@ai-sdk/amazon-bedrock 4.0.94 → 4.0.96
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 +13 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/bedrock-chat-language-model.ts +19 -0
- package/src/bedrock-chat-options.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/amazon-bedrock",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.96",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@smithy/eventstream-codec": "^4.0.1",
|
|
39
39
|
"@smithy/util-utf8": "^4.0.0",
|
|
40
40
|
"aws4fetch": "^1.0.20",
|
|
41
|
-
"@ai-sdk/anthropic": "3.0.
|
|
41
|
+
"@ai-sdk/anthropic": "3.0.71",
|
|
42
42
|
"@ai-sdk/provider-utils": "4.0.23",
|
|
43
43
|
"@ai-sdk/provider": "3.0.8"
|
|
44
44
|
},
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"tsup": "^8.3.0",
|
|
48
48
|
"typescript": "5.8.3",
|
|
49
49
|
"zod": "3.25.76",
|
|
50
|
-
"@ai-
|
|
51
|
-
"@
|
|
50
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
51
|
+
"@ai-sdk/test-server": "1.0.3"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -194,6 +194,10 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
|
|
|
194
194
|
thinkingType === 'enabled'
|
|
195
195
|
? bedrockOptions.reasoningConfig?.budgetTokens
|
|
196
196
|
: undefined;
|
|
197
|
+
const thinkingDisplay =
|
|
198
|
+
thinkingType === 'adaptive'
|
|
199
|
+
? bedrockOptions.reasoningConfig?.display
|
|
200
|
+
: undefined;
|
|
197
201
|
const isAnthropicThinkingEnabled = isAnthropicModel && isThinkingEnabled;
|
|
198
202
|
|
|
199
203
|
const inferenceConfig = {
|
|
@@ -223,6 +227,7 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
|
|
|
223
227
|
...bedrockOptions.additionalModelRequestFields,
|
|
224
228
|
thinking: {
|
|
225
229
|
type: 'adaptive',
|
|
230
|
+
...(thinkingDisplay != null && { display: thinkingDisplay }),
|
|
226
231
|
},
|
|
227
232
|
};
|
|
228
233
|
}
|
|
@@ -851,6 +856,13 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
|
|
|
851
856
|
'signature' in reasoningContent &&
|
|
852
857
|
reasoningContent.signature
|
|
853
858
|
) {
|
|
859
|
+
if (contentBlocks[blockIndex] == null) {
|
|
860
|
+
contentBlocks[blockIndex] = { type: 'reasoning' };
|
|
861
|
+
controller.enqueue({
|
|
862
|
+
type: 'reasoning-start',
|
|
863
|
+
id: String(blockIndex),
|
|
864
|
+
});
|
|
865
|
+
}
|
|
854
866
|
controller.enqueue({
|
|
855
867
|
type: 'reasoning-delta',
|
|
856
868
|
id: String(blockIndex),
|
|
@@ -862,6 +874,13 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
|
|
|
862
874
|
},
|
|
863
875
|
});
|
|
864
876
|
} else if ('data' in reasoningContent && reasoningContent.data) {
|
|
877
|
+
if (contentBlocks[blockIndex] == null) {
|
|
878
|
+
contentBlocks[blockIndex] = { type: 'reasoning' };
|
|
879
|
+
controller.enqueue({
|
|
880
|
+
type: 'reasoning-start',
|
|
881
|
+
id: String(blockIndex),
|
|
882
|
+
});
|
|
883
|
+
}
|
|
865
884
|
controller.enqueue({
|
|
866
885
|
type: 'reasoning-delta',
|
|
867
886
|
id: String(blockIndex),
|
|
@@ -117,7 +117,10 @@ export const amazonBedrockLanguageModelOptions = z.object({
|
|
|
117
117
|
])
|
|
118
118
|
.optional(),
|
|
119
119
|
budgetTokens: z.number().optional(),
|
|
120
|
-
maxReasoningEffort: z
|
|
120
|
+
maxReasoningEffort: z
|
|
121
|
+
.enum(['low', 'medium', 'high', 'xhigh', 'max'])
|
|
122
|
+
.optional(),
|
|
123
|
+
display: z.enum(['omitted', 'summarized']).optional(),
|
|
121
124
|
})
|
|
122
125
|
.optional(),
|
|
123
126
|
/**
|