Description
One of the limitations of using structured outputs with Gemini is that it uses a subset of the OpenAPI 3.0 spec rather than JSON Schema:
This prevents enabling structured outputs when using Zod unions and records.
However, Gemini 2.5 models now support JSON Schema as a preview: https://ai.google.dev/gemini-api/docs/structured-output#json-schema
I would love for the AI SDK to support submitting JSON Schema to Gemini 2.5 models as it would allow enabling structured outputs for higher quality output that follows the schema.
Description
One of the limitations of using structured outputs with Gemini is that it uses a subset of the OpenAPI 3.0 spec rather than JSON Schema:
This prevents enabling structured outputs when using Zod unions and records.
However, Gemini 2.5 models now support JSON Schema as a preview: https://ai.google.dev/gemini-api/docs/structured-output#json-schema
I would love for the AI SDK to support submitting JSON Schema to Gemini 2.5 models as it would allow enabling structured outputs for higher quality output that follows the schema.