Utter_button_message on basic rasa example not working

Hi there,

I’ve been trying to use dispatcher.utter_button_message in a project of mine and I couldn’t quite figure it out. So I tried it on the basic rasa example (rasa init) and it still didn’t work. Maybe someone can figure out what I’m doing wrong here.

  1. I used rasa init to create a new project.

  2. I added a custom action “action_button”

    class ActionHelloWorld(Action):

    def name(self): return “action_button”

    def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]):

     buttons = [{"title": "Button 1", "payload": "/goodbye"},
                {"title": "Button 2", "payload": "/goodbye"}]
     dispatcher.utter_button_message("Here are two buttons:", buttons)
    
     return []
    
  3. I have the action triggered by the greet intent:

intents:

  • greet: triggers: action_button
  1. I added the action to my stories:

happy path

  • greet
    • action_button
    • utter_greet
  • mood_great
    • utter_happy

I know the action is being triggered (printing), but the buttons do not appear - I’m using “rasa shell” to test my bot.

Hope someone can help me out with this.

Thank you!

I have tried your action in my action file and it worked totally fine. I have faced same kind of issue when using formaction. Check this out

But with custom actions it did not cause any issues so far. May be you should try restart action server again using rasa run actions --actions actions command and you can also refer the logs to find out what is happening inside. In case if you need to get the log file use rasa shell --log-file out.log --debug.

Hi Durashi,

thanks for your reply.

If my action worked for you, then I’ll definitely have to check my logs. Thanks for checking it out.

Best, Deniz

Happy to help, deniz :slightly_smiling_face: