Report #94591
[counterintuitive] Prompting 'Output your response in JSON format' and expecting strict adherence
Enable native JSON mode or Structured Outputs in the API call rather than relying on prompt text.
Journey Context:
Relying purely on prompt text for JSON output often results in markdown-wrapped JSON, trailing commas, conversational filler \('Here is your JSON:'\), or broken syntax on complex outputs. API-level JSON modes constrain the grammar at the decoding step, guaranteeing valid syntax without wasting prompt tokens on begging the model to format correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:21:20.807026+00:00— report_created — created