@ai-sdk/amazon-bedrock 5.0.0-beta.12 → 5.0.0-beta.14

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
@@ -597,33 +597,36 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
597
597
  providerOptions: part.providerOptions,
598
598
  schema: bedrockReasoningMetadataSchema
599
599
  });
600
- if (reasoningMetadata != null) {
601
- if (reasoningMetadata.signature != null) {
602
- bedrockContent.push({
603
- reasoningContent: {
604
- reasoningText: {
605
- // trim the last text part if it's the last message in the block
606
- // because Bedrock does not allow trailing whitespace
607
- // in pre-filled assistant responses
608
- text: trimIfLast(
609
- isLastBlock,
610
- isLastMessage,
611
- isLastContentPart,
612
- part.text
613
- ),
614
- signature: reasoningMetadata.signature
615
- }
600
+ if ((reasoningMetadata == null ? void 0 : reasoningMetadata.signature) != null) {
601
+ bedrockContent.push({
602
+ reasoningContent: {
603
+ reasoningText: {
604
+ text: part.text,
605
+ signature: reasoningMetadata.signature
616
606
  }
617
- });
618
- } else if (reasoningMetadata.redactedData != null) {
619
- bedrockContent.push({
620
- reasoningContent: {
621
- redactedReasoning: {
622
- data: reasoningMetadata.redactedData
623
- }
607
+ }
608
+ });
609
+ } else if ((reasoningMetadata == null ? void 0 : reasoningMetadata.redactedData) != null) {
610
+ bedrockContent.push({
611
+ reasoningContent: {
612
+ redactedReasoning: {
613
+ data: reasoningMetadata.redactedData
624
614
  }
625
- });
626
- }
615
+ }
616
+ });
617
+ } else {
618
+ bedrockContent.push({
619
+ reasoningContent: {
620
+ reasoningText: {
621
+ text: trimIfLast(
622
+ isLastBlock,
623
+ isLastMessage,
624
+ isLastContentPart,
625
+ part.text
626
+ )
627
+ }
628
+ }
629
+ });
627
630
  }
628
631
  break;
629
632
  }
@@ -2038,7 +2041,7 @@ import {
2038
2041
  import { AwsV4Signer } from "aws4fetch";
2039
2042
 
2040
2043
  // src/version.ts
2041
- var VERSION = true ? "5.0.0-beta.12" : "0.0.0-test";
2044
+ var VERSION = true ? "5.0.0-beta.14" : "0.0.0-test";
2042
2045
 
2043
2046
  // src/bedrock-sigv4-fetch.ts
2044
2047
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {