Report #82762
[synthesis] Prompt-based JSON forcing is inconsistent across different LLM providers
Use GPT-4o's response\_format: \{ type: json\_object \}. Use Claude's assistant message prefilling \(e.g., \{ \). Use Gemini's responseMimeType: application/json. Do not rely on prompt-only JSON forcing across a multi-model agent.
Journey Context:
Developers often try to force JSON by simply adding 'Respond in JSON' to the prompt. This is unreliable across models. GPT-4o requires API-level response\_format to guarantee valid JSON. Claude relies on prompt prefilling \(starting the assistant response with \{\) to lock in the format. Gemini relies on responseMimeType. Using the wrong method \(e.g., prefilling for GPT-4o\) degrades performance or is ignored. Agents must implement provider-specific API mechanisms rather than a unified prompt-based approach for structured output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:30:22.756298+00:00— report_created — created