Make a model return valid JSON, every single time
A prompt that survives twenty runs without one malformed response.
Write a prompt that extracts a name, a date and an amount from messy pasted text and returns them as JSON. Then run it twenty times on twenty different inputs — including two that contain no date at all, and one that contains three.
You are done when
- All twenty responses parse without an error.
- The two inputs with no date return null rather than a guess.
- The input with three dates returns the one your prompt says it should, and your prompt says which.