fix(google): send tool schemas via parametersJsonSchema#263
Merged
Kamilbenkirane merged 1 commit intomainfrom Apr 18, 2026
Merged
fix(google): send tool schemas via parametersJsonSchema#263Kamilbenkirane merged 1 commit intomainfrom
Kamilbenkirane merged 1 commit intomainfrom
Conversation
The legacy functionDeclarations[].parameters field restricts enum to TYPE_STRING properties, so any integer Choice (e.g. veo-3 duration [4, 6, 8], gemini-embedding dimensions [768, 1536, 3072]) produced a 400 at tool-registration time. Gemini's November 2025 update added parametersJsonSchema, which accepts raw JSON Schema — integer enums, $defs, $ref, anyOf, additionalProperties — with no sanitization. Switch ToolsMapper._map_user_tool to emit parametersJsonSchema and drop the now-unused _remove_titles helper (title is natively supported by the JSON Schema field). Closes #262.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #262.
The legacy
functionDeclarations[].parametersfield restrictsenumtoTYPE_STRINGproperties. Any integerChoiceconstraint (e.g.veo-3.0-generate-001'sduration = Choice([4, 6, 8])orgemini-embedding-001'sdimensions = Choice([768, 1536, 3072])) produced a 400 at tool-registration time.Gemini's November 2025 update introduced
parametersJsonSchema, which accepts raw JSON Schema — integer enums,$defs,$ref,anyOf,additionalProperties, andtitle— with no sanitization (Google announcement).parametersJsonSchemais mutually exclusive withparametersper the API reference.Change
ToolsMapper._map_user_toolnow emits the schema underparametersJsonSchemainstead ofparameters. The_remove_titleshelper is deleted —titleis natively supported by the JSON Schema field.Ecosystem precedent
parametersJsonSchemaunconditionally in its Gemini provider.python-genaiSDK emits deprecation warnings on its legacySchema.from_json_schemasanitizer, steering callers towardparametersJsonSchema.Test plan
tests/unit_tests/test_google_tools_mapper.pycovering:parametersJsonSchema, notparameters.enumon a non-string property preserved.titlefields preserved.