@ai-sdk/anthropic 3.0.0-beta.34 → 3.0.0-beta.36

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.
@@ -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;
@@ -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;
@@ -1912,7 +1912,7 @@ var AnthropicMessagesLanguageModel = class {
1912
1912
  });
1913
1913
  const isThinking = ((_b = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _b.type) === "enabled";
1914
1914
  const thinkingBudget = (_c = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _c.budgetTokens;
1915
- const maxOutputTokensForModel = getMaxOutputTokensForModel(this.modelId);
1915
+ const { maxOutputTokens: maxOutputTokensForModel, knownModel } = getMaxOutputTokensForModel(this.modelId);
1916
1916
  const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
1917
1917
  const baseArgs = {
1918
1918
  // model id:
@@ -1987,7 +1987,7 @@ var AnthropicMessagesLanguageModel = class {
1987
1987
  }
1988
1988
  baseArgs.max_tokens = maxTokens + thinkingBudget;
1989
1989
  }
1990
- if (baseArgs.max_tokens > maxOutputTokensForModel) {
1990
+ if (knownModel && baseArgs.max_tokens > maxOutputTokensForModel) {
1991
1991
  if (maxOutputTokens != null) {
1992
1992
  warnings.push({
1993
1993
  type: "unsupported-setting",
@@ -2877,13 +2877,15 @@ var AnthropicMessagesLanguageModel = class {
2877
2877
  };
2878
2878
  function getMaxOutputTokensForModel(modelId) {
2879
2879
  if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet") || modelId.includes("claude-haiku-4-5")) {
2880
- return 64e3;
2880
+ return { maxOutputTokens: 64e3, knownModel: true };
2881
2881
  } else if (modelId.includes("claude-opus-4-")) {
2882
- return 32e3;
2882
+ return { maxOutputTokens: 32e3, knownModel: true };
2883
2883
  } else if (modelId.includes("claude-3-5-haiku")) {
2884
- return 8192;
2884
+ return { maxOutputTokens: 8192, knownModel: true };
2885
+ } else if (modelId.includes("claude-3-haiku")) {
2886
+ return { maxOutputTokens: 4096, knownModel: true };
2885
2887
  } else {
2886
- return 4096;
2888
+ return { maxOutputTokens: 4096, knownModel: false };
2887
2889
  }
2888
2890
  }
2889
2891