pydantic-ai
pydantic-ai copied to clipboard
Support "responseMimeType" as part of generationConfig for Gemini
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.
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