From 6c217bad828edf62b41ec06b168f8a6cb7ece2ed Mon Sep 17 00:00:00 2001 From: Liang Wu Date: Thu, 14 Aug 2025 21:35:54 -0700 Subject: [PATCH] chore: update models in samples/ folder to be gemini 2.0+ Gemini 1.5 is obsolete and not accessible to new projects. PiperOrigin-RevId: 795330977 --- contributing/samples/hello_world_ma/agent.py | 2 +- contributing/samples/human_in_loop/agent.py | 2 +- contributing/samples/output_schema_with_tools/agent.py | 2 +- contributing/samples/workflow_agent_seq/agent.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contributing/samples/hello_world_ma/agent.py b/contributing/samples/hello_world_ma/agent.py index f9d09765..410d516d 100755 --- a/contributing/samples/hello_world_ma/agent.py +++ b/contributing/samples/hello_world_ma/agent.py @@ -131,7 +131,7 @@ prime_agent = Agent( root_agent = Agent( - model="gemini-1.5-flash", + model="gemini-2.5-flash", name="root_agent", instruction=""" You are a helpful assistant that can roll dice and check if numbers are prime. diff --git a/contributing/samples/human_in_loop/agent.py b/contributing/samples/human_in_loop/agent.py index 79563319..92f0c51a 100644 --- a/contributing/samples/human_in_loop/agent.py +++ b/contributing/samples/human_in_loop/agent.py @@ -39,7 +39,7 @@ def ask_for_approval( root_agent = Agent( - model='gemini-1.5-flash', + model='gemini-2.5-flash', name='reimbursement_agent', instruction=""" You are an agent whose job is to handle the reimbursement process for diff --git a/contributing/samples/output_schema_with_tools/agent.py b/contributing/samples/output_schema_with_tools/agent.py index bd89f18d..bf33bbc9 100644 --- a/contributing/samples/output_schema_with_tools/agent.py +++ b/contributing/samples/output_schema_with_tools/agent.py @@ -82,7 +82,7 @@ def get_current_year() -> str: # Create the agent with both output_schema and tools root_agent = LlmAgent( name="person_info_agent", - model="gemini-1.5-pro", + model="gemini-2.5-pro", instruction=""" You are a helpful assistant that gathers information about famous people. diff --git a/contributing/samples/workflow_agent_seq/agent.py b/contributing/samples/workflow_agent_seq/agent.py index 3edcf197..4d9ccef2 100644 --- a/contributing/samples/workflow_agent_seq/agent.py +++ b/contributing/samples/workflow_agent_seq/agent.py @@ -23,7 +23,7 @@ from google.adk.agents.sequential_agent import SequentialAgent # Takes the initial specification (from user query) and writes code. code_writer_agent = LlmAgent( name="CodeWriterAgent", - model="gemini-1.5-flash", + model="gemini-2.5-flash", # Change 3: Improved instruction instruction="""You are a Python Code Generator. Based *only* on the user's request, write Python code that fulfills the requirement. @@ -38,7 +38,7 @@ Do not add any other text before or after the code block. # Takes the code generated by the previous agent (read from state) and provides feedback. code_reviewer_agent = LlmAgent( name="CodeReviewerAgent", - model="gemini-2.0-flash", + model="gemini-2.5-flash", # Change 3: Improved instruction, correctly using state key injection instruction="""You are an expert Python Code Reviewer. Your task is to provide constructive feedback on the provided code. @@ -69,7 +69,7 @@ Output *only* the review comments or the "No major issues" statement. # Takes the original code and the review comments (read from state) and refactors the code. code_refactorer_agent = LlmAgent( name="CodeRefactorerAgent", - model="gemini-2.0-flash", + model="gemini-2.5-flash", # Change 3: Improved instruction, correctly using state key injection instruction="""You are a Python Code Refactoring AI. Your goal is to improve the given Python code based on the provided review comments.