Amazon Lex
Developer Guide

Step 3: Build and Test the Bot

Make sure the bot works, by building and testing it.

To build and test the bot

  1. To build the PizzaOrderingBot bot, choose Build.

    Amazon Lex builds a machine learning model for the bot. When you test the bot, the console uses the runtime API to send the user input back to Amazon Lex. Amazon Lex then uses the machine learning model to interpret the user input.

    It can take some time to complete the build.

  2. To test the bot, in the Test Bot window, start communicating with your Amazon Lex bot.

    • For example, you might say or type:

                                A conversation to order a pizza from the pizza bot.
    • Use the sample utterances that you configured in the OrderPizza intent to test the bot. For example, the following is one of the sample utterances that you configured for the PizzaOrder intent:

      I want a {size} {crust} crust {pizzaKind} pizza

      To test it, type the following:

      I want a large thin crust cheese pizza

    When you type "I want to order a pizza," Amazon Lex detects the intent (OrderPizza). Then, Amazon Lex asks for slot information.

    After you provide all of the slot information, Amazon Lex invokes the code hook (that is, the Lambda function that you configured for the intent).

    The Lambda function returns a message ("Okay, I have ordered your ...") to Amazon Lex, which Amazon Lex returns to you..

Next Step

Step 4 (Optional): Clean up

On this page: