if my customer action I would like to check if the user ask question or juste easy statement can you help me on that ?
that my code but it is not working plz help me
class ActionQuestionMark(Action):
def name(self):
return "action_question_mark"
def run(self, dispatcher, tracker, domain):
message = tracker.latest_message.text["text"]
# dispatcher.utter_message("Hello World!")
if message.endswith("?"):
# Return a random question
return dispatcher.utter_message("Question")
else:
return dispatcher.utter_message("statement")
Could you give screenshot of your whole action file and also the method latest_message.text.
I am not that skilled with rasa also but to access the latest message
let’s say data={…} contains the tracker json readings,
You could access the latest message with data[“tracker”][“latest_message”][“text”]
Also, you can run “rasa run actions -vv” to enter debug mode, then you can post your debug log here for us to view.