Validate, retry with the error, pass
Swipe to change step
Step 1 of 7. A messy email and a JSON schema go to the model. The schema is the contract: field names, types, and the date format YYYY-MM-DD. Messy email ("invoice of 3rd April, 410 total"). JSON schema (invoice_date: YYYY-MM-DD), highlighted. Model (extracts fields). Validator (schema + business rules). arrow from Messy email to Model. arrow from JSON schema to Model. arrow from Model to Validator, labelled JSON. a email moving along e1.
In this chapter
- 14.1JSON schemas for output5 min read
- 14.2Constrained decoding and strict schema modes6 min read
- 14.3Nullable fields so the model doesn't invent values4 min read
- 14.4Validation-retry loops5 min read
- 14.5Batch extraction at scale5 min read
- 14.6Forcing structure with tool_use5 min read
- 14.7Mapping typed models to response schemas6 min read
- 14.8Refusals, truncation and validation retries5 min read
Chapter check
Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.
Loading check…