Skip to content

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

Merged
aayush-kapoor merged 2 commits intomainfrom
aayush/bedrock-anthropic-native-str-op
Apr 7, 2026
Merged

feat(bedrock): support native structured output for anthropic models without reasoning#14126
aayush-kapoor merged 2 commits intomainfrom
aayush/bedrock-anthropic-native-str-op

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

@aayush-kapoor aayush-kapoor commented Apr 3, 2026

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

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

fixes #12980

@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label bug Something isn't working as documented provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider labels Apr 3, 2026
@aayush-kapoor aayush-kapoor added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 7, 2026
@aayush-kapoor aayush-kapoor merged commit cdc15f3 into main Apr 7, 2026
21 checks passed
@aayush-kapoor aayush-kapoor deleted the aayush/bedrock-anthropic-native-str-op branch April 7, 2026 14:54
vercel-ai-sdk bot pushed a commit that referenced this pull request Apr 7, 2026
…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 removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 7, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 7, 2026

✅ Backport PR created: #14188

@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 7, 2026

🚀 Published in:

Package Version
ai 7.0.0-beta.69
@ai-sdk/alibaba 2.0.0-beta.21
@ai-sdk/amazon-bedrock 5.0.0-beta.25
@ai-sdk/angular 3.0.0-beta.69
@ai-sdk/anthropic 4.0.0-beta.21
@ai-sdk/assemblyai 3.0.0-beta.16
@ai-sdk/azure 4.0.0-beta.25
@ai-sdk/baseten 2.0.0-beta.19
@ai-sdk/black-forest-labs 2.0.0-beta.15
@ai-sdk/bytedance 2.0.0-beta.15
@ai-sdk/cerebras 3.0.0-beta.19
@ai-sdk/cohere 4.0.0-beta.16
@ai-sdk/deepgram 3.0.0-beta.15
@ai-sdk/deepinfra 3.0.0-beta.19
@ai-sdk/deepseek 3.0.0-beta.17
@ai-sdk/devtools 1.0.0-beta.8
@ai-sdk/elevenlabs 3.0.0-beta.15
@ai-sdk/fal 3.0.0-beta.15
@ai-sdk/fireworks 3.0.0-beta.19
@ai-sdk/gateway 4.0.0-beta.38
@ai-sdk/gladia 3.0.0-beta.15
@ai-sdk/google 4.0.0-beta.29
@ai-sdk/google-vertex 5.0.0-beta.38
@ai-sdk/groq 4.0.0-beta.18
@ai-sdk/huggingface 2.0.0-beta.19
@ai-sdk/hume 3.0.0-beta.15
@ai-sdk/klingai 4.0.0-beta.16
@ai-sdk/langchain 3.0.0-beta.69
@ai-sdk/llamaindex 3.0.0-beta.69
@ai-sdk/lmnt 3.0.0-beta.15
@ai-sdk/luma 3.0.0-beta.15
@ai-sdk/mcp 2.0.0-beta.20
@ai-sdk/mistral 4.0.0-beta.17
@ai-sdk/moonshotai 3.0.0-beta.19
@ai-sdk/open-responses 2.0.0-beta.16
@ai-sdk/openai 4.0.0-beta.25
@ai-sdk/openai-compatible 3.0.0-beta.19
@ai-sdk/otel 1.0.0-beta.15
@ai-sdk/perplexity 4.0.0-beta.18
@ai-sdk/prodia 2.0.0-beta.18
@ai-sdk/provider 4.0.0-beta.8
@ai-sdk/provider-utils 5.0.0-beta.14
@ai-sdk/react 4.0.0-beta.69
@ai-sdk/replicate 3.0.0-beta.16
@ai-sdk/revai 3.0.0-beta.16
@ai-sdk/rsc 3.0.0-beta.70
@ai-sdk/svelte 5.0.0-beta.69
@ai-sdk/togetherai 3.0.0-beta.19
@ai-sdk/valibot 3.0.0-beta.14
@ai-sdk/vercel 3.0.0-beta.19
@ai-sdk/vue 4.0.0-beta.69
@ai-sdk/xai 4.0.0-beta.28

gr2m pushed a commit that referenced this pull request Apr 7, 2026
…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
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 bug Something isn't working as documented 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.

Claude 4.x on Bedrock provider doesn't use nativeStructuredOutput, even though supported

2 participants