Challenge 1: It Works on My Machine!
Introduction
We already have a complete Python agent built with the Google Agent Development Kit (ADK). The agent includes tools for looking up customer orders (lookup_order), checking warehouse inventory (check_inventory), reviewing store policies (search_product_faq), and processing refunds (process_refund).
Before containerizing and deploying to the cloud, we’ll verify that the agent behaves correctly and executes its tools in a local development environment.
Description
The sample agent can be found here, download it to your Cloud Shell. Install its dependencies in a Python virtual environment.
Set up the authentication to use Agent Platform Authentication (API keys are not allowed!). Start the database emulator using the provided start-database-emulator.sh script and launch the ADK playground (either with adk cli or agents-cli).
Verify that you get relevant answers when the agent is prompted with the test queries.
Success Criteria
- Python virtual environment is created and dependencies are installed without errors.
- Authentication for Agent Platform is set up (without API keys!).
- The agent successfully answers the following test queries and executes the appropriate tool functions
- Order lookup: “What is the status of order ORD-1001?”
- Inventory check: “How many Wireless Headphones are in stock?”
- Policy question: “What is the return policy for electronics?”
- Refund processing: “I want to return order ORD-1001 because the headphones were defective. Please refund $199.99.”
- The order status for
ORD-1001is verified asDELIVERED, stock for headphones is confirmed, and the refund is approved with a transaction ID. - No code was modified.
Learning Resources
Tips
- If you’re using
adk webin Cloud Shell, pass--allow_origins="*"to ensure the Cloud Shell web preview works smoothly. - Using
sourceto start the Firestore emulator exports the required environment variable for the emulator, otherwise you need to set it yourself. - Cloud Shell should have
agents-clialready installed, if your environment is missing it you can install it by following these instructions.