@ai-sdk/anthropic 2.0.0-alpha.9 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { LanguageModelV2 } from '@ai-sdk/provider';
2
- import { Resolvable, FetchFunction, ToolResultContent } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod';
2
+ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
+ import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
5
  type AnthropicMessagesModelId = 'claude-4-opus-20250514' | 'claude-4-sonnet-20250514' | 'claude-3-7-sonnet-20250219' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
6
6
 
@@ -27,395 +27,136 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV2 {
27
27
  private getHeaders;
28
28
  private buildRequestUrl;
29
29
  private transformRequestBody;
30
+ private extractCitationDocuments;
30
31
  doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
31
32
  doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
32
33
  }
33
34
 
34
- type ExecuteFunction<PARAMETERS, RESULT> = undefined | ((args: PARAMETERS, options: {
35
- abortSignal?: AbortSignal;
36
- }) => Promise<RESULT>);
37
- declare const Bash20241022Parameters: z.ZodObject<{
38
- command: z.ZodString;
39
- restart: z.ZodOptional<z.ZodBoolean>;
40
- }, "strip", z.ZodTypeAny, {
41
- command: string;
42
- restart?: boolean | undefined;
43
- }, {
44
- command: string;
45
- restart?: boolean | undefined;
46
- }>;
47
- /**
48
- * Creates a tool for running a bash command. Must have name "bash".
49
- *
50
- * Image results are supported.
51
- *
52
- * @param execute - The function to execute the tool. Optional.
53
- */
54
- declare function bashTool_20241022<RESULT>(options?: {
55
- execute?: ExecuteFunction<{
56
- /**
57
- * The bash command to run. Required unless the tool is being restarted.
58
- */
35
+ declare const anthropicTools: {
36
+ /**
37
+ * Creates a tool for running a bash command. Must have name "bash".
38
+ *
39
+ * Image results are supported.
40
+ *
41
+ * @param execute - The function to execute the tool. Optional.
42
+ */
43
+ bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
59
44
  command: string;
60
- /**
61
- * Specifying true will restart this tool. Otherwise, leave this unspecified.
62
- */
63
45
  restart?: boolean;
64
- }, RESULT>;
65
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
66
- }): {
67
- type: 'provider-defined';
68
- id: 'anthropic.bash_20241022';
69
- args: {};
70
- parameters: typeof Bash20241022Parameters;
71
- execute: ExecuteFunction<z.infer<typeof Bash20241022Parameters>, RESULT>;
72
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
73
- };
74
- declare const Bash20250124Parameters: z.ZodObject<{
75
- command: z.ZodString;
76
- restart: z.ZodOptional<z.ZodBoolean>;
77
- }, "strip", z.ZodTypeAny, {
78
- command: string;
79
- restart?: boolean | undefined;
80
- }, {
81
- command: string;
82
- restart?: boolean | undefined;
83
- }>;
84
- /**
85
- * Creates a tool for running a bash command. Must have name "bash".
86
- *
87
- * Image results are supported.
88
- *
89
- * @param execute - The function to execute the tool. Optional.
90
- */
91
- declare function bashTool_20250124<RESULT>(options?: {
92
- execute?: ExecuteFunction<{
93
- /**
94
- * The bash command to run. Required unless the tool is being restarted.
95
- */
46
+ }, {}>;
47
+ /**
48
+ * Creates a tool for running a bash command. Must have name "bash".
49
+ *
50
+ * Image results are supported.
51
+ *
52
+ * @param execute - The function to execute the tool. Optional.
53
+ */
54
+ bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
96
55
  command: string;
97
- /**
98
- * Specifying true will restart this tool. Otherwise, leave this unspecified.
99
- */
100
56
  restart?: boolean;
101
- }, RESULT>;
102
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
103
- }): {
104
- type: 'provider-defined';
105
- id: 'anthropic.bash_20250124';
106
- args: {};
107
- parameters: typeof Bash20250124Parameters;
108
- execute: ExecuteFunction<z.infer<typeof Bash20250124Parameters>, RESULT>;
109
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
110
- };
111
- declare const TextEditor20241022Parameters: z.ZodObject<{
112
- command: z.ZodEnum<["view", "create", "str_replace", "insert", "undo_edit"]>;
113
- path: z.ZodString;
114
- file_text: z.ZodOptional<z.ZodString>;
115
- insert_line: z.ZodOptional<z.ZodNumber>;
116
- new_str: z.ZodOptional<z.ZodString>;
117
- old_str: z.ZodOptional<z.ZodString>;
118
- view_range: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
119
- }, "strip", z.ZodTypeAny, {
120
- path: string;
121
- command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
122
- file_text?: string | undefined;
123
- insert_line?: number | undefined;
124
- new_str?: string | undefined;
125
- old_str?: string | undefined;
126
- view_range?: number[] | undefined;
127
- }, {
128
- path: string;
129
- command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
130
- file_text?: string | undefined;
131
- insert_line?: number | undefined;
132
- new_str?: string | undefined;
133
- old_str?: string | undefined;
134
- view_range?: number[] | undefined;
135
- }>;
136
- /**
137
- * Creates a tool for editing text. Must have name "str_replace_editor".
138
- *
139
- * Image results are supported.
140
- *
141
- * @param execute - The function to execute the tool. Optional.
142
- */
143
- declare function textEditorTool_20241022<RESULT>(options?: {
144
- execute?: ExecuteFunction<{
145
- /**
146
- * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`, `undo_edit`.
147
- */
148
- command: 'view' | 'create' | 'str_replace' | 'insert' | 'undo_edit';
149
- /**
150
- * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.
151
- */
57
+ }, {}>;
58
+ /**
59
+ * Creates a tool for editing text. Must have name "str_replace_editor".
60
+ */
61
+ textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
62
+ command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
152
63
  path: string;
153
- /**
154
- * Required parameter of `create` command, with the content of the file to be created.
155
- */
156
64
  file_text?: string;
157
- /**
158
- * Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.
159
- */
160
65
  insert_line?: number;
161
- /**
162
- * Optional parameter of `str_replace` command containing the new string (if not given, no string will be added). Required parameter of `insert` command containing the string to insert.
163
- */
164
66
  new_str?: string;
165
- /**
166
- * Required parameter of `str_replace` command containing the string in `path` to replace.
167
- */
168
67
  old_str?: string;
169
- /**
170
- * Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.
171
- */
172
68
  view_range?: number[];
173
- }, RESULT>;
174
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
175
- }): {
176
- type: 'provider-defined';
177
- id: 'anthropic.text_editor_20241022';
178
- args: {};
179
- parameters: typeof TextEditor20241022Parameters;
180
- execute: ExecuteFunction<z.infer<typeof TextEditor20241022Parameters>, RESULT>;
181
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
182
- };
183
- declare const TextEditor20250124Parameters: z.ZodObject<{
184
- command: z.ZodEnum<["view", "create", "str_replace", "insert", "undo_edit"]>;
185
- path: z.ZodString;
186
- file_text: z.ZodOptional<z.ZodString>;
187
- insert_line: z.ZodOptional<z.ZodNumber>;
188
- new_str: z.ZodOptional<z.ZodString>;
189
- old_str: z.ZodOptional<z.ZodString>;
190
- view_range: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
191
- }, "strip", z.ZodTypeAny, {
192
- path: string;
193
- command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
194
- file_text?: string | undefined;
195
- insert_line?: number | undefined;
196
- new_str?: string | undefined;
197
- old_str?: string | undefined;
198
- view_range?: number[] | undefined;
199
- }, {
200
- path: string;
201
- command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
202
- file_text?: string | undefined;
203
- insert_line?: number | undefined;
204
- new_str?: string | undefined;
205
- old_str?: string | undefined;
206
- view_range?: number[] | undefined;
207
- }>;
208
- /**
209
- * Creates a tool for editing text. Must have name "str_replace_editor".
210
- *
211
- * Image results are supported.
212
- *
213
- * @param execute - The function to execute the tool. Optional.
214
- */
215
- declare function textEditorTool_20250124<RESULT>(options?: {
216
- execute?: ExecuteFunction<{
217
- /**
218
- * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`, `undo_edit`.
219
- */
220
- command: 'view' | 'create' | 'str_replace' | 'insert' | 'undo_edit';
221
- /**
222
- * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.
223
- */
69
+ }, {}>;
70
+ /**
71
+ * Creates a tool for editing text. Must have name "str_replace_editor".
72
+ */
73
+ textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
74
+ command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
224
75
  path: string;
225
- /**
226
- * Required parameter of `create` command, with the content of the file to be created.
227
- */
228
76
  file_text?: string;
229
- /**
230
- * Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.
231
- */
232
77
  insert_line?: number;
233
- /**
234
- * Optional parameter of `str_replace` command containing the new string (if not given, no string will be added). Required parameter of `insert` command containing the string to insert.
235
- */
236
78
  new_str?: string;
237
- /**
238
- * Required parameter of `str_replace` command containing the string in `path` to replace.
239
- */
240
79
  old_str?: string;
241
- /**
242
- * Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.
243
- */
244
80
  view_range?: number[];
245
- }, RESULT>;
246
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
247
- }): {
248
- type: 'provider-defined';
249
- id: 'anthropic.text_editor_20250124';
250
- args: {};
251
- parameters: typeof TextEditor20250124Parameters;
252
- execute: ExecuteFunction<z.infer<typeof TextEditor20250124Parameters>, RESULT>;
253
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
254
- };
255
- declare const Computer20241022Parameters: z.ZodObject<{
256
- action: z.ZodEnum<["key", "type", "mouse_move", "left_click", "left_click_drag", "right_click", "middle_click", "double_click", "screenshot", "cursor_position"]>;
257
- coordinate: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
258
- text: z.ZodOptional<z.ZodString>;
259
- }, "strip", z.ZodTypeAny, {
260
- action: "type" | "key" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
261
- text?: string | undefined;
262
- coordinate?: number[] | undefined;
263
- }, {
264
- action: "type" | "key" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
265
- text?: string | undefined;
266
- coordinate?: number[] | undefined;
267
- }>;
268
- /**
269
- * Creates a tool for executing actions on a computer. Must have name "computer".
270
- *
271
- * Image results are supported.
272
- *
273
- * @param displayWidthPx - The width of the display being controlled by the model in pixels.
274
- * @param displayHeightPx - The height of the display being controlled by the model in pixels.
275
- * @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.
276
- * @param execute - The function to execute the tool. Optional.
277
- */
278
- declare function computerTool_20241022<RESULT>(options: {
279
- displayWidthPx: number;
280
- displayHeightPx: number;
281
- displayNumber?: number;
282
- execute?: ExecuteFunction<{
283
- /**
284
- * The action to perform. The available actions are:
285
- * - `key`: Press a key or key-combination on the keyboard.
286
- * - This supports xdotool's `key` syntax.
287
- * - Examples: "a", "Return", "alt+Tab", "ctrl+s", "Up", "KP_0" (for the numpad 0 key).
288
- * - `type`: Type a string of text on the keyboard.
289
- * - `cursor_position`: Get the current (x, y) pixel coordinate of the cursor on the screen.
290
- * - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on the screen.
291
- * - `left_click`: Click the left mouse button.
292
- * - `left_click_drag`: Click and drag the cursor to a specified (x, y) pixel coordinate on the screen.
293
- * - `right_click`: Click the right mouse button.
294
- * - `middle_click`: Click the middle mouse button.
295
- * - `double_click`: Double-click the left mouse button.
296
- * - `screenshot`: Take a screenshot of the screen.
297
- */
298
- action: 'key' | 'type' | 'mouse_move' | 'left_click' | 'left_click_drag' | 'right_click' | 'middle_click' | 'double_click' | 'screenshot' | 'cursor_position';
299
- /**
300
- * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=mouse_move` and `action=left_click_drag`.
301
- */
81
+ }, {}>;
82
+ /**
83
+ * Creates a tool for executing actions on a computer. Must have name "computer".
84
+ *
85
+ * Image results are supported.
86
+ *
87
+ * @param displayWidthPx - The width of the display being controlled by the model in pixels.
88
+ * @param displayHeightPx - The height of the display being controlled by the model in pixels.
89
+ * @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.
90
+ */
91
+ computer_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
92
+ action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
302
93
  coordinate?: number[];
303
- /**
304
- * Required only by `action=type` and `action=key`.
305
- */
306
94
  text?: string;
307
- }, RESULT>;
308
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
309
- }): {
310
- type: 'provider-defined';
311
- id: 'anthropic.computer_20241022';
312
- args: {};
313
- parameters: typeof Computer20241022Parameters;
314
- execute: ExecuteFunction<z.infer<typeof Computer20241022Parameters>, RESULT>;
315
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
316
- };
317
- declare const Computer20250124Parameters: z.ZodObject<{
318
- action: z.ZodEnum<["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"]>;
319
- coordinate: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
320
- duration: z.ZodOptional<z.ZodNumber>;
321
- scroll_amount: z.ZodOptional<z.ZodNumber>;
322
- scroll_direction: z.ZodOptional<z.ZodEnum<["up", "down", "left", "right"]>>;
323
- start_coordinate: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
324
- text: z.ZodOptional<z.ZodString>;
325
- }, "strip", z.ZodTypeAny, {
326
- action: "type" | "key" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position" | "hold_key" | "left_mouse_down" | "left_mouse_up" | "triple_click" | "scroll" | "wait";
327
- text?: string | undefined;
328
- coordinate?: [number, number] | undefined;
329
- duration?: number | undefined;
330
- scroll_amount?: number | undefined;
331
- scroll_direction?: "up" | "down" | "left" | "right" | undefined;
332
- start_coordinate?: [number, number] | undefined;
333
- }, {
334
- action: "type" | "key" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position" | "hold_key" | "left_mouse_down" | "left_mouse_up" | "triple_click" | "scroll" | "wait";
335
- text?: string | undefined;
336
- coordinate?: [number, number] | undefined;
337
- duration?: number | undefined;
338
- scroll_amount?: number | undefined;
339
- scroll_direction?: "up" | "down" | "left" | "right" | undefined;
340
- start_coordinate?: [number, number] | undefined;
341
- }>;
342
- /**
343
- * Creates a tool for executing actions on a computer. Must have name "computer".
344
- *
345
- * Image results are supported.
346
- *
347
- * @param displayWidthPx - The width of the display being controlled by the model in pixels.
348
- * @param displayHeightPx - The height of the display being controlled by the model in pixels.
349
- * @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.
350
- * @param execute - The function to execute the tool. Optional.
351
- */
352
- declare function computerTool_20250124<RESULT>(options: {
353
- displayWidthPx: number;
354
- displayHeightPx: number;
355
- displayNumber?: number;
356
- execute?: ExecuteFunction<{
357
- /**
358
- * - `key`: Press a key or key-combination on the keyboard.
359
- * - This supports xdotool's `key` syntax.
360
- * - Examples: "a", "Return", "alt+Tab", "ctrl+s", "Up", "KP_0" (for the numpad 0 key).
361
- * - `hold_key`: Hold down a key or multiple keys for a specified duration (in seconds). Supports the same syntax as `key`.
362
- * - `type`: Type a string of text on the keyboard.
363
- * - `cursor_position`: Get the current (x, y) pixel coordinate of the cursor on the screen.
364
- * - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on the screen.
365
- * - `left_mouse_down`: Press the left mouse button.
366
- * - `left_mouse_up`: Release the left mouse button.
367
- * - `left_click`: Click the left mouse button at the specified (x, y) pixel coordinate on the screen. You can also include a key combination to hold down while clicking using the `text` parameter.
368
- * - `left_click_drag`: Click and drag the cursor from `start_coordinate` to a specified (x, y) pixel coordinate on the screen.
369
- * - `right_click`: Click the right mouse button at the specified (x, y) pixel coordinate on the screen.
370
- * - `middle_click`: Click the middle mouse button at the specified (x, y) pixel coordinate on the screen.
371
- * - `double_click`: Double-click the left mouse button at the specified (x, y) pixel coordinate on the screen.
372
- * - `triple_click`: Triple-click the left mouse button at the specified (x, y) pixel coordinate on the screen.
373
- * - `scroll`: Scroll the screen in a specified direction by a specified amount of clicks of the scroll wheel, at the specified (x, y) pixel coordinate. DO NOT use PageUp/PageDown to scroll.
374
- * - `wait`: Wait for a specified duration (in seconds).
375
- * - `screenshot`: Take a screenshot of the screen.
376
- */
377
- 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';
378
- /**
379
- * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=mouse_move` and `action=left_click_drag`.
380
- */
95
+ }, {
96
+ displayWidthPx: number;
97
+ displayHeightPx: number;
98
+ displayNumber?: number;
99
+ }>;
100
+ /**
101
+ * Creates a tool for executing actions on a computer. Must have name "computer".
102
+ *
103
+ * Image results are supported.
104
+ *
105
+ * @param displayWidthPx - The width of the display being controlled by the model in pixels.
106
+ * @param displayHeightPx - The height of the display being controlled by the model in pixels.
107
+ * @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.
108
+ * @param execute - The function to execute the tool. Optional.
109
+ */
110
+ computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
111
+ 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";
381
112
  coordinate?: [number, number];
382
- /**
383
- * The duration to hold the key down for. Required only by `action=hold_key` and `action=wait`.
384
- */
385
113
  duration?: number;
386
- /**
387
- * The number of 'clicks' to scroll. Required only by `action=scroll`.
388
- */
389
114
  scroll_amount?: number;
390
- /**
391
- * The direction to scroll the screen. Required only by `action=scroll`.
392
- */
393
- scroll_direction?: 'up' | 'down' | 'left' | 'right';
394
- /**
395
- * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to start the drag from. Required only by `action=left_click_drag`.
396
- */
115
+ scroll_direction?: "up" | "down" | "left" | "right";
397
116
  start_coordinate?: [number, number];
398
- /**
399
- * Required only by `action=type`, `action=key`, and `action=hold_key`. Can also be used by click or scroll actions to hold down keys while clicking or scrolling.
400
- */
401
117
  text?: string;
402
- }, RESULT>;
403
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
404
- }): {
405
- type: 'provider-defined';
406
- id: 'anthropic.computer_20250124';
407
- args: {};
408
- parameters: typeof Computer20250124Parameters;
409
- execute: ExecuteFunction<z.infer<typeof Computer20250124Parameters>, RESULT>;
410
- experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
411
- };
412
- declare const anthropicTools: {
413
- bash_20241022: typeof bashTool_20241022;
414
- bash_20250124: typeof bashTool_20250124;
415
- textEditor_20241022: typeof textEditorTool_20241022;
416
- textEditor_20250124: typeof textEditorTool_20250124;
417
- computer_20241022: typeof computerTool_20241022;
418
- computer_20250124: typeof computerTool_20250124;
118
+ }, {
119
+ displayWidthPx: number;
120
+ displayHeightPx: number;
121
+ displayNumber?: number;
122
+ }>;
123
+ /**
124
+ * Creates a web search tool that gives Claude direct access to real-time web content.
125
+ * Must have name "web_search".
126
+ *
127
+ * @param maxUses - Maximum number of web searches Claude can perform during the conversation.
128
+ * @param allowedDomains - Optional list of domains that Claude is allowed to search.
129
+ * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
130
+ * @param userLocation - Optional user location information to provide geographically relevant search results.
131
+ */
132
+ webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
133
+ query: string;
134
+ }, {
135
+ url: string;
136
+ title: string;
137
+ pageAge: string | null;
138
+ encryptedContent: string;
139
+ type: string;
140
+ }[], {
141
+ maxUses?: number;
142
+ allowedDomains?: string[];
143
+ blockedDomains?: string[];
144
+ userLocation?: {
145
+ type: "approximate";
146
+ city?: string;
147
+ region?: string;
148
+ country?: string;
149
+ timezone?: string;
150
+ };
151
+ }>>[0]) => _ai_sdk_provider_utils.Tool<{
152
+ query: string;
153
+ }, {
154
+ url: string;
155
+ title: string;
156
+ pageAge: string | null;
157
+ encryptedContent: string;
158
+ type: string;
159
+ }[]>;
419
160
  };
420
161
 
421
162
  export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools };