@ai-sdk/amazon-bedrock 4.0.0-beta.70 → 4.0.0-beta.72
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 +19 -0
- package/dist/index.js +29 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -194,8 +194,8 @@ async function prepareTools({
|
|
|
194
194
|
const supportedTools = tools.filter((tool) => {
|
|
195
195
|
if (tool.type === "provider-defined" && tool.id === "anthropic.web_search_20250305") {
|
|
196
196
|
toolWarnings.push({
|
|
197
|
-
type: "unsupported
|
|
198
|
-
tool,
|
|
197
|
+
type: "unsupported",
|
|
198
|
+
feature: "web_search_20250305 tool",
|
|
199
199
|
details: "The web_search_20250305 tool is not supported on Amazon Bedrock."
|
|
200
200
|
});
|
|
201
201
|
return false;
|
|
@@ -221,8 +221,8 @@ async function prepareTools({
|
|
|
221
221
|
if (usingAnthropicTools) {
|
|
222
222
|
if (functionTools.length > 0) {
|
|
223
223
|
toolWarnings.push({
|
|
224
|
-
type: "unsupported
|
|
225
|
-
|
|
224
|
+
type: "unsupported",
|
|
225
|
+
feature: "mixing Anthropic provider-defined tools and standard function tools",
|
|
226
226
|
details: "Mixed Anthropic provider-defined tools and standard function tools are not supported in a single call to Bedrock. Only Anthropic tools will be used."
|
|
227
227
|
});
|
|
228
228
|
}
|
|
@@ -257,12 +257,12 @@ async function prepareTools({
|
|
|
257
257
|
}
|
|
258
258
|
});
|
|
259
259
|
} else {
|
|
260
|
-
toolWarnings.push({ type: "unsupported
|
|
260
|
+
toolWarnings.push({ type: "unsupported", feature: "tool ${tool.id}" });
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
} else {
|
|
264
264
|
for (const tool of providerDefinedTools) {
|
|
265
|
-
toolWarnings.push({ type: "unsupported
|
|
265
|
+
toolWarnings.push({ type: "unsupported", feature: `tool ${tool.id}` });
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
for (const tool of functionTools) {
|
|
@@ -702,41 +702,41 @@ var BedrockChatLanguageModel = class {
|
|
|
702
702
|
const warnings = [];
|
|
703
703
|
if (frequencyPenalty != null) {
|
|
704
704
|
warnings.push({
|
|
705
|
-
type: "unsupported
|
|
706
|
-
|
|
705
|
+
type: "unsupported",
|
|
706
|
+
feature: "frequencyPenalty"
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
709
|
if (presencePenalty != null) {
|
|
710
710
|
warnings.push({
|
|
711
|
-
type: "unsupported
|
|
712
|
-
|
|
711
|
+
type: "unsupported",
|
|
712
|
+
feature: "presencePenalty"
|
|
713
713
|
});
|
|
714
714
|
}
|
|
715
715
|
if (seed != null) {
|
|
716
716
|
warnings.push({
|
|
717
|
-
type: "unsupported
|
|
718
|
-
|
|
717
|
+
type: "unsupported",
|
|
718
|
+
feature: "seed"
|
|
719
719
|
});
|
|
720
720
|
}
|
|
721
721
|
if (temperature != null && temperature > 1) {
|
|
722
722
|
warnings.push({
|
|
723
|
-
type: "unsupported
|
|
724
|
-
|
|
723
|
+
type: "unsupported",
|
|
724
|
+
feature: "temperature",
|
|
725
725
|
details: `${temperature} exceeds bedrock maximum of 1.0. clamped to 1.0`
|
|
726
726
|
});
|
|
727
727
|
temperature = 1;
|
|
728
728
|
} else if (temperature != null && temperature < 0) {
|
|
729
729
|
warnings.push({
|
|
730
|
-
type: "unsupported
|
|
731
|
-
|
|
730
|
+
type: "unsupported",
|
|
731
|
+
feature: "temperature",
|
|
732
732
|
details: `${temperature} is below bedrock minimum of 0. clamped to 0`
|
|
733
733
|
});
|
|
734
734
|
temperature = 0;
|
|
735
735
|
}
|
|
736
736
|
if (responseFormat != null && responseFormat.type !== "text" && responseFormat.type !== "json") {
|
|
737
737
|
warnings.push({
|
|
738
|
-
type: "unsupported
|
|
739
|
-
|
|
738
|
+
type: "unsupported",
|
|
739
|
+
feature: "responseFormat",
|
|
740
740
|
details: "Only text and json response formats are supported."
|
|
741
741
|
});
|
|
742
742
|
}
|
|
@@ -792,24 +792,24 @@ var BedrockChatLanguageModel = class {
|
|
|
792
792
|
if (isThinking && inferenceConfig.temperature != null) {
|
|
793
793
|
delete inferenceConfig.temperature;
|
|
794
794
|
warnings.push({
|
|
795
|
-
type: "unsupported
|
|
796
|
-
|
|
795
|
+
type: "unsupported",
|
|
796
|
+
feature: "temperature",
|
|
797
797
|
details: "temperature is not supported when thinking is enabled"
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
800
|
if (isThinking && inferenceConfig.topP != null) {
|
|
801
801
|
delete inferenceConfig.topP;
|
|
802
802
|
warnings.push({
|
|
803
|
-
type: "unsupported
|
|
804
|
-
|
|
803
|
+
type: "unsupported",
|
|
804
|
+
feature: "topP",
|
|
805
805
|
details: "topP is not supported when thinking is enabled"
|
|
806
806
|
});
|
|
807
807
|
}
|
|
808
808
|
if (isThinking && inferenceConfig.topK != null) {
|
|
809
809
|
delete inferenceConfig.topK;
|
|
810
810
|
warnings.push({
|
|
811
|
-
type: "unsupported
|
|
812
|
-
|
|
811
|
+
type: "unsupported",
|
|
812
|
+
feature: "topK",
|
|
813
813
|
details: "topK is not supported when thinking is enabled"
|
|
814
814
|
});
|
|
815
815
|
}
|
|
@@ -833,8 +833,8 @@ var BedrockChatLanguageModel = class {
|
|
|
833
833
|
(message) => message.role === "system" || message.content.length > 0
|
|
834
834
|
);
|
|
835
835
|
warnings.push({
|
|
836
|
-
type: "unsupported
|
|
837
|
-
|
|
836
|
+
type: "unsupported",
|
|
837
|
+
feature: "toolContent",
|
|
838
838
|
details: "Tool calls and results removed from conversation because Bedrock does not support tool content without active tools."
|
|
839
839
|
});
|
|
840
840
|
}
|
|
@@ -1505,8 +1505,8 @@ var BedrockImageModel = class {
|
|
|
1505
1505
|
};
|
|
1506
1506
|
if (aspectRatio != void 0) {
|
|
1507
1507
|
warnings.push({
|
|
1508
|
-
type: "unsupported
|
|
1509
|
-
|
|
1508
|
+
type: "unsupported",
|
|
1509
|
+
feature: "aspectRatio",
|
|
1510
1510
|
details: "This model does not support aspect ratio. Use `size` instead."
|
|
1511
1511
|
});
|
|
1512
1512
|
}
|
|
@@ -1552,7 +1552,7 @@ import {
|
|
|
1552
1552
|
import { AwsV4Signer } from "aws4fetch";
|
|
1553
1553
|
|
|
1554
1554
|
// src/version.ts
|
|
1555
|
-
var VERSION = true ? "4.0.0-beta.
|
|
1555
|
+
var VERSION = true ? "4.0.0-beta.72" : "0.0.0-test";
|
|
1556
1556
|
|
|
1557
1557
|
// src/bedrock-sigv4-fetch.ts
|
|
1558
1558
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|