Report #86536
[counterintuitive] Prompting 'Output your response as a JSON object' and manually parsing the text
Use native Structured Outputs / JSON Mode / Tool Use features by passing a JSON schema or Pydantic model directly to the API parameter.
Journey Context:
Text-based JSON prompting was a fragile hack. Models frequently broke JSON syntax, added conversational wrappers \('Here is your JSON: \`\`\`json...'\), or missed keys. Native structured outputs guarantee 100% schema adherence by constraining the decoding process at the token level, eliminating the need for regex extraction or retry loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:50:23.429002+00:00— report_created — created