ai /Practical AI0 / 55 lessons complete

LEVEL 03 · LESSON 23

Structured output

Structure makes an answer processable; validation makes it safe to use.

What it is

Structured output returns information in a defined format, such as a record with fixed fields and allowed categories, rather than only free-form prose.

Why it matters

Downstream software can process a predictable structure, but it still needs to validate whether the values make sense.

A business example

A ticket processor returns an issue type, urgency, order identifier, and a short explanation. A workflow routes the ticket using the issue type and sends missing identifiers for review.

How it actually works

Define a schema specifying field names, types, required values, and constraints. Where supported, constrained generation helps ensure the output follows that schema. Parse and validate it before taking action. Treat a valid format separately from semantic correctness: an allowed category can still be the wrong category. Plan for refusals, incomplete responses, missing evidence, and values that violate business rules.

A common misconception

Valid JSON does not mean valid business data. A neatly formatted imaginary order number remains imaginary.

ONE SENTENCE TO REMEMBER

Structure makes an answer processable; validation makes it safe to use.

CHECK YOUR UNDERSTANDING

An assistant extracts order details as JSON that always matches your schema. What still needs to happen before the system acts on it?

Show the answer

Answer: D.

Structure makes an answer processable; validation makes it safe to use. Valid JSON does not mean valid business data: an allowed category can be the wrong one, and a neatly formatted order number can be imaginary.

Take it into your next meeting

Which checks should run before a generated record is written into your business system?

One more concept, understood.

Mark this lesson complete to keep your place.