@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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 4.0.0-beta.60
4
+
5
+ ### Patch Changes
6
+
7
+ - 33343c3: fix(amazon-bedrock): clamp temperature to valid 0-1 range with warnings
8
+ - Updated dependencies [1d15673]
9
+ - @ai-sdk/anthropic@3.0.0-beta.54
10
+
11
+ ## 4.0.0-beta.59
12
+
13
+ ### Patch Changes
14
+
15
+ - 2a2e17d: fix (provider/amazon-bedrock): deal gracefully with empty tool descriptions
16
+
3
17
  ## 4.0.0-beta.58
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -182,6 +182,7 @@ async function prepareTools({
182
182
  toolChoice,
183
183
  modelId
184
184
  }) {
185
+ var _a;
185
186
  const toolWarnings = [];
186
187
  const betas = /* @__PURE__ */ new Set();
187
188
  if (tools == null || tools.length === 0) {
@@ -270,7 +271,7 @@ async function prepareTools({
270
271
  bedrockTools.push({
271
272
  toolSpec: {
272
273
  name: tool.name,
273
- description: tool.description,
274
+ ...((_a = tool.description) == null ? void 0 : _a.trim()) !== "" ? { description: tool.description } : {},
274
275
  inputSchema: {
275
276
  json: tool.inputSchema
276
277
  }
@@ -717,6 +718,21 @@ var BedrockChatLanguageModel = class {
717
718
  setting: "seed"
718
719
  });
719
720
  }
721
+ if (temperature != null && temperature > 1) {
722
+ warnings.push({
723
+ type: "unsupported-setting",
724
+ setting: "temperature",
725
+ details: `${temperature} exceeds bedrock maximum of 1.0. clamped to 1.0`
726
+ });
727
+ temperature = 1;
728
+ } else if (temperature != null && temperature < 0) {
729
+ warnings.push({
730
+ type: "unsupported-setting",
731
+ setting: "temperature",
732
+ details: `${temperature} is below bedrock minimum of 0. clamped to 0`
733
+ });
734
+ temperature = 0;
735
+ }
720
736
  if (responseFormat != null && responseFormat.type !== "text" && responseFormat.type !== "json") {
721
737
  warnings.push({
722
738
  type: "unsupported-setting",
@@ -1510,7 +1526,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
1510
1526
  var import_aws4fetch = require("aws4fetch");
1511
1527
 
1512
1528
  // src/version.ts
1513
- var VERSION = true ? "4.0.0-beta.58" : "0.0.0-test";
1529
+ var VERSION = true ? "4.0.0-beta.60" : "0.0.0-test";
1514
1530
 
1515
1531
  // src/bedrock-sigv4-fetch.ts
1516
1532
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {