Rich response-buttons passing entities does not work

Helloenopsbot.zip|attachment (4.8 KB)

I generate a new project which want to use buttons passing entities. But after training the bot did not act according to the story I defined.

According to the rasa docs, the button payload should be writen in this format: payload: '/inform{{“insurance”:“motor”}}'

We must use ‘/’ after ‘payload:’ and before intent name. Right? The strange thing is that the dialogue will not follow the story in this writing. And when I delete the ‘/’ it works well. I dubuged the rasa source code under these two domain configurations. I debuged rasa/core/policies/memoization.py predict_action_probabilities function. In with ‘/’ condition, the last state in the figure attached has an addtional entities, this due to predicted_action_name = self.recall(states, tracker, domain) to be None. So the dialogue was stopped after processing this intent. No utter_ action was trigged. The self.recall return None. In without ‘/’ condition, the self.recall return correct action name. I attached the project files. You may run this project to find out the problem. Maybe a bug. The rasa version: Rasa Version : 2.8.1 Minimum Compatible Version: 2.8.0 Rasa SDK Version : 2.8.1 Rasa X Version : 0.39.3 Python Version : 3.8.12 Operating System : Linux-3.10.0-1160.42.2.el7.x86_64-x86_64-with-glibc2.17 Python Path : /root/anaconda3/envs/rasa3/bin/python

@atptour can you please format the code? or shared some related file with us.

Please: git clone https://github.com/atptour2017/opsbot.git

I attached the zip file in the origin topic, but it seems that we can not download file from this forum. Thanks!

@atptour you need to upload every files respectively to the forum, give me some time and I will dry run the code.

@atptour I have seen your syntax of domain.yml please change this

 utter_mt_no_media:
  - text: "you select mt no media, please select media type"
    buttons:
    - payload: /get_media_type{"media_type":"video"}
      title: video
    - payload: /get_media_type{"media_type":"audio"}
      title: audio

I hope this will help you?

I attach four figures in this text with Figure 1 2 3 4 order. (I am not familiar with this forum, maybe the forum will change the order to show, please pay attention.)

It seems that the main change is changing {{}} to {}. I changed domain according to your suggestion, but it doesn’t work and triggered some errors. See Figure 1.

See the Figure2. In rasa official doc, the format of passing entities is to use {{}}.figure2

With my origin domain.yaml the running result is show in Figure 3. After selecting media type there is no utter message triggered. I make an addtional input then the utter is triggered. It does not work according to my story.

When I delete ‘/’ in domain basing on my original domain.yml, the running result is show in Figure 4. The utter is trigged immediately after I select a media type. That’s what I want.

So how can we realize the result in Figure 4 but with the format described in rasa doc? It seems to be a conflict. Is the rasa doc wrong or just a bug of rasa source code? That’s my question.

please share the stories.yml file please.

The story.yml was in the zip file of github repository: https://github.com/atptour2017/opsbot.git. I have shown this url in the message above.

I also attach the file content here:

version: “2.0”

stories:

  • story: no media path steps:

    • intent: get_enter
    • action: utter_get_enter
    • intent: mt_no_media
    • action: utter_mt_no_media
    • intent: get_media_type
    • action: utter_get_media_type
    • action: conf_e164_form
    • active_loop: conf_e164_form
    • active_loop: null
    • action: utter_slots_values
  • story: no vmp path steps:

    • intent: get_enter
    • action: utter_get_enter
    • intent: mt_no_vmp
    • action: utter_mt_no_vmp