Wrong intent was trigger by payload of button

Hi,I’m using two TwoStageFallbackPolicy and I follow the blog to custom my ActionDefaultAskAffirmation . It says that " Use ‘/<intent_name>’ as payload to directly trigger ‘<intent_name>’ when the button is click".However , when I click the button with the intent “game_query_rating” the robot receive another intent “game_query_video”.

When I use rasa shell in debug mode, I get these information. Though I choose the item with intent “game_query_rating”,however,the processor receives message with intent “game_query_video”…

My domain file is domain.yml (2.6 KB) My action.py is actions.py (9.7 KB) My config is config.yml (522 Bytes)

really hope someone can help ,thanks!

mmhh… what Rasa version are you using?

I use rasa-1.2.9 I rewrote my ActionDefaultAskAffirmation class to a simple version and It works 1 below is the original codes that cause the problem

Ok, so that indicates that there is something wrong in your code.

When you append the buttons, you are using intent[1] + entities_text for the title and intent[0] + entities_json for the payload. What is intent[0] and intent[1] in this case? Are there the same?

intent[1] is the mapping result. I map the intent ‘query_game_size’ to '我想知道游戏的大小‘ and intent[0] is the orignal intent which is ‘query_game_size’ . I print the buttons on the terminal

@Tanja Hi,I think I found the reason.In my original code,an item of button will be a dict like

{'title': "我想知道游戏的下载地址 ('name': '太吾绘卷')", 'payload': '/game_query_url{"name": "太吾绘卷"}'}

will be turn to string like:

我想知道游戏的下载地址 ('name': '太吾绘卷') (/game_query_url{"name": "太吾绘卷"})

and it extract intent by the code:

response.find("(") + 1 : response.find(")")

so it will extract " (‘name’: ‘太吾绘卷’)" rather than “/game_query_url{“name”: “太吾绘卷”}” :rofl::rofl::rofl:

That is to say, the button’s title cannot contain brackets :triumph: