You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can delegate tasks to the following specialized agents. Carefully review each agent's description and skills to determine the best match for the user's request.
1. **Assess your own capability**: If you are the best agent to handle this request based on your own description and capabilities, answer it directly.
103
214
104
-
If you are the best to answer the question according to your description, you
105
-
can answer it.
215
+
2. **Consider specialized agents**: If another agent has more relevant skills or expertise for this request, call the `{_TRANSFER_TO_AGENT_FUNCTION_NAME}` function to transfer to that agent. Match the user's needs with the agent's skills and descriptions above.
106
216
107
-
If another agent is better for answering the question according to its
108
-
description, call `{_TRANSFER_TO_AGENT_FUNCTION_NAME}` function to transfer the
109
-
question to that agent. When transferring, do not generate any text other than
110
-
the function call.
217
+
3. **When transferring**: Only call the function - do not generate any additional text.
111
218
112
-
**NOTE**: the only available agents for `{_TRANSFER_TO_AGENT_FUNCTION_NAME}` function are {formatted_agent_names}.
219
+
**IMPORTANT**: The only valid agent names for `{_TRANSFER_TO_AGENT_FUNCTION_NAME}` are:{formatted_agent_names}
If neither you nor the other agents are best for the question, transfer to your parent agent {agent.parent_agent.name}.
224
+
4. **Escalate to parent**: If neither you nor the specialized agents are suitable for this request, transfer to your parent agent `{agent.parent_agent.name}` for broader assistance.
# The NOTE should contain agents in alphabetical order: sub-agents + parent + peers
104
104
expected_content="""\
105
+
## Available Agents for Transfer
105
106
106
-
You have a list of other agents to transfer to:
107
+
You can delegate tasks to the following specialized agents. Carefully review each agent's description and skills to determine the best match for the user's request.
107
108
109
+
### Agent: z_agent
110
+
Description: Last agent
108
111
109
-
Agent name: z_agent
110
-
Agent description: Last agent
112
+
### Agent: a_agent
113
+
Description: First agent
111
114
115
+
### Agent: m_agent
116
+
Description: Middle agent
112
117
113
-
Agent name: a_agent
114
-
Agent description: First agent
118
+
### Agent: parent_agent
119
+
Description: Parent agent
115
120
121
+
### Agent: peer_agent
122
+
Description: Peer agent
116
123
117
-
Agent name: m_agent
118
-
Agent description: Middle agent
124
+
## Decision Criteria
119
125
126
+
1. **Assess your own capability**: If you are the best agent to handle this request based on your own description and capabilities, answer it directly.
120
127
121
-
Agent name: parent_agent
122
-
Agent description: Parent agent
128
+
2. **Consider specialized agents**: If another agent has more relevant skills or expertise for this request, call the `transfer_to_agent` function to transfer to that agent. Match the user's needs with the agent's skills and descriptions above.
123
129
130
+
3. **When transferring**: Only call the function - do not generate any additional text.
124
131
125
-
Agent name: peer_agent
126
-
Agent description: Peer agent
127
-
128
-
129
-
If you are the best to answer the question according to your description, you
130
-
can answer it.
131
-
132
-
If another agent is better for answering the question according to its
133
-
description, call `transfer_to_agent` function to transfer the
134
-
question to that agent. When transferring, do not generate any text other than
135
-
the function call.
136
-
137
-
**NOTE**: the only available agents for `transfer_to_agent` function are `a_agent`, `m_agent`, `parent_agent`, `peer_agent`, `z_agent`.
138
-
139
-
If neither you nor the other agents are best for the question, transfer to your parent agent parent_agent."""
132
+
**IMPORTANT**: The only valid agent names for `transfer_to_agent` are: `a_agent`, `m_agent`, `parent_agent`, `peer_agent`, `z_agent`
133
+
"""
140
134
141
135
assertexpected_contentininstructions
142
136
137
+
# Also verify the parent escalation instruction is present
138
+
assert'4. **Escalate to parent**: If neither you nor the specialized agents are suitable for this request, transfer to your parent agent `parent_agent` for broader assistance.'ininstructions
# Direct multiline string assertion showing the exact expected content
179
176
expected_content="""\
177
+
## Available Agents for Transfer
180
178
181
-
You have a list of other agents to transfer to:
179
+
You can delegate tasks to the following specialized agents. Carefully review each agent's description and skills to determine the best match for the user's request.
182
180
181
+
### Agent: agent1
182
+
Description: First sub-agent
183
183
184
-
Agent name: agent1
185
-
Agent description: First sub-agent
184
+
### Agent: agent2
185
+
Description: Second sub-agent
186
186
187
+
## Decision Criteria
187
188
188
-
Agent name: agent2
189
-
Agent description: Second sub-agent
189
+
1. **Assess your own capability**: If you are the best agent to handle this request based on your own description and capabilities, answer it directly.
190
190
191
+
2. **Consider specialized agents**: If another agent has more relevant skills or expertise for this request, call the `transfer_to_agent` function to transfer to that agent. Match the user's needs with the agent's skills and descriptions above.
191
192
192
-
If you are the best to answer the question according to your description, you
193
-
can answer it.
193
+
3. **When transferring**: Only call the function - do not generate any additional text.
194
194
195
-
If another agent is better for answering the question according to its
196
-
description, call `transfer_to_agent` function to transfer the
197
-
question to that agent. When transferring, do not generate any text other than
198
-
the function call.
199
-
200
-
**NOTE**: the only available agents for `transfer_to_agent` function are `agent1`, `agent2`."""
195
+
**IMPORTANT**: The only valid agent names for `transfer_to_agent` are: `agent1`, `agent2`
196
+
"""
201
197
202
198
assertexpected_contentininstructions
203
199
200
+
# Verify no parent escalation instruction is present
# Direct multiline string assertion showing the exact expected content
238
237
expected_content="""\
238
+
## Available Agents for Transfer
239
239
240
-
You have a list of other agents to transfer to:
241
-
240
+
You can delegate tasks to the following specialized agents. Carefully review each agent's description and skills to determine the best match for the user's request.
242
241
243
-
Agent name: sub_agent
244
-
Agent description: Sub agent
242
+
### Agent: sub_agent
243
+
Description: Sub agent
245
244
245
+
### Agent: parent_agent
246
+
Description: Parent agent
246
247
247
-
Agent name: parent_agent
248
-
Agent description: Parent agent
248
+
## Decision Criteria
249
249
250
+
1. **Assess your own capability**: If you are the best agent to handle this request based on your own description and capabilities, answer it directly.
250
251
251
-
If you are the best to answer the question according to your description, you
252
-
can answer it.
252
+
2. **Consider specialized agents**: If another agent has more relevant skills or expertise for this request, call the `transfer_to_agent` function to transfer to that agent. Match the user's needs with the agent's skills and descriptions above.
253
253
254
-
If another agent is better for answering the question according to its
255
-
description, call `transfer_to_agent` function to transfer the
256
-
question to that agent. When transferring, do not generate any text other than
257
-
the function call.
254
+
3. **When transferring**: Only call the function - do not generate any additional text.
258
255
259
-
**NOTE**: the only available agents for `transfer_to_agent` function are `parent_agent`, `sub_agent`.
260
-
261
-
If neither you nor the other agents are best for the question, transfer to your parent agent parent_agent."""
256
+
**IMPORTANT**: The only valid agent names for `transfer_to_agent` are: `parent_agent`, `sub_agent`
257
+
"""
262
258
263
259
assertexpected_contentininstructions
264
260
261
+
# Also verify the parent escalation instruction is present
262
+
assert'4. **Escalate to parent**: If neither you nor the specialized agents are suitable for this request, transfer to your parent agent `parent_agent` for broader assistance.'ininstructions
0 commit comments