From 9c2358e2a582a2c245fe88dd95bb1e40fd3ea1a8 Mon Sep 17 00:00:00 2001 From: Liang Wu Date: Wed, 14 May 2025 23:16:28 -0700 Subject: [PATCH] Update the usage of built-in code execution in documentation and sample agent. PiperOrigin-RevId: 758997215 --- contributing/samples/code_execution/agent.py | 4 ++-- src/google/adk/agents/llm_agent.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/contributing/samples/code_execution/agent.py b/contributing/samples/code_execution/agent.py index 3e7e4c0..b8cbd61 100644 --- a/contributing/samples/code_execution/agent.py +++ b/contributing/samples/code_execution/agent.py @@ -15,7 +15,7 @@ """Data science agent.""" from google.adk.agents.llm_agent import Agent -from google.adk.tools import built_in_code_execution +from google.adk.code_executors.built_in_code_executor import BuiltInCodeExecutor def base_system_instruction(): @@ -96,5 +96,5 @@ When plotting trends, you should make sure to sort and order the data by the x-a """, - tools=[built_in_code_execution], + code_executor=BuiltInCodeExecutor(), ) diff --git a/src/google/adk/agents/llm_agent.py b/src/google/adk/agents/llm_agent.py index e6b782a..4e31f46 100644 --- a/src/google/adk/agents/llm_agent.py +++ b/src/google/adk/agents/llm_agent.py @@ -200,8 +200,7 @@ class LlmAgent(BaseAgent): Check out available code executions in `google.adk.code_executor` package. - NOTE: to use model's built-in code executor, don't set this field, add - `google.adk.tools.built_in_code_execution` to tools instead. + NOTE: to use model's built-in code executor, use the `BuiltInCodeExecutor`. """ # Advance features - End