fix(transfer_to_agent): update docstring for clarity and accuracy

Copybara import of the project:

--
e246af5965dfd4d032e0a3ce29513f3e2e874f73 by Alankrit Verma <alankrit386@gmail.com>:

tools: allow transfer_to_agent to accept extra kwargs

transfer_to_agent now takes **kwargs to swallow unexpected keyword args
Added integration tests covering single and multiple extra kwargs.
Fixes #458.

--
55fea786a9b7eb19b830dc67d7a2e37fe7937608 by Alankrit Verma <alankrit386@gmail.com>:

fix(tests): correct indentation in test_transfer.py for better readability

--
0c04f2d777bd4f3d8951dadd5e4e105530bd6281 by Alankrit Verma <alankrit386@gmail.com>:

fix(transfer_to_agent): restore strict two-arg signature and clarify usage

Revert the earlier **kwargs change so transfer_to_agent again only accepts
(agent_name, tool_context).  Improve the doc-string to make clear that no
other parameters should be passed to this tool.

Fixes #458

--
d37448dd0ef9fc6199ca0e42b211b3cd9c886eb0 by Alankrit Verma <alankrit386@gmail.com>:

fix(transfer_to_agent): update docstring for clarity and accuracy

--
ea827af78fc2c9abdf030ad50e24bba8c996df75 by Wei Sun (Jack) <Jacksunwei@gmail.com>:

Update transfer_to_agent_tool docstring for better prompt
--
a144069a67b2e5652ffd50224b1ce68ddea14783 by Wei Sun (Jack) <Jacksunwei@gmail.com>:

Update transfer_to_agent_tool.py

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/466 from AlankritVerma01:tools/transfer-accept-kwargs 686d436457e3141d128c6e81452fddc546a14a7e
PiperOrigin-RevId: 764940463
This commit is contained in:
Alankrit Verma 2025-05-29 16:56:54 -07:00 committed by Copybara-Service
parent 0d66a7888b
commit 854a544061

View File

@ -16,5 +16,12 @@ from .tool_context import ToolContext
def transfer_to_agent(agent_name: str, tool_context: ToolContext):
"""Transfer the question to another agent."""
"""Transfer the question to another agent.
This tool hands off control to another agent when it's more suitable to
answer the user's question according to the agent's description.
Args:
agent_name: the agent name to transfer to.
"""
tool_context.actions.transfer_to_agent = agent_name