@ai-sdk/amazon-bedrock 5.0.123 → 5.0.125

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 5.0.125
4
+
5
+ ### Patch Changes
6
+
7
+ - 27a53b4: Fix string interpolation in Amazon Bedrock unsupported provider tool warnings and OpenAI / OpenAI-compatible completion errors for unexpected system messages.
8
+ - Updated dependencies [e64ed82]
9
+ - Updated dependencies [02dbab1]
10
+ - Updated dependencies [27a53b4]
11
+ - @ai-sdk/provider-utils@5.0.69
12
+ - @ai-sdk/openai@4.0.103
13
+ - @ai-sdk/anthropic@4.0.89
14
+
15
+ ## 5.0.124
16
+
17
+ ### Patch Changes
18
+
19
+ - e729d58: chore(docs): update `README.md` for consistent format and to avoid duplication
20
+ - Updated dependencies [5475347]
21
+ - Updated dependencies [e729d58]
22
+ - @ai-sdk/openai@4.0.102
23
+ - @ai-sdk/provider@4.0.34
24
+ - @ai-sdk/provider-utils@5.0.68
25
+ - @ai-sdk/anthropic@4.0.88
26
+
3
27
  ## 5.0.123
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -7,10 +7,8 @@ contains language model support for the Amazon Bedrock [converse API](https://do
7
7
 
8
8
  ## Setup
9
9
 
10
- The Amazon Bedrock provider is available in the `@ai-sdk/amazon-bedrock` module. You can install it with
11
-
12
10
  ```bash
13
- npm i @ai-sdk/amazon-bedrock
11
+ npm i ai @ai-sdk/amazon-bedrock
14
12
  ```
15
13
 
16
14
  ## Skill for Coding Agents
@@ -21,90 +19,7 @@ If you use coding agents such as Claude Code or Cursor, we highly recommend addi
21
19
  npx skills add vercel/ai
22
20
  ```
23
21
 
24
- ## Provider Instance
25
-
26
- You can import the default provider instance `bedrock` from `@ai-sdk/amazon-bedrock`:
27
-
28
- ```ts
29
- import { bedrock } from '@ai-sdk/amazon-bedrock';
30
- ```
31
-
32
- ## Authentication
33
-
34
- The Amazon Bedrock provider supports two authentication methods with automatic fallback:
35
-
36
- ### API Key Authentication (Recommended)
37
-
38
- API key authentication provides a simpler setup process compared to traditional AWS SigV4 authentication. You can authenticate using either environment variables or direct configuration.
39
-
40
- #### Using Environment Variable
41
-
42
- Set the `AWS_BEARER_TOKEN_BEDROCK` environment variable with your API key:
43
-
44
- ```bash
45
- export AWS_BEARER_TOKEN_BEDROCK=your-api-key-here
46
- ```
47
-
48
- ```ts
49
- import { bedrock } from '@ai-sdk/amazon-bedrock';
50
- import { generateText } from 'ai';
51
-
52
- const { text } = await generateText({
53
- model: bedrock('us.anthropic.claude-haiku-5-5'),
54
- prompt: 'Write a vegetarian lasagna recipe for 4 people.',
55
- // API key is automatically loaded from AWS_BEARER_TOKEN_BEDROCK
56
- });
57
- ```
58
-
59
- #### Using Direct Configuration
60
-
61
- You can also pass the API key directly in the provider configuration:
62
-
63
- ```ts
64
- import { bedrock } from '@ai-sdk/amazon-bedrock';
65
- import { generateText } from 'ai';
66
-
67
- const bedrockWithApiKey = bedrock.withSettings({
68
- apiKey: process.env.AWS_BEARER_TOKEN_BEDROCK, // or your API key directly
69
- region: 'us-east-1', // Optional: specify region
70
- });
71
-
72
- const { text } = await generateText({
73
- model: bedrockWithApiKey('us.anthropic.claude-haiku-5-5'),
74
- prompt: 'Write a vegetarian lasagna recipe for 4 people.',
75
- });
76
- ```
77
-
78
- ### SigV4 Authentication (Fallback)
79
-
80
- If no API key is provided, the provider automatically falls back to AWS SigV4 authentication using standard AWS credentials:
81
-
82
- ```ts
83
- import { bedrock } from '@ai-sdk/amazon-bedrock';
84
- import { generateText } from 'ai';
85
-
86
- // Uses AWS credentials from environment variables or AWS credential chain
87
- const { text } = await generateText({
88
- model: bedrock('us.anthropic.claude-haiku-5-5'),
89
- prompt: 'Write a vegetarian lasagna recipe for 4 people.',
90
- });
91
- ```
92
-
93
- This method requires standard AWS environment variables:
94
-
95
- - `AWS_ACCESS_KEY_ID`
96
- - `AWS_SECRET_ACCESS_KEY`
97
- - `AWS_SESSION_TOKEN` (optional, for temporary credentials)
98
-
99
- ### Authentication Precedence
100
-
101
- The provider uses the following authentication precedence:
102
-
103
- 1. **API key from direct configuration** (`apiKey` in `withSettings()`)
104
- 2. **API key from environment variable** (`AWS_BEARER_TOKEN_BEDROCK`)
105
- 3. **SigV4 authentication** (AWS credential chain fallback)
106
-
107
- ## Example
22
+ ## Usage
108
23
 
109
24
  ```ts
110
25
  import { bedrock } from '@ai-sdk/amazon-bedrock';
@@ -116,6 +31,4 @@ const { text } = await generateText({
116
31
  });
117
32
  ```
118
33
 
119
- ## Documentation
120
-
121
- Please check out the **[Amazon Bedrock provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)** for more information.
34
+ See the [Amazon Bedrock Provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock) for more information.
@@ -6,7 +6,7 @@ import { z } from "zod/v4";
6
6
  import { EventStreamCodec } from "@smithy/eventstream-codec";
7
7
  import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
8
8
  //#region src/version.ts
9
- const VERSION = "5.0.123";
9
+ const VERSION = "5.0.125";
10
10
  //#endregion
11
11
  //#region src/amazon-bedrock-sigv4-fetch.ts
12
12
  /**
package/dist/index.js CHANGED
@@ -341,7 +341,7 @@ async function prepareTools$1({ tools, toolChoice, modelId, modelFamily, reasoni
341
341
  } });
342
342
  } else toolWarnings.push({
343
343
  type: "unsupported",
344
- feature: "tool ${tool.id}"
344
+ feature: `tool ${tool.id}`
345
345
  });
346
346
  }
347
347
  } else for (const tool of providerToolsForRequest) toolWarnings.push({
@@ -2334,7 +2334,7 @@ const amazonBedrockImageResponseSchema = lazySchema(() => zodSchema(z.object({
2334
2334
  })));
2335
2335
  //#endregion
2336
2336
  //#region src/version.ts
2337
- const VERSION = "5.0.123";
2337
+ const VERSION = "5.0.125";
2338
2338
  //#endregion
2339
2339
  //#region src/amazon-bedrock-sigv4-fetch.ts
2340
2340
  /**