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 instead. .
Step 1: Review the Blueprints Used in this Exercise
Topics
Overview of the Bot Blueprint (BookTrip)
The blueprint (BookTrip) you use to create a bot provides the following preconfiguration:
-
Slot types – Two custom slot types:
-
RoomTypeswith enumeration values:king,queen, anddeluxe, for use in theBookHotelintent. -
CarTypeswith enumeration values:economy,standard,midsize,full size,luxury, andminivan, for use in theBookCarintent.
-
-
Intent 1 (BookHotel) – It is preconfigured as follows:
-
Preconfigured slots
-
RoomType, of theRoomTypescustom slot type -
Location, of theAMAZON.US_CITYbuilt-in slot type -
CheckInDate, of theAMAZON.DATEbuilt-in slot type -
Nights, of theAMAZON.NUMBERbuilt-in slot type
-
-
Preconfigured utterances
-
"Book a hotel"
-
"I want to make hotel reservations"
-
"Book a {Nights} stay in {Location}"
If the user utters any of these, Amazon Lex determines that
BookHotelis the intent and then prompts the user for slot data. -
-
Preconfigured prompts
-
Prompt for the
Locationslot – "What city will you be staying in?" -
Prompt for the
CheckInDateslot – "What day do you want to check in?" -
Prompt for the
Nightsslot – "How many nights will you be staying?" -
Prompt for the
RoomTypeslot – "What type of room would you like, queen, king, or deluxe?" -
Confirmation statement – "Okay, I have you down for a {Nights} night stay in {Location} starting {CheckInDate}. Shall I book the reservation?"
-
Denial – "Okay, I have cancelled your reservation in progress."
-
-
-
Intent 2 (BookCar) – It is preconfigured as follows:
-
Preconfigured slots
-
PickUpCity, of theAMAZON.US_CITYbuilt-in type -
PickUpDate, of theAMAZON.DATEbuilt-in type -
ReturnDate, of theAMAZON.DATEbuilt-in type -
DriverAge, of theAMAZON.NUMBERbuilt-in type -
CarType, of theCarTypescustom type
-
-
Preconfigured utterances
-
"Book a car"
-
"Reserve a car"
-
"Make a car reservation"
If the user utters any of these, Amazon Lex determines BookCar is the intent and then prompts the user for slot data.
-
-
Preconfigured prompts
-
Prompt for the
PickUpCityslot – "In what city do you need to rent a car?" -
Prompt for the
PickUpDateslot – "What day do you want to start your rental?"" -
Prompt for the
ReturnDateslot – "What day do you want to return this car?" -
Prompt for the
DriverAgeslot – "How old is the driver for this rental?" -
Prompt for the
CarTypeslot – "What type of car would you like to rent? Our most popular options are economy, midsize, and luxury" -
Confirmation statement – "Okay, I have you down for a {CarType} rental in {PickUpCity} from {PickUpDate} to {ReturnDate}. Should I book the reservation?"
-
Denial – "Okay, I have cancelled your reservation in progress."
-
-
Overview of the Lambda Function Blueprint (lex-book-trip-python)
In addition to the bot blueprint, AWS Lambda provides a blueprint (lex-book-trip-python) that you can use as a code hook with the bot blueprint. For a list of bot blueprints and corresponding Lambda function blueprints, see Amazon Lex and AWS Lambda Blueprints.
When you create a bot using the BookTrip blueprint, you update configuration of both the intents (BookCar and BookHotel) by adding this Lambda function as a code hook for both initialization/validation of user data input and fulfillment of the intents.
This Lambda function code provided showcases dynamic conversation using previously known information (persisted in session attributes) about a user to initialize slot values for an intent. For more information, see Managing Conversation Context.
Next Step
Step 2: Create an Amazon Lex Bot