Skip to content

refactor(anthropic): GA structured output support#967

Merged
sixlive merged 1 commit intomainfrom
anthropic-strucutred-output-refactors
Mar 20, 2026
Merged

refactor(anthropic): GA structured output support#967
sixlive merged 1 commit intomainfrom
anthropic-strucutred-output-refactors

Conversation

@sixlive
Copy link
Contributor

@sixlive sixlive commented Mar 20, 2026

Description

Anthropic's structured outputs feature has moved from beta to GA. Native structured output is now the default strategy for Anthropic — no beta header (structured-outputs-2025-11-13) required.

Changes

Strategy selection (Structured.php):

  • Native output format is now the default (previously required beta header)
  • use_tool_calling provider option is the explicit opt-out for older models
  • Removed hasNativeStructuredOutputSupport() beta header check
  • Removed JsonModeStructuredStrategy import (no longer reachable)

Tests:

  • Flattened describe('native structured outputs') block — no longer gated behind beta config
  • Removed two citation + structured output tests (this combination is incompatible at the Anthropic API level)
  • Updated payload test to expect output_config instead of JSON-mode prompt injection
  • Fixed message index in thinking test (no extra JSON-mode message appended)

Docs:

  • Native structured output documented as default (no beta setup needed)
  • Strict tool use no longer references beta header
  • Citations section clarifies incompatibility with structured output
  • Config comment updated to reference remaining beta features (output-128k, code-execution)

Breaking Changes

  • Structured output now uses native mode by default instead of prompt-based JSON mode
  • Citations can no longer be used with structured output (previously worked via JSON mode workaround, but this is unsupported by the Anthropic API)
  • Users who had the beta header configured for structured outputs can remove it

@sixlive sixlive self-assigned this Mar 20, 2026
@sixlive sixlive merged commit bcd7125 into main Mar 20, 2026
14 checks passed
@sixlive sixlive deleted the anthropic-strucutred-output-refactors branch March 20, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant