Skip to content

Latest commit

 

History

History
100 lines (78 loc) · 3.04 KB

File metadata and controls

100 lines (78 loc) · 3.04 KB

ADK Codelab (Gemini API Key)

Pre Setup

Follow the slides for steps: Slides

  1. Create a brand new Gmail account ad activate free cloud trial (worth $300)
  2. go to https://console.cloud.google.com/
  3. Click create "Create a project"
  4. Enter project name
  5. Select "No Orginization" under Parent resource
  6. Click "Activate Cloud Shell" on the top right
  7. Make sure you the terminal shows the project id correctly
  8. You may be asked to
  9. Click "Open editor"

Workshop using Gemini API Key

Codelab link: https://codelabs.developers.google.com/adkcourse/instructions

1. Clone the Repository

git clone https://github.com/cuppibla/adk_tutorial.git
cd adk_tutorial

2. Create Gemini API Key

3. Configure Environment

cloudshell edit .env
GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_API_KEY=AIza...

4. Start ADK

adk web

5. Change the port to 8000

Agent Selection and Prompts

  1. a_single_agent - Plan a trip from Sunnyvale to San Francisco this weekend, I love food and art.

Note: The free Gemini API key may return 429 (quota exceeded) or 404 (model unavailable) depending on account quota or model availability. If this happens, either use a Gemini API key with available quota or use the Vertex AI version of the codelab. Error.

  1. b2_parallel_agent - Plan my trip to San Francisco, I want to find some good concert, restaurant and museum.
  2. b1_sequential_agent - Find a good sushi near Stanford and tell me how to get there.
  3. b3_loop_agent - Plan a trip from Sunnyvale to San Francisco today.
  4. c_custom_agent - Plan a trip from Sunnyvale to San Francisco this weekend, I love food and art. Make sure within budget of 100 dollars.
  5. d_routing_agent - Plan a trip from Sunnyvale to San Francisco this weekend, I love concert, restaurant and museum.
  6. e_agent_as_tool - Plan a trip from Sunnyvale to San Francisco this weekend, I love concert, restaurant and museum.

Session 6

Follow Step 8 of the codelab.

Session 7 (MCP)

If you have issues with the toolbox, follow the workaround below.

Toolbox Workaround

cd ~/adk_tutorial/mcp_tool_box

rm -f toolbox

export VERSION=0.16.0
export OS=linux/amd64

curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/$OS/toolbox

chmod +x toolbox

Terminal 1

cd ~/adk_tutorial/mcp_tool_box
./toolbox --tools-file "trip_tools.yaml" --port 7001

Terminal 2

cd ~/adk_tutorial
set -a
source .env
set +a
source .adk_env/bin/activate
cd g_agents_mcp
python -u main.py

Sometimes, killing the terminal and restarting the server works too!

MCP Prompts

  • What are the top-rated things to do in Tokyo?
  • Show me the museums in Rome.
  • What can I do in New York for under 25 dollars?