The movie expert playbook-based prebuilt agent can answer a wide range of movie-related questions. The agent references both a BigQuery dataset containing metadata about movies and an unstructured data store of movie plot summaries sourced from Wikipedia.
Sample dialogs
The following sample dialogs demonstrate common scenarios handled by this prebuilt agent.
Plot Summary and Database Search
The user asks the agent for a summary of Avatar. The agent retrieves the movie plot for Avatar from the data store, and summarizes it for the user. The user asks how much profit Avatar made. The agent searches the database for Avatar's revenue and budget, and uses this information to answer the user's question. The user asks what the highest-earning non-English movie was in the month that Avatar was released. The agent searches the database, filtering by date and language, and answers the user's question.
User input | Agent response |
---|---|
Hi | |
Hi there, welcome to Cymbal Movies! I'm here to help with your movie-related questions. Ask away! | |
Tell me more about Avatar | |
The plot of the movie "Avatar" is as follows: In 2154, humans have depleted Earth's natural resources, leading to a severe energy crisis. The Resources Development Administration (RDA for short) mines for a valuable mineral --- unobtanium --- on Pandora, a densely forested habitable moon orbiting the gas giant Polyphemus in the Alpha Centauri star system. Pandora, whose atmosphere is poisonous to humans, is inhabited by the Na'vi, a species of 10-foot tall (3.0 m), blue-skinned, sapient humanoids that live in harmony with nature and worship a mother goddess named Eywa. Is there anything else I can help you with? |
|
How much profit did it make? | |
Avatar had a budget of $237 million and grossed $2.79 billion, making a profit of $2.55 billion. Is there anything else I can help you with? |
|
What was the highest-earning non-English movie in the month that Avatar was released? | |
The highest-earning non-English movie in the month that Avatar was released was 3 Idiots, which grossed $70 million. Is there anything else I can help you with? |
|
That's all, thanks! | |
You're welcome! |
Basic setup
To set up this prebuilt agent:
- Import the prebuilt agent.
- Configure the provided tools with your external services, see Tool setup.
Tool setup
This agent includes tools that are used to integrate with external services. You can use the prebuilt tool installer to deploy sample code and data for your prebuilt agent.
To deploy and configure sample code and data for the Movie Expert prebuilt agent, expand for instructions.
- Download the prebuilt tool installer to a local directory.
- Navigate to the local directory where you downloaded installer.zip.
- Unzip installer.zip and open the
installer
folder. - Review README.md for a detailed overview of the installer and its requirements.
- Run
pip install -r requirements.txt
to install requirements. -
Run
gcloud auth application-default login
to authenticate using gcloud auth. -
Run the installer using
python installer.py --project-id=YOUR_GCP_PROJECT_ID --prebuilt-id=movie_expert
-
After deploying all required services, configure each tool in the prebuilt agent with the
provided URL(s) logged by the installer:
Agent Builder console
- If you have not yet imported the prebuilt agent, import the agent into your project.
- Go to the Agent Builder console.
- Select your project from the console drop-down.
- Select your app.
- Click on the icon for Tools.
-
For each tool in the agent, edit the schema to replace the URL in the
servers:
field with the endpoint logged by the installer. - Click Save.
Dialogflow CX
- If you have not yet imported the prebuilt agent, import the agent into your project.
- Open the Dialogflow CX console.
- Choose your Google Cloud project.
- Select your agent.
- Click on the icon for Generative resources.
- Click Tools.
-
For each tool in the agent, edit the schema to replace the URL in the
servers
field with the endpoint logged by the installer. - Click Save.
-
Grant the Compute Engine service account
(
your-project-number-developer.gserviceaccount.com
) the Cloud Datastore User role, so the newly deployed Cloud Run functions can access Firestore.
Steering
The cymbal-movie-plots
tool connects to a data store pointing
to a Cloud Storage bucket containing movie plot summaries.
Search Movie Database
The bq-search
OpenAPI tool connects to the BigQuery API, inputs the SQL query
generated by the agent,
executes it on the BigQuery table containing metadata on movies,
and returns the query outputs to the agent as a JSON object.
Complete
Your agent and its integrations should now be set up and ready to test.