Hello My friend and I are trying to built a bot, using the Rasa platform, for the first time! We are trying to add a button, but we got stuck… We don’t know where we need to add the necessary ‘things’, to make the button work… We started by creating a button in the Domain file under the right template… But in the payload part, we got a little bit confused… Can someone help us understand how to continue? if this isn’t clear enough we can give more info!
So buttons are used to give suggestions or possibly give the next set of actions which the user might ask while in conversation.
Here is an example:
templates: utter_greet: - text: "Hey! How can I help you?" buttons: - title: "What can you do?" payload: '/bot_functions' - text: "Hello! What can I do for you?" buttons: - title: "What can you do?" payload: '/bot_functions' - text: "Hi! What's up?" buttons: - title: "What can you do?" payload: '/bot_functions' - text: "Hey! How are you doing today?"
Here the utter_greet is the action taken by the bot under, for example, the greet intent.
When the user says “Hey” the bot will respond with “Hey! How can I help you?”. These buttons would be sent along with the responses. So the “What can you do?” will be a text suggestion, but the intent /bot_functions will be sent to your bot when the user selects this option. So the
/bot_function is the intent and you’re bypassing the interpreter and directly send the intent to the bot.
Here is a link to the docs: buttons
It is necessary or optional to use quotes
"" while writing
Quotes are not required, just normal text. I’ve never tried adding quotes though. Are you asking about the content of text, title, payload or the ‘text’, ‘title’, ‘payload’?
Yes, I was asking about content only
So I just tried it out without the quotes, and it works. Seems like the quotes are optional after-all.