Update The Lex Bot To Use Lambda For Fulfillment
Now that we have a working Lambda function, we can update our Lex bot so that it uses the Lambda function for fulfillment, rather than returning the elicited slot details to the caller.
- On the AWS Console in the browser, click Services and type lex and then press enter.
- Select TravelBuddyChatBot
- Select TravelBuddyCheckFlightsIntent intent if it doesn’t automatically select.
- Click Test
- Click the settings icon.
- In Lambda function - optional section, select TripSearchLexBot function for Source.
- Select $LATEST version.
- Click Save
- In Fulfullment section, expand the On successful fulfillment
- Then click Advanced options
- Check to Use a Lambda function for fulfillment check box.
- Click Update options
- Click Actice of Fulfillment section
- Click Save intent, then click Build to re-build the your intent
- Click Test, enter
I want to fly from Melbourne to Sydney
to Type a message
.
- The bot will respond When do you want to fly? Type
Tomorrow
.
- The bot will respond Are you sure you want to find flights to Sydney? Type
Yes
.
- The bot will respond I have 1 flight from Melbourne to Sydney - 1 January 2018 or a similar message - perhaps there is more than one flight available, and perhaps the date is different - populating the DynamoDB table is randomised.