Report #80441
[counterintuitive] Writing complex markdown templates with placeholders is the best way to get structured data
Use native JSON Schema or Pydantic models passed directly to the API's structured output parameter instead of formatting instructions in the prompt.
Journey Context:
Before native structured outputs, developers used markdown templates to force formatting. This is brittle; models hallucinate extra fields, miss required ones, or escape the markdown. Native structured outputs use constrained decoding, guaranteeing 100% schema adherence and eliminating the need to 'prompt engineer' the format. Prompting for format is now an anti-pattern when API-level schemas are available.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:37:46.472590+00:00— report_created — created