@ai-sdk/anthropic 3.0.0-beta.52 → 3.0.0-beta.54

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/anthropic
2
2
 
3
+ ## 3.0.0-beta.54
4
+
5
+ ### Patch Changes
6
+
7
+ - 1d15673: fix(provider/anthropic): clamp temperature to valid 0-1 range with warnings
8
+
9
+ ## 3.0.0-beta.53
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [b681d7d]
14
+ - @ai-sdk/provider@3.0.0-beta.16
15
+ - @ai-sdk/provider-utils@4.0.0-beta.33
16
+
3
17
  ## 3.0.0-beta.52
4
18
 
5
19
  ### 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 ? "3.0.0-beta.52" : "0.0.0-test";
34
+ var VERSION = true ? "3.0.0-beta.54" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -1912,6 +1912,21 @@ var AnthropicMessagesLanguageModel = class {
1912
1912
  setting: "seed"
1913
1913
  });
1914
1914
  }
1915
+ if (temperature != null && temperature > 1) {
1916
+ warnings.push({
1917
+ type: "unsupported-setting",
1918
+ setting: "temperature",
1919
+ details: `${temperature} exceeds anthropic maximum of 1.0. clamped to 1.0`
1920
+ });
1921
+ temperature = 1;
1922
+ } else if (temperature != null && temperature < 0) {
1923
+ warnings.push({
1924
+ type: "unsupported-setting",
1925
+ setting: "temperature",
1926
+ details: `${temperature} is below anthropic minimum of 0. clamped to 0`
1927
+ });
1928
+ temperature = 0;
1929
+ }
1915
1930
  if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
1916
1931
  if (responseFormat.schema == null) {
1917
1932
  warnings.push({