AI Academy/AI Foundations/Lesson 06
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
Example schema
{
  "summary": "string",
  "confidence": 0.0,
  "evidence": ["string"],
  "next_steps": ["string"]
}
Validation rules
  • 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.
Exercise

Take one free-form model answer and rewrite the prompt so the result becomes a parseable object.

Deliverable

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