Loading lesson…
Level 1 · Apprentice0 XP
Get JSON that always matches your schema, and handle the cases where the answer is no.
Step 1 / 6
ProblemThe pipeline expects JSON. One response in a hundred starts with 'Sure! Here is the JSON:', and the parser crashes at 3 a.m.
← → step
Before this: Prompting techniques that work
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Extract fields from 10 invoices or receipts into a Pydantic model using a JSON schema output. Make optional fields nullable, add a check that the total equals the sum of lines, and send failures to a 'review' list.