Skip to content

docs: correct Amazon Bedrock reasoning provider option example #5773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brianprost
Copy link

Background

The docs detail that to enable reasoning for models in Amazon Bedrock, you should set the reasoning_config provider option. However, in the code snippit, the provider option is in camelCase:

const { text, reasoning, reasoningDetails } = await generateText({
  model: bedrock('us.anthropic.claude-3-7-sonnet-20250219-v1:0'),
  prompt: 'How many people will live in the world in 2040?',
  providerOptions: {
    bedrock: {
      // before (does not work): reasoningConfig: { type: 'enabled', budgetTokens: 1024 },
      reasoning_config: { type: 'enabled', budgetTokens: 1024 }, // works
    },
  },
});

Summary

I corrected the code example to use the snake_case casing convention, and confirmed that it worked.

Tasks

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If required, a patch changeset for relevant packages has been added
  • You've run pnpm prettier-fix to fix any formatting issues

Future Work

None

@brianprost brianprost changed the title Docs: Correct Amazon Bedrock reasoning provider option docs: correct Amazon Bedrock reasoning provider option Apr 15, 2025
@brianprost brianprost changed the title docs: correct Amazon Bedrock reasoning provider option docs: correct Amazon Bedrock reasoning provider option example Apr 15, 2025
@@ -368,7 +368,7 @@ const { text, reasoning, reasoningDetails } = await generateText({
prompt: 'How many people will live in the world in 2040?',
providerOptions: {
bedrock: {
reasoningConfig: { type: 'enabled', budgetTokens: 1024 },
reasoning_config: { type: 'enabled', budgetTokens: 1024 },
Copy link
Collaborator

@gr2m gr2m Apr 15, 2025

Choose a reason for hiding this comment

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

Thanks Brian for your contribution!

Changes look good to me for the current version. It seems to have been incorrect since the docs where added: https://github.com/vercel/ai/pull/4980/files#diff-7ad7b5eb5101f87657c996a90d248af47e3d0968bca01d4c917273e5a74d486eR334

@lgrammel
Copy link
Collaborator

This should be fixed in the provider instead (bug).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants