fix(structured outputs): avoid including beta header if output_format is missing#1121
Merged
RobertCraigie merged 3 commits intoanthropics:nextfrom Jan 20, 2026
Conversation
Collaborator
Author
|
@RobertCraigie merge it please if it's ready. I can't merge unfortunately, even the approved ones 😢 |
Collaborator
|
Ah sorry I forgot you can't do that yet :( |
Merged
3 tasks
colbyguan
pushed a commit
that referenced
this pull request
Jan 29, 2026
* codegen metadata * feat(api): migrate sending message format in output_config rather than output_format * chore(internal): update `actions/checkout` version * fix(structured outputs): avoid including beta header if `output_format` is missing (#1121) * fix(structured outputs): avoid including beta header if output_format is missing * fix ci * fix condition * chore(ci): upgrade `actions/github-script` * codegen metadata * feat: use output_config for structured outputs * feat(api): api update * feat(api): migrate sending message format in output_config rather than output_format * fix lint * review fixes * more fixes * keep transformed_output_format naming * typo * add a test * test for conflict * do the same for create * feat: add deprecation warning to all calls using output_format * test: add unit tests for output_format -> output_config migration * fix: change warning stack level to 4 for output_format derecation * chore: consolidate warning suppressions in unit test * fix: remove redundant output_config formatting in tool_runner methods --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: karpetrosyan <kar.petrosyanpy@gmail.com> Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com> Co-authored-by: Cameron McAteer <246350779+cameron-mcateer@users.noreply.github.com> * feat(client): add custom JSON encoder for extended type support * feat(api): add support for Structured Outputs in the Messages API * fix(client): run formatter * fix: remove class causing breaking change (#1333) * release: 0.77.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com> Co-authored-by: dtmeadows <dmeadows@stainless.com> Co-authored-by: karpetrosyan <kar.petrosyanpy@gmail.com> Co-authored-by: Cameron McAteer <246350779+cameron-mcateer@users.noreply.github.com>
karpetrosyan
added a commit
to karpetrosyan/anthropic-sdk-python
that referenced
this pull request
Feb 3, 2026
…ut_format` is missing (anthropics#1121)" This reverts commit 062077e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third-party clients (Vertex, Bedrock) don’t support structured outputs and its beta header, so when the SDK sets it, the remote server returns
Error code: 400 - {'message': 'invalid beta flag'}.This change just avoids always setting that header, so we can still port the
tool_runnerandstreamhelpers, which useparsemethod internally, with minimal changes.