By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How can I override the default error handling in Amazon Lex?

3 minute read
0

I want to modify the default error handling of my Amazon Lex bot. How can I do this?

Short description

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.

Resolution

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.

  1. Open the Amazon Lex V1 console, and then choose the bot that you want to configure fallback intent for.
  2. From the Intents section, choose the + sign.
  3. Search for AMAZON.Fallback in the existing intents.
  4. Enter a name for the built-in intent, and then create the intent.
  5. 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

  1. Open the Amazon Lex V2 console, and then choose the bot that you want to configure fallback intent for.
  2. From the Language section, under the specific language that your bot uses, choose intents.
  3. Choose Fallback intent.
  4. 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:

  • Utterances
  • Slots
  • Confirmation prompts

Related information

Configuring fulfillment progress updates

Using an AWS Lambda function

AMAZON.FallbackIntent

AWS OFFICIAL
AWS OFFICIALUpdated 3 years ago