@ai-sdk/anthropic 2.0.45 → 2.0.47
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 +12 -0
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +22 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +22 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
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 ? "2.0.
|
|
14
|
+
var VERSION = true ? "2.0.47" : "0.0.0-test";
|
|
15
15
|
|
|
16
16
|
// src/anthropic-messages-language-model.ts
|
|
17
17
|
import {
|
|
@@ -577,7 +577,11 @@ var anthropicProviderOptions = z3.object({
|
|
|
577
577
|
version: z3.string().optional()
|
|
578
578
|
})
|
|
579
579
|
).optional()
|
|
580
|
-
}).optional()
|
|
580
|
+
}).optional(),
|
|
581
|
+
/**
|
|
582
|
+
* @default 'high'
|
|
583
|
+
*/
|
|
584
|
+
effort: z3.enum(["low", "medium", "high"]).optional()
|
|
581
585
|
});
|
|
582
586
|
|
|
583
587
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1868,6 +1872,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1868
1872
|
...isThinking && {
|
|
1869
1873
|
thinking: { type: "enabled", budget_tokens: thinkingBudget }
|
|
1870
1874
|
},
|
|
1875
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
1876
|
+
output_config: { effort: anthropicOptions.effort }
|
|
1877
|
+
},
|
|
1871
1878
|
// container with agent skills:
|
|
1872
1879
|
...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
|
|
1873
1880
|
container: {
|
|
@@ -1938,6 +1945,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1938
1945
|
});
|
|
1939
1946
|
}
|
|
1940
1947
|
}
|
|
1948
|
+
if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
|
|
1949
|
+
betas.add("effort-2025-11-24");
|
|
1950
|
+
}
|
|
1941
1951
|
const {
|
|
1942
1952
|
tools: anthropicTools2,
|
|
1943
1953
|
toolChoice: anthropicToolChoice,
|
|
@@ -2741,7 +2751,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2741
2751
|
}
|
|
2742
2752
|
};
|
|
2743
2753
|
function getMaxOutputTokensForModel(modelId) {
|
|
2744
|
-
if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-
|
|
2754
|
+
if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5")) {
|
|
2755
|
+
return {
|
|
2756
|
+
maxOutputTokens: 64e3,
|
|
2757
|
+
knownModel: true
|
|
2758
|
+
};
|
|
2759
|
+
} else if (modelId.includes("claude-opus-4-1")) {
|
|
2760
|
+
return {
|
|
2761
|
+
maxOutputTokens: 32e3,
|
|
2762
|
+
knownModel: true
|
|
2763
|
+
};
|
|
2764
|
+
} else if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet") || modelId.includes("claude-haiku-4-5")) {
|
|
2745
2765
|
return { maxOutputTokens: 64e3, knownModel: true };
|
|
2746
2766
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
2747
2767
|
return { maxOutputTokens: 32e3, knownModel: true };
|