{
"summary": "string",
"confidence": 0.0,
"evidence": ["string"],
"next_steps": ["string"]
}LESSON 06 · AI FOUNDATIONS
Structure Outputs
If your application needs to act on an AI response, the response should have a shape your code can validate.
Goal: Define a machine-checkable response35 minOutput: Schema and parser test
- Reject missing required fields.
- Reject confidence values outside the expected range.
- Reject empty evidence when evidence is required.
- Keep parsing and validation separate from presentation.
Take one free-form model answer and rewrite the prompt so the result becomes a parseable object.
Create one response schema and a parser test for a real workflow.
LEARNING CHECKPOINT
Capture the deliverable before moving on.
Schema and parser test is your evidence that this lesson has been applied, not just read.
✓ PRACTICAL OUTPUT