@ai-sdk/amazon-bedrock 4.0.89 → 4.0.91

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/dist/index.mjs CHANGED
@@ -574,12 +574,15 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
574
574
  const message = block.messages[j];
575
575
  const isLastMessage = j === block.messages.length - 1;
576
576
  const { content } = message;
577
+ const hasReasoningBlocks = content.some(
578
+ (part) => part.type === "reasoning"
579
+ );
577
580
  for (let k = 0; k < content.length; k++) {
578
581
  const part = content[k];
579
582
  const isLastContentPart = k === content.length - 1;
580
583
  switch (part.type) {
581
584
  case "text": {
582
- if (!part.text.trim()) {
585
+ if (!part.text.trim() && !hasReasoningBlocks) {
583
586
  break;
584
587
  }
585
588
  bedrockContent.push({
@@ -1066,7 +1069,7 @@ var BedrockChatLanguageModel = class {
1066
1069
  const content = [];
1067
1070
  let isJsonResponseFromTool = false;
1068
1071
  for (const part of response.output.message.content) {
1069
- if (part.text) {
1072
+ if (part.text != null) {
1070
1073
  content.push({ type: "text", text: part.text });
1071
1074
  }
1072
1075
  if (part.reasoningContent) {
@@ -1989,7 +1992,7 @@ import {
1989
1992
  import { AwsV4Signer } from "aws4fetch";
1990
1993
 
1991
1994
  // src/version.ts
1992
- var VERSION = true ? "4.0.89" : "0.0.0-test";
1995
+ var VERSION = true ? "4.0.91" : "0.0.0-test";
1993
1996
 
1994
1997
  // src/bedrock-sigv4-fetch.ts
1995
1998
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {