I want to modify the default error handling of my Amazon Lex bot. How can I do this?
Amazon Lex offers default error handling in the form of predefined prompts. But by using the fallback intent, you can get a greater level of control over how your bot reacts to situations where user input isn't matched. You can use the fallback intent to manage the conversation flow, use business logic, or handover your bot conversations to a human agent. You can also design the fallback intent to trigger an AWS Lambda function, and provide responses.
Configure fallback intent using the Amazon Lex V1 console
Note: If you want to switch from the Amazon Lex V2 console to the Amazon Lex V1 console, from the navigation pane, choose Return to V1 console.
- Open the Amazon Lex V1 console, and then choose the bot that you want to configure fallback intent for.
- From the Intents section, choose the + sign.
- Search for AMAZON.Fallback in the existing intents.
- Enter a name for the built-in intent, and then create the intent.
- Optionally, you can add a Lambda function in the fulfillment code hook of the newly created fallback intent. This triggers the Lambda function when the fallback intent is fulfilled.
Note: You can add a fallback intent by adding the built-in AMAZON.Fallback intent type to your bot using the console. You can also specify the intent using the PutBot operation or choose the intent from the list of built-in intents in the console.
Configure fallback intent using the Amazon Lex V2 console
- Open the Amazon Lex V2 console, and then choose the bot that you want to configure fallback intent for.
- From the Language section, under the specific language that your bot uses, choose intents.
- Choose Fallback intent.
- Optionally, enable a Lambda function for fulfillment using the advanced options for fulfillment. To use a specific Lambda function, attach the function to your bot alias. The same Lambda function is used for all intents in a language supported by the bot.
Note: The built-in AMAZON.Fallback intent type is added to your bot automatically when you create a bot using the console. If you use the API, then specify the intent using the CreateBot operation.
You can't add these items to a fallback intent:
- Confirmation prompts
Configuring fulfillment progress updates
Using an AWS Lambda function