Commit 6e44f37
fix: handle raw dict output_schema in SetModelResponseTool
When output_schema is a raw dict instance (e.g.,
{"type": "object", "properties": {...}}), SetModelResponseTool sets it
as the parameter annotation directly. This crashes in
_is_builtin_primitive_or_compound because dict instances are not
hashable and the check does `annotation in dict.keys()`.
Fix: add an explicit isinstance(output_schema, dict) branch that uses
`dict` (the type) as the annotation instead of the dict instance.
Fixes #54691 parent 909a8c2 commit 6e44f37
2 files changed
Lines changed: 25 additions & 1 deletion
File tree
- src/google/adk/tools
- tests/unittests/tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
90 | 99 | | |
91 | | - | |
| 100 | + | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
0 commit comments