@ai-sdk/anthropic 4.0.0-beta.4 → 4.0.0-beta.41
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 +305 -4
- package/README.md +2 -0
- package/dist/index.d.ts +83 -58
- package/dist/index.js +2043 -1356
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +85 -58
- package/dist/internal/index.js +1804 -1342
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +116 -13
- package/package.json +14 -15
- package/src/{anthropic-messages-api.ts → anthropic-api.ts} +14 -6
- package/src/anthropic-error.ts +1 -1
- package/src/anthropic-files.ts +95 -0
- package/src/{anthropic-messages-language-model.ts → anthropic-language-model.ts} +263 -78
- package/src/anthropic-message-metadata.ts +1 -4
- package/src/{anthropic-messages-options.ts → anthropic-options.ts} +68 -11
- package/src/anthropic-prepare-tools.ts +14 -7
- package/src/anthropic-provider.ts +42 -13
- package/src/{convert-anthropic-messages-usage.ts → convert-anthropic-usage.ts} +4 -4
- package/src/{convert-to-anthropic-messages-prompt.ts → convert-to-anthropic-prompt.ts} +190 -149
- package/src/forward-anthropic-container-id-from-last-step.ts +2 -2
- package/src/get-cache-control.ts +5 -2
- package/src/index.ts +1 -1
- package/src/internal/index.ts +11 -2
- package/src/map-anthropic-stop-reason.ts +1 -1
- package/src/sanitize-json-schema.ts +203 -0
- package/src/skills/anthropic-skills-api.ts +44 -0
- package/src/skills/anthropic-skills.ts +132 -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 +6 -3
- 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/internal/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, JSONSchema7, SharedV4ProviderMetadata, SharedV4Warning } from '@ai-sdk/provider';
|
|
1
|
+
import { LanguageModelV4, JSONObject, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, JSONSchema7, SharedV4ProviderMetadata, SharedV4Warning } from '@ai-sdk/provider';
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
|
-
import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
+
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
|
|
5
|
-
type
|
|
5
|
+
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 & {});
|
|
6
6
|
|
|
7
|
-
type
|
|
7
|
+
type AnthropicLanguageModelConfig = {
|
|
8
8
|
provider: string;
|
|
9
9
|
baseURL: string;
|
|
10
|
-
headers
|
|
10
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
11
11
|
fetch?: FetchFunction;
|
|
12
12
|
buildRequestUrl?: (baseURL: string, isStreaming: boolean) => string;
|
|
13
13
|
transformRequestBody?: (args: Record<string, any>, betas: Set<string>) => Record<string, any>;
|
|
@@ -23,12 +23,20 @@ type AnthropicMessagesConfig = {
|
|
|
23
23
|
*/
|
|
24
24
|
supportsStrictTools?: boolean;
|
|
25
25
|
};
|
|
26
|
-
declare class
|
|
26
|
+
declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
27
27
|
readonly specificationVersion = "v4";
|
|
28
|
-
readonly modelId:
|
|
28
|
+
readonly modelId: AnthropicModelId;
|
|
29
29
|
private readonly config;
|
|
30
30
|
private readonly generateId;
|
|
31
|
-
|
|
31
|
+
static [WORKFLOW_SERIALIZE](model: AnthropicLanguageModel): {
|
|
32
|
+
modelId: string;
|
|
33
|
+
config: JSONObject;
|
|
34
|
+
};
|
|
35
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
36
|
+
modelId: AnthropicModelId;
|
|
37
|
+
config: AnthropicLanguageModelConfig;
|
|
38
|
+
}): AnthropicLanguageModel;
|
|
39
|
+
constructor(modelId: AnthropicModelId, config: AnthropicLanguageModelConfig);
|
|
32
40
|
supportsUrl(url: URL): boolean;
|
|
33
41
|
get provider(): string;
|
|
34
42
|
/**
|
|
@@ -46,6 +54,20 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV4 {
|
|
|
46
54
|
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
47
55
|
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
48
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Returns the capabilities of a Claude model that are used for defaults and feature selection.
|
|
59
|
+
*
|
|
60
|
+
* @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
|
|
61
|
+
* @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
|
|
62
|
+
*/
|
|
63
|
+
declare function getModelCapabilities(modelId: string): {
|
|
64
|
+
maxOutputTokens: number;
|
|
65
|
+
supportsStructuredOutput: boolean;
|
|
66
|
+
supportsAdaptiveThinking: boolean;
|
|
67
|
+
rejectsSamplingParameters: boolean;
|
|
68
|
+
supportsXhighEffort: boolean;
|
|
69
|
+
isKnownModel: boolean;
|
|
70
|
+
};
|
|
49
71
|
|
|
50
72
|
declare const anthropicTools: {
|
|
51
73
|
/**
|
|
@@ -54,20 +76,20 @@ declare const anthropicTools: {
|
|
|
54
76
|
*
|
|
55
77
|
* Image results are supported.
|
|
56
78
|
*/
|
|
57
|
-
bash_20241022: _ai_sdk_provider_utils.
|
|
79
|
+
bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
58
80
|
command: string;
|
|
59
81
|
restart?: boolean;
|
|
60
|
-
}, {}>;
|
|
82
|
+
}, {}, {}>;
|
|
61
83
|
/**
|
|
62
84
|
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
63
85
|
* allowing system operations, script execution, and command-line automation.
|
|
64
86
|
*
|
|
65
87
|
* Image results are supported.
|
|
66
88
|
*/
|
|
67
|
-
bash_20250124: _ai_sdk_provider_utils.
|
|
89
|
+
bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
68
90
|
command: string;
|
|
69
91
|
restart?: boolean;
|
|
70
|
-
}, {}>;
|
|
92
|
+
}, {}, {}>;
|
|
71
93
|
/**
|
|
72
94
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
73
95
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -76,7 +98,7 @@ declare const anthropicTools: {
|
|
|
76
98
|
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
77
99
|
* including writing code, in a secure, sandboxed environment.
|
|
78
100
|
*/
|
|
79
|
-
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.
|
|
101
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
80
102
|
code: string;
|
|
81
103
|
}, {
|
|
82
104
|
type: "code_execution_result";
|
|
@@ -87,7 +109,7 @@ declare const anthropicTools: {
|
|
|
87
109
|
type: "code_execution_output";
|
|
88
110
|
file_id: string;
|
|
89
111
|
}>;
|
|
90
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.
|
|
112
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
91
113
|
code: string;
|
|
92
114
|
}, {
|
|
93
115
|
type: "code_execution_result";
|
|
@@ -98,7 +120,7 @@ declare const anthropicTools: {
|
|
|
98
120
|
type: "code_execution_output";
|
|
99
121
|
file_id: string;
|
|
100
122
|
}>;
|
|
101
|
-
}>;
|
|
123
|
+
}, {}>;
|
|
102
124
|
/**
|
|
103
125
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
104
126
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -109,7 +131,7 @@ declare const anthropicTools: {
|
|
|
109
131
|
*
|
|
110
132
|
* This is the latest version with enhanced Bash support and file operations.
|
|
111
133
|
*/
|
|
112
|
-
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.
|
|
134
|
+
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
113
135
|
type: "programmatic-tool-call";
|
|
114
136
|
code: string;
|
|
115
137
|
} | {
|
|
@@ -171,7 +193,7 @@ declare const anthropicTools: {
|
|
|
171
193
|
new_start: number | null;
|
|
172
194
|
old_lines: number | null;
|
|
173
195
|
old_start: number | null;
|
|
174
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.
|
|
196
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
175
197
|
type: "programmatic-tool-call";
|
|
176
198
|
code: string;
|
|
177
199
|
} | {
|
|
@@ -233,7 +255,7 @@ declare const anthropicTools: {
|
|
|
233
255
|
new_start: number | null;
|
|
234
256
|
old_lines: number | null;
|
|
235
257
|
old_start: number | null;
|
|
236
|
-
}>;
|
|
258
|
+
}, {}>;
|
|
237
259
|
/**
|
|
238
260
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
239
261
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -246,7 +268,7 @@ declare const anthropicTools: {
|
|
|
246
268
|
*
|
|
247
269
|
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
248
270
|
*/
|
|
249
|
-
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.
|
|
271
|
+
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
250
272
|
type: "programmatic-tool-call";
|
|
251
273
|
code: string;
|
|
252
274
|
} | {
|
|
@@ -317,7 +339,7 @@ declare const anthropicTools: {
|
|
|
317
339
|
new_start: number | null;
|
|
318
340
|
old_lines: number | null;
|
|
319
341
|
old_start: number | null;
|
|
320
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.
|
|
342
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
321
343
|
type: "programmatic-tool-call";
|
|
322
344
|
code: string;
|
|
323
345
|
} | {
|
|
@@ -388,7 +410,7 @@ declare const anthropicTools: {
|
|
|
388
410
|
new_start: number | null;
|
|
389
411
|
old_lines: number | null;
|
|
390
412
|
old_start: number | null;
|
|
391
|
-
}>;
|
|
413
|
+
}, {}>;
|
|
392
414
|
/**
|
|
393
415
|
* Claude can interact with computer environments through the computer use tool, which
|
|
394
416
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -399,7 +421,7 @@ declare const anthropicTools: {
|
|
|
399
421
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
400
422
|
* @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.
|
|
401
423
|
*/
|
|
402
|
-
computer_20241022: _ai_sdk_provider_utils.
|
|
424
|
+
computer_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
403
425
|
action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
|
|
404
426
|
coordinate?: number[];
|
|
405
427
|
text?: string;
|
|
@@ -407,7 +429,7 @@ declare const anthropicTools: {
|
|
|
407
429
|
displayWidthPx: number;
|
|
408
430
|
displayHeightPx: number;
|
|
409
431
|
displayNumber?: number;
|
|
410
|
-
}>;
|
|
432
|
+
}, {}>;
|
|
411
433
|
/**
|
|
412
434
|
* Claude can interact with computer environments through the computer use tool, which
|
|
413
435
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -418,7 +440,7 @@ declare const anthropicTools: {
|
|
|
418
440
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
419
441
|
* @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.
|
|
420
442
|
*/
|
|
421
|
-
computer_20250124: _ai_sdk_provider_utils.
|
|
443
|
+
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
422
444
|
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";
|
|
423
445
|
coordinate?: [number, number];
|
|
424
446
|
duration?: number;
|
|
@@ -430,7 +452,7 @@ declare const anthropicTools: {
|
|
|
430
452
|
displayWidthPx: number;
|
|
431
453
|
displayHeightPx: number;
|
|
432
454
|
displayNumber?: number;
|
|
433
|
-
}>;
|
|
455
|
+
}, {}>;
|
|
434
456
|
/**
|
|
435
457
|
* Claude can interact with computer environments through the computer use tool, which
|
|
436
458
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -446,7 +468,7 @@ declare const anthropicTools: {
|
|
|
446
468
|
* @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.
|
|
447
469
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
448
470
|
*/
|
|
449
|
-
computer_20251124: _ai_sdk_provider_utils.
|
|
471
|
+
computer_20251124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
450
472
|
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";
|
|
451
473
|
coordinate?: [number, number];
|
|
452
474
|
duration?: number;
|
|
@@ -460,7 +482,7 @@ declare const anthropicTools: {
|
|
|
460
482
|
displayHeightPx: number;
|
|
461
483
|
displayNumber?: number;
|
|
462
484
|
enableZoom?: boolean;
|
|
463
|
-
}>;
|
|
485
|
+
}, {}>;
|
|
464
486
|
/**
|
|
465
487
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
466
488
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -469,7 +491,7 @@ declare const anthropicTools: {
|
|
|
469
491
|
*
|
|
470
492
|
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
471
493
|
*/
|
|
472
|
-
memory_20250818: _ai_sdk_provider_utils.
|
|
494
|
+
memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
473
495
|
command: "view";
|
|
474
496
|
path: string;
|
|
475
497
|
view_range?: [number, number];
|
|
@@ -494,7 +516,7 @@ declare const anthropicTools: {
|
|
|
494
516
|
command: "rename";
|
|
495
517
|
old_path: string;
|
|
496
518
|
new_path: string;
|
|
497
|
-
}, {}>;
|
|
519
|
+
}, {}, {}>;
|
|
498
520
|
/**
|
|
499
521
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
500
522
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -502,7 +524,7 @@ declare const anthropicTools: {
|
|
|
502
524
|
*
|
|
503
525
|
* Supported models: Claude Sonnet 3.5
|
|
504
526
|
*/
|
|
505
|
-
textEditor_20241022: _ai_sdk_provider_utils.
|
|
527
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
506
528
|
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
507
529
|
path: string;
|
|
508
530
|
file_text?: string;
|
|
@@ -511,7 +533,7 @@ declare const anthropicTools: {
|
|
|
511
533
|
insert_text?: string;
|
|
512
534
|
old_str?: string;
|
|
513
535
|
view_range?: number[];
|
|
514
|
-
}, {}>;
|
|
536
|
+
}, {}, {}>;
|
|
515
537
|
/**
|
|
516
538
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
517
539
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -519,7 +541,7 @@ declare const anthropicTools: {
|
|
|
519
541
|
*
|
|
520
542
|
* Supported models: Claude Sonnet 3.7
|
|
521
543
|
*/
|
|
522
|
-
textEditor_20250124: _ai_sdk_provider_utils.
|
|
544
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
523
545
|
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
524
546
|
path: string;
|
|
525
547
|
file_text?: string;
|
|
@@ -528,7 +550,7 @@ declare const anthropicTools: {
|
|
|
528
550
|
insert_text?: string;
|
|
529
551
|
old_str?: string;
|
|
530
552
|
view_range?: number[];
|
|
531
|
-
}, {}>;
|
|
553
|
+
}, {}, {}>;
|
|
532
554
|
/**
|
|
533
555
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
534
556
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -538,7 +560,7 @@ declare const anthropicTools: {
|
|
|
538
560
|
*
|
|
539
561
|
* @deprecated Use textEditor_20250728 instead
|
|
540
562
|
*/
|
|
541
|
-
textEditor_20250429: _ai_sdk_provider_utils.
|
|
563
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
542
564
|
command: "view" | "create" | "str_replace" | "insert";
|
|
543
565
|
path: string;
|
|
544
566
|
file_text?: string;
|
|
@@ -547,7 +569,7 @@ declare const anthropicTools: {
|
|
|
547
569
|
insert_text?: string;
|
|
548
570
|
old_str?: string;
|
|
549
571
|
view_range?: number[];
|
|
550
|
-
}, {}>;
|
|
572
|
+
}, {}, {}>;
|
|
551
573
|
/**
|
|
552
574
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
553
575
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -559,7 +581,7 @@ declare const anthropicTools: {
|
|
|
559
581
|
*
|
|
560
582
|
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
561
583
|
*/
|
|
562
|
-
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.
|
|
584
|
+
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
563
585
|
command: "view" | "create" | "str_replace" | "insert";
|
|
564
586
|
path: string;
|
|
565
587
|
file_text?: string;
|
|
@@ -570,7 +592,7 @@ declare const anthropicTools: {
|
|
|
570
592
|
view_range?: number[];
|
|
571
593
|
}, {
|
|
572
594
|
maxCharacters?: number;
|
|
573
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
595
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderDefinedTool<{
|
|
574
596
|
command: "view" | "create" | "str_replace" | "insert";
|
|
575
597
|
path: string;
|
|
576
598
|
file_text?: string;
|
|
@@ -579,7 +601,7 @@ declare const anthropicTools: {
|
|
|
579
601
|
insert_text?: string;
|
|
580
602
|
old_str?: string;
|
|
581
603
|
view_range?: number[];
|
|
582
|
-
}, unknown>;
|
|
604
|
+
}, unknown, {}>;
|
|
583
605
|
/**
|
|
584
606
|
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
585
607
|
*
|
|
@@ -589,7 +611,7 @@ declare const anthropicTools: {
|
|
|
589
611
|
* @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.
|
|
590
612
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
591
613
|
*/
|
|
592
|
-
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.
|
|
614
|
+
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
593
615
|
url: string;
|
|
594
616
|
}, {
|
|
595
617
|
type: "web_fetch_result";
|
|
@@ -619,7 +641,7 @@ declare const anthropicTools: {
|
|
|
619
641
|
enabled: boolean;
|
|
620
642
|
};
|
|
621
643
|
maxContentTokens?: number;
|
|
622
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
644
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
623
645
|
url: string;
|
|
624
646
|
}, {
|
|
625
647
|
type: "web_fetch_result";
|
|
@@ -641,7 +663,7 @@ declare const anthropicTools: {
|
|
|
641
663
|
};
|
|
642
664
|
};
|
|
643
665
|
retrievedAt: string | null;
|
|
644
|
-
}>;
|
|
666
|
+
}, {}>;
|
|
645
667
|
/**
|
|
646
668
|
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
647
669
|
*
|
|
@@ -651,7 +673,7 @@ declare const anthropicTools: {
|
|
|
651
673
|
* @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.
|
|
652
674
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
653
675
|
*/
|
|
654
|
-
webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.
|
|
676
|
+
webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
655
677
|
url: string;
|
|
656
678
|
}, {
|
|
657
679
|
type: "web_fetch_result";
|
|
@@ -681,7 +703,7 @@ declare const anthropicTools: {
|
|
|
681
703
|
enabled: boolean;
|
|
682
704
|
};
|
|
683
705
|
maxContentTokens?: number;
|
|
684
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
706
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
685
707
|
url: string;
|
|
686
708
|
}, {
|
|
687
709
|
type: "web_fetch_result";
|
|
@@ -703,7 +725,7 @@ declare const anthropicTools: {
|
|
|
703
725
|
};
|
|
704
726
|
};
|
|
705
727
|
retrievedAt: string | null;
|
|
706
|
-
}>;
|
|
728
|
+
}, {}>;
|
|
707
729
|
/**
|
|
708
730
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
709
731
|
*
|
|
@@ -712,7 +734,7 @@ declare const anthropicTools: {
|
|
|
712
734
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
713
735
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
714
736
|
*/
|
|
715
|
-
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.
|
|
737
|
+
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
716
738
|
query: string;
|
|
717
739
|
}, {
|
|
718
740
|
type: "web_search_result";
|
|
@@ -731,7 +753,7 @@ declare const anthropicTools: {
|
|
|
731
753
|
country?: string;
|
|
732
754
|
timezone?: string;
|
|
733
755
|
};
|
|
734
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
756
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
735
757
|
query: string;
|
|
736
758
|
}, {
|
|
737
759
|
type: "web_search_result";
|
|
@@ -739,7 +761,7 @@ declare const anthropicTools: {
|
|
|
739
761
|
title: string | null;
|
|
740
762
|
pageAge: string | null;
|
|
741
763
|
encryptedContent: string;
|
|
742
|
-
}[]>;
|
|
764
|
+
}[], {}>;
|
|
743
765
|
/**
|
|
744
766
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
745
767
|
*
|
|
@@ -748,7 +770,7 @@ declare const anthropicTools: {
|
|
|
748
770
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
749
771
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
750
772
|
*/
|
|
751
|
-
webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.
|
|
773
|
+
webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
752
774
|
query: string;
|
|
753
775
|
}, {
|
|
754
776
|
type: "web_search_result";
|
|
@@ -767,7 +789,7 @@ declare const anthropicTools: {
|
|
|
767
789
|
country?: string;
|
|
768
790
|
timezone?: string;
|
|
769
791
|
};
|
|
770
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
792
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
771
793
|
query: string;
|
|
772
794
|
}, {
|
|
773
795
|
type: "web_search_result";
|
|
@@ -775,7 +797,7 @@ declare const anthropicTools: {
|
|
|
775
797
|
title: string | null;
|
|
776
798
|
pageAge: string | null;
|
|
777
799
|
encryptedContent: string;
|
|
778
|
-
}[]>;
|
|
800
|
+
}[], {}>;
|
|
779
801
|
/**
|
|
780
802
|
* Creates a tool search tool that uses regex patterns to find tools.
|
|
781
803
|
*
|
|
@@ -789,19 +811,19 @@ declare const anthropicTools: {
|
|
|
789
811
|
*
|
|
790
812
|
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
791
813
|
*/
|
|
792
|
-
toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.
|
|
814
|
+
toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
793
815
|
pattern: string;
|
|
794
816
|
limit?: number;
|
|
795
817
|
}, {
|
|
796
818
|
type: "tool_reference";
|
|
797
819
|
toolName: string;
|
|
798
|
-
}[], {}>>[0]) => _ai_sdk_provider_utils.
|
|
820
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
799
821
|
pattern: string;
|
|
800
822
|
limit?: number;
|
|
801
823
|
}, {
|
|
802
824
|
type: "tool_reference";
|
|
803
825
|
toolName: string;
|
|
804
|
-
}[]>;
|
|
826
|
+
}[], {}>;
|
|
805
827
|
/**
|
|
806
828
|
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
807
829
|
*
|
|
@@ -815,19 +837,19 @@ declare const anthropicTools: {
|
|
|
815
837
|
*
|
|
816
838
|
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
817
839
|
*/
|
|
818
|
-
toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.
|
|
840
|
+
toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
819
841
|
query: string;
|
|
820
842
|
limit?: number;
|
|
821
843
|
}, {
|
|
822
844
|
type: "tool_reference";
|
|
823
845
|
toolName: string;
|
|
824
|
-
}[], {}>>[0]) => _ai_sdk_provider_utils.
|
|
846
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
825
847
|
query: string;
|
|
826
848
|
limit?: number;
|
|
827
849
|
}, {
|
|
828
850
|
type: "tool_reference";
|
|
829
851
|
toolName: string;
|
|
830
|
-
}[]>;
|
|
852
|
+
}[], {}>;
|
|
831
853
|
};
|
|
832
854
|
|
|
833
855
|
type AnthropicCacheControl = {
|
|
@@ -946,7 +968,7 @@ declare class CacheControlValidator {
|
|
|
946
968
|
getWarnings(): SharedV4Warning[];
|
|
947
969
|
}
|
|
948
970
|
|
|
949
|
-
declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cacheControlValidator, supportsStructuredOutput, supportsStrictTools, }: {
|
|
971
|
+
declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cacheControlValidator, supportsStructuredOutput, supportsStrictTools, defaultEagerInputStreaming, }: {
|
|
950
972
|
tools: LanguageModelV4CallOptions['tools'];
|
|
951
973
|
toolChoice: LanguageModelV4CallOptions['toolChoice'] | undefined;
|
|
952
974
|
disableParallelToolUse?: boolean;
|
|
@@ -959,6 +981,11 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
|
|
|
959
981
|
* Whether the model supports strict mode on tool definitions.
|
|
960
982
|
*/
|
|
961
983
|
supportsStrictTools: boolean;
|
|
984
|
+
/**
|
|
985
|
+
* Default for `eager_input_streaming` on function tools that do not set
|
|
986
|
+
* it explicitly. Driven by the model-level `toolStreaming` option.
|
|
987
|
+
*/
|
|
988
|
+
defaultEagerInputStreaming?: boolean;
|
|
962
989
|
}): Promise<{
|
|
963
990
|
tools: Array<AnthropicTool> | undefined;
|
|
964
991
|
toolChoice: AnthropicToolChoice | undefined;
|
|
@@ -966,4 +993,4 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
|
|
|
966
993
|
betas: Set<string>;
|
|
967
994
|
}>;
|
|
968
995
|
|
|
969
|
-
export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools };
|
|
996
|
+
export { AnthropicLanguageModel, AnthropicLanguageModel as AnthropicMessagesLanguageModel, type AnthropicModelId as AnthropicMessagesModelId, type AnthropicModelId, anthropicTools, getModelCapabilities, prepareTools };
|