@ai-sdk/anthropic 2.0.35 → 2.0.37
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 +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +8 -0
- package/dist/internal/index.d.ts +8 -0
- package/dist/internal/index.js +8 -6
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -6
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -114,6 +114,10 @@ declare const anthropicTools: {
|
|
|
114
114
|
new_str: string;
|
|
115
115
|
}, {
|
|
116
116
|
type: "bash_code_execution_result";
|
|
117
|
+
content: Array<{
|
|
118
|
+
type: "bash_code_execution_output";
|
|
119
|
+
file_id: string;
|
|
120
|
+
}>;
|
|
117
121
|
stdout: string;
|
|
118
122
|
stderr: string;
|
|
119
123
|
return_code: number;
|
|
@@ -160,6 +164,10 @@ declare const anthropicTools: {
|
|
|
160
164
|
new_str: string;
|
|
161
165
|
}, {
|
|
162
166
|
type: "bash_code_execution_result";
|
|
167
|
+
content: Array<{
|
|
168
|
+
type: "bash_code_execution_output";
|
|
169
|
+
file_id: string;
|
|
170
|
+
}>;
|
|
163
171
|
stdout: string;
|
|
164
172
|
stderr: string;
|
|
165
173
|
return_code: number;
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -114,6 +114,10 @@ declare const anthropicTools: {
|
|
|
114
114
|
new_str: string;
|
|
115
115
|
}, {
|
|
116
116
|
type: "bash_code_execution_result";
|
|
117
|
+
content: Array<{
|
|
118
|
+
type: "bash_code_execution_output";
|
|
119
|
+
file_id: string;
|
|
120
|
+
}>;
|
|
117
121
|
stdout: string;
|
|
118
122
|
stderr: string;
|
|
119
123
|
return_code: number;
|
|
@@ -160,6 +164,10 @@ declare const anthropicTools: {
|
|
|
160
164
|
new_str: string;
|
|
161
165
|
}, {
|
|
162
166
|
type: "bash_code_execution_result";
|
|
167
|
+
content: Array<{
|
|
168
|
+
type: "bash_code_execution_output";
|
|
169
|
+
file_id: string;
|
|
170
|
+
}>;
|
|
163
171
|
stdout: string;
|
|
164
172
|
stderr: string;
|
|
165
173
|
return_code: number;
|
package/dist/internal/index.js
CHANGED
|
@@ -1813,7 +1813,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1813
1813
|
});
|
|
1814
1814
|
const isThinking = ((_b = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _b.type) === "enabled";
|
|
1815
1815
|
const thinkingBudget = (_c = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _c.budgetTokens;
|
|
1816
|
-
const maxOutputTokensForModel = getMaxOutputTokensForModel(this.modelId);
|
|
1816
|
+
const { maxOutputTokens: maxOutputTokensForModel, knownModel } = getMaxOutputTokensForModel(this.modelId);
|
|
1817
1817
|
const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
|
|
1818
1818
|
const baseArgs = {
|
|
1819
1819
|
// model id:
|
|
@@ -1875,7 +1875,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1875
1875
|
}
|
|
1876
1876
|
baseArgs.max_tokens = maxTokens + thinkingBudget;
|
|
1877
1877
|
}
|
|
1878
|
-
if (baseArgs.max_tokens > maxOutputTokensForModel) {
|
|
1878
|
+
if (knownModel && baseArgs.max_tokens > maxOutputTokensForModel) {
|
|
1879
1879
|
if (maxOutputTokens != null) {
|
|
1880
1880
|
warnings.push({
|
|
1881
1881
|
type: "unsupported-setting",
|
|
@@ -2701,13 +2701,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2701
2701
|
};
|
|
2702
2702
|
function getMaxOutputTokensForModel(modelId) {
|
|
2703
2703
|
if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet") || modelId.includes("claude-haiku-4-5")) {
|
|
2704
|
-
return 64e3;
|
|
2704
|
+
return { maxOutputTokens: 64e3, knownModel: true };
|
|
2705
2705
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
2706
|
-
return 32e3;
|
|
2706
|
+
return { maxOutputTokens: 32e3, knownModel: true };
|
|
2707
2707
|
} else if (modelId.includes("claude-3-5-haiku")) {
|
|
2708
|
-
return 8192;
|
|
2708
|
+
return { maxOutputTokens: 8192, knownModel: true };
|
|
2709
|
+
} else if (modelId.includes("claude-3-haiku")) {
|
|
2710
|
+
return { maxOutputTokens: 4096, knownModel: true };
|
|
2709
2711
|
} else {
|
|
2710
|
-
return 4096;
|
|
2712
|
+
return { maxOutputTokens: 4096, knownModel: false };
|
|
2711
2713
|
}
|
|
2712
2714
|
}
|
|
2713
2715
|
|