Bot Responses
If you want your bot to respond to user messages, you need to manage the bots responses. In the training data for your bot, your stories, you specify the actions your bot executes when he encounters the dialogue example. These actions can use utterances to send messages back to the user.
你想要机器人回答你的问题,那么你需要去管理机器人的回答。在你的训练数据故事中,当机器人匹配到了你的对话时,他会按照指定的action去执行,通过该action可以将结果返回给用户。
There are two ways to manage these utterances:
这里有2种方式去控制语言
- include your bot utterances in your domain file or
- use an external service to generate the responses
1.在domain文件中配置话语
2.调用外部接口服务返回话语
Including the utterances in the domain(在domain文件中配置话语)
The default format is, to include the utterances into your domain file. This file then contains references to all your custom actions, available entities, slots and intents.
默认格式是在domain文件中配置话语,这个文件包含了所有自定义action、实体、词槽、意图。
# all hashtags are comments :)
intents:
- greet
- default
- goodbye
- affirm
- thank_you
- change_bank_details
- simple
- hello
- why
- next_intent
entities:
- name
slots:
name:
type: text
templates:
utter_greet:
- "hey there {name}!" # variable will be filled by slot with the same name or by custom code
utter_goodbye:
- "goodbye