@ai-sdk/anthropic 2.0.43 → 2.0.45

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,18 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.0.45
4
+
5
+ ### Patch Changes
6
+
7
+ - 54b7c08: fix(provider/anthropic): clamp temperature to valid 0-1 range with warnings
8
+
9
+ ## 2.0.44
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [056c471]
14
+ - @ai-sdk/provider-utils@3.0.17
15
+
3
16
  ## 2.0.43
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
31
31
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
32
32
 
33
33
  // src/version.ts
34
- var VERSION = true ? "2.0.43" : "0.0.0-test";
34
+ var VERSION = true ? "2.0.45" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -1785,6 +1785,21 @@ var AnthropicMessagesLanguageModel = class {
1785
1785
  setting: "seed"
1786
1786
  });
1787
1787
  }
1788
+ if (temperature != null && temperature > 1) {
1789
+ warnings.push({
1790
+ type: "unsupported-setting",
1791
+ setting: "temperature",
1792
+ details: `${temperature} exceeds anthropic maximum of 1.0. clamped to 1.0`
1793
+ });
1794
+ temperature = 1;
1795
+ } else if (temperature != null && temperature < 0) {
1796
+ warnings.push({
1797
+ type: "unsupported-setting",
1798
+ setting: "temperature",
1799
+ details: `${temperature} is below anthropic minimum of 0. clamped to 0`
1800
+ });
1801
+ temperature = 0;
1802
+ }
1788
1803
  if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
1789
1804
  if (responseFormat.schema == null) {
1790
1805
  warnings.push({