@ai-sdk/anthropic 3.0.0-beta.62 → 3.0.0-beta.63
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 +9 -0
- package/dist/index.js +30 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -33
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +3 -3
- package/dist/internal/index.d.ts +3 -3
- package/dist/internal/index.js +29 -32
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +29 -32
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@ai-sdk/provider-utils";
|
|
12
12
|
|
|
13
13
|
// src/version.ts
|
|
14
|
-
var VERSION = true ? "3.0.0-beta.
|
|
14
|
+
var VERSION = true ? "3.0.0-beta.63" : "0.0.0-test";
|
|
15
15
|
|
|
16
16
|
// src/anthropic-messages-language-model.ts
|
|
17
17
|
import {
|
|
@@ -688,8 +688,8 @@ var CacheControlValidator = class {
|
|
|
688
688
|
}
|
|
689
689
|
if (!context.canCache) {
|
|
690
690
|
this.warnings.push({
|
|
691
|
-
type: "unsupported
|
|
692
|
-
|
|
691
|
+
type: "unsupported",
|
|
692
|
+
feature: "cache_control on non-cacheable context",
|
|
693
693
|
details: `cache_control cannot be set on ${context.type}. It will be ignored.`
|
|
694
694
|
});
|
|
695
695
|
return void 0;
|
|
@@ -697,8 +697,8 @@ var CacheControlValidator = class {
|
|
|
697
697
|
this.breakpointCount++;
|
|
698
698
|
if (this.breakpointCount > MAX_CACHE_BREAKPOINTS) {
|
|
699
699
|
this.warnings.push({
|
|
700
|
-
type: "unsupported
|
|
701
|
-
|
|
700
|
+
type: "unsupported",
|
|
701
|
+
feature: "cacheControl breakpoint limit",
|
|
702
702
|
details: `Maximum ${MAX_CACHE_BREAKPOINTS} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`
|
|
703
703
|
});
|
|
704
704
|
return void 0;
|
|
@@ -1032,14 +1032,20 @@ async function prepareTools({
|
|
|
1032
1032
|
break;
|
|
1033
1033
|
}
|
|
1034
1034
|
default: {
|
|
1035
|
-
toolWarnings.push({
|
|
1035
|
+
toolWarnings.push({
|
|
1036
|
+
type: "unsupported",
|
|
1037
|
+
feature: `provider-defined tool ${tool.id}`
|
|
1038
|
+
});
|
|
1036
1039
|
break;
|
|
1037
1040
|
}
|
|
1038
1041
|
}
|
|
1039
1042
|
break;
|
|
1040
1043
|
}
|
|
1041
1044
|
default: {
|
|
1042
|
-
toolWarnings.push({
|
|
1045
|
+
toolWarnings.push({
|
|
1046
|
+
type: "unsupported",
|
|
1047
|
+
feature: `tool ${tool}`
|
|
1048
|
+
});
|
|
1043
1049
|
break;
|
|
1044
1050
|
}
|
|
1045
1051
|
}
|
|
@@ -1941,34 +1947,25 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1941
1947
|
var _a, _b, _c, _d, _e, _f;
|
|
1942
1948
|
const warnings = [];
|
|
1943
1949
|
if (frequencyPenalty != null) {
|
|
1944
|
-
warnings.push({
|
|
1945
|
-
type: "unsupported-setting",
|
|
1946
|
-
setting: "frequencyPenalty"
|
|
1947
|
-
});
|
|
1950
|
+
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
1948
1951
|
}
|
|
1949
1952
|
if (presencePenalty != null) {
|
|
1950
|
-
warnings.push({
|
|
1951
|
-
type: "unsupported-setting",
|
|
1952
|
-
setting: "presencePenalty"
|
|
1953
|
-
});
|
|
1953
|
+
warnings.push({ type: "unsupported", feature: "presencePenalty" });
|
|
1954
1954
|
}
|
|
1955
1955
|
if (seed != null) {
|
|
1956
|
-
warnings.push({
|
|
1957
|
-
type: "unsupported-setting",
|
|
1958
|
-
setting: "seed"
|
|
1959
|
-
});
|
|
1956
|
+
warnings.push({ type: "unsupported", feature: "seed" });
|
|
1960
1957
|
}
|
|
1961
1958
|
if (temperature != null && temperature > 1) {
|
|
1962
1959
|
warnings.push({
|
|
1963
|
-
type: "unsupported
|
|
1964
|
-
|
|
1960
|
+
type: "unsupported",
|
|
1961
|
+
feature: "temperature",
|
|
1965
1962
|
details: `${temperature} exceeds anthropic maximum of 1.0. clamped to 1.0`
|
|
1966
1963
|
});
|
|
1967
1964
|
temperature = 1;
|
|
1968
1965
|
} else if (temperature != null && temperature < 0) {
|
|
1969
1966
|
warnings.push({
|
|
1970
|
-
type: "unsupported
|
|
1971
|
-
|
|
1967
|
+
type: "unsupported",
|
|
1968
|
+
feature: "temperature",
|
|
1972
1969
|
details: `${temperature} is below anthropic minimum of 0. clamped to 0`
|
|
1973
1970
|
});
|
|
1974
1971
|
temperature = 0;
|
|
@@ -1976,8 +1973,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1976
1973
|
if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
|
|
1977
1974
|
if (responseFormat.schema == null) {
|
|
1978
1975
|
warnings.push({
|
|
1979
|
-
type: "unsupported
|
|
1980
|
-
|
|
1976
|
+
type: "unsupported",
|
|
1977
|
+
feature: "responseFormat",
|
|
1981
1978
|
details: "JSON response format requires a schema. The response format is ignored."
|
|
1982
1979
|
});
|
|
1983
1980
|
}
|
|
@@ -2070,24 +2067,24 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2070
2067
|
if (baseArgs.temperature != null) {
|
|
2071
2068
|
baseArgs.temperature = void 0;
|
|
2072
2069
|
warnings.push({
|
|
2073
|
-
type: "unsupported
|
|
2074
|
-
|
|
2070
|
+
type: "unsupported",
|
|
2071
|
+
feature: "temperature",
|
|
2075
2072
|
details: "temperature is not supported when thinking is enabled"
|
|
2076
2073
|
});
|
|
2077
2074
|
}
|
|
2078
2075
|
if (topK != null) {
|
|
2079
2076
|
baseArgs.top_k = void 0;
|
|
2080
2077
|
warnings.push({
|
|
2081
|
-
type: "unsupported
|
|
2082
|
-
|
|
2078
|
+
type: "unsupported",
|
|
2079
|
+
feature: "topK",
|
|
2083
2080
|
details: "topK is not supported when thinking is enabled"
|
|
2084
2081
|
});
|
|
2085
2082
|
}
|
|
2086
2083
|
if (topP != null) {
|
|
2087
2084
|
baseArgs.top_p = void 0;
|
|
2088
2085
|
warnings.push({
|
|
2089
|
-
type: "unsupported
|
|
2090
|
-
|
|
2086
|
+
type: "unsupported",
|
|
2087
|
+
feature: "topP",
|
|
2091
2088
|
details: "topP is not supported when thinking is enabled"
|
|
2092
2089
|
});
|
|
2093
2090
|
}
|
|
@@ -2096,8 +2093,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2096
2093
|
if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) {
|
|
2097
2094
|
if (maxOutputTokens != null) {
|
|
2098
2095
|
warnings.push({
|
|
2099
|
-
type: "unsupported
|
|
2100
|
-
|
|
2096
|
+
type: "unsupported",
|
|
2097
|
+
feature: "maxOutputTokens",
|
|
2101
2098
|
details: `${baseArgs.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${maxOutputTokensForModel} max output tokens. The max output tokens have been limited to ${maxOutputTokensForModel}.`
|
|
2102
2099
|
});
|
|
2103
2100
|
}
|