Skip to content

Commit 110aecf

Browse files
morganrouxcopybara-github
authored andcommitted
chore: Replace old model gemini-2.0 references by 2.5
Merge #4705 ### Link to Issue or Description of Change - Closes: #4666 **Problem:** Gemini-2.0-flash model is still used in integration tests, but disabled for new users **Solution:** Replace all occurrences of Gemini-2.0-flash by Gemini-2.5-flash, in integration tests and docstrings. Because gemini-2.0 is still enabled for some users, this PR doesn't clean the model from unit tests. ### Testing Plan Run already existing unittests and integration tests ### Checklist - [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document. - [x] I have performed a self-review of my own code. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have added tests that prove my fix is effective or that my feature works. - [x] New and existing unit tests pass locally with my changes. - [x] I have manually tested my changes end-to-end. - [x] Any dependent changes have been merged and published in downstream modules. COPYBARA_INTEGRATE_REVIEW=#4705 from morganroux:fix/issues/4666 3c390a2 PiperOrigin-RevId: 900973552
1 parent 6b1ffa3 commit 110aecf

12 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/google/adk/agents/common_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class AgentRefConfig(BaseModel):
118118
my_custom_agent = LlmAgent(
119119
name="my_custom_agent",
120120
instruction="You are a helpful custom agent.",
121-
model="gemini-2.0-flash",
121+
model="gemini-2.5-flash",
122122
)
123123
```
124124

src/google/adk/agents/config_schemas/AgentConfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@
24612461
}
24622462
],
24632463
"default": null,
2464-
"description": "Optional. LlmAgent.model. Provide a model name string (e.g. \"gemini-2.0-flash\"). If not set, the model will be inherited from the ancestor or fall back to the system default (gemini-2.5-flash unless overridden via LlmAgent.set_default_model). To construct a model instance from code, use model_code.",
2464+
"description": "Optional. LlmAgent.model. Provide a model name string (e.g. \"gemini-2.5-flash\"). If not set, the model will be inherited from the ancestor or fall back to the system default (gemini-2.5-flash unless overridden via LlmAgent.set_default_model). To construct a model instance from code, use model_code.",
24652465
"title": "Model"
24662466
},
24672467
"instruction": {

src/google/adk/agents/llm_agent_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class LlmAgentConfig(BaseAgentConfig):
5555
default=None,
5656
description=(
5757
'Optional. LlmAgent.model. Provide a model name string (e.g.'
58-
' "gemini-2.0-flash"). If not set, the model will be inherited from'
58+
' "gemini-2.5-flash"). If not set, the model will be inherited from'
5959
' the ancestor or fall back to the system default (gemini-2.5-flash'
6060
' unless overridden via LlmAgent.set_default_model). To construct a'
6161
' model instance from code, use model_code.'

src/google/adk/tools/mcp_tool/mcp_toolset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class McpToolset(BaseToolset):
8282
8383
# Use in an agent
8484
agent = LlmAgent(
85-
model='gemini-2.0-flash',
85+
model='gemini-2.5-flash',
8686
name='enterprise_assistant',
8787
instruction='Help user accessing their file systems',
8888
tools=[toolset],

src/google/adk/utils/instructions_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def build_instruction(
5151
)
5252
5353
agent = Agent(
54-
model="gemini-2.0-flash",
54+
model="gemini-2.5-flash",
5555
name="agent",
5656
instruction=build_instruction,
5757
)

src/google/adk/utils/model_name_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def extract_model_name(model_string: str) -> str:
4141
4242
Args:
4343
model_string: Either a simple model name like "gemini-2.5-pro" or a
44-
path-based model name like "projects/.../models/gemini-2.0-flash-001"
44+
path-based model name like "projects/.../models/gemini-2.5-flash"
4545
4646
Returns:
4747
The extracted model name (e.g., "gemini-2.5-pro")

tests/integration/fixture/ecommerce_customer_service_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def get_user_id_from_cookie() -> str:
288288

289289

290290
root_agent = Agent(
291-
model="gemini-2.0-flash-001",
291+
model="gemini-2.5-flash",
292292
name="Ecommerce_Customer_Service",
293293
instruction="""
294294
You are an intelligent customer service assistant for an e-commerce platform. Your goal is to accurately understand user queries and use the appropriate tools to fulfill requests. Follow these guidelines:

tests/integration/fixture/hello_world_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def check_prime(nums: list[int]) -> list[str]:
6060

6161

6262
root_agent = Agent(
63-
model='gemini-2.0-flash-001',
63+
model='gemini-2.5-flash',
6464
name='data_processing_agent',
6565
instruction="""
6666
You roll dice and answer questions about the outcome of the dice rolls.

tests/integration/fixture/hello_world_agent_async/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async def get_agent_async() -> (
6868
):
6969
"""Returns the root agent."""
7070
root_agent = Agent(
71-
model='gemini-2.0-flash-001',
71+
model='gemini-2.5-flash',
7272
name='data_processing_agent',
7373
instruction="""
7474
You roll dice and answer questions about the outcome of the dice rolls.

tests/integration/fixture/home_automation_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def list_devices(status: str = "", location: str = "") -> list:
284284

285285

286286
root_agent = Agent(
287-
model="gemini-2.0-flash-001",
287+
model="gemini-2.5-flash",
288288
name="Home_automation_agent",
289289
instruction="""
290290
You are Home Automation Agent. You are responsible for controlling the devices in the home.

0 commit comments

Comments
 (0)