fix(anthropic, amazon-bedrock): migrate output_format to output_config.format#12319
Merged
aayush-kapoor merged 8 commits intovercel:mainfrom Feb 27, 2026
Merged
Conversation
69096b4 to
10da013
Compare
…g.format and enable Bedrock structured outputs Fixes vercel#12298
10da013 to
7d78dbe
Compare
Collaborator
aayush-kapoor
left a comment
There was a problem hiding this comment.
thanks! look correct - just making some minor changes and will merge
Refactor output configuration handling and remove unused structured output checks.
aayush-kapoor
approved these changes
Feb 27, 2026
| }); | ||
| }); | ||
|
|
||
| it('should still use json tool fallback for structured output without thinking enabled', async () => { |
Collaborator
There was a problem hiding this comment.
this might need to change eventually. didn't change in this PR since it led to some regression after changed behaviour and would expand the scope of this PR
Collaborator
There was a problem hiding this comment.
change in this file is because bedrock now supports native structured ouptuts. using the falling back to the JSON tool approach was leading to issues when thinking was enabled. so we changed made the guard very specific to that use case for now
dancer
approved these changes
Feb 27, 2026
Collaborator
|
thanks a bunch @muraliavarma 🎉 |
Contributor
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.
Background
#12298
Summary
@ai-sdk/anthropic: Migrated the deprecatedoutput_formatrequest parameter tooutput_config.format, aligning with the current Anthropic API. Theeffortandformatfields are now merged into a singleoutput_configobject to avoid one spread overwriting the other.@ai-sdk/amazon-bedrock: EnabledsupportsNativeStructuredOutput: truefor Bedrock Anthropic models. Structured outputs are now GA on Bedrock and no longer require a beta header, so the JSON tool fallback is no longer necessary.Manual Verification
verified the fix by running the following code snippet before and after the changes
repro
Related Issues
Fixes #12298