Report #86739
[counterintuitive] Is providing few-shot examples the best way to guarantee JSON output format?
Use API-level structured outputs \(JSON mode / schemas\) for format compliance; reserve few-shot only for nuanced stylistic imitation.
Journey Context:
Few-shot was the primary way to control output format before structured output features existed. Now, forcing JSON schema via API parameters guarantees 100% format compliance, whereas few-shot examples still suffer from format drift and token waste. Few-shot remains useful for style \(e.g., 'write a commit message like this'\), but is obsolete for structure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:10:44.472335+00:00— report_created — created