@ai-sdk/anthropic 3.0.0-beta.92 → 3.0.0-beta.94

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.
@@ -1,4 +1,4 @@
1
- import { LanguageModelV3, JSONSchema7, SharedV3ProviderMetadata, SharedV3Warning, LanguageModelV3CallOptions } from '@ai-sdk/provider';
1
+ import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult, JSONSchema7, SharedV3ProviderMetadata, SharedV3Warning } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
3
  import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
@@ -33,8 +33,8 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV3 {
33
33
  private buildRequestUrl;
34
34
  private transformRequestBody;
35
35
  private extractCitationDocuments;
36
- doGenerate(options: Parameters<LanguageModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doGenerate']>>>;
37
- doStream(options: Parameters<LanguageModelV3['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>>;
36
+ doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
37
+ doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
38
38
  }
39
39
 
40
40
  declare const anthropicTools: {
@@ -73,6 +73,10 @@ declare const anthropicTools: {
73
73
  stdout: string;
74
74
  stderr: string;
75
75
  return_code: number;
76
+ content: Array<{
77
+ type: "code_execution_output";
78
+ file_id: string;
79
+ }>;
76
80
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
77
81
  code: string;
78
82
  }, {
@@ -80,6 +84,10 @@ declare const anthropicTools: {
80
84
  stdout: string;
81
85
  stderr: string;
82
86
  return_code: number;
87
+ content: Array<{
88
+ type: "code_execution_output";
89
+ file_id: string;
90
+ }>;
83
91
  }>;
84
92
  /**
85
93
  * Claude can analyze data, create visualizations, perform complex calculations,
@@ -92,6 +100,9 @@ declare const anthropicTools: {
92
100
  * This is the latest version with enhanced Bash support and file operations.
93
101
  */
94
102
  codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
103
+ type: "programmatic-tool-call";
104
+ code: string;
105
+ } | {
95
106
  type: "bash_code_execution";
96
107
  command: string;
97
108
  } | {
@@ -110,6 +121,15 @@ declare const anthropicTools: {
110
121
  old_str: string;
111
122
  new_str: string;
112
123
  }, {
124
+ type: "code_execution_result";
125
+ stdout: string;
126
+ stderr: string;
127
+ return_code: number;
128
+ content: Array<{
129
+ type: "code_execution_output";
130
+ file_id: string;
131
+ }>;
132
+ } | {
113
133
  type: "bash_code_execution_result";
114
134
  content: Array<{
115
135
  type: "bash_code_execution_output";
@@ -142,6 +162,9 @@ declare const anthropicTools: {
142
162
  old_lines: number | null;
143
163
  old_start: number | null;
144
164
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
165
+ type: "programmatic-tool-call";
166
+ code: string;
167
+ } | {
145
168
  type: "bash_code_execution";
146
169
  command: string;
147
170
  } | {
@@ -160,6 +183,15 @@ declare const anthropicTools: {
160
183
  old_str: string;
161
184
  new_str: string;
162
185
  }, {
186
+ type: "code_execution_result";
187
+ stdout: string;
188
+ stderr: string;
189
+ return_code: number;
190
+ content: Array<{
191
+ type: "code_execution_output";
192
+ file_id: string;
193
+ }>;
194
+ } | {
163
195
  type: "bash_code_execution_result";
164
196
  content: Array<{
165
197
  type: "bash_code_execution_output";
@@ -535,6 +567,14 @@ type AnthropicTool = {
535
567
  * discovered via the tool search tool.
536
568
  */
537
569
  defer_loading?: boolean;
570
+ /**
571
+ * Programmatic tool calling: specifies which server-executed tools
572
+ * are allowed to call this tool. When set, only the specified callers
573
+ * can invoke this tool programmatically.
574
+ *
575
+ * @example ['code_execution_20250825']
576
+ */
577
+ allowed_callers?: Array<'code_execution_20250825'>;
538
578
  } | {
539
579
  type: 'code_execution_20250522';
540
580
  name: string;
@@ -1,4 +1,4 @@
1
- import { LanguageModelV3, JSONSchema7, SharedV3ProviderMetadata, SharedV3Warning, LanguageModelV3CallOptions } from '@ai-sdk/provider';
1
+ import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult, JSONSchema7, SharedV3ProviderMetadata, SharedV3Warning } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
3
  import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
@@ -33,8 +33,8 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV3 {
33
33
  private buildRequestUrl;
34
34
  private transformRequestBody;
35
35
  private extractCitationDocuments;
36
- doGenerate(options: Parameters<LanguageModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doGenerate']>>>;
37
- doStream(options: Parameters<LanguageModelV3['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>>;
36
+ doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
37
+ doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
38
38
  }
39
39
 
40
40
  declare const anthropicTools: {
@@ -73,6 +73,10 @@ declare const anthropicTools: {
73
73
  stdout: string;
74
74
  stderr: string;
75
75
  return_code: number;
76
+ content: Array<{
77
+ type: "code_execution_output";
78
+ file_id: string;
79
+ }>;
76
80
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
77
81
  code: string;
78
82
  }, {
@@ -80,6 +84,10 @@ declare const anthropicTools: {
80
84
  stdout: string;
81
85
  stderr: string;
82
86
  return_code: number;
87
+ content: Array<{
88
+ type: "code_execution_output";
89
+ file_id: string;
90
+ }>;
83
91
  }>;
84
92
  /**
85
93
  * Claude can analyze data, create visualizations, perform complex calculations,
@@ -92,6 +100,9 @@ declare const anthropicTools: {
92
100
  * This is the latest version with enhanced Bash support and file operations.
93
101
  */
94
102
  codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
103
+ type: "programmatic-tool-call";
104
+ code: string;
105
+ } | {
95
106
  type: "bash_code_execution";
96
107
  command: string;
97
108
  } | {
@@ -110,6 +121,15 @@ declare const anthropicTools: {
110
121
  old_str: string;
111
122
  new_str: string;
112
123
  }, {
124
+ type: "code_execution_result";
125
+ stdout: string;
126
+ stderr: string;
127
+ return_code: number;
128
+ content: Array<{
129
+ type: "code_execution_output";
130
+ file_id: string;
131
+ }>;
132
+ } | {
113
133
  type: "bash_code_execution_result";
114
134
  content: Array<{
115
135
  type: "bash_code_execution_output";
@@ -142,6 +162,9 @@ declare const anthropicTools: {
142
162
  old_lines: number | null;
143
163
  old_start: number | null;
144
164
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
165
+ type: "programmatic-tool-call";
166
+ code: string;
167
+ } | {
145
168
  type: "bash_code_execution";
146
169
  command: string;
147
170
  } | {
@@ -160,6 +183,15 @@ declare const anthropicTools: {
160
183
  old_str: string;
161
184
  new_str: string;
162
185
  }, {
186
+ type: "code_execution_result";
187
+ stdout: string;
188
+ stderr: string;
189
+ return_code: number;
190
+ content: Array<{
191
+ type: "code_execution_output";
192
+ file_id: string;
193
+ }>;
194
+ } | {
163
195
  type: "bash_code_execution_result";
164
196
  content: Array<{
165
197
  type: "bash_code_execution_output";
@@ -535,6 +567,14 @@ type AnthropicTool = {
535
567
  * discovered via the tool search tool.
536
568
  */
537
569
  defer_loading?: boolean;
570
+ /**
571
+ * Programmatic tool calling: specifies which server-executed tools
572
+ * are allowed to call this tool. When set, only the specified callers
573
+ * can invoke this tool programmatically.
574
+ *
575
+ * @example ['code_execution_20250825']
576
+ */
577
+ allowed_callers?: Array<'code_execution_20250825'>;
538
578
  } | {
539
579
  type: 'code_execution_20250522';
540
580
  name: string;