Skip to content
Module
Module 4 of 6Lesson 1 of 2~15 min

Specify validation, retries and fallback

A well-formed output can still be wrong from a business point of view. This lesson teaches you to specify several levels of checks, a rule for retrying when the output is rejected and a backup path that is proportionate to what an error would cost the user and the business.

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

Topics covered

  • data validation
  • business rules
  • retry
  • fallback

In the glossary

Full glossary

Where it fits

When the output breaks the contract

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

Lessons in this module

  1. Specify validation, retries and fallback (this lesson)
  2. Plan for the cases where the guarantee does not hold

What you will learn in this module

This lesson is part of the course Get reliable, product-ready AI outputs (JSON, schemas, function calling)

  • Choose between instructions alone, JSON mode, structured outputs and function calling for a given need, and justify the choice.
  • Specify validation (syntax, schema, business rules), retries, handling of refusals and truncation, and the fallback path.