Skip to content

fix(tools): allow transfer_to_agent to accept extra kwargs #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/google/adk/tools/transfer_to_agent_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,18 @@

# TODO: make this internal, since user doesn't need to use this tool directly.
def transfer_to_agent(agent_name: str, tool_context: ToolContext):
"""Transfer the question to another agent."""
"""Transfer the current request to another agent.

This tool hands off control to a different named agent. Any additional
context (e.g. user query, temperature settings) should be carried in the
LLM prompt or tool_context, not passed as extra parameters here.

Args:
agent_name: The identifier of the agent to transfer to (e.g. "math_agent").
tool_context: The current ToolContext, whose `actions.transfer_to_agent`
field will be set.

Returns:
None. Side-effect: `tool_context.actions.transfer_to_agent` is set.
"""
tool_context.actions.transfer_to_agent = agent_name