Hi , i’m a little confused in terms of what the payloads of buttons should look like , like this Domains or like this Slots , i’m wondering if it’s
possible to set a slot using buttons without the /intent{entities} format in the payloads ? so i want the payloads to be normal texts and clicking them results in setting the slot . What am i missing ?
Buttons are just smaller, more concise bits of information that you can send to your RASA server from your UI. They’re made of 2 parts: the text is what the user should see in the actual text of the button itself. The payload is what exactly is sent to RASA when you click on the button. For most UIs, there’s no real internal distinction between text sent via clicking on a button or by typing it in.
So why do we use payloads? Because they allow you to fire intents directly. For example, if your bot is asking a question with Yes/No buttons, their payloads could be directly defined as their respective intents (such as intent_agree and intent_deny).
RASA matches direct intent commands (as opposed to user input text that should get processed INTO an intent) when they are prefaced with a forward slash (/). That’s why you see payloads looking like
Thank you @ActuallyAcey for the quick response , i really appreciate it . I got what you meant in your reply , but isn’t it unpleasant for the client’s side to click a button and see the payload /intent{entities} showing up in his chat ?
edit :
Hi @akelad , i know , this is on me , i’m failing to comprehend how things work out fine . I just want to know that if it’s possible to set a slot using the format /intent{entity} but at the same time not returning the payload in the chat but the text/title of the button , do you see what i mean ?
But this implies that the user clicking on one of the buttons to return /choose_potential{“potential”: “Fort/Moyen/Faible”} in his chat , how do we avoid this ?(correct me if i’m wrong)
I want to avoid this :
I want the title to appear not the payload after the click…
this is just the way it looks like in Rasa X, how this will look to your end users depends entirely on the platform you run it on later. For example on Facebook Messenger, the button text will show up as the user message, rather than the payload
Hi again , long time no see @akelad , i’ve actually been working on an application in Flutter and it’s been so fun so far . So what i’m doing right now is running rasa server and rasa actions server locally in LAN , and the flutter app talks to rasa via the rest channel using this :
The exchange between rasa and the user is working as intended but i stumbled upon an issue when the json response being containing the buttons attribute (e.g “buttons” : [{“payload”: … , “title”:…},{},{} and so on]) , i created buttons widgets in case the response contains buttons like this :
And now i’m wondering on how to proceed when it comes to what to post to rasa server when the buttons are clicked , i had the idea to create a future like this :
But right now i have no clue on how to retrieve the sender_id of a user in a perimeter that is outside of rasa , honestly i have no idea how the sender_id is handled in rasa , is it generated randomly ? what i do know is that we can retrieve it via the tracker in rasa but how do i use it outside of rasa ?
Hi @pandaxar not sure if you’ve already figured this out, but the sender_id in this situation is actually the sender you set in your request to the /webhooks/rest/webhook call. So in the case of the rest channel, setting the sender ID is up to you.
Why codes as below (exactly the same situation like mentioned before in this post) have the Errors. It doesn’t make sense to me.
utter_ask_feedback_button:
- buttons:
- payload: /feedback_button{"feedback_value":"positive"}
title: 👍
- payload: /feedback_button{"feedback_value":"negative"}
title: 👎
text: Do you like it?
However, in Rasa 2, I got the warnings:
2020-11-12 21:44:02 ERROR rasa.core.nlg.interpolator - Failed to fill utterance template '/feedback_button{"feedback_value":"positive"}'. Tried to replace '"feedback_value":"positive"' 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 template. Return template without filling the template.
Traceback (most recent call last):
File "/home/sz/py36-bert110-grakn181-rasa203/lib/python3.7/site-packages/rasa/core/nlg/interpolator.py", line 28, in interpolate_text
text = text.format(values)
KeyError: '"feedback_value":"positive"'
2020-11-12 21:44:02 ERROR rasa.core.nlg.interpolator - Failed to fill utterance template '/feedback_button{"feedback_value":"negative"}'. Tried to replace '"feedback_value":"negative"' 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 template. Return template without filling the template.
Traceback (most recent call last):
File "/home/sz/py36-bert110-grakn181-rasa203/lib/python3.7/site-packages/rasa/core/nlg/interpolator.py", line 28, in interpolate_text
text = text.format(values)
KeyError: '"feedback_value":"negative"'