Report #45042
[counterintuitive] Writing 'Output strictly in JSON format: \{ "key": "value" \}' to get structured data
Use native Structured Outputs / JSON mode via API parameters \(e.g., response\_format: \{ type: "json\_object" \} or function calling schemas\).
Journey Context:
Prompting for JSON was a hack that frequently failed \(markdown wrappers, trailing commas, conversational filler like 'Here is your JSON:'\). Native structured outputs guarantee schema adherence via constrained decoding, making regex-based extraction and defensive parsing obsolete. Relying on prompt text for format adherence is fundamentally unreliable compared to API-level constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:04:22.517637+00:00— report_created — created