@ai-sdk/amazon-bedrock 5.0.82 → 5.0.84
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 +18 -0
- package/dist/anthropic/index.d.ts +1 -1
- package/dist/anthropic/index.js +9 -1
- package/dist/anthropic/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mantle/index.cjs +1 -1
- package/dist/mantle/index.js +1 -1
- package/docs/08-amazon-bedrock.mdx +2 -0
- package/package.json +5 -5
- package/src/amazon-bedrock-chat-language-model-options.ts +3 -0
- package/src/anthropic/amazon-bedrock-anthropic-options.ts +3 -0
- package/src/anthropic/amazon-bedrock-anthropic-provider.ts +17 -0
package/dist/mantle/index.cjs
CHANGED
|
@@ -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.
|
|
38
|
+
var VERSION = true ? "5.0.84" : "0.0.0-test";
|
|
39
39
|
|
|
40
40
|
// src/amazon-bedrock-sigv4-fetch.ts
|
|
41
41
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|
package/dist/mantle/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { AwsV4Signer } from "aws4fetch";
|
|
24
24
|
|
|
25
25
|
// src/version.ts
|
|
26
|
-
var VERSION = true ? "5.0.
|
|
26
|
+
var VERSION = true ? "5.0.84" : "0.0.0-test";
|
|
27
27
|
|
|
28
28
|
// src/amazon-bedrock-sigv4-fetch.ts
|
|
29
29
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|
|
@@ -1719,6 +1719,7 @@ const result = await generateText({
|
|
|
1719
1719
|
|
|
1720
1720
|
Anthropic has reasoning support for Claude 3.7 and Claude 4 models on Bedrock, including:
|
|
1721
1721
|
|
|
1722
|
+
- `us.anthropic.claude-fable-5-1`
|
|
1722
1723
|
- `us.anthropic.claude-sonnet-5`
|
|
1723
1724
|
- `us.anthropic.claude-fable-5`
|
|
1724
1725
|
- `us.anthropic.claude-opus-4-8`
|
|
@@ -1764,6 +1765,7 @@ on how to integrate reasoning into your chatbot.
|
|
|
1764
1765
|
|
|
1765
1766
|
| Model | Image Input | Object Generation | Tool Usage | Computer Use | Reasoning |
|
|
1766
1767
|
| ---------------------------------------------- | ----------- | ----------------- | ---------- | ------------ | --------- |
|
|
1768
|
+
| `us.anthropic.claude-fable-5-1` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
1767
1769
|
| `us.anthropic.claude-sonnet-5` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
1768
1770
|
| `us.anthropic.claude-fable-5` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
1769
1771
|
| `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.
|
|
3
|
+
"version": "5.0.84",
|
|
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.
|
|
45
|
-
"@ai-sdk/openai": "4.0.
|
|
46
|
-
"@ai-sdk/provider": "4.0.
|
|
47
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
44
|
+
"@ai-sdk/anthropic": "4.0.54",
|
|
45
|
+
"@ai-sdk/openai": "4.0.67",
|
|
46
|
+
"@ai-sdk/provider": "4.0.15",
|
|
47
|
+
"@ai-sdk/provider-utils": "5.0.41",
|
|
48
48
|
"@smithy/eventstream-codec": "^4.3.3",
|
|
49
49
|
"@smithy/util-utf8": "^4.3.3",
|
|
50
50
|
"aws4fetch": "^1.0.20"
|
|
@@ -9,6 +9,7 @@ export type AmazonBedrockChatModelId =
|
|
|
9
9
|
| 'anthropic.claude-instant-v1'
|
|
10
10
|
| 'anthropic.claude-sonnet-5'
|
|
11
11
|
| 'anthropic.claude-fable-5'
|
|
12
|
+
| 'anthropic.claude-fable-5-1'
|
|
12
13
|
| 'anthropic.claude-opus-4-8'
|
|
13
14
|
| 'anthropic.claude-opus-4-7'
|
|
14
15
|
| 'anthropic.claude-opus-4-6-v1'
|
|
@@ -60,6 +61,7 @@ export type AmazonBedrockChatModelId =
|
|
|
60
61
|
| 'us.anthropic.claude-3-7-sonnet-20250219-v1:0'
|
|
61
62
|
| 'us.anthropic.claude-sonnet-5'
|
|
62
63
|
| 'us.anthropic.claude-fable-5'
|
|
64
|
+
| 'us.anthropic.claude-fable-5-1'
|
|
63
65
|
| 'us.anthropic.claude-opus-4-8'
|
|
64
66
|
| 'us.anthropic.claude-opus-4-7'
|
|
65
67
|
| 'us.anthropic.claude-opus-4-6-v1'
|
|
@@ -70,6 +72,7 @@ export type AmazonBedrockChatModelId =
|
|
|
70
72
|
| 'us.anthropic.claude-opus-4-20250514-v1:0'
|
|
71
73
|
| 'us.anthropic.claude-opus-4-1-20250805-v1:0'
|
|
72
74
|
| 'us.anthropic.claude-haiku-4-5-20251001-v1:0'
|
|
75
|
+
| 'global.anthropic.claude-fable-5-1'
|
|
73
76
|
| 'us.meta.llama3-2-11b-instruct-v1:0'
|
|
74
77
|
| 'us.meta.llama3-2-3b-instruct-v1:0'
|
|
75
78
|
| 'us.meta.llama3-2-90b-instruct-v1:0'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type AmazonBedrockAnthropicModelId =
|
|
2
2
|
| 'anthropic.claude-sonnet-5'
|
|
3
3
|
| 'anthropic.claude-fable-5'
|
|
4
|
+
| 'anthropic.claude-fable-5-1'
|
|
4
5
|
| 'anthropic.claude-opus-4-8'
|
|
5
6
|
| 'anthropic.claude-opus-4-7'
|
|
6
7
|
| 'anthropic.claude-opus-4-6-v1'
|
|
@@ -20,6 +21,7 @@ export type AmazonBedrockAnthropicModelId =
|
|
|
20
21
|
| 'anthropic.claude-3-haiku-20240307-v1:0'
|
|
21
22
|
| 'us.anthropic.claude-sonnet-5'
|
|
22
23
|
| 'us.anthropic.claude-fable-5'
|
|
24
|
+
| 'us.anthropic.claude-fable-5-1'
|
|
23
25
|
| 'us.anthropic.claude-opus-4-8'
|
|
24
26
|
| 'us.anthropic.claude-opus-4-7'
|
|
25
27
|
| 'us.anthropic.claude-opus-4-6-v1'
|
|
@@ -37,4 +39,5 @@ export type AmazonBedrockAnthropicModelId =
|
|
|
37
39
|
| 'us.anthropic.claude-3-opus-20240229-v1:0'
|
|
38
40
|
| 'us.anthropic.claude-3-sonnet-20240229-v1:0'
|
|
39
41
|
| 'us.anthropic.claude-3-haiku-20240307-v1:0'
|
|
42
|
+
| 'global.anthropic.claude-fable-5-1'
|
|
40
43
|
| (string & {});
|
|
@@ -275,6 +275,7 @@ export function createAmazonBedrockAnthropic(
|
|
|
275
275
|
model: _model,
|
|
276
276
|
stream: _stream,
|
|
277
277
|
tool_choice,
|
|
278
|
+
thinking,
|
|
278
279
|
tools,
|
|
279
280
|
...rest
|
|
280
281
|
} = args;
|
|
@@ -287,6 +288,21 @@ export function createAmazonBedrockAnthropic(
|
|
|
287
288
|
}
|
|
288
289
|
: undefined;
|
|
289
290
|
|
|
291
|
+
// Bedrock names the thinking block binding field `mismatch_behavior`, while the
|
|
292
|
+
// Anthropic Messages API names it `prefix_mismatch_behavior`
|
|
293
|
+
// Some AWS regions (us-east-1) will automatically alias the field to `mismatch_behavior`,
|
|
294
|
+
// but others (eu-central-1) fail.
|
|
295
|
+
const transformedThinking =
|
|
296
|
+
thinking?.block_binding != null
|
|
297
|
+
? {
|
|
298
|
+
...thinking,
|
|
299
|
+
block_binding: {
|
|
300
|
+
mismatch_behavior:
|
|
301
|
+
thinking.block_binding.prefix_mismatch_behavior,
|
|
302
|
+
},
|
|
303
|
+
}
|
|
304
|
+
: thinking;
|
|
305
|
+
|
|
290
306
|
const requiredBetas = new Set<string>(betas);
|
|
291
307
|
const transformedTools = tools?.map(
|
|
292
308
|
(rawTool: Record<string, unknown>) => {
|
|
@@ -337,6 +353,7 @@ export function createAmazonBedrockAnthropic(
|
|
|
337
353
|
|
|
338
354
|
return {
|
|
339
355
|
...rest,
|
|
356
|
+
...(thinking != null ? { thinking: transformedThinking } : {}),
|
|
340
357
|
...(transformedTools != null ? { tools: transformedTools } : {}),
|
|
341
358
|
...(transformedToolChoice != null
|
|
342
359
|
? { tool_choice: transformedToolChoice }
|