@ai-sdk/amazon-bedrock 4.0.84 → 4.0.86
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 +12 -0
- package/dist/anthropic/index.js +19 -1
- package/dist/anthropic/index.js.map +1 -1
- package/dist/anthropic/index.mjs +19 -1
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/index.js +29 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/anthropic/bedrock-anthropic-fetch.ts +26 -0
- package/src/convert-to-bedrock-chat-messages.ts +33 -25
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
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
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
|
-
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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.
|
|
1976
|
+
var VERSION = true ? "4.0.86" : "0.0.0-test";
|
|
1974
1977
|
|
|
1975
1978
|
// src/bedrock-sigv4-fetch.ts
|
|
1976
1979
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|