Multi-step
Multi-step JSON repair: make any model return valid JSON on the second try
Step one: ask for JSON. Step two: if JSON.parse throws, send the broken string plus the parser error back and ask only for a corrected version. Don't re-explain the task. Models fix syntax far more reliably than they self-correct semantics. Two steps, near-zero unparseable output.
1 min read3