Repository navigation
Commit 672d94c
committed
Google: Handle anyOf types for Gemini 3+ models
Gemini 3+ models reject TYPE_UNSPECIFIED in function parameter schemas,
which was previously used as a fallback for anyOf types that weren't
simple nullable types ([type, null]).
This change picks the first non-null type from anyOf as the fallback
type instead. This is a lossy conversion (we lose the union semantics)
but allows tools with union-typed parameters like `str | list[str]`
to work with Gemini 3 models.
See: google/adk-python#34241 parent eac4142 commit 672d94c
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | | - | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1225 | 1234 | | |
1226 | 1235 | | |
1227 | 1236 | | |
| |||
0 commit comments