When json_schema response_format is sent to models that do not natively
support Structured Output (e.g. DeepSeek/Ollama/local LLMs via
openai-compatible-* providers), they often return empty or malformed
content.
Detect response_format.type === "json_schema", inject the schema into the
system prompt, and downgrade response_format to json_object so Structured
Output works transparently across openai-compatible providers.
Gated to provider.startsWith("openai-compatible-") so providers with
native Structured Output support are not downgraded.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
||
|---|---|---|
| .. | ||
| antigravity.js | ||
| azure.js | ||
| base.js | ||
| codex.js | ||
| commandcode.js | ||
| cursor.js | ||
| default.js | ||
| gemini-cli.js | ||
| github.js | ||
| grok-web.js | ||
| iflow.js | ||
| index.js | ||
| kiro.js | ||
| ollama-local.js | ||
| opencode-go.js | ||
| opencode.js | ||
| perplexity-web.js | ||
| qoder.js | ||
| qwen.js | ||
| vertex.js | ||