Structured output & delimiters
Lesson 6 of 8 · 25 min · part of the AI Prompt Engineer certification
When model output feeds into code, "roughly right" is not good enough — you need output your program can parse every time. Three techniques do most of the work:
- Delimiters — wrap inputs in clear boundaries like
<email>…</email>or triple quotes, so the model can tell your instructions apart from the data. - An explicit schema — list every field, its type, and what to do when it is missing (e.g.
null). - Output-only instructions — "Return only valid JSON, no prose." Many APIs also offer a JSON / structured-output mode or tool schemas that enforce this.
Interactive exercise: Extracting a sales lead
Interactive exercise: Review this summarization prompt template