@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/internal/index.mjs
CHANGED
|
@@ -562,7 +562,11 @@ var anthropicProviderOptions = z3.object({
|
|
|
562
562
|
version: z3.string().optional()
|
|
563
563
|
})
|
|
564
564
|
).optional()
|
|
565
|
-
}).optional()
|
|
565
|
+
}).optional(),
|
|
566
|
+
/**
|
|
567
|
+
* @default 'high'
|
|
568
|
+
*/
|
|
569
|
+
effort: z3.enum(["low", "medium", "high"]).optional()
|
|
566
570
|
});
|
|
567
571
|
|
|
568
572
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1853,6 +1857,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1853
1857
|
...isThinking && {
|
|
1854
1858
|
thinking: { type: "enabled", budget_tokens: thinkingBudget }
|
|
1855
1859
|
},
|
|
1860
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
1861
|
+
output_config: { effort: anthropicOptions.effort }
|
|
1862
|
+
},
|
|
1856
1863
|
// container with agent skills:
|
|
1857
1864
|
...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
|
|
1858
1865
|
container: {
|
|
@@ -1923,6 +1930,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1923
1930
|
});
|
|
1924
1931
|
}
|
|
1925
1932
|
}
|
|
1933
|
+
if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
|
|
1934
|
+
betas.add("effort-2025-11-24");
|
|
1935
|
+
}
|
|
1926
1936
|
const {
|
|
1927
1937
|
tools: anthropicTools2,
|
|
1928
1938
|
toolChoice: anthropicToolChoice,
|
|
@@ -2726,7 +2736,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2726
2736
|
}
|
|
2727
2737
|
};
|
|
2728
2738
|
function getMaxOutputTokensForModel(modelId) {
|
|
2729
|
-
if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-
|
|
2739
|
+
if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5")) {
|
|
2740
|
+
return {
|
|
2741
|
+
maxOutputTokens: 64e3,
|
|
2742
|
+
knownModel: true
|
|
2743
|
+
};
|
|
2744
|
+
} else if (modelId.includes("claude-opus-4-1")) {
|
|
2745
|
+
return {
|
|
2746
|
+
maxOutputTokens: 32e3,
|
|
2747
|
+
knownModel: true
|
|
2748
|
+
};
|
|
2749
|
+
} else if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet") || modelId.includes("claude-haiku-4-5")) {
|
|
2730
2750
|
return { maxOutputTokens: 64e3, knownModel: true };
|
|
2731
2751
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
2732
2752
|
return { maxOutputTokens: 32e3, knownModel: true };
|