[英]How cann I trigger second intent after fulfilment of the first intent?
I am creating a food order taking chatbot in lex.我正在 lex 中创建一个接受聊天机器人的食品订单。 After my first intent of taking veg starters is over, I want the bot to ask for order of non-veg starters automatically.
在我第一次吃蔬菜开胃菜的意图结束后,我希望机器人自动要求订购非蔬菜开胃菜。 I looked for online documentation, what I understand is that I have to use elicitintent but I don't know how.
我查找了在线文档,据我了解我必须使用 elicitintent 但我不知道如何使用。
The exact return format depends on what version of Lex you're using.确切的返回格式取决于您使用的 Lex 版本。 Lex V1 and Lex V2 have different return formats.
Lex V1 和 Lex V2 具有不同的返回格式。
There's 2 dialogAction
types that will bring you to a new intent: elicitIntent
and elicitSlot
.有 2 种
dialogAction
类型可以为您带来新的意图: elicitIntent
和elicitSlot
。
The AWS docs say: elicitIntent
- the next action is to determine the intent that the user wants to fulfill. AWS 文档说:
elicitIntent
- 下一步是确定用户想要实现的意图。 I haven't used it in Lex V2 but in Lex V1, it doesn't always work the way I want to chain intents.我没有在 Lex V2 中使用它,但在 Lex V1 中,它并不总是按照我想要链接意图的方式工作。 In my experience, it listens to the user's next input and infers the intent from this.
根据我的经验,它会监听用户的下一个输入并从中推断出意图。 This doesn't really help if you want to chain a specific intent like in your case.
如果您想像您的情况一样链接特定意图,这并没有多大帮助。
You can use elicitSlot
to trigger your next intent.您可以使用
elicitSlot
来触发您的下一个意图。
In Lex V1, you'll need to include something like this in your return body:在 Lex V1 中,您需要在返回正文中包含如下内容:
dialogAction: {
type: 'ElicitSlot',
intentName: intentName, // Name of intent to be invoked
slotToElicit: slotName // Name of the slot you want to invoke in the intent
}
The return format is a little different in V2 but I believe the process is nearly the same. V2 中的返回格式略有不同,但我相信过程几乎相同。
If you have found a way to use elicitIntent
for this purpose, please let me know.如果您找到了为此目的使用
elicitIntent
的方法,请告诉我。 My understanding of it might've been incorrect so I'd appreciate the info.我对它的理解可能不正确,所以我很感激这些信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.