

End of support notice: On September 15, 2025, AWS will discontinue support for Amazon Lex V1. After September 15, 2025, you will no longer be able to access the Amazon Lex V1 console or Amazon Lex V1 resources. If you are using Amazon Lex V2, refer to the [Amazon Lex V2 guide](https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html) instead. . 

# Step 2: Create a Bot
<a name="gs2-create-bot"></a>

In this step, you create a bot to handle pizza orders. 

**Topics**
+ [Create the Bot](gs2-create-bot-create.md)
+ [Create an Intent](gs2-create-bot-intent.md)
+ [Create Slot Types](gs2-create-bot-slot-types.md)
+ [Configure the Intent](gs2-create-bot-configure-intent.md)
+ [Configure the Bot](gs2-create-bot-configure-bot.md)

# Create the Bot
<a name="gs2-create-bot-create"></a>

Create the `PizzaOrderingBot` bot with the minimum information needed. You add an intent, an action that the user wants to perform, for the bot later.

**To create the bot**

1. Sign in to the AWS Management Console and open the Amazon Lex console at [https://console.aws.amazon.com/lex/](https://console.aws.amazon.com/lex/).

1. Create a bot.

   1. If you are creating your first bot, choose **Get Started**. Otherwise, choose **Bots**, and then choose **Create**. 

   1. On the **Create your Lex bot** page, choose **Custom bot** and provide the following information:
      + **Bot name**: PizzaOrderingBot 
      + **Language**: Choose the language and locale for your bot.
      + **Output voice**: Salli 
      + **Session timeout **: 5 minutes.
      + **COPPA**: Choose the appropriate response.
      + **User utterance storage: Choose the appropriate response.**

   1. Choose **Create**. 

      The console sends Amazon Lex a request to create a new bot. Amazon Lex sets the bot version to `$LATEST`. After creating the bot, Amazon Lex shows the bot **Editor** tab, as in the following image:  
![\[\]](http://docs.aws.amazon.com/lex/latest/dg/images/gs1-20.png)
      + The bot version, **Latest**, appears next to the bot name in the console. New Amazon Lex resources have `$LATEST` as the version. For more information, see [Versioning and Aliases](versioning-aliases.md).
      + Because you haven't created any intents or slots types, none are listed. 
      + **Build** and **Publish** are bot-level activities. After you configure the entire bot, you'll learn more about these activities.

## Next Step
<a name="gs2-next-step-intent"></a>

[Create an Intent](gs2-create-bot-intent.md)

# Create an Intent
<a name="gs2-create-bot-intent"></a>

Now, create the `OrderPizza` intent , an action that the user wants to perform, with the minimum information needed. You add slot types for the intent and then configure the intent later.

**To create an intent**

1. In the Amazon Lex console, choose the plus sign (\$1) next to **Intents**, and then choose **Create new intent**.

1. In the **Create intent** dialog box, type the name of the intent (`OrderPizza`), and then choose **Add**.

The console sends a request to Amazon Lex to create the `OrderPizza` intent. In this example you create slots for the intent after you create slot types.

## Next Step
<a name="gs2-next-step-slot-types"></a>

[Create Slot Types](gs2-create-bot-slot-types.md)

# Create Slot Types
<a name="gs2-create-bot-slot-types"></a>

Create the slot types, or parameter values, that the `OrderPizza` intent uses.

**To create slot types**

1. <a name="slotTypeStart"></a>In the left menu, choose the plus sign (\$1) next to **Slot types**.

1. In the **Add slot type** dialog box, add the following: 
   + **Slot type name** – Crusts
   + **Description** – Available crusts
   + Choose **Restrict to Slot values and Synonyms**
   + **Value** – Type **thick**. Press tab and in the **Synonym** field type **stuffed**. Choose the plus sign (\$1). Type **thin** and then choose the plus sign (\$1) again.

   The dialog should look like the following image:  
![\[The edit slot type dialog box.\]](http://docs.aws.amazon.com/lex/latest/dg/images/gs1-25a.png)

1. Choose **Add slot to intent**.

1. <a name="slotTypeFinish"></a>On the **Intent** page, choose **Required**. Change the name of the slot from **slotOne** to **crust**. Change the prompt to **What kind of crust would you like?**

1. Repeat [Step 1](#slotTypeStart) through [Step 4](#slotTypeFinish) using the values in the following table:    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lex/latest/dg/gs2-create-bot-slot-types.html)

## Next Step
<a name="gs2-next-step-configure-intent"></a>

[Configure the Intent](gs2-create-bot-configure-intent.md)

# Configure the Intent
<a name="gs2-create-bot-configure-intent"></a>

Configure the `OrderPizza` intent to fulfill a user's request to order a pizza.

**To configure an intent**
+ On the **OrderPizza** configuration page, configure the intent as follows:
  + **Sample utterances** – Type the following strings. The curly braces \$1\$1 enclose slot names.
    + I want to order pizza please 
    + I want to order a pizza
    + I want to order a \$1pizzaKind\$1 pizza
    + I want to order a \$1size\$1 \$1pizzaKind\$1 pizza 
    + I want a \$1size\$1 \$1crust\$1 crust \$1pizzaKind\$1 pizza
    + Can I get a pizza please
    + Can I get a \$1pizzaKind\$1 pizza
    + Can I get a \$1size\$1 \$1pizzaKind\$1 pizza
  + **Lambda initialization and validation** – Leave the default setting.
  + **Confirmation prompt** – Leave the default setting.
  + **Fulfillment** – Perform the following tasks:
    + Choose **AWS Lambda function**.
    + Choose **PizzaOrderProcessor**. 
    + If the **Add permission to Lambda function** dialog box is shown, choose **OK** to give the `OrderPizza` intent permission to call the `PizzaOrderProcessor` Lambda function.
    +  Leave **None** selected.

  The intent should look like the following:  
![\[The intent editor.\]](http://docs.aws.amazon.com/lex/latest/dg/images/gs1-70c.png)

## Next Step
<a name="gs2-next-step-configure-bot"></a>

[Configure the Bot](gs2-create-bot-configure-bot.md)

# Configure the Bot
<a name="gs2-create-bot-configure-bot"></a>

Configure error handling for the `PizzaOrderingBot` bot.

1. Navigate to the `PizzaOrderingBot` bot. Choose **Editor**. and then choose **Error Handling**, as in the following image:  
![\[\]](http://docs.aws.amazon.com/lex/latest/dg/images/gs1-80.png)

1. Use the **Editor** tab to configure bot error handling.
   + Information you provide in **Clarification Prompts** maps to the bot's [clarificationPrompt](https://docs.aws.amazon.com/lex/latest/dg/API_PutBot.html#lex-PutBot-request-clarificationPrompt) configuration. 

     When Amazon Lex can't determine the user intent, the service returns a response with this message. 
   + Information that you provide in the **Hang-up** phrase maps to the bot's [abortStatement](https://docs.aws.amazon.com/lex/latest/dg/API_PutBot.html#lex-PutBot-request-abortStatement) configuration. 

     If the service can't determine the user's intent after a set number of consecutive requests, Amazon Lex returns a response with this message.

   Leave the defaults.

## Next Step
<a name="gs2-next-step-build-and-test"></a>

[Step 3: Build and Test the Bot](gs2-build-and-test.md)