- Newest
- Most votes
- Most comments
To hook the FallbackIntent to your Lambda function in Amazon Lex V2, you need to configure it specifically for the fallback intent. The process is slightly different from hooking custom intents.
For the FallbackIntent, you need to set the fulfillmentCodeHook parameter when creating or updating the intent. This is typically done through the CreateIntent or UpdateIntent API operations, or through the AWS Management Console.
In the console:
- Navigate to your bot and select the FallbackIntent.
- In the "Fulfillment" section, choose "AWS Lambda function" as the fulfillment method.
- Select the Lambda function you want to use.
- Save and build your bot.
If you're using the AWS SDK or CLI, you would need to include the fulfillmentCodeHook parameter in your CreateIntent or UpdateIntent call for the FallbackIntent.
It's important to note that the FallbackIntent behaves differently from custom intents. It doesn't have utterances, slots, or a confirmation prompt. When invoked, it will either return intent information to the client application or call the specified Lambda function, depending on how you've configured the fulfillmentCodeHook.
Your Lambda function can use this opportunity to handle unrecognized inputs, perhaps by prompting the user for clarification, redirecting to a different intent, or providing a helpful message. You can also use session variables in your Lambda function to keep track of how many times the FallbackIntent has been invoked in a session, allowing you to implement more complex fallback strategies.
Remember to rebuild and redeploy your bot after making these changes for them to take effect.
Sources
AMAZON.FallbackIntent - Amazon Lex
AMAZON.FallbackIntent - Amazon Lex V1
answered 2 years ago
This doesn't make sense to me because it's not possible to use CreateIntent for the FallbackIntent - it's a builtin. Maybe I have to try UpdateIntent using the FallbackIntent intent ID?
answered 2 years ago
Relevant content
asked 2 years ago
asked 4 years ago
- AWS OFFICIALUpdated 4 years ago
