@ai-sdk/amazon-bedrock 4.0.103 → 4.0.104
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 +6 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/index.js +1 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/convert-to-bedrock-chat-messages.ts +4 -28
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.104",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -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.5"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -319,35 +319,11 @@ export async function convertToBedrockChatMessages(
|
|
|
319
319
|
},
|
|
320
320
|
},
|
|
321
321
|
});
|
|
322
|
-
} else if (
|
|
323
|
-
part.providerOptions == null ||
|
|
324
|
-
Object.keys(part.providerOptions).every(
|
|
325
|
-
k => k === 'bedrock' || k === 'amazonBedrock',
|
|
326
|
-
)
|
|
327
|
-
) {
|
|
328
|
-
// No foreign-provider metadata — preserve text. This covers
|
|
329
|
-
// the prefill case where the caller hand-crafts a reasoning
|
|
330
|
-
// block without a signature. Forwarding reasoning that was
|
|
331
|
-
// signed by a different provider (e.g. anthropic) would
|
|
332
|
-
// cause Bedrock to reject with
|
|
333
|
-
// `thinking.signature: Field required`, so we drop those.
|
|
334
|
-
// trim the last text part if it's the last message in the
|
|
335
|
-
// block because Bedrock does not allow trailing whitespace
|
|
336
|
-
// in pre-filled assistant responses
|
|
337
|
-
bedrockContent.push({
|
|
338
|
-
reasoningContent: {
|
|
339
|
-
reasoningText: {
|
|
340
|
-
text: trimIfLast(
|
|
341
|
-
isLastBlock,
|
|
342
|
-
isLastMessage,
|
|
343
|
-
isLastContentPart,
|
|
344
|
-
part.text,
|
|
345
|
-
),
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
});
|
|
349
322
|
}
|
|
350
|
-
|
|
323
|
+
// Unsigned reasoning is intentionally not replayed. Some
|
|
324
|
+
// Bedrock models (for example OpenAI gpt-oss) return reasoning
|
|
325
|
+
// without a signature; sending it back in multi-turn tool use
|
|
326
|
+
// can leak raw reasoning into the visible response.
|
|
351
327
|
break;
|
|
352
328
|
}
|
|
353
329
|
|