Skip to content
Module
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

Full 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

  1. Diagnose where free text breaks your product
  2. 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.