Skip to content
This repository was archived by the owner on Sep 15, 2026. It is now read-only.

[Content outdated] "Structured Data" lesson teaches prefill + stop sequences, superseded by structured outputs #161

Open

Description

@baptistegresse

Course

Skilljar version: "Claude with the Anthropic API"
https://anthropic.skilljar.com/claude-with-the-anthropic-api

Section: "Accessing Claude with the API"
Lesson: "Structured Data"

Problem

The "Structured Data" lesson teaches structured JSON extraction using the
prefilled assistant message + stop sequence technique (prefilling the
assistant turn with ```json and setting ``` as a stop
sequence).

This approach is no longer the current best practice and conflicts with the
feature Anthropic now recommends for this exact use case:

  1. Structured outputs are now the purpose-built, recommended solution
    for getting valid JSON, and are not covered by the course. The
    output_config.format parameter with a JSON schema uses constrained
    decoding to guarantee schema-valid output ("Always valid: No more
    JSON.parse() errors ... no retries needed"). It is generally available
    for Claude Opus 4.7, Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5, and
    Haiku 4.5.
    Ref: https://platform.claude.com/docs/en/build-with-claude/structured-outputs

  2. The technique taught is explicitly incompatible with structured
    outputs.
    The structured outputs documentation lists "Message
    Prefilling" as incompatible with JSON outputs. So the method the lesson
    teaches cannot be combined with the modern recommended approach, and
    learners are being taught a pattern that the current API design steers
    away from.

Suggested fix

Update the "Structured Data" lesson to teach structured outputs
(output_config.format / json_schema) as the primary method, and present
prefill + stop sequences (and tool use) as historical or alternative
approaches with their current limitations clearly noted.

Related

Part of the broader pattern of course material lagging behind the current
API. See #71 (dynamic model name selection in course notebooks).

Activity

  1. added a commit that references this issue on Jun 21, 2026
    1fe1dac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions