@ai-sdk/amazon-bedrock 4.0.90 → 4.0.92

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/amazon-bedrock",
3
- "version": "4.0.90",
3
+ "version": "4.0.92",
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.67",
41
+ "@ai-sdk/anthropic": "3.0.68",
42
42
  "@ai-sdk/provider": "3.0.8",
43
43
  "@ai-sdk/provider-utils": "4.0.23"
44
44
  },
@@ -447,7 +447,7 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
447
447
  // map response content to content array
448
448
  for (const part of response.output.message.content) {
449
449
  // text
450
- if (part.text) {
450
+ if (part.text != null) {
451
451
  content.push({ type: 'text', text: part.text });
452
452
  }
453
453
 
@@ -253,6 +253,9 @@ export async function convertToBedrockChatMessages(
253
253
  const message = block.messages[j];
254
254
  const isLastMessage = j === block.messages.length - 1;
255
255
  const { content } = message;
256
+ const hasReasoningBlocks = content.some(
257
+ part => part.type === 'reasoning',
258
+ );
256
259
 
257
260
  for (let k = 0; k < content.length; k++) {
258
261
  const part = content[k];
@@ -260,8 +263,8 @@ export async function convertToBedrockChatMessages(
260
263
 
261
264
  switch (part.type) {
262
265
  case 'text': {
263
- // Skip empty text blocks
264
- if (!part.text.trim()) {
266
+ // Skip empty text blocks unless reasoning blocks are present
267
+ if (!part.text.trim() && !hasReasoningBlocks) {
265
268
  break;
266
269
  }
267
270