当聊天机器人呈现两个按钮供用户选择时,就会出现问题,一个用于“astreinte”,另一个用于“support”。 用户选择这些选项之一后,聊天机器人应相应地从 CSV 文件中提取信息。 但是,当用户选择“astreinte”或“support”时会发生错误:
“用户警告:无法解析行 '/choose_topic{"topic": "astreinte"}' 中的参数。期望来自 [] 的实体,但找到了 {'topic'}。在没有未知实体类型的情况下继续。"
文件nly.yml:
- intent: choose_topic
examples: |
- '/choose_topic{"topic": "astreinte"}'
- '/choose_topic{"topic": "support"}'
文件domain.yml:
utter_greet_with_options:
- text: "Bonjour, voulez-vous avoir des informations sur l'astreinte ou le support ?"
buttons:
- title: "astreinte"
payload: '/choose_topic{"topic": "astreinte"}'
- title: "support"
payload: '/choose_topic{"topic": "support"}'
我需要做什么来修复这个错误?
utter_greet_with_options:
- text: "Bonjour, voulez-vous avoir des informations sur l'astreinte ou le support ?"
buttons:
- title: "astreinte"
payload: /choose_topic{{"topic": "astreinte"}}
- title: "support"
payload: /choose_topic{{"topic": "support"}}
这是按钮的正确格式。
此语法告诉 rasa 当前消息具有意图
choose_topic
并且具有实体 topic
,其值 astrinte
/ support
。choose_topic
的 nlu 训练数据是没有必要的。