Skip to content

Commit 46282ee

Browse files
Jacksunweicopybara-github
authored andcommitted
chore: Don't add prompt about parent agent when disallow_transfer_to_parent=True
Fixes #844 PiperOrigin-RevId: 764116180
1 parent f4c7d78 commit 46282ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/google/adk/flows/llm_flows/agent_transfer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ def _build_target_agents_instructions(
9898
the function call.
9999
"""
100100

101-
if agent.parent_agent:
101+
if agent.parent_agent and not agent.disallow_transfer_to_parent:
102102
si += f"""
103103
Your parent agent is {agent.parent_agent.name}. If neither the other agents nor
104104
you are best for answering the question according to the descriptions, transfer
105-
to your parent agent. If you don't have parent agent, try answer by yourself.
105+
to your parent agent.
106106
"""
107107
return si
108108

0 commit comments

Comments
 (0)