Skip to content

Commit a9b4276

Browse files
nuthalapativarunxuanyang15
authored andcommitted
docs(tools): encourage using mode='single_turn' in AgentTool and document manual artifacts configuration
Merge #6197 ### Link to Issue or Description of Change - Closes: #3232 ### Problem PR 6197 originally proposed adding an auto-attachment flag to `AgentTool` to recursively inject `load_artifacts_tool` to sub-agents. However: 1. `AgentTool` is no longer encouraged to use directly in favor of using `mode='single_turn'` sub-agents. 2. Auto-attaching the tool dynamically at runtime via `list_artifacts` creates unnecessary performance overhead for all agent tool executions. ### Solution Instead of any code changes, we update `AgentTool`'s docstring to: 1. Recommend the use of `mode='single_turn'` sub-agents (the modern replacement for `AgentTool`). 2. Document that if a sub-agent needs to access parent artifacts, the developer should simply add `load_artifacts_tool` manually to the sub-agent's `tools` list. This resolves the usability gap by clarifying the path forward without adding deprecated flags or introducing runtime slowness. Co-authored-by: Xuan Yang <xygoogle@google.com> COPYBARA_INTEGRATE_REVIEW=#6197 from nuthalapativarun:fix/3232-auto-include-load-artifacts-tool 645c99e PiperOrigin-RevId: 948575713
1 parent f6387c4 commit a9b4276

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/google/adk/tools/agent_tool.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ class AgentTool(BaseTool):
117117
setting ``mode='single_turn'`` on the sub-agent and attaching it via
118118
``sub_agents=[...]`` instead of wrapping it with ``AgentTool``. The
119119
framework then exposes the sub-agent as a tool automatically and runs it
120-
inline in the parent's session. See the single-turn mode guide for details.
120+
inline in the parent's session.
121+
122+
If the sub-agent needs to access parent artifacts, add
123+
``load_artifacts_tool`` directly to the sub-agent's ``tools`` list.
124+
125+
Direct usage of ``AgentTool`` is discouraged. See the single-turn
126+
mode guide for details.
121127
122128
Attributes:
123129
agent: The agent to wrap.

0 commit comments

Comments
 (0)