Skip to content

feat(openai): support GPT-5.6 structured output#1029

Open
bradleybernard wants to merge 1 commit into
prism-php:mainfrom
bradleybernard:feature/openai-gpt-5-6-structured-output
Open

feat(openai): support GPT-5.6 structured output#1029
bradleybernard wants to merge 1 commit into
prism-php:mainfrom
bradleybernard:feature/openai-gpt-5-6-structured-output

Conversation

@bradleybernard

Copy link
Copy Markdown

Description

Adds native structured-output recognition for the official GPT-5.6 API model family:

  • gpt-5.6 (Sol alias)
  • gpt-5.6-sol
  • gpt-5.6-terra
  • gpt-5.6-luna

Without these entries, StructuredModeResolver silently falls back to JSON mode, so Prism sends json_object instead of json_schema and ignores schema.strict.

OpenAI documents Structured Outputs support for each GPT-5.6 model:

The regression test covers all four identifiers and asserts Prism sends json_schema with strict: true.

This is intentionally narrower than #991, which proposes broader prefix matching for versioned model names.

Breaking Changes

None.

Test plan

  • vendor/bin/pest tests/Providers/OpenAI/StructuredTest.php
  • vendor/bin/pest (1467 passed, 8 skipped)
  • vendor/bin/phpstan analyse --memory-limit=512M
  • Pint and Rector on changed files

@wishborn

Copy link
Copy Markdown

For context from a downstream fork — Particle-Academy/prism already covers this, via prefix matching in StructuredModeResolver rather than an exact-match list. It matches on the gpt-5 family prefix, so gpt-5.6 and the -sol / -terra / -luna variants already resolve to structured mode (sending json_schema with strict) without per-model entries — that's effectively the broader #991 approach this PR intentionally avoids.

Sharing in case it helps the narrow-vs-broad trade-off discussion: the prefix approach is zero-maintenance for new gpt-5.x snapshots, at the cost of assuming every future gpt-5.* supports structured output (which holds for the GPT-5.6 family per OpenAI's docs). The explicit list here is the safer, more deliberate side of that trade-off.

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.

2 participants