From 7bc179dd8712fe9e41bebcea255e3bc3905ab68f Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Sun, 14 Jun 2026 18:58:01 +1000 Subject: [PATCH 1/4] Bump gemini flash from v2 to v2.5 --- .../agent_team/adk-tutorial/step_1/agent.py | 8 +++---- .../agent_team/adk-tutorial/step_3/agent.py | 24 +++++++++---------- .../agent_team/adk-tutorial/step_5/agent.py | 14 +++++------ .../agent_team/adk-tutorial/step_6/agent.py | 14 +++++------ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py b/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py index 60602b24de..df52429ba9 100644 --- a/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py +++ b/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py @@ -21,7 +21,7 @@ # Use one of the model constants defined earlier -MODEL_GEMINI_2_0_FLASH = "gemini-2.0-flash" +MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash" # @title Define the get_weather Tool @@ -60,7 +60,7 @@ def get_weather(city: str) -> dict: root_agent = Agent( name="weather_agent_v1", - model=MODEL_GEMINI_2_0_FLASH, # Can be a string for Gemini or a LiteLlm object + model=MODEL_GEMINI_2_5_FLASH, # Can be a string for Gemini or a LiteLlm object description="Provides weather information for specific cities.", instruction="You are a helpful weather assistant. " "When the user asks for the weather in a specific city, " @@ -70,7 +70,7 @@ def get_weather(city: str) -> dict: tools=[get_weather], # Pass the function directly ) -# Sample queries to test the agent: +# Sample queries to test the agent: # # Agent will give weather information for the specified cities. # # What's the weather in Tokyo? @@ -78,4 +78,4 @@ def get_weather(city: str) -> dict: # # Tell me the weather in New York? # # Agent will not have information for the specified city. -# # How about Paris? \ No newline at end of file +# # How about Paris? \ No newline at end of file diff --git a/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py b/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py index 62514277eb..17a303c726 100644 --- a/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py +++ b/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py @@ -21,7 +21,7 @@ from typing import Optional # Use one of the model constants defined earlier -MODEL_GEMINI_2_0_FLASH = "gemini-2.0-flash" +MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash" # @title Define the get_weather Tool @@ -51,9 +51,9 @@ def get_weather(city: str) -> dict: return mock_weather_db[city_normalized] else: return {"status": "error", "error_message": f"Sorry, I don't have weather information for '{city}'."} - - -def say_hello(name: Optional[str] = None) -> str: + + +def say_hello(name: Optional[str] = None) -> str: """Provides a simple greeting. If a name is provided, it will be used. Args: @@ -83,8 +83,8 @@ def say_goodbye() -> str: try: greeting_agent = Agent( # Using a potentially different/cheaper model for a simple task - model = MODEL_GEMINI_2_0_FLASH, - # model=LiteLlm(model=MODEL_GPT_4O), # If you would like to experiment with other models + model = MODEL_GEMINI_2_5_FLASH, + # model=LiteLlm(model=MODEL_GPT_4O), # If you would like to experiment with other models name="greeting_agent", instruction="You are the Greeting Agent. Your ONLY task is to provide a friendly greeting to the user. " "Use the 'say_hello' tool to generate the greeting. " @@ -102,7 +102,7 @@ def say_goodbye() -> str: try: farewell_agent = Agent( # Can use the same or a different model - model = MODEL_GEMINI_2_0_FLASH, + model = MODEL_GEMINI_2_5_FLASH, # model=LiteLlm(model=MODEL_GPT_4O), # If you would like to experiment with other models name="farewell_agent", instruction="You are the Farewell Agent. Your ONLY task is to provide a polite goodbye message. " @@ -115,11 +115,11 @@ def say_goodbye() -> str: print(f"✅ Agent '{farewell_agent.name}' created using model '{farewell_agent.model}'.") except Exception as e: print(f"❌ Could not create Farewell agent. Check API Key ({farewell_agent.model}). Error: {e}") - - + + root_agent = Agent( name="weather_agent_v2", # Give it a new version name - model=MODEL_GEMINI_2_0_FLASH, + model=MODEL_GEMINI_2_5_FLASH, description="The main coordinator agent. Handles weather requests and delegates greetings/farewells to specialists.", instruction="You are the main Weather Agent coordinating a team. Your primary responsibility is to provide weather information. " "Use the 'get_weather' tool ONLY for specific weather requests (e.g., 'weather in London'). " @@ -134,7 +134,7 @@ def say_goodbye() -> str: sub_agents=[greeting_agent, farewell_agent] ) -# Sample queries to test the agent: +# Sample queries to test the agent: # # Agent will give weather information for the specified cities. # # What's the weather in Tokyo? @@ -142,7 +142,7 @@ def say_goodbye() -> str: # # Tell me the weather in New York? # # Agent will not have information for the specified city. -# # How about Paris? +# # How about Paris? # # Agent will delegate greetings to the greeting_agent. # # Hi there! diff --git a/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py b/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py index 7ef21f89aa..7aedb8f808 100644 --- a/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py +++ b/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py @@ -27,7 +27,7 @@ # Use one of the model constants defined earlier -MODEL_GEMINI_2_0_FLASH = "gemini-2.0-flash" +MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash" def get_weather_stateful(city: str, tool_context: ToolContext) -> dict: @@ -76,7 +76,7 @@ def get_weather_stateful(city: str, tool_context: ToolContext) -> dict: return {"status": "error", "error_message": error_msg} -def say_hello(name: Optional[str] = None) -> str: +def say_hello(name: Optional[str] = None) -> str: """Provides a simple greeting. If a name is provided, it will be used. Args: @@ -149,7 +149,7 @@ def block_keyword_guardrail( try: # Use a defined model constant greeting_agent = Agent( - model=MODEL_GEMINI_2_0_FLASH, + model=MODEL_GEMINI_2_5_FLASH, name="greeting_agent", # Keep original name for consistency instruction="You are the Greeting Agent. Your ONLY task is to provide a friendly greeting using the 'say_hello' tool. Do nothing else.", description="Handles simple greetings and hellos using the 'say_hello' tool.", @@ -163,7 +163,7 @@ def block_keyword_guardrail( try: # Use a defined model constant farewell_agent = Agent( - model=MODEL_GEMINI_2_0_FLASH, + model=MODEL_GEMINI_2_5_FLASH, name="farewell_agent", # Keep original name instruction="You are the Farewell Agent. Your ONLY task is to provide a polite goodbye message using the 'say_goodbye' tool. Do not perform any other actions.", description="Handles simple farewells and goodbyes using the 'say_goodbye' tool.", @@ -176,7 +176,7 @@ def block_keyword_guardrail( root_agent = Agent( name="weather_agent_v5_model_guardrail", # New version name for clarity - model=MODEL_GEMINI_2_0_FLASH, + model=MODEL_GEMINI_2_5_FLASH, description="Main agent: Handles weather, delegates greetings/farewells, includes input keyword guardrail.", instruction="You are the main Weather Agent. Provide weather using 'get_weather_stateful'. " "Delegate simple greetings to 'greeting_agent' and farewells to 'farewell_agent'. " @@ -187,7 +187,7 @@ def block_keyword_guardrail( before_model_callback=block_keyword_guardrail # <<< Assign the guardrail callback ) -# Sample queries to test the agent: +# Sample queries to test the agent: # # Agent will give weather information for the specified cities. # # What's the weather in Tokyo? @@ -195,7 +195,7 @@ def block_keyword_guardrail( # # Tell me the weather in New York? # # Agent will not have information for the specified city. -# # How about Paris? +# # How about Paris? # # Agent will delegate greetings to the greeting_agent. # # Hi there! diff --git a/examples/python/tutorial/agent_team/adk-tutorial/step_6/agent.py b/examples/python/tutorial/agent_team/adk-tutorial/step_6/agent.py index c3f8a10eb4..73516b5207 100644 --- a/examples/python/tutorial/agent_team/adk-tutorial/step_6/agent.py +++ b/examples/python/tutorial/agent_team/adk-tutorial/step_6/agent.py @@ -28,7 +28,7 @@ from typing import Optional, Dict, Any # For type hints # Use one of the model constants defined earlier -MODEL_GEMINI_2_0_FLASH = "gemini-2.0-flash" +MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash" def get_weather_stateful(city: str, tool_context: ToolContext) -> dict: @@ -77,7 +77,7 @@ def get_weather_stateful(city: str, tool_context: ToolContext) -> dict: return {"status": "error", "error_message": error_msg} -def say_hello(name: Optional[str] = None) -> str: +def say_hello(name: Optional[str] = None) -> str: """Provides a simple greeting. If a name is provided, it will be used. Args: @@ -191,7 +191,7 @@ def block_paris_tool_guardrail( try: # Use a defined model constant greeting_agent = Agent( - model=MODEL_GEMINI_2_0_FLASH, + model=MODEL_GEMINI_2_5_FLASH, name="greeting_agent", # Keep original name for consistency instruction="You are the Greeting Agent. Your ONLY task is to provide a friendly greeting using the 'say_hello' tool. Do nothing else.", description="Handles simple greetings and hellos using the 'say_hello' tool.", @@ -205,7 +205,7 @@ def block_paris_tool_guardrail( try: # Use a defined model constant farewell_agent = Agent( - model=MODEL_GEMINI_2_0_FLASH, + model=MODEL_GEMINI_2_5_FLASH, name="farewell_agent", # Keep original name instruction="You are the Farewell Agent. Your ONLY task is to provide a polite goodbye message using the 'say_goodbye' tool. Do not perform any other actions.", description="Handles simple farewells and goodbyes using the 'say_goodbye' tool.", @@ -218,7 +218,7 @@ def block_paris_tool_guardrail( root_agent = Agent( name="weather_agent_v6_tool_guardrail", # New version name - model=MODEL_GEMINI_2_0_FLASH, + model=MODEL_GEMINI_2_5_FLASH, description="Main agent: Handles weather, delegates, includes input AND tool guardrails.", instruction="You are the main Weather Agent. Provide weather using 'get_weather_stateful'. " "Delegate greetings to 'greeting_agent' and farewells to 'farewell_agent'. " @@ -230,7 +230,7 @@ def block_paris_tool_guardrail( before_tool_callback=block_paris_tool_guardrail # <<< Add tool guardrail ) -# Sample queries to test the agent: +# Sample queries to test the agent: # # Agent will give weather information for the specified cities. # # What's the weather in Tokyo? @@ -238,7 +238,7 @@ def block_paris_tool_guardrail( # # Tell me the weather in New York? # # Agent will not have information for the specified city. -# # How about Paris? +# # How about Paris? # # Agent will delegate greetings to the greeting_agent. # # Hi there! From fbf97117cbb47c34c3518eba73ae4b72f492d2e0 Mon Sep 17 00:00:00 2001 From: Joe Fernandez <931947+joefernandez@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:38:10 -0700 Subject: [PATCH 2/4] Update agent.py --- .../tutorial/agent_team/adk-tutorial/step_3/agent.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py b/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py index 17a303c726..17dc816f83 100644 --- a/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py +++ b/examples/python/tutorial/agent_team/adk-tutorial/step_3/agent.py @@ -21,7 +21,7 @@ from typing import Optional # Use one of the model constants defined earlier -MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash" +MODEL_GEMINI_FLASH = "gemini-flash-latest" # @title Define the get_weather Tool @@ -83,7 +83,7 @@ def say_goodbye() -> str: try: greeting_agent = Agent( # Using a potentially different/cheaper model for a simple task - model = MODEL_GEMINI_2_5_FLASH, + model = MODEL_GEMINI_FLASH, # model=LiteLlm(model=MODEL_GPT_4O), # If you would like to experiment with other models name="greeting_agent", instruction="You are the Greeting Agent. Your ONLY task is to provide a friendly greeting to the user. " @@ -102,7 +102,7 @@ def say_goodbye() -> str: try: farewell_agent = Agent( # Can use the same or a different model - model = MODEL_GEMINI_2_5_FLASH, + model = MODEL_GEMINI_FLASH, # model=LiteLlm(model=MODEL_GPT_4O), # If you would like to experiment with other models name="farewell_agent", instruction="You are the Farewell Agent. Your ONLY task is to provide a polite goodbye message. " @@ -119,7 +119,7 @@ def say_goodbye() -> str: root_agent = Agent( name="weather_agent_v2", # Give it a new version name - model=MODEL_GEMINI_2_5_FLASH, + model=MODEL_GEMINI_FLASH, description="The main coordinator agent. Handles weather requests and delegates greetings/farewells to specialists.", instruction="You are the main Weather Agent coordinating a team. Your primary responsibility is to provide weather information. " "Use the 'get_weather' tool ONLY for specific weather requests (e.g., 'weather in London'). " @@ -152,4 +152,4 @@ def say_goodbye() -> str: # # Agent will delegate farewells to the farewell_agent. # # Bye! # # See you later! -# # Thanks, bye! \ No newline at end of file +# # Thanks, bye! From 3eebcac1a954b6ed7d79d102039dce65427a0ef5 Mon Sep 17 00:00:00 2001 From: Joe Fernandez <931947+joefernandez@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:39:45 -0700 Subject: [PATCH 3/4] Update agent.py --- .../python/tutorial/agent_team/adk-tutorial/step_1/agent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py b/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py index df52429ba9..53deae9da4 100644 --- a/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py +++ b/examples/python/tutorial/agent_team/adk-tutorial/step_1/agent.py @@ -21,7 +21,7 @@ # Use one of the model constants defined earlier -MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash" +MODEL_GEMINI_FLASH = "gemini-flash-latest" # @title Define the get_weather Tool @@ -60,7 +60,7 @@ def get_weather(city: str) -> dict: root_agent = Agent( name="weather_agent_v1", - model=MODEL_GEMINI_2_5_FLASH, # Can be a string for Gemini or a LiteLlm object + model=MODEL_GEMINI_FLASH, # Can be a string for Gemini or a LiteLlm object description="Provides weather information for specific cities.", instruction="You are a helpful weather assistant. " "When the user asks for the weather in a specific city, " @@ -78,4 +78,4 @@ def get_weather(city: str) -> dict: # # Tell me the weather in New York? # # Agent will not have information for the specified city. -# # How about Paris? \ No newline at end of file +# # How about Paris? From 075c8460e667d16246cca2281dfbd4bd7c61b57b Mon Sep 17 00:00:00 2001 From: Joe Fernandez <931947+joefernandez@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:41:33 -0700 Subject: [PATCH 4/4] Update agent.py --- .../tutorial/agent_team/adk-tutorial/step_5/agent.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py b/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py index 7aedb8f808..33cf6aff24 100644 --- a/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py +++ b/examples/python/tutorial/agent_team/adk-tutorial/step_5/agent.py @@ -27,7 +27,7 @@ # Use one of the model constants defined earlier -MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash" +MODEL_GEMINI_FLASH = "gemini-flash-latest" def get_weather_stateful(city: str, tool_context: ToolContext) -> dict: @@ -149,7 +149,7 @@ def block_keyword_guardrail( try: # Use a defined model constant greeting_agent = Agent( - model=MODEL_GEMINI_2_5_FLASH, + model=MODEL_GEMINI_FLASH, name="greeting_agent", # Keep original name for consistency instruction="You are the Greeting Agent. Your ONLY task is to provide a friendly greeting using the 'say_hello' tool. Do nothing else.", description="Handles simple greetings and hellos using the 'say_hello' tool.", @@ -163,7 +163,7 @@ def block_keyword_guardrail( try: # Use a defined model constant farewell_agent = Agent( - model=MODEL_GEMINI_2_5_FLASH, + model=MODEL_GEMINI_FLASH, name="farewell_agent", # Keep original name instruction="You are the Farewell Agent. Your ONLY task is to provide a polite goodbye message using the 'say_goodbye' tool. Do not perform any other actions.", description="Handles simple farewells and goodbyes using the 'say_goodbye' tool.", @@ -176,7 +176,7 @@ def block_keyword_guardrail( root_agent = Agent( name="weather_agent_v5_model_guardrail", # New version name for clarity - model=MODEL_GEMINI_2_5_FLASH, + model=MODEL_GEMINI_FLASH, description="Main agent: Handles weather, delegates greetings/farewells, includes input keyword guardrail.", instruction="You are the main Weather Agent. Provide weather using 'get_weather_stateful'. " "Delegate simple greetings to 'greeting_agent' and farewells to 'farewell_agent'. " @@ -210,4 +210,4 @@ def block_keyword_guardrail( # # Agent will block any request containing the keyword "BLOCK". # # What's the weather in BLOCK tokyo? # # tell me the weather in BLOCK london -# # how about BLOCK new york? \ No newline at end of file +# # how about BLOCK new york?