The process of creating Lex V2 bots is . Since the process could change, refer to Amazon documentation when creating chat bots. This example explains how to create a simple bot that books trips. To create this bot, use the Bots interface in Amazon Web Services (AWS).
Start creating your bot by defining the name, description and some basic information.
Log in to Amazon Web Services (AWS) and navigate to the AWS services page.
Under Find Services, select Amazon Lex.
On the Amazon Lex page, click Get Started.
On the Create your bot page, select BookTrip. This bot is a sample bot that books trips.
In the Bot name box, accept BookTrip as the default name, or type a different name.
For this example, set COPPA to Yes.
Click Create.
For each intent, you must define utterances and slots:
The template that this example is based on automatically added two intents. One to book a car (BookCar), and another to book a hotel (BookHotel).
It added utterances to recognize phrases a user might say. When booking a car, the bot listens for “Make a car reservation,” “Reserve a car,” or “Book a car.” In response to any of those phrases, the bot prompts for the details it needs to make a reservation. Those details (called slots) prompt for city, pick-up date, return date, and so on. Information collected by slots can be passed to Architect.
Each slot has a that defines how data in the slot is recognized and handled. For example, if you select AMAZON.DATE, the bot converts words that represent dates into a date format. When passed to Architect, slot data is converted to string format.
Each slot in an intent has at least one prompt . A prompt is often a question that a user must respond to, so that the bot can collect input data. Also, messages can be informational, not requiring a response. It is up to you, as a bot designer.
In this example, the slots and prompts are already set up. Let’s test them. Type Hi in the “Chat to your bot” box. The bot doesn’t have an utterance that matches “Hi,” so it responds, “Sorry, what can I help you with?”
In the chat box, type Book a car. The bot has an utterance to match, so it responds by prompting for the information defined by its slots.
When you finish testing, click Build.
Click Publish. Publishing a bot makes it available to use in Architect.
The system prompts you to create an alias. This name is a pointer to a specific version of a bot. For more information, see in the Amazon Lex Developer Guide. Since this is the first version of our bot, type FirstAlias in the Create an alias box. Later you use this name to refer to the bot in Architect.
Click Publish.
Wait for the operation to complete.
Get user feedback about articles.