简体   繁体   中英

How cann I trigger second intent after fulfilment of the first intent?

I am creating a food order taking chatbot in 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.

The exact return format depends on what version of Lex you're using. Lex V1 and Lex V2 have different return formats.

There's 2 dialogAction types that will bring you to a new intent: elicitIntent and elicitSlot .

The AWS docs say: elicitIntent - the next action is to determine the intent that the user wants to fulfill. I haven't used it in Lex V2 but in Lex V1, it doesn't always work the way I want to chain intents. 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.

In Lex V1, you'll need to include something like this in your return body:

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.

If you have found a way to use elicitIntent for this purpose, please let me know. My understanding of it might've been incorrect so I'd appreciate the info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM