Report #73413
[synthesis] Model adds unsolicited conversational caveats or markdown wrapping strict JSON output
For Claude, use the API \`prefill\` parameter with \`\{\` to force JSON start and explicitly prompt 'Return ONLY valid JSON, no markdown'. For GPT-4o, use \`response\_format: \{ type: 'json\_object' \}\`. For Gemini, use \`responseMimeType: 'application/json'\`.
Journey Context:
Even when explicitly asked for JSON-only output, Claude 3.5 Sonnet frequently prepends conversational filler \('Here is the JSON:'\) or appends caveats, breaking automated parsers. GPT-4o is generally compliant if API-level enforcement is used, but will add filler if relying on prompting alone. Gemini 1.5 Pro often wraps output in markdown code blocks despite instructions. Prompt-level instructions alone are insufficient; you must leverage model-specific API constraints to guarantee parseable structured output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T05:49:12.194181+00:00— report_created — created