API Request and Prompt Creation
Goal
Configure a request to the IMDB API to get details for a specific movie in the chatbot.
Main Steps
Configuring the API Request
- Created a new endpoint for movie details
- Used KeyVault to protect sensitive data
- Added a dynamic
movie_idparameter to the request - Configured the URL to accept the parameter dynamically
Implementation in the Chatbot
-
In the click event:
- Added
await readyto ensure the data is loaded - Selected the movie in the
all_moviestable - Retrieved the ID of the selected movie
- Added
-
Made the request to the IMDB API
- Used the
movie API client - Passed the
movie_iddynamically - Stored the result in a Step
- Used the
-
Processing the Response
- Called the movie assistant bot
- Built a prompt with the movie's official information
- Converted the result to JSON
- Generated a detailed response about the movie
Final Result
The chatbot can now:
- Identify the movie
- Make a request to the IMDB API
- Retrieve official details
- Generate a personalized response for the user