feat(amazon-bedrock): allow anthropicBeta through bedrock providerOptions in bedrock/anthropic#13054
Closed
sylviezhang37 wants to merge 6 commits intorelease-v5.0from
Closed
feat(amazon-bedrock): allow anthropicBeta through bedrock providerOptions in bedrock/anthropic#13054sylviezhang37 wants to merge 6 commits intorelease-v5.0from
sylviezhang37 wants to merge 6 commits intorelease-v5.0from
Conversation
c7ee050 to
ad80936
Compare
4 tasks
sylviezhang37
added a commit
that referenced
this pull request
Mar 4, 2026
…m providers (#13059) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background <!-- Why was this change necessary? --> `amazon-bedrock/anthropic` requires `anthropic_beta` in its request body to enable extended capabilities for anthropic models, like 1M context (context-1m-2025-08-07) and fine-grained tool streaming (fine-grained-tool-streaming-2025-05-14). ## Summary <!-- What did you change? --> - `anthropic`: added `anthropicBeta` and forwarded to downstream providers via transformRequestBody - `amazon-bedrock`: receive betas passed from upstream I also explored handling this gap in `amazon-bedrock` instead (see this [draft PR](#13054) if you're curious). Ultimately I think this is the cleanest solution. If we want to allow both `anthropic` and `bedrock` namespaces, we can handle this on the Gateway / client side via better education. ## Manual Verification <!-- For features & bugfixes. Please explain how you *manually* verified that the change works end-to-end as expected (excluding automated tests). Remove the section if it's not needed (e.g. for docs). --> - added example scripts ## Checklist <!-- Do not edit this list. Leave items unchecked that don't apply. If you need to track subtasks, create a new "## Tasks" section Please check if the PR fulfills the following requirements: --> - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work - Make these changes in v6 too ## Related Issues
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
Bedrock requires
anthropic_betain its request body to enable extended capabilities like 1M context (context-1m-2025-08-07) and fine-grained tool streaming (fine-grained-tool-streaming-2025-05-14).Summary
By design,
bedrock/anthropicwas ignoring providerOptions.bedrock.anthropicBeta.Why not pass beta from anthropic back to bedrock?
Manual Verification
Checklist
pnpm changesetin the project root)Future Work
Related Issues