@ai-sdk/amazon-bedrock 4.0.0-beta.58 → 4.0.0-beta.60
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 +14 -0
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -176,6 +176,7 @@ async function prepareTools({
|
|
|
176
176
|
toolChoice,
|
|
177
177
|
modelId
|
|
178
178
|
}) {
|
|
179
|
+
var _a;
|
|
179
180
|
const toolWarnings = [];
|
|
180
181
|
const betas = /* @__PURE__ */ new Set();
|
|
181
182
|
if (tools == null || tools.length === 0) {
|
|
@@ -264,7 +265,7 @@ async function prepareTools({
|
|
|
264
265
|
bedrockTools.push({
|
|
265
266
|
toolSpec: {
|
|
266
267
|
name: tool.name,
|
|
267
|
-
description: tool.description,
|
|
268
|
+
...((_a = tool.description) == null ? void 0 : _a.trim()) !== "" ? { description: tool.description } : {},
|
|
268
269
|
inputSchema: {
|
|
269
270
|
json: tool.inputSchema
|
|
270
271
|
}
|
|
@@ -713,6 +714,21 @@ var BedrockChatLanguageModel = class {
|
|
|
713
714
|
setting: "seed"
|
|
714
715
|
});
|
|
715
716
|
}
|
|
717
|
+
if (temperature != null && temperature > 1) {
|
|
718
|
+
warnings.push({
|
|
719
|
+
type: "unsupported-setting",
|
|
720
|
+
setting: "temperature",
|
|
721
|
+
details: `${temperature} exceeds bedrock maximum of 1.0. clamped to 1.0`
|
|
722
|
+
});
|
|
723
|
+
temperature = 1;
|
|
724
|
+
} else if (temperature != null && temperature < 0) {
|
|
725
|
+
warnings.push({
|
|
726
|
+
type: "unsupported-setting",
|
|
727
|
+
setting: "temperature",
|
|
728
|
+
details: `${temperature} is below bedrock minimum of 0. clamped to 0`
|
|
729
|
+
});
|
|
730
|
+
temperature = 0;
|
|
731
|
+
}
|
|
716
732
|
if (responseFormat != null && responseFormat.type !== "text" && responseFormat.type !== "json") {
|
|
717
733
|
warnings.push({
|
|
718
734
|
type: "unsupported-setting",
|
|
@@ -1526,7 +1542,7 @@ import {
|
|
|
1526
1542
|
import { AwsV4Signer } from "aws4fetch";
|
|
1527
1543
|
|
|
1528
1544
|
// src/version.ts
|
|
1529
|
-
var VERSION = true ? "4.0.0-beta.
|
|
1545
|
+
var VERSION = true ? "4.0.0-beta.60" : "0.0.0-test";
|
|
1530
1546
|
|
|
1531
1547
|
// src/bedrock-sigv4-fetch.ts
|
|
1532
1548
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|