@ai-sdk/amazon-bedrock 5.0.97 → 5.0.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
35
35
  var import_aws4fetch = require("aws4fetch");
36
36
 
37
37
  // src/version.ts
38
- var VERSION = true ? "5.0.97" : "0.0.0-test";
38
+ var VERSION = true ? "5.0.99" : "0.0.0-test";
39
39
 
40
40
  // src/amazon-bedrock-sigv4-fetch.ts
41
41
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
@@ -23,7 +23,7 @@ import {
23
23
  import { AwsV4Signer } from "aws4fetch";
24
24
 
25
25
  // src/version.ts
26
- var VERSION = true ? "5.0.97" : "0.0.0-test";
26
+ var VERSION = true ? "5.0.99" : "0.0.0-test";
27
27
 
28
28
  // src/amazon-bedrock-sigv4-fetch.ts
29
29
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
@@ -544,7 +544,7 @@ const cyberpunkAnalysis =
544
544
  '... literary analysis of cyberpunk themes and concepts ...';
545
545
 
546
546
  const result = await generateText({
547
- model: amazonBedrock('us.anthropic.claude-sonnet-5'),
547
+ model: amazonBedrock('us.anthropic.claude-sonnet-5-5'),
548
548
  messages: [
549
549
  {
550
550
  role: 'system',
@@ -580,7 +580,7 @@ const cyberpunkAnalysis =
580
580
  '... literary analysis of cyberpunk themes and concepts ...';
581
581
 
582
582
  const result = streamText({
583
- model: amazonBedrock('us.anthropic.claude-sonnet-5'),
583
+ model: amazonBedrock('us.anthropic.claude-sonnet-5-5'),
584
584
  messages: [
585
585
  {
586
586
  role: 'assistant',
@@ -1590,10 +1590,10 @@ You can use the following optional settings to customize the Bedrock Anthropic p
1590
1590
  ### Language Models
1591
1591
 
1592
1592
  You can create models that call the [Anthropic Messages API](https://docs.anthropic.com/claude/reference/messages_post) using the provider instance.
1593
- The first argument is the model id, e.g. `us.anthropic.claude-sonnet-5`.
1593
+ The first argument is the model id, e.g. `us.anthropic.claude-sonnet-5-5`.
1594
1594
 
1595
1595
  ```ts
1596
- const model = bedrockAnthropic('us.anthropic.claude-sonnet-5');
1596
+ const model = bedrockAnthropic('us.anthropic.claude-sonnet-5-5');
1597
1597
  ```
1598
1598
 
1599
1599
  You can use Bedrock Anthropic language models to generate text with the `generateText` function:
@@ -1603,7 +1603,7 @@ import { bedrockAnthropic } from '@ai-sdk/amazon-bedrock/anthropic';
1603
1603
  import { generateText } from 'ai';
1604
1604
 
1605
1605
  const { text } = await generateText({
1606
- model: bedrockAnthropic('us.anthropic.claude-sonnet-5'),
1606
+ model: bedrockAnthropic('us.anthropic.claude-sonnet-5-5'),
1607
1607
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
1608
1608
  });
1609
1609
  ```
@@ -1627,7 +1627,7 @@ import { bedrockAnthropic } from '@ai-sdk/amazon-bedrock/anthropic';
1627
1627
  import { generateText } from 'ai';
1628
1628
 
1629
1629
  const result = await generateText({
1630
- model: bedrockAnthropic('us.anthropic.claude-sonnet-5'),
1630
+ model: bedrockAnthropic('us.anthropic.claude-sonnet-5-5'),
1631
1631
  messages: [
1632
1632
  {
1633
1633
  role: 'system',
@@ -1756,6 +1756,7 @@ const result = await generateText({
1756
1756
  Anthropic has reasoning support for Claude 3.7 and Claude 4 models on Bedrock, including:
1757
1757
 
1758
1758
  - `us.anthropic.claude-fable-5-1`
1759
+ - `us.anthropic.claude-sonnet-5-5`
1759
1760
  - `us.anthropic.claude-sonnet-5`
1760
1761
  - `us.anthropic.claude-fable-5`
1761
1762
  - `us.anthropic.claude-opus-4-8`
@@ -1802,6 +1803,7 @@ on how to integrate reasoning into your chatbot.
1802
1803
  | Model | Image Input | Object Generation | Tool Usage | Computer Use | Reasoning |
1803
1804
  | ---------------------------------------------- | ----------- | ----------------- | ---------- | ------------ | --------- |
1804
1805
  | `us.anthropic.claude-fable-5-1` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
1806
+ | `us.anthropic.claude-sonnet-5-5` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
1805
1807
  | `us.anthropic.claude-sonnet-5` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
1806
1808
  | `us.anthropic.claude-fable-5` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
1807
1809
  | `us.anthropic.claude-opus-4-8` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/amazon-bedrock",
3
- "version": "5.0.97",
3
+ "version": "5.0.99",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -41,10 +41,10 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@ai-sdk/anthropic": "4.0.65",
45
- "@ai-sdk/openai": "4.0.78",
46
- "@ai-sdk/provider": "4.0.18",
47
- "@ai-sdk/provider-utils": "5.0.49",
44
+ "@ai-sdk/anthropic": "4.0.67",
45
+ "@ai-sdk/openai": "4.0.79",
46
+ "@ai-sdk/provider": "4.0.19",
47
+ "@ai-sdk/provider-utils": "5.0.50",
48
48
  "@smithy/eventstream-codec": "^4.3.3",
49
49
  "@smithy/util-utf8": "^4.3.3",
50
50
  "aws4fetch": "^1.0.20"
@@ -8,6 +8,7 @@ export type AmazonBedrockChatModelId =
8
8
  | 'anthropic.claude-v2:1'
9
9
  | 'anthropic.claude-instant-v1'
10
10
  | 'anthropic.claude-sonnet-5'
11
+ | 'anthropic.claude-sonnet-5-5'
11
12
  | 'anthropic.claude-fable-5'
12
13
  | 'anthropic.claude-fable-5-1'
13
14
  | 'anthropic.claude-opus-5'
@@ -62,6 +63,7 @@ export type AmazonBedrockChatModelId =
62
63
  | 'us.anthropic.claude-3-5-sonnet-20241022-v2:0'
63
64
  | 'us.anthropic.claude-3-7-sonnet-20250219-v1:0'
64
65
  | 'us.anthropic.claude-sonnet-5'
66
+ | 'us.anthropic.claude-sonnet-5-5'
65
67
  | 'us.anthropic.claude-fable-5'
66
68
  | 'us.anthropic.claude-fable-5-1'
67
69
  | 'us.anthropic.claude-opus-5'
@@ -234,6 +234,7 @@ export class AmazonBedrockChatLanguageModel implements LanguageModelV4 {
234
234
  const isOpenAIModel = openAIModelId != null;
235
235
  const isOpenAIGptOssModel =
236
236
  openAIModelId?.startsWith('openai.gpt-oss-') ?? false;
237
+ const isNovaReasoningModel = isNova2ReasoningModel(this.modelId);
237
238
  const shouldNormalizeTemperature = !isOpenAIModel || isOpenAIGptOssModel;
238
239
 
239
240
  if (shouldNormalizeTemperature && temperature != null && temperature > 1) {
@@ -495,6 +496,22 @@ export class AmazonBedrockChatLanguageModel implements LanguageModelV4 {
495
496
  }
496
497
  }
497
498
 
499
+ if (
500
+ isNovaReasoningModel &&
501
+ thinkingType === 'enabled' &&
502
+ (maxReasoningEffort === 'high' ||
503
+ maxReasoningEffort === 'xhigh' ||
504
+ maxReasoningEffort === 'max') &&
505
+ inferenceConfig.maxTokens != null
506
+ ) {
507
+ delete inferenceConfig.maxTokens;
508
+ warnings.push({
509
+ type: 'unsupported',
510
+ feature: 'maxOutputTokens',
511
+ details: `maxOutputTokens is not supported by ${this.modelId} when high reasoning is enabled and will be ignored`,
512
+ });
513
+ }
514
+
498
515
  if (useNativeStructuredOutput) {
499
516
  amazonBedrockOptions.additionalModelRequestFields = {
500
517
  ...amazonBedrockOptions.additionalModelRequestFields,
@@ -1603,6 +1620,10 @@ const amazonBedrockReasoningEffortMap: Partial<
1603
1620
  xhigh: 'max',
1604
1621
  };
1605
1622
 
1623
+ function isNova2ReasoningModel(modelId: string): boolean {
1624
+ return modelId.includes('amazon.nova-2-lite-v1:0');
1625
+ }
1626
+
1606
1627
  function resolveAmazonBedrockReasoningConfig({
1607
1628
  reasoning,
1608
1629
  amazonBedrockOptions,
@@ -1626,7 +1647,7 @@ function resolveAmazonBedrockReasoningConfig({
1626
1647
  const hasPortableReasoning = reasoning !== 'none';
1627
1648
  const hasExplicitReasoningConfig =
1628
1649
  amazonBedrockOptions.reasoningConfig != null;
1629
- const isNovaReasoningModel = modelId.includes('amazon.nova-2-lite-v1:0');
1650
+ const isNovaReasoningModel = isNova2ReasoningModel(modelId);
1630
1651
  const supportsPortableReasoning = isOpenAIModel || isNovaReasoningModel;
1631
1652
 
1632
1653
  if (isAnthropicModel) {
@@ -55,6 +55,14 @@ export class AmazonBedrockImageModel implements ImageModelV4 {
55
55
  return modelMaxImagesPerCall[this.modelId] ?? 1;
56
56
  }
57
57
 
58
+ get supportsFileInputs(): boolean | undefined {
59
+ return this.modelId === 'amazon.nova-canvas-v1:0' ? true : undefined;
60
+ }
61
+
62
+ get supportsMaskInputs(): boolean | undefined {
63
+ return this.modelId === 'amazon.nova-canvas-v1:0' ? true : undefined;
64
+ }
65
+
58
66
  private getUrl(modelId: string): string {
59
67
  const encodedModelId = encodeURIComponent(modelId);
60
68
  return `${this.config.baseUrl()}/model/${encodedModelId}/invoke`;
@@ -1,5 +1,6 @@
1
1
  export type AmazonBedrockAnthropicModelId =
2
2
  | 'anthropic.claude-sonnet-5'
3
+ | 'anthropic.claude-sonnet-5-5'
3
4
  | 'anthropic.claude-fable-5'
4
5
  | 'anthropic.claude-fable-5-1'
5
6
  | 'anthropic.claude-opus-5'
@@ -22,6 +23,7 @@ export type AmazonBedrockAnthropicModelId =
22
23
  | 'anthropic.claude-3-sonnet-20240229-v1:0'
23
24
  | 'anthropic.claude-3-haiku-20240307-v1:0'
24
25
  | 'us.anthropic.claude-sonnet-5'
26
+ | 'us.anthropic.claude-sonnet-5-5'
25
27
  | 'us.anthropic.claude-fable-5'
26
28
  | 'us.anthropic.claude-fable-5-1'
27
29
  | 'us.anthropic.claude-opus-5'