fix(core): detect Bedrock Anthropic model IDs - #2682
Open
uuzzrm wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 225ba80 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
Local verification is complete: the core build, lint, typecheck, and focused Bedrock regression tests pass. The GitHub Actions runs currently show |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Client as AI SDK Client
participant Infer as inferProviderName()
participant OptMap as ProviderOptionMap
Client->>Infer: modelId (e.g. "us.anthropic.claude-sonnet-4-6[1m]")
Infer->>Infer: const [providerName] = modelId.split("/")
alt modelId contains "/" (standard provider/model)
Infer-->>Client: return providerName (e.g. "openai")
else no "/" present
alt regex matches /^(?:[a-z0-9-]+\.)?anthropic\./i
Infer-->>Client: NEW: return "anthropic" (Bedrock style)
else no match (legacy bare model ID)
Infer-->>Client: return providerName (original value)
end
end
Client->>OptMap: get provider options for "anthropic"
OptMap-->>Client: anthropic: { structuredOutputMode: "auto" }
Note over Client,OptMap: Provider-specific structured output options are now applied for Bedrock Anthropic model IDs.
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.
Fixes #2565
AISdkClientinfers provider-specific options from the model ID. AWS Bedrock Anthropic IDs useanthropic.<model>orregion.anthropic.<model>, so they do not match the existingprovider/modelformat and miss Anthropic'sstructuredOutputMode: "auto"option.This change:
@browserbasehq/stagehandVerification: