@ai-sdk/anthropic 4.0.0-beta.4 → 4.0.0-beta.40
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 +293 -4
- package/README.md +2 -0
- package/dist/index.d.ts +83 -58
- package/dist/index.js +1918 -1259
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +85 -58
- package/dist/internal/index.js +1679 -1245
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +115 -12
- package/package.json +14 -15
- package/src/{anthropic-messages-api.ts → anthropic-api.ts} +8 -4
- package/src/anthropic-files.ts +96 -0
- package/src/{anthropic-messages-language-model.ts → anthropic-language-model.ts} +239 -54
- package/src/anthropic-message-metadata.ts +0 -3
- package/src/{anthropic-messages-options.ts → anthropic-options.ts} +68 -11
- package/src/anthropic-prepare-tools.ts +12 -5
- package/src/anthropic-provider.ts +39 -10
- package/src/{convert-anthropic-messages-usage.ts → convert-anthropic-usage.ts} +3 -3
- package/src/{convert-to-anthropic-messages-prompt.ts → convert-to-anthropic-prompt.ts} +51 -28
- package/src/get-cache-control.ts +1 -1
- package/src/index.ts +1 -1
- package/src/internal/index.ts +11 -2
- package/src/sanitize-json-schema.ts +203 -0
- package/src/skills/anthropic-skills-api.ts +44 -0
- package/src/skills/anthropic-skills.ts +136 -0
- package/src/tool/bash_20241022.ts +2 -2
- package/src/tool/bash_20250124.ts +2 -2
- package/src/tool/code-execution_20250522.ts +2 -2
- package/src/tool/code-execution_20250825.ts +2 -2
- package/src/tool/code-execution_20260120.ts +2 -2
- package/src/tool/computer_20241022.ts +2 -2
- package/src/tool/computer_20250124.ts +2 -2
- package/src/tool/computer_20251124.ts +2 -2
- package/src/tool/memory_20250818.ts +2 -2
- package/src/tool/text-editor_20241022.ts +2 -2
- package/src/tool/text-editor_20250124.ts +2 -2
- package/src/tool/text-editor_20250429.ts +2 -2
- package/src/tool/text-editor_20250728.ts +2 -2
- package/src/tool/tool-search-bm25_20251119.ts +2 -2
- package/src/tool/tool-search-regex_20251119.ts +2 -2
- package/src/tool/web-fetch-20250910.ts +2 -2
- package/src/tool/web-fetch-20260209.ts +2 -2
- package/src/tool/web-search_20250305.ts +2 -2
- package/src/tool/web-search_20260209.ts +2 -2
- package/dist/index.d.mts +0 -1090
- package/dist/index.mjs +0 -5244
- package/dist/index.mjs.map +0 -1
- package/dist/internal/index.d.mts +0 -969
- package/dist/internal/index.mjs +0 -5136
- package/dist/internal/index.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONObject, ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
|
|
1
|
+
import { JSONObject, ProviderV4, LanguageModelV4, FilesV4, SkillsV4 } from '@ai-sdk/provider';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
@@ -21,7 +21,6 @@ interface AnthropicUsageIteration {
|
|
|
21
21
|
}
|
|
22
22
|
interface AnthropicMessageMetadata {
|
|
23
23
|
usage: JSONObject;
|
|
24
|
-
cacheCreationInputTokens: number | null;
|
|
25
24
|
stopSequence: string | null;
|
|
26
25
|
/**
|
|
27
26
|
* Usage breakdown by iteration when compaction is triggered.
|
|
@@ -128,7 +127,7 @@ interface AnthropicMessageMetadata {
|
|
|
128
127
|
} | null;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
type
|
|
130
|
+
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' | (string & {});
|
|
132
131
|
declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
133
132
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
134
133
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -138,6 +137,10 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
|
138
137
|
}>>;
|
|
139
138
|
thinking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
139
|
type: z.ZodLiteral<"adaptive">;
|
|
140
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
141
|
+
omitted: "omitted";
|
|
142
|
+
summarized: "summarized";
|
|
143
|
+
}>>;
|
|
141
144
|
}, z.core.$strip>, z.ZodObject<{
|
|
142
145
|
type: z.ZodLiteral<"enabled">;
|
|
143
146
|
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -149,6 +152,9 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
|
149
152
|
type: z.ZodLiteral<"ephemeral">;
|
|
150
153
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"5m">, z.ZodLiteral<"1h">]>>;
|
|
151
154
|
}, z.core.$strip>>;
|
|
155
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
152
158
|
mcpServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
153
159
|
type: z.ZodLiteral<"url">;
|
|
154
160
|
name: z.ZodString;
|
|
@@ -161,23 +167,37 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
|
161
167
|
}, z.core.$strip>>>;
|
|
162
168
|
container: z.ZodOptional<z.ZodObject<{
|
|
163
169
|
id: z.ZodOptional<z.ZodString>;
|
|
164
|
-
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
|
-
type: z.
|
|
170
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
171
|
+
type: z.ZodLiteral<"anthropic">;
|
|
166
172
|
skillId: z.ZodString;
|
|
167
173
|
version: z.ZodOptional<z.ZodString>;
|
|
168
|
-
}, z.core.$strip
|
|
174
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
175
|
+
type: z.ZodLiteral<"custom">;
|
|
176
|
+
providerReference: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
177
|
+
version: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strip>]>>>;
|
|
169
179
|
}, z.core.$strip>>;
|
|
170
180
|
toolStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
171
181
|
effort: z.ZodOptional<z.ZodEnum<{
|
|
172
182
|
low: "low";
|
|
173
183
|
medium: "medium";
|
|
174
184
|
high: "high";
|
|
185
|
+
xhigh: "xhigh";
|
|
175
186
|
max: "max";
|
|
176
187
|
}>>;
|
|
188
|
+
taskBudget: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
type: z.ZodLiteral<"tokens">;
|
|
190
|
+
total: z.ZodNumber;
|
|
191
|
+
remaining: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
177
193
|
speed: z.ZodOptional<z.ZodEnum<{
|
|
178
194
|
fast: "fast";
|
|
179
195
|
standard: "standard";
|
|
180
196
|
}>>;
|
|
197
|
+
inferenceGeo: z.ZodOptional<z.ZodEnum<{
|
|
198
|
+
us: "us";
|
|
199
|
+
global: "global";
|
|
200
|
+
}>>;
|
|
181
201
|
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
182
202
|
contextManagement: z.ZodOptional<z.ZodObject<{
|
|
183
203
|
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -231,20 +251,20 @@ declare const anthropicTools: {
|
|
|
231
251
|
*
|
|
232
252
|
* Image results are supported.
|
|
233
253
|
*/
|
|
234
|
-
bash_20241022: _ai_sdk_provider_utils.
|
|
254
|
+
bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
235
255
|
command: string;
|
|
236
256
|
restart?: boolean;
|
|
237
|
-
}, {}>;
|
|
257
|
+
}, {}, {}>;
|
|
238
258
|
/**
|
|
239
259
|
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
240
260
|
* allowing system operations, script execution, and command-line automation.
|
|
241
261
|
*
|
|
242
262
|
* Image results are supported.
|
|
243
263
|
*/
|
|
244
|
-
bash_20250124: _ai_sdk_provider_utils.
|
|
264
|
+
bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
245
265
|
command: string;
|
|
246
266
|
restart?: boolean;
|
|
247
|
-
}, {}>;
|
|
267
|
+
}, {}, {}>;
|
|
248
268
|
/**
|
|
249
269
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
250
270
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -253,7 +273,7 @@ declare const anthropicTools: {
|
|
|
253
273
|
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
254
274
|
* including writing code, in a secure, sandboxed environment.
|
|
255
275
|
*/
|
|
256
|
-
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.
|
|
276
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
257
277
|
code: string;
|
|
258
278
|
}, {
|
|
259
279
|
type: "code_execution_result";
|
|
@@ -264,7 +284,7 @@ declare const anthropicTools: {
|
|
|
264
284
|
type: "code_execution_output";
|
|
265
285
|
file_id: string;
|
|
266
286
|
}>;
|
|
267
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
287
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
268
288
|
code: string;
|
|
269
289
|
}, {
|
|
270
290
|
type: "code_execution_result";
|
|
@@ -275,7 +295,7 @@ declare const anthropicTools: {
|
|
|
275
295
|
type: "code_execution_output";
|
|
276
296
|
file_id: string;
|
|
277
297
|
}>;
|
|
278
|
-
}>;
|
|
298
|
+
}, {}>;
|
|
279
299
|
/**
|
|
280
300
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
281
301
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -286,7 +306,7 @@ declare const anthropicTools: {
|
|
|
286
306
|
*
|
|
287
307
|
* This is the latest version with enhanced Bash support and file operations.
|
|
288
308
|
*/
|
|
289
|
-
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.
|
|
309
|
+
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
290
310
|
type: "programmatic-tool-call";
|
|
291
311
|
code: string;
|
|
292
312
|
} | {
|
|
@@ -348,7 +368,7 @@ declare const anthropicTools: {
|
|
|
348
368
|
new_start: number | null;
|
|
349
369
|
old_lines: number | null;
|
|
350
370
|
old_start: number | null;
|
|
351
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
371
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
352
372
|
type: "programmatic-tool-call";
|
|
353
373
|
code: string;
|
|
354
374
|
} | {
|
|
@@ -410,7 +430,7 @@ declare const anthropicTools: {
|
|
|
410
430
|
new_start: number | null;
|
|
411
431
|
old_lines: number | null;
|
|
412
432
|
old_start: number | null;
|
|
413
|
-
}>;
|
|
433
|
+
}, {}>;
|
|
414
434
|
/**
|
|
415
435
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
416
436
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -423,7 +443,7 @@ declare const anthropicTools: {
|
|
|
423
443
|
*
|
|
424
444
|
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
425
445
|
*/
|
|
426
|
-
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.
|
|
446
|
+
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
427
447
|
type: "programmatic-tool-call";
|
|
428
448
|
code: string;
|
|
429
449
|
} | {
|
|
@@ -494,7 +514,7 @@ declare const anthropicTools: {
|
|
|
494
514
|
new_start: number | null;
|
|
495
515
|
old_lines: number | null;
|
|
496
516
|
old_start: number | null;
|
|
497
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
517
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
498
518
|
type: "programmatic-tool-call";
|
|
499
519
|
code: string;
|
|
500
520
|
} | {
|
|
@@ -565,7 +585,7 @@ declare const anthropicTools: {
|
|
|
565
585
|
new_start: number | null;
|
|
566
586
|
old_lines: number | null;
|
|
567
587
|
old_start: number | null;
|
|
568
|
-
}>;
|
|
588
|
+
}, {}>;
|
|
569
589
|
/**
|
|
570
590
|
* Claude can interact with computer environments through the computer use tool, which
|
|
571
591
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -576,7 +596,7 @@ declare const anthropicTools: {
|
|
|
576
596
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
577
597
|
* @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.
|
|
578
598
|
*/
|
|
579
|
-
computer_20241022: _ai_sdk_provider_utils.
|
|
599
|
+
computer_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
580
600
|
action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
|
|
581
601
|
coordinate?: number[];
|
|
582
602
|
text?: string;
|
|
@@ -584,7 +604,7 @@ declare const anthropicTools: {
|
|
|
584
604
|
displayWidthPx: number;
|
|
585
605
|
displayHeightPx: number;
|
|
586
606
|
displayNumber?: number;
|
|
587
|
-
}>;
|
|
607
|
+
}, {}>;
|
|
588
608
|
/**
|
|
589
609
|
* Claude can interact with computer environments through the computer use tool, which
|
|
590
610
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -595,7 +615,7 @@ declare const anthropicTools: {
|
|
|
595
615
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
596
616
|
* @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.
|
|
597
617
|
*/
|
|
598
|
-
computer_20250124: _ai_sdk_provider_utils.
|
|
618
|
+
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
599
619
|
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";
|
|
600
620
|
coordinate?: [number, number];
|
|
601
621
|
duration?: number;
|
|
@@ -607,7 +627,7 @@ declare const anthropicTools: {
|
|
|
607
627
|
displayWidthPx: number;
|
|
608
628
|
displayHeightPx: number;
|
|
609
629
|
displayNumber?: number;
|
|
610
|
-
}>;
|
|
630
|
+
}, {}>;
|
|
611
631
|
/**
|
|
612
632
|
* Claude can interact with computer environments through the computer use tool, which
|
|
613
633
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -623,7 +643,7 @@ declare const anthropicTools: {
|
|
|
623
643
|
* @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.
|
|
624
644
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
625
645
|
*/
|
|
626
|
-
computer_20251124: _ai_sdk_provider_utils.
|
|
646
|
+
computer_20251124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
627
647
|
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";
|
|
628
648
|
coordinate?: [number, number];
|
|
629
649
|
duration?: number;
|
|
@@ -637,7 +657,7 @@ declare const anthropicTools: {
|
|
|
637
657
|
displayHeightPx: number;
|
|
638
658
|
displayNumber?: number;
|
|
639
659
|
enableZoom?: boolean;
|
|
640
|
-
}>;
|
|
660
|
+
}, {}>;
|
|
641
661
|
/**
|
|
642
662
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
643
663
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -646,7 +666,7 @@ declare const anthropicTools: {
|
|
|
646
666
|
*
|
|
647
667
|
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
648
668
|
*/
|
|
649
|
-
memory_20250818: _ai_sdk_provider_utils.
|
|
669
|
+
memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
650
670
|
command: "view";
|
|
651
671
|
path: string;
|
|
652
672
|
view_range?: [number, number];
|
|
@@ -671,7 +691,7 @@ declare const anthropicTools: {
|
|
|
671
691
|
command: "rename";
|
|
672
692
|
old_path: string;
|
|
673
693
|
new_path: string;
|
|
674
|
-
}, {}>;
|
|
694
|
+
}, {}, {}>;
|
|
675
695
|
/**
|
|
676
696
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
677
697
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -679,7 +699,7 @@ declare const anthropicTools: {
|
|
|
679
699
|
*
|
|
680
700
|
* Supported models: Claude Sonnet 3.5
|
|
681
701
|
*/
|
|
682
|
-
textEditor_20241022: _ai_sdk_provider_utils.
|
|
702
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
683
703
|
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
684
704
|
path: string;
|
|
685
705
|
file_text?: string;
|
|
@@ -688,7 +708,7 @@ declare const anthropicTools: {
|
|
|
688
708
|
insert_text?: string;
|
|
689
709
|
old_str?: string;
|
|
690
710
|
view_range?: number[];
|
|
691
|
-
}, {}>;
|
|
711
|
+
}, {}, {}>;
|
|
692
712
|
/**
|
|
693
713
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
694
714
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -696,7 +716,7 @@ declare const anthropicTools: {
|
|
|
696
716
|
*
|
|
697
717
|
* Supported models: Claude Sonnet 3.7
|
|
698
718
|
*/
|
|
699
|
-
textEditor_20250124: _ai_sdk_provider_utils.
|
|
719
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
700
720
|
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
701
721
|
path: string;
|
|
702
722
|
file_text?: string;
|
|
@@ -705,7 +725,7 @@ declare const anthropicTools: {
|
|
|
705
725
|
insert_text?: string;
|
|
706
726
|
old_str?: string;
|
|
707
727
|
view_range?: number[];
|
|
708
|
-
}, {}>;
|
|
728
|
+
}, {}, {}>;
|
|
709
729
|
/**
|
|
710
730
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
711
731
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -715,7 +735,7 @@ declare const anthropicTools: {
|
|
|
715
735
|
*
|
|
716
736
|
* @deprecated Use textEditor_20250728 instead
|
|
717
737
|
*/
|
|
718
|
-
textEditor_20250429: _ai_sdk_provider_utils.
|
|
738
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
719
739
|
command: "view" | "create" | "str_replace" | "insert";
|
|
720
740
|
path: string;
|
|
721
741
|
file_text?: string;
|
|
@@ -724,7 +744,7 @@ declare const anthropicTools: {
|
|
|
724
744
|
insert_text?: string;
|
|
725
745
|
old_str?: string;
|
|
726
746
|
view_range?: number[];
|
|
727
|
-
}, {}>;
|
|
747
|
+
}, {}, {}>;
|
|
728
748
|
/**
|
|
729
749
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
730
750
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -736,7 +756,7 @@ declare const anthropicTools: {
|
|
|
736
756
|
*
|
|
737
757
|
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
738
758
|
*/
|
|
739
|
-
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.
|
|
759
|
+
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
740
760
|
command: "view" | "create" | "str_replace" | "insert";
|
|
741
761
|
path: string;
|
|
742
762
|
file_text?: string;
|
|
@@ -747,7 +767,7 @@ declare const anthropicTools: {
|
|
|
747
767
|
view_range?: number[];
|
|
748
768
|
}, {
|
|
749
769
|
maxCharacters?: number;
|
|
750
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
770
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
751
771
|
command: "view" | "create" | "str_replace" | "insert";
|
|
752
772
|
path: string;
|
|
753
773
|
file_text?: string;
|
|
@@ -756,7 +776,7 @@ declare const anthropicTools: {
|
|
|
756
776
|
insert_text?: string;
|
|
757
777
|
old_str?: string;
|
|
758
778
|
view_range?: number[];
|
|
759
|
-
}, unknown>;
|
|
779
|
+
}, unknown, {}>;
|
|
760
780
|
/**
|
|
761
781
|
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
762
782
|
*
|
|
@@ -766,7 +786,7 @@ declare const anthropicTools: {
|
|
|
766
786
|
* @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.
|
|
767
787
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
768
788
|
*/
|
|
769
|
-
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.
|
|
789
|
+
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
770
790
|
url: string;
|
|
771
791
|
}, {
|
|
772
792
|
type: "web_fetch_result";
|
|
@@ -796,7 +816,7 @@ declare const anthropicTools: {
|
|
|
796
816
|
enabled: boolean;
|
|
797
817
|
};
|
|
798
818
|
maxContentTokens?: number;
|
|
799
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
819
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
800
820
|
url: string;
|
|
801
821
|
}, {
|
|
802
822
|
type: "web_fetch_result";
|
|
@@ -818,7 +838,7 @@ declare const anthropicTools: {
|
|
|
818
838
|
};
|
|
819
839
|
};
|
|
820
840
|
retrievedAt: string | null;
|
|
821
|
-
}>;
|
|
841
|
+
}, {}>;
|
|
822
842
|
/**
|
|
823
843
|
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
824
844
|
*
|
|
@@ -828,7 +848,7 @@ declare const anthropicTools: {
|
|
|
828
848
|
* @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.
|
|
829
849
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
830
850
|
*/
|
|
831
|
-
webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.
|
|
851
|
+
webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
832
852
|
url: string;
|
|
833
853
|
}, {
|
|
834
854
|
type: "web_fetch_result";
|
|
@@ -858,7 +878,7 @@ declare const anthropicTools: {
|
|
|
858
878
|
enabled: boolean;
|
|
859
879
|
};
|
|
860
880
|
maxContentTokens?: number;
|
|
861
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
881
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
862
882
|
url: string;
|
|
863
883
|
}, {
|
|
864
884
|
type: "web_fetch_result";
|
|
@@ -880,7 +900,7 @@ declare const anthropicTools: {
|
|
|
880
900
|
};
|
|
881
901
|
};
|
|
882
902
|
retrievedAt: string | null;
|
|
883
|
-
}>;
|
|
903
|
+
}, {}>;
|
|
884
904
|
/**
|
|
885
905
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
886
906
|
*
|
|
@@ -889,7 +909,7 @@ declare const anthropicTools: {
|
|
|
889
909
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
890
910
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
891
911
|
*/
|
|
892
|
-
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.
|
|
912
|
+
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
893
913
|
query: string;
|
|
894
914
|
}, {
|
|
895
915
|
type: "web_search_result";
|
|
@@ -908,7 +928,7 @@ declare const anthropicTools: {
|
|
|
908
928
|
country?: string;
|
|
909
929
|
timezone?: string;
|
|
910
930
|
};
|
|
911
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
931
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
912
932
|
query: string;
|
|
913
933
|
}, {
|
|
914
934
|
type: "web_search_result";
|
|
@@ -916,7 +936,7 @@ declare const anthropicTools: {
|
|
|
916
936
|
title: string | null;
|
|
917
937
|
pageAge: string | null;
|
|
918
938
|
encryptedContent: string;
|
|
919
|
-
}[]>;
|
|
939
|
+
}[], {}>;
|
|
920
940
|
/**
|
|
921
941
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
922
942
|
*
|
|
@@ -925,7 +945,7 @@ declare const anthropicTools: {
|
|
|
925
945
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
926
946
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
927
947
|
*/
|
|
928
|
-
webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.
|
|
948
|
+
webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
929
949
|
query: string;
|
|
930
950
|
}, {
|
|
931
951
|
type: "web_search_result";
|
|
@@ -944,7 +964,7 @@ declare const anthropicTools: {
|
|
|
944
964
|
country?: string;
|
|
945
965
|
timezone?: string;
|
|
946
966
|
};
|
|
947
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
967
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
948
968
|
query: string;
|
|
949
969
|
}, {
|
|
950
970
|
type: "web_search_result";
|
|
@@ -952,7 +972,7 @@ declare const anthropicTools: {
|
|
|
952
972
|
title: string | null;
|
|
953
973
|
pageAge: string | null;
|
|
954
974
|
encryptedContent: string;
|
|
955
|
-
}[]>;
|
|
975
|
+
}[], {}>;
|
|
956
976
|
/**
|
|
957
977
|
* Creates a tool search tool that uses regex patterns to find tools.
|
|
958
978
|
*
|
|
@@ -966,19 +986,19 @@ declare const anthropicTools: {
|
|
|
966
986
|
*
|
|
967
987
|
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
968
988
|
*/
|
|
969
|
-
toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.
|
|
989
|
+
toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
970
990
|
pattern: string;
|
|
971
991
|
limit?: number;
|
|
972
992
|
}, {
|
|
973
993
|
type: "tool_reference";
|
|
974
994
|
toolName: string;
|
|
975
|
-
}[], {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
995
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
976
996
|
pattern: string;
|
|
977
997
|
limit?: number;
|
|
978
998
|
}, {
|
|
979
999
|
type: "tool_reference";
|
|
980
1000
|
toolName: string;
|
|
981
|
-
}[]>;
|
|
1001
|
+
}[], {}>;
|
|
982
1002
|
/**
|
|
983
1003
|
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
984
1004
|
*
|
|
@@ -992,36 +1012,41 @@ declare const anthropicTools: {
|
|
|
992
1012
|
*
|
|
993
1013
|
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
994
1014
|
*/
|
|
995
|
-
toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.
|
|
1015
|
+
toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
996
1016
|
query: string;
|
|
997
1017
|
limit?: number;
|
|
998
1018
|
}, {
|
|
999
1019
|
type: "tool_reference";
|
|
1000
1020
|
toolName: string;
|
|
1001
|
-
}[], {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
1021
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
1002
1022
|
query: string;
|
|
1003
1023
|
limit?: number;
|
|
1004
1024
|
}, {
|
|
1005
1025
|
type: "tool_reference";
|
|
1006
1026
|
toolName: string;
|
|
1007
|
-
}[]>;
|
|
1027
|
+
}[], {}>;
|
|
1008
1028
|
};
|
|
1009
1029
|
|
|
1010
1030
|
interface AnthropicProvider extends ProviderV4 {
|
|
1011
1031
|
/**
|
|
1012
1032
|
* Creates a model for text generation.
|
|
1013
1033
|
*/
|
|
1014
|
-
(modelId:
|
|
1034
|
+
(modelId: AnthropicModelId): LanguageModelV4;
|
|
1015
1035
|
/**
|
|
1016
1036
|
* Creates a model for text generation.
|
|
1017
1037
|
*/
|
|
1018
|
-
languageModel(modelId:
|
|
1019
|
-
chat(modelId:
|
|
1020
|
-
messages(modelId:
|
|
1038
|
+
languageModel(modelId: AnthropicModelId): LanguageModelV4;
|
|
1039
|
+
chat(modelId: AnthropicModelId): LanguageModelV4;
|
|
1040
|
+
messages(modelId: AnthropicModelId): LanguageModelV4;
|
|
1021
1041
|
/**
|
|
1022
1042
|
* @deprecated Use `embeddingModel` instead.
|
|
1023
1043
|
*/
|
|
1024
1044
|
textEmbeddingModel(modelId: string): never;
|
|
1045
|
+
files(): FilesV4;
|
|
1046
|
+
/**
|
|
1047
|
+
* Returns a SkillsV4 interface for uploading skills to Anthropic.
|
|
1048
|
+
*/
|
|
1049
|
+
skills(): SkillsV4;
|
|
1025
1050
|
/**
|
|
1026
1051
|
* Anthropic-specific computer use tool.
|
|
1027
1052
|
*/
|