@ai-sdk/anthropic 4.0.68 → 4.0.70
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 +19 -0
- package/dist/index.d.ts +1435 -1425
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6800 -8384
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +1960 -1932
- package/dist/internal/index.d.ts.map +1 -0
- package/dist/internal/index.js +5987 -7371
- package/dist/internal/index.js.map +1 -1
- package/package.json +8 -8
- package/src/anthropic-api.ts +15 -11
- package/src/anthropic-batch.ts +11 -0
- package/src/anthropic-language-model.ts +22 -6
- package/src/convert-to-anthropic-prompt.ts +34 -1
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { z } from 'zod/v4';
|
|
6
|
-
|
|
1
|
+
import { Experimental_SandboxSession, FetchFunction, InferSchema, ProviderDefinedTool, Resolvable, Tool, ToolExecuteFunction, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@ai-sdk/provider-utils";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
import { FilesV4, FilesV4UploadFileCallOptions, FilesV4UploadFileResult, JSONObject, JSONSchema7, LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, SharedV4ProviderMetadata, SharedV4Warning, SkillsV4 } from "@ai-sdk/provider";
|
|
4
|
+
//#region src/anthropic-files.d.ts
|
|
7
5
|
interface AnthropicFilesConfig {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
provider: string;
|
|
7
|
+
baseURL: string;
|
|
8
|
+
headers: () => Record<string, string | undefined>;
|
|
9
|
+
fetch?: FetchFunction;
|
|
12
10
|
}
|
|
13
|
-
declare class AnthropicFiles implements FilesV4 {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
export declare class AnthropicFiles implements FilesV4 {
|
|
12
|
+
private readonly config;
|
|
13
|
+
readonly specificationVersion = "v4";
|
|
14
|
+
get provider(): string;
|
|
15
|
+
constructor(config: AnthropicFilesConfig);
|
|
16
|
+
uploadFile({ data, mediaType, filename, abortSignal, headers }: FilesV4UploadFileCallOptions): Promise<FilesV4UploadFileResult>;
|
|
19
17
|
}
|
|
20
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/anthropic-api.d.ts
|
|
21
20
|
type AnthropicMessage = AnthropicUserMessage | AnthropicAssistantMessage | AnthropicSystemMessage;
|
|
22
21
|
type AnthropicCacheControl = {
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
type: 'ephemeral';
|
|
23
|
+
ttl?: '5m' | '1h';
|
|
25
24
|
};
|
|
26
25
|
interface AnthropicSystemMessage {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
role: 'system';
|
|
27
|
+
content: Array<AnthropicTextContent | AnthropicToolChangeContent>;
|
|
28
|
+
clear_at?: 'next_user_message';
|
|
29
|
+
output_config?: {
|
|
30
|
+
effort: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
31
|
+
};
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
35
34
|
* Mid-conversation tool change content block. Adds or removes a tool from the
|
|
@@ -39,932 +38,952 @@ interface AnthropicSystemMessage {
|
|
|
39
38
|
* Requires the `mid-conversation-tool-changes-2026-07-01` beta.
|
|
40
39
|
*/
|
|
41
40
|
interface AnthropicToolChangeContent {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
type: 'tool_addition' | 'tool_removal';
|
|
42
|
+
tool: {
|
|
43
|
+
type: 'tool_reference';
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
cache_control?: never;
|
|
48
47
|
}
|
|
49
48
|
interface AnthropicUserMessage {
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
role: 'user';
|
|
50
|
+
content: Array<AnthropicTextContent | AnthropicImageContent | AnthropicDocumentContent | AnthropicContainerUploadContent | AnthropicToolResultContent>;
|
|
52
51
|
}
|
|
53
52
|
interface AnthropicAssistantMessage {
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
role: 'assistant';
|
|
54
|
+
content: Array<AnthropicTextContent | AnthropicThinkingContent | AnthropicRedactedThinkingContent | AnthropicFallbackContent | AnthropicToolCallContent | AnthropicServerToolUseContent | AnthropicCodeExecutionToolResultContent | AnthropicWebFetchToolResultContent | AnthropicWebSearchToolResultContent | AnthropicToolSearchToolResultContent | AnthropicBashCodeExecutionToolResultContent | AnthropicTextEditorCodeExecutionToolResultContent | AnthropicAdvisorToolResultContent | AnthropicMcpToolUseContent | AnthropicMcpToolResultContent | AnthropicCompactionContent>;
|
|
56
55
|
}
|
|
56
|
+
declare const anthropicFallbackContentSchema: z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"fallback">;
|
|
58
|
+
from: z.ZodObject<{
|
|
59
|
+
model: z.ZodString;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
to: z.ZodObject<{
|
|
62
|
+
model: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
type AnthropicFallbackContent = InferSchema<typeof anthropicFallbackContentSchema> & {
|
|
66
|
+
cache_control?: never;
|
|
67
|
+
};
|
|
57
68
|
interface AnthropicCompactionContent {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
type: 'compaction';
|
|
70
|
+
content: string;
|
|
71
|
+
signature?: string;
|
|
72
|
+
cache_control?: AnthropicCacheControl;
|
|
62
73
|
}
|
|
63
74
|
interface AnthropicTextContent {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
type: 'text';
|
|
76
|
+
text: string;
|
|
77
|
+
citations?: Citation[];
|
|
78
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
68
79
|
}
|
|
69
80
|
interface AnthropicThinkingContent {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
type: 'thinking';
|
|
82
|
+
thinking: string;
|
|
83
|
+
signature: string;
|
|
84
|
+
cache_control?: never;
|
|
74
85
|
}
|
|
75
86
|
interface AnthropicRedactedThinkingContent {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
type: 'redacted_thinking';
|
|
88
|
+
data: string;
|
|
89
|
+
cache_control?: never;
|
|
79
90
|
}
|
|
80
91
|
type AnthropicContentSource = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
92
|
+
type: 'base64';
|
|
93
|
+
media_type: string;
|
|
94
|
+
data: string;
|
|
84
95
|
} | {
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
type: 'url';
|
|
97
|
+
url: string;
|
|
87
98
|
} | {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
type: 'text';
|
|
100
|
+
media_type: 'text/plain';
|
|
101
|
+
data: string;
|
|
91
102
|
} | {
|
|
92
|
-
|
|
93
|
-
|
|
103
|
+
type: 'file';
|
|
104
|
+
file_id: string;
|
|
94
105
|
};
|
|
95
106
|
interface AnthropicImageContent {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
type: 'image';
|
|
108
|
+
source: AnthropicContentSource;
|
|
109
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
99
110
|
}
|
|
100
111
|
interface AnthropicDocumentContent {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
type: 'document';
|
|
113
|
+
source: AnthropicContentSource;
|
|
114
|
+
title?: string;
|
|
115
|
+
context?: string;
|
|
116
|
+
citations?: {
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
};
|
|
119
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
109
120
|
}
|
|
110
121
|
interface AnthropicContainerUploadContent {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
122
|
+
type: 'container_upload';
|
|
123
|
+
file_id: string;
|
|
124
|
+
cache_control?: never;
|
|
114
125
|
}
|
|
115
126
|
/**
|
|
116
127
|
* The caller information for programmatic tool calling.
|
|
117
128
|
* Present when a tool is called from within code execution.
|
|
118
129
|
*/
|
|
119
130
|
type AnthropicToolCallCaller = {
|
|
120
|
-
|
|
121
|
-
|
|
131
|
+
type: 'code_execution_20250825';
|
|
132
|
+
tool_id: string;
|
|
122
133
|
} | {
|
|
123
|
-
|
|
124
|
-
|
|
134
|
+
type: 'code_execution_20260120';
|
|
135
|
+
tool_id: string;
|
|
125
136
|
} | {
|
|
126
|
-
|
|
137
|
+
type: 'direct';
|
|
127
138
|
};
|
|
128
139
|
interface AnthropicToolCallContent {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
type: 'tool_use';
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
input: unknown;
|
|
144
|
+
/**
|
|
145
|
+
* Present when this tool call was triggered by a server-executed tool
|
|
146
|
+
* (e.g., code execution calling a user-defined tool programmatically).
|
|
147
|
+
*/
|
|
148
|
+
caller?: AnthropicToolCallCaller;
|
|
149
|
+
/**
|
|
150
|
+
* Present when this tool call is a member call of a toolset
|
|
151
|
+
* (e.g. `computer` for the computer toolset). `name` is then the member name.
|
|
152
|
+
*/
|
|
153
|
+
toolset_name?: string;
|
|
154
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
144
155
|
}
|
|
145
156
|
interface AnthropicServerToolUseContent {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
type: 'server_tool_use';
|
|
158
|
+
id: string;
|
|
159
|
+
name: 'web_fetch' | 'web_search' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25' | 'advisor';
|
|
160
|
+
input: unknown;
|
|
161
|
+
caller?: AnthropicToolCallCaller;
|
|
162
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
152
163
|
}
|
|
153
164
|
type AnthropicNestedTextContent = Omit<AnthropicTextContent, 'cache_control'> & {
|
|
154
|
-
|
|
165
|
+
cache_control?: never;
|
|
155
166
|
};
|
|
156
167
|
type AnthropicNestedImageContent = Omit<AnthropicImageContent, 'cache_control'> & {
|
|
157
|
-
|
|
168
|
+
cache_control?: never;
|
|
158
169
|
};
|
|
159
170
|
type AnthropicNestedDocumentContent = Omit<AnthropicDocumentContent, 'cache_control'> & {
|
|
160
|
-
|
|
171
|
+
cache_control?: never;
|
|
161
172
|
};
|
|
162
173
|
interface AnthropicToolReferenceContent {
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
type: 'tool_reference';
|
|
175
|
+
tool_name: string;
|
|
165
176
|
}
|
|
166
177
|
interface AnthropicToolResultContent {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
178
|
+
type: 'tool_result';
|
|
179
|
+
tool_use_id: string;
|
|
180
|
+
/**
|
|
181
|
+
* Required for results of toolset member calls (e.g. `computer`).
|
|
182
|
+
*/
|
|
183
|
+
toolset_name?: string;
|
|
184
|
+
content: string | Array<AnthropicNestedTextContent | AnthropicNestedImageContent | AnthropicNestedDocumentContent | AnthropicToolReferenceContent>;
|
|
185
|
+
is_error: boolean | undefined;
|
|
186
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
176
187
|
}
|
|
177
188
|
interface AnthropicWebSearchToolResultContent {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
type: 'web_search_tool_result';
|
|
190
|
+
tool_use_id: string;
|
|
191
|
+
content: Array<{
|
|
192
|
+
url: string;
|
|
193
|
+
title: string | null;
|
|
194
|
+
page_age: string | null;
|
|
195
|
+
encrypted_content: string;
|
|
196
|
+
type: string;
|
|
197
|
+
}> | {
|
|
198
|
+
type: 'web_search_tool_result_error';
|
|
199
|
+
error_code: string;
|
|
200
|
+
};
|
|
201
|
+
caller?: AnthropicToolCallCaller;
|
|
202
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
192
203
|
}
|
|
193
204
|
interface AnthropicToolSearchToolResultContent {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
type: 'tool_search_tool_result';
|
|
206
|
+
tool_use_id: string;
|
|
207
|
+
content: {
|
|
208
|
+
type: 'tool_search_tool_search_result';
|
|
209
|
+
tool_references: Array<{
|
|
210
|
+
type: 'tool_reference';
|
|
211
|
+
tool_name: string;
|
|
212
|
+
}>;
|
|
213
|
+
} | {
|
|
214
|
+
type: 'tool_search_tool_result_error';
|
|
215
|
+
error_code: string;
|
|
216
|
+
};
|
|
217
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
207
218
|
}
|
|
208
219
|
interface AnthropicCodeExecutionToolResultContent {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
220
|
+
type: 'code_execution_tool_result';
|
|
221
|
+
tool_use_id: string;
|
|
222
|
+
content: {
|
|
223
|
+
type: 'code_execution_result';
|
|
224
|
+
stdout: string;
|
|
225
|
+
stderr: string;
|
|
226
|
+
return_code: number;
|
|
227
|
+
content: Array<{
|
|
228
|
+
type: 'code_execution_output';
|
|
229
|
+
file_id: string;
|
|
230
|
+
}>;
|
|
231
|
+
} | {
|
|
232
|
+
type: 'encrypted_code_execution_result';
|
|
233
|
+
encrypted_stdout: string;
|
|
234
|
+
stderr: string;
|
|
235
|
+
return_code: number;
|
|
236
|
+
content: Array<{
|
|
237
|
+
type: 'code_execution_output';
|
|
238
|
+
file_id: string;
|
|
239
|
+
}>;
|
|
240
|
+
} | {
|
|
241
|
+
type: 'code_execution_tool_result_error';
|
|
242
|
+
error_code: string;
|
|
243
|
+
};
|
|
244
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
234
245
|
}
|
|
235
246
|
interface AnthropicTextEditorCodeExecutionToolResultContent {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
247
|
+
type: 'text_editor_code_execution_tool_result';
|
|
248
|
+
tool_use_id: string;
|
|
249
|
+
content: {
|
|
250
|
+
type: 'text_editor_code_execution_tool_result_error';
|
|
251
|
+
error_code: string;
|
|
252
|
+
} | {
|
|
253
|
+
type: 'text_editor_code_execution_create_result';
|
|
254
|
+
is_file_update: boolean;
|
|
255
|
+
} | {
|
|
256
|
+
type: 'text_editor_code_execution_view_result';
|
|
257
|
+
content: string;
|
|
258
|
+
file_type: string;
|
|
259
|
+
num_lines: number | null;
|
|
260
|
+
start_line: number | null;
|
|
261
|
+
total_lines: number | null;
|
|
262
|
+
} | {
|
|
263
|
+
type: 'text_editor_code_execution_str_replace_result';
|
|
264
|
+
lines: string[] | null;
|
|
265
|
+
new_lines: number | null;
|
|
266
|
+
new_start: number | null;
|
|
267
|
+
old_lines: number | null;
|
|
268
|
+
old_start: number | null;
|
|
269
|
+
};
|
|
270
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
260
271
|
}
|
|
261
272
|
interface AnthropicBashCodeExecutionToolResultContent {
|
|
262
|
-
|
|
263
|
-
|
|
273
|
+
type: 'bash_code_execution_tool_result';
|
|
274
|
+
tool_use_id: string;
|
|
275
|
+
content: {
|
|
276
|
+
type: 'bash_code_execution_result';
|
|
277
|
+
stdout: string;
|
|
278
|
+
stderr: string;
|
|
279
|
+
return_code: number;
|
|
264
280
|
content: {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
} | {
|
|
274
|
-
type: 'bash_code_execution_tool_result_error';
|
|
275
|
-
error_code: string;
|
|
276
|
-
};
|
|
277
|
-
cache_control: AnthropicCacheControl | undefined;
|
|
281
|
+
type: 'bash_code_execution_output';
|
|
282
|
+
file_id: string;
|
|
283
|
+
}[];
|
|
284
|
+
} | {
|
|
285
|
+
type: 'bash_code_execution_tool_result_error';
|
|
286
|
+
error_code: string;
|
|
287
|
+
};
|
|
288
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
278
289
|
}
|
|
279
290
|
interface AnthropicAdvisorToolResultContent {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
291
|
+
type: 'advisor_tool_result';
|
|
292
|
+
tool_use_id: string;
|
|
293
|
+
content: {
|
|
294
|
+
type: 'advisor_result';
|
|
295
|
+
text: string;
|
|
296
|
+
stop_reason?: string;
|
|
297
|
+
} | {
|
|
298
|
+
type: 'advisor_redacted_result';
|
|
299
|
+
encrypted_content: string;
|
|
300
|
+
stop_reason?: string;
|
|
301
|
+
} | {
|
|
302
|
+
type: 'advisor_tool_result_error';
|
|
303
|
+
/**
|
|
304
|
+
* Available options: `max_uses_exceeded`, `too_many_requests`,
|
|
305
|
+
* `overloaded`, `prompt_too_long`, `execution_time_exceeded`,
|
|
306
|
+
* `unavailable`.
|
|
307
|
+
*/
|
|
308
|
+
error_code: string;
|
|
309
|
+
};
|
|
310
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
300
311
|
}
|
|
301
312
|
interface AnthropicWebFetchToolResultContent {
|
|
302
|
-
|
|
303
|
-
|
|
313
|
+
type: 'web_fetch_tool_result';
|
|
314
|
+
tool_use_id: string;
|
|
315
|
+
content: {
|
|
316
|
+
type: 'web_fetch_result';
|
|
317
|
+
url: string;
|
|
318
|
+
retrieved_at: string | null;
|
|
304
319
|
content: {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
type: 'text';
|
|
320
|
-
media_type: 'text/plain';
|
|
321
|
-
data: string;
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
|
-
} | {
|
|
325
|
-
type: 'web_fetch_tool_result_error';
|
|
326
|
-
error_code: string;
|
|
320
|
+
type: 'document';
|
|
321
|
+
title: string | null;
|
|
322
|
+
citations?: {
|
|
323
|
+
enabled: boolean;
|
|
324
|
+
};
|
|
325
|
+
source: {
|
|
326
|
+
type: 'base64';
|
|
327
|
+
media_type: 'application/pdf';
|
|
328
|
+
data: string;
|
|
329
|
+
} | {
|
|
330
|
+
type: 'text';
|
|
331
|
+
media_type: 'text/plain';
|
|
332
|
+
data: string;
|
|
333
|
+
};
|
|
327
334
|
};
|
|
328
|
-
|
|
329
|
-
|
|
335
|
+
} | {
|
|
336
|
+
type: 'web_fetch_tool_result_error';
|
|
337
|
+
error_code: string;
|
|
338
|
+
};
|
|
339
|
+
caller?: AnthropicToolCallCaller;
|
|
340
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
330
341
|
}
|
|
331
342
|
interface AnthropicMcpToolUseContent {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
343
|
+
type: 'mcp_tool_use';
|
|
344
|
+
id: string;
|
|
345
|
+
name: string;
|
|
346
|
+
server_name: string;
|
|
347
|
+
input: unknown;
|
|
348
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
338
349
|
}
|
|
339
350
|
interface AnthropicMcpToolResultContent {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
351
|
+
type: 'mcp_tool_result';
|
|
352
|
+
tool_use_id: string;
|
|
353
|
+
is_error: boolean;
|
|
354
|
+
content: string | Array<{
|
|
355
|
+
type: 'text';
|
|
356
|
+
text: string;
|
|
357
|
+
citations?: Citation[] | null;
|
|
358
|
+
}>;
|
|
359
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
349
360
|
}
|
|
350
361
|
type AnthropicTool = {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
362
|
+
name: string;
|
|
363
|
+
description: string | undefined;
|
|
364
|
+
input_schema: JSONSchema7;
|
|
365
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
366
|
+
eager_input_streaming?: boolean;
|
|
367
|
+
strict?: boolean;
|
|
368
|
+
/**
|
|
369
|
+
* When true, this tool is deferred and will only be loaded when
|
|
370
|
+
* discovered via the tool search tool.
|
|
371
|
+
*/
|
|
372
|
+
defer_loading?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Programmatic tool calling: specifies which server-executed tools
|
|
375
|
+
* are allowed to call this tool. When set, only the specified callers
|
|
376
|
+
* can invoke this tool programmatically.
|
|
377
|
+
*
|
|
378
|
+
* @example ['code_execution_20250825']
|
|
379
|
+
*/
|
|
380
|
+
allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
|
|
370
381
|
} | {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
382
|
+
type: 'code_execution_20250522';
|
|
383
|
+
name: string;
|
|
384
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
374
385
|
} | {
|
|
375
|
-
|
|
376
|
-
|
|
386
|
+
type: 'code_execution_20250825';
|
|
387
|
+
name: string;
|
|
377
388
|
} | {
|
|
378
|
-
|
|
379
|
-
|
|
389
|
+
type: 'code_execution_20260120';
|
|
390
|
+
name: string;
|
|
380
391
|
} | {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
392
|
+
name: string;
|
|
393
|
+
type: 'computer_20250124' | 'computer_20241022';
|
|
394
|
+
display_width_px: number;
|
|
395
|
+
display_height_px: number;
|
|
396
|
+
display_number: number;
|
|
397
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
387
398
|
} | {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
399
|
+
name: string;
|
|
400
|
+
type: 'computer_20251124';
|
|
401
|
+
display_width_px: number;
|
|
402
|
+
display_height_px: number;
|
|
403
|
+
display_number: number;
|
|
404
|
+
enable_zoom?: boolean;
|
|
405
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
395
406
|
} | {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
407
|
+
/**
|
|
408
|
+
* Computer toolset. Declared without a `name`; the API returns member
|
|
409
|
+
* tool calls (e.g. `left_click`) with `toolset_name: 'computer'`.
|
|
410
|
+
*/
|
|
411
|
+
type: 'computer_toolset_20260801';
|
|
412
|
+
configs?: Record<string, {
|
|
413
|
+
enabled?: boolean;
|
|
414
|
+
defer_loading?: boolean;
|
|
415
|
+
}>;
|
|
416
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
406
417
|
} | {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
418
|
+
name: string;
|
|
419
|
+
type: 'text_editor_20250124' | 'text_editor_20241022' | 'text_editor_20250429';
|
|
420
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
410
421
|
} | {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
422
|
+
name: string;
|
|
423
|
+
type: 'text_editor_20250728';
|
|
424
|
+
max_characters?: number;
|
|
425
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
415
426
|
} | {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
427
|
+
name: string;
|
|
428
|
+
type: 'bash_20250124' | 'bash_20241022';
|
|
429
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
419
430
|
} | {
|
|
420
|
-
|
|
421
|
-
|
|
431
|
+
name: string;
|
|
432
|
+
type: 'memory_20250818';
|
|
422
433
|
} | {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
434
|
+
type: 'web_fetch_20250910' | 'web_fetch_20260209' | 'web_fetch_20260318';
|
|
435
|
+
name: string;
|
|
436
|
+
max_uses?: number;
|
|
437
|
+
allowed_domains?: string[];
|
|
438
|
+
blocked_domains?: string[];
|
|
439
|
+
citations?: {
|
|
440
|
+
enabled: boolean;
|
|
441
|
+
};
|
|
442
|
+
max_content_tokens?: number;
|
|
443
|
+
use_cache?: boolean;
|
|
444
|
+
response_inclusion?: 'full' | 'excluded';
|
|
445
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
435
446
|
} | {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
447
|
+
type: 'web_search_20250305' | 'web_search_20260209' | 'web_search_20260318';
|
|
448
|
+
name: string;
|
|
449
|
+
max_uses?: number;
|
|
450
|
+
allowed_domains?: string[];
|
|
451
|
+
blocked_domains?: string[];
|
|
452
|
+
user_location?: {
|
|
453
|
+
type: 'approximate';
|
|
454
|
+
city?: string;
|
|
455
|
+
region?: string;
|
|
456
|
+
country?: string;
|
|
457
|
+
timezone?: string;
|
|
458
|
+
};
|
|
459
|
+
response_inclusion?: 'full' | 'excluded';
|
|
460
|
+
cache_control: AnthropicCacheControl | undefined;
|
|
450
461
|
} | {
|
|
451
|
-
|
|
452
|
-
|
|
462
|
+
type: 'tool_search_tool_regex_20251119';
|
|
463
|
+
name: string;
|
|
453
464
|
} | {
|
|
454
|
-
|
|
455
|
-
|
|
465
|
+
type: 'tool_search_tool_bm25_20251119';
|
|
466
|
+
name: string;
|
|
456
467
|
} | {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
468
|
+
type: 'advisor_20260301';
|
|
469
|
+
name: 'advisor';
|
|
470
|
+
model: string;
|
|
471
|
+
max_uses?: number;
|
|
472
|
+
max_tokens?: number;
|
|
473
|
+
caching?: {
|
|
474
|
+
type: 'ephemeral';
|
|
475
|
+
ttl: '5m' | '1h';
|
|
476
|
+
};
|
|
466
477
|
};
|
|
467
478
|
type AnthropicToolChoice = {
|
|
468
|
-
|
|
469
|
-
|
|
479
|
+
type: 'auto' | 'any';
|
|
480
|
+
disable_parallel_tool_use?: boolean;
|
|
470
481
|
} | {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
482
|
+
type: 'tool';
|
|
483
|
+
name: string;
|
|
484
|
+
disable_parallel_tool_use?: boolean;
|
|
474
485
|
};
|
|
475
|
-
declare const anthropicResponseSchema:
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
} | {
|
|
589
|
-
type: "text";
|
|
590
|
-
media_type: "text/plain";
|
|
591
|
-
data: string;
|
|
592
|
-
};
|
|
593
|
-
citations?: {
|
|
594
|
-
enabled: boolean;
|
|
595
|
-
} | undefined;
|
|
596
|
-
};
|
|
486
|
+
declare const anthropicResponseSchema: import("@ai-sdk/provider-utils").LazySchema<{
|
|
487
|
+
type: "message";
|
|
488
|
+
content: ({
|
|
489
|
+
type: "text";
|
|
490
|
+
text: string;
|
|
491
|
+
citations?: ({
|
|
492
|
+
type: "web_search_result_location";
|
|
493
|
+
cited_text: string;
|
|
494
|
+
url: string;
|
|
495
|
+
title: string | null;
|
|
496
|
+
encrypted_index: string;
|
|
497
|
+
} | {
|
|
498
|
+
type: "page_location";
|
|
499
|
+
cited_text: string;
|
|
500
|
+
document_index: number;
|
|
501
|
+
document_title: string | null;
|
|
502
|
+
start_page_number: number;
|
|
503
|
+
end_page_number: number;
|
|
504
|
+
file_id?: string | null | undefined;
|
|
505
|
+
} | {
|
|
506
|
+
type: "char_location";
|
|
507
|
+
cited_text: string;
|
|
508
|
+
document_index: number;
|
|
509
|
+
document_title: string | null;
|
|
510
|
+
start_char_index: number;
|
|
511
|
+
end_char_index: number;
|
|
512
|
+
file_id?: string | null | undefined;
|
|
513
|
+
} | {
|
|
514
|
+
type: "content_block_location";
|
|
515
|
+
cited_text: string;
|
|
516
|
+
document_index: number;
|
|
517
|
+
document_title: string | null;
|
|
518
|
+
start_block_index: number;
|
|
519
|
+
end_block_index: number;
|
|
520
|
+
file_id: string | null;
|
|
521
|
+
} | {
|
|
522
|
+
type: "search_result_location";
|
|
523
|
+
cited_text: string;
|
|
524
|
+
search_result_index: number;
|
|
525
|
+
source: string;
|
|
526
|
+
title: string | null;
|
|
527
|
+
start_block_index: number;
|
|
528
|
+
end_block_index: number;
|
|
529
|
+
})[] | null | undefined;
|
|
530
|
+
} | {
|
|
531
|
+
type: "thinking";
|
|
532
|
+
thinking: string;
|
|
533
|
+
signature: string;
|
|
534
|
+
} | {
|
|
535
|
+
type: "redacted_thinking";
|
|
536
|
+
data: string;
|
|
537
|
+
} | {
|
|
538
|
+
type: "compaction";
|
|
539
|
+
content?: string | null | undefined;
|
|
540
|
+
signature?: string | null | undefined;
|
|
541
|
+
} | {
|
|
542
|
+
type: "tool_use";
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
input: unknown;
|
|
546
|
+
caller?: {
|
|
547
|
+
type: "code_execution_20250825";
|
|
548
|
+
tool_id: string;
|
|
549
|
+
} | {
|
|
550
|
+
type: "code_execution_20260120";
|
|
551
|
+
tool_id: string;
|
|
552
|
+
} | {
|
|
553
|
+
type: "direct";
|
|
554
|
+
} | undefined;
|
|
555
|
+
toolset_name?: string | null | undefined;
|
|
556
|
+
} | {
|
|
557
|
+
type: "server_tool_use";
|
|
558
|
+
id: string;
|
|
559
|
+
name: string;
|
|
560
|
+
input?: Record<string, unknown> | null | undefined;
|
|
561
|
+
caller?: {
|
|
562
|
+
type: "code_execution_20250825";
|
|
563
|
+
tool_id: string;
|
|
564
|
+
} | {
|
|
565
|
+
type: "code_execution_20260120";
|
|
566
|
+
tool_id: string;
|
|
567
|
+
} | {
|
|
568
|
+
type: "direct";
|
|
569
|
+
} | undefined;
|
|
570
|
+
} | {
|
|
571
|
+
type: "mcp_tool_use";
|
|
572
|
+
id: string;
|
|
573
|
+
name: string;
|
|
574
|
+
input: unknown;
|
|
575
|
+
server_name: string;
|
|
576
|
+
} | {
|
|
577
|
+
type: "mcp_tool_result";
|
|
578
|
+
tool_use_id: string;
|
|
579
|
+
is_error: boolean;
|
|
580
|
+
content: string | (string | {
|
|
581
|
+
type: "text";
|
|
582
|
+
text: string;
|
|
583
|
+
citations?: z.core.util.JSONType[] | null | undefined;
|
|
584
|
+
})[];
|
|
585
|
+
} | {
|
|
586
|
+
type: "web_fetch_tool_result";
|
|
587
|
+
tool_use_id: string;
|
|
588
|
+
content: {
|
|
589
|
+
type: "web_fetch_result";
|
|
590
|
+
url: string;
|
|
591
|
+
retrieved_at: string | null;
|
|
592
|
+
content: {
|
|
593
|
+
type: "document";
|
|
594
|
+
title: string | null;
|
|
595
|
+
source: {
|
|
596
|
+
type: "base64";
|
|
597
|
+
media_type: "application/pdf";
|
|
598
|
+
data: string;
|
|
597
599
|
} | {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
+
type: "text";
|
|
601
|
+
media_type: "text/plain";
|
|
602
|
+
data: string;
|
|
600
603
|
};
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
tool_id: string;
|
|
604
|
-
} | {
|
|
605
|
-
type: "code_execution_20260120";
|
|
606
|
-
tool_id: string;
|
|
607
|
-
} | {
|
|
608
|
-
type: "direct";
|
|
604
|
+
citations?: {
|
|
605
|
+
enabled: boolean;
|
|
609
606
|
} | undefined;
|
|
607
|
+
};
|
|
610
608
|
} | {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
encrypted_content: string;
|
|
618
|
-
page_age?: string | null | undefined;
|
|
619
|
-
}[] | {
|
|
620
|
-
type: "web_search_tool_result_error";
|
|
621
|
-
error_code: string;
|
|
622
|
-
};
|
|
623
|
-
caller?: {
|
|
624
|
-
type: "code_execution_20250825";
|
|
625
|
-
tool_id: string;
|
|
626
|
-
} | {
|
|
627
|
-
type: "code_execution_20260120";
|
|
628
|
-
tool_id: string;
|
|
629
|
-
} | {
|
|
630
|
-
type: "direct";
|
|
631
|
-
} | undefined;
|
|
609
|
+
type: "web_fetch_tool_result_error";
|
|
610
|
+
error_code: string;
|
|
611
|
+
};
|
|
612
|
+
caller?: {
|
|
613
|
+
type: "code_execution_20250825";
|
|
614
|
+
tool_id: string;
|
|
632
615
|
} | {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
content: {
|
|
636
|
-
type: "code_execution_result";
|
|
637
|
-
stdout: string;
|
|
638
|
-
stderr: string;
|
|
639
|
-
return_code: number;
|
|
640
|
-
content: {
|
|
641
|
-
type: "code_execution_output";
|
|
642
|
-
file_id: string;
|
|
643
|
-
}[];
|
|
644
|
-
} | {
|
|
645
|
-
type: "encrypted_code_execution_result";
|
|
646
|
-
encrypted_stdout: string;
|
|
647
|
-
stderr: string;
|
|
648
|
-
return_code: number;
|
|
649
|
-
content: {
|
|
650
|
-
type: "code_execution_output";
|
|
651
|
-
file_id: string;
|
|
652
|
-
}[];
|
|
653
|
-
} | {
|
|
654
|
-
type: "code_execution_tool_result_error";
|
|
655
|
-
error_code: string;
|
|
656
|
-
};
|
|
616
|
+
type: "code_execution_20260120";
|
|
617
|
+
tool_id: string;
|
|
657
618
|
} | {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
619
|
+
type: "direct";
|
|
620
|
+
} | undefined;
|
|
621
|
+
} | {
|
|
622
|
+
type: "web_search_tool_result";
|
|
623
|
+
tool_use_id: string;
|
|
624
|
+
content: {
|
|
625
|
+
type: "web_search_result";
|
|
626
|
+
url: string;
|
|
627
|
+
title: string | null;
|
|
628
|
+
encrypted_content: string;
|
|
629
|
+
page_age?: string | null | undefined;
|
|
630
|
+
}[] | {
|
|
631
|
+
type: "web_search_tool_result_error";
|
|
632
|
+
error_code: string;
|
|
633
|
+
};
|
|
634
|
+
caller?: {
|
|
635
|
+
type: "code_execution_20250825";
|
|
636
|
+
tool_id: string;
|
|
673
637
|
} | {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
content: {
|
|
677
|
-
type: "text_editor_code_execution_tool_result_error";
|
|
678
|
-
error_code: string;
|
|
679
|
-
} | {
|
|
680
|
-
type: "text_editor_code_execution_view_result";
|
|
681
|
-
content: string;
|
|
682
|
-
file_type: string;
|
|
683
|
-
num_lines: number | null;
|
|
684
|
-
start_line: number | null;
|
|
685
|
-
total_lines: number | null;
|
|
686
|
-
} | {
|
|
687
|
-
type: "text_editor_code_execution_create_result";
|
|
688
|
-
is_file_update: boolean;
|
|
689
|
-
} | {
|
|
690
|
-
type: "text_editor_code_execution_str_replace_result";
|
|
691
|
-
lines: string[] | null;
|
|
692
|
-
new_lines: number | null;
|
|
693
|
-
new_start: number | null;
|
|
694
|
-
old_lines: number | null;
|
|
695
|
-
old_start: number | null;
|
|
696
|
-
};
|
|
638
|
+
type: "code_execution_20260120";
|
|
639
|
+
tool_id: string;
|
|
697
640
|
} | {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
641
|
+
type: "direct";
|
|
642
|
+
} | undefined;
|
|
643
|
+
} | {
|
|
644
|
+
type: "code_execution_tool_result";
|
|
645
|
+
tool_use_id: string;
|
|
646
|
+
content: {
|
|
647
|
+
type: "code_execution_result";
|
|
648
|
+
stdout: string;
|
|
649
|
+
stderr: string;
|
|
650
|
+
return_code: number;
|
|
651
|
+
content: {
|
|
652
|
+
type: "code_execution_output";
|
|
653
|
+
file_id: string;
|
|
654
|
+
}[];
|
|
655
|
+
} | {
|
|
656
|
+
type: "encrypted_code_execution_result";
|
|
657
|
+
encrypted_stdout: string;
|
|
658
|
+
stderr: string;
|
|
659
|
+
return_code: number;
|
|
660
|
+
content: {
|
|
661
|
+
type: "code_execution_output";
|
|
662
|
+
file_id: string;
|
|
663
|
+
}[];
|
|
710
664
|
} | {
|
|
711
|
-
|
|
665
|
+
type: "code_execution_tool_result_error";
|
|
666
|
+
error_code: string;
|
|
667
|
+
};
|
|
668
|
+
} | {
|
|
669
|
+
type: "bash_code_execution_tool_result";
|
|
670
|
+
tool_use_id: string;
|
|
671
|
+
content: {
|
|
672
|
+
type: "bash_code_execution_result";
|
|
673
|
+
content: {
|
|
674
|
+
type: "bash_code_execution_output";
|
|
712
675
|
file_id: string;
|
|
676
|
+
}[];
|
|
677
|
+
stdout: string;
|
|
678
|
+
stderr: string;
|
|
679
|
+
return_code: number;
|
|
713
680
|
} | {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
681
|
+
type: "bash_code_execution_tool_result_error";
|
|
682
|
+
error_code: string;
|
|
683
|
+
};
|
|
684
|
+
} | {
|
|
685
|
+
type: "text_editor_code_execution_tool_result";
|
|
686
|
+
tool_use_id: string;
|
|
687
|
+
content: {
|
|
688
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
689
|
+
error_code: string;
|
|
690
|
+
} | {
|
|
691
|
+
type: "text_editor_code_execution_view_result";
|
|
692
|
+
content: string;
|
|
693
|
+
file_type: string;
|
|
694
|
+
num_lines: number | null;
|
|
695
|
+
start_line: number | null;
|
|
696
|
+
total_lines: number | null;
|
|
697
|
+
} | {
|
|
698
|
+
type: "text_editor_code_execution_create_result";
|
|
699
|
+
is_file_update: boolean;
|
|
700
|
+
} | {
|
|
701
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
702
|
+
lines: string[] | null;
|
|
703
|
+
new_lines: number | null;
|
|
704
|
+
new_start: number | null;
|
|
705
|
+
old_lines: number | null;
|
|
706
|
+
old_start: number | null;
|
|
707
|
+
};
|
|
708
|
+
} | {
|
|
709
|
+
type: "tool_search_tool_result";
|
|
710
|
+
tool_use_id: string;
|
|
711
|
+
content: {
|
|
712
|
+
type: "tool_search_tool_search_result";
|
|
713
|
+
tool_references: {
|
|
714
|
+
type: "tool_reference";
|
|
715
|
+
tool_name: string;
|
|
716
|
+
}[];
|
|
728
717
|
} | {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
usage: {
|
|
732
|
-
[x: string]: unknown;
|
|
733
|
-
input_tokens: number;
|
|
734
|
-
output_tokens: number;
|
|
735
|
-
output_tokens_details?: {
|
|
736
|
-
thinking_tokens?: number | null | undefined;
|
|
737
|
-
} | null | undefined;
|
|
738
|
-
cache_creation_input_tokens?: number | null | undefined;
|
|
739
|
-
cache_read_input_tokens?: number | null | undefined;
|
|
740
|
-
iterations?: {
|
|
741
|
-
type: "message" | "compaction" | "advisor_message" | "fallback_message";
|
|
742
|
-
input_tokens: number;
|
|
743
|
-
output_tokens: number;
|
|
744
|
-
model?: string | null | undefined;
|
|
745
|
-
cache_creation_input_tokens?: number | null | undefined;
|
|
746
|
-
cache_read_input_tokens?: number | null | undefined;
|
|
747
|
-
}[] | null | undefined;
|
|
718
|
+
type: "tool_search_tool_result_error";
|
|
719
|
+
error_code: string;
|
|
748
720
|
};
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
721
|
+
} | {
|
|
722
|
+
type: "container_upload";
|
|
723
|
+
file_id: string;
|
|
724
|
+
} | {
|
|
725
|
+
type: "advisor_tool_result";
|
|
726
|
+
tool_use_id: string;
|
|
727
|
+
content: {
|
|
728
|
+
type: "advisor_result";
|
|
729
|
+
text: string;
|
|
730
|
+
stop_reason?: string | null | undefined;
|
|
731
|
+
} | {
|
|
732
|
+
type: "advisor_redacted_result";
|
|
733
|
+
encrypted_content: string;
|
|
734
|
+
stop_reason?: string | null | undefined;
|
|
735
|
+
} | {
|
|
736
|
+
type: "advisor_tool_result_error";
|
|
737
|
+
error_code: string;
|
|
738
|
+
};
|
|
739
|
+
} | {
|
|
740
|
+
type: "fallback";
|
|
741
|
+
from: {
|
|
742
|
+
model: string;
|
|
743
|
+
};
|
|
744
|
+
to: {
|
|
745
|
+
model: string;
|
|
746
|
+
};
|
|
747
|
+
})[];
|
|
748
|
+
usage: {
|
|
749
|
+
[x: string]: unknown;
|
|
750
|
+
input_tokens: number;
|
|
751
|
+
output_tokens: number;
|
|
752
|
+
output_tokens_details?: {
|
|
753
|
+
thinking_tokens?: number | null | undefined;
|
|
758
754
|
} | null | undefined;
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
755
|
+
cache_creation_input_tokens?: number | null | undefined;
|
|
756
|
+
cache_read_input_tokens?: number | null | undefined;
|
|
757
|
+
iterations?: {
|
|
758
|
+
type: "message" | "compaction" | "advisor_message" | "fallback_message";
|
|
759
|
+
input_tokens: number;
|
|
760
|
+
output_tokens: number;
|
|
761
|
+
model?: string | null | undefined;
|
|
762
|
+
cache_creation_input_tokens?: number | null | undefined;
|
|
763
|
+
cache_read_input_tokens?: number | null | undefined;
|
|
763
764
|
}[] | null | undefined;
|
|
764
|
-
|
|
765
|
+
};
|
|
766
|
+
id?: string | null | undefined;
|
|
767
|
+
model?: string | null | undefined;
|
|
768
|
+
stop_reason?: string | null | undefined;
|
|
769
|
+
stop_sequence?: string | null | undefined;
|
|
770
|
+
stop_details?: {
|
|
771
|
+
type: string;
|
|
772
|
+
category?: string | null | undefined;
|
|
773
|
+
explanation?: string | null | undefined;
|
|
774
|
+
recommended_model?: string | null | undefined;
|
|
775
|
+
} | null | undefined;
|
|
776
|
+
input_transformations?: {
|
|
777
|
+
type: string;
|
|
778
|
+
path: string;
|
|
779
|
+
reason: string;
|
|
780
|
+
}[] | null | undefined;
|
|
781
|
+
safeguard_results?: {
|
|
782
|
+
type: string;
|
|
783
|
+
status: {
|
|
784
|
+
type: string;
|
|
785
|
+
tool_uses?: Record<string, {
|
|
765
786
|
type: string;
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
787
|
+
outcome?: string | null | undefined;
|
|
788
|
+
explanation?: string | null | undefined;
|
|
789
|
+
}> | null | undefined;
|
|
790
|
+
};
|
|
791
|
+
}[] | null | undefined;
|
|
792
|
+
container?: {
|
|
793
|
+
expires_at: string;
|
|
794
|
+
id: string;
|
|
795
|
+
skills?: {
|
|
796
|
+
type: "anthropic" | "custom";
|
|
797
|
+
skill_id: string;
|
|
798
|
+
version: string;
|
|
774
799
|
}[] | null | undefined;
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
} | {
|
|
790
|
-
type: "clear_thinking_20251015";
|
|
791
|
-
cleared_thinking_turns: number;
|
|
792
|
-
cleared_input_tokens: number;
|
|
793
|
-
} | {
|
|
794
|
-
type: "compact_20260112";
|
|
795
|
-
})[];
|
|
796
|
-
} | null | undefined;
|
|
800
|
+
} | null | undefined;
|
|
801
|
+
context_management?: {
|
|
802
|
+
applied_edits: ({
|
|
803
|
+
type: "clear_tool_uses_20250919";
|
|
804
|
+
cleared_tool_uses: number;
|
|
805
|
+
cleared_input_tokens: number;
|
|
806
|
+
} | {
|
|
807
|
+
type: "clear_thinking_20251015";
|
|
808
|
+
cleared_thinking_turns: number;
|
|
809
|
+
cleared_input_tokens: number;
|
|
810
|
+
} | {
|
|
811
|
+
type: "compact_20260112";
|
|
812
|
+
})[];
|
|
813
|
+
} | null | undefined;
|
|
797
814
|
}>;
|
|
798
815
|
type Citation = NonNullable<(InferSchema<typeof anthropicResponseSchema>['content'][number] & {
|
|
799
|
-
|
|
816
|
+
type: 'text';
|
|
800
817
|
})['citations']>[number];
|
|
801
|
-
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region src/anthropic-language-model-options.d.ts
|
|
802
820
|
type AnthropicModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | (string & {});
|
|
803
|
-
|
|
821
|
+
//#endregion
|
|
822
|
+
//#region src/anthropic-language-model.d.ts
|
|
804
823
|
type AnthropicLanguageModelConfig = {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
824
|
+
provider: string;
|
|
825
|
+
baseURL: string;
|
|
826
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
827
|
+
fetch?: FetchFunction;
|
|
828
|
+
buildRequestUrl?: (baseURL: string, isStreaming: boolean) => string;
|
|
829
|
+
transformRequestBody?: (args: Record<string, any>, betas: Set<string>) => Record<string, any>;
|
|
830
|
+
supportedUrls?: () => LanguageModelV4['supportedUrls'];
|
|
831
|
+
generateId?: () => string;
|
|
832
|
+
supportsNativeStructuredOutput?: boolean;
|
|
833
|
+
supportsStrictTools?: boolean;
|
|
815
834
|
};
|
|
816
|
-
declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
835
|
+
export declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
836
|
+
readonly specificationVersion = "v4";
|
|
837
|
+
readonly modelId: AnthropicModelId;
|
|
838
|
+
protected readonly config: AnthropicLanguageModelConfig;
|
|
839
|
+
protected readonly generateId: () => string;
|
|
840
|
+
static [WORKFLOW_SERIALIZE](model: AnthropicLanguageModel): {
|
|
841
|
+
modelId: string;
|
|
842
|
+
config: JSONObject;
|
|
843
|
+
};
|
|
844
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
845
|
+
modelId: AnthropicModelId;
|
|
846
|
+
config: AnthropicLanguageModelConfig;
|
|
847
|
+
}): AnthropicLanguageModel;
|
|
848
|
+
constructor(modelId: AnthropicModelId, config: AnthropicLanguageModelConfig);
|
|
849
|
+
supportsUrl(url: URL): boolean;
|
|
850
|
+
get provider(): string;
|
|
851
|
+
get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
|
|
852
|
+
static prepareRequest({ modelId, config, options: { userSuppliedBetas, prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, tools, toolChoice, reasoning, providerOptions, stream } }: {
|
|
853
|
+
modelId: AnthropicModelId;
|
|
854
|
+
config: AnthropicLanguageModelConfig;
|
|
855
|
+
options: LanguageModelV4CallOptions & {
|
|
856
|
+
stream: boolean;
|
|
857
|
+
userSuppliedBetas: Set<string>;
|
|
824
858
|
};
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
warnings: SharedV4Warning[];
|
|
954
|
-
betas: Set<string>;
|
|
955
|
-
usesJsonResponseTool: boolean;
|
|
956
|
-
toolNameMapping: _ai_sdk_provider_utils.ToolNameMapping;
|
|
957
|
-
providerOptionsName: string;
|
|
958
|
-
usedCustomProviderKey: boolean;
|
|
959
|
-
}>;
|
|
960
|
-
private getArgs;
|
|
961
|
-
private getHeaders;
|
|
962
|
-
private getBetasFromHeaders;
|
|
963
|
-
private buildRequestUrl;
|
|
964
|
-
protected transformRequestBody(args: Record<string, any>, betas: Set<string>): Record<string, any>;
|
|
965
|
-
private extractCitationDocuments;
|
|
966
|
-
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
967
|
-
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
859
|
+
}): Promise<{
|
|
860
|
+
args: {
|
|
861
|
+
tools: AnthropicTool[] | undefined;
|
|
862
|
+
tool_choice: AnthropicToolChoice | undefined;
|
|
863
|
+
stream: boolean | undefined;
|
|
864
|
+
context_management?: {
|
|
865
|
+
edits: ({
|
|
866
|
+
exclude_tools?: string[] | undefined;
|
|
867
|
+
clear_tool_inputs?: boolean | undefined;
|
|
868
|
+
clear_at_least?: {
|
|
869
|
+
type: "input_tokens";
|
|
870
|
+
value: number;
|
|
871
|
+
} | undefined;
|
|
872
|
+
keep?: {
|
|
873
|
+
type: "tool_uses";
|
|
874
|
+
value: number;
|
|
875
|
+
} | undefined;
|
|
876
|
+
trigger?: {
|
|
877
|
+
type: "input_tokens";
|
|
878
|
+
value: number;
|
|
879
|
+
} | {
|
|
880
|
+
type: "tool_uses";
|
|
881
|
+
value: number;
|
|
882
|
+
} | undefined;
|
|
883
|
+
type: "clear_tool_uses_20250919";
|
|
884
|
+
} | {
|
|
885
|
+
keep?: "all" | {
|
|
886
|
+
type: "thinking_turns";
|
|
887
|
+
value: number;
|
|
888
|
+
} | undefined;
|
|
889
|
+
type: "clear_thinking_20251015";
|
|
890
|
+
} | {
|
|
891
|
+
instructions?: string | undefined;
|
|
892
|
+
pause_after_compaction?: boolean | undefined;
|
|
893
|
+
trigger?: {
|
|
894
|
+
type: "input_tokens";
|
|
895
|
+
value: number;
|
|
896
|
+
} | undefined;
|
|
897
|
+
type: "compact_20260112";
|
|
898
|
+
})[];
|
|
899
|
+
} | undefined;
|
|
900
|
+
compaction?: {
|
|
901
|
+
instructions?: string | undefined;
|
|
902
|
+
type: "summarize";
|
|
903
|
+
} | undefined;
|
|
904
|
+
safeguards?: {
|
|
905
|
+
classifier_context?: Record<string, unknown> | undefined;
|
|
906
|
+
type: "dangerous_tool_use";
|
|
907
|
+
}[] | undefined;
|
|
908
|
+
system: AnthropicTextContent[] | undefined;
|
|
909
|
+
messages: AnthropicMessage[];
|
|
910
|
+
container?: string | {
|
|
911
|
+
id: string | undefined;
|
|
912
|
+
skills: {
|
|
913
|
+
type: "anthropic" | "custom";
|
|
914
|
+
skill_id: string;
|
|
915
|
+
version: string | undefined;
|
|
916
|
+
}[];
|
|
917
|
+
} | undefined;
|
|
918
|
+
mcp_servers?: {
|
|
919
|
+
type: "url";
|
|
920
|
+
name: string;
|
|
921
|
+
url: string;
|
|
922
|
+
authorization_token: string | null | undefined;
|
|
923
|
+
tool_configuration: {
|
|
924
|
+
allowed_tools: string[] | null | undefined;
|
|
925
|
+
enabled: boolean | null | undefined;
|
|
926
|
+
} | undefined;
|
|
927
|
+
}[] | undefined;
|
|
928
|
+
metadata?: {
|
|
929
|
+
user_id: string;
|
|
930
|
+
} | undefined;
|
|
931
|
+
cache_control?: {
|
|
932
|
+
type: "ephemeral";
|
|
933
|
+
ttl?: "5m" | "1h" | undefined;
|
|
934
|
+
} | undefined;
|
|
935
|
+
fallbacks?: "default" | {
|
|
936
|
+
model: string;
|
|
937
|
+
max_tokens?: number | undefined;
|
|
938
|
+
thinking?: Record<string, unknown> | undefined;
|
|
939
|
+
output_config?: Record<string, unknown> | undefined;
|
|
940
|
+
speed?: "fast" | "standard" | undefined;
|
|
941
|
+
}[] | undefined;
|
|
942
|
+
inference_geo?: "us" | "global" | undefined;
|
|
943
|
+
service_tier?: "auto" | "standard_only" | undefined;
|
|
944
|
+
speed?: "fast" | "standard" | undefined;
|
|
945
|
+
output_config?: {
|
|
946
|
+
format?: {
|
|
947
|
+
type: string;
|
|
948
|
+
schema: import("@ai-sdk/provider").JSONSchema7;
|
|
949
|
+
} | undefined;
|
|
950
|
+
task_budget?: {
|
|
951
|
+
remaining?: number | undefined;
|
|
952
|
+
type: "tokens";
|
|
953
|
+
total: number;
|
|
954
|
+
} | undefined;
|
|
955
|
+
effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
956
|
+
} | undefined;
|
|
957
|
+
thinking?: {
|
|
958
|
+
block_binding?: {
|
|
959
|
+
prefix_mismatch_behavior: "error" | "drop_block";
|
|
960
|
+
} | undefined;
|
|
961
|
+
display?: "omitted" | "summarized" | "updates" | undefined;
|
|
962
|
+
budget_tokens?: number | undefined;
|
|
963
|
+
type?: "adaptive" | "enabled" | "disabled" | "between_tools" | undefined;
|
|
964
|
+
} | undefined;
|
|
965
|
+
model: AnthropicModelId;
|
|
966
|
+
max_tokens: number;
|
|
967
|
+
temperature: number | undefined;
|
|
968
|
+
top_k: number | undefined;
|
|
969
|
+
top_p: number | undefined;
|
|
970
|
+
stop_sequences: string[] | undefined;
|
|
971
|
+
};
|
|
972
|
+
warnings: SharedV4Warning[];
|
|
973
|
+
betas: Set<string>;
|
|
974
|
+
usesJsonResponseTool: boolean;
|
|
975
|
+
toolNameMapping: import("@ai-sdk/provider-utils").ToolNameMapping;
|
|
976
|
+
providerOptionsName: string;
|
|
977
|
+
usedCustomProviderKey: boolean;
|
|
978
|
+
}>;
|
|
979
|
+
private getArgs;
|
|
980
|
+
private getHeaders;
|
|
981
|
+
private getBetasFromHeaders;
|
|
982
|
+
private buildRequestUrl;
|
|
983
|
+
protected transformRequestBody(args: Record<string, any>, betas: Set<string>): Record<string, any>;
|
|
984
|
+
private extractCitationDocuments;
|
|
985
|
+
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
986
|
+
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
968
987
|
}
|
|
969
988
|
/**
|
|
970
989
|
* Returns the capabilities of a Claude model that are used for defaults and feature selection.
|
|
@@ -972,30 +991,31 @@ declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
|
972
991
|
* @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
|
|
973
992
|
* @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
|
|
974
993
|
*/
|
|
975
|
-
declare function getModelCapabilities(modelId: string): {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
994
|
+
export declare function getModelCapabilities(modelId: string): {
|
|
995
|
+
maxOutputTokens: number;
|
|
996
|
+
supportsStructuredOutput: boolean;
|
|
997
|
+
supportsAdaptiveThinking: boolean;
|
|
998
|
+
rejectsSamplingParameters: boolean;
|
|
999
|
+
supportsXhighEffort: boolean;
|
|
1000
|
+
rejectsThinkingDisabledAboveHighEffort: boolean;
|
|
1001
|
+
/**
|
|
1002
|
+
* Thinking is always adaptive: `thinking.type` `disabled` and `enabled`
|
|
1003
|
+
* are rejected with a 400.
|
|
1004
|
+
*/
|
|
1005
|
+
rejectsThinkingDisabled: boolean;
|
|
1006
|
+
/**
|
|
1007
|
+
* Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
|
|
1008
|
+
*/
|
|
1009
|
+
rejectsForcedToolUse: boolean;
|
|
1010
|
+
/**
|
|
1011
|
+
* Supports `thinking.type` `between_tools`, the lowest thinking setting on
|
|
1012
|
+
* models that reject disabled thinking.
|
|
1013
|
+
*/
|
|
1014
|
+
supportsBetweenToolsThinking: boolean;
|
|
1015
|
+
isKnownModel: boolean;
|
|
997
1016
|
};
|
|
998
|
-
|
|
1017
|
+
//#endregion
|
|
1018
|
+
//#region src/tool/computer-toolset_20260801.d.ts
|
|
999
1019
|
/**
|
|
1000
1020
|
* Member tools of the computer toolset. Each member is returned by the API as
|
|
1001
1021
|
* its own `tool_use` block; the AI SDK exposes it as the `action` of a single
|
|
@@ -1003,1086 +1023,1092 @@ declare function getModelCapabilities(modelId: string): {
|
|
|
1003
1023
|
*/
|
|
1004
1024
|
declare const computerToolset_20260801Members: readonly ["screenshot", "zoom", "left_click", "right_click", "middle_click", "double_click", "triple_click", "left_click_drag", "mouse_move", "left_mouse_down", "left_mouse_up", "cursor_position", "scroll", "type", "key", "hold_key", "wait"];
|
|
1005
1025
|
type ComputerToolset_20260801Member = (typeof computerToolset_20260801Members)[number];
|
|
1006
|
-
|
|
1026
|
+
//#endregion
|
|
1027
|
+
//#region src/tool/bash_20241022.d.ts
|
|
1007
1028
|
type Bash20241022Input = {
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1029
|
+
/**
|
|
1030
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
1031
|
+
*/
|
|
1032
|
+
command: string;
|
|
1033
|
+
/**
|
|
1034
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
1035
|
+
*/
|
|
1036
|
+
restart?: boolean;
|
|
1016
1037
|
};
|
|
1017
1038
|
type Bash20241022Options<OUTPUT> = {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1039
|
+
execute?: ToolExecuteFunction<Bash20241022Input, OUTPUT, {}>;
|
|
1040
|
+
needsApproval?: Tool<Bash20241022Input, OUTPUT, {}>['needsApproval'];
|
|
1041
|
+
toModelOutput?: Tool<Bash20241022Input, OUTPUT, {}>['toModelOutput'];
|
|
1042
|
+
onInputStart?: Tool<Bash20241022Input, OUTPUT, {}>['onInputStart'];
|
|
1043
|
+
onInputDelta?: Tool<Bash20241022Input, OUTPUT, {}>['onInputDelta'];
|
|
1044
|
+
onInputAvailable?: Tool<Bash20241022Input, OUTPUT, {}>['onInputAvailable'];
|
|
1024
1045
|
};
|
|
1025
1046
|
type Bash20241022DefaultOutput = Awaited<ReturnType<Experimental_SandboxSession['run']>>;
|
|
1026
1047
|
declare function bash_20241022(options?: Omit<Bash20241022Options<Bash20241022DefaultOutput>, 'execute'> & {
|
|
1027
|
-
|
|
1048
|
+
execute?: undefined;
|
|
1028
1049
|
}): ProviderDefinedTool<Bash20241022Input, Bash20241022DefaultOutput, {}>;
|
|
1029
1050
|
declare function bash_20241022<OUTPUT = never>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
1030
|
-
|
|
1051
|
+
execute: null;
|
|
1031
1052
|
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
1032
1053
|
declare function bash_20241022<OUTPUT>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
1033
|
-
|
|
1054
|
+
execute: Bash20241022Options<OUTPUT>['execute'];
|
|
1034
1055
|
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
1035
|
-
|
|
1056
|
+
//#endregion
|
|
1057
|
+
//#region src/tool/bash_20250124.d.ts
|
|
1036
1058
|
type Bash20250124Input = {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1059
|
+
/**
|
|
1060
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
1061
|
+
*/
|
|
1062
|
+
command: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
1065
|
+
*/
|
|
1066
|
+
restart?: boolean;
|
|
1045
1067
|
};
|
|
1046
1068
|
type Bash20250124Options<OUTPUT> = {
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1069
|
+
execute?: ToolExecuteFunction<Bash20250124Input, OUTPUT, {}>;
|
|
1070
|
+
needsApproval?: Tool<Bash20250124Input, OUTPUT, {}>['needsApproval'];
|
|
1071
|
+
toModelOutput?: Tool<Bash20250124Input, OUTPUT, {}>['toModelOutput'];
|
|
1072
|
+
onInputStart?: Tool<Bash20250124Input, OUTPUT, {}>['onInputStart'];
|
|
1073
|
+
onInputDelta?: Tool<Bash20250124Input, OUTPUT, {}>['onInputDelta'];
|
|
1074
|
+
onInputAvailable?: Tool<Bash20250124Input, OUTPUT, {}>['onInputAvailable'];
|
|
1053
1075
|
};
|
|
1054
1076
|
type Bash20250124DefaultOutput = Awaited<ReturnType<Experimental_SandboxSession['run']>>;
|
|
1055
1077
|
declare function bash_20250124(options?: Omit<Bash20250124Options<Bash20250124DefaultOutput>, 'execute'> & {
|
|
1056
|
-
|
|
1078
|
+
execute?: undefined;
|
|
1057
1079
|
}): ProviderDefinedTool<Bash20250124Input, Bash20250124DefaultOutput, {}>;
|
|
1058
1080
|
declare function bash_20250124<OUTPUT = never>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
1059
|
-
|
|
1081
|
+
execute: null;
|
|
1060
1082
|
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
1061
1083
|
declare function bash_20250124<OUTPUT>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
1062
|
-
|
|
1084
|
+
execute: Bash20250124Options<OUTPUT>['execute'];
|
|
1063
1085
|
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
1086
|
+
//#endregion
|
|
1087
|
+
//#region src/anthropic-tools.d.ts
|
|
1088
|
+
export declare const anthropicTools: {
|
|
1089
|
+
/**
|
|
1090
|
+
* Pairs a faster executor model with a higher-intelligence advisor model
|
|
1091
|
+
* that provides strategic guidance mid-generation.
|
|
1092
|
+
*
|
|
1093
|
+
* The advisor lets a faster, lower-cost executor model consult a
|
|
1094
|
+
* higher-intelligence advisor model server-side. The advisor reads the
|
|
1095
|
+
* executor's full transcript and produces a plan or course correction;
|
|
1096
|
+
* the executor continues with the task, informed by the advice. All of
|
|
1097
|
+
* this happens inside a single `/v1/messages` request.
|
|
1098
|
+
*
|
|
1099
|
+
* Beta header `advisor-tool-2026-03-01` is added automatically when this
|
|
1100
|
+
* tool is included.
|
|
1101
|
+
*
|
|
1102
|
+
* Multi-turn conversations: pass the full assistant content (including
|
|
1103
|
+
* `advisor_tool_result` blocks) back to the API on subsequent turns. If
|
|
1104
|
+
* you omit the advisor tool from `tools` on a follow-up turn while the
|
|
1105
|
+
* message history still contains `advisor_tool_result` blocks, the API
|
|
1106
|
+
* returns a `400 invalid_request_error`.
|
|
1107
|
+
*
|
|
1108
|
+
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
1109
|
+
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
1110
|
+
*
|
|
1111
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
1112
|
+
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
1113
|
+
* @param maxTokens - Maximum advisor output tokens per call, including
|
|
1114
|
+
* thinking and text. Minimum 1024; Anthropic recommends starting with 2048.
|
|
1115
|
+
* @param caching - Enables prompt caching for the advisor's transcript
|
|
1116
|
+
* across calls within a conversation. Worthwhile from ~3 advisor calls
|
|
1117
|
+
* per conversation.
|
|
1118
|
+
*/
|
|
1119
|
+
advisor_20260301: (args: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {
|
|
1120
|
+
type: "advisor_result";
|
|
1121
|
+
text: string;
|
|
1122
|
+
stopReason?: string;
|
|
1123
|
+
} | {
|
|
1124
|
+
type: "advisor_redacted_result";
|
|
1125
|
+
encryptedContent: string;
|
|
1126
|
+
stopReason?: string;
|
|
1127
|
+
} | {
|
|
1128
|
+
type: "advisor_tool_result_error";
|
|
1129
|
+
errorCode: string;
|
|
1130
|
+
}, {
|
|
1131
|
+
model: string;
|
|
1132
|
+
maxUses?: number;
|
|
1133
|
+
maxTokens?: number;
|
|
1134
|
+
caching?: {
|
|
1135
|
+
type: "ephemeral";
|
|
1136
|
+
ttl: "5m" | "1h";
|
|
1137
|
+
};
|
|
1138
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{}, {
|
|
1139
|
+
type: "advisor_result";
|
|
1140
|
+
text: string;
|
|
1141
|
+
stopReason?: string;
|
|
1142
|
+
} | {
|
|
1143
|
+
type: "advisor_redacted_result";
|
|
1144
|
+
encryptedContent: string;
|
|
1145
|
+
stopReason?: string;
|
|
1146
|
+
} | {
|
|
1147
|
+
type: "advisor_tool_result_error";
|
|
1148
|
+
errorCode: string;
|
|
1149
|
+
}, {}>;
|
|
1150
|
+
/**
|
|
1151
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
1152
|
+
* allowing system operations, script execution, and command-line automation.
|
|
1153
|
+
*
|
|
1154
|
+
* Image results are supported.
|
|
1155
|
+
*/
|
|
1156
|
+
bash_20241022: typeof bash_20241022;
|
|
1157
|
+
/**
|
|
1158
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
1159
|
+
* allowing system operations, script execution, and command-line automation.
|
|
1160
|
+
*
|
|
1161
|
+
* Image results are supported.
|
|
1162
|
+
*/
|
|
1163
|
+
bash_20250124: typeof bash_20250124;
|
|
1164
|
+
/**
|
|
1165
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
1166
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
1167
|
+
* the API conversation.
|
|
1168
|
+
*
|
|
1169
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
1170
|
+
* including writing code, in a secure, sandboxed environment.
|
|
1171
|
+
*/
|
|
1172
|
+
codeExecution_20250522: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1173
|
+
code: string;
|
|
1174
|
+
}, {
|
|
1175
|
+
type: "code_execution_result";
|
|
1176
|
+
stdout: string;
|
|
1177
|
+
stderr: string;
|
|
1178
|
+
return_code: number;
|
|
1179
|
+
content: Array<{
|
|
1180
|
+
type: "code_execution_output";
|
|
1181
|
+
file_id: string;
|
|
1182
|
+
}>;
|
|
1183
|
+
}, {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1184
|
+
code: string;
|
|
1185
|
+
}, {
|
|
1186
|
+
type: "code_execution_result";
|
|
1187
|
+
stdout: string;
|
|
1188
|
+
stderr: string;
|
|
1189
|
+
return_code: number;
|
|
1190
|
+
content: Array<{
|
|
1191
|
+
type: "code_execution_output";
|
|
1192
|
+
file_id: string;
|
|
1193
|
+
}>;
|
|
1194
|
+
}, {}>;
|
|
1195
|
+
/**
|
|
1196
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
1197
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
1198
|
+
* the API conversation.
|
|
1199
|
+
*
|
|
1200
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
1201
|
+
* including writing code, in a secure, sandboxed environment.
|
|
1202
|
+
*
|
|
1203
|
+
* This is the latest version with enhanced Bash support and file operations.
|
|
1204
|
+
*/
|
|
1205
|
+
codeExecution_20250825: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1206
|
+
type: "programmatic-tool-call";
|
|
1207
|
+
code: string;
|
|
1208
|
+
} | {
|
|
1209
|
+
type: "bash_code_execution";
|
|
1210
|
+
command: string;
|
|
1211
|
+
} | {
|
|
1212
|
+
type: "text_editor_code_execution";
|
|
1213
|
+
command: "view";
|
|
1214
|
+
path: string;
|
|
1215
|
+
} | {
|
|
1216
|
+
type: "text_editor_code_execution";
|
|
1217
|
+
command: "create";
|
|
1218
|
+
path: string;
|
|
1219
|
+
file_text?: string | null;
|
|
1220
|
+
} | {
|
|
1221
|
+
type: "text_editor_code_execution";
|
|
1222
|
+
command: "str_replace";
|
|
1223
|
+
path: string;
|
|
1224
|
+
old_str: string;
|
|
1225
|
+
new_str: string;
|
|
1226
|
+
}, {
|
|
1227
|
+
type: "code_execution_result";
|
|
1228
|
+
stdout: string;
|
|
1229
|
+
stderr: string;
|
|
1230
|
+
return_code: number;
|
|
1231
|
+
content: Array<{
|
|
1232
|
+
type: "code_execution_output";
|
|
1233
|
+
file_id: string;
|
|
1234
|
+
}>;
|
|
1235
|
+
} | {
|
|
1236
|
+
type: "bash_code_execution_result";
|
|
1237
|
+
content: Array<{
|
|
1238
|
+
type: "bash_code_execution_output";
|
|
1239
|
+
file_id: string;
|
|
1240
|
+
}>;
|
|
1241
|
+
stdout: string;
|
|
1242
|
+
stderr: string;
|
|
1243
|
+
return_code: number;
|
|
1244
|
+
} | {
|
|
1245
|
+
type: "bash_code_execution_tool_result_error";
|
|
1246
|
+
error_code: string;
|
|
1247
|
+
} | {
|
|
1248
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
1249
|
+
error_code: string;
|
|
1250
|
+
} | {
|
|
1251
|
+
type: "text_editor_code_execution_view_result";
|
|
1252
|
+
content: string;
|
|
1253
|
+
file_type: string;
|
|
1254
|
+
num_lines: number | null;
|
|
1255
|
+
start_line: number | null;
|
|
1256
|
+
total_lines: number | null;
|
|
1257
|
+
} | {
|
|
1258
|
+
type: "text_editor_code_execution_create_result";
|
|
1259
|
+
is_file_update: boolean;
|
|
1260
|
+
} | {
|
|
1261
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
1262
|
+
lines: string[] | null;
|
|
1263
|
+
new_lines: number | null;
|
|
1264
|
+
new_start: number | null;
|
|
1265
|
+
old_lines: number | null;
|
|
1266
|
+
old_start: number | null;
|
|
1267
|
+
}, {}, {}>>[0]) => import("@ai-sdk/provider-utils").Experimental_ToolCallerTool<import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1268
|
+
type: "programmatic-tool-call";
|
|
1269
|
+
code: string;
|
|
1270
|
+
} | {
|
|
1271
|
+
type: "bash_code_execution";
|
|
1272
|
+
command: string;
|
|
1273
|
+
} | {
|
|
1274
|
+
type: "text_editor_code_execution";
|
|
1275
|
+
command: "view";
|
|
1276
|
+
path: string;
|
|
1277
|
+
} | {
|
|
1278
|
+
type: "text_editor_code_execution";
|
|
1279
|
+
command: "create";
|
|
1280
|
+
path: string;
|
|
1281
|
+
file_text?: string | null;
|
|
1282
|
+
} | {
|
|
1283
|
+
type: "text_editor_code_execution";
|
|
1284
|
+
command: "str_replace";
|
|
1285
|
+
path: string;
|
|
1286
|
+
old_str: string;
|
|
1287
|
+
new_str: string;
|
|
1288
|
+
}, {
|
|
1289
|
+
type: "code_execution_result";
|
|
1290
|
+
stdout: string;
|
|
1291
|
+
stderr: string;
|
|
1292
|
+
return_code: number;
|
|
1293
|
+
content: Array<{
|
|
1294
|
+
type: "code_execution_output";
|
|
1295
|
+
file_id: string;
|
|
1296
|
+
}>;
|
|
1297
|
+
} | {
|
|
1298
|
+
type: "bash_code_execution_result";
|
|
1299
|
+
content: Array<{
|
|
1300
|
+
type: "bash_code_execution_output";
|
|
1301
|
+
file_id: string;
|
|
1302
|
+
}>;
|
|
1303
|
+
stdout: string;
|
|
1304
|
+
stderr: string;
|
|
1305
|
+
return_code: number;
|
|
1306
|
+
} | {
|
|
1307
|
+
type: "bash_code_execution_tool_result_error";
|
|
1308
|
+
error_code: string;
|
|
1309
|
+
} | {
|
|
1310
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
1311
|
+
error_code: string;
|
|
1312
|
+
} | {
|
|
1313
|
+
type: "text_editor_code_execution_view_result";
|
|
1314
|
+
content: string;
|
|
1315
|
+
file_type: string;
|
|
1316
|
+
num_lines: number | null;
|
|
1317
|
+
start_line: number | null;
|
|
1318
|
+
total_lines: number | null;
|
|
1319
|
+
} | {
|
|
1320
|
+
type: "text_editor_code_execution_create_result";
|
|
1321
|
+
is_file_update: boolean;
|
|
1322
|
+
} | {
|
|
1323
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
1324
|
+
lines: string[] | null;
|
|
1325
|
+
new_lines: number | null;
|
|
1326
|
+
new_start: number | null;
|
|
1327
|
+
old_lines: number | null;
|
|
1328
|
+
old_start: number | null;
|
|
1329
|
+
}, {}>>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
1332
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
1333
|
+
* the API conversation.
|
|
1334
|
+
*
|
|
1335
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
1336
|
+
* including writing code, in a secure, sandboxed environment.
|
|
1337
|
+
*
|
|
1338
|
+
* This is the recommended version. Does not require a beta header.
|
|
1339
|
+
*
|
|
1340
|
+
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
1341
|
+
*/
|
|
1342
|
+
codeExecution_20260120: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1343
|
+
type: "programmatic-tool-call";
|
|
1344
|
+
code: string;
|
|
1345
|
+
} | {
|
|
1346
|
+
type: "bash_code_execution";
|
|
1347
|
+
command: string;
|
|
1348
|
+
} | {
|
|
1349
|
+
type: "text_editor_code_execution";
|
|
1350
|
+
command: "view";
|
|
1351
|
+
path: string;
|
|
1352
|
+
} | {
|
|
1353
|
+
type: "text_editor_code_execution";
|
|
1354
|
+
command: "create";
|
|
1355
|
+
path: string;
|
|
1356
|
+
file_text?: string | null;
|
|
1357
|
+
} | {
|
|
1358
|
+
type: "text_editor_code_execution";
|
|
1359
|
+
command: "str_replace";
|
|
1360
|
+
path: string;
|
|
1361
|
+
old_str: string;
|
|
1362
|
+
new_str: string;
|
|
1363
|
+
}, {
|
|
1364
|
+
type: "code_execution_result";
|
|
1365
|
+
stdout: string;
|
|
1366
|
+
stderr: string;
|
|
1367
|
+
return_code: number;
|
|
1368
|
+
content: Array<{
|
|
1369
|
+
type: "code_execution_output";
|
|
1370
|
+
file_id: string;
|
|
1371
|
+
}>;
|
|
1372
|
+
} | {
|
|
1373
|
+
type: "encrypted_code_execution_result";
|
|
1374
|
+
encrypted_stdout: string;
|
|
1375
|
+
stderr: string;
|
|
1376
|
+
return_code: number;
|
|
1377
|
+
content: Array<{
|
|
1378
|
+
type: "code_execution_output";
|
|
1379
|
+
file_id: string;
|
|
1380
|
+
}>;
|
|
1381
|
+
} | {
|
|
1382
|
+
type: "bash_code_execution_result";
|
|
1383
|
+
content: Array<{
|
|
1384
|
+
type: "bash_code_execution_output";
|
|
1385
|
+
file_id: string;
|
|
1386
|
+
}>;
|
|
1387
|
+
stdout: string;
|
|
1388
|
+
stderr: string;
|
|
1389
|
+
return_code: number;
|
|
1390
|
+
} | {
|
|
1391
|
+
type: "bash_code_execution_tool_result_error";
|
|
1392
|
+
error_code: string;
|
|
1393
|
+
} | {
|
|
1394
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
1395
|
+
error_code: string;
|
|
1396
|
+
} | {
|
|
1397
|
+
type: "text_editor_code_execution_view_result";
|
|
1398
|
+
content: string;
|
|
1399
|
+
file_type: string;
|
|
1400
|
+
num_lines: number | null;
|
|
1401
|
+
start_line: number | null;
|
|
1402
|
+
total_lines: number | null;
|
|
1403
|
+
} | {
|
|
1404
|
+
type: "text_editor_code_execution_create_result";
|
|
1405
|
+
is_file_update: boolean;
|
|
1406
|
+
} | {
|
|
1407
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
1408
|
+
lines: string[] | null;
|
|
1409
|
+
new_lines: number | null;
|
|
1410
|
+
new_start: number | null;
|
|
1411
|
+
old_lines: number | null;
|
|
1412
|
+
old_start: number | null;
|
|
1413
|
+
}, {}, {}>>[0]) => import("@ai-sdk/provider-utils").Experimental_ToolCallerTool<import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1414
|
+
type: "programmatic-tool-call";
|
|
1415
|
+
code: string;
|
|
1416
|
+
} | {
|
|
1417
|
+
type: "bash_code_execution";
|
|
1418
|
+
command: string;
|
|
1419
|
+
} | {
|
|
1420
|
+
type: "text_editor_code_execution";
|
|
1421
|
+
command: "view";
|
|
1422
|
+
path: string;
|
|
1423
|
+
} | {
|
|
1424
|
+
type: "text_editor_code_execution";
|
|
1425
|
+
command: "create";
|
|
1426
|
+
path: string;
|
|
1427
|
+
file_text?: string | null;
|
|
1428
|
+
} | {
|
|
1429
|
+
type: "text_editor_code_execution";
|
|
1430
|
+
command: "str_replace";
|
|
1431
|
+
path: string;
|
|
1432
|
+
old_str: string;
|
|
1433
|
+
new_str: string;
|
|
1434
|
+
}, {
|
|
1435
|
+
type: "code_execution_result";
|
|
1436
|
+
stdout: string;
|
|
1437
|
+
stderr: string;
|
|
1438
|
+
return_code: number;
|
|
1439
|
+
content: Array<{
|
|
1440
|
+
type: "code_execution_output";
|
|
1441
|
+
file_id: string;
|
|
1442
|
+
}>;
|
|
1443
|
+
} | {
|
|
1444
|
+
type: "encrypted_code_execution_result";
|
|
1445
|
+
encrypted_stdout: string;
|
|
1446
|
+
stderr: string;
|
|
1447
|
+
return_code: number;
|
|
1448
|
+
content: Array<{
|
|
1449
|
+
type: "code_execution_output";
|
|
1450
|
+
file_id: string;
|
|
1451
|
+
}>;
|
|
1452
|
+
} | {
|
|
1453
|
+
type: "bash_code_execution_result";
|
|
1454
|
+
content: Array<{
|
|
1455
|
+
type: "bash_code_execution_output";
|
|
1456
|
+
file_id: string;
|
|
1457
|
+
}>;
|
|
1458
|
+
stdout: string;
|
|
1459
|
+
stderr: string;
|
|
1460
|
+
return_code: number;
|
|
1461
|
+
} | {
|
|
1462
|
+
type: "bash_code_execution_tool_result_error";
|
|
1463
|
+
error_code: string;
|
|
1464
|
+
} | {
|
|
1465
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
1466
|
+
error_code: string;
|
|
1467
|
+
} | {
|
|
1468
|
+
type: "text_editor_code_execution_view_result";
|
|
1469
|
+
content: string;
|
|
1470
|
+
file_type: string;
|
|
1471
|
+
num_lines: number | null;
|
|
1472
|
+
start_line: number | null;
|
|
1473
|
+
total_lines: number | null;
|
|
1474
|
+
} | {
|
|
1475
|
+
type: "text_editor_code_execution_create_result";
|
|
1476
|
+
is_file_update: boolean;
|
|
1477
|
+
} | {
|
|
1478
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
1479
|
+
lines: string[] | null;
|
|
1480
|
+
new_lines: number | null;
|
|
1481
|
+
new_start: number | null;
|
|
1482
|
+
old_lines: number | null;
|
|
1483
|
+
old_start: number | null;
|
|
1484
|
+
}, {}>>;
|
|
1485
|
+
/**
|
|
1486
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
1487
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
1488
|
+
*
|
|
1489
|
+
* Image results are supported.
|
|
1490
|
+
*
|
|
1491
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
1492
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
1493
|
+
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
1494
|
+
*/
|
|
1495
|
+
computer_20241022: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1496
|
+
action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
|
|
1497
|
+
coordinate?: number[];
|
|
1498
|
+
text?: string;
|
|
1499
|
+
}, {
|
|
1500
|
+
displayWidthPx: number;
|
|
1501
|
+
displayHeightPx: number;
|
|
1502
|
+
displayNumber?: number;
|
|
1503
|
+
}, {}>;
|
|
1504
|
+
/**
|
|
1505
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
1506
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
1507
|
+
*
|
|
1508
|
+
* Image results are supported.
|
|
1509
|
+
*
|
|
1510
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
1511
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
1512
|
+
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
1513
|
+
*/
|
|
1514
|
+
computer_20250124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1515
|
+
action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot";
|
|
1516
|
+
coordinate?: [number, number];
|
|
1517
|
+
duration?: number;
|
|
1518
|
+
scroll_amount?: number;
|
|
1519
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
1520
|
+
start_coordinate?: [number, number];
|
|
1521
|
+
text?: string;
|
|
1522
|
+
}, {
|
|
1523
|
+
displayWidthPx: number;
|
|
1524
|
+
displayHeightPx: number;
|
|
1525
|
+
displayNumber?: number;
|
|
1526
|
+
}, {}>;
|
|
1527
|
+
/**
|
|
1528
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
1529
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
1530
|
+
*
|
|
1531
|
+
* This version adds the zoom action for detailed screen region inspection.
|
|
1532
|
+
*
|
|
1533
|
+
* Image results are supported.
|
|
1534
|
+
*
|
|
1535
|
+
* Supported models: Claude Opus 4.5
|
|
1536
|
+
*
|
|
1537
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
1538
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
1539
|
+
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
1540
|
+
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
1541
|
+
*/
|
|
1542
|
+
computer_20251124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1543
|
+
action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot" | "zoom";
|
|
1544
|
+
coordinate?: [number, number];
|
|
1545
|
+
duration?: number;
|
|
1546
|
+
region?: [number, number, number, number];
|
|
1547
|
+
scroll_amount?: number;
|
|
1548
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
1549
|
+
start_coordinate?: [number, number];
|
|
1550
|
+
text?: string;
|
|
1551
|
+
}, {
|
|
1552
|
+
displayWidthPx: number;
|
|
1553
|
+
displayHeightPx: number;
|
|
1554
|
+
displayNumber?: number;
|
|
1555
|
+
enableZoom?: boolean;
|
|
1556
|
+
}, {}>;
|
|
1557
|
+
/**
|
|
1558
|
+
* The computer toolset lets Claude control a computer through screenshots,
|
|
1559
|
+
* mouse, and keyboard. It replaces the versioned computer tools
|
|
1560
|
+
* (`computer_20251124` and earlier) on newer models.
|
|
1561
|
+
*
|
|
1562
|
+
* The API returns each computer action as its own `tool_use` block with
|
|
1563
|
+
* `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
|
|
1564
|
+
* and exposes the member name as `action`, so `execute` receives the same
|
|
1565
|
+
* input shape as the older computer tools. Claude may return several actions
|
|
1566
|
+
* in one turn.
|
|
1567
|
+
*
|
|
1568
|
+
* Coordinates are always in the pixel space of the screenshots you return;
|
|
1569
|
+
* there are no display size parameters. Zoom is enabled by default.
|
|
1570
|
+
*
|
|
1571
|
+
* Does not require a beta header.
|
|
1572
|
+
*
|
|
1573
|
+
* Supported models: Claude Opus 5.5 (required; older computer tool types
|
|
1574
|
+
* are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
|
|
1575
|
+
*
|
|
1576
|
+
* @param configs - Per-member settings keyed by member name, e.g.
|
|
1577
|
+
* `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
|
|
1578
|
+
*/
|
|
1579
|
+
computerToolset_20260801: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1580
|
+
action: ComputerToolset_20260801Member;
|
|
1581
|
+
coordinate?: [number, number];
|
|
1582
|
+
duration?: number;
|
|
1583
|
+
region?: [number, number, number, number];
|
|
1584
|
+
repeat?: number;
|
|
1585
|
+
scroll_amount?: number;
|
|
1586
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
1587
|
+
start_coordinate?: [number, number];
|
|
1588
|
+
text?: string;
|
|
1589
|
+
}, {
|
|
1590
|
+
configs?: Partial<Record<ComputerToolset_20260801Member, {
|
|
1591
|
+
enabled?: boolean;
|
|
1592
|
+
deferLoading?: boolean;
|
|
1593
|
+
}>>;
|
|
1594
|
+
}, {}>;
|
|
1595
|
+
/**
|
|
1596
|
+
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
1597
|
+
* Claude can create, read, update, and delete files that persist between sessions,
|
|
1598
|
+
* allowing it to build knowledge over time without keeping everything in the context window.
|
|
1599
|
+
* The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
|
|
1600
|
+
*
|
|
1601
|
+
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
1602
|
+
*/
|
|
1603
|
+
memory_20250818: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1604
|
+
command: "view";
|
|
1605
|
+
path: string;
|
|
1606
|
+
view_range?: [number, number];
|
|
1607
|
+
} | {
|
|
1608
|
+
command: "create";
|
|
1609
|
+
path: string;
|
|
1610
|
+
file_text: string;
|
|
1611
|
+
} | {
|
|
1612
|
+
command: "str_replace";
|
|
1613
|
+
path: string;
|
|
1614
|
+
old_str: string;
|
|
1615
|
+
new_str: string;
|
|
1616
|
+
} | {
|
|
1617
|
+
command: "insert";
|
|
1618
|
+
path: string;
|
|
1619
|
+
insert_line: number;
|
|
1620
|
+
insert_text: string;
|
|
1621
|
+
} | {
|
|
1622
|
+
command: "delete";
|
|
1623
|
+
path: string;
|
|
1624
|
+
} | {
|
|
1625
|
+
command: "rename";
|
|
1626
|
+
old_path: string;
|
|
1627
|
+
new_path: string;
|
|
1628
|
+
}, {}, {}>;
|
|
1629
|
+
/**
|
|
1630
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1631
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1632
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1633
|
+
*
|
|
1634
|
+
* Supported models: Claude Sonnet 3.5
|
|
1635
|
+
*/
|
|
1636
|
+
textEditor_20241022: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1637
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
1638
|
+
path: string;
|
|
1639
|
+
file_text?: string;
|
|
1640
|
+
insert_line?: number;
|
|
1641
|
+
new_str?: string;
|
|
1642
|
+
insert_text?: string;
|
|
1643
|
+
old_str?: string;
|
|
1644
|
+
view_range?: number[];
|
|
1645
|
+
}, {}, {}>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1648
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1649
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1650
|
+
*
|
|
1651
|
+
* Supported models: Claude Sonnet 3.7
|
|
1652
|
+
*/
|
|
1653
|
+
textEditor_20250124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1654
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
1655
|
+
path: string;
|
|
1656
|
+
file_text?: string;
|
|
1657
|
+
insert_line?: number;
|
|
1658
|
+
new_str?: string;
|
|
1659
|
+
insert_text?: string;
|
|
1660
|
+
old_str?: string;
|
|
1661
|
+
view_range?: number[];
|
|
1662
|
+
}, {}, {}>;
|
|
1663
|
+
/**
|
|
1664
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1665
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1666
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1667
|
+
*
|
|
1668
|
+
* Note: This version does not support the "undo_edit" command.
|
|
1669
|
+
*
|
|
1670
|
+
* @deprecated Use textEditor_20250728 instead
|
|
1671
|
+
*/
|
|
1672
|
+
textEditor_20250429: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1673
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
1674
|
+
path: string;
|
|
1675
|
+
file_text?: string;
|
|
1676
|
+
insert_line?: number;
|
|
1677
|
+
new_str?: string;
|
|
1678
|
+
insert_text?: string;
|
|
1679
|
+
old_str?: string;
|
|
1680
|
+
view_range?: number[];
|
|
1681
|
+
}, {}, {}>;
|
|
1682
|
+
/**
|
|
1683
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1684
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1685
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1686
|
+
*
|
|
1687
|
+
* Note: This version does not support the "undo_edit" command and adds optional max_characters parameter.
|
|
1688
|
+
*
|
|
1689
|
+
* Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1
|
|
1690
|
+
*
|
|
1691
|
+
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
1692
|
+
*/
|
|
1693
|
+
textEditor_20250728: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1694
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
1695
|
+
path: string;
|
|
1696
|
+
file_text?: string;
|
|
1697
|
+
insert_line?: number;
|
|
1698
|
+
new_str?: string;
|
|
1699
|
+
insert_text?: string;
|
|
1700
|
+
old_str?: string;
|
|
1701
|
+
view_range?: number[];
|
|
1702
|
+
}, {
|
|
1703
|
+
maxCharacters?: number;
|
|
1704
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderDefinedTool<{
|
|
1705
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
1706
|
+
path: string;
|
|
1707
|
+
file_text?: string;
|
|
1708
|
+
insert_line?: number;
|
|
1709
|
+
new_str?: string;
|
|
1710
|
+
insert_text?: string;
|
|
1711
|
+
old_str?: string;
|
|
1712
|
+
view_range?: number[];
|
|
1713
|
+
}, unknown, {}>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
1716
|
+
*
|
|
1717
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
1718
|
+
* @param allowedDomains - Only fetch from these domains
|
|
1719
|
+
* @param blockedDomains - Never fetch from these domains
|
|
1720
|
+
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
1721
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
1722
|
+
*/
|
|
1723
|
+
webFetch_20250910: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1724
|
+
url: string;
|
|
1725
|
+
}, {
|
|
1726
|
+
type: "web_fetch_result";
|
|
1727
|
+
url: string;
|
|
1728
|
+
content: {
|
|
1729
|
+
type: "document";
|
|
1730
|
+
title: string | null;
|
|
1731
|
+
citations?: {
|
|
1732
|
+
enabled: boolean;
|
|
1733
|
+
};
|
|
1734
|
+
source: {
|
|
1735
|
+
type: "base64";
|
|
1736
|
+
mediaType: "application/pdf";
|
|
1737
|
+
data: string;
|
|
1738
|
+
} | {
|
|
1739
|
+
type: "text";
|
|
1740
|
+
mediaType: "text/plain";
|
|
1741
|
+
data: string;
|
|
1742
|
+
};
|
|
1743
|
+
};
|
|
1744
|
+
retrievedAt: string | null;
|
|
1745
|
+
}, {
|
|
1746
|
+
maxUses?: number;
|
|
1747
|
+
allowedDomains?: string[];
|
|
1748
|
+
blockedDomains?: string[];
|
|
1749
|
+
citations?: {
|
|
1750
|
+
enabled: boolean;
|
|
1751
|
+
};
|
|
1752
|
+
maxContentTokens?: number;
|
|
1753
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1754
|
+
url: string;
|
|
1755
|
+
}, {
|
|
1756
|
+
type: "web_fetch_result";
|
|
1757
|
+
url: string;
|
|
1758
|
+
content: {
|
|
1759
|
+
type: "document";
|
|
1760
|
+
title: string | null;
|
|
1761
|
+
citations?: {
|
|
1762
|
+
enabled: boolean;
|
|
1763
|
+
};
|
|
1764
|
+
source: {
|
|
1765
|
+
type: "base64";
|
|
1766
|
+
mediaType: "application/pdf";
|
|
1767
|
+
data: string;
|
|
1768
|
+
} | {
|
|
1769
|
+
type: "text";
|
|
1770
|
+
mediaType: "text/plain";
|
|
1771
|
+
data: string;
|
|
1772
|
+
};
|
|
1773
|
+
};
|
|
1774
|
+
retrievedAt: string | null;
|
|
1775
|
+
}, {}>;
|
|
1776
|
+
/**
|
|
1777
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
1778
|
+
*
|
|
1779
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
1780
|
+
* @param allowedDomains - Only fetch from these domains
|
|
1781
|
+
* @param blockedDomains - Never fetch from these domains
|
|
1782
|
+
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
1783
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
1784
|
+
*/
|
|
1785
|
+
webFetch_20260209: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1786
|
+
url: string;
|
|
1787
|
+
}, {
|
|
1788
|
+
type: "web_fetch_result";
|
|
1789
|
+
url: string;
|
|
1790
|
+
content: {
|
|
1791
|
+
type: "document";
|
|
1792
|
+
title: string | null;
|
|
1793
|
+
citations?: {
|
|
1794
|
+
enabled: boolean;
|
|
1795
|
+
};
|
|
1796
|
+
source: {
|
|
1797
|
+
type: "base64";
|
|
1798
|
+
mediaType: "application/pdf";
|
|
1799
|
+
data: string;
|
|
1800
|
+
} | {
|
|
1801
|
+
type: "text";
|
|
1802
|
+
mediaType: "text/plain";
|
|
1803
|
+
data: string;
|
|
1804
|
+
};
|
|
1805
|
+
};
|
|
1806
|
+
retrievedAt: string | null;
|
|
1807
|
+
}, {
|
|
1808
|
+
maxUses?: number;
|
|
1809
|
+
allowedDomains?: string[];
|
|
1810
|
+
blockedDomains?: string[];
|
|
1811
|
+
citations?: {
|
|
1812
|
+
enabled: boolean;
|
|
1813
|
+
};
|
|
1814
|
+
maxContentTokens?: number;
|
|
1815
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1816
|
+
url: string;
|
|
1817
|
+
}, {
|
|
1818
|
+
type: "web_fetch_result";
|
|
1819
|
+
url: string;
|
|
1820
|
+
content: {
|
|
1821
|
+
type: "document";
|
|
1822
|
+
title: string | null;
|
|
1823
|
+
citations?: {
|
|
1824
|
+
enabled: boolean;
|
|
1825
|
+
};
|
|
1826
|
+
source: {
|
|
1827
|
+
type: "base64";
|
|
1828
|
+
mediaType: "application/pdf";
|
|
1829
|
+
data: string;
|
|
1830
|
+
} | {
|
|
1831
|
+
type: "text";
|
|
1832
|
+
mediaType: "text/plain";
|
|
1833
|
+
data: string;
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
retrievedAt: string | null;
|
|
1837
|
+
}, {}>;
|
|
1838
|
+
/**
|
|
1839
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
1840
|
+
*
|
|
1841
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
1842
|
+
* @param allowedDomains - Only fetch from these domains
|
|
1843
|
+
* @param blockedDomains - Never fetch from these domains
|
|
1844
|
+
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
1845
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
1846
|
+
* @param useCache - Whether cached content may be returned. Set to false to fetch fresh content.
|
|
1847
|
+
* @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
|
|
1848
|
+
*/
|
|
1849
|
+
webFetch_20260318: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1850
|
+
url: string;
|
|
1851
|
+
}, {
|
|
1852
|
+
type: "web_fetch_result";
|
|
1853
|
+
url: string;
|
|
1854
|
+
content: {
|
|
1855
|
+
type: "document";
|
|
1856
|
+
title: string | null;
|
|
1857
|
+
citations?: {
|
|
1858
|
+
enabled: boolean;
|
|
1859
|
+
};
|
|
1860
|
+
source: {
|
|
1861
|
+
type: "base64";
|
|
1862
|
+
mediaType: "application/pdf";
|
|
1863
|
+
data: string;
|
|
1864
|
+
} | {
|
|
1865
|
+
type: "text";
|
|
1866
|
+
mediaType: "text/plain";
|
|
1867
|
+
data: string;
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
retrievedAt: string | null;
|
|
1871
|
+
}, {
|
|
1872
|
+
maxUses?: number;
|
|
1873
|
+
allowedDomains?: string[];
|
|
1874
|
+
blockedDomains?: string[];
|
|
1875
|
+
citations?: {
|
|
1876
|
+
enabled: boolean;
|
|
1877
|
+
};
|
|
1878
|
+
maxContentTokens?: number;
|
|
1879
|
+
useCache?: boolean;
|
|
1880
|
+
responseInclusion?: "full" | "excluded";
|
|
1881
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1882
|
+
url: string;
|
|
1883
|
+
}, {
|
|
1884
|
+
type: "web_fetch_result";
|
|
1885
|
+
url: string;
|
|
1886
|
+
content: {
|
|
1887
|
+
type: "document";
|
|
1888
|
+
title: string | null;
|
|
1889
|
+
citations?: {
|
|
1890
|
+
enabled: boolean;
|
|
1891
|
+
};
|
|
1892
|
+
source: {
|
|
1893
|
+
type: "base64";
|
|
1894
|
+
mediaType: "application/pdf";
|
|
1895
|
+
data: string;
|
|
1896
|
+
} | {
|
|
1897
|
+
type: "text";
|
|
1898
|
+
mediaType: "text/plain";
|
|
1899
|
+
data: string;
|
|
1900
|
+
};
|
|
1901
|
+
};
|
|
1902
|
+
retrievedAt: string | null;
|
|
1903
|
+
}, {}>;
|
|
1904
|
+
/**
|
|
1905
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1906
|
+
*
|
|
1907
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1908
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1909
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1910
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1911
|
+
*/
|
|
1912
|
+
webSearch_20250305: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1913
|
+
query: string;
|
|
1914
|
+
}, {
|
|
1915
|
+
type: "web_search_result";
|
|
1916
|
+
url: string;
|
|
1917
|
+
title: string | null;
|
|
1918
|
+
pageAge: string | null;
|
|
1919
|
+
encryptedContent: string;
|
|
1920
|
+
}[], {
|
|
1921
|
+
maxUses?: number;
|
|
1922
|
+
allowedDomains?: string[];
|
|
1923
|
+
blockedDomains?: string[];
|
|
1924
|
+
userLocation?: {
|
|
1925
|
+
type: "approximate";
|
|
1926
|
+
city?: string;
|
|
1927
|
+
region?: string;
|
|
1928
|
+
country?: string;
|
|
1929
|
+
timezone?: string;
|
|
1930
|
+
};
|
|
1931
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1932
|
+
query: string;
|
|
1933
|
+
}, {
|
|
1934
|
+
type: "web_search_result";
|
|
1935
|
+
url: string;
|
|
1936
|
+
title: string | null;
|
|
1937
|
+
pageAge: string | null;
|
|
1938
|
+
encryptedContent: string;
|
|
1939
|
+
}[], {}>;
|
|
1940
|
+
/**
|
|
1941
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1942
|
+
*
|
|
1943
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1944
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1945
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1946
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1947
|
+
*/
|
|
1948
|
+
webSearch_20260209: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1949
|
+
query: string;
|
|
1950
|
+
}, {
|
|
1951
|
+
type: "web_search_result";
|
|
1952
|
+
url: string;
|
|
1953
|
+
title: string | null;
|
|
1954
|
+
pageAge: string | null;
|
|
1955
|
+
encryptedContent: string;
|
|
1956
|
+
}[], {
|
|
1957
|
+
maxUses?: number;
|
|
1958
|
+
allowedDomains?: string[];
|
|
1959
|
+
blockedDomains?: string[];
|
|
1960
|
+
userLocation?: {
|
|
1961
|
+
type: "approximate";
|
|
1962
|
+
city?: string;
|
|
1963
|
+
region?: string;
|
|
1964
|
+
country?: string;
|
|
1965
|
+
timezone?: string;
|
|
1966
|
+
};
|
|
1967
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1968
|
+
query: string;
|
|
1969
|
+
}, {
|
|
1970
|
+
type: "web_search_result";
|
|
1971
|
+
url: string;
|
|
1972
|
+
title: string | null;
|
|
1973
|
+
pageAge: string | null;
|
|
1974
|
+
encryptedContent: string;
|
|
1975
|
+
}[], {}>;
|
|
1976
|
+
/**
|
|
1977
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1978
|
+
*
|
|
1979
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1980
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1981
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1982
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1983
|
+
* @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
|
|
1984
|
+
*/
|
|
1985
|
+
webSearch_20260318: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1986
|
+
query: string;
|
|
1987
|
+
}, {
|
|
1988
|
+
type: "web_search_result";
|
|
1989
|
+
url: string;
|
|
1990
|
+
title: string | null;
|
|
1991
|
+
pageAge: string | null;
|
|
1992
|
+
encryptedContent: string;
|
|
1993
|
+
}[], {
|
|
1994
|
+
maxUses?: number;
|
|
1995
|
+
allowedDomains?: string[];
|
|
1996
|
+
blockedDomains?: string[];
|
|
1997
|
+
userLocation?: {
|
|
1998
|
+
type: "approximate";
|
|
1999
|
+
city?: string;
|
|
2000
|
+
region?: string;
|
|
2001
|
+
country?: string;
|
|
2002
|
+
timezone?: string;
|
|
2003
|
+
};
|
|
2004
|
+
responseInclusion?: "full" | "excluded";
|
|
2005
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
2006
|
+
query: string;
|
|
2007
|
+
}, {
|
|
2008
|
+
type: "web_search_result";
|
|
2009
|
+
url: string;
|
|
2010
|
+
title: string | null;
|
|
2011
|
+
pageAge: string | null;
|
|
2012
|
+
encryptedContent: string;
|
|
2013
|
+
}[], {}>;
|
|
2014
|
+
/**
|
|
2015
|
+
* Creates a tool search tool that uses regex patterns to find tools.
|
|
2016
|
+
*
|
|
2017
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
2018
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
2019
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
2020
|
+
* catalog and loads only the tools it needs.
|
|
2021
|
+
*
|
|
2022
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
2023
|
+
* to mark them for deferred loading.
|
|
2024
|
+
*
|
|
2025
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
2026
|
+
*/
|
|
2027
|
+
toolSearchRegex_20251119: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
2028
|
+
pattern: string;
|
|
2029
|
+
limit?: number;
|
|
2030
|
+
}, {
|
|
2031
|
+
type: "tool_reference";
|
|
2032
|
+
toolName: string;
|
|
2033
|
+
}[], {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
2034
|
+
pattern: string;
|
|
2035
|
+
limit?: number;
|
|
2036
|
+
}, {
|
|
2037
|
+
type: "tool_reference";
|
|
2038
|
+
toolName: string;
|
|
2039
|
+
}[], {}>;
|
|
2040
|
+
/**
|
|
2041
|
+
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
2042
|
+
*
|
|
2043
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
2044
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
2045
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
2046
|
+
* catalog and loads only the tools it needs.
|
|
2047
|
+
*
|
|
2048
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
2049
|
+
* to mark them for deferred loading.
|
|
2050
|
+
*
|
|
2051
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
2052
|
+
*/
|
|
2053
|
+
toolSearchBm25_20251119: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
2054
|
+
query: string;
|
|
2055
|
+
limit?: number;
|
|
2056
|
+
}, {
|
|
2057
|
+
type: "tool_reference";
|
|
2058
|
+
toolName: string;
|
|
2059
|
+
}[], {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
2060
|
+
query: string;
|
|
2061
|
+
limit?: number;
|
|
2062
|
+
}, {
|
|
2063
|
+
type: "tool_reference";
|
|
2064
|
+
toolName: string;
|
|
2065
|
+
}[], {}>;
|
|
2043
2066
|
};
|
|
2044
|
-
|
|
2067
|
+
//#endregion
|
|
2068
|
+
//#region src/get-cache-control.d.ts
|
|
2045
2069
|
declare class CacheControlValidator {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2070
|
+
private breakpointCount;
|
|
2071
|
+
private warnings;
|
|
2072
|
+
getCacheControl(providerMetadata: SharedV4ProviderMetadata | undefined, context: {
|
|
2073
|
+
type: string;
|
|
2074
|
+
canCache: boolean;
|
|
2075
|
+
}): AnthropicCacheControl | undefined;
|
|
2076
|
+
getWarnings(): SharedV4Warning[];
|
|
2053
2077
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2078
|
+
//#endregion
|
|
2079
|
+
//#region src/anthropic-prepare-tools.d.ts
|
|
2080
|
+
export declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cacheControlValidator, supportsStructuredOutput, supportsStrictTools, defaultEagerInputStreaming, rejectsForcedToolUse }: {
|
|
2081
|
+
tools: LanguageModelV4CallOptions['tools'];
|
|
2082
|
+
toolChoice: LanguageModelV4CallOptions['toolChoice'] | undefined;
|
|
2083
|
+
disableParallelToolUse?: boolean;
|
|
2084
|
+
cacheControlValidator?: CacheControlValidator;
|
|
2085
|
+
/**
|
|
2086
|
+
* Whether the model supports native structured output response format.
|
|
2087
|
+
*/
|
|
2088
|
+
supportsStructuredOutput: boolean;
|
|
2089
|
+
/**
|
|
2090
|
+
* Whether the model supports strict mode on tool definitions.
|
|
2091
|
+
*/
|
|
2092
|
+
supportsStrictTools: boolean;
|
|
2093
|
+
/**
|
|
2094
|
+
* Default for `eager_input_streaming` on function tools that do not set
|
|
2095
|
+
* it explicitly. Driven by the model-level `toolStreaming` option.
|
|
2096
|
+
*/
|
|
2097
|
+
defaultEagerInputStreaming?: boolean;
|
|
2098
|
+
/**
|
|
2099
|
+
* Whether the model rejects forced tool use (`tool_choice` `any` or a
|
|
2100
|
+
* named tool). When true, `required` and `tool` tool choices fall back to
|
|
2101
|
+
* `auto` with a warning.
|
|
2102
|
+
*/
|
|
2103
|
+
rejectsForcedToolUse?: boolean;
|
|
2079
2104
|
}): Promise<{
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2105
|
+
tools: Array<AnthropicTool> | undefined;
|
|
2106
|
+
toolChoice: AnthropicToolChoice | undefined;
|
|
2107
|
+
toolWarnings: SharedV4Warning[];
|
|
2108
|
+
betas: Set<string>;
|
|
2084
2109
|
}>;
|
|
2085
|
-
|
|
2110
|
+
//#endregion
|
|
2111
|
+
//#region src/sanitize-json-schema.d.ts
|
|
2086
2112
|
/**
|
|
2087
2113
|
* Removes JSON Schema keywords that Anthropic rejects in
|
|
2088
2114
|
* `output_config.format.schema`.
|
|
@@ -2090,22 +2116,24 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
|
|
|
2090
2116
|
* The full original schema is still used by AI SDK result validation. This
|
|
2091
2117
|
* only relaxes the schema sent to Anthropic's constrained decoder.
|
|
2092
2118
|
*/
|
|
2093
|
-
declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
|
|
2094
|
-
|
|
2119
|
+
export declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
|
|
2120
|
+
//#endregion
|
|
2121
|
+
//#region src/skills/anthropic-skills.d.ts
|
|
2095
2122
|
interface AnthropicSkillsConfig {
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2123
|
+
provider: string;
|
|
2124
|
+
baseURL: string;
|
|
2125
|
+
headers: Resolvable<Record<string, string | undefined>>;
|
|
2126
|
+
fetch?: FetchFunction;
|
|
2100
2127
|
}
|
|
2101
|
-
declare class AnthropicSkills implements SkillsV4 {
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2128
|
+
export declare class AnthropicSkills implements SkillsV4 {
|
|
2129
|
+
private readonly config;
|
|
2130
|
+
readonly specificationVersion = "v4";
|
|
2131
|
+
get provider(): string;
|
|
2132
|
+
constructor(config: AnthropicSkillsConfig);
|
|
2133
|
+
private getHeaders;
|
|
2134
|
+
private fetchVersionMetadata;
|
|
2135
|
+
uploadSkill(params: Parameters<SkillsV4['uploadSkill']>[0]): Promise<Awaited<ReturnType<SkillsV4['uploadSkill']>>>;
|
|
2109
2136
|
}
|
|
2110
|
-
|
|
2111
|
-
export {
|
|
2137
|
+
//#endregion
|
|
2138
|
+
export { AnthropicLanguageModel as AnthropicMessagesLanguageModel, type AnthropicModelId as AnthropicMessagesModelId, type AnthropicModelId };
|
|
2139
|
+
//# sourceMappingURL=index.d.ts.map
|