Skip to content
New this month 24 fresh C++, C#, F#, JavaScript, TypeScript and Lua courses just landed. Browse new releases Use code WELCOME10 for 10% off your first order · 14-day refund

Structured Outputs and JSON Mode Without the Retry Loop

Get valid JSON on the first attempt, and handle the cases where you still will not.

Rated 5.0 out of 5 from 2 reviews 27 students

LM Created by Laura Mbeki

  • Last updated August 2026
  • English
  • 3h 15m of material
  • 24 lessons

What you will learn

7 concrete outcomes

Every bullet below is something you will have built, shipped or be able to explain by the time you finish the last lesson.

  • Design schemas the model can satisfy, including an explicit unknown case
  • Use structured output modes and JSON schema constraints for what they truly guarantee
  • Validate with Zod or Pydantic and return typed errors rather than raw text
  • Detect truncation at the token limit and recover without corrupting the record
  • Repair a bad response instead of blindly retrying the same request
  • Catch values that pass the schema but are semantically wrong
  • Log rejections so you can see which field fails most often

Course curriculum

5 modules · 24 lessons · 3h 15m of material

4 lessons running 30m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 lessons running 40m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 lessons running 42m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 lessons running 44m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 lessons running 39m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 modules · 24 lessons

3h 15m total length

Requirements

Short list, and deliberately so. If you meet these you can start today.

  • Working knowledge of TypeScript or Python
  • You have made an HTTP request to a model API before
  • Familiarity with JSON and basic schema concepts

About this course

The moment a model output feeds a parser instead of a person, prose becomes a liability. This course is about the boundary where a language model meets typed code, and how to make that boundary boring.

You begin with schema design, which is where most structured output problems are really created. Fields named after what they mean, enums instead of free strings, required rather than optional wherever you can defend it, and a deliberate representation for the answer being unknown. Then you work through the provider mechanisms: structured output modes, JSON schema constraints, tool definitions used purely for shape, and what each one actually guarantees rather than what the marketing implies.

The middle of the course is failure handling. Truncated responses at the token limit, values that satisfy the schema but are semantically wrong, hallucinated enum members, numbers arriving as strings, and the retry strategy that repairs rather than repeats. You build a small validation layer in TypeScript with Zod and a Python equivalent with Pydantic, then wire both into a request path with typed errors, bounded retries and a logged rejection trail.

By the end you have an extraction service that turns messy documents into typed records and refuses loudly when it cannot. Access arrives by email as a library link immediately after checkout.

Frequently asked questions

Still unsure about something? Write to misteryjj100@gmail.com and a human answers, usually the same working day.

Yes. Structured output support differs between providers and the course compares them directly, including what happens when a constraint cannot be honoured.

Both. Every exercise ships in both languages, with Zod on the TypeScript side and Pydantic on the Python side, so you can follow in whichever you use at work.

Yes, including partial JSON parsing while a response streams and how to decide whether streaming is worth the added complexity for structured data.

Checkout is handled on our provider's secure payment page. The moment your payment clears we email your personal access link and access code to the address you used at checkout, and the same link appears in your account library. There is nothing to install and nothing to wait for.

Email misteryjj100@gmail.com within 14 days of your purchase, quote your order number, and we refund the full amount to your original payment method. No form to fill in and no questions about how much of the course you watched.

What students say

Reviews are written by people who bought this course. We publish the critical ones too.

5.0

Rated 5.0 out of 5

Course rating · 2 reviews

Rating distribution

  • 5 stars 100%
  • 4 stars 0%
  • 3 stars 0%
  • 2 stars 0%
  • 1 star 0%
  • AL

    Antoine Lefèvre

    Backend engineer

    Feb 2026
    Rated 5.0 out of 5

    Bounded retries instead of infinite hope

    Our extraction service used to retry until either it worked or the bill got frightening. The repair-then-retry pattern with a hard ceiling gave us a predictable cost and a sensible failure path. Straightforwardly better engineering than what we had before.
  • HN

    Hana Novotná

    Software engineer

    Oct 2025
    Rated 5.0 out of 5

    Schema design is the real lever

    It turned out most of our invalid output was our own fault for asking for deeply nested optional unions. Flattening the schema, as suggested here, cut the failure rate further than any amount of retry logic ever did.

Your instructor

LM

Laura Mbeki

Prompt engineer and AI workflow designer

  • 506 students taught
  • 16 courses published
  • 4.3 instructor rating
  • Prompt engineering
  • Prompt libraries
  • AI workflows
  • Prompt evaluation

Laura went independent after seven years of agency work and now designs the prompt libraries that sit behind other people's products. She treats prompting as engineering: versioned prompts, a held-out evaluation set, a regression run before anything ships, and a token budget you have to hit. Her packs are the ones she uses with her own clients — briefing, rewriting, summarising, review — rather than sanitised examples, and each comes with notes on where it fails. She keeps every pack working across ChatGPT, Claude and a small open model, so the technique outlives the model.

$19 USD

One-time payment · lifetime access

The WisdomCharms dispatch

One useful email a week. No fluff, no spam.

New course releases, discount codes before anyone else, and a short, practical breakdown of one technique — a prompt pattern, a C++ idiom, a TypeScript trick — that you can use the same day.

  • Subscriber-only launch pricing
  • Unsubscribe in one click
  • We never sell your address

By subscribing you agree to our Privacy Policy. Questions? Write to misteryjj100@gmail.com.