I’m trying out buttons for the first time, so it’s quite possible I’m doing something wrong.
This is the button code I have:
- text: "Are you trying to get access to a Shared Drive, Security Group or neither?"
buttons:
- title: "Shared Drive"
payload: '/s10_choice_shared_drive{"s10_verify_problem": "Shared Drive"}'
- title: "Security Group"
payload: '/s10_choice_security_group{"s10_verify_problem": "Security Group"}'
- title: "Neither"
payload: '/s10_choice_neither{"s10_verify_problem": "Neither"}'
When these buttons are displayed, I click one, but the intent doesn’t fire, and the slot is not filled, the entire payload ends up as the response, in both rasa shell and in my web chat like this:
Rasa shell
Here it asked me and I clicked on the Shared Drive button and the whole payload is there as if I typed all that in
Are you trying to get access to a Shared Drive, Security Group or neither? 1: Shared Drive (/s10_choice_shared_drive{"s10_verify_problem": "Shared Drive"})
Web Chat Screenshot (sorry for the horrible css style, like I said this is the first time I’ve implemented them so I haven’t tried changing the style yet haha)
As you can see, the entire payload is displayed as if I typed it all instead of clicked a button.
My action detects “Shared Drive” / “Security Group” with an else for any other response, so the if statement drops out of the other questions in the form.
Am I missing some tiny detail? it looks like it is setup right.
Is this a custom chat client? Or how is it that you’re displaying the conversation history (it looks like you’re using a connection to your tracker store to render the chat)?
It seems like you might just need to suppress displaying that message that’s being sent on behalf of the user and instead provide some visual cue that the button was clicked. If you’re connecting directly to the tracker store to get the conversation history, you could probably just filter out any message that starts with /.
Normally, when I handle buttons, I display the title of the clicked button as an user’s message in the chat UI. So in this case, if you click “Shared Drive” it will display “Shared Drive” as an user’s message, but I still send the payload to the Rasa server for consistency. Of course you can only do this if you are using your own custom chat UI or you are able to modify it.
It’s hard to identify what’s wrong only from this, do you have any logs of the Rasa server ?
utter_s10_choice_shared_drive:
- text: "In order to help you with your shared drive issue, I have to ask you some questions"
utter_s10_choice_security_group:
- text: "In order to help you with your security group issue, I have to ask you some questions"
utter_s10_choice_neither:
- text: "Is there another problem?"
I’m guessing since I am not seeing those utterances, the payloads are not grabbing the intents properly.
For fun I removed the slot filling portion for the buttons -
utter_ask_s10_verify_problem:
- text: "Are you trying to get access to a Shared Drive, Security Group or neither?"
buttons:
- title: "Shared Drive"
payload: '/s10_choice_shared_drive'
- title: "Security Group"
payload: '/s10_choice_security_group'
- title: "Neither"
payload: '/s10_choice_neither'