ai icon indicating copy to clipboard operation
ai copied to clipboard

docs: correct Amazon Bedrock reasoning provider option example

Open brianprost opened this issue 9 months ago • 1 comments

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

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

Future Work

None

brianprost avatar Apr 15 '25 00:04 brianprost

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

lgrammel avatar Apr 16 '25 06:04 lgrammel

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

fixed, and PR updated! 🙃

brianprost avatar Jun 16 '25 15:06 brianprost