-
Notifications
You must be signed in to change notification settings - Fork 621
feat(gemini-request): add response_json_schema to GenerationConfig #1077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gemini-request): add response_json_schema to GenerationConfig #1077
Conversation
Updates the GenerationConfig struct to include the response_json_schema field. This enables support for standard JSON Schema formats per Gemini API docs.
joshua-mo-143
left a comment
There was a problem hiding this 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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
joshua-mo-143
left a comment
There was a problem hiding this 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
Fixes #1076