简体   繁体   English

如何在实现第一个意图后触发第二个意图?

[英]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类型可以为您带来新的意图: elicitIntentelicitSlot

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.

相关问题 我如何获得在 DialogFlow 上调用我的 fulfillment 的意图? - How do I get my intent to call my fulfilment on DialogFlow? 如何在 Dialogflow V1 中触发不同的 Intent - How to Trigger a Different Intent in Dialogflow V1 Dialogflow ES - 我无法创建意图(只有后备意图) - Dialogflow ES - I can't create Intent (only fallback intent) 如何从 lambda (nodejs) 中的另一个意图调用一个意图 - How to call one intent from another intent in lambda (nodejs) 如何将后续意图上传到另一个父意图 - How to upload follow-up intent to another parent intent 我想在开始新意图时破坏活动 - I want to destroy activities on starting a new intent 如何问“这有用吗?” 在呈现来自 Intent 的响应后对话结束时在 DialogFlow 中 - How to ask "Was this helpful?" in DialogFlow at the end of conversation after rendering the response from Intent 如何通过对话流中的代码创建意图? - How to create the intent via code in dialogflow? 如何使用其 API 在 Dialogflow CX 中向意图添加新的训练短语? - How can I add new training phrases to an intent in Dialogflow CX using its API? 如何在 LexV2 的 Intent 中为插槽值定义插槽优先级 - How can I define Slot Priority for Slot Values in an Intent in LexV2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM