Skip to content

Support "responseMimeType" as part of generationConfig for Gemini #1288

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

Open
talos opened this issue Mar 28, 2025 · 1 comment
Open

Support "responseMimeType" as part of generationConfig for Gemini #1288

talos opened this issue Mar 28, 2025 · 1 comment
Assignees

Comments

@talos
Copy link

talos commented Mar 28, 2025

Description

Gemini allows you to ask the model to create "structured output" without specifying a schema. This ends up being "JSON mode", with untyped (but valid JSON) output.

This is generally useful because prompting the model to "write JSON" isn't foolproof, it will often include various delimiters etc.

Image

This could be supported by allowing a customization of responseMimeType for GeminiModelSettings. Right now only "gemini_safety_settings" is supported.

LMK if you'd prefer I try to open a PR for this, it just might be a minute. Seems like a nice improvement and light lift. Keep up the great work!

References

No response

@DouweM
Copy link
Contributor

DouweM commented May 21, 2025

Thank you -- this is related to #582 and will be implemented in #1628.

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

No branches or pull requests

2 participants