@ai-sdk/amazon-bedrock 5.0.0-beta.13 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 5.0.0-beta.14
4
+
5
+ ### Patch Changes
6
+
7
+ - b0c59e8: fix(amazon-bedrock): preserve reasoning text when signature is present
8
+
3
9
  ## 5.0.0-beta.13
4
10
 
5
11
  ### Patch Changes
@@ -35,7 +35,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
35
35
  var import_aws4fetch = require("aws4fetch");
36
36
 
37
37
  // src/version.ts
38
- var VERSION = true ? "5.0.0-beta.13" : "0.0.0-test";
38
+ var VERSION = true ? "5.0.0-beta.14" : "0.0.0-test";
39
39
 
40
40
  // src/bedrock-sigv4-fetch.ts
41
41
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
@@ -24,7 +24,7 @@ import {
24
24
  import { AwsV4Signer } from "aws4fetch";
25
25
 
26
26
  // src/version.ts
27
- var VERSION = true ? "5.0.0-beta.13" : "0.0.0-test";
27
+ var VERSION = true ? "5.0.0-beta.14" : "0.0.0-test";
28
28
 
29
29
  // src/bedrock-sigv4-fetch.ts
30
30
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
package/dist/index.js CHANGED
@@ -594,33 +594,36 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
594
594
  providerOptions: part.providerOptions,
595
595
  schema: bedrockReasoningMetadataSchema
596
596
  });
597
- if (reasoningMetadata != null) {
598
- if (reasoningMetadata.signature != null) {
599
- bedrockContent.push({
600
- reasoningContent: {
601
- reasoningText: {
602
- // trim the last text part if it's the last message in the block
603
- // because Bedrock does not allow trailing whitespace
604
- // in pre-filled assistant responses
605
- text: trimIfLast(
606
- isLastBlock,
607
- isLastMessage,
608
- isLastContentPart,
609
- part.text
610
- ),
611
- signature: reasoningMetadata.signature
612
- }
597
+ if ((reasoningMetadata == null ? void 0 : reasoningMetadata.signature) != null) {
598
+ bedrockContent.push({
599
+ reasoningContent: {
600
+ reasoningText: {
601
+ text: part.text,
602
+ signature: reasoningMetadata.signature
613
603
  }
614
- });
615
- } else if (reasoningMetadata.redactedData != null) {
616
- bedrockContent.push({
617
- reasoningContent: {
618
- redactedReasoning: {
619
- data: reasoningMetadata.redactedData
620
- }
604
+ }
605
+ });
606
+ } else if ((reasoningMetadata == null ? void 0 : reasoningMetadata.redactedData) != null) {
607
+ bedrockContent.push({
608
+ reasoningContent: {
609
+ redactedReasoning: {
610
+ data: reasoningMetadata.redactedData
621
611
  }
622
- });
623
- }
612
+ }
613
+ });
614
+ } else {
615
+ bedrockContent.push({
616
+ reasoningContent: {
617
+ reasoningText: {
618
+ text: trimIfLast(
619
+ isLastBlock,
620
+ isLastMessage,
621
+ isLastContentPart,
622
+ part.text
623
+ )
624
+ }
625
+ }
626
+ });
624
627
  }
625
628
  break;
626
629
  }
@@ -2014,7 +2017,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
2014
2017
  var import_aws4fetch = require("aws4fetch");
2015
2018
 
2016
2019
  // src/version.ts
2017
- var VERSION = true ? "5.0.0-beta.13" : "0.0.0-test";
2020
+ var VERSION = true ? "5.0.0-beta.14" : "0.0.0-test";
2018
2021
 
2019
2022
  // src/bedrock-sigv4-fetch.ts
2020
2023
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {