RASA and Conversational Flow with Buttons

Hello RASA Community,

I’m currently working on the design of our chatbot and a few questions regarding the handling of buttons came up, which I would like to discuss here. Maybe the thread will help one or the other. Namely, my consideration is to control most of the conversation/responses of the users via buttons, as this has the advantage that the intent is reliably recognized and the user talks about things the chatbot has been trained to do. Here are my questions:

  1. Can I implement it so that the payload of each button has the /intent_value as its payload? Accordingly, I assume that the NLU would then skip the evaluation and simply predict the intent, is that correct?
  2. If the answer format for a question is a button, is training still needed for the chatbot to know which intent is meant? Or can I also use this to reduce the training and thus the size of the model?
  3. If only buttons are allowed in the whole conversation “menu bot”, would RASA be a good choice at all or should I use a framework that doesn’t use training at all to keep it slim?
  4. Is it somehow possible to disable the free response format, i.e. the text field where responses are entered, so that the user is “forced” to respond with a button?

I look really forward to hear your answers and appreciate every input! Thank you!

Hello @LindaA !

One questions to you first, I hope you don’t mind. Do you have any front end in mind for the chatbot ?

Thanks.

1 Like

Sure, I don’t mind, thanks for asking! We plan to integrate the chatbot in our flutter app, so the front end will be a chat UI within a mobile app. I assume your question relates to my question 4? I would also love to know whether this would be possible in a web chat.

@LindaA Honestly, my question is in the context of all 4 points :slight_smile: Thanks for sharing that your front end is a flutter app ( it’s developed?). I never worked with Flutter App, but I can suggest some points.

@LindaA

  • Can I implement it so that the payload of each button has the /intent_value as its payload? Accordingly, I assume that the NLU would then skip the evaluation and simply predict the intent, is that correct?

Yes, you can mention the intent, for example:

responses:
  utter_greet:
  - text: "Hey! How are you?"
    buttons:
    - title: "great"
      payload: "/mood_great"
    - title: "super sad"
      payload: "/mood_sad"

And you need to write the story for the same.

  • If the answer format for a question is a button, is training still needed for the chatbot to know which intent is meant? Or can I also use this to reduce the training and thus the size of the model?

Yes, you need to train the bot, as intent will be trigger based on story and conversation flow.

  • If only buttons are allowed in the whole conversation “menu bot”, would RASA be a good choice at all or should I use a framework that doesn’t use training at all to keep it slim?

Well, that depends on your requirement and use-case. Normally, we consider both Text and Button approach, other wise user is bound to answer based on buttons.

  • Is it somehow possible to disable the free response format, i.e. the text field where responses are entered, so that the user is “forced” to respond with a button?

Yes, you can do it but its much depends on your front end.

I hope this will help you.

1 Like

I thank you so much! … I agree on that a combination of buttons and text is great. If however someone only wants to use buttons, then RASA would be an overload?

And I deeply hope you don’t mind if I ask you another question: Could you show me how to set buttons into forms. So that when a button ist pressed the slot is filled with the value of the button. It worked fine for me in RASA 2.0 but I do not find any good example in which buttons are used within forms. Thank you so much!

@LindaA

I don’t think so, it much overload.

@LindaA Can you please see this blog post: How to Build Your First Rasa Form | The Rasa Blog | Rasa

Please see the concept of button, slots, from_intent using Form (Rasa 2.X).

Good Luck!

Dear Nik,

I followed your advice and looked at your suggested example and did it exactly as it is described there however, I get always an error response and I really think that is because of the very different structure of Rasa 3.0. So do you maybe also know of a working example with buttons in forms for Rasa 3.0 and not Rasa 2.0? That would be fantastic!

Many thanks, Linda

This is my current error message:

 Failed to replace placeholders in response '/inform{"wellbeing": "high"}'. Tried to replace '"wellbeing": "high"' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the response. Return response without filling the response. ```

@LindaA Hello Linda,

Yes, the example which I shared with you is in 2.x but If you are aware of 3.x now, there are only a few changes I guess. I still didn’t get any chance to explore much on rasa 3 as I was busy with my work recently and now got some free time, so yes I will explore more about your use-case or even keep in mind any example I encountered.

Can you share the error screenshot with full traceback? or if you can share code files that will be great.

Do you have entity wellbeing defined or did you define the value “high” in slots? Ref: Responses

Thanks, Nim

Any updates on this question? I want to use buttons as well as part of the flow.

@lucas144 what is your question huh?

Sorry @nik202. I wanted to know how can I feed the dispatcher with a list of buttons from a Custom Action.

@lucas144 I guess you looking for something like this?


   button_resp=[
                  {
                      "title": "great",
                      "payload": "great"
                  },
                  {
                      "title": "super sad",
                      "payload": "super sad"
                  }
              ]

   dispatcher.utter_message(text="Hey! How are you?", buttons=button_resp)

Thank you so much @nik202 , it worked like a charm :slight_smile:

@nik202 can I call a Custom Action using the payload of the button? Or does that need to be always an “intent”

Thanks.

Not get you on this?

What I wanted to know is if the content inside “payload” does always need to reference a specific intent.

@lucas144 yes, you need to create the intent and even mentioned that in domain and stories or rules. Please Ref the doc for more information.

Yes, that’s what I thought. Is there a way to have intents without any “text” associated with them? The objective would be to call them from the buttons in order to trigger specific actions only, but no need to recognize them from the NLU.

1 Like