@ai-sdk/anthropic 3.0.134 → 3.0.136
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 +17 -0
- package/dist/index.d.mts +121 -156
- package/dist/index.d.ts +121 -156
- package/dist/index.js +528 -515
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +485 -469
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +521 -508
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +484 -468
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/anthropic-messages-api.ts +65 -57
- package/src/anthropic-messages-options.ts +386 -367
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 3.0.136
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [28252da]
|
|
8
|
+
- @ai-sdk/provider-utils@4.0.63
|
|
9
|
+
|
|
10
|
+
## 3.0.135
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 2223bf2: Defer validation schema construction until first use to reduce provider import time.
|
|
15
|
+
- e172400: Defer construction of Anthropic provider option schemas until they are first used to reduce package import time.
|
|
16
|
+
- Updated dependencies [1183cc4]
|
|
17
|
+
- Updated dependencies [d726591]
|
|
18
|
+
- @ai-sdk/provider-utils@4.0.62
|
|
19
|
+
|
|
3
20
|
## 3.0.134
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JSONObject, ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
|
-
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
|
+
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
declare const anthropicSafeguardResultSchema: z.ZodObject<{
|
|
6
|
+
declare const anthropicSafeguardResultSchema: () => z.ZodObject<{
|
|
7
7
|
type: z.ZodString;
|
|
8
8
|
status: z.ZodObject<{
|
|
9
9
|
type: z.ZodString;
|
|
@@ -14,7 +14,7 @@ declare const anthropicSafeguardResultSchema: z.ZodObject<{
|
|
|
14
14
|
}, z.core.$strip>>>>;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
|
-
type AnthropicSafeguardResult = z.infer<typeof anthropicSafeguardResultSchema
|
|
17
|
+
type AnthropicSafeguardResult = z.infer<ReturnType<typeof anthropicSafeguardResultSchema>>;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Represents a single iteration in the usage breakdown.
|
|
@@ -224,159 +224,124 @@ type AnthropicMessagesModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20
|
|
|
224
224
|
/**
|
|
225
225
|
* Anthropic provider options for system messages.
|
|
226
226
|
*/
|
|
227
|
-
declare const anthropicSystemMessageProviderOptions:
|
|
228
|
-
clearAt
|
|
229
|
-
effort
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
type:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
type:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
346
|
-
type: z.ZodLiteral<"input_tokens">;
|
|
347
|
-
value: z.ZodNumber;
|
|
348
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
349
|
-
type: z.ZodLiteral<"tool_uses">;
|
|
350
|
-
value: z.ZodNumber;
|
|
351
|
-
}, z.core.$strip>]>>;
|
|
352
|
-
keep: z.ZodOptional<z.ZodObject<{
|
|
353
|
-
type: z.ZodLiteral<"tool_uses">;
|
|
354
|
-
value: z.ZodNumber;
|
|
355
|
-
}, z.core.$strip>>;
|
|
356
|
-
clearAtLeast: z.ZodOptional<z.ZodObject<{
|
|
357
|
-
type: z.ZodLiteral<"input_tokens">;
|
|
358
|
-
value: z.ZodNumber;
|
|
359
|
-
}, z.core.$strip>>;
|
|
360
|
-
clearToolInputs: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
-
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
362
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
363
|
-
type: z.ZodLiteral<"clear_thinking_20251015">;
|
|
364
|
-
keep: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodObject<{
|
|
365
|
-
type: z.ZodLiteral<"thinking_turns">;
|
|
366
|
-
value: z.ZodNumber;
|
|
367
|
-
}, z.core.$strip>]>>;
|
|
368
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
369
|
-
type: z.ZodLiteral<"compact_20260112">;
|
|
370
|
-
trigger: z.ZodOptional<z.ZodObject<{
|
|
371
|
-
type: z.ZodLiteral<"input_tokens">;
|
|
372
|
-
value: z.ZodNumber;
|
|
373
|
-
}, z.core.$strip>>;
|
|
374
|
-
pauseAfterCompaction: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
-
instructions: z.ZodOptional<z.ZodString>;
|
|
376
|
-
}, z.core.$strip>]>>;
|
|
377
|
-
}, z.core.$strip>>;
|
|
378
|
-
}, z.core.$strip>;
|
|
379
|
-
type AnthropicLanguageModelOptions = z.infer<typeof anthropicLanguageModelOptions>;
|
|
227
|
+
declare const anthropicSystemMessageProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
228
|
+
clearAt?: "next_user_message" | undefined;
|
|
229
|
+
effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
230
|
+
toolChanges?: ({
|
|
231
|
+
type: "tool_addition";
|
|
232
|
+
toolName: string;
|
|
233
|
+
} | {
|
|
234
|
+
type: "tool_removal";
|
|
235
|
+
toolName: string;
|
|
236
|
+
})[] | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
type AnthropicSystemMessageProviderOptions = InferSchema<typeof anthropicSystemMessageProviderOptions>;
|
|
239
|
+
declare const anthropicLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
240
|
+
sendReasoning?: boolean | undefined;
|
|
241
|
+
structuredOutputMode?: "auto" | "outputFormat" | "jsonTool" | undefined;
|
|
242
|
+
thinking?: {
|
|
243
|
+
type: "adaptive";
|
|
244
|
+
display?: "omitted" | "summarized" | "updates" | undefined;
|
|
245
|
+
blockBinding?: {
|
|
246
|
+
prefixMismatchBehavior: "error" | "drop_block";
|
|
247
|
+
} | undefined;
|
|
248
|
+
} | {
|
|
249
|
+
type: "enabled";
|
|
250
|
+
budgetTokens?: number | undefined;
|
|
251
|
+
} | {
|
|
252
|
+
type: "disabled";
|
|
253
|
+
} | {
|
|
254
|
+
type: "between_tools";
|
|
255
|
+
} | {
|
|
256
|
+
blockBinding: {
|
|
257
|
+
prefixMismatchBehavior: "error" | "drop_block";
|
|
258
|
+
};
|
|
259
|
+
} | undefined;
|
|
260
|
+
disableParallelToolUse?: boolean | undefined;
|
|
261
|
+
cacheControl?: {
|
|
262
|
+
type: "ephemeral";
|
|
263
|
+
ttl?: "5m" | "1h" | undefined;
|
|
264
|
+
} | undefined;
|
|
265
|
+
metadata?: {
|
|
266
|
+
userId?: string | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
mcpServers?: {
|
|
269
|
+
type: "url";
|
|
270
|
+
name: string;
|
|
271
|
+
url: string;
|
|
272
|
+
authorizationToken?: string | null | undefined;
|
|
273
|
+
toolConfiguration?: {
|
|
274
|
+
enabled?: boolean | null | undefined;
|
|
275
|
+
allowedTools?: string[] | null | undefined;
|
|
276
|
+
} | null | undefined;
|
|
277
|
+
}[] | undefined;
|
|
278
|
+
container?: {
|
|
279
|
+
id?: string | undefined;
|
|
280
|
+
skills?: {
|
|
281
|
+
type: "custom" | "anthropic";
|
|
282
|
+
skillId: string;
|
|
283
|
+
version?: string | undefined;
|
|
284
|
+
}[] | undefined;
|
|
285
|
+
} | undefined;
|
|
286
|
+
toolStreaming?: boolean | undefined;
|
|
287
|
+
effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
288
|
+
taskBudget?: {
|
|
289
|
+
type: "tokens";
|
|
290
|
+
total: number;
|
|
291
|
+
remaining?: number | undefined;
|
|
292
|
+
} | undefined;
|
|
293
|
+
speed?: "fast" | "standard" | undefined;
|
|
294
|
+
inferenceGeo?: "us" | "global" | undefined;
|
|
295
|
+
fallbacks?: "default" | {
|
|
296
|
+
model: string;
|
|
297
|
+
max_tokens?: number | undefined;
|
|
298
|
+
thinking?: Record<string, unknown> | undefined;
|
|
299
|
+
output_config?: Record<string, unknown> | undefined;
|
|
300
|
+
speed?: "fast" | "standard" | undefined;
|
|
301
|
+
}[] | undefined;
|
|
302
|
+
anthropicBeta?: string[] | undefined;
|
|
303
|
+
safeguards?: {
|
|
304
|
+
type: "dangerous_tool_use";
|
|
305
|
+
classifierContext?: Record<string, unknown> | undefined;
|
|
306
|
+
}[] | undefined;
|
|
307
|
+
contextManagement?: {
|
|
308
|
+
edits: ({
|
|
309
|
+
type: "clear_tool_uses_20250919";
|
|
310
|
+
trigger?: {
|
|
311
|
+
type: "input_tokens";
|
|
312
|
+
value: number;
|
|
313
|
+
} | {
|
|
314
|
+
type: "tool_uses";
|
|
315
|
+
value: number;
|
|
316
|
+
} | undefined;
|
|
317
|
+
keep?: {
|
|
318
|
+
type: "tool_uses";
|
|
319
|
+
value: number;
|
|
320
|
+
} | undefined;
|
|
321
|
+
clearAtLeast?: {
|
|
322
|
+
type: "input_tokens";
|
|
323
|
+
value: number;
|
|
324
|
+
} | undefined;
|
|
325
|
+
clearToolInputs?: boolean | undefined;
|
|
326
|
+
excludeTools?: string[] | undefined;
|
|
327
|
+
} | {
|
|
328
|
+
type: "clear_thinking_20251015";
|
|
329
|
+
keep?: "all" | {
|
|
330
|
+
type: "thinking_turns";
|
|
331
|
+
value: number;
|
|
332
|
+
} | undefined;
|
|
333
|
+
} | {
|
|
334
|
+
type: "compact_20260112";
|
|
335
|
+
trigger?: {
|
|
336
|
+
type: "input_tokens";
|
|
337
|
+
value: number;
|
|
338
|
+
} | undefined;
|
|
339
|
+
pauseAfterCompaction?: boolean | undefined;
|
|
340
|
+
instructions?: string | undefined;
|
|
341
|
+
})[];
|
|
342
|
+
} | undefined;
|
|
343
|
+
}>;
|
|
344
|
+
type AnthropicLanguageModelOptions = InferSchema<typeof anthropicLanguageModelOptions>;
|
|
380
345
|
|
|
381
346
|
interface AnthropicToolOptions {
|
|
382
347
|
deferLoading?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JSONObject, ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
|
-
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
|
+
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
declare const anthropicSafeguardResultSchema: z.ZodObject<{
|
|
6
|
+
declare const anthropicSafeguardResultSchema: () => z.ZodObject<{
|
|
7
7
|
type: z.ZodString;
|
|
8
8
|
status: z.ZodObject<{
|
|
9
9
|
type: z.ZodString;
|
|
@@ -14,7 +14,7 @@ declare const anthropicSafeguardResultSchema: z.ZodObject<{
|
|
|
14
14
|
}, z.core.$strip>>>>;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
|
-
type AnthropicSafeguardResult = z.infer<typeof anthropicSafeguardResultSchema
|
|
17
|
+
type AnthropicSafeguardResult = z.infer<ReturnType<typeof anthropicSafeguardResultSchema>>;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Represents a single iteration in the usage breakdown.
|
|
@@ -224,159 +224,124 @@ type AnthropicMessagesModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20
|
|
|
224
224
|
/**
|
|
225
225
|
* Anthropic provider options for system messages.
|
|
226
226
|
*/
|
|
227
|
-
declare const anthropicSystemMessageProviderOptions:
|
|
228
|
-
clearAt
|
|
229
|
-
effort
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
type:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
type:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
346
|
-
type: z.ZodLiteral<"input_tokens">;
|
|
347
|
-
value: z.ZodNumber;
|
|
348
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
349
|
-
type: z.ZodLiteral<"tool_uses">;
|
|
350
|
-
value: z.ZodNumber;
|
|
351
|
-
}, z.core.$strip>]>>;
|
|
352
|
-
keep: z.ZodOptional<z.ZodObject<{
|
|
353
|
-
type: z.ZodLiteral<"tool_uses">;
|
|
354
|
-
value: z.ZodNumber;
|
|
355
|
-
}, z.core.$strip>>;
|
|
356
|
-
clearAtLeast: z.ZodOptional<z.ZodObject<{
|
|
357
|
-
type: z.ZodLiteral<"input_tokens">;
|
|
358
|
-
value: z.ZodNumber;
|
|
359
|
-
}, z.core.$strip>>;
|
|
360
|
-
clearToolInputs: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
-
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
362
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
363
|
-
type: z.ZodLiteral<"clear_thinking_20251015">;
|
|
364
|
-
keep: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodObject<{
|
|
365
|
-
type: z.ZodLiteral<"thinking_turns">;
|
|
366
|
-
value: z.ZodNumber;
|
|
367
|
-
}, z.core.$strip>]>>;
|
|
368
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
369
|
-
type: z.ZodLiteral<"compact_20260112">;
|
|
370
|
-
trigger: z.ZodOptional<z.ZodObject<{
|
|
371
|
-
type: z.ZodLiteral<"input_tokens">;
|
|
372
|
-
value: z.ZodNumber;
|
|
373
|
-
}, z.core.$strip>>;
|
|
374
|
-
pauseAfterCompaction: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
-
instructions: z.ZodOptional<z.ZodString>;
|
|
376
|
-
}, z.core.$strip>]>>;
|
|
377
|
-
}, z.core.$strip>>;
|
|
378
|
-
}, z.core.$strip>;
|
|
379
|
-
type AnthropicLanguageModelOptions = z.infer<typeof anthropicLanguageModelOptions>;
|
|
227
|
+
declare const anthropicSystemMessageProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
228
|
+
clearAt?: "next_user_message" | undefined;
|
|
229
|
+
effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
230
|
+
toolChanges?: ({
|
|
231
|
+
type: "tool_addition";
|
|
232
|
+
toolName: string;
|
|
233
|
+
} | {
|
|
234
|
+
type: "tool_removal";
|
|
235
|
+
toolName: string;
|
|
236
|
+
})[] | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
type AnthropicSystemMessageProviderOptions = InferSchema<typeof anthropicSystemMessageProviderOptions>;
|
|
239
|
+
declare const anthropicLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
240
|
+
sendReasoning?: boolean | undefined;
|
|
241
|
+
structuredOutputMode?: "auto" | "outputFormat" | "jsonTool" | undefined;
|
|
242
|
+
thinking?: {
|
|
243
|
+
type: "adaptive";
|
|
244
|
+
display?: "omitted" | "summarized" | "updates" | undefined;
|
|
245
|
+
blockBinding?: {
|
|
246
|
+
prefixMismatchBehavior: "error" | "drop_block";
|
|
247
|
+
} | undefined;
|
|
248
|
+
} | {
|
|
249
|
+
type: "enabled";
|
|
250
|
+
budgetTokens?: number | undefined;
|
|
251
|
+
} | {
|
|
252
|
+
type: "disabled";
|
|
253
|
+
} | {
|
|
254
|
+
type: "between_tools";
|
|
255
|
+
} | {
|
|
256
|
+
blockBinding: {
|
|
257
|
+
prefixMismatchBehavior: "error" | "drop_block";
|
|
258
|
+
};
|
|
259
|
+
} | undefined;
|
|
260
|
+
disableParallelToolUse?: boolean | undefined;
|
|
261
|
+
cacheControl?: {
|
|
262
|
+
type: "ephemeral";
|
|
263
|
+
ttl?: "5m" | "1h" | undefined;
|
|
264
|
+
} | undefined;
|
|
265
|
+
metadata?: {
|
|
266
|
+
userId?: string | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
mcpServers?: {
|
|
269
|
+
type: "url";
|
|
270
|
+
name: string;
|
|
271
|
+
url: string;
|
|
272
|
+
authorizationToken?: string | null | undefined;
|
|
273
|
+
toolConfiguration?: {
|
|
274
|
+
enabled?: boolean | null | undefined;
|
|
275
|
+
allowedTools?: string[] | null | undefined;
|
|
276
|
+
} | null | undefined;
|
|
277
|
+
}[] | undefined;
|
|
278
|
+
container?: {
|
|
279
|
+
id?: string | undefined;
|
|
280
|
+
skills?: {
|
|
281
|
+
type: "custom" | "anthropic";
|
|
282
|
+
skillId: string;
|
|
283
|
+
version?: string | undefined;
|
|
284
|
+
}[] | undefined;
|
|
285
|
+
} | undefined;
|
|
286
|
+
toolStreaming?: boolean | undefined;
|
|
287
|
+
effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
288
|
+
taskBudget?: {
|
|
289
|
+
type: "tokens";
|
|
290
|
+
total: number;
|
|
291
|
+
remaining?: number | undefined;
|
|
292
|
+
} | undefined;
|
|
293
|
+
speed?: "fast" | "standard" | undefined;
|
|
294
|
+
inferenceGeo?: "us" | "global" | undefined;
|
|
295
|
+
fallbacks?: "default" | {
|
|
296
|
+
model: string;
|
|
297
|
+
max_tokens?: number | undefined;
|
|
298
|
+
thinking?: Record<string, unknown> | undefined;
|
|
299
|
+
output_config?: Record<string, unknown> | undefined;
|
|
300
|
+
speed?: "fast" | "standard" | undefined;
|
|
301
|
+
}[] | undefined;
|
|
302
|
+
anthropicBeta?: string[] | undefined;
|
|
303
|
+
safeguards?: {
|
|
304
|
+
type: "dangerous_tool_use";
|
|
305
|
+
classifierContext?: Record<string, unknown> | undefined;
|
|
306
|
+
}[] | undefined;
|
|
307
|
+
contextManagement?: {
|
|
308
|
+
edits: ({
|
|
309
|
+
type: "clear_tool_uses_20250919";
|
|
310
|
+
trigger?: {
|
|
311
|
+
type: "input_tokens";
|
|
312
|
+
value: number;
|
|
313
|
+
} | {
|
|
314
|
+
type: "tool_uses";
|
|
315
|
+
value: number;
|
|
316
|
+
} | undefined;
|
|
317
|
+
keep?: {
|
|
318
|
+
type: "tool_uses";
|
|
319
|
+
value: number;
|
|
320
|
+
} | undefined;
|
|
321
|
+
clearAtLeast?: {
|
|
322
|
+
type: "input_tokens";
|
|
323
|
+
value: number;
|
|
324
|
+
} | undefined;
|
|
325
|
+
clearToolInputs?: boolean | undefined;
|
|
326
|
+
excludeTools?: string[] | undefined;
|
|
327
|
+
} | {
|
|
328
|
+
type: "clear_thinking_20251015";
|
|
329
|
+
keep?: "all" | {
|
|
330
|
+
type: "thinking_turns";
|
|
331
|
+
value: number;
|
|
332
|
+
} | undefined;
|
|
333
|
+
} | {
|
|
334
|
+
type: "compact_20260112";
|
|
335
|
+
trigger?: {
|
|
336
|
+
type: "input_tokens";
|
|
337
|
+
value: number;
|
|
338
|
+
} | undefined;
|
|
339
|
+
pauseAfterCompaction?: boolean | undefined;
|
|
340
|
+
instructions?: string | undefined;
|
|
341
|
+
})[];
|
|
342
|
+
} | undefined;
|
|
343
|
+
}>;
|
|
344
|
+
type AnthropicLanguageModelOptions = InferSchema<typeof anthropicLanguageModelOptions>;
|
|
380
345
|
|
|
381
346
|
interface AnthropicToolOptions {
|
|
382
347
|
deferLoading?: boolean;
|