Home > front end >  Animation when we click on a button created in RASA (actions.py file)
Animation when we click on a button created in RASA (actions.py file)

Time:11-03

Is there any way where we can add animation on a specific button click in RASA. The buttons are created in actions.py file of RASA chatbot.

CodePudding user response:

You'd need to have a custom frontend in order to do that. The code for the actual visual component of the chat doesn't come from Rasa (though it integrates with a few via connectors), so you can connect it to your own chat widget with animations on the buttons.

CodePudding user response:

You can do this in custom actions. I believe you need to fetch that data from your DB. When the user asks give me mobile no. xx, first you need to capture the name of that person in a slot.

Then in your custom actions make your API call to the DB or however you want to fetch the user details. Use:

# Fetch the data and store in the format used by buttons.
buttons = [{"title": "Shakir Sadiq", "payload": "/intent_name"}, {"title": "Shakir Sadiq", "payload": "/intent_name"}]
dispatcher.utter_button_message("There are 2 people with the name Shakir:", buttons)
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

Once the user selects a button again trigger custom actions and fetch his details.

  • Related