Rasa Button Payload and User Response

Hello Rasa Community,

I apologize if this was posted before…

I am extremely new to chat bots and I am currently trying to program one that mimics a barista at a coffee shop. So I have an utterance with a button: utter_help_customer:

  • buttons:
    • title: Coffee payload: ‘/drink{“drink”: “Coffee”}’

I already have an intent:

intent:drink

  • coffee please … and other variations of this phrase

intent:drink{“drink”:“Coffee”}

  • coffee please … and other variations of this phrase

So, in Rasa X, when I clicked the button for coffee, it came back as: /drink{“drink”: “Coffee”}

I am looking for “Coffee please” or one of the variations in my intents.

Hopefully I am making sense here. Again, I apologize for asking really stupid questions here.

2 Likes

Hello @Eli,

Welcome to the forum, your question is absolutely fine, no worry :smiley:

In Rasa X, when you clicked the button it displayed the payload because that the intented behavior. “/drink” meant that the intent drink is provoke and “{drink: Coffee}” mean the slot drink is assigned the value “Coffee”. That’s the exact flow of actions if an user said “coffee please”. But because the user didn’t type a message, but click on the button, therefore the payload got executed without needing to predict user’s message, and Rasa X print that payload out.

If you build a custom UI, then you can control how the user’s message is displayed when they click on the button. Rasa X is simply designed to do it that way (from what i know).

3 Likes

Thank you so much for the response. I am wondering how I could get the user response to just show Coffee when the button is pressed rather than the actual slot. Does a custom action need to be in place for this?

1 Like

@Eli You can, but not with Rasa X. It’s the UI problem, not Rasa. The Rasa X UI is designed to print out the payload when the user click on the button (I guess for debugging purpose). If you build a custom UI, then you totally control how the user message get displayed, for example print out the title “Coffee” of the button instead of the payload. Right now by using Rasa X, you are using a prebuild UI and you can not change how the devs intended it to work.

2 Likes

Thank you so much for explaining the issue to me. Would you know if any guide for developing that UI? I am still very new to Rasa and am absolutely at a loss at what to ask on Google to obtain the right guidance.

Again, I am very, very grateful for your patience with me!

1 Like

hey @Eli, check out this, I have built the custom UI,

5 Likes

Hey, I wanted to know why I cant send the custom payload as a key inside the first message instead of it being a entirely different object?

When I use buttons it goes in well - [{‘recipient_id’: ‘test_real_194’, ‘text’: ‘Hey there’, ‘buttons’:[{‘quick_replies’: {‘title’: [‘Show me your functions’], ‘type’: [‘text’]}}]}]

But when using custom payload it becomes a different object altogether - [{‘recipient_id’: ‘test_real_194’, ‘text’: ‘Hey there’}, {‘recipient_id’: ‘test_real_194’, ‘custom’: {‘quick_replies’: {‘title’: [‘Show me your functions’], ‘type’: [‘text’]}}}]

Thanks in advance!

can somebody please tell how to add payload buttons in action file. when i tried to upload it shows a series of error. but when i tried to add payload button on my doamin file, i was able to get ,not on my action file.some one please help. i am a starter on rasa.

This doesn’t support markdown. Is there a way to present URL to the user?

1 Like

@Pritesh you can send response as shown below for rendering it as a hyperlink:

 text: <a href='url'>Some Text</a>
2 Likes

Thanks Jitesh.

1 Like