You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prerequisite - get an API key for open movie database
Click the omdb link and sign up for a free api key
Getting started
create a new bot in LEX called moviebot
create a welcome intent with your bot greeting called movieHelp (utterances: Help, Hi, Hello)
create a new intent for moviePlot (Utterances: What is the plot of {movie}?, etc...)
Add a slot variable called "movie" with a slot type of AMAZON.movie and a question of "What Movie?"
create more intents for movieReleaseDate, movieRuntime, and movieRating -
add slot for movie in each one with prompt of "What movie?"
and Utterances for each for example: "What was the release date of {movie}, how long is {movie}, what was {movie} rated
From Lambda console create a new function called getMovie using defaults (Python 3.7)
add api_key environment variable with your openmovie DB API key
within the Lamda function, find the section of code that has the if, elif statements:
ifmovie_intent=="movieReleaseDate":
response_body=f"{movie_title} was released on {movie_date}"elifmovie_intent=="moviePlot":
response_body=f"{movie_title}: {movie_plot}"elifmovie_intent=="moviePoster":
response_body=movie_posterelifmovie_intent=="movieRating":
response_body=f"{movie_title} is rated {movie_rating}"elifmovie_intent=="movieRuntime":
response_body=f"{movie_title} has a runtime of {movie_runtime}"else:
response_body=f"I'm sorry, I didnt quite understand your request."
modify the lines which mention movie_intent == "": - change what is in the "" to match the intent name you used in LEX
save the Lambda function after any changes to the python code