Module
Back to courses
AI & ProductAdvanced

Get reliable, product-ready AI outputs (JSON, schemas, function calling)

Turn a model’s answer into data the product can read without guessing: choose the mechanism, design the schema, plan for failures, version the contract, test it on 20 cases.

46 steps~2 hr 30 minLevel: Advanced · Regular practice: you already use the tools or work on this topic.

Turn a model's answer into data your product can read without guessing: pick the right mechanism (instructions, JSON mode, structured outputs, function calling), design the schema, plan what happens when the output breaks, version the contract and test it on 20 cases. You leave with the output contract of a feature in your own product and its test table, ready to review with your engineering team, without writing code.

What you will be able to do

  • 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.
  • Design an output schema (types, enums, required fields, nullable fields, descriptions, "unknown" values) where every field serves a consumer.
  • Specify validation (syntax, schema, business rules), retries, handling of refusals and truncation, and the fallback path.
  • Version and evolve an output contract without breaking its consumers, accounting for provider differences and the split of roles between PM and developers.
  • Build a set of 20 robustness cases and set acceptance thresholds before going to production.

Prerequisites

  • Knowing what an API and a data format like JSON are, at the "I know what it is" level
  • Having written a spec or user stories for an engineering team
  • Having used an LLM (ChatGPT, Claude, Gemini) for a work task
  • Recommended, not required: Build an AI assistant for your product (its lesson on response format is taken further here).
  • This course is not for developers looking for an SDK tutorial: schemas are shown in a readable pseudo-format.

Syllabus

What will I produce in this course, and in what order?

  1. Objective · By the end of this overview, you will know what you are going to produce (the output contract of a feature and its 20-case table) and in what order the five modules get you there.

Which outputs of my product must become a contract, and which mechanism should I use to get it?

  1. Objective · By the end of this lesson, you will be able to list the consumers of an AI output, identify the failures free text causes for each, and decide whether that output needs a contract.

  2. 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.

Which fields, which types and which allowed values, and how do I let the model say "I don't know"?

  1. 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.

  2. Objective · By the end of this lesson, you will be able to plan in a schema how to express missing information (null, "unknown" value, extraction status), choose the order of fields and judge the use of a confidence score.

What does the product check, and what does it do when the output is invalid, refused or cut off?

  1. Objective · By the end of this lesson, you will be able to specify the three levels of output validation (syntax, schema, business rules), a retry rule and a fallback path suited to the cost of an error.

  2. Objective · By the end of this lesson, you will be able to describe the documented cases where a structured output does not follow the schema (refusal, truncation, enum casing), how each provider signals them, and the behaviour expected from the product.

How do I evolve the schema without breaking the product, and how do I know it holds?

  1. Objective · By the end of this lesson, you will be able to classify a schema change as additive or breaking, propose a migration plan, anticipate the effect of changing provider or model, and split roles between PM and developers.

  2. Objective · By the end of this lesson, you will be able to build a set of 20 robustness cases spread over eight families, choose the metrics to measure and set acceptance thresholds before measuring.

How do I assemble the output contract of a feature in my product and apply it over the next 30 days?

  1. Objective · By the end of this lesson, you will be able to assemble the full output contract of a feature in your product (consumers, mechanism, schema, validation, exceptions, version, 20 cases and thresholds), self-assess it and plan how to apply it over 7 and 30 days.