@ai-sdk/amazon-bedrock 4.0.83 → 4.0.85

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
@@ -593,33 +593,36 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
593
593
  providerOptions: part.providerOptions,
594
594
  schema: bedrockReasoningMetadataSchema
595
595
  });
596
- if (reasoningMetadata != null) {
597
- if (reasoningMetadata.signature != null) {
598
- bedrockContent.push({
599
- reasoningContent: {
600
- reasoningText: {
601
- // trim the last text part if it's the last message in the block
602
- // because Bedrock does not allow trailing whitespace
603
- // in pre-filled assistant responses
604
- text: trimIfLast(
605
- isLastBlock,
606
- isLastMessage,
607
- isLastContentPart,
608
- part.text
609
- ),
610
- signature: reasoningMetadata.signature
611
- }
596
+ if ((reasoningMetadata == null ? void 0 : reasoningMetadata.signature) != null) {
597
+ bedrockContent.push({
598
+ reasoningContent: {
599
+ reasoningText: {
600
+ text: part.text,
601
+ signature: reasoningMetadata.signature
612
602
  }
613
- });
614
- } else if (reasoningMetadata.redactedData != null) {
615
- bedrockContent.push({
616
- reasoningContent: {
617
- redactedReasoning: {
618
- data: reasoningMetadata.redactedData
619
- }
603
+ }
604
+ });
605
+ } else if ((reasoningMetadata == null ? void 0 : reasoningMetadata.redactedData) != null) {
606
+ bedrockContent.push({
607
+ reasoningContent: {
608
+ redactedReasoning: {
609
+ data: reasoningMetadata.redactedData
620
610
  }
621
- });
622
- }
611
+ }
612
+ });
613
+ } else {
614
+ bedrockContent.push({
615
+ reasoningContent: {
616
+ reasoningText: {
617
+ text: trimIfLast(
618
+ isLastBlock,
619
+ isLastMessage,
620
+ isLastContentPart,
621
+ part.text
622
+ )
623
+ }
624
+ }
625
+ });
623
626
  }
624
627
  break;
625
628
  }
@@ -1970,7 +1973,7 @@ import {
1970
1973
  import { AwsV4Signer } from "aws4fetch";
1971
1974
 
1972
1975
  // src/version.ts
1973
- var VERSION = true ? "4.0.83" : "0.0.0-test";
1976
+ var VERSION = true ? "4.0.85" : "0.0.0-test";
1974
1977
 
1975
1978
  // src/bedrock-sigv4-fetch.ts
1976
1979
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {