Module 3 of 6Lesson 1 of 2~16 min
Write the spec of every field in the schema
An output schema is read by both the model and the engineers, and each expects different things from it. This lesson teaches you to document every field precisely and to spot the rules that the provider will not enforce for you, so the team knows exactly what still needs checking in code.
Lesson objective
By the end of this lesson, you will be able to write an output schema field by field (name, type, required or not, allowed values, description, consumer) and spot the constraints the provider does not guarantee.
Topics covered
- JSON Schema
- schema design
- data types
- enums
In the glossary
Where it fits
Design the schema
Which fields, which types and which allowed values, and how do I let the model say "I don't know"?
Lessons in this module
- Write the spec of every field in the schema (this lesson)
- Let the model say "I don't know" in the schema
What you will learn in this module
This lesson is part of the course Get reliable, product-ready AI outputs (JSON, schemas, function calling)
- Design an output schema (types, enums, required fields, nullable fields, descriptions, "unknown" values) where every field serves a consumer.
Related courses
- AI & ProductAdvancedRegular practice: you already use the tools or work on this topic.
Build an AI assistant for your product
3 hr
- AI & ProductAdvancedRegular practice: you already use the tools or work on this topic.
Design a RAG architecture that fits your product
3 hr 30 min
- AI & ProductAdvancedRegular practice: you already use the tools or work on this topic.
Evaluate an AI feature: test sets, metrics and LLM judges
3 hr