Skip to content

Conversation

@Numeration
Copy link
Contributor

Fixes #1076

Updates the GenerationConfig struct to include the response_json_schema field.
This enables support for standard JSON Schema formats per Gemini API docs.
Copy link
Collaborator

@joshua-mo-143 joshua-mo-143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change required due to incorrect serde renaming.

/// This is an alternative to responseSchema that accepts a standard JSON Schema.
/// If this is set, responseSchema must be omitted.
/// Compatible MIME type: application/json.
/// Supported properties: $id, $defs, $ref, type, properties, etc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to swap the _response_json_schema and response_json_schema docstrings around

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

As suggested in the review, the docstrings for `_response_json_schema` and `response_json_schema` were swapped to be accurate.
Copy link
Collaborator

@joshua-mo-143 joshua-mo-143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the PR!

Tested manually through temporarily adjusting the gemini_agent example locally

@joshua-mo-143 joshua-mo-143 added this pull request to the merge queue Nov 25, 2025
Merged via the queue into 0xPlaygrounds:main with commit 225ee64 Nov 25, 2025
5 checks passed
@github-actions github-actions bot mentioned this pull request Nov 25, 2025
@Numeration Numeration deleted the feat/gemini-json-schema branch December 1, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add response_json_schema to Gemini GenerationConfig

2 participants