Module 2 of 6Lesson 2 of 2~17 min
Choose the mechanism that guarantees the structure
Asking for JSON in a prompt does not guarantee that you will get it back. This lesson compares the mechanisms that model providers offer according to what each one actually guarantees, and helps you choose the one that fits a given product need without overengineering it.
Lesson objective
By the end of this lesson, you will be able to tell instructions alone, JSON mode, structured outputs and function calling apart by what they guarantee, and choose the mechanism that fits a product need.
Topics covered
- JSON mode
- structured outputs
- function calling
- OpenAI, Anthropic, Gemini
In the glossary
Where it fits
From free text to a contract
Which outputs of my product must become a contract, and which mechanism should I use to get it?
Lessons in this module
- Diagnose where free text breaks your product
- Choose the mechanism that guarantees the structure (this lesson)
What you will learn in this module
This lesson is part of the course Get reliable, product-ready AI outputs (JSON, schemas, function calling)
- Diagnose where free-text output breaks a feature and decide which outputs require a contract.
- Choose between instructions alone, JSON mode, structured outputs and function calling for a given need, and justify the choice.
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