Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/google/adk/agents/llm_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ class LlmAgent(BaseAgent):
"""
disallow_transfer_to_peers: bool = False
"""Disallows LLM-controlled transferring to the peer agents."""

require_confirmation_for_transfer: bool = False
"""If True, requires user confirmation before transferring to another agent."""
# LLM-based agent transfer configs - End

include_contents: Literal['default', 'none'] = 'default'
Expand Down
5 changes: 4 additions & 1 deletion src/google/adk/flows/llm_flows/agent_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ async def run_async(
)
])

transfer_to_agent_tool = FunctionTool(func=transfer_to_agent)
transfer_to_agent_tool = FunctionTool(
func=transfer_to_agent,
require_confirmation=invocation_context.agent.require_confirmation_for_transfer
)
tool_context = ToolContext(invocation_context)
await transfer_to_agent_tool.process_llm_request(
tool_context=tool_context, llm_request=llm_request
Expand Down