Commit 180609c
committed
fix: include handoffs when deciding to inject JSON
prompt
The JSON prompt injection was only triggered when tools list was non-empty,
but handoffs are converted to function tools and added separately. This meant
that agents using only handoffs with output_schema would not get the prompt
injection even when enable_structured_output_with_tools=True, causing Gemini
to error with 'Function calling with response mime type application/json is
unsupported.'
Changes:
- Combine tools and handoffs before checking if JSON prompt should be injected
- Add test case for handoffs-only scenario
- Update inline comment to clarify why handoffs must be included
This ensures the opt-in flag works correctly for multi-agent scenarios where
an agent might use handoffs without regular tools.1 parent cfcd777 commit 180609c
File tree
2 files changed
+16
-1
lines changed- src/agents/extensions/models
- tests/utils
2 files changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
295 | 299 | | |
296 | | - | |
| 300 | + | |
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments