676 B 2 lines
03c3ca48
⋯
packages/ai/.changes/structured-output-response-format.md
download raw history
at main Markdown
  • Added responseFormat to request schema-constrained JSON output, implemented for Google, Google Vertex (responseMimeType plus responseJsonSchema), and OpenAI-compatible completions (response_format: { type: "json_schema" }). The completions path is enabled for endpoints known to support it and opt-in per model with compat.supportsResponseFormatJsonSchema for providers such as DeepSeek and z.ai that reject or ignore the field.
  • Added responseFormat schema normalization that sends TypeBox literal unions as enum, because provider structured-output dialects do not accept const: Gemini ignores it and would accept any value, and OpenAI rejects the schema.