@ai-sdk/amazon-bedrock 5.0.0-beta.13 → 5.0.0-beta.15
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/docs/08-amazon-bedrock.mdx +6 -6
- 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
|
@@ -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
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
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
|
-
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
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.
|
|
2044
|
+
var VERSION = true ? "5.0.0-beta.15" : "0.0.0-test";
|
|
2042
2045
|
|
|
2043
2046
|
// src/bedrock-sigv4-fetch.ts
|
|
2044
2047
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|