Skip to content

Backport: feat(bedrock): support native structured output for anthropic models without reasoning#14188

Closed
vercel-ai-sdk[bot] wants to merge 1 commit intorelease-v6.0from
backport-pr-14126-to-release-v6.0
Closed

Backport: feat(bedrock): support native structured output for anthropic models without reasoning#14188
vercel-ai-sdk[bot] wants to merge 1 commit intorelease-v6.0from
backport-pr-14126-to-release-v6.0

Conversation

@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

@vercel-ai-sdk vercel-ai-sdk bot commented Apr 7, 2026

This is an automated backport of #14126 to the release-v6.0 branch. FYI @aayush-kapoor

…without reasoning (#14126)

## Background

#12980

The bedrock converse API path (bedrock('anthropic.claude-...')) only
used native structured output when thinking/reasoning was enabled.
Without thinking, it always fell back to a JSON tool workaround, even
for models like Claude 4.5/4.6 that natively support structured output
on bedrock.

## Summary

changed the condition to use model capability OR thinking enabled 9since
we already have a function `getModelCapabilities()` to check if the
model natively supports structured output

## Manual Verification

na

## Checklist

- [x] Tests have been added / updated (for bug fixes / features)
- [ ] 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)

## Related Issues

fixes #12980
@vercel-ai-sdk vercel-ai-sdk bot enabled auto-merge (squash) April 7, 2026 14:55
@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label feature New feature or request maintenance CI, internal documentation, automations, etc provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider labels Apr 7, 2026
auto-merge was automatically disabled April 7, 2026 14:58

Pull request was closed

bedrockOptions.reasoningConfig?.type === 'adaptive';

const { supportsStructuredOutput: modelSupportsStructuredOutput } =
getModelCapabilities(this.modelId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getModelCapabilities is called but never defined or imported in bedrock-chat-language-model.ts, causing a ReferenceError at runtime when any Bedrock model is used with structured output or thinking features.

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label feature New feature or request maintenance CI, internal documentation, automations, etc provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant