@ai-sdk/anthropic 4.0.67 → 4.0.69
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 +18 -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/anthropic-provider.ts +1 -1
- package/src/convert-to-anthropic-prompt.ts +34 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Experimental_BatchV4, Experimental_EvaluationModelV4, FilesV4, JSONObject, LanguageModelV4, ProviderV4, SkillsV4 } from "@ai-sdk/provider";
|
|
2
|
+
import { Experimental_SandboxSession, FetchFunction, ProviderDefinedTool, Tool, ToolExecuteFunction } from "@ai-sdk/provider-utils";
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
|
+
//#region src/anthropic-api.d.ts
|
|
6
5
|
declare const anthropicSafeguardResultSchema: z.ZodObject<{
|
|
6
|
+
type: z.ZodString;
|
|
7
|
+
status: z.ZodObject<{
|
|
7
8
|
type: z.ZodString;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, z.core.$strip>>>>;
|
|
15
|
-
}, z.core.$strip>;
|
|
9
|
+
tool_uses: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
10
|
+
type: z.ZodString;
|
|
11
|
+
outcome: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
explanation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
}, z.core.$strip>>>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
16
15
|
}, z.core.$strip>;
|
|
17
16
|
type AnthropicSafeguardResult = z.infer<typeof anthropicSafeguardResultSchema>;
|
|
18
|
-
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/anthropic-message-metadata.d.ts
|
|
19
19
|
/**
|
|
20
20
|
* Represents a single iteration in the usage breakdown.
|
|
21
21
|
*
|
|
@@ -32,370 +32,373 @@ type AnthropicSafeguardResult = z.infer<typeof anthropicSafeguardResultSchema>;
|
|
|
32
32
|
* back.
|
|
33
33
|
*/
|
|
34
34
|
type AnthropicUsageIteration = {
|
|
35
|
-
|
|
35
|
+
type: 'compaction' | 'message' | 'advisor_message' | 'fallback_message';
|
|
36
|
+
/**
|
|
37
|
+
* The model that produced this iteration. Populated for the per-model
|
|
38
|
+
* attribution cases (the fallback chain and advisor sub-inferences) and
|
|
39
|
+
* absent otherwise.
|
|
40
|
+
*/
|
|
41
|
+
model?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Number of input tokens consumed in this iteration.
|
|
44
|
+
*/
|
|
45
|
+
inputTokens: number;
|
|
46
|
+
/**
|
|
47
|
+
* Number of output tokens generated in this iteration.
|
|
48
|
+
*/
|
|
49
|
+
outputTokens: number;
|
|
50
|
+
/**
|
|
51
|
+
* Number of cache-creation input tokens consumed in this iteration.
|
|
52
|
+
*/
|
|
53
|
+
cacheCreationInputTokens?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Number of cache-read input tokens consumed in this iteration.
|
|
56
|
+
*/
|
|
57
|
+
cacheReadInputTokens?: number;
|
|
58
|
+
};
|
|
59
|
+
interface AnthropicMessageMetadata {
|
|
60
|
+
usage: JSONObject;
|
|
61
|
+
stopSequence: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Input blocks that Anthropic transformed before inference. This is
|
|
64
|
+
* populated when thinking binding controls drop a mismatched thinking block.
|
|
65
|
+
* Values are intentionally open-ended so new transformation types and
|
|
66
|
+
* reasons remain forward compatible.
|
|
67
|
+
*/
|
|
68
|
+
inputTransformations?: Array<{
|
|
69
|
+
type: string;
|
|
70
|
+
path: string;
|
|
71
|
+
reason: string;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Verdicts of the server-side safeguards requested with
|
|
75
|
+
* `providerOptions.anthropic.safeguards`, one entry per requested safeguard.
|
|
76
|
+
* For `dangerous_tool_use`, `status.type` is `'available'` when the
|
|
77
|
+
* classifier ran and `status.tool_uses` maps each tool call id to its
|
|
78
|
+
* verdict (`type: 'evaluated'` with an `outcome` of `'not_flagged'` or
|
|
79
|
+
* `'flagged'` plus an `explanation`, `'skipped'`, or `'unavailable'`).
|
|
80
|
+
*
|
|
81
|
+
* Kept in the API's wire shape (snake_case), since consumers such as Claude
|
|
82
|
+
* Code read the verdicts verbatim.
|
|
83
|
+
*/
|
|
84
|
+
safeguardResults?: AnthropicSafeguardResult[];
|
|
85
|
+
/**
|
|
86
|
+
* Details about why the request stopped. Present only when the API returns
|
|
87
|
+
* a `refusal` stop reason together with a `stop_details` object (a
|
|
88
|
+
* classifier block or a model refusal).
|
|
89
|
+
*
|
|
90
|
+
* Branch on the finish reason (`content-filter`), not on this object: the
|
|
91
|
+
* API may return a refusal with no details at all, so this field can be
|
|
92
|
+
* absent even on a refusal and should not be relied upon being present.
|
|
93
|
+
*/
|
|
94
|
+
stopDetails?: {
|
|
36
95
|
/**
|
|
37
|
-
* The
|
|
38
|
-
*
|
|
39
|
-
* absent otherwise.
|
|
96
|
+
* The kind of stop detail. `'refusal'` for classifier blocks and model
|
|
97
|
+
* refusals.
|
|
40
98
|
*/
|
|
41
|
-
|
|
99
|
+
type: string;
|
|
42
100
|
/**
|
|
43
|
-
*
|
|
101
|
+
* The classifier category that triggered the block, e.g. `'cyber'` or
|
|
102
|
+
* `'bio'`. Absent for model refusals and other cases.
|
|
44
103
|
*/
|
|
45
|
-
|
|
104
|
+
category?: string;
|
|
46
105
|
/**
|
|
47
|
-
*
|
|
106
|
+
* Human-readable explanation of why the request was blocked. May be
|
|
107
|
+
* absent even on a refusal.
|
|
48
108
|
*/
|
|
49
|
-
|
|
109
|
+
explanation?: string;
|
|
50
110
|
/**
|
|
51
|
-
*
|
|
111
|
+
* The canonical id of a model to retry directly. Populated only when the
|
|
112
|
+
* request included fallbacks and the fallback attempt could not be made
|
|
113
|
+
* (e.g. the fallback model was rate limited or overloaded).
|
|
52
114
|
*/
|
|
53
|
-
|
|
115
|
+
recommendedModel?: string;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Usage breakdown by iteration when compaction is triggered.
|
|
119
|
+
*
|
|
120
|
+
* When compaction occurs, this array contains usage for each sampling iteration.
|
|
121
|
+
* The first iteration is typically the compaction step, followed by the main
|
|
122
|
+
* message iteration.
|
|
123
|
+
*/
|
|
124
|
+
iterations: AnthropicUsageIteration[] | null;
|
|
125
|
+
/**
|
|
126
|
+
* Information about the container used in this request.
|
|
127
|
+
*
|
|
128
|
+
* This will be non-null if a container tool (e.g., code execution) was used.
|
|
129
|
+
* Information about the container used in the request (for the code execution tool).
|
|
130
|
+
*/
|
|
131
|
+
container: {
|
|
54
132
|
/**
|
|
55
|
-
*
|
|
133
|
+
* The time at which the container will expire (RFC3339 timestamp).
|
|
56
134
|
*/
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
interface AnthropicMessageMetadata {
|
|
60
|
-
usage: JSONObject;
|
|
61
|
-
stopSequence: string | null;
|
|
135
|
+
expiresAt: string;
|
|
62
136
|
/**
|
|
63
|
-
*
|
|
64
|
-
* populated when thinking binding controls drop a mismatched thinking block.
|
|
65
|
-
* Values are intentionally open-ended so new transformation types and
|
|
66
|
-
* reasons remain forward compatible.
|
|
137
|
+
* Identifier for the container used in this request.
|
|
67
138
|
*/
|
|
68
|
-
|
|
69
|
-
type: string;
|
|
70
|
-
path: string;
|
|
71
|
-
reason: string;
|
|
72
|
-
}>;
|
|
139
|
+
id: string;
|
|
73
140
|
/**
|
|
74
|
-
*
|
|
75
|
-
* `providerOptions.anthropic.safeguards`, one entry per requested safeguard.
|
|
76
|
-
* For `dangerous_tool_use`, `status.type` is `'available'` when the
|
|
77
|
-
* classifier ran and `status.tool_uses` maps each tool call id to its
|
|
78
|
-
* verdict (`type: 'evaluated'` with an `outcome` of `'not_flagged'` or
|
|
79
|
-
* `'flagged'` plus an `explanation`, `'skipped'`, or `'unavailable'`).
|
|
80
|
-
*
|
|
81
|
-
* Kept in the API's wire shape (snake_case), since consumers such as Claude
|
|
82
|
-
* Code read the verdicts verbatim.
|
|
141
|
+
* Skills loaded in the container.
|
|
83
142
|
*/
|
|
84
|
-
|
|
143
|
+
skills: Array<{
|
|
144
|
+
/**
|
|
145
|
+
* Type of skill: either 'anthropic' (built-in) or 'custom' (user-defined).
|
|
146
|
+
*/
|
|
147
|
+
type: 'anthropic' | 'custom';
|
|
148
|
+
/**
|
|
149
|
+
* Skill ID (1-64 characters).
|
|
150
|
+
*/
|
|
151
|
+
skillId: string;
|
|
152
|
+
/**
|
|
153
|
+
* Skill version or 'latest' for most recent version (1-64 characters).
|
|
154
|
+
*/
|
|
155
|
+
version: string;
|
|
156
|
+
}> | null;
|
|
157
|
+
} | null;
|
|
158
|
+
/**
|
|
159
|
+
* Context management response.
|
|
160
|
+
*
|
|
161
|
+
* Information about context management strategies applied during the request.
|
|
162
|
+
*/
|
|
163
|
+
contextManagement: {
|
|
85
164
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* classifier block or a model refusal).
|
|
89
|
-
*
|
|
90
|
-
* Branch on the finish reason (`content-filter`), not on this object: the
|
|
91
|
-
* API may return a refusal with no details at all, so this field can be
|
|
92
|
-
* absent even on a refusal and should not be relied upon being present.
|
|
165
|
+
* List of context management edits that were applied.
|
|
166
|
+
* Each item in the array is a specific type of context management edit.
|
|
93
167
|
*/
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* The kind of stop detail. `'refusal'` for classifier blocks and model
|
|
97
|
-
* refusals.
|
|
98
|
-
*/
|
|
99
|
-
type: string;
|
|
100
|
-
/**
|
|
101
|
-
* The classifier category that triggered the block, e.g. `'cyber'` or
|
|
102
|
-
* `'bio'`. Absent for model refusals and other cases.
|
|
103
|
-
*/
|
|
104
|
-
category?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Human-readable explanation of why the request was blocked. May be
|
|
107
|
-
* absent even on a refusal.
|
|
108
|
-
*/
|
|
109
|
-
explanation?: string;
|
|
110
|
-
/**
|
|
111
|
-
* The canonical id of a model to retry directly. Populated only when the
|
|
112
|
-
* request included fallbacks and the fallback attempt could not be made
|
|
113
|
-
* (e.g. the fallback model was rate limited or overloaded).
|
|
114
|
-
*/
|
|
115
|
-
recommendedModel?: string;
|
|
116
|
-
};
|
|
168
|
+
appliedEdits: Array<
|
|
117
169
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* When compaction occurs, this array contains usage for each sampling iteration.
|
|
121
|
-
* The first iteration is typically the compaction step, followed by the main
|
|
122
|
-
* message iteration.
|
|
170
|
+
* Represents an edit where a certain number of tool uses and input tokens were cleared.
|
|
123
171
|
*/
|
|
124
|
-
|
|
172
|
+
{
|
|
173
|
+
/**
|
|
174
|
+
* The type of context management edit applied.
|
|
175
|
+
* Possible value: 'clear_tool_uses_20250919'
|
|
176
|
+
*/
|
|
177
|
+
type: 'clear_tool_uses_20250919';
|
|
178
|
+
/**
|
|
179
|
+
* Number of tool uses that were cleared by this edit.
|
|
180
|
+
* Minimum: 0
|
|
181
|
+
*/
|
|
182
|
+
clearedToolUses: number;
|
|
183
|
+
/**
|
|
184
|
+
* Number of input tokens cleared by this edit.
|
|
185
|
+
* Minimum: 0
|
|
186
|
+
*/
|
|
187
|
+
clearedInputTokens: number;
|
|
188
|
+
} |
|
|
125
189
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* This will be non-null if a container tool (e.g., code execution) was used.
|
|
129
|
-
* Information about the container used in the request (for the code execution tool).
|
|
190
|
+
* Represents an edit where a certain number of thinking turns and input tokens were cleared.
|
|
130
191
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Skill ID (1-64 characters).
|
|
150
|
-
*/
|
|
151
|
-
skillId: string;
|
|
152
|
-
/**
|
|
153
|
-
* Skill version or 'latest' for most recent version (1-64 characters).
|
|
154
|
-
*/
|
|
155
|
-
version: string;
|
|
156
|
-
}> | null;
|
|
157
|
-
} | null;
|
|
192
|
+
{
|
|
193
|
+
/**
|
|
194
|
+
* The type of context management edit applied.
|
|
195
|
+
* Possible value: 'clear_thinking_20251015'
|
|
196
|
+
*/
|
|
197
|
+
type: 'clear_thinking_20251015';
|
|
198
|
+
/**
|
|
199
|
+
* Number of thinking turns that were cleared by this edit.
|
|
200
|
+
* Minimum: 0
|
|
201
|
+
*/
|
|
202
|
+
clearedThinkingTurns: number;
|
|
203
|
+
/**
|
|
204
|
+
* Number of input tokens cleared by this edit.
|
|
205
|
+
* Minimum: 0
|
|
206
|
+
*/
|
|
207
|
+
clearedInputTokens: number;
|
|
208
|
+
} |
|
|
158
209
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* Information about context management strategies applied during the request.
|
|
210
|
+
* Represents a compaction edit where the conversation context was summarized.
|
|
162
211
|
*/
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
*/
|
|
172
|
-
{
|
|
173
|
-
/**
|
|
174
|
-
* The type of context management edit applied.
|
|
175
|
-
* Possible value: 'clear_tool_uses_20250919'
|
|
176
|
-
*/
|
|
177
|
-
type: 'clear_tool_uses_20250919';
|
|
178
|
-
/**
|
|
179
|
-
* Number of tool uses that were cleared by this edit.
|
|
180
|
-
* Minimum: 0
|
|
181
|
-
*/
|
|
182
|
-
clearedToolUses: number;
|
|
183
|
-
/**
|
|
184
|
-
* Number of input tokens cleared by this edit.
|
|
185
|
-
* Minimum: 0
|
|
186
|
-
*/
|
|
187
|
-
clearedInputTokens: number;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Represents an edit where a certain number of thinking turns and input tokens were cleared.
|
|
191
|
-
*/
|
|
192
|
-
| {
|
|
193
|
-
/**
|
|
194
|
-
* The type of context management edit applied.
|
|
195
|
-
* Possible value: 'clear_thinking_20251015'
|
|
196
|
-
*/
|
|
197
|
-
type: 'clear_thinking_20251015';
|
|
198
|
-
/**
|
|
199
|
-
* Number of thinking turns that were cleared by this edit.
|
|
200
|
-
* Minimum: 0
|
|
201
|
-
*/
|
|
202
|
-
clearedThinkingTurns: number;
|
|
203
|
-
/**
|
|
204
|
-
* Number of input tokens cleared by this edit.
|
|
205
|
-
* Minimum: 0
|
|
206
|
-
*/
|
|
207
|
-
clearedInputTokens: number;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Represents a compaction edit where the conversation context was summarized.
|
|
211
|
-
*/
|
|
212
|
-
| {
|
|
213
|
-
/**
|
|
214
|
-
* The type of context management edit applied.
|
|
215
|
-
* Possible value: 'compact_20260112'
|
|
216
|
-
*/
|
|
217
|
-
type: 'compact_20260112';
|
|
218
|
-
}>;
|
|
219
|
-
} | null;
|
|
212
|
+
{
|
|
213
|
+
/**
|
|
214
|
+
* The type of context management edit applied.
|
|
215
|
+
* Possible value: 'compact_20260112'
|
|
216
|
+
*/
|
|
217
|
+
type: 'compact_20260112';
|
|
218
|
+
}>;
|
|
219
|
+
} | null;
|
|
220
220
|
}
|
|
221
|
-
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/anthropic-language-model-options.d.ts
|
|
222
223
|
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 & {});
|
|
223
224
|
/**
|
|
224
225
|
* Anthropic provider options for system messages.
|
|
225
226
|
*/
|
|
226
227
|
declare const anthropicSystemMessageProviderOptions: z.ZodObject<{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
228
|
+
clearAt: z.ZodOptional<z.ZodLiteral<"next_user_message">>;
|
|
229
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
230
|
+
low: "low";
|
|
231
|
+
medium: "medium";
|
|
232
|
+
high: "high";
|
|
233
|
+
xhigh: "xhigh";
|
|
234
|
+
max: "max";
|
|
235
|
+
}>>;
|
|
236
|
+
toolChanges: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
237
|
+
type: z.ZodLiteral<"tool_addition">;
|
|
238
|
+
toolName: z.ZodString;
|
|
239
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
240
|
+
type: z.ZodLiteral<"tool_removal">;
|
|
241
|
+
toolName: z.ZodString;
|
|
242
|
+
}, z.core.$strip>]>>>;
|
|
242
243
|
}, z.core.$strip>;
|
|
243
244
|
type AnthropicSystemMessageProviderOptions = z.infer<typeof anthropicSystemMessageProviderOptions>;
|
|
244
245
|
declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
248
|
+
outputFormat: "outputFormat";
|
|
249
|
+
jsonTool: "jsonTool";
|
|
250
|
+
auto: "auto";
|
|
251
|
+
}>>;
|
|
252
|
+
thinking: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
253
|
+
type: z.ZodLiteral<"adaptive">;
|
|
254
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
255
|
+
omitted: "omitted";
|
|
256
|
+
summarized: "summarized";
|
|
257
|
+
updates: "updates";
|
|
250
258
|
}>>;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
updates: "updates";
|
|
257
|
-
}>>;
|
|
258
|
-
blockBinding: z.ZodOptional<z.ZodObject<{
|
|
259
|
-
prefixMismatchBehavior: z.ZodEnum<{
|
|
260
|
-
error: "error";
|
|
261
|
-
drop_block: "drop_block";
|
|
262
|
-
}>;
|
|
263
|
-
}, z.core.$strip>>;
|
|
264
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
265
|
-
type: z.ZodLiteral<"enabled">;
|
|
266
|
-
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
267
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
-
type: z.ZodLiteral<"disabled">;
|
|
269
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
270
|
-
type: z.ZodLiteral<"between_tools">;
|
|
271
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
272
|
-
type: z.ZodOptional<z.ZodNever>;
|
|
273
|
-
blockBinding: z.ZodObject<{
|
|
274
|
-
prefixMismatchBehavior: z.ZodEnum<{
|
|
275
|
-
error: "error";
|
|
276
|
-
drop_block: "drop_block";
|
|
277
|
-
}>;
|
|
278
|
-
}, z.core.$strip>;
|
|
279
|
-
}, z.core.$strip>]>>;
|
|
280
|
-
disableParallelToolUse: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
-
cacheControl: z.ZodOptional<z.ZodObject<{
|
|
282
|
-
type: z.ZodLiteral<"ephemeral">;
|
|
283
|
-
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"5m">, z.ZodLiteral<"1h">]>>;
|
|
284
|
-
}, z.core.$strip>>;
|
|
285
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
286
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
259
|
+
blockBinding: z.ZodOptional<z.ZodObject<{
|
|
260
|
+
prefixMismatchBehavior: z.ZodEnum<{
|
|
261
|
+
error: "error";
|
|
262
|
+
drop_block: "drop_block";
|
|
263
|
+
}>;
|
|
287
264
|
}, z.core.$strip>>;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
265
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
266
|
+
type: z.ZodLiteral<"enabled">;
|
|
267
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
268
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
269
|
+
type: z.ZodLiteral<"disabled">;
|
|
270
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
271
|
+
type: z.ZodLiteral<"between_tools">;
|
|
272
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
273
|
+
type: z.ZodOptional<z.ZodNever>;
|
|
274
|
+
blockBinding: z.ZodObject<{
|
|
275
|
+
prefixMismatchBehavior: z.ZodEnum<{
|
|
276
|
+
error: "error";
|
|
277
|
+
drop_block: "drop_block";
|
|
278
|
+
}>;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
}, z.core.$strip>]>>;
|
|
281
|
+
disableParallelToolUse: z.ZodOptional<z.ZodBoolean>;
|
|
282
|
+
cacheControl: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
type: z.ZodLiteral<"ephemeral">;
|
|
284
|
+
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"5m">, z.ZodLiteral<"1h">]>>;
|
|
285
|
+
}, z.core.$strip>>;
|
|
286
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
287
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
mcpServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
290
|
+
type: z.ZodLiteral<"url">;
|
|
291
|
+
name: z.ZodString;
|
|
292
|
+
url: z.ZodString;
|
|
293
|
+
authorizationToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
294
|
+
toolConfiguration: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
295
|
+
enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
296
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
297
297
|
}, z.core.$strip>>>;
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}, z.core.$strip
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
298
|
+
}, z.core.$strip>>>;
|
|
299
|
+
container: z.ZodOptional<z.ZodObject<{
|
|
300
|
+
id: z.ZodOptional<z.ZodString>;
|
|
301
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
302
|
+
type: z.ZodLiteral<"anthropic">;
|
|
303
|
+
skillId: z.ZodString;
|
|
304
|
+
version: z.ZodOptional<z.ZodString>;
|
|
305
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
306
|
+
type: z.ZodLiteral<"custom">;
|
|
307
|
+
providerReference: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
308
|
+
version: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>]>>>;
|
|
310
|
+
}, z.core.$strip>>;
|
|
311
|
+
toolStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
312
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
313
|
+
low: "low";
|
|
314
|
+
medium: "medium";
|
|
315
|
+
high: "high";
|
|
316
|
+
xhigh: "xhigh";
|
|
317
|
+
max: "max";
|
|
318
|
+
}>>;
|
|
319
|
+
taskBudget: z.ZodOptional<z.ZodObject<{
|
|
320
|
+
type: z.ZodLiteral<"tokens">;
|
|
321
|
+
total: z.ZodNumber;
|
|
322
|
+
remaining: z.ZodOptional<z.ZodNumber>;
|
|
323
|
+
}, z.core.$strip>>;
|
|
324
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
325
|
+
fast: "fast";
|
|
326
|
+
standard: "standard";
|
|
327
|
+
}>>;
|
|
328
|
+
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
329
|
+
auto: "auto";
|
|
330
|
+
standard_only: "standard_only";
|
|
331
|
+
}>>;
|
|
332
|
+
inferenceGeo: z.ZodOptional<z.ZodEnum<{
|
|
333
|
+
us: "us";
|
|
334
|
+
global: "global";
|
|
335
|
+
}>>;
|
|
336
|
+
fallbacks: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"default">, z.ZodArray<z.ZodObject<{
|
|
337
|
+
model: z.ZodString;
|
|
338
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
339
|
+
thinking: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
340
|
+
output_config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
323
341
|
speed: z.ZodOptional<z.ZodEnum<{
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}>>;
|
|
327
|
-
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
328
|
-
auto: "auto";
|
|
329
|
-
standard_only: "standard_only";
|
|
342
|
+
fast: "fast";
|
|
343
|
+
standard: "standard";
|
|
330
344
|
}>>;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
type: z.ZodLiteral<"thinking_turns">;
|
|
378
|
-
value: z.ZodNumber;
|
|
379
|
-
}, z.core.$strip>]>>;
|
|
380
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
381
|
-
type: z.ZodLiteral<"compact_20260112">;
|
|
382
|
-
trigger: z.ZodOptional<z.ZodObject<{
|
|
383
|
-
type: z.ZodLiteral<"input_tokens">;
|
|
384
|
-
value: z.ZodNumber;
|
|
385
|
-
}, z.core.$strip>>;
|
|
386
|
-
pauseAfterCompaction: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
-
instructions: z.ZodOptional<z.ZodString>;
|
|
388
|
-
}, z.core.$strip>]>>;
|
|
389
|
-
}, z.core.$strip>>;
|
|
345
|
+
}, z.core.$strip>>]>>;
|
|
346
|
+
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
347
|
+
safeguards: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
348
|
+
type: z.ZodLiteral<"dangerous_tool_use">;
|
|
349
|
+
classifierContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
350
|
+
}, z.core.$strip>>>;
|
|
351
|
+
compaction: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
type: z.ZodLiteral<"summarize">;
|
|
353
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
contextManagement: z.ZodOptional<z.ZodObject<{
|
|
356
|
+
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
357
|
+
type: z.ZodLiteral<"clear_tool_uses_20250919">;
|
|
358
|
+
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
359
|
+
type: z.ZodLiteral<"input_tokens">;
|
|
360
|
+
value: z.ZodNumber;
|
|
361
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
362
|
+
type: z.ZodLiteral<"tool_uses">;
|
|
363
|
+
value: z.ZodNumber;
|
|
364
|
+
}, z.core.$strip>]>>;
|
|
365
|
+
keep: z.ZodOptional<z.ZodObject<{
|
|
366
|
+
type: z.ZodLiteral<"tool_uses">;
|
|
367
|
+
value: z.ZodNumber;
|
|
368
|
+
}, z.core.$strip>>;
|
|
369
|
+
clearAtLeast: z.ZodOptional<z.ZodObject<{
|
|
370
|
+
type: z.ZodLiteral<"input_tokens">;
|
|
371
|
+
value: z.ZodNumber;
|
|
372
|
+
}, z.core.$strip>>;
|
|
373
|
+
clearToolInputs: z.ZodOptional<z.ZodBoolean>;
|
|
374
|
+
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
375
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
376
|
+
type: z.ZodLiteral<"clear_thinking_20251015">;
|
|
377
|
+
keep: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodObject<{
|
|
378
|
+
type: z.ZodLiteral<"thinking_turns">;
|
|
379
|
+
value: z.ZodNumber;
|
|
380
|
+
}, z.core.$strip>]>>;
|
|
381
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
382
|
+
type: z.ZodLiteral<"compact_20260112">;
|
|
383
|
+
trigger: z.ZodOptional<z.ZodObject<{
|
|
384
|
+
type: z.ZodLiteral<"input_tokens">;
|
|
385
|
+
value: z.ZodNumber;
|
|
386
|
+
}, z.core.$strip>>;
|
|
387
|
+
pauseAfterCompaction: z.ZodOptional<z.ZodBoolean>;
|
|
388
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
389
|
+
}, z.core.$strip>]>>;
|
|
390
|
+
}, z.core.$strip>>;
|
|
390
391
|
}, z.core.$strip>;
|
|
391
392
|
type AnthropicLanguageModelOptions = z.infer<typeof anthropicLanguageModelOptions>;
|
|
392
|
-
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/anthropic-prepare-tools.d.ts
|
|
393
395
|
interface AnthropicToolOptions {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
396
|
+
deferLoading?: boolean;
|
|
397
|
+
allowedCallers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
|
|
398
|
+
eagerInputStreaming?: boolean;
|
|
397
399
|
}
|
|
398
|
-
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/tool/computer-toolset_20260801.d.ts
|
|
399
402
|
/**
|
|
400
403
|
* Member tools of the computer toolset. Each member is returned by the API as
|
|
401
404
|
* its own `tool_use` block; the AI SDK exposes it as the `action` of a single
|
|
@@ -403,1118 +406,1123 @@ interface AnthropicToolOptions {
|
|
|
403
406
|
*/
|
|
404
407
|
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"];
|
|
405
408
|
type ComputerToolset_20260801Member = (typeof computerToolset_20260801Members)[number];
|
|
406
|
-
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/tool/bash_20241022.d.ts
|
|
407
411
|
type Bash20241022Input = {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
412
|
+
/**
|
|
413
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
414
|
+
*/
|
|
415
|
+
command: string;
|
|
416
|
+
/**
|
|
417
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
418
|
+
*/
|
|
419
|
+
restart?: boolean;
|
|
416
420
|
};
|
|
417
421
|
type Bash20241022Options<OUTPUT> = {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
execute?: ToolExecuteFunction<Bash20241022Input, OUTPUT, {}>;
|
|
423
|
+
needsApproval?: Tool<Bash20241022Input, OUTPUT, {}>['needsApproval'];
|
|
424
|
+
toModelOutput?: Tool<Bash20241022Input, OUTPUT, {}>['toModelOutput'];
|
|
425
|
+
onInputStart?: Tool<Bash20241022Input, OUTPUT, {}>['onInputStart'];
|
|
426
|
+
onInputDelta?: Tool<Bash20241022Input, OUTPUT, {}>['onInputDelta'];
|
|
427
|
+
onInputAvailable?: Tool<Bash20241022Input, OUTPUT, {}>['onInputAvailable'];
|
|
424
428
|
};
|
|
425
429
|
type Bash20241022DefaultOutput = Awaited<ReturnType<Experimental_SandboxSession['run']>>;
|
|
426
430
|
declare function bash_20241022(options?: Omit<Bash20241022Options<Bash20241022DefaultOutput>, 'execute'> & {
|
|
427
|
-
|
|
431
|
+
execute?: undefined;
|
|
428
432
|
}): ProviderDefinedTool<Bash20241022Input, Bash20241022DefaultOutput, {}>;
|
|
429
433
|
declare function bash_20241022<OUTPUT = never>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
430
|
-
|
|
434
|
+
execute: null;
|
|
431
435
|
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
432
436
|
declare function bash_20241022<OUTPUT>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
433
|
-
|
|
437
|
+
execute: Bash20241022Options<OUTPUT>['execute'];
|
|
434
438
|
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
435
|
-
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/tool/bash_20250124.d.ts
|
|
436
441
|
type Bash20250124Input = {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
442
|
+
/**
|
|
443
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
444
|
+
*/
|
|
445
|
+
command: string;
|
|
446
|
+
/**
|
|
447
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
448
|
+
*/
|
|
449
|
+
restart?: boolean;
|
|
445
450
|
};
|
|
446
451
|
type Bash20250124Options<OUTPUT> = {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
452
|
+
execute?: ToolExecuteFunction<Bash20250124Input, OUTPUT, {}>;
|
|
453
|
+
needsApproval?: Tool<Bash20250124Input, OUTPUT, {}>['needsApproval'];
|
|
454
|
+
toModelOutput?: Tool<Bash20250124Input, OUTPUT, {}>['toModelOutput'];
|
|
455
|
+
onInputStart?: Tool<Bash20250124Input, OUTPUT, {}>['onInputStart'];
|
|
456
|
+
onInputDelta?: Tool<Bash20250124Input, OUTPUT, {}>['onInputDelta'];
|
|
457
|
+
onInputAvailable?: Tool<Bash20250124Input, OUTPUT, {}>['onInputAvailable'];
|
|
453
458
|
};
|
|
454
459
|
type Bash20250124DefaultOutput = Awaited<ReturnType<Experimental_SandboxSession['run']>>;
|
|
455
460
|
declare function bash_20250124(options?: Omit<Bash20250124Options<Bash20250124DefaultOutput>, 'execute'> & {
|
|
456
|
-
|
|
461
|
+
execute?: undefined;
|
|
457
462
|
}): ProviderDefinedTool<Bash20250124Input, Bash20250124DefaultOutput, {}>;
|
|
458
463
|
declare function bash_20250124<OUTPUT = never>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
459
|
-
|
|
464
|
+
execute: null;
|
|
460
465
|
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
461
466
|
declare function bash_20250124<OUTPUT>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
462
|
-
|
|
467
|
+
execute: Bash20250124Options<OUTPUT>['execute'];
|
|
463
468
|
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
464
|
-
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/anthropic-tools.d.ts
|
|
465
471
|
declare const anthropicTools: {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
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
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
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
|
-
|
|
472
|
+
/**
|
|
473
|
+
* Pairs a faster executor model with a higher-intelligence advisor model
|
|
474
|
+
* that provides strategic guidance mid-generation.
|
|
475
|
+
*
|
|
476
|
+
* The advisor lets a faster, lower-cost executor model consult a
|
|
477
|
+
* higher-intelligence advisor model server-side. The advisor reads the
|
|
478
|
+
* executor's full transcript and produces a plan or course correction;
|
|
479
|
+
* the executor continues with the task, informed by the advice. All of
|
|
480
|
+
* this happens inside a single `/v1/messages` request.
|
|
481
|
+
*
|
|
482
|
+
* Beta header `advisor-tool-2026-03-01` is added automatically when this
|
|
483
|
+
* tool is included.
|
|
484
|
+
*
|
|
485
|
+
* Multi-turn conversations: pass the full assistant content (including
|
|
486
|
+
* `advisor_tool_result` blocks) back to the API on subsequent turns. If
|
|
487
|
+
* you omit the advisor tool from `tools` on a follow-up turn while the
|
|
488
|
+
* message history still contains `advisor_tool_result` blocks, the API
|
|
489
|
+
* returns a `400 invalid_request_error`.
|
|
490
|
+
*
|
|
491
|
+
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
492
|
+
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
493
|
+
*
|
|
494
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
495
|
+
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
496
|
+
* @param maxTokens - Maximum advisor output tokens per call, including
|
|
497
|
+
* thinking and text. Minimum 1024; Anthropic recommends starting with 2048.
|
|
498
|
+
* @param caching - Enables prompt caching for the advisor's transcript
|
|
499
|
+
* across calls within a conversation. Worthwhile from ~3 advisor calls
|
|
500
|
+
* per conversation.
|
|
501
|
+
*/
|
|
502
|
+
advisor_20260301: (args: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {
|
|
503
|
+
type: "advisor_result";
|
|
504
|
+
text: string;
|
|
505
|
+
stopReason?: string;
|
|
506
|
+
} | {
|
|
507
|
+
type: "advisor_redacted_result";
|
|
508
|
+
encryptedContent: string;
|
|
509
|
+
stopReason?: string;
|
|
510
|
+
} | {
|
|
511
|
+
type: "advisor_tool_result_error";
|
|
512
|
+
errorCode: string;
|
|
513
|
+
}, {
|
|
514
|
+
model: string;
|
|
515
|
+
maxUses?: number;
|
|
516
|
+
maxTokens?: number;
|
|
517
|
+
caching?: {
|
|
518
|
+
type: "ephemeral";
|
|
519
|
+
ttl: "5m" | "1h";
|
|
520
|
+
};
|
|
521
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{}, {
|
|
522
|
+
type: "advisor_result";
|
|
523
|
+
text: string;
|
|
524
|
+
stopReason?: string;
|
|
525
|
+
} | {
|
|
526
|
+
type: "advisor_redacted_result";
|
|
527
|
+
encryptedContent: string;
|
|
528
|
+
stopReason?: string;
|
|
529
|
+
} | {
|
|
530
|
+
type: "advisor_tool_result_error";
|
|
531
|
+
errorCode: string;
|
|
532
|
+
}, {}>;
|
|
533
|
+
/**
|
|
534
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
535
|
+
* allowing system operations, script execution, and command-line automation.
|
|
536
|
+
*
|
|
537
|
+
* Image results are supported.
|
|
538
|
+
*/
|
|
539
|
+
bash_20241022: typeof bash_20241022;
|
|
540
|
+
/**
|
|
541
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
542
|
+
* allowing system operations, script execution, and command-line automation.
|
|
543
|
+
*
|
|
544
|
+
* Image results are supported.
|
|
545
|
+
*/
|
|
546
|
+
bash_20250124: typeof bash_20250124;
|
|
547
|
+
/**
|
|
548
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
549
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
550
|
+
* the API conversation.
|
|
551
|
+
*
|
|
552
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
553
|
+
* including writing code, in a secure, sandboxed environment.
|
|
554
|
+
*/
|
|
555
|
+
codeExecution_20250522: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
556
|
+
code: string;
|
|
557
|
+
}, {
|
|
558
|
+
type: "code_execution_result";
|
|
559
|
+
stdout: string;
|
|
560
|
+
stderr: string;
|
|
561
|
+
return_code: number;
|
|
562
|
+
content: Array<{
|
|
563
|
+
type: "code_execution_output";
|
|
564
|
+
file_id: string;
|
|
565
|
+
}>;
|
|
566
|
+
}, {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
567
|
+
code: string;
|
|
568
|
+
}, {
|
|
569
|
+
type: "code_execution_result";
|
|
570
|
+
stdout: string;
|
|
571
|
+
stderr: string;
|
|
572
|
+
return_code: number;
|
|
573
|
+
content: Array<{
|
|
574
|
+
type: "code_execution_output";
|
|
575
|
+
file_id: string;
|
|
576
|
+
}>;
|
|
577
|
+
}, {}>;
|
|
578
|
+
/**
|
|
579
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
580
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
581
|
+
* the API conversation.
|
|
582
|
+
*
|
|
583
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
584
|
+
* including writing code, in a secure, sandboxed environment.
|
|
585
|
+
*
|
|
586
|
+
* This is the latest version with enhanced Bash support and file operations.
|
|
587
|
+
*/
|
|
588
|
+
codeExecution_20250825: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
589
|
+
type: "programmatic-tool-call";
|
|
590
|
+
code: string;
|
|
591
|
+
} | {
|
|
592
|
+
type: "bash_code_execution";
|
|
593
|
+
command: string;
|
|
594
|
+
} | {
|
|
595
|
+
type: "text_editor_code_execution";
|
|
596
|
+
command: "view";
|
|
597
|
+
path: string;
|
|
598
|
+
} | {
|
|
599
|
+
type: "text_editor_code_execution";
|
|
600
|
+
command: "create";
|
|
601
|
+
path: string;
|
|
602
|
+
file_text?: string | null;
|
|
603
|
+
} | {
|
|
604
|
+
type: "text_editor_code_execution";
|
|
605
|
+
command: "str_replace";
|
|
606
|
+
path: string;
|
|
607
|
+
old_str: string;
|
|
608
|
+
new_str: string;
|
|
609
|
+
}, {
|
|
610
|
+
type: "code_execution_result";
|
|
611
|
+
stdout: string;
|
|
612
|
+
stderr: string;
|
|
613
|
+
return_code: number;
|
|
614
|
+
content: Array<{
|
|
615
|
+
type: "code_execution_output";
|
|
616
|
+
file_id: string;
|
|
617
|
+
}>;
|
|
618
|
+
} | {
|
|
619
|
+
type: "bash_code_execution_result";
|
|
620
|
+
content: Array<{
|
|
621
|
+
type: "bash_code_execution_output";
|
|
622
|
+
file_id: string;
|
|
623
|
+
}>;
|
|
624
|
+
stdout: string;
|
|
625
|
+
stderr: string;
|
|
626
|
+
return_code: number;
|
|
627
|
+
} | {
|
|
628
|
+
type: "bash_code_execution_tool_result_error";
|
|
629
|
+
error_code: string;
|
|
630
|
+
} | {
|
|
631
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
632
|
+
error_code: string;
|
|
633
|
+
} | {
|
|
634
|
+
type: "text_editor_code_execution_view_result";
|
|
635
|
+
content: string;
|
|
636
|
+
file_type: string;
|
|
637
|
+
num_lines: number | null;
|
|
638
|
+
start_line: number | null;
|
|
639
|
+
total_lines: number | null;
|
|
640
|
+
} | {
|
|
641
|
+
type: "text_editor_code_execution_create_result";
|
|
642
|
+
is_file_update: boolean;
|
|
643
|
+
} | {
|
|
644
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
645
|
+
lines: string[] | null;
|
|
646
|
+
new_lines: number | null;
|
|
647
|
+
new_start: number | null;
|
|
648
|
+
old_lines: number | null;
|
|
649
|
+
old_start: number | null;
|
|
650
|
+
}, {}, {}>>[0]) => import("@ai-sdk/provider-utils").Experimental_ToolCallerTool<import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
651
|
+
type: "programmatic-tool-call";
|
|
652
|
+
code: string;
|
|
653
|
+
} | {
|
|
654
|
+
type: "bash_code_execution";
|
|
655
|
+
command: string;
|
|
656
|
+
} | {
|
|
657
|
+
type: "text_editor_code_execution";
|
|
658
|
+
command: "view";
|
|
659
|
+
path: string;
|
|
660
|
+
} | {
|
|
661
|
+
type: "text_editor_code_execution";
|
|
662
|
+
command: "create";
|
|
663
|
+
path: string;
|
|
664
|
+
file_text?: string | null;
|
|
665
|
+
} | {
|
|
666
|
+
type: "text_editor_code_execution";
|
|
667
|
+
command: "str_replace";
|
|
668
|
+
path: string;
|
|
669
|
+
old_str: string;
|
|
670
|
+
new_str: string;
|
|
671
|
+
}, {
|
|
672
|
+
type: "code_execution_result";
|
|
673
|
+
stdout: string;
|
|
674
|
+
stderr: string;
|
|
675
|
+
return_code: number;
|
|
676
|
+
content: Array<{
|
|
677
|
+
type: "code_execution_output";
|
|
678
|
+
file_id: string;
|
|
679
|
+
}>;
|
|
680
|
+
} | {
|
|
681
|
+
type: "bash_code_execution_result";
|
|
682
|
+
content: Array<{
|
|
683
|
+
type: "bash_code_execution_output";
|
|
684
|
+
file_id: string;
|
|
685
|
+
}>;
|
|
686
|
+
stdout: string;
|
|
687
|
+
stderr: string;
|
|
688
|
+
return_code: number;
|
|
689
|
+
} | {
|
|
690
|
+
type: "bash_code_execution_tool_result_error";
|
|
691
|
+
error_code: string;
|
|
692
|
+
} | {
|
|
693
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
694
|
+
error_code: string;
|
|
695
|
+
} | {
|
|
696
|
+
type: "text_editor_code_execution_view_result";
|
|
697
|
+
content: string;
|
|
698
|
+
file_type: string;
|
|
699
|
+
num_lines: number | null;
|
|
700
|
+
start_line: number | null;
|
|
701
|
+
total_lines: number | null;
|
|
702
|
+
} | {
|
|
703
|
+
type: "text_editor_code_execution_create_result";
|
|
704
|
+
is_file_update: boolean;
|
|
705
|
+
} | {
|
|
706
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
707
|
+
lines: string[] | null;
|
|
708
|
+
new_lines: number | null;
|
|
709
|
+
new_start: number | null;
|
|
710
|
+
old_lines: number | null;
|
|
711
|
+
old_start: number | null;
|
|
712
|
+
}, {}>>;
|
|
713
|
+
/**
|
|
714
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
715
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
716
|
+
* the API conversation.
|
|
717
|
+
*
|
|
718
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
719
|
+
* including writing code, in a secure, sandboxed environment.
|
|
720
|
+
*
|
|
721
|
+
* This is the recommended version. Does not require a beta header.
|
|
722
|
+
*
|
|
723
|
+
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
724
|
+
*/
|
|
725
|
+
codeExecution_20260120: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
726
|
+
type: "programmatic-tool-call";
|
|
727
|
+
code: string;
|
|
728
|
+
} | {
|
|
729
|
+
type: "bash_code_execution";
|
|
730
|
+
command: string;
|
|
731
|
+
} | {
|
|
732
|
+
type: "text_editor_code_execution";
|
|
733
|
+
command: "view";
|
|
734
|
+
path: string;
|
|
735
|
+
} | {
|
|
736
|
+
type: "text_editor_code_execution";
|
|
737
|
+
command: "create";
|
|
738
|
+
path: string;
|
|
739
|
+
file_text?: string | null;
|
|
740
|
+
} | {
|
|
741
|
+
type: "text_editor_code_execution";
|
|
742
|
+
command: "str_replace";
|
|
743
|
+
path: string;
|
|
744
|
+
old_str: string;
|
|
745
|
+
new_str: string;
|
|
746
|
+
}, {
|
|
747
|
+
type: "code_execution_result";
|
|
748
|
+
stdout: string;
|
|
749
|
+
stderr: string;
|
|
750
|
+
return_code: number;
|
|
751
|
+
content: Array<{
|
|
752
|
+
type: "code_execution_output";
|
|
753
|
+
file_id: string;
|
|
754
|
+
}>;
|
|
755
|
+
} | {
|
|
756
|
+
type: "encrypted_code_execution_result";
|
|
757
|
+
encrypted_stdout: string;
|
|
758
|
+
stderr: string;
|
|
759
|
+
return_code: number;
|
|
760
|
+
content: Array<{
|
|
761
|
+
type: "code_execution_output";
|
|
762
|
+
file_id: string;
|
|
763
|
+
}>;
|
|
764
|
+
} | {
|
|
765
|
+
type: "bash_code_execution_result";
|
|
766
|
+
content: Array<{
|
|
767
|
+
type: "bash_code_execution_output";
|
|
768
|
+
file_id: string;
|
|
769
|
+
}>;
|
|
770
|
+
stdout: string;
|
|
771
|
+
stderr: string;
|
|
772
|
+
return_code: number;
|
|
773
|
+
} | {
|
|
774
|
+
type: "bash_code_execution_tool_result_error";
|
|
775
|
+
error_code: string;
|
|
776
|
+
} | {
|
|
777
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
778
|
+
error_code: string;
|
|
779
|
+
} | {
|
|
780
|
+
type: "text_editor_code_execution_view_result";
|
|
781
|
+
content: string;
|
|
782
|
+
file_type: string;
|
|
783
|
+
num_lines: number | null;
|
|
784
|
+
start_line: number | null;
|
|
785
|
+
total_lines: number | null;
|
|
786
|
+
} | {
|
|
787
|
+
type: "text_editor_code_execution_create_result";
|
|
788
|
+
is_file_update: boolean;
|
|
789
|
+
} | {
|
|
790
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
791
|
+
lines: string[] | null;
|
|
792
|
+
new_lines: number | null;
|
|
793
|
+
new_start: number | null;
|
|
794
|
+
old_lines: number | null;
|
|
795
|
+
old_start: number | null;
|
|
796
|
+
}, {}, {}>>[0]) => import("@ai-sdk/provider-utils").Experimental_ToolCallerTool<import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
797
|
+
type: "programmatic-tool-call";
|
|
798
|
+
code: string;
|
|
799
|
+
} | {
|
|
800
|
+
type: "bash_code_execution";
|
|
801
|
+
command: string;
|
|
802
|
+
} | {
|
|
803
|
+
type: "text_editor_code_execution";
|
|
804
|
+
command: "view";
|
|
805
|
+
path: string;
|
|
806
|
+
} | {
|
|
807
|
+
type: "text_editor_code_execution";
|
|
808
|
+
command: "create";
|
|
809
|
+
path: string;
|
|
810
|
+
file_text?: string | null;
|
|
811
|
+
} | {
|
|
812
|
+
type: "text_editor_code_execution";
|
|
813
|
+
command: "str_replace";
|
|
814
|
+
path: string;
|
|
815
|
+
old_str: string;
|
|
816
|
+
new_str: string;
|
|
817
|
+
}, {
|
|
818
|
+
type: "code_execution_result";
|
|
819
|
+
stdout: string;
|
|
820
|
+
stderr: string;
|
|
821
|
+
return_code: number;
|
|
822
|
+
content: Array<{
|
|
823
|
+
type: "code_execution_output";
|
|
824
|
+
file_id: string;
|
|
825
|
+
}>;
|
|
826
|
+
} | {
|
|
827
|
+
type: "encrypted_code_execution_result";
|
|
828
|
+
encrypted_stdout: string;
|
|
829
|
+
stderr: string;
|
|
830
|
+
return_code: number;
|
|
831
|
+
content: Array<{
|
|
832
|
+
type: "code_execution_output";
|
|
833
|
+
file_id: string;
|
|
834
|
+
}>;
|
|
835
|
+
} | {
|
|
836
|
+
type: "bash_code_execution_result";
|
|
837
|
+
content: Array<{
|
|
838
|
+
type: "bash_code_execution_output";
|
|
839
|
+
file_id: string;
|
|
840
|
+
}>;
|
|
841
|
+
stdout: string;
|
|
842
|
+
stderr: string;
|
|
843
|
+
return_code: number;
|
|
844
|
+
} | {
|
|
845
|
+
type: "bash_code_execution_tool_result_error";
|
|
846
|
+
error_code: string;
|
|
847
|
+
} | {
|
|
848
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
849
|
+
error_code: string;
|
|
850
|
+
} | {
|
|
851
|
+
type: "text_editor_code_execution_view_result";
|
|
852
|
+
content: string;
|
|
853
|
+
file_type: string;
|
|
854
|
+
num_lines: number | null;
|
|
855
|
+
start_line: number | null;
|
|
856
|
+
total_lines: number | null;
|
|
857
|
+
} | {
|
|
858
|
+
type: "text_editor_code_execution_create_result";
|
|
859
|
+
is_file_update: boolean;
|
|
860
|
+
} | {
|
|
861
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
862
|
+
lines: string[] | null;
|
|
863
|
+
new_lines: number | null;
|
|
864
|
+
new_start: number | null;
|
|
865
|
+
old_lines: number | null;
|
|
866
|
+
old_start: number | null;
|
|
867
|
+
}, {}>>;
|
|
868
|
+
/**
|
|
869
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
870
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
871
|
+
*
|
|
872
|
+
* Image results are supported.
|
|
873
|
+
*
|
|
874
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
875
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
876
|
+
* @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.
|
|
877
|
+
*/
|
|
878
|
+
computer_20241022: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
879
|
+
action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
|
|
880
|
+
coordinate?: number[];
|
|
881
|
+
text?: string;
|
|
882
|
+
}, {
|
|
883
|
+
displayWidthPx: number;
|
|
884
|
+
displayHeightPx: number;
|
|
885
|
+
displayNumber?: number;
|
|
886
|
+
}, {}>;
|
|
887
|
+
/**
|
|
888
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
889
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
890
|
+
*
|
|
891
|
+
* Image results are supported.
|
|
892
|
+
*
|
|
893
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
894
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
895
|
+
* @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.
|
|
896
|
+
*/
|
|
897
|
+
computer_20250124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
898
|
+
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";
|
|
899
|
+
coordinate?: [number, number];
|
|
900
|
+
duration?: number;
|
|
901
|
+
scroll_amount?: number;
|
|
902
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
903
|
+
start_coordinate?: [number, number];
|
|
904
|
+
text?: string;
|
|
905
|
+
}, {
|
|
906
|
+
displayWidthPx: number;
|
|
907
|
+
displayHeightPx: number;
|
|
908
|
+
displayNumber?: number;
|
|
909
|
+
}, {}>;
|
|
910
|
+
/**
|
|
911
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
912
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
913
|
+
*
|
|
914
|
+
* This version adds the zoom action for detailed screen region inspection.
|
|
915
|
+
*
|
|
916
|
+
* Image results are supported.
|
|
917
|
+
*
|
|
918
|
+
* Supported models: Claude Opus 4.5
|
|
919
|
+
*
|
|
920
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
921
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
922
|
+
* @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.
|
|
923
|
+
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
924
|
+
*/
|
|
925
|
+
computer_20251124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
926
|
+
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";
|
|
927
|
+
coordinate?: [number, number];
|
|
928
|
+
duration?: number;
|
|
929
|
+
region?: [number, number, number, number];
|
|
930
|
+
scroll_amount?: number;
|
|
931
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
932
|
+
start_coordinate?: [number, number];
|
|
933
|
+
text?: string;
|
|
934
|
+
}, {
|
|
935
|
+
displayWidthPx: number;
|
|
936
|
+
displayHeightPx: number;
|
|
937
|
+
displayNumber?: number;
|
|
938
|
+
enableZoom?: boolean;
|
|
939
|
+
}, {}>;
|
|
940
|
+
/**
|
|
941
|
+
* The computer toolset lets Claude control a computer through screenshots,
|
|
942
|
+
* mouse, and keyboard. It replaces the versioned computer tools
|
|
943
|
+
* (`computer_20251124` and earlier) on newer models.
|
|
944
|
+
*
|
|
945
|
+
* The API returns each computer action as its own `tool_use` block with
|
|
946
|
+
* `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
|
|
947
|
+
* and exposes the member name as `action`, so `execute` receives the same
|
|
948
|
+
* input shape as the older computer tools. Claude may return several actions
|
|
949
|
+
* in one turn.
|
|
950
|
+
*
|
|
951
|
+
* Coordinates are always in the pixel space of the screenshots you return;
|
|
952
|
+
* there are no display size parameters. Zoom is enabled by default.
|
|
953
|
+
*
|
|
954
|
+
* Does not require a beta header.
|
|
955
|
+
*
|
|
956
|
+
* Supported models: Claude Opus 5.5 (required; older computer tool types
|
|
957
|
+
* are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
|
|
958
|
+
*
|
|
959
|
+
* @param configs - Per-member settings keyed by member name, e.g.
|
|
960
|
+
* `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
|
|
961
|
+
*/
|
|
962
|
+
computerToolset_20260801: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
963
|
+
action: ComputerToolset_20260801Member;
|
|
964
|
+
coordinate?: [number, number];
|
|
965
|
+
duration?: number;
|
|
966
|
+
region?: [number, number, number, number];
|
|
967
|
+
repeat?: number;
|
|
968
|
+
scroll_amount?: number;
|
|
969
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
970
|
+
start_coordinate?: [number, number];
|
|
971
|
+
text?: string;
|
|
972
|
+
}, {
|
|
973
|
+
configs?: Partial<Record<ComputerToolset_20260801Member, {
|
|
974
|
+
enabled?: boolean;
|
|
975
|
+
deferLoading?: boolean;
|
|
976
|
+
}>>;
|
|
977
|
+
}, {}>;
|
|
978
|
+
/**
|
|
979
|
+
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
980
|
+
* Claude can create, read, update, and delete files that persist between sessions,
|
|
981
|
+
* allowing it to build knowledge over time without keeping everything in the context window.
|
|
982
|
+
* The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
|
|
983
|
+
*
|
|
984
|
+
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
985
|
+
*/
|
|
986
|
+
memory_20250818: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
987
|
+
command: "view";
|
|
988
|
+
path: string;
|
|
989
|
+
view_range?: [number, number];
|
|
990
|
+
} | {
|
|
991
|
+
command: "create";
|
|
992
|
+
path: string;
|
|
993
|
+
file_text: string;
|
|
994
|
+
} | {
|
|
995
|
+
command: "str_replace";
|
|
996
|
+
path: string;
|
|
997
|
+
old_str: string;
|
|
998
|
+
new_str: string;
|
|
999
|
+
} | {
|
|
1000
|
+
command: "insert";
|
|
1001
|
+
path: string;
|
|
1002
|
+
insert_line: number;
|
|
1003
|
+
insert_text: string;
|
|
1004
|
+
} | {
|
|
1005
|
+
command: "delete";
|
|
1006
|
+
path: string;
|
|
1007
|
+
} | {
|
|
1008
|
+
command: "rename";
|
|
1009
|
+
old_path: string;
|
|
1010
|
+
new_path: string;
|
|
1011
|
+
}, {}, {}>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1014
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1015
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1016
|
+
*
|
|
1017
|
+
* Supported models: Claude Sonnet 3.5
|
|
1018
|
+
*/
|
|
1019
|
+
textEditor_20241022: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1020
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
1021
|
+
path: string;
|
|
1022
|
+
file_text?: string;
|
|
1023
|
+
insert_line?: number;
|
|
1024
|
+
new_str?: string;
|
|
1025
|
+
insert_text?: string;
|
|
1026
|
+
old_str?: string;
|
|
1027
|
+
view_range?: number[];
|
|
1028
|
+
}, {}, {}>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1031
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1032
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1033
|
+
*
|
|
1034
|
+
* Supported models: Claude Sonnet 3.7
|
|
1035
|
+
*/
|
|
1036
|
+
textEditor_20250124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1037
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
1038
|
+
path: string;
|
|
1039
|
+
file_text?: string;
|
|
1040
|
+
insert_line?: number;
|
|
1041
|
+
new_str?: string;
|
|
1042
|
+
insert_text?: string;
|
|
1043
|
+
old_str?: string;
|
|
1044
|
+
view_range?: number[];
|
|
1045
|
+
}, {}, {}>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1048
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1049
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1050
|
+
*
|
|
1051
|
+
* Note: This version does not support the "undo_edit" command.
|
|
1052
|
+
*
|
|
1053
|
+
* @deprecated Use textEditor_20250728 instead
|
|
1054
|
+
*/
|
|
1055
|
+
textEditor_20250429: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1056
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
1057
|
+
path: string;
|
|
1058
|
+
file_text?: string;
|
|
1059
|
+
insert_line?: number;
|
|
1060
|
+
new_str?: string;
|
|
1061
|
+
insert_text?: string;
|
|
1062
|
+
old_str?: string;
|
|
1063
|
+
view_range?: number[];
|
|
1064
|
+
}, {}, {}>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
1067
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
1068
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
1069
|
+
*
|
|
1070
|
+
* Note: This version does not support the "undo_edit" command and adds optional max_characters parameter.
|
|
1071
|
+
*
|
|
1072
|
+
* Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1
|
|
1073
|
+
*
|
|
1074
|
+
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
1075
|
+
*/
|
|
1076
|
+
textEditor_20250728: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
|
|
1077
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
1078
|
+
path: string;
|
|
1079
|
+
file_text?: string;
|
|
1080
|
+
insert_line?: number;
|
|
1081
|
+
new_str?: string;
|
|
1082
|
+
insert_text?: string;
|
|
1083
|
+
old_str?: string;
|
|
1084
|
+
view_range?: number[];
|
|
1085
|
+
}, {
|
|
1086
|
+
maxCharacters?: number;
|
|
1087
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderDefinedTool<{
|
|
1088
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
1089
|
+
path: string;
|
|
1090
|
+
file_text?: string;
|
|
1091
|
+
insert_line?: number;
|
|
1092
|
+
new_str?: string;
|
|
1093
|
+
insert_text?: string;
|
|
1094
|
+
old_str?: string;
|
|
1095
|
+
view_range?: number[];
|
|
1096
|
+
}, unknown, {}>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
1099
|
+
*
|
|
1100
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
1101
|
+
* @param allowedDomains - Only fetch from these domains
|
|
1102
|
+
* @param blockedDomains - Never fetch from these domains
|
|
1103
|
+
* @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.
|
|
1104
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
1105
|
+
*/
|
|
1106
|
+
webFetch_20250910: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1107
|
+
url: string;
|
|
1108
|
+
}, {
|
|
1109
|
+
type: "web_fetch_result";
|
|
1110
|
+
url: string;
|
|
1111
|
+
content: {
|
|
1112
|
+
type: "document";
|
|
1113
|
+
title: string | null;
|
|
1114
|
+
citations?: {
|
|
1115
|
+
enabled: boolean;
|
|
1116
|
+
};
|
|
1117
|
+
source: {
|
|
1118
|
+
type: "base64";
|
|
1119
|
+
mediaType: "application/pdf";
|
|
1120
|
+
data: string;
|
|
1121
|
+
} | {
|
|
1122
|
+
type: "text";
|
|
1123
|
+
mediaType: "text/plain";
|
|
1124
|
+
data: string;
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
retrievedAt: string | null;
|
|
1128
|
+
}, {
|
|
1129
|
+
maxUses?: number;
|
|
1130
|
+
allowedDomains?: string[];
|
|
1131
|
+
blockedDomains?: string[];
|
|
1132
|
+
citations?: {
|
|
1133
|
+
enabled: boolean;
|
|
1134
|
+
};
|
|
1135
|
+
maxContentTokens?: number;
|
|
1136
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1137
|
+
url: string;
|
|
1138
|
+
}, {
|
|
1139
|
+
type: "web_fetch_result";
|
|
1140
|
+
url: string;
|
|
1141
|
+
content: {
|
|
1142
|
+
type: "document";
|
|
1143
|
+
title: string | null;
|
|
1144
|
+
citations?: {
|
|
1145
|
+
enabled: boolean;
|
|
1146
|
+
};
|
|
1147
|
+
source: {
|
|
1148
|
+
type: "base64";
|
|
1149
|
+
mediaType: "application/pdf";
|
|
1150
|
+
data: string;
|
|
1151
|
+
} | {
|
|
1152
|
+
type: "text";
|
|
1153
|
+
mediaType: "text/plain";
|
|
1154
|
+
data: string;
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1157
|
+
retrievedAt: string | null;
|
|
1158
|
+
}, {}>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
1161
|
+
*
|
|
1162
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
1163
|
+
* @param allowedDomains - Only fetch from these domains
|
|
1164
|
+
* @param blockedDomains - Never fetch from these domains
|
|
1165
|
+
* @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.
|
|
1166
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
1167
|
+
*/
|
|
1168
|
+
webFetch_20260209: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1169
|
+
url: string;
|
|
1170
|
+
}, {
|
|
1171
|
+
type: "web_fetch_result";
|
|
1172
|
+
url: string;
|
|
1173
|
+
content: {
|
|
1174
|
+
type: "document";
|
|
1175
|
+
title: string | null;
|
|
1176
|
+
citations?: {
|
|
1177
|
+
enabled: boolean;
|
|
1178
|
+
};
|
|
1179
|
+
source: {
|
|
1180
|
+
type: "base64";
|
|
1181
|
+
mediaType: "application/pdf";
|
|
1182
|
+
data: string;
|
|
1183
|
+
} | {
|
|
1184
|
+
type: "text";
|
|
1185
|
+
mediaType: "text/plain";
|
|
1186
|
+
data: string;
|
|
1187
|
+
};
|
|
1188
|
+
};
|
|
1189
|
+
retrievedAt: string | null;
|
|
1190
|
+
}, {
|
|
1191
|
+
maxUses?: number;
|
|
1192
|
+
allowedDomains?: string[];
|
|
1193
|
+
blockedDomains?: string[];
|
|
1194
|
+
citations?: {
|
|
1195
|
+
enabled: boolean;
|
|
1196
|
+
};
|
|
1197
|
+
maxContentTokens?: number;
|
|
1198
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1199
|
+
url: string;
|
|
1200
|
+
}, {
|
|
1201
|
+
type: "web_fetch_result";
|
|
1202
|
+
url: string;
|
|
1203
|
+
content: {
|
|
1204
|
+
type: "document";
|
|
1205
|
+
title: string | null;
|
|
1206
|
+
citations?: {
|
|
1207
|
+
enabled: boolean;
|
|
1208
|
+
};
|
|
1209
|
+
source: {
|
|
1210
|
+
type: "base64";
|
|
1211
|
+
mediaType: "application/pdf";
|
|
1212
|
+
data: string;
|
|
1213
|
+
} | {
|
|
1214
|
+
type: "text";
|
|
1215
|
+
mediaType: "text/plain";
|
|
1216
|
+
data: string;
|
|
1217
|
+
};
|
|
1218
|
+
};
|
|
1219
|
+
retrievedAt: string | null;
|
|
1220
|
+
}, {}>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
1223
|
+
*
|
|
1224
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
1225
|
+
* @param allowedDomains - Only fetch from these domains
|
|
1226
|
+
* @param blockedDomains - Never fetch from these domains
|
|
1227
|
+
* @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.
|
|
1228
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
1229
|
+
* @param useCache - Whether cached content may be returned. Set to false to fetch fresh content.
|
|
1230
|
+
* @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
|
|
1231
|
+
*/
|
|
1232
|
+
webFetch_20260318: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1233
|
+
url: string;
|
|
1234
|
+
}, {
|
|
1235
|
+
type: "web_fetch_result";
|
|
1236
|
+
url: string;
|
|
1237
|
+
content: {
|
|
1238
|
+
type: "document";
|
|
1239
|
+
title: string | null;
|
|
1240
|
+
citations?: {
|
|
1241
|
+
enabled: boolean;
|
|
1242
|
+
};
|
|
1243
|
+
source: {
|
|
1244
|
+
type: "base64";
|
|
1245
|
+
mediaType: "application/pdf";
|
|
1246
|
+
data: string;
|
|
1247
|
+
} | {
|
|
1248
|
+
type: "text";
|
|
1249
|
+
mediaType: "text/plain";
|
|
1250
|
+
data: string;
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
retrievedAt: string | null;
|
|
1254
|
+
}, {
|
|
1255
|
+
maxUses?: number;
|
|
1256
|
+
allowedDomains?: string[];
|
|
1257
|
+
blockedDomains?: string[];
|
|
1258
|
+
citations?: {
|
|
1259
|
+
enabled: boolean;
|
|
1260
|
+
};
|
|
1261
|
+
maxContentTokens?: number;
|
|
1262
|
+
useCache?: boolean;
|
|
1263
|
+
responseInclusion?: "full" | "excluded";
|
|
1264
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1265
|
+
url: string;
|
|
1266
|
+
}, {
|
|
1267
|
+
type: "web_fetch_result";
|
|
1268
|
+
url: string;
|
|
1269
|
+
content: {
|
|
1270
|
+
type: "document";
|
|
1271
|
+
title: string | null;
|
|
1272
|
+
citations?: {
|
|
1273
|
+
enabled: boolean;
|
|
1274
|
+
};
|
|
1275
|
+
source: {
|
|
1276
|
+
type: "base64";
|
|
1277
|
+
mediaType: "application/pdf";
|
|
1278
|
+
data: string;
|
|
1279
|
+
} | {
|
|
1280
|
+
type: "text";
|
|
1281
|
+
mediaType: "text/plain";
|
|
1282
|
+
data: string;
|
|
1283
|
+
};
|
|
1284
|
+
};
|
|
1285
|
+
retrievedAt: string | null;
|
|
1286
|
+
}, {}>;
|
|
1287
|
+
/**
|
|
1288
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1289
|
+
*
|
|
1290
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1291
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1292
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1293
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1294
|
+
*/
|
|
1295
|
+
webSearch_20250305: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1296
|
+
query: string;
|
|
1297
|
+
}, {
|
|
1298
|
+
type: "web_search_result";
|
|
1299
|
+
url: string;
|
|
1300
|
+
title: string | null;
|
|
1301
|
+
pageAge: string | null;
|
|
1302
|
+
encryptedContent: string;
|
|
1303
|
+
}[], {
|
|
1304
|
+
maxUses?: number;
|
|
1305
|
+
allowedDomains?: string[];
|
|
1306
|
+
blockedDomains?: string[];
|
|
1307
|
+
userLocation?: {
|
|
1308
|
+
type: "approximate";
|
|
1309
|
+
city?: string;
|
|
1310
|
+
region?: string;
|
|
1311
|
+
country?: string;
|
|
1312
|
+
timezone?: string;
|
|
1313
|
+
};
|
|
1314
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1315
|
+
query: string;
|
|
1316
|
+
}, {
|
|
1317
|
+
type: "web_search_result";
|
|
1318
|
+
url: string;
|
|
1319
|
+
title: string | null;
|
|
1320
|
+
pageAge: string | null;
|
|
1321
|
+
encryptedContent: string;
|
|
1322
|
+
}[], {}>;
|
|
1323
|
+
/**
|
|
1324
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1325
|
+
*
|
|
1326
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1327
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1328
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1329
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1330
|
+
*/
|
|
1331
|
+
webSearch_20260209: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1332
|
+
query: string;
|
|
1333
|
+
}, {
|
|
1334
|
+
type: "web_search_result";
|
|
1335
|
+
url: string;
|
|
1336
|
+
title: string | null;
|
|
1337
|
+
pageAge: string | null;
|
|
1338
|
+
encryptedContent: string;
|
|
1339
|
+
}[], {
|
|
1340
|
+
maxUses?: number;
|
|
1341
|
+
allowedDomains?: string[];
|
|
1342
|
+
blockedDomains?: string[];
|
|
1343
|
+
userLocation?: {
|
|
1344
|
+
type: "approximate";
|
|
1345
|
+
city?: string;
|
|
1346
|
+
region?: string;
|
|
1347
|
+
country?: string;
|
|
1348
|
+
timezone?: string;
|
|
1349
|
+
};
|
|
1350
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1351
|
+
query: string;
|
|
1352
|
+
}, {
|
|
1353
|
+
type: "web_search_result";
|
|
1354
|
+
url: string;
|
|
1355
|
+
title: string | null;
|
|
1356
|
+
pageAge: string | null;
|
|
1357
|
+
encryptedContent: string;
|
|
1358
|
+
}[], {}>;
|
|
1359
|
+
/**
|
|
1360
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1361
|
+
*
|
|
1362
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1363
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1364
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1365
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1366
|
+
* @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
|
|
1367
|
+
*/
|
|
1368
|
+
webSearch_20260318: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1369
|
+
query: string;
|
|
1370
|
+
}, {
|
|
1371
|
+
type: "web_search_result";
|
|
1372
|
+
url: string;
|
|
1373
|
+
title: string | null;
|
|
1374
|
+
pageAge: string | null;
|
|
1375
|
+
encryptedContent: string;
|
|
1376
|
+
}[], {
|
|
1377
|
+
maxUses?: number;
|
|
1378
|
+
allowedDomains?: string[];
|
|
1379
|
+
blockedDomains?: string[];
|
|
1380
|
+
userLocation?: {
|
|
1381
|
+
type: "approximate";
|
|
1382
|
+
city?: string;
|
|
1383
|
+
region?: string;
|
|
1384
|
+
country?: string;
|
|
1385
|
+
timezone?: string;
|
|
1386
|
+
};
|
|
1387
|
+
responseInclusion?: "full" | "excluded";
|
|
1388
|
+
}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1389
|
+
query: string;
|
|
1390
|
+
}, {
|
|
1391
|
+
type: "web_search_result";
|
|
1392
|
+
url: string;
|
|
1393
|
+
title: string | null;
|
|
1394
|
+
pageAge: string | null;
|
|
1395
|
+
encryptedContent: string;
|
|
1396
|
+
}[], {}>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Creates a tool search tool that uses regex patterns to find tools.
|
|
1399
|
+
*
|
|
1400
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
1401
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
1402
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
1403
|
+
* catalog and loads only the tools it needs.
|
|
1404
|
+
*
|
|
1405
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
1406
|
+
* to mark them for deferred loading.
|
|
1407
|
+
*
|
|
1408
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
1409
|
+
*/
|
|
1410
|
+
toolSearchRegex_20251119: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1411
|
+
pattern: string;
|
|
1412
|
+
limit?: number;
|
|
1413
|
+
}, {
|
|
1414
|
+
type: "tool_reference";
|
|
1415
|
+
toolName: string;
|
|
1416
|
+
}[], {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1417
|
+
pattern: string;
|
|
1418
|
+
limit?: number;
|
|
1419
|
+
}, {
|
|
1420
|
+
type: "tool_reference";
|
|
1421
|
+
toolName: string;
|
|
1422
|
+
}[], {}>;
|
|
1423
|
+
/**
|
|
1424
|
+
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
1425
|
+
*
|
|
1426
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
1427
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
1428
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
1429
|
+
* catalog and loads only the tools it needs.
|
|
1430
|
+
*
|
|
1431
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
1432
|
+
* to mark them for deferred loading.
|
|
1433
|
+
*
|
|
1434
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
1435
|
+
*/
|
|
1436
|
+
toolSearchBm25_20251119: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
1437
|
+
query: string;
|
|
1438
|
+
limit?: number;
|
|
1439
|
+
}, {
|
|
1440
|
+
type: "tool_reference";
|
|
1441
|
+
toolName: string;
|
|
1442
|
+
}[], {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
|
|
1443
|
+
query: string;
|
|
1444
|
+
limit?: number;
|
|
1445
|
+
}, {
|
|
1446
|
+
type: "tool_reference";
|
|
1447
|
+
toolName: string;
|
|
1448
|
+
}[], {}>;
|
|
1443
1449
|
};
|
|
1444
|
-
|
|
1450
|
+
//#endregion
|
|
1451
|
+
//#region src/anthropic-provider.d.ts
|
|
1445
1452
|
interface AnthropicProvider extends ProviderV4 {
|
|
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
|
-
|
|
1453
|
+
/**
|
|
1454
|
+
* Creates a model for text generation.
|
|
1455
|
+
*/
|
|
1456
|
+
(modelId: AnthropicModelId): LanguageModelV4;
|
|
1457
|
+
/**
|
|
1458
|
+
* Creates a model for text generation.
|
|
1459
|
+
*/
|
|
1460
|
+
languageModel(modelId: AnthropicModelId): LanguageModelV4;
|
|
1461
|
+
chat(modelId: AnthropicModelId): LanguageModelV4;
|
|
1462
|
+
messages(modelId: AnthropicModelId): LanguageModelV4;
|
|
1463
|
+
/** Creates an experimental Choice/Score/Boolean evaluation model using Messages. */
|
|
1464
|
+
evaluationModel(modelId: AnthropicModelId): Experimental_EvaluationModelV4;
|
|
1465
|
+
experimental_batch(): Experimental_BatchV4<{
|
|
1466
|
+
text: AnthropicModelId;
|
|
1467
|
+
}>;
|
|
1468
|
+
/**
|
|
1469
|
+
* @deprecated Use `embeddingModel` instead.
|
|
1470
|
+
*/
|
|
1471
|
+
textEmbeddingModel(modelId: string): never;
|
|
1472
|
+
files(): FilesV4;
|
|
1473
|
+
/**
|
|
1474
|
+
* Returns a SkillsV4 interface for uploading skills to Anthropic.
|
|
1475
|
+
*/
|
|
1476
|
+
skills(): SkillsV4;
|
|
1477
|
+
/**
|
|
1478
|
+
* Anthropic-specific computer use tool.
|
|
1479
|
+
*/
|
|
1480
|
+
tools: typeof anthropicTools;
|
|
1474
1481
|
}
|
|
1475
1482
|
interface AnthropicProviderSettings {
|
|
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
|
-
|
|
1483
|
+
/**
|
|
1484
|
+
* Use a different URL prefix for API calls, e.g. to use proxy servers.
|
|
1485
|
+
* The default prefix is `https://api.anthropic.com/v1`.
|
|
1486
|
+
*/
|
|
1487
|
+
baseURL?: string;
|
|
1488
|
+
/**
|
|
1489
|
+
* API key that is being send using the `x-api-key` header.
|
|
1490
|
+
* It defaults to the `ANTHROPIC_API_KEY` environment variable.
|
|
1491
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
1492
|
+
*/
|
|
1493
|
+
apiKey?: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* Auth token that is being sent using the `Authorization: Bearer` header.
|
|
1496
|
+
* It defaults to the `ANTHROPIC_AUTH_TOKEN` environment variable.
|
|
1497
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
1498
|
+
*/
|
|
1499
|
+
authToken?: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* Custom headers to include in the requests.
|
|
1502
|
+
*/
|
|
1503
|
+
headers?: Record<string, string>;
|
|
1504
|
+
/**
|
|
1505
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
1506
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
1507
|
+
*/
|
|
1508
|
+
fetch?: FetchFunction;
|
|
1509
|
+
generateId?: () => string;
|
|
1510
|
+
/**
|
|
1511
|
+
* Custom provider name
|
|
1512
|
+
* Defaults to 'anthropic.messages'.
|
|
1513
|
+
*/
|
|
1514
|
+
name?: string;
|
|
1508
1515
|
}
|
|
1509
1516
|
/**
|
|
1510
1517
|
* Create an Anthropic provider instance.
|
|
1511
1518
|
*/
|
|
1512
|
-
declare function createAnthropic(options?: AnthropicProviderSettings): AnthropicProvider;
|
|
1519
|
+
export declare function createAnthropic(options?: AnthropicProviderSettings): AnthropicProvider;
|
|
1513
1520
|
/**
|
|
1514
1521
|
* Default Anthropic provider instance.
|
|
1515
1522
|
*/
|
|
1516
|
-
declare const anthropic: AnthropicProvider;
|
|
1517
|
-
|
|
1523
|
+
export declare const anthropic: AnthropicProvider;
|
|
1524
|
+
//#endregion
|
|
1525
|
+
//#region src/forward-anthropic-container-id-from-last-step.d.ts
|
|
1518
1526
|
/**
|
|
1519
1527
|
* Sets the Anthropic container ID in the provider options based on
|
|
1520
1528
|
* any previous step's provider metadata.
|
|
@@ -1522,14 +1530,16 @@ declare const anthropic: AnthropicProvider;
|
|
|
1522
1530
|
* Searches backwards through steps to find the most recent container ID.
|
|
1523
1531
|
* You can use this function in `prepareStep` to forward the container ID between steps.
|
|
1524
1532
|
*/
|
|
1525
|
-
declare function forwardAnthropicContainerIdFromLastStep({ steps
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1533
|
+
export declare function forwardAnthropicContainerIdFromLastStep({ steps }: {
|
|
1534
|
+
steps: Array<{
|
|
1535
|
+
providerMetadata?: Record<string, JSONObject>;
|
|
1536
|
+
}>;
|
|
1529
1537
|
}): undefined | {
|
|
1530
|
-
|
|
1538
|
+
providerOptions?: Record<string, JSONObject>;
|
|
1531
1539
|
};
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1540
|
+
//#endregion
|
|
1541
|
+
//#region src/version.d.ts
|
|
1542
|
+
export declare const VERSION: string;
|
|
1543
|
+
//#endregion
|
|
1544
|
+
export type { AnthropicLanguageModelOptions, AnthropicLanguageModelOptions as AnthropicProviderOptions, AnthropicMessageMetadata, AnthropicProvider, AnthropicProviderSettings, AnthropicSystemMessageProviderOptions, AnthropicToolOptions, AnthropicUsageIteration };
|
|
1545
|
+
//# sourceMappingURL=index.d.ts.map
|