Google Gemini
Gemini supports structured output viaresponse_schema. Use GEMINI_DOCUMENT_SCHEMA which omits additionalProperties (unsupported by Gemini).
GEMINI_DOCUMENT_SCHEMA is specifically designed for Gemini — it removes additionalProperties fields that Gemini doesn’t support and uses explicit metadata property definitions.Why a separate schema?
Gemini’s structured output has different constraints than OpenAI:
The
GEMINI_DOCUMENT_SCHEMA handles these differences so you don’t have to.