Hello, this is a general Python question unrelated to Rasa. I’d suggest using Stack Overflow for that
But, here’s your answer: Simply use .lower()
with parenthesis since it is a method, not a property.
While that is true for text processing, this is regular Python code inside a Custom Action. The ==
operator considers if a letter is lowercase or uppercase.
Even in the case that tracker.get_slot()
always returns a lowercase string, it is best practice to use .lower()
(or .upper()
, .title()
, etc.) on both sides of the operator: x.lower() == y.lower()
- Unless the case is important of course
But maybe country.lower() == "america".lower()
is too much