Using buttons and selecting them in Interactive learning

I have some buttons which will be used in my bot to answer certain questions? But when I am doing interactive learning I am not able to choose between the buttons so that I can easily build up a story which my bot desires.

I am currently using Facebook as my main dialouge channel but when I choose a button, its not able to catch the correct intent. It can do it right if I have better stories, as it would be easier with interactive learning.

@akelad @abhishakskilrock Can you help you please?

Which version of rasa_core are you using?

@abhishakskilrock I am using rasa_core v0.12.3

I think it should show buttons during interactive learning. Can you show me your actions logs and data you got during interactive learning?

@abhishakskilrock Below are the screenshots for when I am running interactive learning in rasa core

It shows the buttons correctly (ignore the payload for now). But there is no option for selecting any one of them. It directly goes for action_listen. But I want to be able to select any one of them so that I can continue the story.

Here is the actions log

Here is my actions.py code https://pastebin.com/LzAgP6Qw

Here is my train_interactive.py code https://pastebin.com/eNazrdXs

you have to type the payload value after action_listen … See this Using Slots

Hey, You can’t select buttons there you have to type the value(which shows on buttons). It will write stories based on your slots. BTW what do you want it should perform as I can see that you want to perform three actions based on your headache symptom if that’s the situation I think it will be better if you provide symptom slot to categorical whose values are Moderate, Mild, Severe and then make single custom_action rather than three different custom_action where I use if-else check based on slot value and give results based on that slots.

1 Like

@Arunkumar0258 yeah the way “selecting” buttons on the command line works is by copying the payload and sending it. Action_listen just means the bot is waiting for your input, which is correct behaviour

@abhishakskilrock @akelad Thanks for clarifying that. But I another question. Actually three!!

  1. What does the payload actually do? What’s it requirement? I am running the bot in Facebook chat, and when I am selecting a button, I don’t see the payload text as output. It outputs just my selection.

  2. Can I get the value of payload in a variable after I select the button, and use it in my next iteration of action_medicine.

  3. Also, I want to access the text I write in action_listen for intent action_medicine as a variable so that I can use it in actions.py. How to do that?

Please can you help me? Thanks a lot

Hi @Arunkumar0258, I think it will be better if you fetch button from custom_action rather than domain.yml file because you want to set you buttons dynamic(variable) so it will be easy if you use custom_action for calling buttons. I think it will help to answer all of your questions.

@abhishakskilrock I am currently creating dynamic buttons only, not using them from domain.yml. I have created a custom action named action_medicine through which I am dispatching the button for selection. Can you help in getting the text in a variable which triggered that custom action.

Also is it possible to get the value of payload after I select the button?

I think you want to do it something like if fever is a then medicine button is Ma, fever is b medicine button is Mb. If so you can do it by creating a dictionary in config and call it using slots or utter_latest_message() or else if it’s not your problem then can you give me your test case so that I can understand it properly.

@abhishakskilrock

It’s like I ask a question to the bot “I have a headache” The bot responds with : “How strong is your headache?” (from API) and gives three options

  1. Mild
  2. Moderate
  3. Severe

Each of these has a follow-up question when I select them (given by API). I want the follow up question to show as a message. But in Facebook if I select the button Mild, I just get the text Mild written. I want to avoid Mind and write the actual follow-up question for the bot to answer.

Example of follow-up question (if selected Severe): “Do you have any physical injuries or anxiety?” (want this to show up as answer instead of Severe)

@Arunkumar0258 I have suffer the same question, yet, are you solve it? Thanks!

@red-frog If you are asking about selecting buttons for interactive learning in command line. See the comments above by @abhishakskilrock and @akelad

But I haven’t been able to solve my last problem of showing text other than payload in Facebook unfortunately!

But the bot will just respond with “Do you have any physical injuries or anxiety?” to what the user selected. Is that not fine?

Otherwise I think you may want to try quick replies, or a different channel

Is dynamic buttons working for you in custom actions?