@effect/ai-anthropic 4.0.0-beta.2 → 4.0.0-beta.21
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/dist/AnthropicClient.d.ts +1 -1
- package/dist/AnthropicClient.d.ts.map +1 -1
- package/dist/AnthropicError.d.ts +22 -32
- package/dist/AnthropicError.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.d.ts +29 -25
- package/dist/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.js +9 -7
- package/dist/AnthropicLanguageModel.js.map +1 -1
- package/dist/AnthropicTool.d.ts +15 -15
- package/dist/Generated.d.ts +12317 -5916
- package/dist/Generated.d.ts.map +1 -1
- package/dist/Generated.js +2325 -922
- package/dist/Generated.js.map +1 -1
- package/package.json +3 -3
- package/src/AnthropicClient.ts +1 -1
- package/src/AnthropicError.ts +24 -32
- package/src/AnthropicLanguageModel.ts +13 -7
- package/src/Generated.ts +3758 -1822
package/dist/Generated.js
CHANGED
|
@@ -61,6 +61,9 @@ export const Base64PDFSource = /*#__PURE__*/Schema.Struct({
|
|
|
61
61
|
}).annotate({
|
|
62
62
|
"title": "Base64PDFSource"
|
|
63
63
|
});
|
|
64
|
+
export const BashCodeExecutionToolResultErrorCode = /*#__PURE__*/Schema.Literals(["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded", "output_file_too_large"]).annotate({
|
|
65
|
+
"title": "BashCodeExecutionToolResultErrorCode"
|
|
66
|
+
});
|
|
64
67
|
export const BetaAPIError = /*#__PURE__*/Schema.Struct({
|
|
65
68
|
"message": Schema.String.annotate({
|
|
66
69
|
"title": "Message",
|
|
@@ -1330,6 +1333,16 @@ export const BetaServerToolCaller = /*#__PURE__*/Schema.Struct({
|
|
|
1330
1333
|
"title": "ServerToolCaller",
|
|
1331
1334
|
"description": "Tool invocation generated by a server-side tool."
|
|
1332
1335
|
});
|
|
1336
|
+
export const BetaServerToolCaller_20260120 = /*#__PURE__*/Schema.Struct({
|
|
1337
|
+
"tool_id": Schema.String.annotate({
|
|
1338
|
+
"title": "Tool Id"
|
|
1339
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
1340
|
+
"type": Schema.Literal("code_execution_20260120").annotate({
|
|
1341
|
+
"title": "Type"
|
|
1342
|
+
})
|
|
1343
|
+
}).annotate({
|
|
1344
|
+
"title": "ServerToolCaller_20260120"
|
|
1345
|
+
});
|
|
1333
1346
|
export const BetaServerToolUsage = /*#__PURE__*/Schema.Struct({
|
|
1334
1347
|
"web_fetch_requests": Schema.Number.annotate({
|
|
1335
1348
|
"title": "Web Fetch Requests",
|
|
@@ -1711,6 +1724,23 @@ export const CanceledResult = /*#__PURE__*/Schema.Struct({
|
|
|
1711
1724
|
}).annotate({
|
|
1712
1725
|
"title": "CanceledResult"
|
|
1713
1726
|
});
|
|
1727
|
+
export const CodeExecutionToolResultErrorCode = /*#__PURE__*/Schema.Literals(["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]).annotate({
|
|
1728
|
+
"title": "CodeExecutionToolResultErrorCode"
|
|
1729
|
+
});
|
|
1730
|
+
export const Container = /*#__PURE__*/Schema.Struct({
|
|
1731
|
+
"expires_at": Schema.String.annotate({
|
|
1732
|
+
"title": "Expires At",
|
|
1733
|
+
"description": "The time at which the container will expire.",
|
|
1734
|
+
"format": "date-time"
|
|
1735
|
+
}),
|
|
1736
|
+
"id": Schema.String.annotate({
|
|
1737
|
+
"title": "Id",
|
|
1738
|
+
"description": "Identifier for the container used in this request"
|
|
1739
|
+
})
|
|
1740
|
+
}).annotate({
|
|
1741
|
+
"title": "Container",
|
|
1742
|
+
"description": "Information about the container used in the request (for the code execution tool)"
|
|
1743
|
+
});
|
|
1714
1744
|
export const ContentBlockStopEvent = /*#__PURE__*/Schema.Struct({
|
|
1715
1745
|
"index": Schema.Number.annotate({
|
|
1716
1746
|
"title": "Index"
|
|
@@ -1839,6 +1869,14 @@ export const DeleteSkillVersionResponse = /*#__PURE__*/Schema.Struct({
|
|
|
1839
1869
|
}).annotate({
|
|
1840
1870
|
"title": "DeleteSkillVersionResponse"
|
|
1841
1871
|
});
|
|
1872
|
+
export const DirectCaller = /*#__PURE__*/Schema.Struct({
|
|
1873
|
+
"type": Schema.Literal("direct").annotate({
|
|
1874
|
+
"title": "Type"
|
|
1875
|
+
})
|
|
1876
|
+
}).annotate({
|
|
1877
|
+
"title": "DirectCaller",
|
|
1878
|
+
"description": "Tool invocation directly from the model."
|
|
1879
|
+
});
|
|
1842
1880
|
export const EffortLevel = /*#__PURE__*/Schema.Literals(["low", "medium", "high", "max"]).annotate({
|
|
1843
1881
|
"title": "EffortLevel",
|
|
1844
1882
|
"description": "All possible effort levels."
|
|
@@ -2014,6 +2052,7 @@ export const JsonOutputFormat = /*#__PURE__*/Schema.Struct({
|
|
|
2014
2052
|
}).annotate({
|
|
2015
2053
|
"title": "JsonOutputFormat"
|
|
2016
2054
|
});
|
|
2055
|
+
export const JsonValue = Schema.Unknown;
|
|
2017
2056
|
export const MessageBatch = /*#__PURE__*/Schema.Struct({
|
|
2018
2057
|
"archived_at": Schema.Union([Schema.String.annotate({
|
|
2019
2058
|
"format": "date-time"
|
|
@@ -2184,6 +2223,16 @@ export const RateLimitError = /*#__PURE__*/Schema.Struct({
|
|
|
2184
2223
|
}).annotate({
|
|
2185
2224
|
"title": "RateLimitError"
|
|
2186
2225
|
});
|
|
2226
|
+
export const RequestBashCodeExecutionOutputBlock = /*#__PURE__*/Schema.Struct({
|
|
2227
|
+
"file_id": Schema.String.annotate({
|
|
2228
|
+
"title": "File Id"
|
|
2229
|
+
}),
|
|
2230
|
+
"type": Schema.Literal("bash_code_execution_output").annotate({
|
|
2231
|
+
"title": "Type"
|
|
2232
|
+
})
|
|
2233
|
+
}).annotate({
|
|
2234
|
+
"title": "RequestBashCodeExecutionOutputBlock"
|
|
2235
|
+
});
|
|
2187
2236
|
export const RequestCharLocationCitation = /*#__PURE__*/Schema.Struct({
|
|
2188
2237
|
"cited_text": Schema.String.annotate({
|
|
2189
2238
|
"title": "Cited Text"
|
|
@@ -2213,6 +2262,16 @@ export const RequestCitationsConfig = /*#__PURE__*/Schema.Struct({
|
|
|
2213
2262
|
}).annotate({
|
|
2214
2263
|
"title": "RequestCitationsConfig"
|
|
2215
2264
|
});
|
|
2265
|
+
export const RequestCodeExecutionOutputBlock = /*#__PURE__*/Schema.Struct({
|
|
2266
|
+
"file_id": Schema.String.annotate({
|
|
2267
|
+
"title": "File Id"
|
|
2268
|
+
}),
|
|
2269
|
+
"type": Schema.Literal("code_execution_output").annotate({
|
|
2270
|
+
"title": "Type"
|
|
2271
|
+
})
|
|
2272
|
+
}).annotate({
|
|
2273
|
+
"title": "RequestCodeExecutionOutputBlock"
|
|
2274
|
+
});
|
|
2216
2275
|
export const RequestContentBlockLocationCitation = /*#__PURE__*/Schema.Struct({
|
|
2217
2276
|
"cited_text": Schema.String.annotate({
|
|
2218
2277
|
"title": "Cited Text"
|
|
@@ -2282,6 +2341,60 @@ export const RequestSearchResultLocationCitation = /*#__PURE__*/Schema.Struct({
|
|
|
2282
2341
|
}).annotate({
|
|
2283
2342
|
"title": "RequestSearchResultLocationCitation"
|
|
2284
2343
|
});
|
|
2344
|
+
export const RequestTextEditorCodeExecutionCreateResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2345
|
+
"is_file_update": Schema.Boolean.annotate({
|
|
2346
|
+
"title": "Is File Update"
|
|
2347
|
+
}),
|
|
2348
|
+
"type": Schema.Literal("text_editor_code_execution_create_result").annotate({
|
|
2349
|
+
"title": "Type"
|
|
2350
|
+
})
|
|
2351
|
+
}).annotate({
|
|
2352
|
+
"title": "RequestTextEditorCodeExecutionCreateResultBlock"
|
|
2353
|
+
});
|
|
2354
|
+
export const RequestTextEditorCodeExecutionStrReplaceResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2355
|
+
"lines": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
2356
|
+
"title": "Lines"
|
|
2357
|
+
})),
|
|
2358
|
+
"new_lines": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2359
|
+
"title": "New Lines"
|
|
2360
|
+
})),
|
|
2361
|
+
"new_start": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2362
|
+
"title": "New Start"
|
|
2363
|
+
})),
|
|
2364
|
+
"old_lines": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2365
|
+
"title": "Old Lines"
|
|
2366
|
+
})),
|
|
2367
|
+
"old_start": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2368
|
+
"title": "Old Start"
|
|
2369
|
+
})),
|
|
2370
|
+
"type": Schema.Literal("text_editor_code_execution_str_replace_result").annotate({
|
|
2371
|
+
"title": "Type"
|
|
2372
|
+
})
|
|
2373
|
+
}).annotate({
|
|
2374
|
+
"title": "RequestTextEditorCodeExecutionStrReplaceResultBlock"
|
|
2375
|
+
});
|
|
2376
|
+
export const RequestTextEditorCodeExecutionViewResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2377
|
+
"content": Schema.String.annotate({
|
|
2378
|
+
"title": "Content"
|
|
2379
|
+
}),
|
|
2380
|
+
"file_type": Schema.Literals(["text", "image", "pdf"]).annotate({
|
|
2381
|
+
"title": "File Type"
|
|
2382
|
+
}),
|
|
2383
|
+
"num_lines": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2384
|
+
"title": "Num Lines"
|
|
2385
|
+
})),
|
|
2386
|
+
"start_line": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2387
|
+
"title": "Start Line"
|
|
2388
|
+
})),
|
|
2389
|
+
"total_lines": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2390
|
+
"title": "Total Lines"
|
|
2391
|
+
})),
|
|
2392
|
+
"type": Schema.Literal("text_editor_code_execution_view_result").annotate({
|
|
2393
|
+
"title": "Type"
|
|
2394
|
+
})
|
|
2395
|
+
}).annotate({
|
|
2396
|
+
"title": "RequestTextEditorCodeExecutionViewResultBlock"
|
|
2397
|
+
});
|
|
2285
2398
|
export const RequestWebSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2286
2399
|
"encrypted_content": Schema.String.annotate({
|
|
2287
2400
|
"title": "Encrypted Content"
|
|
@@ -2320,6 +2433,17 @@ export const RequestWebSearchResultLocationCitation = /*#__PURE__*/Schema.Struct
|
|
|
2320
2433
|
}).annotate({
|
|
2321
2434
|
"title": "RequestWebSearchResultLocationCitation"
|
|
2322
2435
|
});
|
|
2436
|
+
export const ResponseBashCodeExecutionOutputBlock = /*#__PURE__*/Schema.Struct({
|
|
2437
|
+
"file_id": Schema.String.annotate({
|
|
2438
|
+
"title": "File Id"
|
|
2439
|
+
}),
|
|
2440
|
+
"type": Schema.Literal("bash_code_execution_output").annotate({
|
|
2441
|
+
"title": "Type",
|
|
2442
|
+
"default": "bash_code_execution_output"
|
|
2443
|
+
})
|
|
2444
|
+
}).annotate({
|
|
2445
|
+
"title": "ResponseBashCodeExecutionOutputBlock"
|
|
2446
|
+
});
|
|
2323
2447
|
export const ResponseCharLocationCitation = /*#__PURE__*/Schema.Struct({
|
|
2324
2448
|
"cited_text": Schema.String.annotate({
|
|
2325
2449
|
"title": "Cited Text"
|
|
@@ -2347,6 +2471,37 @@ export const ResponseCharLocationCitation = /*#__PURE__*/Schema.Struct({
|
|
|
2347
2471
|
}).annotate({
|
|
2348
2472
|
"title": "ResponseCharLocationCitation"
|
|
2349
2473
|
});
|
|
2474
|
+
export const ResponseCitationsConfig = /*#__PURE__*/Schema.Struct({
|
|
2475
|
+
"enabled": Schema.Boolean.annotate({
|
|
2476
|
+
"title": "Enabled",
|
|
2477
|
+
"default": false
|
|
2478
|
+
})
|
|
2479
|
+
}).annotate({
|
|
2480
|
+
"title": "ResponseCitationsConfig"
|
|
2481
|
+
});
|
|
2482
|
+
export const ResponseCodeExecutionOutputBlock = /*#__PURE__*/Schema.Struct({
|
|
2483
|
+
"file_id": Schema.String.annotate({
|
|
2484
|
+
"title": "File Id"
|
|
2485
|
+
}),
|
|
2486
|
+
"type": Schema.Literal("code_execution_output").annotate({
|
|
2487
|
+
"title": "Type",
|
|
2488
|
+
"default": "code_execution_output"
|
|
2489
|
+
})
|
|
2490
|
+
}).annotate({
|
|
2491
|
+
"title": "ResponseCodeExecutionOutputBlock"
|
|
2492
|
+
});
|
|
2493
|
+
export const ResponseContainerUploadBlock = /*#__PURE__*/Schema.Struct({
|
|
2494
|
+
"file_id": Schema.String.annotate({
|
|
2495
|
+
"title": "File Id"
|
|
2496
|
+
}),
|
|
2497
|
+
"type": Schema.Literal("container_upload").annotate({
|
|
2498
|
+
"title": "Type",
|
|
2499
|
+
"default": "container_upload"
|
|
2500
|
+
})
|
|
2501
|
+
}).annotate({
|
|
2502
|
+
"title": "ResponseContainerUploadBlock",
|
|
2503
|
+
"description": "Response model for a file uploaded to the container."
|
|
2504
|
+
});
|
|
2350
2505
|
export const ResponseContentBlockLocationCitation = /*#__PURE__*/Schema.Struct({
|
|
2351
2506
|
"cited_text": Schema.String.annotate({
|
|
2352
2507
|
"title": "Cited Text"
|
|
@@ -2438,22 +2593,70 @@ export const ResponseSearchResultLocationCitation = /*#__PURE__*/Schema.Struct({
|
|
|
2438
2593
|
}).annotate({
|
|
2439
2594
|
"title": "ResponseSearchResultLocationCitation"
|
|
2440
2595
|
});
|
|
2441
|
-
export const
|
|
2442
|
-
"
|
|
2443
|
-
"title": "
|
|
2444
|
-
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
2445
|
-
"input": Schema.Record(Schema.String, Schema.Json).annotate({
|
|
2446
|
-
"title": "Input"
|
|
2596
|
+
export const ResponseTextEditorCodeExecutionCreateResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2597
|
+
"is_file_update": Schema.Boolean.annotate({
|
|
2598
|
+
"title": "Is File Update"
|
|
2447
2599
|
}),
|
|
2448
|
-
"
|
|
2449
|
-
"title": "
|
|
2600
|
+
"type": Schema.Literal("text_editor_code_execution_create_result").annotate({
|
|
2601
|
+
"title": "Type",
|
|
2602
|
+
"default": "text_editor_code_execution_create_result"
|
|
2603
|
+
})
|
|
2604
|
+
}).annotate({
|
|
2605
|
+
"title": "ResponseTextEditorCodeExecutionCreateResultBlock"
|
|
2606
|
+
});
|
|
2607
|
+
export const ResponseTextEditorCodeExecutionStrReplaceResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2608
|
+
"lines": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
2609
|
+
"title": "Lines",
|
|
2610
|
+
"default": null
|
|
2450
2611
|
}),
|
|
2451
|
-
"
|
|
2612
|
+
"new_lines": Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2613
|
+
"title": "New Lines",
|
|
2614
|
+
"default": null
|
|
2615
|
+
}),
|
|
2616
|
+
"new_start": Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2617
|
+
"title": "New Start",
|
|
2618
|
+
"default": null
|
|
2619
|
+
}),
|
|
2620
|
+
"old_lines": Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2621
|
+
"title": "Old Lines",
|
|
2622
|
+
"default": null
|
|
2623
|
+
}),
|
|
2624
|
+
"old_start": Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2625
|
+
"title": "Old Start",
|
|
2626
|
+
"default": null
|
|
2627
|
+
}),
|
|
2628
|
+
"type": Schema.Literal("text_editor_code_execution_str_replace_result").annotate({
|
|
2452
2629
|
"title": "Type",
|
|
2453
|
-
"default": "
|
|
2630
|
+
"default": "text_editor_code_execution_str_replace_result"
|
|
2454
2631
|
})
|
|
2455
2632
|
}).annotate({
|
|
2456
|
-
"title": "
|
|
2633
|
+
"title": "ResponseTextEditorCodeExecutionStrReplaceResultBlock"
|
|
2634
|
+
});
|
|
2635
|
+
export const ResponseTextEditorCodeExecutionViewResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2636
|
+
"content": Schema.String.annotate({
|
|
2637
|
+
"title": "Content"
|
|
2638
|
+
}),
|
|
2639
|
+
"file_type": Schema.Literals(["text", "image", "pdf"]).annotate({
|
|
2640
|
+
"title": "File Type"
|
|
2641
|
+
}),
|
|
2642
|
+
"num_lines": Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2643
|
+
"title": "Num Lines",
|
|
2644
|
+
"default": null
|
|
2645
|
+
}),
|
|
2646
|
+
"start_line": Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2647
|
+
"title": "Start Line",
|
|
2648
|
+
"default": null
|
|
2649
|
+
}),
|
|
2650
|
+
"total_lines": Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]).annotate({
|
|
2651
|
+
"title": "Total Lines",
|
|
2652
|
+
"default": null
|
|
2653
|
+
}),
|
|
2654
|
+
"type": Schema.Literal("text_editor_code_execution_view_result").annotate({
|
|
2655
|
+
"title": "Type",
|
|
2656
|
+
"default": "text_editor_code_execution_view_result"
|
|
2657
|
+
})
|
|
2658
|
+
}).annotate({
|
|
2659
|
+
"title": "ResponseTextEditorCodeExecutionViewResultBlock"
|
|
2457
2660
|
});
|
|
2458
2661
|
export const ResponseThinkingBlock = /*#__PURE__*/Schema.Struct({
|
|
2459
2662
|
"signature": Schema.String.annotate({
|
|
@@ -2469,22 +2672,16 @@ export const ResponseThinkingBlock = /*#__PURE__*/Schema.Struct({
|
|
|
2469
2672
|
}).annotate({
|
|
2470
2673
|
"title": "ResponseThinkingBlock"
|
|
2471
2674
|
});
|
|
2472
|
-
export const
|
|
2473
|
-
"
|
|
2474
|
-
"title": "
|
|
2475
|
-
}).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]
|
|
2476
|
-
"
|
|
2477
|
-
"title": "Input"
|
|
2478
|
-
}),
|
|
2479
|
-
"name": Schema.String.annotate({
|
|
2480
|
-
"title": "Name"
|
|
2481
|
-
}).check(Schema.isMinLength(1)),
|
|
2482
|
-
"type": Schema.Literal("tool_use").annotate({
|
|
2675
|
+
export const ResponseToolReferenceBlock = /*#__PURE__*/Schema.Struct({
|
|
2676
|
+
"tool_name": Schema.String.annotate({
|
|
2677
|
+
"title": "Tool Name"
|
|
2678
|
+
}).check(Schema.isMinLength(1)).check(Schema.isMaxLength(256)).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]{1,256}$"))),
|
|
2679
|
+
"type": Schema.Literal("tool_reference").annotate({
|
|
2483
2680
|
"title": "Type",
|
|
2484
|
-
"default": "
|
|
2681
|
+
"default": "tool_reference"
|
|
2485
2682
|
})
|
|
2486
2683
|
}).annotate({
|
|
2487
|
-
"title": "
|
|
2684
|
+
"title": "ResponseToolReferenceBlock"
|
|
2488
2685
|
});
|
|
2489
2686
|
export const ResponseWebSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
2490
2687
|
"encrypted_content": Schema.String.annotate({
|
|
@@ -2527,7 +2724,33 @@ export const ResponseWebSearchResultLocationCitation = /*#__PURE__*/Schema.Struc
|
|
|
2527
2724
|
}).annotate({
|
|
2528
2725
|
"title": "ResponseWebSearchResultLocationCitation"
|
|
2529
2726
|
});
|
|
2727
|
+
export const ServerToolCaller = /*#__PURE__*/Schema.Struct({
|
|
2728
|
+
"tool_id": Schema.String.annotate({
|
|
2729
|
+
"title": "Tool Id"
|
|
2730
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
2731
|
+
"type": Schema.Literal("code_execution_20250825").annotate({
|
|
2732
|
+
"title": "Type"
|
|
2733
|
+
})
|
|
2734
|
+
}).annotate({
|
|
2735
|
+
"title": "ServerToolCaller",
|
|
2736
|
+
"description": "Tool invocation generated by a server-side tool."
|
|
2737
|
+
});
|
|
2738
|
+
export const ServerToolCaller_20260120 = /*#__PURE__*/Schema.Struct({
|
|
2739
|
+
"tool_id": Schema.String.annotate({
|
|
2740
|
+
"title": "Tool Id"
|
|
2741
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
2742
|
+
"type": Schema.Literal("code_execution_20260120").annotate({
|
|
2743
|
+
"title": "Type"
|
|
2744
|
+
})
|
|
2745
|
+
}).annotate({
|
|
2746
|
+
"title": "ServerToolCaller_20260120"
|
|
2747
|
+
});
|
|
2530
2748
|
export const ServerToolUsage = /*#__PURE__*/Schema.Struct({
|
|
2749
|
+
"web_fetch_requests": Schema.Number.annotate({
|
|
2750
|
+
"title": "Web Fetch Requests",
|
|
2751
|
+
"description": "The number of web fetch tool requests.",
|
|
2752
|
+
"default": 0
|
|
2753
|
+
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
2531
2754
|
"web_search_requests": Schema.Number.annotate({
|
|
2532
2755
|
"title": "Web Search Requests",
|
|
2533
2756
|
"description": "The number of web search tool requests.",
|
|
@@ -2617,9 +2840,6 @@ export const SkillVersion = /*#__PURE__*/Schema.Struct({
|
|
|
2617
2840
|
}).annotate({
|
|
2618
2841
|
"title": "SkillVersion"
|
|
2619
2842
|
});
|
|
2620
|
-
export const Speed = /*#__PURE__*/Schema.Literals(["standard", "fast"]).annotate({
|
|
2621
|
-
"title": "Speed"
|
|
2622
|
-
});
|
|
2623
2843
|
export const TextContentBlockDelta = /*#__PURE__*/Schema.Struct({
|
|
2624
2844
|
"text": Schema.String.annotate({
|
|
2625
2845
|
"title": "Text"
|
|
@@ -2631,6 +2851,9 @@ export const TextContentBlockDelta = /*#__PURE__*/Schema.Struct({
|
|
|
2631
2851
|
}).annotate({
|
|
2632
2852
|
"title": "TextContentBlockDelta"
|
|
2633
2853
|
});
|
|
2854
|
+
export const TextEditorCodeExecutionToolResultErrorCode = /*#__PURE__*/Schema.Literals(["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded", "file_not_found"]).annotate({
|
|
2855
|
+
"title": "TextEditorCodeExecutionToolResultErrorCode"
|
|
2856
|
+
});
|
|
2634
2857
|
export const ThinkingConfigAdaptive = /*#__PURE__*/Schema.Struct({
|
|
2635
2858
|
"type": Schema.Literal("adaptive").annotate({
|
|
2636
2859
|
"title": "Type"
|
|
@@ -2715,6 +2938,9 @@ export const ToolChoiceTool = /*#__PURE__*/Schema.Struct({
|
|
|
2715
2938
|
"title": "ToolChoiceTool",
|
|
2716
2939
|
"description": "The model will use the specified tool with `tool_choice.name`."
|
|
2717
2940
|
});
|
|
2941
|
+
export const ToolSearchToolResultErrorCode = /*#__PURE__*/Schema.Literals(["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]).annotate({
|
|
2942
|
+
"title": "ToolSearchToolResultErrorCode"
|
|
2943
|
+
});
|
|
2718
2944
|
export const URLImageSource = /*#__PURE__*/Schema.Struct({
|
|
2719
2945
|
"type": Schema.Literal("url").annotate({
|
|
2720
2946
|
"title": "Type"
|
|
@@ -2758,12 +2984,15 @@ export const UserLocation = /*#__PURE__*/Schema.Struct({
|
|
|
2758
2984
|
}).annotate({
|
|
2759
2985
|
"title": "UserLocation"
|
|
2760
2986
|
});
|
|
2987
|
+
export const WebFetchToolResultErrorCode = /*#__PURE__*/Schema.Literals(["invalid_tool_input", "url_too_long", "url_not_allowed", "url_not_accessible", "unsupported_content_type", "too_many_requests", "max_uses_exceeded", "unavailable"]).annotate({
|
|
2988
|
+
"title": "WebFetchToolResultErrorCode"
|
|
2989
|
+
});
|
|
2761
2990
|
export const WebSearchToolResultErrorCode = /*#__PURE__*/Schema.Literals(["invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long", "request_too_large"]).annotate({
|
|
2762
2991
|
"title": "WebSearchToolResultErrorCode"
|
|
2763
2992
|
});
|
|
2764
2993
|
export const StopReason = /*#__PURE__*/Schema.Literals(["end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal"]);
|
|
2765
2994
|
export const BetaStopReason = /*#__PURE__*/Schema.Literals(["end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "compaction", "refusal", "model_context_window_exceeded"]);
|
|
2766
|
-
export const Model = /*#__PURE__*/Schema.Literals(["claude-opus-4-6", "claude-opus-4-5-20251101", "claude-opus-4-5", "claude-3-7-sonnet-latest", "claude-3-7-sonnet-20250219", "claude-3-5-haiku-latest", "claude-3-5-haiku-20241022", "claude-haiku-4-5", "claude-haiku-4-5-20251001", "claude-sonnet-4-20250514", "claude-sonnet-4-0", "claude-4-sonnet-20250514", "claude-sonnet-4-5", "claude-sonnet-4-5-20250929", "claude-opus-4-0", "claude-opus-4-20250514", "claude-4-opus-20250514", "claude-opus-4-1-20250805", "claude-3-opus-latest", "claude-3-opus-20240229", "claude-3-haiku-20240307"]).annotate({
|
|
2995
|
+
export const Model = /*#__PURE__*/Schema.Literals(["claude-opus-4-6", "claude-sonnet-4-6", "claude-opus-4-5-20251101", "claude-opus-4-5", "claude-3-7-sonnet-latest", "claude-3-7-sonnet-20250219", "claude-3-5-haiku-latest", "claude-3-5-haiku-20241022", "claude-haiku-4-5", "claude-haiku-4-5-20251001", "claude-sonnet-4-20250514", "claude-sonnet-4-0", "claude-4-sonnet-20250514", "claude-sonnet-4-5", "claude-sonnet-4-5-20250929", "claude-opus-4-0", "claude-opus-4-20250514", "claude-4-opus-20250514", "claude-opus-4-1-20250805", "claude-3-opus-latest", "claude-3-opus-20240229", "claude-3-haiku-20240307"]).annotate({
|
|
2767
2996
|
"title": "Model",
|
|
2768
2997
|
"description": "The model that will complete your prompt.\\n\\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options."
|
|
2769
2998
|
});
|
|
@@ -2842,8 +3071,25 @@ export const BetaMemoryTool_20250818_RenameCommand = /*#__PURE__*/Schema.Struct(
|
|
|
2842
3071
|
"description": "New path for the file or directory"
|
|
2843
3072
|
})
|
|
2844
3073
|
});
|
|
2845
|
-
export const
|
|
2846
|
-
"error_code":
|
|
3074
|
+
export const RequestBashCodeExecutionToolResultError = /*#__PURE__*/Schema.Struct({
|
|
3075
|
+
"error_code": BashCodeExecutionToolResultErrorCode,
|
|
3076
|
+
"type": Schema.Literal("bash_code_execution_tool_result_error").annotate({
|
|
3077
|
+
"title": "Type"
|
|
3078
|
+
})
|
|
3079
|
+
}).annotate({
|
|
3080
|
+
"title": "RequestBashCodeExecutionToolResultError"
|
|
3081
|
+
});
|
|
3082
|
+
export const ResponseBashCodeExecutionToolResultError = /*#__PURE__*/Schema.Struct({
|
|
3083
|
+
"error_code": BashCodeExecutionToolResultErrorCode,
|
|
3084
|
+
"type": Schema.Literal("bash_code_execution_tool_result_error").annotate({
|
|
3085
|
+
"title": "Type",
|
|
3086
|
+
"default": "bash_code_execution_tool_result_error"
|
|
3087
|
+
})
|
|
3088
|
+
}).annotate({
|
|
3089
|
+
"title": "ResponseBashCodeExecutionToolResultError"
|
|
3090
|
+
});
|
|
3091
|
+
export const BetaRequestBashCodeExecutionToolResultError = /*#__PURE__*/Schema.Struct({
|
|
3092
|
+
"error_code": BetaBashCodeExecutionToolResultErrorCode,
|
|
2847
3093
|
"type": Schema.Literal("bash_code_execution_tool_result_error").annotate({
|
|
2848
3094
|
"title": "Type"
|
|
2849
3095
|
})
|
|
@@ -2860,7 +3106,7 @@ export const BetaResponseBashCodeExecutionToolResultError = /*#__PURE__*/Schema.
|
|
|
2860
3106
|
"title": "ResponseBashCodeExecutionToolResultError"
|
|
2861
3107
|
});
|
|
2862
3108
|
export const BetaCodeExecutionTool_20250522 = /*#__PURE__*/Schema.Struct({
|
|
2863
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3109
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
2864
3110
|
"title": "Allowed Callers"
|
|
2865
3111
|
})),
|
|
2866
3112
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -2888,7 +3134,7 @@ export const BetaCodeExecutionTool_20250522 = /*#__PURE__*/Schema.Struct({
|
|
|
2888
3134
|
"title": "CodeExecutionTool_20250522"
|
|
2889
3135
|
});
|
|
2890
3136
|
export const BetaCodeExecutionTool_20250825 = /*#__PURE__*/Schema.Struct({
|
|
2891
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3137
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
2892
3138
|
"title": "Allowed Callers"
|
|
2893
3139
|
})),
|
|
2894
3140
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -2915,6 +3161,35 @@ export const BetaCodeExecutionTool_20250825 = /*#__PURE__*/Schema.Struct({
|
|
|
2915
3161
|
}).annotate({
|
|
2916
3162
|
"title": "CodeExecutionTool_20250825"
|
|
2917
3163
|
});
|
|
3164
|
+
export const BetaCodeExecutionTool_20260120 = /*#__PURE__*/Schema.Struct({
|
|
3165
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3166
|
+
"title": "Allowed Callers"
|
|
3167
|
+
})),
|
|
3168
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
3169
|
+
mode: "oneOf"
|
|
3170
|
+
}), Schema.Null]).annotate({
|
|
3171
|
+
"title": "Cache Control",
|
|
3172
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
3173
|
+
})),
|
|
3174
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
3175
|
+
"title": "Defer Loading",
|
|
3176
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
3177
|
+
})),
|
|
3178
|
+
"name": Schema.Literal("code_execution").annotate({
|
|
3179
|
+
"title": "Name",
|
|
3180
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
3181
|
+
}),
|
|
3182
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
3183
|
+
"title": "Strict",
|
|
3184
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
3185
|
+
})),
|
|
3186
|
+
"type": Schema.Literal("code_execution_20260120").annotate({
|
|
3187
|
+
"title": "Type"
|
|
3188
|
+
})
|
|
3189
|
+
}).annotate({
|
|
3190
|
+
"title": "CodeExecutionTool_20260120",
|
|
3191
|
+
"description": "Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint)."
|
|
3192
|
+
});
|
|
2918
3193
|
export const BetaRequestCompactionBlock = /*#__PURE__*/Schema.Struct({
|
|
2919
3194
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
2920
3195
|
mode: "oneOf"
|
|
@@ -2994,7 +3269,7 @@ export const BetaRequestToolReferenceBlock = /*#__PURE__*/Schema.Struct({
|
|
|
2994
3269
|
"description": "Tool reference block that can be included in tool_result content."
|
|
2995
3270
|
});
|
|
2996
3271
|
export const BetaToolSearchToolBM25_20251119 = /*#__PURE__*/Schema.Struct({
|
|
2997
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3272
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
2998
3273
|
"title": "Allowed Callers"
|
|
2999
3274
|
})),
|
|
3000
3275
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3022,7 +3297,7 @@ export const BetaToolSearchToolBM25_20251119 = /*#__PURE__*/Schema.Struct({
|
|
|
3022
3297
|
"title": "ToolSearchToolBM25_20251119"
|
|
3023
3298
|
});
|
|
3024
3299
|
export const BetaToolSearchToolRegex_20251119 = /*#__PURE__*/Schema.Struct({
|
|
3025
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3300
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3026
3301
|
"title": "Allowed Callers"
|
|
3027
3302
|
})),
|
|
3028
3303
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3182,7 +3457,7 @@ export const BetaCompact20260112 = /*#__PURE__*/Schema.Struct({
|
|
|
3182
3457
|
"description": "Automatically compact older context when reaching the configured trigger threshold."
|
|
3183
3458
|
});
|
|
3184
3459
|
export const BetaBashTool_20241022 = /*#__PURE__*/Schema.Struct({
|
|
3185
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3460
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3186
3461
|
"title": "Allowed Callers"
|
|
3187
3462
|
})),
|
|
3188
3463
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3213,7 +3488,7 @@ export const BetaBashTool_20241022 = /*#__PURE__*/Schema.Struct({
|
|
|
3213
3488
|
"title": "BashTool_20241022"
|
|
3214
3489
|
});
|
|
3215
3490
|
export const BetaBashTool_20250124 = /*#__PURE__*/Schema.Struct({
|
|
3216
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3491
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3217
3492
|
"title": "Allowed Callers"
|
|
3218
3493
|
})),
|
|
3219
3494
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3244,7 +3519,7 @@ export const BetaBashTool_20250124 = /*#__PURE__*/Schema.Struct({
|
|
|
3244
3519
|
"title": "BashTool_20250124"
|
|
3245
3520
|
});
|
|
3246
3521
|
export const BetaComputerUseTool_20241022 = /*#__PURE__*/Schema.Struct({
|
|
3247
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3522
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3248
3523
|
"title": "Allowed Callers"
|
|
3249
3524
|
})),
|
|
3250
3525
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3287,7 +3562,7 @@ export const BetaComputerUseTool_20241022 = /*#__PURE__*/Schema.Struct({
|
|
|
3287
3562
|
"title": "ComputerUseTool_20241022"
|
|
3288
3563
|
});
|
|
3289
3564
|
export const BetaComputerUseTool_20250124 = /*#__PURE__*/Schema.Struct({
|
|
3290
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3565
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3291
3566
|
"title": "Allowed Callers"
|
|
3292
3567
|
})),
|
|
3293
3568
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3330,7 +3605,7 @@ export const BetaComputerUseTool_20250124 = /*#__PURE__*/Schema.Struct({
|
|
|
3330
3605
|
"title": "ComputerUseTool_20250124"
|
|
3331
3606
|
});
|
|
3332
3607
|
export const BetaComputerUseTool_20251124 = /*#__PURE__*/Schema.Struct({
|
|
3333
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3608
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3334
3609
|
"title": "Allowed Callers"
|
|
3335
3610
|
})),
|
|
3336
3611
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3377,7 +3652,7 @@ export const BetaComputerUseTool_20251124 = /*#__PURE__*/Schema.Struct({
|
|
|
3377
3652
|
"title": "ComputerUseTool_20251124"
|
|
3378
3653
|
});
|
|
3379
3654
|
export const BetaMemoryTool_20250818 = /*#__PURE__*/Schema.Struct({
|
|
3380
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3655
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3381
3656
|
"title": "Allowed Callers"
|
|
3382
3657
|
})),
|
|
3383
3658
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3408,7 +3683,7 @@ export const BetaMemoryTool_20250818 = /*#__PURE__*/Schema.Struct({
|
|
|
3408
3683
|
"title": "MemoryTool_20250818"
|
|
3409
3684
|
});
|
|
3410
3685
|
export const BetaTextEditor_20241022 = /*#__PURE__*/Schema.Struct({
|
|
3411
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3686
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3412
3687
|
"title": "Allowed Callers"
|
|
3413
3688
|
})),
|
|
3414
3689
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3439,7 +3714,7 @@ export const BetaTextEditor_20241022 = /*#__PURE__*/Schema.Struct({
|
|
|
3439
3714
|
"title": "TextEditor_20241022"
|
|
3440
3715
|
});
|
|
3441
3716
|
export const BetaTextEditor_20250124 = /*#__PURE__*/Schema.Struct({
|
|
3442
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3717
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3443
3718
|
"title": "Allowed Callers"
|
|
3444
3719
|
})),
|
|
3445
3720
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3470,7 +3745,7 @@ export const BetaTextEditor_20250124 = /*#__PURE__*/Schema.Struct({
|
|
|
3470
3745
|
"title": "TextEditor_20250124"
|
|
3471
3746
|
});
|
|
3472
3747
|
export const BetaTextEditor_20250429 = /*#__PURE__*/Schema.Struct({
|
|
3473
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3748
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3474
3749
|
"title": "Allowed Callers"
|
|
3475
3750
|
})),
|
|
3476
3751
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3501,7 +3776,7 @@ export const BetaTextEditor_20250429 = /*#__PURE__*/Schema.Struct({
|
|
|
3501
3776
|
"title": "TextEditor_20250429"
|
|
3502
3777
|
});
|
|
3503
3778
|
export const BetaTextEditor_20250728 = /*#__PURE__*/Schema.Struct({
|
|
3504
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3779
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3505
3780
|
"title": "Allowed Callers"
|
|
3506
3781
|
})),
|
|
3507
3782
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
@@ -3575,7 +3850,7 @@ export const BetaTool = /*#__PURE__*/Schema.Struct({
|
|
|
3575
3850
|
"title": "Eager Input Streaming",
|
|
3576
3851
|
"description": "Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers."
|
|
3577
3852
|
})),
|
|
3578
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3853
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3579
3854
|
"title": "Allowed Callers"
|
|
3580
3855
|
})),
|
|
3581
3856
|
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
@@ -3696,7 +3971,7 @@ export const BetaRequestBashCodeExecutionResultBlock = /*#__PURE__*/Schema.Struc
|
|
|
3696
3971
|
"title": "RequestBashCodeExecutionResultBlock"
|
|
3697
3972
|
});
|
|
3698
3973
|
export const BetaWebFetchTool_20250910 = /*#__PURE__*/Schema.Struct({
|
|
3699
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
3974
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
3700
3975
|
"title": "Allowed Callers"
|
|
3701
3976
|
})),
|
|
3702
3977
|
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
@@ -3742,6 +4017,53 @@ export const BetaWebFetchTool_20250910 = /*#__PURE__*/Schema.Struct({
|
|
|
3742
4017
|
}).annotate({
|
|
3743
4018
|
"title": "WebFetchTool_20250910"
|
|
3744
4019
|
});
|
|
4020
|
+
export const BetaWebFetchTool_20260209 = /*#__PURE__*/Schema.Struct({
|
|
4021
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4022
|
+
"title": "Allowed Callers"
|
|
4023
|
+
})),
|
|
4024
|
+
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
4025
|
+
"title": "Allowed Domains",
|
|
4026
|
+
"description": "List of domains to allow fetching from"
|
|
4027
|
+
})),
|
|
4028
|
+
"blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
4029
|
+
"title": "Blocked Domains",
|
|
4030
|
+
"description": "List of domains to block fetching from"
|
|
4031
|
+
})),
|
|
4032
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
4033
|
+
mode: "oneOf"
|
|
4034
|
+
}), Schema.Null]).annotate({
|
|
4035
|
+
"title": "Cache Control",
|
|
4036
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4037
|
+
})),
|
|
4038
|
+
"citations": Schema.optionalKey(Schema.Union([BetaRequestCitationsConfig, Schema.Null]).annotate({
|
|
4039
|
+
"description": "Citations configuration for fetched documents. Citations are disabled by default."
|
|
4040
|
+
})),
|
|
4041
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4042
|
+
"title": "Defer Loading",
|
|
4043
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4044
|
+
})),
|
|
4045
|
+
"max_content_tokens": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
4046
|
+
"title": "Max Content Tokens",
|
|
4047
|
+
"description": "Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs."
|
|
4048
|
+
})),
|
|
4049
|
+
"max_uses": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
4050
|
+
"title": "Max Uses",
|
|
4051
|
+
"description": "Maximum number of times the tool can be used in the API request."
|
|
4052
|
+
})),
|
|
4053
|
+
"name": Schema.Literal("web_fetch").annotate({
|
|
4054
|
+
"title": "Name",
|
|
4055
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4056
|
+
}),
|
|
4057
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4058
|
+
"title": "Strict",
|
|
4059
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4060
|
+
})),
|
|
4061
|
+
"type": Schema.Literal("web_fetch_20260209").annotate({
|
|
4062
|
+
"title": "Type"
|
|
4063
|
+
})
|
|
4064
|
+
}).annotate({
|
|
4065
|
+
"title": "WebFetchTool_20260209"
|
|
4066
|
+
});
|
|
3745
4067
|
export const BetaRequestCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
3746
4068
|
"content": Schema.Array(BetaRequestCodeExecutionOutputBlock).annotate({
|
|
3747
4069
|
"title": "Content"
|
|
@@ -3761,6 +4083,26 @@ export const BetaRequestCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
|
3761
4083
|
}).annotate({
|
|
3762
4084
|
"title": "Result Block"
|
|
3763
4085
|
});
|
|
4086
|
+
export const BetaRequestEncryptedCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
4087
|
+
"content": Schema.Array(BetaRequestCodeExecutionOutputBlock).annotate({
|
|
4088
|
+
"title": "Content"
|
|
4089
|
+
}),
|
|
4090
|
+
"encrypted_stdout": Schema.String.annotate({
|
|
4091
|
+
"title": "Encrypted Stdout"
|
|
4092
|
+
}),
|
|
4093
|
+
"return_code": Schema.Number.annotate({
|
|
4094
|
+
"title": "Return Code"
|
|
4095
|
+
}).check(Schema.isInt()),
|
|
4096
|
+
"stderr": Schema.String.annotate({
|
|
4097
|
+
"title": "Stderr"
|
|
4098
|
+
}),
|
|
4099
|
+
"type": Schema.Literal("encrypted_code_execution_result").annotate({
|
|
4100
|
+
"title": "Type"
|
|
4101
|
+
})
|
|
4102
|
+
}).annotate({
|
|
4103
|
+
"title": "RequestEncryptedCodeExecutionResultBlock",
|
|
4104
|
+
"description": "Code execution result with encrypted stdout for PFC + web_search results."
|
|
4105
|
+
});
|
|
3764
4106
|
export const BetaRequestMCPServerURLDefinition = /*#__PURE__*/Schema.Struct({
|
|
3765
4107
|
"authorization_token": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
3766
4108
|
"title": "Authorization Token"
|
|
@@ -3915,6 +4257,27 @@ export const BetaResponseCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
|
3915
4257
|
}).annotate({
|
|
3916
4258
|
"title": "ResponseCodeExecutionResultBlock"
|
|
3917
4259
|
});
|
|
4260
|
+
export const BetaResponseEncryptedCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
4261
|
+
"content": Schema.Array(BetaResponseCodeExecutionOutputBlock).annotate({
|
|
4262
|
+
"title": "Content"
|
|
4263
|
+
}),
|
|
4264
|
+
"encrypted_stdout": Schema.String.annotate({
|
|
4265
|
+
"title": "Encrypted Stdout"
|
|
4266
|
+
}),
|
|
4267
|
+
"return_code": Schema.Number.annotate({
|
|
4268
|
+
"title": "Return Code"
|
|
4269
|
+
}).check(Schema.isInt()),
|
|
4270
|
+
"stderr": Schema.String.annotate({
|
|
4271
|
+
"title": "Stderr"
|
|
4272
|
+
}),
|
|
4273
|
+
"type": Schema.Literal("encrypted_code_execution_result").annotate({
|
|
4274
|
+
"title": "Type",
|
|
4275
|
+
"default": "encrypted_code_execution_result"
|
|
4276
|
+
})
|
|
4277
|
+
}).annotate({
|
|
4278
|
+
"title": "ResponseEncryptedCodeExecutionResultBlock",
|
|
4279
|
+
"description": "Code execution result with encrypted stdout for PFC + web_search results."
|
|
4280
|
+
});
|
|
3918
4281
|
export const BetaResponseToolSearchToolSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
3919
4282
|
"tool_references": Schema.Array(BetaResponseToolReferenceBlock).annotate({
|
|
3920
4283
|
"title": "Tool References"
|
|
@@ -4001,7 +4364,7 @@ export const BetaRequestServerToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
|
4001
4364
|
"title": "Cache Control",
|
|
4002
4365
|
"description": "Create a cache control breakpoint at this content block."
|
|
4003
4366
|
})),
|
|
4004
|
-
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller], {
|
|
4367
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
4005
4368
|
mode: "oneOf"
|
|
4006
4369
|
}).annotate({
|
|
4007
4370
|
"title": "Caller"
|
|
@@ -4022,7 +4385,7 @@ export const BetaRequestServerToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
|
4022
4385
|
"title": "RequestServerToolUseBlock"
|
|
4023
4386
|
});
|
|
4024
4387
|
export const BetaResponseServerToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
4025
|
-
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller], {
|
|
4388
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
4026
4389
|
mode: "oneOf"
|
|
4027
4390
|
}).annotate({
|
|
4028
4391
|
"title": "Caller"
|
|
@@ -4044,7 +4407,7 @@ export const BetaResponseServerToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
|
4044
4407
|
"title": "ResponseServerToolUseBlock"
|
|
4045
4408
|
});
|
|
4046
4409
|
export const BetaResponseToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
4047
|
-
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller], {
|
|
4410
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
4048
4411
|
mode: "oneOf"
|
|
4049
4412
|
}).annotate({
|
|
4050
4413
|
"title": "Caller"
|
|
@@ -4232,7 +4595,7 @@ export const BetaRequestImageBlock = /*#__PURE__*/Schema.Struct({
|
|
|
4232
4595
|
"title": "RequestImageBlock"
|
|
4233
4596
|
});
|
|
4234
4597
|
export const BetaWebSearchTool_20250305 = /*#__PURE__*/Schema.Struct({
|
|
4235
|
-
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825"])).annotate({
|
|
4598
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4236
4599
|
"title": "Allowed Callers"
|
|
4237
4600
|
})),
|
|
4238
4601
|
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
@@ -4274,6 +4637,49 @@ export const BetaWebSearchTool_20250305 = /*#__PURE__*/Schema.Struct({
|
|
|
4274
4637
|
}).annotate({
|
|
4275
4638
|
"title": "WebSearchTool_20250305"
|
|
4276
4639
|
});
|
|
4640
|
+
export const BetaWebSearchTool_20260209 = /*#__PURE__*/Schema.Struct({
|
|
4641
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4642
|
+
"title": "Allowed Callers"
|
|
4643
|
+
})),
|
|
4644
|
+
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
4645
|
+
"title": "Allowed Domains",
|
|
4646
|
+
"description": "If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`."
|
|
4647
|
+
})),
|
|
4648
|
+
"blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
4649
|
+
"title": "Blocked Domains",
|
|
4650
|
+
"description": "If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`."
|
|
4651
|
+
})),
|
|
4652
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
4653
|
+
mode: "oneOf"
|
|
4654
|
+
}), Schema.Null]).annotate({
|
|
4655
|
+
"title": "Cache Control",
|
|
4656
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4657
|
+
})),
|
|
4658
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4659
|
+
"title": "Defer Loading",
|
|
4660
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4661
|
+
})),
|
|
4662
|
+
"max_uses": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
4663
|
+
"title": "Max Uses",
|
|
4664
|
+
"description": "Maximum number of times the tool can be used in the API request."
|
|
4665
|
+
})),
|
|
4666
|
+
"name": Schema.Literal("web_search").annotate({
|
|
4667
|
+
"title": "Name",
|
|
4668
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4669
|
+
}),
|
|
4670
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4671
|
+
"title": "Strict",
|
|
4672
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4673
|
+
})),
|
|
4674
|
+
"type": Schema.Literal("web_search_20260209").annotate({
|
|
4675
|
+
"title": "Type"
|
|
4676
|
+
}),
|
|
4677
|
+
"user_location": Schema.optionalKey(Schema.Union([BetaUserLocation, Schema.Null]).annotate({
|
|
4678
|
+
"description": "Parameters for the user's location. Used to provide more relevant search results."
|
|
4679
|
+
}))
|
|
4680
|
+
}).annotate({
|
|
4681
|
+
"title": "WebSearchTool_20260209"
|
|
4682
|
+
});
|
|
4277
4683
|
export const BetaRequestWebFetchToolResultError = /*#__PURE__*/Schema.Struct({
|
|
4278
4684
|
"error_code": BetaWebFetchToolResultErrorCode,
|
|
4279
4685
|
"type": Schema.Literal("web_fetch_tool_result_error").annotate({
|
|
@@ -4324,14 +4730,21 @@ export const BetaListSkillsResponse = /*#__PURE__*/Schema.Struct({
|
|
|
4324
4730
|
}).annotate({
|
|
4325
4731
|
"title": "ListSkillsResponse"
|
|
4326
4732
|
});
|
|
4327
|
-
export const
|
|
4733
|
+
export const CodeExecutionTool_20250522 = /*#__PURE__*/Schema.Struct({
|
|
4734
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4735
|
+
"title": "Allowed Callers"
|
|
4736
|
+
})),
|
|
4328
4737
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4329
4738
|
mode: "oneOf"
|
|
4330
4739
|
}), Schema.Null]).annotate({
|
|
4331
4740
|
"title": "Cache Control",
|
|
4332
4741
|
"description": "Create a cache control breakpoint at this content block."
|
|
4333
4742
|
})),
|
|
4334
|
-
"
|
|
4743
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4744
|
+
"title": "Defer Loading",
|
|
4745
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4746
|
+
})),
|
|
4747
|
+
"name": Schema.Literal("code_execution").annotate({
|
|
4335
4748
|
"title": "Name",
|
|
4336
4749
|
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4337
4750
|
}),
|
|
@@ -4339,42 +4752,55 @@ export const BashTool_20250124 = /*#__PURE__*/Schema.Struct({
|
|
|
4339
4752
|
"title": "Strict",
|
|
4340
4753
|
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4341
4754
|
})),
|
|
4342
|
-
"type": Schema.Literal("
|
|
4755
|
+
"type": Schema.Literal("code_execution_20250522").annotate({
|
|
4343
4756
|
"title": "Type"
|
|
4344
4757
|
})
|
|
4345
4758
|
}).annotate({
|
|
4346
|
-
"title": "
|
|
4759
|
+
"title": "CodeExecutionTool_20250522"
|
|
4347
4760
|
});
|
|
4348
|
-
export const
|
|
4761
|
+
export const CodeExecutionTool_20250825 = /*#__PURE__*/Schema.Struct({
|
|
4762
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4763
|
+
"title": "Allowed Callers"
|
|
4764
|
+
})),
|
|
4349
4765
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4350
4766
|
mode: "oneOf"
|
|
4351
4767
|
}), Schema.Null]).annotate({
|
|
4352
4768
|
"title": "Cache Control",
|
|
4353
4769
|
"description": "Create a cache control breakpoint at this content block."
|
|
4354
4770
|
})),
|
|
4355
|
-
"
|
|
4356
|
-
"title": "
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
"title": "Name"
|
|
4771
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4772
|
+
"title": "Defer Loading",
|
|
4773
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4774
|
+
})),
|
|
4775
|
+
"name": Schema.Literal("code_execution").annotate({
|
|
4776
|
+
"title": "Name",
|
|
4777
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4363
4778
|
}),
|
|
4364
|
-
"
|
|
4779
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4780
|
+
"title": "Strict",
|
|
4781
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4782
|
+
})),
|
|
4783
|
+
"type": Schema.Literal("code_execution_20250825").annotate({
|
|
4365
4784
|
"title": "Type"
|
|
4366
4785
|
})
|
|
4367
4786
|
}).annotate({
|
|
4368
|
-
"title": "
|
|
4787
|
+
"title": "CodeExecutionTool_20250825"
|
|
4369
4788
|
});
|
|
4370
|
-
export const
|
|
4789
|
+
export const CodeExecutionTool_20260120 = /*#__PURE__*/Schema.Struct({
|
|
4790
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4791
|
+
"title": "Allowed Callers"
|
|
4792
|
+
})),
|
|
4371
4793
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4372
4794
|
mode: "oneOf"
|
|
4373
4795
|
}), Schema.Null]).annotate({
|
|
4374
4796
|
"title": "Cache Control",
|
|
4375
4797
|
"description": "Create a cache control breakpoint at this content block."
|
|
4376
4798
|
})),
|
|
4377
|
-
"
|
|
4799
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4800
|
+
"title": "Defer Loading",
|
|
4801
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4802
|
+
})),
|
|
4803
|
+
"name": Schema.Literal("code_execution").annotate({
|
|
4378
4804
|
"title": "Name",
|
|
4379
4805
|
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4380
4806
|
}),
|
|
@@ -4382,45 +4808,62 @@ export const TextEditor_20250124 = /*#__PURE__*/Schema.Struct({
|
|
|
4382
4808
|
"title": "Strict",
|
|
4383
4809
|
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4384
4810
|
})),
|
|
4385
|
-
"type": Schema.Literal("
|
|
4811
|
+
"type": Schema.Literal("code_execution_20260120").annotate({
|
|
4386
4812
|
"title": "Type"
|
|
4387
4813
|
})
|
|
4388
4814
|
}).annotate({
|
|
4389
|
-
"title": "
|
|
4815
|
+
"title": "CodeExecutionTool_20260120",
|
|
4816
|
+
"description": "Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint)."
|
|
4390
4817
|
});
|
|
4391
|
-
export const
|
|
4818
|
+
export const RequestContainerUploadBlock = /*#__PURE__*/Schema.Struct({
|
|
4392
4819
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4393
4820
|
mode: "oneOf"
|
|
4394
4821
|
}), Schema.Null]).annotate({
|
|
4395
4822
|
"title": "Cache Control",
|
|
4396
4823
|
"description": "Create a cache control breakpoint at this content block."
|
|
4397
4824
|
})),
|
|
4398
|
-
"
|
|
4399
|
-
"title": "
|
|
4400
|
-
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4825
|
+
"file_id": Schema.String.annotate({
|
|
4826
|
+
"title": "File Id"
|
|
4401
4827
|
}),
|
|
4402
|
-
"
|
|
4403
|
-
"title": "
|
|
4404
|
-
|
|
4828
|
+
"type": Schema.Literal("container_upload").annotate({
|
|
4829
|
+
"title": "Type"
|
|
4830
|
+
})
|
|
4831
|
+
}).annotate({
|
|
4832
|
+
"title": "RequestContainerUploadBlock",
|
|
4833
|
+
"description": "A content block that represents a file to be uploaded to the container\nFiles uploaded via this block will be available in the container's input directory."
|
|
4834
|
+
});
|
|
4835
|
+
export const RequestToolReferenceBlock = /*#__PURE__*/Schema.Struct({
|
|
4836
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4837
|
+
mode: "oneOf"
|
|
4838
|
+
}), Schema.Null]).annotate({
|
|
4839
|
+
"title": "Cache Control",
|
|
4840
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4405
4841
|
})),
|
|
4406
|
-
"
|
|
4842
|
+
"tool_name": Schema.String.annotate({
|
|
4843
|
+
"title": "Tool Name"
|
|
4844
|
+
}).check(Schema.isMinLength(1)).check(Schema.isMaxLength(256)).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]{1,256}$"))),
|
|
4845
|
+
"type": Schema.Literal("tool_reference").annotate({
|
|
4407
4846
|
"title": "Type"
|
|
4408
4847
|
})
|
|
4409
4848
|
}).annotate({
|
|
4410
|
-
"title": "
|
|
4849
|
+
"title": "RequestToolReferenceBlock",
|
|
4850
|
+
"description": "Tool reference block that can be included in tool_result content."
|
|
4411
4851
|
});
|
|
4412
|
-
export const
|
|
4852
|
+
export const ToolSearchToolBM25_20251119 = /*#__PURE__*/Schema.Struct({
|
|
4853
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4854
|
+
"title": "Allowed Callers"
|
|
4855
|
+
})),
|
|
4413
4856
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4414
4857
|
mode: "oneOf"
|
|
4415
4858
|
}), Schema.Null]).annotate({
|
|
4416
4859
|
"title": "Cache Control",
|
|
4417
4860
|
"description": "Create a cache control breakpoint at this content block."
|
|
4418
4861
|
})),
|
|
4419
|
-
"
|
|
4420
|
-
"title": "
|
|
4421
|
-
"description": "
|
|
4862
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4863
|
+
"title": "Defer Loading",
|
|
4864
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4422
4865
|
})),
|
|
4423
|
-
"name": Schema.Literal("
|
|
4866
|
+
"name": Schema.Literal("tool_search_tool_bm25").annotate({
|
|
4424
4867
|
"title": "Name",
|
|
4425
4868
|
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4426
4869
|
}),
|
|
@@ -4428,21 +4871,246 @@ export const TextEditor_20250728 = /*#__PURE__*/Schema.Struct({
|
|
|
4428
4871
|
"title": "Strict",
|
|
4429
4872
|
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4430
4873
|
})),
|
|
4431
|
-
"type": Schema.
|
|
4874
|
+
"type": Schema.Literals(["tool_search_tool_bm25_20251119", "tool_search_tool_bm25"]).annotate({
|
|
4432
4875
|
"title": "Type"
|
|
4433
4876
|
})
|
|
4434
4877
|
}).annotate({
|
|
4435
|
-
"title": "
|
|
4878
|
+
"title": "ToolSearchToolBM25_20251119"
|
|
4436
4879
|
});
|
|
4437
|
-
export const
|
|
4438
|
-
"
|
|
4439
|
-
"title": "
|
|
4880
|
+
export const ToolSearchToolRegex_20251119 = /*#__PURE__*/Schema.Struct({
|
|
4881
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4882
|
+
"title": "Allowed Callers"
|
|
4440
4883
|
})),
|
|
4441
|
-
"
|
|
4442
|
-
|
|
4443
|
-
|
|
4884
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4885
|
+
mode: "oneOf"
|
|
4886
|
+
}), Schema.Null]).annotate({
|
|
4887
|
+
"title": "Cache Control",
|
|
4888
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4444
4889
|
})),
|
|
4445
|
-
"
|
|
4890
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4891
|
+
"title": "Defer Loading",
|
|
4892
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4893
|
+
})),
|
|
4894
|
+
"name": Schema.Literal("tool_search_tool_regex").annotate({
|
|
4895
|
+
"title": "Name",
|
|
4896
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4897
|
+
}),
|
|
4898
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4899
|
+
"title": "Strict",
|
|
4900
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4901
|
+
})),
|
|
4902
|
+
"type": Schema.Literals(["tool_search_tool_regex_20251119", "tool_search_tool_regex"]).annotate({
|
|
4903
|
+
"title": "Type"
|
|
4904
|
+
})
|
|
4905
|
+
}).annotate({
|
|
4906
|
+
"title": "ToolSearchToolRegex_20251119"
|
|
4907
|
+
});
|
|
4908
|
+
export const RequestCodeExecutionToolResultError = /*#__PURE__*/Schema.Struct({
|
|
4909
|
+
"error_code": CodeExecutionToolResultErrorCode,
|
|
4910
|
+
"type": Schema.Literal("code_execution_tool_result_error").annotate({
|
|
4911
|
+
"title": "Type"
|
|
4912
|
+
})
|
|
4913
|
+
}).annotate({
|
|
4914
|
+
"title": "RequestCodeExecutionToolResultError"
|
|
4915
|
+
});
|
|
4916
|
+
export const ResponseCodeExecutionToolResultError = /*#__PURE__*/Schema.Struct({
|
|
4917
|
+
"error_code": CodeExecutionToolResultErrorCode,
|
|
4918
|
+
"type": Schema.Literal("code_execution_tool_result_error").annotate({
|
|
4919
|
+
"title": "Type",
|
|
4920
|
+
"default": "code_execution_tool_result_error"
|
|
4921
|
+
})
|
|
4922
|
+
}).annotate({
|
|
4923
|
+
"title": "ResponseCodeExecutionToolResultError"
|
|
4924
|
+
});
|
|
4925
|
+
export const FileListResponse = /*#__PURE__*/Schema.Struct({
|
|
4926
|
+
"data": Schema.Array(FileMetadataSchema).annotate({
|
|
4927
|
+
"title": "Data",
|
|
4928
|
+
"description": "List of file metadata objects."
|
|
4929
|
+
}),
|
|
4930
|
+
"first_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
4931
|
+
"title": "First Id",
|
|
4932
|
+
"description": "ID of the first file in this page of results."
|
|
4933
|
+
})),
|
|
4934
|
+
"has_more": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4935
|
+
"title": "Has More",
|
|
4936
|
+
"description": "Whether there are more results available.",
|
|
4937
|
+
"default": false
|
|
4938
|
+
})),
|
|
4939
|
+
"last_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
4940
|
+
"title": "Last Id",
|
|
4941
|
+
"description": "ID of the last file in this page of results."
|
|
4942
|
+
}))
|
|
4943
|
+
}).annotate({
|
|
4944
|
+
"title": "FileListResponse"
|
|
4945
|
+
});
|
|
4946
|
+
export const BashTool_20250124 = /*#__PURE__*/Schema.Struct({
|
|
4947
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4948
|
+
"title": "Allowed Callers"
|
|
4949
|
+
})),
|
|
4950
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4951
|
+
mode: "oneOf"
|
|
4952
|
+
}), Schema.Null]).annotate({
|
|
4953
|
+
"title": "Cache Control",
|
|
4954
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4955
|
+
})),
|
|
4956
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4957
|
+
"title": "Defer Loading",
|
|
4958
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4959
|
+
})),
|
|
4960
|
+
"input_examples": Schema.optionalKey(Schema.Array(Schema.Record(Schema.String, JsonValue)).annotate({
|
|
4961
|
+
"title": "Input Examples"
|
|
4962
|
+
})),
|
|
4963
|
+
"name": Schema.Literal("bash").annotate({
|
|
4964
|
+
"title": "Name",
|
|
4965
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4966
|
+
}),
|
|
4967
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4968
|
+
"title": "Strict",
|
|
4969
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4970
|
+
})),
|
|
4971
|
+
"type": Schema.Literal("bash_20250124").annotate({
|
|
4972
|
+
"title": "Type"
|
|
4973
|
+
})
|
|
4974
|
+
}).annotate({
|
|
4975
|
+
"title": "BashTool_20250124"
|
|
4976
|
+
});
|
|
4977
|
+
export const MemoryTool_20250818 = /*#__PURE__*/Schema.Struct({
|
|
4978
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
4979
|
+
"title": "Allowed Callers"
|
|
4980
|
+
})),
|
|
4981
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4982
|
+
mode: "oneOf"
|
|
4983
|
+
}), Schema.Null]).annotate({
|
|
4984
|
+
"title": "Cache Control",
|
|
4985
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4986
|
+
})),
|
|
4987
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4988
|
+
"title": "Defer Loading",
|
|
4989
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
4990
|
+
})),
|
|
4991
|
+
"input_examples": Schema.optionalKey(Schema.Array(Schema.Record(Schema.String, JsonValue)).annotate({
|
|
4992
|
+
"title": "Input Examples"
|
|
4993
|
+
})),
|
|
4994
|
+
"name": Schema.Literal("memory").annotate({
|
|
4995
|
+
"title": "Name",
|
|
4996
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4997
|
+
}),
|
|
4998
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
4999
|
+
"title": "Strict",
|
|
5000
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
5001
|
+
})),
|
|
5002
|
+
"type": Schema.Literal("memory_20250818").annotate({
|
|
5003
|
+
"title": "Type"
|
|
5004
|
+
})
|
|
5005
|
+
}).annotate({
|
|
5006
|
+
"title": "MemoryTool_20250818"
|
|
5007
|
+
});
|
|
5008
|
+
export const TextEditor_20250124 = /*#__PURE__*/Schema.Struct({
|
|
5009
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5010
|
+
"title": "Allowed Callers"
|
|
5011
|
+
})),
|
|
5012
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5013
|
+
mode: "oneOf"
|
|
5014
|
+
}), Schema.Null]).annotate({
|
|
5015
|
+
"title": "Cache Control",
|
|
5016
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5017
|
+
})),
|
|
5018
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5019
|
+
"title": "Defer Loading",
|
|
5020
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5021
|
+
})),
|
|
5022
|
+
"input_examples": Schema.optionalKey(Schema.Array(Schema.Record(Schema.String, JsonValue)).annotate({
|
|
5023
|
+
"title": "Input Examples"
|
|
5024
|
+
})),
|
|
5025
|
+
"name": Schema.Literal("str_replace_editor").annotate({
|
|
5026
|
+
"title": "Name",
|
|
5027
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
5028
|
+
}),
|
|
5029
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5030
|
+
"title": "Strict",
|
|
5031
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
5032
|
+
})),
|
|
5033
|
+
"type": Schema.Literal("text_editor_20250124").annotate({
|
|
5034
|
+
"title": "Type"
|
|
5035
|
+
})
|
|
5036
|
+
}).annotate({
|
|
5037
|
+
"title": "TextEditor_20250124"
|
|
5038
|
+
});
|
|
5039
|
+
export const TextEditor_20250429 = /*#__PURE__*/Schema.Struct({
|
|
5040
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5041
|
+
"title": "Allowed Callers"
|
|
5042
|
+
})),
|
|
5043
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5044
|
+
mode: "oneOf"
|
|
5045
|
+
}), Schema.Null]).annotate({
|
|
5046
|
+
"title": "Cache Control",
|
|
5047
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5048
|
+
})),
|
|
5049
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5050
|
+
"title": "Defer Loading",
|
|
5051
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5052
|
+
})),
|
|
5053
|
+
"input_examples": Schema.optionalKey(Schema.Array(Schema.Record(Schema.String, JsonValue)).annotate({
|
|
5054
|
+
"title": "Input Examples"
|
|
5055
|
+
})),
|
|
5056
|
+
"name": Schema.Literal("str_replace_based_edit_tool").annotate({
|
|
5057
|
+
"title": "Name",
|
|
5058
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
5059
|
+
}),
|
|
5060
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5061
|
+
"title": "Strict",
|
|
5062
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
5063
|
+
})),
|
|
5064
|
+
"type": Schema.Literal("text_editor_20250429").annotate({
|
|
5065
|
+
"title": "Type"
|
|
5066
|
+
})
|
|
5067
|
+
}).annotate({
|
|
5068
|
+
"title": "TextEditor_20250429"
|
|
5069
|
+
});
|
|
5070
|
+
export const TextEditor_20250728 = /*#__PURE__*/Schema.Struct({
|
|
5071
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5072
|
+
"title": "Allowed Callers"
|
|
5073
|
+
})),
|
|
5074
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5075
|
+
mode: "oneOf"
|
|
5076
|
+
}), Schema.Null]).annotate({
|
|
5077
|
+
"title": "Cache Control",
|
|
5078
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5079
|
+
})),
|
|
5080
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5081
|
+
"title": "Defer Loading",
|
|
5082
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5083
|
+
})),
|
|
5084
|
+
"input_examples": Schema.optionalKey(Schema.Array(Schema.Record(Schema.String, JsonValue)).annotate({
|
|
5085
|
+
"title": "Input Examples"
|
|
5086
|
+
})),
|
|
5087
|
+
"max_characters": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(1)), Schema.Null]).annotate({
|
|
5088
|
+
"title": "Max Characters",
|
|
5089
|
+
"description": "Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file."
|
|
5090
|
+
})),
|
|
5091
|
+
"name": Schema.Literal("str_replace_based_edit_tool").annotate({
|
|
5092
|
+
"title": "Name",
|
|
5093
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
5094
|
+
}),
|
|
5095
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5096
|
+
"title": "Strict",
|
|
5097
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
5098
|
+
})),
|
|
5099
|
+
"type": Schema.Literal("text_editor_20250728").annotate({
|
|
5100
|
+
"title": "Type"
|
|
5101
|
+
})
|
|
5102
|
+
}).annotate({
|
|
5103
|
+
"title": "TextEditor_20250728"
|
|
5104
|
+
});
|
|
5105
|
+
export const Tool = /*#__PURE__*/Schema.Struct({
|
|
5106
|
+
"type": Schema.optionalKey(Schema.Union([Schema.Null, Schema.Literal("custom")]).annotate({
|
|
5107
|
+
"title": "Type"
|
|
5108
|
+
})),
|
|
5109
|
+
"description": Schema.optionalKey(Schema.String.annotate({
|
|
5110
|
+
"title": "Description",
|
|
5111
|
+
"description": "Description of what this tool does.\n\nTool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema."
|
|
5112
|
+
})),
|
|
5113
|
+
"name": Schema.String.annotate({
|
|
4446
5114
|
"title": "Name",
|
|
4447
5115
|
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4448
5116
|
}).check(Schema.isMinLength(1)).check(Schema.isMaxLength(128)).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]{1,128}$"))),
|
|
@@ -4473,30 +5141,19 @@ export const Tool = /*#__PURE__*/Schema.Struct({
|
|
|
4473
5141
|
"eager_input_streaming": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]).annotate({
|
|
4474
5142
|
"title": "Eager Input Streaming",
|
|
4475
5143
|
"description": "Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers."
|
|
4476
|
-
}))
|
|
4477
|
-
}).annotate({
|
|
4478
|
-
"title": "Tool"
|
|
4479
|
-
});
|
|
4480
|
-
export const FileListResponse = /*#__PURE__*/Schema.Struct({
|
|
4481
|
-
"data": Schema.Array(FileMetadataSchema).annotate({
|
|
4482
|
-
"title": "Data",
|
|
4483
|
-
"description": "List of file metadata objects."
|
|
4484
|
-
}),
|
|
4485
|
-
"first_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
4486
|
-
"title": "First Id",
|
|
4487
|
-
"description": "ID of the first file in this page of results."
|
|
4488
5144
|
})),
|
|
4489
|
-
"
|
|
4490
|
-
"title": "
|
|
4491
|
-
"description": "Whether there are more results available.",
|
|
4492
|
-
"default": false
|
|
5145
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5146
|
+
"title": "Allowed Callers"
|
|
4493
5147
|
})),
|
|
4494
|
-
"
|
|
4495
|
-
"title": "
|
|
4496
|
-
"description": "
|
|
5148
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5149
|
+
"title": "Defer Loading",
|
|
5150
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5151
|
+
})),
|
|
5152
|
+
"input_examples": Schema.optionalKey(Schema.Array(Schema.Record(Schema.String, JsonValue)).annotate({
|
|
5153
|
+
"title": "Input Examples"
|
|
4497
5154
|
}))
|
|
4498
5155
|
}).annotate({
|
|
4499
|
-
"title": "
|
|
5156
|
+
"title": "Tool"
|
|
4500
5157
|
});
|
|
4501
5158
|
export const ListResponse_MessageBatch_ = /*#__PURE__*/Schema.Struct({
|
|
4502
5159
|
"data": Schema.Array(MessageBatch).annotate({
|
|
@@ -4553,128 +5210,83 @@ export const ErrorResponse = /*#__PURE__*/Schema.Struct({
|
|
|
4553
5210
|
}).annotate({
|
|
4554
5211
|
"title": "ErrorResponse"
|
|
4555
5212
|
});
|
|
4556
|
-
export const
|
|
4557
|
-
"
|
|
4558
|
-
|
|
4559
|
-
}), Schema.Null]).annotate({
|
|
4560
|
-
"title": "Cache Control",
|
|
4561
|
-
"description": "Create a cache control breakpoint at this content block."
|
|
4562
|
-
})),
|
|
4563
|
-
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([RequestCharLocationCitation, RequestPageLocationCitation, RequestContentBlockLocationCitation, RequestWebSearchResultLocationCitation, RequestSearchResultLocationCitation], {
|
|
4564
|
-
mode: "oneOf"
|
|
4565
|
-
})), Schema.Null]).annotate({
|
|
4566
|
-
"title": "Citations"
|
|
4567
|
-
})),
|
|
4568
|
-
"text": Schema.String.annotate({
|
|
4569
|
-
"title": "Text"
|
|
4570
|
-
}).check(Schema.isMinLength(1)),
|
|
4571
|
-
"type": Schema.Literal("text").annotate({
|
|
4572
|
-
"title": "Type"
|
|
4573
|
-
})
|
|
4574
|
-
}).annotate({
|
|
4575
|
-
"title": "RequestTextBlock"
|
|
4576
|
-
});
|
|
4577
|
-
export const CitationsDelta = /*#__PURE__*/Schema.Struct({
|
|
4578
|
-
"citation": Schema.Union([ResponseCharLocationCitation, ResponsePageLocationCitation, ResponseContentBlockLocationCitation, ResponseWebSearchResultLocationCitation, ResponseSearchResultLocationCitation], {
|
|
4579
|
-
mode: "oneOf"
|
|
4580
|
-
}).annotate({
|
|
4581
|
-
"title": "Citation"
|
|
4582
|
-
}),
|
|
4583
|
-
"type": Schema.Literal("citations_delta").annotate({
|
|
4584
|
-
"title": "Type",
|
|
4585
|
-
"default": "citations_delta"
|
|
4586
|
-
})
|
|
4587
|
-
}).annotate({
|
|
4588
|
-
"title": "CitationsDelta"
|
|
4589
|
-
});
|
|
4590
|
-
export const ResponseTextBlock = /*#__PURE__*/Schema.Struct({
|
|
4591
|
-
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([ResponseCharLocationCitation, ResponsePageLocationCitation, ResponseContentBlockLocationCitation, ResponseWebSearchResultLocationCitation, ResponseSearchResultLocationCitation], {
|
|
4592
|
-
mode: "oneOf"
|
|
4593
|
-
})), Schema.Null]).annotate({
|
|
4594
|
-
"title": "Citations",
|
|
4595
|
-
"description": "Citations supporting the text block.\n\nThe type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.",
|
|
4596
|
-
"default": null
|
|
4597
|
-
})),
|
|
4598
|
-
"text": Schema.String.annotate({
|
|
4599
|
-
"title": "Text"
|
|
4600
|
-
}).check(Schema.isMinLength(0)).check(Schema.isMaxLength(5000000)),
|
|
4601
|
-
"type": Schema.Literal("text").annotate({
|
|
4602
|
-
"title": "Type",
|
|
4603
|
-
"default": "text"
|
|
4604
|
-
})
|
|
4605
|
-
}).annotate({
|
|
4606
|
-
"title": "ResponseTextBlock"
|
|
4607
|
-
});
|
|
4608
|
-
export const ListSkillsResponse = /*#__PURE__*/Schema.Struct({
|
|
4609
|
-
"data": Schema.Array(Skill).annotate({
|
|
4610
|
-
"title": "Data",
|
|
4611
|
-
"description": "List of skills."
|
|
4612
|
-
}),
|
|
4613
|
-
"has_more": Schema.Boolean.annotate({
|
|
4614
|
-
"title": "Has More",
|
|
4615
|
-
"description": "Whether there are more results available.\n\nIf `true`, there are additional results that can be fetched using the `next_page` token."
|
|
5213
|
+
export const RequestBashCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5214
|
+
"content": Schema.Array(RequestBashCodeExecutionOutputBlock).annotate({
|
|
5215
|
+
"title": "Content"
|
|
4616
5216
|
}),
|
|
4617
|
-
"
|
|
4618
|
-
"title": "
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
"title": "ListSkillsResponse"
|
|
4623
|
-
});
|
|
4624
|
-
export const ListSkillVersionsResponse = /*#__PURE__*/Schema.Struct({
|
|
4625
|
-
"data": Schema.Array(SkillVersion).annotate({
|
|
4626
|
-
"title": "Data",
|
|
4627
|
-
"description": "List of skill versions."
|
|
5217
|
+
"return_code": Schema.Number.annotate({
|
|
5218
|
+
"title": "Return Code"
|
|
5219
|
+
}).check(Schema.isInt()),
|
|
5220
|
+
"stderr": Schema.String.annotate({
|
|
5221
|
+
"title": "Stderr"
|
|
4628
5222
|
}),
|
|
4629
|
-
"
|
|
4630
|
-
"title": "
|
|
4631
|
-
"description": "Indicates if there are more results in the requested page direction."
|
|
5223
|
+
"stdout": Schema.String.annotate({
|
|
5224
|
+
"title": "Stdout"
|
|
4632
5225
|
}),
|
|
4633
|
-
"
|
|
4634
|
-
"title": "
|
|
4635
|
-
"description": "Token to provide in as `page` in the subsequent request to retrieve the next page of data."
|
|
5226
|
+
"type": Schema.Literal("bash_code_execution_result").annotate({
|
|
5227
|
+
"title": "Type"
|
|
4636
5228
|
})
|
|
4637
5229
|
}).annotate({
|
|
4638
|
-
"title": "
|
|
4639
|
-
});
|
|
4640
|
-
export const ThinkingConfigParam = /*#__PURE__*/Schema.Union([ThinkingConfigEnabled, ThinkingConfigDisabled, ThinkingConfigAdaptive], {
|
|
4641
|
-
mode: "oneOf"
|
|
4642
|
-
}).annotate({
|
|
4643
|
-
"title": "Thinking",
|
|
4644
|
-
"description": "Configuration for enabling Claude's extended thinking.\n\nWhen enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.\n\nSee [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details."
|
|
4645
|
-
});
|
|
4646
|
-
export const ToolChoice = /*#__PURE__*/Schema.Union([ToolChoiceAuto, ToolChoiceAny, ToolChoiceTool, ToolChoiceNone], {
|
|
4647
|
-
mode: "oneOf"
|
|
4648
|
-
}).annotate({
|
|
4649
|
-
"title": "Tool Choice",
|
|
4650
|
-
"description": "How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all."
|
|
5230
|
+
"title": "RequestBashCodeExecutionResultBlock"
|
|
4651
5231
|
});
|
|
4652
|
-
export const
|
|
5232
|
+
export const WebFetchTool_20250910 = /*#__PURE__*/Schema.Struct({
|
|
5233
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5234
|
+
"title": "Allowed Callers"
|
|
5235
|
+
})),
|
|
5236
|
+
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
5237
|
+
"title": "Allowed Domains",
|
|
5238
|
+
"description": "List of domains to allow fetching from"
|
|
5239
|
+
})),
|
|
5240
|
+
"blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
5241
|
+
"title": "Blocked Domains",
|
|
5242
|
+
"description": "List of domains to block fetching from"
|
|
5243
|
+
})),
|
|
4653
5244
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4654
5245
|
mode: "oneOf"
|
|
4655
5246
|
}), Schema.Null]).annotate({
|
|
4656
5247
|
"title": "Cache Control",
|
|
4657
5248
|
"description": "Create a cache control breakpoint at this content block."
|
|
4658
5249
|
})),
|
|
4659
|
-
"
|
|
4660
|
-
|
|
4661
|
-
})
|
|
4662
|
-
|
|
5250
|
+
"citations": Schema.optionalKey(Schema.Union([RequestCitationsConfig, Schema.Null]).annotate({
|
|
5251
|
+
"description": "Citations configuration for fetched documents. Citations are disabled by default."
|
|
5252
|
+
})),
|
|
5253
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5254
|
+
"title": "Defer Loading",
|
|
5255
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5256
|
+
})),
|
|
5257
|
+
"max_content_tokens": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
5258
|
+
"title": "Max Content Tokens",
|
|
5259
|
+
"description": "Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs."
|
|
5260
|
+
})),
|
|
5261
|
+
"max_uses": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
5262
|
+
"title": "Max Uses",
|
|
5263
|
+
"description": "Maximum number of times the tool can be used in the API request."
|
|
5264
|
+
})),
|
|
5265
|
+
"name": Schema.Literal("web_fetch").annotate({
|
|
5266
|
+
"title": "Name",
|
|
5267
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4663
5268
|
}),
|
|
4664
|
-
"
|
|
5269
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5270
|
+
"title": "Strict",
|
|
5271
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
5272
|
+
})),
|
|
5273
|
+
"type": Schema.Literal("web_fetch_20250910").annotate({
|
|
4665
5274
|
"title": "Type"
|
|
4666
5275
|
})
|
|
4667
5276
|
}).annotate({
|
|
4668
|
-
"title": "
|
|
5277
|
+
"title": "WebFetchTool_20250910"
|
|
4669
5278
|
});
|
|
4670
|
-
export const
|
|
5279
|
+
export const WebFetchTool_20260209 = /*#__PURE__*/Schema.Struct({
|
|
5280
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5281
|
+
"title": "Allowed Callers"
|
|
5282
|
+
})),
|
|
4671
5283
|
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
4672
5284
|
"title": "Allowed Domains",
|
|
4673
|
-
"description": "
|
|
5285
|
+
"description": "List of domains to allow fetching from"
|
|
4674
5286
|
})),
|
|
4675
5287
|
"blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
4676
5288
|
"title": "Blocked Domains",
|
|
4677
|
-
"description": "
|
|
5289
|
+
"description": "List of domains to block fetching from"
|
|
4678
5290
|
})),
|
|
4679
5291
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4680
5292
|
mode: "oneOf"
|
|
@@ -4682,11 +5294,22 @@ export const WebSearchTool_20250305 = /*#__PURE__*/Schema.Struct({
|
|
|
4682
5294
|
"title": "Cache Control",
|
|
4683
5295
|
"description": "Create a cache control breakpoint at this content block."
|
|
4684
5296
|
})),
|
|
5297
|
+
"citations": Schema.optionalKey(Schema.Union([RequestCitationsConfig, Schema.Null]).annotate({
|
|
5298
|
+
"description": "Citations configuration for fetched documents. Citations are disabled by default."
|
|
5299
|
+
})),
|
|
5300
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5301
|
+
"title": "Defer Loading",
|
|
5302
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5303
|
+
})),
|
|
5304
|
+
"max_content_tokens": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
5305
|
+
"title": "Max Content Tokens",
|
|
5306
|
+
"description": "Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs."
|
|
5307
|
+
})),
|
|
4685
5308
|
"max_uses": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
4686
5309
|
"title": "Max Uses",
|
|
4687
5310
|
"description": "Maximum number of times the tool can be used in the API request."
|
|
4688
5311
|
})),
|
|
4689
|
-
"name": Schema.Literal("
|
|
5312
|
+
"name": Schema.Literal("web_fetch").annotate({
|
|
4690
5313
|
"title": "Name",
|
|
4691
5314
|
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
4692
5315
|
}),
|
|
@@ -4694,110 +5317,864 @@ export const WebSearchTool_20250305 = /*#__PURE__*/Schema.Struct({
|
|
|
4694
5317
|
"title": "Strict",
|
|
4695
5318
|
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
4696
5319
|
})),
|
|
4697
|
-
"type": Schema.Literal("
|
|
5320
|
+
"type": Schema.Literal("web_fetch_20260209").annotate({
|
|
4698
5321
|
"title": "Type"
|
|
5322
|
+
})
|
|
5323
|
+
}).annotate({
|
|
5324
|
+
"title": "WebFetchTool_20260209"
|
|
5325
|
+
});
|
|
5326
|
+
export const RequestCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5327
|
+
"content": Schema.Array(RequestCodeExecutionOutputBlock).annotate({
|
|
5328
|
+
"title": "Content"
|
|
4699
5329
|
}),
|
|
4700
|
-
"
|
|
4701
|
-
"
|
|
4702
|
-
}))
|
|
5330
|
+
"return_code": Schema.Number.annotate({
|
|
5331
|
+
"title": "Return Code"
|
|
5332
|
+
}).check(Schema.isInt()),
|
|
5333
|
+
"stderr": Schema.String.annotate({
|
|
5334
|
+
"title": "Stderr"
|
|
5335
|
+
}),
|
|
5336
|
+
"stdout": Schema.String.annotate({
|
|
5337
|
+
"title": "Stdout"
|
|
5338
|
+
}),
|
|
5339
|
+
"type": Schema.Literal("code_execution_result").annotate({
|
|
5340
|
+
"title": "Type"
|
|
5341
|
+
})
|
|
4703
5342
|
}).annotate({
|
|
4704
|
-
"title": "
|
|
5343
|
+
"title": "RequestCodeExecutionResultBlock"
|
|
4705
5344
|
});
|
|
4706
|
-
export const
|
|
4707
|
-
"
|
|
4708
|
-
|
|
5345
|
+
export const RequestEncryptedCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5346
|
+
"content": Schema.Array(RequestCodeExecutionOutputBlock).annotate({
|
|
5347
|
+
"title": "Content"
|
|
5348
|
+
}),
|
|
5349
|
+
"encrypted_stdout": Schema.String.annotate({
|
|
5350
|
+
"title": "Encrypted Stdout"
|
|
5351
|
+
}),
|
|
5352
|
+
"return_code": Schema.Number.annotate({
|
|
5353
|
+
"title": "Return Code"
|
|
5354
|
+
}).check(Schema.isInt()),
|
|
5355
|
+
"stderr": Schema.String.annotate({
|
|
5356
|
+
"title": "Stderr"
|
|
5357
|
+
}),
|
|
5358
|
+
"type": Schema.Literal("encrypted_code_execution_result").annotate({
|
|
4709
5359
|
"title": "Type"
|
|
4710
5360
|
})
|
|
4711
5361
|
}).annotate({
|
|
4712
|
-
"title": "
|
|
5362
|
+
"title": "RequestEncryptedCodeExecutionResultBlock",
|
|
5363
|
+
"description": "Code execution result with encrypted stdout for PFC + web_search results."
|
|
4713
5364
|
});
|
|
4714
|
-
export const
|
|
4715
|
-
"
|
|
4716
|
-
|
|
5365
|
+
export const RequestTextBlock = /*#__PURE__*/Schema.Struct({
|
|
5366
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5367
|
+
mode: "oneOf"
|
|
5368
|
+
}), Schema.Null]).annotate({
|
|
5369
|
+
"title": "Cache Control",
|
|
5370
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5371
|
+
})),
|
|
5372
|
+
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([RequestCharLocationCitation, RequestPageLocationCitation, RequestContentBlockLocationCitation, RequestWebSearchResultLocationCitation, RequestSearchResultLocationCitation], {
|
|
5373
|
+
mode: "oneOf"
|
|
5374
|
+
})), Schema.Null]).annotate({
|
|
5375
|
+
"title": "Citations"
|
|
5376
|
+
})),
|
|
5377
|
+
"text": Schema.String.annotate({
|
|
5378
|
+
"title": "Text"
|
|
5379
|
+
}).check(Schema.isMinLength(1)),
|
|
5380
|
+
"type": Schema.Literal("text").annotate({
|
|
5381
|
+
"title": "Type"
|
|
5382
|
+
})
|
|
5383
|
+
}).annotate({
|
|
5384
|
+
"title": "RequestTextBlock"
|
|
5385
|
+
});
|
|
5386
|
+
export const ResponseBashCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5387
|
+
"content": Schema.Array(ResponseBashCodeExecutionOutputBlock).annotate({
|
|
5388
|
+
"title": "Content"
|
|
5389
|
+
}),
|
|
5390
|
+
"return_code": Schema.Number.annotate({
|
|
5391
|
+
"title": "Return Code"
|
|
5392
|
+
}).check(Schema.isInt()),
|
|
5393
|
+
"stderr": Schema.String.annotate({
|
|
5394
|
+
"title": "Stderr"
|
|
5395
|
+
}),
|
|
5396
|
+
"stdout": Schema.String.annotate({
|
|
5397
|
+
"title": "Stdout"
|
|
5398
|
+
}),
|
|
5399
|
+
"type": Schema.Literal("bash_code_execution_result").annotate({
|
|
4717
5400
|
"title": "Type",
|
|
4718
|
-
"default": "
|
|
5401
|
+
"default": "bash_code_execution_result"
|
|
4719
5402
|
})
|
|
4720
5403
|
}).annotate({
|
|
4721
|
-
"title": "
|
|
5404
|
+
"title": "ResponseBashCodeExecutionResultBlock"
|
|
4722
5405
|
});
|
|
4723
|
-
export const
|
|
4724
|
-
"
|
|
4725
|
-
"
|
|
5406
|
+
export const ResponseDocumentBlock = /*#__PURE__*/Schema.Struct({
|
|
5407
|
+
"citations": Schema.Union([ResponseCitationsConfig, Schema.Null]).annotate({
|
|
5408
|
+
"description": "Citation configuration for the document",
|
|
4726
5409
|
"default": null
|
|
4727
5410
|
}),
|
|
4728
|
-
"
|
|
4729
|
-
|
|
5411
|
+
"source": Schema.Union([Base64PDFSource, PlainTextSource], {
|
|
5412
|
+
mode: "oneOf"
|
|
5413
|
+
}).annotate({
|
|
5414
|
+
"title": "Source"
|
|
5415
|
+
}),
|
|
5416
|
+
"title": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5417
|
+
"title": "Title",
|
|
5418
|
+
"description": "The title of the document",
|
|
4730
5419
|
"default": null
|
|
5420
|
+
}),
|
|
5421
|
+
"type": Schema.Literal("document").annotate({
|
|
5422
|
+
"title": "Type",
|
|
5423
|
+
"default": "document"
|
|
4731
5424
|
})
|
|
4732
5425
|
}).annotate({
|
|
4733
|
-
"title": "
|
|
5426
|
+
"title": "ResponseDocumentBlock"
|
|
4734
5427
|
});
|
|
4735
|
-
export const
|
|
4736
|
-
"
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
"
|
|
4744
|
-
})
|
|
4745
|
-
"
|
|
4746
|
-
"title": "
|
|
4747
|
-
|
|
5428
|
+
export const ResponseCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5429
|
+
"content": Schema.Array(ResponseCodeExecutionOutputBlock).annotate({
|
|
5430
|
+
"title": "Content"
|
|
5431
|
+
}),
|
|
5432
|
+
"return_code": Schema.Number.annotate({
|
|
5433
|
+
"title": "Return Code"
|
|
5434
|
+
}).check(Schema.isInt()),
|
|
5435
|
+
"stderr": Schema.String.annotate({
|
|
5436
|
+
"title": "Stderr"
|
|
5437
|
+
}),
|
|
5438
|
+
"stdout": Schema.String.annotate({
|
|
5439
|
+
"title": "Stdout"
|
|
5440
|
+
}),
|
|
5441
|
+
"type": Schema.Literal("code_execution_result").annotate({
|
|
5442
|
+
"title": "Type",
|
|
5443
|
+
"default": "code_execution_result"
|
|
5444
|
+
})
|
|
5445
|
+
}).annotate({
|
|
5446
|
+
"title": "ResponseCodeExecutionResultBlock"
|
|
5447
|
+
});
|
|
5448
|
+
export const ResponseEncryptedCodeExecutionResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5449
|
+
"content": Schema.Array(ResponseCodeExecutionOutputBlock).annotate({
|
|
5450
|
+
"title": "Content"
|
|
5451
|
+
}),
|
|
5452
|
+
"encrypted_stdout": Schema.String.annotate({
|
|
5453
|
+
"title": "Encrypted Stdout"
|
|
5454
|
+
}),
|
|
5455
|
+
"return_code": Schema.Number.annotate({
|
|
5456
|
+
"title": "Return Code"
|
|
5457
|
+
}).check(Schema.isInt()),
|
|
5458
|
+
"stderr": Schema.String.annotate({
|
|
5459
|
+
"title": "Stderr"
|
|
5460
|
+
}),
|
|
5461
|
+
"type": Schema.Literal("encrypted_code_execution_result").annotate({
|
|
5462
|
+
"title": "Type",
|
|
5463
|
+
"default": "encrypted_code_execution_result"
|
|
5464
|
+
})
|
|
5465
|
+
}).annotate({
|
|
5466
|
+
"title": "ResponseEncryptedCodeExecutionResultBlock",
|
|
5467
|
+
"description": "Code execution result with encrypted stdout for PFC + web_search results."
|
|
5468
|
+
});
|
|
5469
|
+
export const ResponseToolSearchToolSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5470
|
+
"tool_references": Schema.Array(ResponseToolReferenceBlock).annotate({
|
|
5471
|
+
"title": "Tool References"
|
|
5472
|
+
}),
|
|
5473
|
+
"type": Schema.Literal("tool_search_tool_search_result").annotate({
|
|
5474
|
+
"title": "Type",
|
|
5475
|
+
"default": "tool_search_tool_search_result"
|
|
5476
|
+
})
|
|
5477
|
+
}).annotate({
|
|
5478
|
+
"title": "ResponseToolSearchToolSearchResultBlock"
|
|
5479
|
+
});
|
|
5480
|
+
export const CitationsDelta = /*#__PURE__*/Schema.Struct({
|
|
5481
|
+
"citation": Schema.Union([ResponseCharLocationCitation, ResponsePageLocationCitation, ResponseContentBlockLocationCitation, ResponseWebSearchResultLocationCitation, ResponseSearchResultLocationCitation], {
|
|
5482
|
+
mode: "oneOf"
|
|
5483
|
+
}).annotate({
|
|
5484
|
+
"title": "Citation"
|
|
5485
|
+
}),
|
|
5486
|
+
"type": Schema.Literal("citations_delta").annotate({
|
|
5487
|
+
"title": "Type",
|
|
5488
|
+
"default": "citations_delta"
|
|
5489
|
+
})
|
|
5490
|
+
}).annotate({
|
|
5491
|
+
"title": "CitationsDelta"
|
|
5492
|
+
});
|
|
5493
|
+
export const ResponseTextBlock = /*#__PURE__*/Schema.Struct({
|
|
5494
|
+
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([ResponseCharLocationCitation, ResponsePageLocationCitation, ResponseContentBlockLocationCitation, ResponseWebSearchResultLocationCitation, ResponseSearchResultLocationCitation], {
|
|
5495
|
+
mode: "oneOf"
|
|
5496
|
+
})), Schema.Null]).annotate({
|
|
5497
|
+
"title": "Citations",
|
|
5498
|
+
"description": "Citations supporting the text block.\n\nThe type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.",
|
|
5499
|
+
"default": null
|
|
5500
|
+
})),
|
|
5501
|
+
"text": Schema.String.annotate({
|
|
5502
|
+
"title": "Text"
|
|
5503
|
+
}).check(Schema.isMinLength(0)).check(Schema.isMaxLength(5000000)),
|
|
5504
|
+
"type": Schema.Literal("text").annotate({
|
|
5505
|
+
"title": "Type",
|
|
5506
|
+
"default": "text"
|
|
5507
|
+
})
|
|
5508
|
+
}).annotate({
|
|
5509
|
+
"title": "ResponseTextBlock"
|
|
5510
|
+
});
|
|
5511
|
+
export const RequestServerToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
5512
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5513
|
+
mode: "oneOf"
|
|
5514
|
+
}), Schema.Null]).annotate({
|
|
5515
|
+
"title": "Cache Control",
|
|
5516
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5517
|
+
})),
|
|
5518
|
+
"caller": Schema.optionalKey(Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
5519
|
+
mode: "oneOf"
|
|
5520
|
+
}).annotate({
|
|
5521
|
+
"title": "Caller"
|
|
5522
|
+
})),
|
|
5523
|
+
"id": Schema.String.annotate({
|
|
5524
|
+
"title": "Id"
|
|
5525
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5526
|
+
"input": Schema.Record(Schema.String, Schema.Json).annotate({
|
|
5527
|
+
"title": "Input"
|
|
5528
|
+
}),
|
|
5529
|
+
"name": Schema.Literals(["web_search", "web_fetch", "code_execution", "bash_code_execution", "text_editor_code_execution", "tool_search_tool_regex", "tool_search_tool_bm25"]).annotate({
|
|
5530
|
+
"title": "Name"
|
|
5531
|
+
}),
|
|
5532
|
+
"type": Schema.Literal("server_tool_use").annotate({
|
|
5533
|
+
"title": "Type"
|
|
5534
|
+
})
|
|
5535
|
+
}).annotate({
|
|
5536
|
+
"title": "RequestServerToolUseBlock"
|
|
5537
|
+
});
|
|
5538
|
+
export const ResponseServerToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
5539
|
+
"caller": Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
5540
|
+
mode: "oneOf"
|
|
5541
|
+
}).annotate({
|
|
5542
|
+
"title": "Caller",
|
|
5543
|
+
"default": {
|
|
5544
|
+
"type": "direct"
|
|
5545
|
+
}
|
|
5546
|
+
}),
|
|
5547
|
+
"id": Schema.String.annotate({
|
|
5548
|
+
"title": "Id"
|
|
5549
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5550
|
+
"input": Schema.Record(Schema.String, Schema.Json).annotate({
|
|
5551
|
+
"title": "Input"
|
|
5552
|
+
}),
|
|
5553
|
+
"name": Schema.Literals(["web_search", "web_fetch", "code_execution", "bash_code_execution", "text_editor_code_execution", "tool_search_tool_regex", "tool_search_tool_bm25"]).annotate({
|
|
5554
|
+
"title": "Name"
|
|
5555
|
+
}),
|
|
5556
|
+
"type": Schema.Literal("server_tool_use").annotate({
|
|
5557
|
+
"title": "Type",
|
|
5558
|
+
"default": "server_tool_use"
|
|
5559
|
+
})
|
|
5560
|
+
}).annotate({
|
|
5561
|
+
"title": "ResponseServerToolUseBlock"
|
|
5562
|
+
});
|
|
5563
|
+
export const ResponseToolUseBlock = /*#__PURE__*/Schema.Struct({
|
|
5564
|
+
"caller": Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
5565
|
+
mode: "oneOf"
|
|
5566
|
+
}).annotate({
|
|
5567
|
+
"title": "Caller",
|
|
5568
|
+
"default": {
|
|
5569
|
+
"type": "direct"
|
|
5570
|
+
}
|
|
5571
|
+
}),
|
|
5572
|
+
"id": Schema.String.annotate({
|
|
5573
|
+
"title": "Id"
|
|
5574
|
+
}).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
5575
|
+
"input": Schema.Record(Schema.String, Schema.Json).annotate({
|
|
5576
|
+
"title": "Input"
|
|
5577
|
+
}),
|
|
5578
|
+
"name": Schema.String.annotate({
|
|
5579
|
+
"title": "Name"
|
|
5580
|
+
}).check(Schema.isMinLength(1)),
|
|
5581
|
+
"type": Schema.Literal("tool_use").annotate({
|
|
5582
|
+
"title": "Type",
|
|
5583
|
+
"default": "tool_use"
|
|
5584
|
+
})
|
|
5585
|
+
}).annotate({
|
|
5586
|
+
"title": "ResponseToolUseBlock"
|
|
5587
|
+
});
|
|
5588
|
+
export const ListSkillsResponse = /*#__PURE__*/Schema.Struct({
|
|
5589
|
+
"data": Schema.Array(Skill).annotate({
|
|
5590
|
+
"title": "Data",
|
|
5591
|
+
"description": "List of skills."
|
|
5592
|
+
}),
|
|
5593
|
+
"has_more": Schema.Boolean.annotate({
|
|
5594
|
+
"title": "Has More",
|
|
5595
|
+
"description": "Whether there are more results available.\n\nIf `true`, there are additional results that can be fetched using the `next_page` token."
|
|
5596
|
+
}),
|
|
5597
|
+
"next_page": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5598
|
+
"title": "Next Page",
|
|
5599
|
+
"description": "Token for fetching the next page of results.\n\nIf `null`, there are no more results available. Pass this value to the `page_token` parameter in the next request to get the next page."
|
|
5600
|
+
})
|
|
5601
|
+
}).annotate({
|
|
5602
|
+
"title": "ListSkillsResponse"
|
|
5603
|
+
});
|
|
5604
|
+
export const ListSkillVersionsResponse = /*#__PURE__*/Schema.Struct({
|
|
5605
|
+
"data": Schema.Array(SkillVersion).annotate({
|
|
5606
|
+
"title": "Data",
|
|
5607
|
+
"description": "List of skill versions."
|
|
5608
|
+
}),
|
|
5609
|
+
"has_more": Schema.Boolean.annotate({
|
|
5610
|
+
"title": "Has More",
|
|
5611
|
+
"description": "Indicates if there are more results in the requested page direction."
|
|
5612
|
+
}),
|
|
5613
|
+
"next_page": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5614
|
+
"title": "Next Page",
|
|
5615
|
+
"description": "Token to provide in as `page` in the subsequent request to retrieve the next page of data."
|
|
5616
|
+
})
|
|
5617
|
+
}).annotate({
|
|
5618
|
+
"title": "ListSkillVersionsResponse"
|
|
5619
|
+
});
|
|
5620
|
+
export const RequestTextEditorCodeExecutionToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5621
|
+
"error_code": TextEditorCodeExecutionToolResultErrorCode,
|
|
5622
|
+
"error_message": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5623
|
+
"title": "Error Message"
|
|
5624
|
+
})),
|
|
5625
|
+
"type": Schema.Literal("text_editor_code_execution_tool_result_error").annotate({
|
|
5626
|
+
"title": "Type"
|
|
5627
|
+
})
|
|
5628
|
+
}).annotate({
|
|
5629
|
+
"title": "RequestTextEditorCodeExecutionToolResultError"
|
|
5630
|
+
});
|
|
5631
|
+
export const ResponseTextEditorCodeExecutionToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5632
|
+
"error_code": TextEditorCodeExecutionToolResultErrorCode,
|
|
5633
|
+
"error_message": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5634
|
+
"title": "Error Message",
|
|
5635
|
+
"default": null
|
|
5636
|
+
}),
|
|
5637
|
+
"type": Schema.Literal("text_editor_code_execution_tool_result_error").annotate({
|
|
5638
|
+
"title": "Type",
|
|
5639
|
+
"default": "text_editor_code_execution_tool_result_error"
|
|
5640
|
+
})
|
|
5641
|
+
}).annotate({
|
|
5642
|
+
"title": "ResponseTextEditorCodeExecutionToolResultError"
|
|
5643
|
+
});
|
|
5644
|
+
export const ThinkingConfigParam = /*#__PURE__*/Schema.Union([ThinkingConfigEnabled, ThinkingConfigDisabled, ThinkingConfigAdaptive], {
|
|
5645
|
+
mode: "oneOf"
|
|
5646
|
+
}).annotate({
|
|
5647
|
+
"title": "Thinking",
|
|
5648
|
+
"description": "Configuration for enabling Claude's extended thinking.\n\nWhen enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.\n\nSee [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details."
|
|
5649
|
+
});
|
|
5650
|
+
export const ToolChoice = /*#__PURE__*/Schema.Union([ToolChoiceAuto, ToolChoiceAny, ToolChoiceTool, ToolChoiceNone], {
|
|
5651
|
+
mode: "oneOf"
|
|
5652
|
+
}).annotate({
|
|
5653
|
+
"title": "Tool Choice",
|
|
5654
|
+
"description": "How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all."
|
|
5655
|
+
});
|
|
5656
|
+
export const RequestToolSearchToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5657
|
+
"error_code": ToolSearchToolResultErrorCode,
|
|
5658
|
+
"type": Schema.Literal("tool_search_tool_result_error").annotate({
|
|
5659
|
+
"title": "Type"
|
|
5660
|
+
})
|
|
5661
|
+
}).annotate({
|
|
5662
|
+
"title": "RequestToolSearchToolResultError"
|
|
5663
|
+
});
|
|
5664
|
+
export const ResponseToolSearchToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5665
|
+
"error_code": ToolSearchToolResultErrorCode,
|
|
5666
|
+
"error_message": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5667
|
+
"title": "Error Message",
|
|
5668
|
+
"default": null
|
|
5669
|
+
}),
|
|
5670
|
+
"type": Schema.Literal("tool_search_tool_result_error").annotate({
|
|
5671
|
+
"title": "Type",
|
|
5672
|
+
"default": "tool_search_tool_result_error"
|
|
5673
|
+
})
|
|
5674
|
+
}).annotate({
|
|
5675
|
+
"title": "ResponseToolSearchToolResultError"
|
|
5676
|
+
});
|
|
5677
|
+
export const RequestImageBlock = /*#__PURE__*/Schema.Struct({
|
|
5678
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5679
|
+
mode: "oneOf"
|
|
5680
|
+
}), Schema.Null]).annotate({
|
|
5681
|
+
"title": "Cache Control",
|
|
5682
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5683
|
+
})),
|
|
5684
|
+
"source": Schema.Union([Base64ImageSource, URLImageSource], {
|
|
5685
|
+
mode: "oneOf"
|
|
5686
|
+
}).annotate({
|
|
5687
|
+
"title": "Source"
|
|
5688
|
+
}),
|
|
5689
|
+
"type": Schema.Literal("image").annotate({
|
|
5690
|
+
"title": "Type"
|
|
5691
|
+
})
|
|
5692
|
+
}).annotate({
|
|
5693
|
+
"title": "RequestImageBlock"
|
|
5694
|
+
});
|
|
5695
|
+
export const WebSearchTool_20250305 = /*#__PURE__*/Schema.Struct({
|
|
5696
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5697
|
+
"title": "Allowed Callers"
|
|
5698
|
+
})),
|
|
5699
|
+
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
5700
|
+
"title": "Allowed Domains",
|
|
5701
|
+
"description": "If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`."
|
|
5702
|
+
})),
|
|
5703
|
+
"blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
5704
|
+
"title": "Blocked Domains",
|
|
5705
|
+
"description": "If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`."
|
|
5706
|
+
})),
|
|
5707
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5708
|
+
mode: "oneOf"
|
|
5709
|
+
}), Schema.Null]).annotate({
|
|
5710
|
+
"title": "Cache Control",
|
|
5711
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5712
|
+
})),
|
|
5713
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5714
|
+
"title": "Defer Loading",
|
|
5715
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5716
|
+
})),
|
|
5717
|
+
"max_uses": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
5718
|
+
"title": "Max Uses",
|
|
5719
|
+
"description": "Maximum number of times the tool can be used in the API request."
|
|
5720
|
+
})),
|
|
5721
|
+
"name": Schema.Literal("web_search").annotate({
|
|
5722
|
+
"title": "Name",
|
|
5723
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
5724
|
+
}),
|
|
5725
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5726
|
+
"title": "Strict",
|
|
5727
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
5728
|
+
})),
|
|
5729
|
+
"type": Schema.Literal("web_search_20250305").annotate({
|
|
5730
|
+
"title": "Type"
|
|
5731
|
+
}),
|
|
5732
|
+
"user_location": Schema.optionalKey(Schema.Union([UserLocation, Schema.Null]).annotate({
|
|
5733
|
+
"description": "Parameters for the user's location. Used to provide more relevant search results."
|
|
5734
|
+
}))
|
|
5735
|
+
}).annotate({
|
|
5736
|
+
"title": "WebSearchTool_20250305"
|
|
5737
|
+
});
|
|
5738
|
+
export const WebSearchTool_20260209 = /*#__PURE__*/Schema.Struct({
|
|
5739
|
+
"allowed_callers": Schema.optionalKey(Schema.Array(Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])).annotate({
|
|
5740
|
+
"title": "Allowed Callers"
|
|
5741
|
+
})),
|
|
5742
|
+
"allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
5743
|
+
"title": "Allowed Domains",
|
|
5744
|
+
"description": "If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`."
|
|
5745
|
+
})),
|
|
5746
|
+
"blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
|
|
5747
|
+
"title": "Blocked Domains",
|
|
5748
|
+
"description": "If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`."
|
|
5749
|
+
})),
|
|
5750
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5751
|
+
mode: "oneOf"
|
|
5752
|
+
}), Schema.Null]).annotate({
|
|
5753
|
+
"title": "Cache Control",
|
|
5754
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5755
|
+
})),
|
|
5756
|
+
"defer_loading": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5757
|
+
"title": "Defer Loading",
|
|
5758
|
+
"description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search."
|
|
5759
|
+
})),
|
|
5760
|
+
"max_uses": Schema.optionalKey(Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), Schema.Null]).annotate({
|
|
5761
|
+
"title": "Max Uses",
|
|
5762
|
+
"description": "Maximum number of times the tool can be used in the API request."
|
|
5763
|
+
})),
|
|
5764
|
+
"name": Schema.Literal("web_search").annotate({
|
|
5765
|
+
"title": "Name",
|
|
5766
|
+
"description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks."
|
|
5767
|
+
}),
|
|
5768
|
+
"strict": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5769
|
+
"title": "Strict",
|
|
5770
|
+
"description": "When true, guarantees schema validation on tool names and inputs"
|
|
5771
|
+
})),
|
|
5772
|
+
"type": Schema.Literal("web_search_20260209").annotate({
|
|
5773
|
+
"title": "Type"
|
|
5774
|
+
}),
|
|
5775
|
+
"user_location": Schema.optionalKey(Schema.Union([UserLocation, Schema.Null]).annotate({
|
|
5776
|
+
"description": "Parameters for the user's location. Used to provide more relevant search results."
|
|
5777
|
+
}))
|
|
5778
|
+
}).annotate({
|
|
5779
|
+
"title": "WebSearchTool_20260209"
|
|
5780
|
+
});
|
|
5781
|
+
export const RequestWebFetchToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5782
|
+
"error_code": WebFetchToolResultErrorCode,
|
|
5783
|
+
"type": Schema.Literal("web_fetch_tool_result_error").annotate({
|
|
5784
|
+
"title": "Type"
|
|
5785
|
+
})
|
|
5786
|
+
}).annotate({
|
|
5787
|
+
"title": "RequestWebFetchToolResultError"
|
|
5788
|
+
});
|
|
5789
|
+
export const ResponseWebFetchToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5790
|
+
"error_code": WebFetchToolResultErrorCode,
|
|
5791
|
+
"type": Schema.Literal("web_fetch_tool_result_error").annotate({
|
|
5792
|
+
"title": "Type",
|
|
5793
|
+
"default": "web_fetch_tool_result_error"
|
|
5794
|
+
})
|
|
5795
|
+
}).annotate({
|
|
5796
|
+
"title": "ResponseWebFetchToolResultError"
|
|
5797
|
+
});
|
|
5798
|
+
export const RequestWebSearchToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5799
|
+
"error_code": WebSearchToolResultErrorCode,
|
|
5800
|
+
"type": Schema.Literal("web_search_tool_result_error").annotate({
|
|
5801
|
+
"title": "Type"
|
|
5802
|
+
})
|
|
5803
|
+
}).annotate({
|
|
5804
|
+
"title": "RequestWebSearchToolResultError"
|
|
5805
|
+
});
|
|
5806
|
+
export const ResponseWebSearchToolResultError = /*#__PURE__*/Schema.Struct({
|
|
5807
|
+
"error_code": WebSearchToolResultErrorCode,
|
|
5808
|
+
"type": Schema.Literal("web_search_tool_result_error").annotate({
|
|
5809
|
+
"title": "Type",
|
|
5810
|
+
"default": "web_search_tool_result_error"
|
|
5811
|
+
})
|
|
5812
|
+
}).annotate({
|
|
5813
|
+
"title": "ResponseWebSearchToolResultError"
|
|
5814
|
+
});
|
|
5815
|
+
export const MessageDelta = /*#__PURE__*/Schema.Struct({
|
|
5816
|
+
"container": Schema.Union([Container, Schema.Null]).annotate({
|
|
5817
|
+
"description": "Information about the container used in this request.\n\nThis will be non-null if a container tool (e.g. code execution) was used.",
|
|
5818
|
+
"default": null
|
|
5819
|
+
}),
|
|
5820
|
+
"stop_reason": Schema.Union([StopReason, Schema.Null]).annotate({
|
|
5821
|
+
"title": "Stop Reason",
|
|
5822
|
+
"default": null
|
|
5823
|
+
}),
|
|
5824
|
+
"stop_sequence": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5825
|
+
"title": "Stop Sequence",
|
|
5826
|
+
"default": null
|
|
5827
|
+
})
|
|
5828
|
+
}).annotate({
|
|
5829
|
+
"title": "MessageDelta"
|
|
5830
|
+
});
|
|
5831
|
+
export const CompletionRequest = /*#__PURE__*/Schema.Struct({
|
|
5832
|
+
"model": Model,
|
|
5833
|
+
"prompt": Schema.String.annotate({
|
|
5834
|
+
"title": "Prompt",
|
|
5835
|
+
"description": "The prompt that you want Claude to complete.\n\nFor proper response generation you will need to format your prompt using alternating `\\n\\nHuman:` and `\\n\\nAssistant:` conversational turns. For example:\n\n```\n\"\\n\\nHuman: {userQuestion}\\n\\nAssistant:\"\n```\n\nSee [prompt validation](https://docs.claude.com/en/api/prompt-validation) and our guide to [prompt design](https://docs.claude.com/en/docs/intro-to-prompting) for more details."
|
|
5836
|
+
}).check(Schema.isMinLength(1)),
|
|
5837
|
+
"max_tokens_to_sample": Schema.Number.annotate({
|
|
5838
|
+
"title": "Max Tokens To Sample",
|
|
5839
|
+
"description": "The maximum number of tokens to generate before stopping.\n\nNote that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate."
|
|
5840
|
+
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(1)),
|
|
5841
|
+
"stop_sequences": Schema.optionalKey(Schema.Array(Schema.String).annotate({
|
|
5842
|
+
"title": "Stop Sequences",
|
|
5843
|
+
"description": "Sequences that will cause the model to stop generating.\n\nOur models stop on `\"\\n\\nHuman:\"`, and may include additional built-in stop sequences in the future. By providing the stop_sequences parameter, you may include additional strings that will cause the model to stop generating."
|
|
5844
|
+
})),
|
|
5845
|
+
"temperature": Schema.optionalKey(Schema.Number.annotate({
|
|
5846
|
+
"title": "Temperature",
|
|
5847
|
+
"description": "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic."
|
|
5848
|
+
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
5849
|
+
"top_p": Schema.optionalKey(Schema.Number.annotate({
|
|
5850
|
+
"title": "Top P",
|
|
5851
|
+
"description": "Use nucleus sampling.\n\nIn nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.\n\nRecommended for advanced use cases only. You usually only need to use `temperature`."
|
|
5852
|
+
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
5853
|
+
"top_k": Schema.optionalKey(Schema.Number.annotate({
|
|
5854
|
+
"title": "Top K",
|
|
5855
|
+
"description": "Only sample from the top K options for each subsequent token.\n\nUsed to remove \"long tail\" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).\n\nRecommended for advanced use cases only. You usually only need to use `temperature`."
|
|
5856
|
+
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0))),
|
|
5857
|
+
"metadata": Schema.optionalKey(Schema.Struct({
|
|
5858
|
+
"user_id": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxLength(256)), Schema.Null]).annotate({
|
|
5859
|
+
"title": "User Id",
|
|
5860
|
+
"description": "An external identifier for the user who is associated with the request.\n\nThis should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number."
|
|
5861
|
+
}))
|
|
5862
|
+
}).annotate({
|
|
5863
|
+
"title": "Metadata",
|
|
5864
|
+
"description": "An object describing metadata about the request."
|
|
5865
|
+
})),
|
|
5866
|
+
"stream": Schema.optionalKey(Schema.Boolean.annotate({
|
|
5867
|
+
"title": "Stream",
|
|
5868
|
+
"description": "Whether to incrementally stream the response using server-sent events.\n\nSee [streaming](https://docs.claude.com/en/api/streaming) for details."
|
|
5869
|
+
}))
|
|
5870
|
+
}).annotate({
|
|
5871
|
+
"title": "CompletionRequest"
|
|
5872
|
+
});
|
|
5873
|
+
export const CompletionResponse = /*#__PURE__*/Schema.Struct({
|
|
5874
|
+
"completion": Schema.String.annotate({
|
|
5875
|
+
"title": "Completion",
|
|
5876
|
+
"description": "The resulting completion up to and excluding the stop sequences."
|
|
5877
|
+
}),
|
|
5878
|
+
"id": Schema.String.annotate({
|
|
5879
|
+
"title": "Id",
|
|
5880
|
+
"description": "Unique object identifier.\n\nThe format and length of IDs may change over time."
|
|
5881
|
+
}),
|
|
5882
|
+
"model": Model,
|
|
5883
|
+
"stop_reason": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5884
|
+
"title": "Stop Reason",
|
|
5885
|
+
"description": "The reason that we stopped.\n\nThis may be one the following values:\n* `\"stop_sequence\"`: we reached a stop sequence — either provided by you via the `stop_sequences` parameter, or a stop sequence built into the model\n* `\"max_tokens\"`: we exceeded `max_tokens_to_sample` or the model's maximum"
|
|
5886
|
+
}),
|
|
5887
|
+
"type": Schema.Literal("completion").annotate({
|
|
5888
|
+
"title": "Type",
|
|
5889
|
+
"description": "Object type.\n\nFor Text Completions, this is always `\"completion\"`.",
|
|
5890
|
+
"default": "completion"
|
|
5891
|
+
})
|
|
5892
|
+
}).annotate({
|
|
5893
|
+
"title": "CompletionResponse"
|
|
5894
|
+
});
|
|
5895
|
+
export const BetaRequestToolSearchToolSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5896
|
+
"tool_references": Schema.Array(BetaRequestToolReferenceBlock).annotate({
|
|
5897
|
+
"title": "Tool References"
|
|
5898
|
+
}),
|
|
5899
|
+
"type": Schema.Literal("tool_search_tool_search_result").annotate({
|
|
5900
|
+
"title": "Type"
|
|
5901
|
+
})
|
|
5902
|
+
}).annotate({
|
|
5903
|
+
"title": "RequestToolSearchToolSearchResultBlock"
|
|
5904
|
+
});
|
|
5905
|
+
export const BetaIterationsUsage = /*#__PURE__*/Schema.Union([Schema.Array(Schema.Union([BetaMessageIterationUsage, BetaCompactionIterationUsage])), Schema.Null]).annotate({
|
|
5906
|
+
"title": "Iterations",
|
|
5907
|
+
"description": "Per-iteration token usage breakdown.\n\nEach entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:\n- Determine which iterations exceeded long context thresholds (>=200k tokens)\n- Calculate the true context window size from the last iteration\n- Understand token accumulation across server-side tool use loops",
|
|
5908
|
+
"default": null
|
|
5909
|
+
});
|
|
5910
|
+
export const BetaErroredResult = /*#__PURE__*/Schema.Struct({
|
|
5911
|
+
"error": BetaErrorResponse,
|
|
5912
|
+
"type": Schema.Literal("errored").annotate({
|
|
5913
|
+
"title": "Type",
|
|
5914
|
+
"default": "errored"
|
|
5915
|
+
})
|
|
5916
|
+
}).annotate({
|
|
5917
|
+
"title": "ErroredResult"
|
|
5918
|
+
});
|
|
5919
|
+
export const BetaRequestBashCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5920
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5921
|
+
mode: "oneOf"
|
|
5922
|
+
}), Schema.Null]).annotate({
|
|
5923
|
+
"title": "Cache Control",
|
|
5924
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5925
|
+
})),
|
|
5926
|
+
"content": Schema.Union([BetaRequestBashCodeExecutionToolResultError, BetaRequestBashCodeExecutionResultBlock]).annotate({
|
|
5927
|
+
"title": "Content"
|
|
5928
|
+
}),
|
|
5929
|
+
"tool_use_id": Schema.String.annotate({
|
|
5930
|
+
"title": "Tool Use Id"
|
|
5931
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5932
|
+
"type": Schema.Literal("bash_code_execution_tool_result").annotate({
|
|
5933
|
+
"title": "Type"
|
|
5934
|
+
})
|
|
5935
|
+
}).annotate({
|
|
5936
|
+
"title": "RequestBashCodeExecutionToolResultBlock"
|
|
5937
|
+
});
|
|
5938
|
+
export const BetaRequestCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5939
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5940
|
+
mode: "oneOf"
|
|
5941
|
+
}), Schema.Null]).annotate({
|
|
5942
|
+
"title": "Cache Control",
|
|
5943
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5944
|
+
})),
|
|
5945
|
+
"content": Schema.Union([BetaRequestCodeExecutionToolResultError, BetaRequestCodeExecutionResultBlock, BetaRequestEncryptedCodeExecutionResultBlock]).annotate({
|
|
5946
|
+
"title": "Content"
|
|
5947
|
+
}),
|
|
5948
|
+
"tool_use_id": Schema.String.annotate({
|
|
5949
|
+
"title": "Tool Use Id"
|
|
5950
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5951
|
+
"type": Schema.Literal("code_execution_tool_result").annotate({
|
|
5952
|
+
"title": "Type"
|
|
5953
|
+
})
|
|
5954
|
+
}).annotate({
|
|
5955
|
+
"title": "RequestCodeExecutionToolResultBlock"
|
|
5956
|
+
});
|
|
5957
|
+
export const BetaRequestSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5958
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5959
|
+
mode: "oneOf"
|
|
5960
|
+
}), Schema.Null]).annotate({
|
|
5961
|
+
"title": "Cache Control",
|
|
5962
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
5963
|
+
})),
|
|
5964
|
+
"citations": Schema.optionalKey(BetaRequestCitationsConfig),
|
|
5965
|
+
"content": Schema.Array(BetaRequestTextBlock).annotate({
|
|
5966
|
+
"title": "Content"
|
|
5967
|
+
}),
|
|
5968
|
+
"source": Schema.String.annotate({
|
|
5969
|
+
"title": "Source"
|
|
5970
|
+
}),
|
|
5971
|
+
"title": Schema.String.annotate({
|
|
5972
|
+
"title": "Title"
|
|
5973
|
+
}),
|
|
5974
|
+
"type": Schema.Literal("search_result").annotate({
|
|
5975
|
+
"title": "Type"
|
|
5976
|
+
})
|
|
5977
|
+
}).annotate({
|
|
5978
|
+
"title": "RequestSearchResultBlock"
|
|
5979
|
+
});
|
|
5980
|
+
export const BetaResponseBashCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5981
|
+
"content": Schema.Union([BetaResponseBashCodeExecutionToolResultError, BetaResponseBashCodeExecutionResultBlock]).annotate({
|
|
5982
|
+
"title": "Content"
|
|
5983
|
+
}),
|
|
5984
|
+
"tool_use_id": Schema.String.annotate({
|
|
5985
|
+
"title": "Tool Use Id"
|
|
5986
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5987
|
+
"type": Schema.Literal("bash_code_execution_tool_result").annotate({
|
|
5988
|
+
"title": "Type",
|
|
5989
|
+
"default": "bash_code_execution_tool_result"
|
|
5990
|
+
})
|
|
5991
|
+
}).annotate({
|
|
5992
|
+
"title": "ResponseBashCodeExecutionToolResultBlock"
|
|
5993
|
+
});
|
|
5994
|
+
export const BetaResponseWebFetchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5995
|
+
"content": BetaResponseDocumentBlock,
|
|
5996
|
+
"retrieved_at": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5997
|
+
"title": "Retrieved At",
|
|
5998
|
+
"description": "ISO 8601 timestamp when the content was retrieved",
|
|
5999
|
+
"default": null
|
|
6000
|
+
}),
|
|
6001
|
+
"type": Schema.Literal("web_fetch_result").annotate({
|
|
6002
|
+
"title": "Type",
|
|
6003
|
+
"default": "web_fetch_result"
|
|
6004
|
+
}),
|
|
6005
|
+
"url": Schema.String.annotate({
|
|
6006
|
+
"title": "Url",
|
|
6007
|
+
"description": "Fetched content URL"
|
|
6008
|
+
})
|
|
6009
|
+
}).annotate({
|
|
6010
|
+
"title": "ResponseWebFetchResultBlock"
|
|
6011
|
+
});
|
|
6012
|
+
export const BetaResponseCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6013
|
+
"content": Schema.Union([BetaResponseCodeExecutionToolResultError, BetaResponseCodeExecutionResultBlock, BetaResponseEncryptedCodeExecutionResultBlock]).annotate({
|
|
6014
|
+
"title": "Content"
|
|
6015
|
+
}),
|
|
6016
|
+
"tool_use_id": Schema.String.annotate({
|
|
6017
|
+
"title": "Tool Use Id"
|
|
6018
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6019
|
+
"type": Schema.Literal("code_execution_tool_result").annotate({
|
|
6020
|
+
"title": "Type",
|
|
6021
|
+
"default": "code_execution_tool_result"
|
|
6022
|
+
})
|
|
6023
|
+
}).annotate({
|
|
6024
|
+
"title": "ResponseCodeExecutionToolResultBlock"
|
|
6025
|
+
});
|
|
6026
|
+
export const BetaContentBlockDeltaEvent = /*#__PURE__*/Schema.Struct({
|
|
6027
|
+
"delta": Schema.Union([BetaTextContentBlockDelta, BetaInputJsonContentBlockDelta, BetaCitationsDelta, BetaThinkingContentBlockDelta, BetaSignatureContentBlockDelta, BetaCompactionContentBlockDelta], {
|
|
6028
|
+
mode: "oneOf"
|
|
6029
|
+
}).annotate({
|
|
6030
|
+
"title": "Delta"
|
|
6031
|
+
}),
|
|
6032
|
+
"index": Schema.Number.annotate({
|
|
6033
|
+
"title": "Index"
|
|
6034
|
+
}).check(Schema.isInt()),
|
|
6035
|
+
"type": Schema.Literal("content_block_delta").annotate({
|
|
6036
|
+
"title": "Type",
|
|
6037
|
+
"default": "content_block_delta"
|
|
6038
|
+
})
|
|
6039
|
+
}).annotate({
|
|
6040
|
+
"title": "ContentBlockDeltaEvent"
|
|
6041
|
+
});
|
|
6042
|
+
export const BetaMessageDelta = /*#__PURE__*/Schema.Struct({
|
|
6043
|
+
"container": Schema.optionalKey(Schema.Union([BetaContainer, Schema.Null]).annotate({
|
|
6044
|
+
"description": "Information about the container used in this request.\n\nThis will be non-null if a container tool (e.g. code execution) was used.",
|
|
6045
|
+
"default": null
|
|
6046
|
+
})),
|
|
6047
|
+
"stop_reason": Schema.Union([BetaStopReason, Schema.Null]).annotate({
|
|
6048
|
+
"title": "Stop Reason",
|
|
6049
|
+
"default": null
|
|
6050
|
+
}),
|
|
6051
|
+
"stop_sequence": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6052
|
+
"title": "Stop Sequence",
|
|
6053
|
+
"default": null
|
|
6054
|
+
})
|
|
6055
|
+
}).annotate({
|
|
6056
|
+
"title": "MessageDelta"
|
|
6057
|
+
});
|
|
6058
|
+
export const BetaRequestTextEditorCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6059
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
6060
|
+
mode: "oneOf"
|
|
6061
|
+
}), Schema.Null]).annotate({
|
|
6062
|
+
"title": "Cache Control",
|
|
6063
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
6064
|
+
})),
|
|
6065
|
+
"content": Schema.Union([BetaRequestTextEditorCodeExecutionToolResultError, BetaRequestTextEditorCodeExecutionViewResultBlock, BetaRequestTextEditorCodeExecutionCreateResultBlock, BetaRequestTextEditorCodeExecutionStrReplaceResultBlock]).annotate({
|
|
6066
|
+
"title": "Content"
|
|
6067
|
+
}),
|
|
6068
|
+
"tool_use_id": Schema.String.annotate({
|
|
6069
|
+
"title": "Tool Use Id"
|
|
6070
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6071
|
+
"type": Schema.Literal("text_editor_code_execution_tool_result").annotate({
|
|
6072
|
+
"title": "Type"
|
|
6073
|
+
})
|
|
6074
|
+
}).annotate({
|
|
6075
|
+
"title": "RequestTextEditorCodeExecutionToolResultBlock"
|
|
6076
|
+
});
|
|
6077
|
+
export const BetaResponseTextEditorCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6078
|
+
"content": Schema.Union([BetaResponseTextEditorCodeExecutionToolResultError, BetaResponseTextEditorCodeExecutionViewResultBlock, BetaResponseTextEditorCodeExecutionCreateResultBlock, BetaResponseTextEditorCodeExecutionStrReplaceResultBlock]).annotate({
|
|
6079
|
+
"title": "Content"
|
|
6080
|
+
}),
|
|
6081
|
+
"tool_use_id": Schema.String.annotate({
|
|
6082
|
+
"title": "Tool Use Id"
|
|
6083
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6084
|
+
"type": Schema.Literal("text_editor_code_execution_tool_result").annotate({
|
|
6085
|
+
"title": "Type",
|
|
6086
|
+
"default": "text_editor_code_execution_tool_result"
|
|
6087
|
+
})
|
|
6088
|
+
}).annotate({
|
|
6089
|
+
"title": "ResponseTextEditorCodeExecutionToolResultBlock"
|
|
6090
|
+
});
|
|
6091
|
+
export const BetaResponseToolSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6092
|
+
"content": Schema.Union([BetaResponseToolSearchToolResultError, BetaResponseToolSearchToolSearchResultBlock]).annotate({
|
|
6093
|
+
"title": "Content"
|
|
6094
|
+
}),
|
|
6095
|
+
"tool_use_id": Schema.String.annotate({
|
|
6096
|
+
"title": "Tool Use Id"
|
|
6097
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6098
|
+
"type": Schema.Literal("tool_search_tool_result").annotate({
|
|
6099
|
+
"title": "Type",
|
|
6100
|
+
"default": "tool_search_tool_result"
|
|
6101
|
+
})
|
|
6102
|
+
}).annotate({
|
|
6103
|
+
"title": "ResponseToolSearchToolResultBlock"
|
|
6104
|
+
});
|
|
6105
|
+
export const BetaContextManagementConfig = /*#__PURE__*/Schema.Struct({
|
|
6106
|
+
"edits": Schema.optionalKey(Schema.Array(Schema.Union([BetaClearToolUses20250919, BetaClearThinking20251015, BetaCompact20260112], {
|
|
6107
|
+
mode: "oneOf"
|
|
6108
|
+
})).annotate({
|
|
6109
|
+
"title": "Edits",
|
|
6110
|
+
"description": "List of context management edits to apply"
|
|
6111
|
+
}).check(Schema.isMinLength(0)))
|
|
6112
|
+
}).annotate({
|
|
6113
|
+
"title": "ContextManagementConfig"
|
|
6114
|
+
});
|
|
6115
|
+
export const BetaContentBlockSource = /*#__PURE__*/Schema.Struct({
|
|
6116
|
+
"content": Schema.Union([Schema.String, Schema.Array(Schema.Union([BetaRequestTextBlock, BetaRequestImageBlock], {
|
|
6117
|
+
mode: "oneOf"
|
|
6118
|
+
}).annotate({
|
|
6119
|
+
"title": "beta_content_block_source_content_item"
|
|
6120
|
+
})).annotate({
|
|
6121
|
+
"title": "beta_content_block_source_content"
|
|
6122
|
+
})]).annotate({
|
|
6123
|
+
"title": "Content"
|
|
6124
|
+
}),
|
|
6125
|
+
"type": Schema.Literal("content").annotate({
|
|
6126
|
+
"title": "Type"
|
|
6127
|
+
})
|
|
6128
|
+
}).annotate({
|
|
6129
|
+
"title": "ContentBlockSource"
|
|
6130
|
+
});
|
|
6131
|
+
export const BetaRequestWebSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6132
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
6133
|
+
mode: "oneOf"
|
|
6134
|
+
}), Schema.Null]).annotate({
|
|
6135
|
+
"title": "Cache Control",
|
|
6136
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4748
6137
|
})),
|
|
4749
|
-
"
|
|
4750
|
-
|
|
4751
|
-
"description": "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic."
|
|
4752
|
-
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
4753
|
-
"top_p": Schema.optionalKey(Schema.Number.annotate({
|
|
4754
|
-
"title": "Top P",
|
|
4755
|
-
"description": "Use nucleus sampling.\n\nIn nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.\n\nRecommended for advanced use cases only. You usually only need to use `temperature`."
|
|
4756
|
-
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
4757
|
-
"top_k": Schema.optionalKey(Schema.Number.annotate({
|
|
4758
|
-
"title": "Top K",
|
|
4759
|
-
"description": "Only sample from the top K options for each subsequent token.\n\nUsed to remove \"long tail\" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).\n\nRecommended for advanced use cases only. You usually only need to use `temperature`."
|
|
4760
|
-
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0))),
|
|
4761
|
-
"metadata": Schema.optionalKey(Schema.Struct({
|
|
4762
|
-
"user_id": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxLength(256)), Schema.Null]).annotate({
|
|
4763
|
-
"title": "User Id",
|
|
4764
|
-
"description": "An external identifier for the user who is associated with the request.\n\nThis should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number."
|
|
4765
|
-
}))
|
|
6138
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
6139
|
+
mode: "oneOf"
|
|
4766
6140
|
}).annotate({
|
|
4767
|
-
"title": "
|
|
4768
|
-
"description": "An object describing metadata about the request."
|
|
6141
|
+
"title": "Caller"
|
|
4769
6142
|
})),
|
|
4770
|
-
"
|
|
4771
|
-
"title": "
|
|
4772
|
-
|
|
4773
|
-
|
|
6143
|
+
"content": Schema.Union([Schema.Array(BetaRequestWebSearchResultBlock).annotate({
|
|
6144
|
+
"title": "Result Block"
|
|
6145
|
+
}), BetaRequestWebSearchToolResultError]).annotate({
|
|
6146
|
+
"title": "Content"
|
|
6147
|
+
}),
|
|
6148
|
+
"tool_use_id": Schema.String.annotate({
|
|
6149
|
+
"title": "Tool Use Id"
|
|
6150
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6151
|
+
"type": Schema.Literal("web_search_tool_result").annotate({
|
|
6152
|
+
"title": "Type"
|
|
6153
|
+
})
|
|
4774
6154
|
}).annotate({
|
|
4775
|
-
"title": "
|
|
6155
|
+
"title": "RequestWebSearchToolResultBlock"
|
|
4776
6156
|
});
|
|
4777
|
-
export const
|
|
4778
|
-
"
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
"
|
|
4785
|
-
}),
|
|
4786
|
-
"model": Model,
|
|
4787
|
-
"stop_reason": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
4788
|
-
"title": "Stop Reason",
|
|
4789
|
-
"description": "The reason that we stopped.\n\nThis may be one the following values:\n* `\"stop_sequence\"`: we reached a stop sequence — either provided by you via the `stop_sequences` parameter, or a stop sequence built into the model\n* `\"max_tokens\"`: we exceeded `max_tokens_to_sample` or the model's maximum"
|
|
6157
|
+
export const BetaResponseWebSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6158
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
6159
|
+
mode: "oneOf"
|
|
6160
|
+
}).annotate({
|
|
6161
|
+
"title": "Caller"
|
|
6162
|
+
})),
|
|
6163
|
+
"content": Schema.Union([BetaResponseWebSearchToolResultError, Schema.Array(BetaResponseWebSearchResultBlock)]).annotate({
|
|
6164
|
+
"title": "Content"
|
|
4790
6165
|
}),
|
|
4791
|
-
"
|
|
6166
|
+
"tool_use_id": Schema.String.annotate({
|
|
6167
|
+
"title": "Tool Use Id"
|
|
6168
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6169
|
+
"type": Schema.Literal("web_search_tool_result").annotate({
|
|
4792
6170
|
"title": "Type",
|
|
4793
|
-
"
|
|
4794
|
-
"default": "completion"
|
|
6171
|
+
"default": "web_search_tool_result"
|
|
4795
6172
|
})
|
|
4796
6173
|
}).annotate({
|
|
4797
|
-
"title": "
|
|
6174
|
+
"title": "ResponseWebSearchToolResultBlock"
|
|
4798
6175
|
});
|
|
4799
|
-
export const
|
|
4800
|
-
"tool_references": Schema.Array(
|
|
6176
|
+
export const RequestToolSearchToolSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6177
|
+
"tool_references": Schema.Array(RequestToolReferenceBlock).annotate({
|
|
4801
6178
|
"title": "Tool References"
|
|
4802
6179
|
}),
|
|
4803
6180
|
"type": Schema.Literal("tool_search_tool_search_result").annotate({
|
|
@@ -4806,13 +6183,8 @@ export const BetaRequestToolSearchToolSearchResultBlock = /*#__PURE__*/Schema.St
|
|
|
4806
6183
|
}).annotate({
|
|
4807
6184
|
"title": "RequestToolSearchToolSearchResultBlock"
|
|
4808
6185
|
});
|
|
4809
|
-
export const
|
|
4810
|
-
"
|
|
4811
|
-
"description": "Per-iteration token usage breakdown.\n\nEach entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:\n- Determine which iterations exceeded long context thresholds (>=200k tokens)\n- Calculate the true context window size from the last iteration\n- Understand token accumulation across server-side tool use loops",
|
|
4812
|
-
"default": null
|
|
4813
|
-
});
|
|
4814
|
-
export const BetaErroredResult = /*#__PURE__*/Schema.Struct({
|
|
4815
|
-
"error": BetaErrorResponse,
|
|
6186
|
+
export const ErroredResult = /*#__PURE__*/Schema.Struct({
|
|
6187
|
+
"error": ErrorResponse,
|
|
4816
6188
|
"type": Schema.Literal("errored").annotate({
|
|
4817
6189
|
"title": "Type",
|
|
4818
6190
|
"default": "errored"
|
|
@@ -4820,14 +6192,14 @@ export const BetaErroredResult = /*#__PURE__*/Schema.Struct({
|
|
|
4820
6192
|
}).annotate({
|
|
4821
6193
|
"title": "ErroredResult"
|
|
4822
6194
|
});
|
|
4823
|
-
export const
|
|
4824
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
6195
|
+
export const RequestBashCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6196
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4825
6197
|
mode: "oneOf"
|
|
4826
6198
|
}), Schema.Null]).annotate({
|
|
4827
6199
|
"title": "Cache Control",
|
|
4828
6200
|
"description": "Create a cache control breakpoint at this content block."
|
|
4829
6201
|
})),
|
|
4830
|
-
"content": Schema.Union([
|
|
6202
|
+
"content": Schema.Union([RequestBashCodeExecutionToolResultError, RequestBashCodeExecutionResultBlock]).annotate({
|
|
4831
6203
|
"title": "Content"
|
|
4832
6204
|
}),
|
|
4833
6205
|
"tool_use_id": Schema.String.annotate({
|
|
@@ -4839,14 +6211,14 @@ export const BetaRequestBashCodeExecutionToolResultBlock = /*#__PURE__*/Schema.S
|
|
|
4839
6211
|
}).annotate({
|
|
4840
6212
|
"title": "RequestBashCodeExecutionToolResultBlock"
|
|
4841
6213
|
});
|
|
4842
|
-
export const
|
|
4843
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
6214
|
+
export const RequestCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6215
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4844
6216
|
mode: "oneOf"
|
|
4845
6217
|
}), Schema.Null]).annotate({
|
|
4846
6218
|
"title": "Cache Control",
|
|
4847
6219
|
"description": "Create a cache control breakpoint at this content block."
|
|
4848
6220
|
})),
|
|
4849
|
-
"content": Schema.Union([
|
|
6221
|
+
"content": Schema.Union([RequestCodeExecutionToolResultError, RequestCodeExecutionResultBlock, RequestEncryptedCodeExecutionResultBlock]).annotate({
|
|
4850
6222
|
"title": "Content"
|
|
4851
6223
|
}),
|
|
4852
6224
|
"tool_use_id": Schema.String.annotate({
|
|
@@ -4858,15 +6230,15 @@ export const BetaRequestCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struc
|
|
|
4858
6230
|
}).annotate({
|
|
4859
6231
|
"title": "RequestCodeExecutionToolResultBlock"
|
|
4860
6232
|
});
|
|
4861
|
-
export const
|
|
4862
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
6233
|
+
export const RequestSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6234
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
4863
6235
|
mode: "oneOf"
|
|
4864
6236
|
}), Schema.Null]).annotate({
|
|
4865
6237
|
"title": "Cache Control",
|
|
4866
6238
|
"description": "Create a cache control breakpoint at this content block."
|
|
4867
6239
|
})),
|
|
4868
|
-
"citations": Schema.optionalKey(
|
|
4869
|
-
"content": Schema.Array(
|
|
6240
|
+
"citations": Schema.optionalKey(RequestCitationsConfig),
|
|
6241
|
+
"content": Schema.Array(RequestTextBlock).annotate({
|
|
4870
6242
|
"title": "Content"
|
|
4871
6243
|
}),
|
|
4872
6244
|
"source": Schema.String.annotate({
|
|
@@ -4881,8 +6253,8 @@ export const BetaRequestSearchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
|
4881
6253
|
}).annotate({
|
|
4882
6254
|
"title": "RequestSearchResultBlock"
|
|
4883
6255
|
});
|
|
4884
|
-
export const
|
|
4885
|
-
"content": Schema.Union([
|
|
6256
|
+
export const ResponseBashCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6257
|
+
"content": Schema.Union([ResponseBashCodeExecutionToolResultError, ResponseBashCodeExecutionResultBlock]).annotate({
|
|
4886
6258
|
"title": "Content"
|
|
4887
6259
|
}),
|
|
4888
6260
|
"tool_use_id": Schema.String.annotate({
|
|
@@ -4895,8 +6267,8 @@ export const BetaResponseBashCodeExecutionToolResultBlock = /*#__PURE__*/Schema.
|
|
|
4895
6267
|
}).annotate({
|
|
4896
6268
|
"title": "ResponseBashCodeExecutionToolResultBlock"
|
|
4897
6269
|
});
|
|
4898
|
-
export const
|
|
4899
|
-
"content":
|
|
6270
|
+
export const ResponseWebFetchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6271
|
+
"content": ResponseDocumentBlock,
|
|
4900
6272
|
"retrieved_at": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
4901
6273
|
"title": "Retrieved At",
|
|
4902
6274
|
"description": "ISO 8601 timestamp when the content was retrieved",
|
|
@@ -4913,8 +6285,8 @@ export const BetaResponseWebFetchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
|
4913
6285
|
}).annotate({
|
|
4914
6286
|
"title": "ResponseWebFetchResultBlock"
|
|
4915
6287
|
});
|
|
4916
|
-
export const
|
|
4917
|
-
"content": Schema.Union([
|
|
6288
|
+
export const ResponseCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6289
|
+
"content": Schema.Union([ResponseCodeExecutionToolResultError, ResponseCodeExecutionResultBlock, ResponseEncryptedCodeExecutionResultBlock]).annotate({
|
|
4918
6290
|
"title": "Content"
|
|
4919
6291
|
}),
|
|
4920
6292
|
"tool_use_id": Schema.String.annotate({
|
|
@@ -4927,8 +6299,8 @@ export const BetaResponseCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Stru
|
|
|
4927
6299
|
}).annotate({
|
|
4928
6300
|
"title": "ResponseCodeExecutionToolResultBlock"
|
|
4929
6301
|
});
|
|
4930
|
-
export const
|
|
4931
|
-
"delta": Schema.Union([
|
|
6302
|
+
export const ContentBlockDeltaEvent = /*#__PURE__*/Schema.Struct({
|
|
6303
|
+
"delta": Schema.Union([TextContentBlockDelta, InputJsonContentBlockDelta, CitationsDelta, ThinkingContentBlockDelta, SignatureContentBlockDelta], {
|
|
4932
6304
|
mode: "oneOf"
|
|
4933
6305
|
}).annotate({
|
|
4934
6306
|
"title": "Delta"
|
|
@@ -4943,453 +6315,632 @@ export const BetaContentBlockDeltaEvent = /*#__PURE__*/Schema.Struct({
|
|
|
4943
6315
|
}).annotate({
|
|
4944
6316
|
"title": "ContentBlockDeltaEvent"
|
|
4945
6317
|
});
|
|
4946
|
-
export const
|
|
4947
|
-
"
|
|
4948
|
-
|
|
4949
|
-
|
|
6318
|
+
export const RequestTextEditorCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6319
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
6320
|
+
mode: "oneOf"
|
|
6321
|
+
}), Schema.Null]).annotate({
|
|
6322
|
+
"title": "Cache Control",
|
|
6323
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
4950
6324
|
})),
|
|
4951
|
-
"
|
|
4952
|
-
"title": "
|
|
4953
|
-
"default": null
|
|
6325
|
+
"content": Schema.Union([RequestTextEditorCodeExecutionToolResultError, RequestTextEditorCodeExecutionViewResultBlock, RequestTextEditorCodeExecutionCreateResultBlock, RequestTextEditorCodeExecutionStrReplaceResultBlock]).annotate({
|
|
6326
|
+
"title": "Content"
|
|
4954
6327
|
}),
|
|
4955
|
-
"
|
|
4956
|
-
"title": "
|
|
4957
|
-
|
|
6328
|
+
"tool_use_id": Schema.String.annotate({
|
|
6329
|
+
"title": "Tool Use Id"
|
|
6330
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6331
|
+
"type": Schema.Literal("text_editor_code_execution_tool_result").annotate({
|
|
6332
|
+
"title": "Type"
|
|
4958
6333
|
})
|
|
4959
6334
|
}).annotate({
|
|
4960
|
-
"title": "
|
|
6335
|
+
"title": "RequestTextEditorCodeExecutionToolResultBlock"
|
|
4961
6336
|
});
|
|
4962
|
-
export const
|
|
6337
|
+
export const ResponseTextEditorCodeExecutionToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6338
|
+
"content": Schema.Union([ResponseTextEditorCodeExecutionToolResultError, ResponseTextEditorCodeExecutionViewResultBlock, ResponseTextEditorCodeExecutionCreateResultBlock, ResponseTextEditorCodeExecutionStrReplaceResultBlock]).annotate({
|
|
6339
|
+
"title": "Content"
|
|
6340
|
+
}),
|
|
6341
|
+
"tool_use_id": Schema.String.annotate({
|
|
6342
|
+
"title": "Tool Use Id"
|
|
6343
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6344
|
+
"type": Schema.Literal("text_editor_code_execution_tool_result").annotate({
|
|
6345
|
+
"title": "Type",
|
|
6346
|
+
"default": "text_editor_code_execution_tool_result"
|
|
6347
|
+
})
|
|
6348
|
+
}).annotate({
|
|
6349
|
+
"title": "ResponseTextEditorCodeExecutionToolResultBlock"
|
|
6350
|
+
});
|
|
6351
|
+
export const ResponseToolSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6352
|
+
"content": Schema.Union([ResponseToolSearchToolResultError, ResponseToolSearchToolSearchResultBlock]).annotate({
|
|
6353
|
+
"title": "Content"
|
|
6354
|
+
}),
|
|
6355
|
+
"tool_use_id": Schema.String.annotate({
|
|
6356
|
+
"title": "Tool Use Id"
|
|
6357
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6358
|
+
"type": Schema.Literal("tool_search_tool_result").annotate({
|
|
6359
|
+
"title": "Type",
|
|
6360
|
+
"default": "tool_search_tool_result"
|
|
6361
|
+
})
|
|
6362
|
+
}).annotate({
|
|
6363
|
+
"title": "ResponseToolSearchToolResultBlock"
|
|
6364
|
+
});
|
|
6365
|
+
export const ContentBlockSource = /*#__PURE__*/Schema.Struct({
|
|
6366
|
+
"content": Schema.Union([Schema.String, Schema.Array(Schema.Union([RequestTextBlock, RequestImageBlock], {
|
|
6367
|
+
mode: "oneOf"
|
|
6368
|
+
}).annotate({
|
|
6369
|
+
"title": "content_block_source_content_item"
|
|
6370
|
+
})).annotate({
|
|
6371
|
+
"title": "content_block_source_content"
|
|
6372
|
+
})]).annotate({
|
|
6373
|
+
"title": "Content"
|
|
6374
|
+
}),
|
|
6375
|
+
"type": Schema.Literal("content").annotate({
|
|
6376
|
+
"title": "Type"
|
|
6377
|
+
})
|
|
6378
|
+
}).annotate({
|
|
6379
|
+
"title": "ContentBlockSource"
|
|
6380
|
+
});
|
|
6381
|
+
export const RequestWebSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6382
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
6383
|
+
mode: "oneOf"
|
|
6384
|
+
}), Schema.Null]).annotate({
|
|
6385
|
+
"title": "Cache Control",
|
|
6386
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
6387
|
+
})),
|
|
6388
|
+
"caller": Schema.optionalKey(Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
6389
|
+
mode: "oneOf"
|
|
6390
|
+
}).annotate({
|
|
6391
|
+
"title": "Caller"
|
|
6392
|
+
})),
|
|
6393
|
+
"content": Schema.Union([Schema.Array(RequestWebSearchResultBlock).annotate({
|
|
6394
|
+
"title": "web_search_tool_result_block_item"
|
|
6395
|
+
}), RequestWebSearchToolResultError]).annotate({
|
|
6396
|
+
"title": "Content"
|
|
6397
|
+
}),
|
|
6398
|
+
"tool_use_id": Schema.String.annotate({
|
|
6399
|
+
"title": "Tool Use Id"
|
|
6400
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6401
|
+
"type": Schema.Literal("web_search_tool_result").annotate({
|
|
6402
|
+
"title": "Type"
|
|
6403
|
+
})
|
|
6404
|
+
}).annotate({
|
|
6405
|
+
"title": "RequestWebSearchToolResultBlock"
|
|
6406
|
+
});
|
|
6407
|
+
export const ResponseWebSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6408
|
+
"caller": Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
6409
|
+
mode: "oneOf"
|
|
6410
|
+
}).annotate({
|
|
6411
|
+
"title": "Caller",
|
|
6412
|
+
"default": {
|
|
6413
|
+
"type": "direct"
|
|
6414
|
+
}
|
|
6415
|
+
}),
|
|
6416
|
+
"content": Schema.Union([ResponseWebSearchToolResultError, Schema.Array(ResponseWebSearchResultBlock)]).annotate({
|
|
6417
|
+
"title": "Content"
|
|
6418
|
+
}),
|
|
6419
|
+
"tool_use_id": Schema.String.annotate({
|
|
6420
|
+
"title": "Tool Use Id"
|
|
6421
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6422
|
+
"type": Schema.Literal("web_search_tool_result").annotate({
|
|
6423
|
+
"title": "Type",
|
|
6424
|
+
"default": "web_search_tool_result"
|
|
6425
|
+
})
|
|
6426
|
+
}).annotate({
|
|
6427
|
+
"title": "ResponseWebSearchToolResultBlock"
|
|
6428
|
+
});
|
|
6429
|
+
export const MessageDeltaEvent = /*#__PURE__*/Schema.Struct({
|
|
6430
|
+
"delta": MessageDelta,
|
|
6431
|
+
"type": Schema.Literal("message_delta").annotate({
|
|
6432
|
+
"title": "Type",
|
|
6433
|
+
"default": "message_delta"
|
|
6434
|
+
}),
|
|
6435
|
+
"usage": Schema.Struct({
|
|
6436
|
+
"cache_creation_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
6437
|
+
"title": "Cache Creation Input Tokens",
|
|
6438
|
+
"description": "The cumulative number of input tokens used to create the cache entry.",
|
|
6439
|
+
"default": null
|
|
6440
|
+
}),
|
|
6441
|
+
"cache_read_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
6442
|
+
"title": "Cache Read Input Tokens",
|
|
6443
|
+
"description": "The cumulative number of input tokens read from the cache.",
|
|
6444
|
+
"default": null
|
|
6445
|
+
}),
|
|
6446
|
+
"input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
6447
|
+
"title": "Input Tokens",
|
|
6448
|
+
"description": "The cumulative number of input tokens which were used.",
|
|
6449
|
+
"default": null
|
|
6450
|
+
}),
|
|
6451
|
+
"output_tokens": Schema.Number.annotate({
|
|
6452
|
+
"title": "Output Tokens",
|
|
6453
|
+
"description": "The cumulative number of output tokens which were used."
|
|
6454
|
+
}).check(Schema.isInt()),
|
|
6455
|
+
"server_tool_use": Schema.optionalKey(Schema.Union([ServerToolUsage, Schema.Null]).annotate({
|
|
6456
|
+
"description": "The number of server tool requests.",
|
|
6457
|
+
"default": null
|
|
6458
|
+
}))
|
|
6459
|
+
}).annotate({
|
|
6460
|
+
"title": "MessageDeltaUsage",
|
|
6461
|
+
"description": "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude.\n\nTotal input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`."
|
|
6462
|
+
})
|
|
6463
|
+
}).annotate({
|
|
6464
|
+
"title": "MessageDeltaEvent"
|
|
6465
|
+
});
|
|
6466
|
+
export const BetaRequestToolSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
4963
6467
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
4964
6468
|
mode: "oneOf"
|
|
4965
6469
|
}), Schema.Null]).annotate({
|
|
4966
6470
|
"title": "Cache Control",
|
|
4967
6471
|
"description": "Create a cache control breakpoint at this content block."
|
|
4968
6472
|
})),
|
|
4969
|
-
"content": Schema.Union([
|
|
6473
|
+
"content": Schema.Union([BetaRequestToolSearchToolResultError, BetaRequestToolSearchToolSearchResultBlock]).annotate({
|
|
4970
6474
|
"title": "Content"
|
|
4971
6475
|
}),
|
|
4972
6476
|
"tool_use_id": Schema.String.annotate({
|
|
4973
6477
|
"title": "Tool Use Id"
|
|
4974
6478
|
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
4975
|
-
"type": Schema.Literal("
|
|
6479
|
+
"type": Schema.Literal("tool_search_tool_result").annotate({
|
|
4976
6480
|
"title": "Type"
|
|
4977
6481
|
})
|
|
4978
6482
|
}).annotate({
|
|
4979
|
-
"title": "
|
|
6483
|
+
"title": "RequestToolSearchToolResultBlock"
|
|
4980
6484
|
});
|
|
4981
|
-
export const
|
|
4982
|
-
"
|
|
6485
|
+
export const BetaResponseWebFetchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6486
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
6487
|
+
mode: "oneOf"
|
|
6488
|
+
}).annotate({
|
|
6489
|
+
"title": "Caller"
|
|
6490
|
+
})),
|
|
6491
|
+
"content": Schema.Union([BetaResponseWebFetchToolResultError, BetaResponseWebFetchResultBlock]).annotate({
|
|
4983
6492
|
"title": "Content"
|
|
4984
6493
|
}),
|
|
4985
6494
|
"tool_use_id": Schema.String.annotate({
|
|
4986
6495
|
"title": "Tool Use Id"
|
|
4987
6496
|
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
4988
|
-
"type": Schema.Literal("
|
|
6497
|
+
"type": Schema.Literal("web_fetch_tool_result").annotate({
|
|
4989
6498
|
"title": "Type",
|
|
4990
|
-
"default": "
|
|
6499
|
+
"default": "web_fetch_tool_result"
|
|
4991
6500
|
})
|
|
4992
6501
|
}).annotate({
|
|
4993
|
-
"title": "
|
|
6502
|
+
"title": "ResponseWebFetchToolResultBlock"
|
|
4994
6503
|
});
|
|
4995
|
-
export const
|
|
4996
|
-
"
|
|
4997
|
-
"
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
"type": Schema.Literal("tool_search_tool_result").annotate({
|
|
6504
|
+
export const BetaMessageDeltaEvent = /*#__PURE__*/Schema.Struct({
|
|
6505
|
+
"context_management": Schema.optionalKey(Schema.Union([BetaResponseContextManagement, Schema.Null]).annotate({
|
|
6506
|
+
"description": "Information about context management strategies applied during the request",
|
|
6507
|
+
"default": null
|
|
6508
|
+
})),
|
|
6509
|
+
"delta": BetaMessageDelta,
|
|
6510
|
+
"type": Schema.Literal("message_delta").annotate({
|
|
5003
6511
|
"title": "Type",
|
|
5004
|
-
"default": "
|
|
6512
|
+
"default": "message_delta"
|
|
6513
|
+
}),
|
|
6514
|
+
"usage": Schema.Struct({
|
|
6515
|
+
"cache_creation_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
6516
|
+
"title": "Cache Creation Input Tokens",
|
|
6517
|
+
"description": "The cumulative number of input tokens used to create the cache entry.",
|
|
6518
|
+
"default": null
|
|
6519
|
+
}),
|
|
6520
|
+
"cache_read_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
6521
|
+
"title": "Cache Read Input Tokens",
|
|
6522
|
+
"description": "The cumulative number of input tokens read from the cache.",
|
|
6523
|
+
"default": null
|
|
6524
|
+
}),
|
|
6525
|
+
"input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
6526
|
+
"title": "Input Tokens",
|
|
6527
|
+
"description": "The cumulative number of input tokens which were used.",
|
|
6528
|
+
"default": null
|
|
6529
|
+
}),
|
|
6530
|
+
"iterations": Schema.optionalKey(BetaIterationsUsage),
|
|
6531
|
+
"output_tokens": Schema.Number.annotate({
|
|
6532
|
+
"title": "Output Tokens",
|
|
6533
|
+
"description": "The cumulative number of output tokens which were used."
|
|
6534
|
+
}).check(Schema.isInt()),
|
|
6535
|
+
"server_tool_use": Schema.optionalKey(Schema.Union([BetaServerToolUsage, Schema.Null]).annotate({
|
|
6536
|
+
"description": "The number of server tool requests.",
|
|
6537
|
+
"default": null
|
|
6538
|
+
}))
|
|
6539
|
+
}).annotate({
|
|
6540
|
+
"title": "MessageDeltaUsage",
|
|
6541
|
+
"description": "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude.\n\nTotal input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`."
|
|
5005
6542
|
})
|
|
5006
6543
|
}).annotate({
|
|
5007
|
-
"title": "
|
|
6544
|
+
"title": "MessageDeltaEvent"
|
|
5008
6545
|
});
|
|
5009
|
-
export const
|
|
5010
|
-
"
|
|
6546
|
+
export const BetaRequestDocumentBlock = /*#__PURE__*/Schema.Struct({
|
|
6547
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5011
6548
|
mode: "oneOf"
|
|
5012
|
-
})).annotate({
|
|
5013
|
-
"title": "
|
|
5014
|
-
"description": "
|
|
5015
|
-
})
|
|
5016
|
-
|
|
5017
|
-
"
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
"
|
|
6549
|
+
}), Schema.Null]).annotate({
|
|
6550
|
+
"title": "Cache Control",
|
|
6551
|
+
"description": "Create a cache control breakpoint at this content block."
|
|
6552
|
+
})),
|
|
6553
|
+
"citations": Schema.optionalKey(Schema.Union([BetaRequestCitationsConfig, Schema.Null])),
|
|
6554
|
+
"context": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)), Schema.Null]).annotate({
|
|
6555
|
+
"title": "Context"
|
|
6556
|
+
})),
|
|
6557
|
+
"source": Schema.Union([BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource, BetaURLPDFSource, BetaFileDocumentSource], {
|
|
5021
6558
|
mode: "oneOf"
|
|
5022
6559
|
}).annotate({
|
|
5023
|
-
"title": "
|
|
5024
|
-
})).annotate({
|
|
5025
|
-
"title": "beta_content_block_source_content"
|
|
5026
|
-
})]).annotate({
|
|
5027
|
-
"title": "Content"
|
|
6560
|
+
"title": "Source"
|
|
5028
6561
|
}),
|
|
5029
|
-
"
|
|
6562
|
+
"title": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)).check(Schema.isMaxLength(500)), Schema.Null]).annotate({
|
|
6563
|
+
"title": "Title"
|
|
6564
|
+
})),
|
|
6565
|
+
"type": Schema.Literal("document").annotate({
|
|
5030
6566
|
"title": "Type"
|
|
5031
6567
|
})
|
|
5032
6568
|
}).annotate({
|
|
5033
|
-
"title": "
|
|
6569
|
+
"title": "RequestDocumentBlock"
|
|
5034
6570
|
});
|
|
5035
|
-
export const
|
|
5036
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
6571
|
+
export const RequestToolSearchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6572
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5037
6573
|
mode: "oneOf"
|
|
5038
6574
|
}), Schema.Null]).annotate({
|
|
5039
6575
|
"title": "Cache Control",
|
|
5040
6576
|
"description": "Create a cache control breakpoint at this content block."
|
|
5041
6577
|
})),
|
|
5042
|
-
"content": Schema.Union([
|
|
5043
|
-
"title": "Result Block"
|
|
5044
|
-
}), BetaRequestWebSearchToolResultError]).annotate({
|
|
6578
|
+
"content": Schema.Union([RequestToolSearchToolResultError, RequestToolSearchToolSearchResultBlock]).annotate({
|
|
5045
6579
|
"title": "Content"
|
|
5046
6580
|
}),
|
|
5047
6581
|
"tool_use_id": Schema.String.annotate({
|
|
5048
6582
|
"title": "Tool Use Id"
|
|
5049
6583
|
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5050
|
-
"type": Schema.Literal("
|
|
6584
|
+
"type": Schema.Literal("tool_search_tool_result").annotate({
|
|
5051
6585
|
"title": "Type"
|
|
5052
6586
|
})
|
|
5053
6587
|
}).annotate({
|
|
5054
|
-
"title": "
|
|
6588
|
+
"title": "RequestToolSearchToolResultBlock"
|
|
5055
6589
|
});
|
|
5056
|
-
export const
|
|
5057
|
-
"
|
|
6590
|
+
export const ResponseWebFetchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6591
|
+
"caller": Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
6592
|
+
mode: "oneOf"
|
|
6593
|
+
}).annotate({
|
|
6594
|
+
"title": "Caller",
|
|
6595
|
+
"default": {
|
|
6596
|
+
"type": "direct"
|
|
6597
|
+
}
|
|
6598
|
+
}),
|
|
6599
|
+
"content": Schema.Union([ResponseWebFetchToolResultError, ResponseWebFetchResultBlock]).annotate({
|
|
5058
6600
|
"title": "Content"
|
|
5059
6601
|
}),
|
|
5060
6602
|
"tool_use_id": Schema.String.annotate({
|
|
5061
6603
|
"title": "Tool Use Id"
|
|
5062
6604
|
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5063
|
-
"type": Schema.Literal("
|
|
5064
|
-
"title": "Type",
|
|
5065
|
-
"default": "web_search_tool_result"
|
|
5066
|
-
})
|
|
5067
|
-
}).annotate({
|
|
5068
|
-
"title": "ResponseWebSearchToolResultBlock"
|
|
5069
|
-
});
|
|
5070
|
-
export const ErroredResult = /*#__PURE__*/Schema.Struct({
|
|
5071
|
-
"error": ErrorResponse,
|
|
5072
|
-
"type": Schema.Literal("errored").annotate({
|
|
6605
|
+
"type": Schema.Literal("web_fetch_tool_result").annotate({
|
|
5073
6606
|
"title": "Type",
|
|
5074
|
-
"default": "
|
|
6607
|
+
"default": "web_fetch_tool_result"
|
|
5075
6608
|
})
|
|
5076
6609
|
}).annotate({
|
|
5077
|
-
"title": "
|
|
6610
|
+
"title": "ResponseWebFetchToolResultBlock"
|
|
5078
6611
|
});
|
|
5079
|
-
export const
|
|
6612
|
+
export const RequestDocumentBlock = /*#__PURE__*/Schema.Struct({
|
|
5080
6613
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5081
6614
|
mode: "oneOf"
|
|
5082
6615
|
}), Schema.Null]).annotate({
|
|
5083
6616
|
"title": "Cache Control",
|
|
5084
6617
|
"description": "Create a cache control breakpoint at this content block."
|
|
5085
6618
|
})),
|
|
5086
|
-
"citations": Schema.optionalKey(RequestCitationsConfig),
|
|
5087
|
-
"
|
|
5088
|
-
"title": "
|
|
5089
|
-
}),
|
|
5090
|
-
"source": Schema.
|
|
6619
|
+
"citations": Schema.optionalKey(Schema.Union([RequestCitationsConfig, Schema.Null])),
|
|
6620
|
+
"context": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)), Schema.Null]).annotate({
|
|
6621
|
+
"title": "Context"
|
|
6622
|
+
})),
|
|
6623
|
+
"source": Schema.Union([Base64PDFSource, PlainTextSource, ContentBlockSource, URLPDFSource], {
|
|
6624
|
+
mode: "oneOf"
|
|
6625
|
+
}).annotate({
|
|
5091
6626
|
"title": "Source"
|
|
5092
6627
|
}),
|
|
5093
|
-
"title": Schema.String.annotate({
|
|
6628
|
+
"title": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)).check(Schema.isMaxLength(500)), Schema.Null]).annotate({
|
|
5094
6629
|
"title": "Title"
|
|
5095
|
-
}),
|
|
5096
|
-
"type": Schema.Literal("
|
|
6630
|
+
})),
|
|
6631
|
+
"type": Schema.Literal("document").annotate({
|
|
5097
6632
|
"title": "Type"
|
|
5098
6633
|
})
|
|
5099
6634
|
}).annotate({
|
|
5100
|
-
"title": "
|
|
6635
|
+
"title": "RequestDocumentBlock"
|
|
5101
6636
|
});
|
|
5102
|
-
export const
|
|
5103
|
-
"
|
|
6637
|
+
export const BetaContentBlockStartEvent = /*#__PURE__*/Schema.Struct({
|
|
6638
|
+
"content_block": Schema.Union([BetaResponseTextBlock, BetaResponseThinkingBlock, BetaResponseRedactedThinkingBlock, BetaResponseToolUseBlock, BetaResponseServerToolUseBlock, BetaResponseWebSearchToolResultBlock, BetaResponseWebFetchToolResultBlock, BetaResponseCodeExecutionToolResultBlock, BetaResponseBashCodeExecutionToolResultBlock, BetaResponseTextEditorCodeExecutionToolResultBlock, BetaResponseToolSearchToolResultBlock, BetaResponseMCPToolUseBlock, BetaResponseMCPToolResultBlock, BetaResponseContainerUploadBlock, BetaResponseCompactionBlock], {
|
|
5104
6639
|
mode: "oneOf"
|
|
5105
6640
|
}).annotate({
|
|
5106
|
-
"title": "
|
|
6641
|
+
"title": "Content Block"
|
|
5107
6642
|
}),
|
|
5108
6643
|
"index": Schema.Number.annotate({
|
|
5109
6644
|
"title": "Index"
|
|
5110
6645
|
}).check(Schema.isInt()),
|
|
5111
|
-
"type": Schema.Literal("
|
|
6646
|
+
"type": Schema.Literal("content_block_start").annotate({
|
|
5112
6647
|
"title": "Type",
|
|
5113
|
-
"default": "
|
|
6648
|
+
"default": "content_block_start"
|
|
5114
6649
|
})
|
|
5115
6650
|
}).annotate({
|
|
5116
|
-
"title": "
|
|
6651
|
+
"title": "ContentBlockStartEvent"
|
|
5117
6652
|
});
|
|
5118
|
-
export const
|
|
5119
|
-
"
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
"title": "
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
"type": Schema.Literal("content").annotate({
|
|
6653
|
+
export const BetaContentBlock = /*#__PURE__*/Schema.Union([BetaResponseTextBlock, BetaResponseThinkingBlock, BetaResponseRedactedThinkingBlock, BetaResponseToolUseBlock, BetaResponseServerToolUseBlock, BetaResponseWebSearchToolResultBlock, BetaResponseWebFetchToolResultBlock, BetaResponseCodeExecutionToolResultBlock, BetaResponseBashCodeExecutionToolResultBlock, BetaResponseTextEditorCodeExecutionToolResultBlock, BetaResponseToolSearchToolResultBlock, BetaResponseMCPToolUseBlock, BetaResponseMCPToolResultBlock, BetaResponseContainerUploadBlock, BetaResponseCompactionBlock], {
|
|
6654
|
+
mode: "oneOf"
|
|
6655
|
+
});
|
|
6656
|
+
export const BetaRequestWebFetchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6657
|
+
"content": BetaRequestDocumentBlock,
|
|
6658
|
+
"retrieved_at": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6659
|
+
"title": "Retrieved At",
|
|
6660
|
+
"description": "ISO 8601 timestamp when the content was retrieved"
|
|
6661
|
+
})),
|
|
6662
|
+
"type": Schema.Literal("web_fetch_result").annotate({
|
|
5129
6663
|
"title": "Type"
|
|
6664
|
+
}),
|
|
6665
|
+
"url": Schema.String.annotate({
|
|
6666
|
+
"title": "Url",
|
|
6667
|
+
"description": "Fetched content URL"
|
|
5130
6668
|
})
|
|
5131
6669
|
}).annotate({
|
|
5132
|
-
"title": "
|
|
6670
|
+
"title": "RequestWebFetchResultBlock"
|
|
5133
6671
|
});
|
|
5134
|
-
export const
|
|
5135
|
-
"
|
|
6672
|
+
export const ContentBlockStartEvent = /*#__PURE__*/Schema.Struct({
|
|
6673
|
+
"content_block": Schema.Union([ResponseTextBlock, ResponseThinkingBlock, ResponseRedactedThinkingBlock, ResponseToolUseBlock, ResponseServerToolUseBlock, ResponseWebSearchToolResultBlock, ResponseWebFetchToolResultBlock, ResponseCodeExecutionToolResultBlock, ResponseBashCodeExecutionToolResultBlock, ResponseTextEditorCodeExecutionToolResultBlock, ResponseToolSearchToolResultBlock, ResponseContainerUploadBlock], {
|
|
5136
6674
|
mode: "oneOf"
|
|
5137
|
-
})
|
|
5138
|
-
"title": "
|
|
5139
|
-
"description": "Create a cache control breakpoint at this content block."
|
|
5140
|
-
})),
|
|
5141
|
-
"content": Schema.Union([Schema.Array(RequestWebSearchResultBlock).annotate({
|
|
5142
|
-
"title": "web_search_tool_result_block_item"
|
|
5143
|
-
}), RequestWebSearchToolResultError]).annotate({
|
|
5144
|
-
"title": "Content"
|
|
6675
|
+
}).annotate({
|
|
6676
|
+
"title": "Content Block"
|
|
5145
6677
|
}),
|
|
5146
|
-
"
|
|
5147
|
-
"title": "
|
|
5148
|
-
}).check(Schema.
|
|
5149
|
-
"type": Schema.Literal("
|
|
5150
|
-
"title": "Type"
|
|
6678
|
+
"index": Schema.Number.annotate({
|
|
6679
|
+
"title": "Index"
|
|
6680
|
+
}).check(Schema.isInt()),
|
|
6681
|
+
"type": Schema.Literal("content_block_start").annotate({
|
|
6682
|
+
"title": "Type",
|
|
6683
|
+
"default": "content_block_start"
|
|
5151
6684
|
})
|
|
5152
6685
|
}).annotate({
|
|
5153
|
-
"title": "
|
|
6686
|
+
"title": "ContentBlockStartEvent"
|
|
5154
6687
|
});
|
|
5155
|
-
export const
|
|
5156
|
-
"
|
|
5157
|
-
|
|
6688
|
+
export const ContentBlock = /*#__PURE__*/Schema.Union([ResponseTextBlock, ResponseThinkingBlock, ResponseRedactedThinkingBlock, ResponseToolUseBlock, ResponseServerToolUseBlock, ResponseWebSearchToolResultBlock, ResponseWebFetchToolResultBlock, ResponseCodeExecutionToolResultBlock, ResponseBashCodeExecutionToolResultBlock, ResponseTextEditorCodeExecutionToolResultBlock, ResponseToolSearchToolResultBlock, ResponseContainerUploadBlock], {
|
|
6689
|
+
mode: "oneOf"
|
|
6690
|
+
});
|
|
6691
|
+
export const RequestWebFetchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
6692
|
+
"content": RequestDocumentBlock,
|
|
6693
|
+
"retrieved_at": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6694
|
+
"title": "Retrieved At",
|
|
6695
|
+
"description": "ISO 8601 timestamp when the content was retrieved"
|
|
6696
|
+
})),
|
|
6697
|
+
"type": Schema.Literal("web_fetch_result").annotate({
|
|
6698
|
+
"title": "Type"
|
|
5158
6699
|
}),
|
|
5159
|
-
"
|
|
5160
|
-
"title": "
|
|
5161
|
-
|
|
5162
|
-
"type": Schema.Literal("web_search_tool_result").annotate({
|
|
5163
|
-
"title": "Type",
|
|
5164
|
-
"default": "web_search_tool_result"
|
|
6700
|
+
"url": Schema.String.annotate({
|
|
6701
|
+
"title": "Url",
|
|
6702
|
+
"description": "Fetched content URL"
|
|
5165
6703
|
})
|
|
5166
6704
|
}).annotate({
|
|
5167
|
-
"title": "
|
|
6705
|
+
"title": "RequestWebFetchResultBlock"
|
|
5168
6706
|
});
|
|
5169
|
-
export const
|
|
5170
|
-
"
|
|
5171
|
-
|
|
6707
|
+
export const BetaMessage = /*#__PURE__*/Schema.Struct({
|
|
6708
|
+
"id": Schema.String.annotate({
|
|
6709
|
+
"title": "Id",
|
|
6710
|
+
"description": "Unique object identifier.\n\nThe format and length of IDs may change over time."
|
|
6711
|
+
}),
|
|
6712
|
+
"type": Schema.Literal("message").annotate({
|
|
5172
6713
|
"title": "Type",
|
|
5173
|
-
"
|
|
6714
|
+
"description": "Object type.\n\nFor Messages, this is always `\"message\"`.",
|
|
6715
|
+
"default": "message"
|
|
6716
|
+
}),
|
|
6717
|
+
"role": Schema.Literal("assistant").annotate({
|
|
6718
|
+
"title": "Role",
|
|
6719
|
+
"description": "Conversational role of the generated message.\n\nThis will always be `\"assistant\"`.",
|
|
6720
|
+
"default": "assistant"
|
|
6721
|
+
}),
|
|
6722
|
+
"content": Schema.Array(BetaContentBlock).annotate({
|
|
6723
|
+
"title": "Content",
|
|
6724
|
+
"description": "Content generated by the model.\n\nThis is an array of content blocks, each of which has a `type` that determines its shape.\n\nExample:\n\n```json\n[{\"type\": \"text\", \"text\": \"Hi, I'm Claude.\"}]\n```\n\nIf the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.\n\nFor example, if the input `messages` were:\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"}\n]\n```\n\nThen the response `content` might be:\n\n```json\n[{\"type\": \"text\", \"text\": \"B)\"}]\n```"
|
|
6725
|
+
}),
|
|
6726
|
+
"model": Model,
|
|
6727
|
+
"stop_reason": Schema.Union([BetaStopReason, Schema.Null]).annotate({
|
|
6728
|
+
"title": "Stop Reason",
|
|
6729
|
+
"description": "The reason that we stopped.\n\nThis may be one the following values:\n* `\"end_turn\"`: the model reached a natural stopping point\n* `\"max_tokens\"`: we exceeded the requested `max_tokens` or the model's maximum\n* `\"stop_sequence\"`: one of your provided custom `stop_sequences` was generated\n* `\"tool_use\"`: the model invoked one or more tools\n* `\"pause_turn\"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.\n* `\"refusal\"`: when streaming classifiers intervene to handle potential policy violations\n\nIn non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise."
|
|
6730
|
+
}),
|
|
6731
|
+
"stop_sequence": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6732
|
+
"title": "Stop Sequence",
|
|
6733
|
+
"description": "Which custom stop sequence was generated, if any.\n\nThis value will be a non-null string if one of your custom stop sequences was generated.",
|
|
6734
|
+
"default": null
|
|
5174
6735
|
}),
|
|
5175
6736
|
"usage": Schema.Struct({
|
|
6737
|
+
"cache_creation": Schema.Union([BetaCacheCreation, Schema.Null]).annotate({
|
|
6738
|
+
"description": "Breakdown of cached tokens by TTL",
|
|
6739
|
+
"default": null
|
|
6740
|
+
}),
|
|
5176
6741
|
"cache_creation_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5177
6742
|
"title": "Cache Creation Input Tokens",
|
|
5178
|
-
"description": "The
|
|
6743
|
+
"description": "The number of input tokens used to create the cache entry.",
|
|
5179
6744
|
"default": null
|
|
5180
6745
|
}),
|
|
5181
6746
|
"cache_read_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5182
6747
|
"title": "Cache Read Input Tokens",
|
|
5183
|
-
"description": "The
|
|
6748
|
+
"description": "The number of input tokens read from the cache.",
|
|
5184
6749
|
"default": null
|
|
5185
6750
|
}),
|
|
5186
|
-
"
|
|
5187
|
-
"title": "
|
|
5188
|
-
"description": "The
|
|
6751
|
+
"inference_geo": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6752
|
+
"title": "Inference Geo",
|
|
6753
|
+
"description": "The geographic region where inference was performed for this request.",
|
|
5189
6754
|
"default": null
|
|
5190
6755
|
}),
|
|
6756
|
+
"input_tokens": Schema.Number.annotate({
|
|
6757
|
+
"title": "Input Tokens",
|
|
6758
|
+
"description": "The number of input tokens which were used."
|
|
6759
|
+
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
6760
|
+
"iterations": Schema.optionalKey(BetaIterationsUsage),
|
|
5191
6761
|
"output_tokens": Schema.Number.annotate({
|
|
5192
6762
|
"title": "Output Tokens",
|
|
5193
|
-
"description": "The
|
|
5194
|
-
}).check(Schema.isInt()),
|
|
5195
|
-
"server_tool_use": Schema.optionalKey(Schema.Union([
|
|
6763
|
+
"description": "The number of output tokens which were used."
|
|
6764
|
+
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
6765
|
+
"server_tool_use": Schema.optionalKey(Schema.Union([BetaServerToolUsage, Schema.Null]).annotate({
|
|
5196
6766
|
"description": "The number of server tool requests.",
|
|
5197
6767
|
"default": null
|
|
6768
|
+
})),
|
|
6769
|
+
"service_tier": Schema.Union([Schema.Literals(["standard", "priority", "batch"]), Schema.Null]).annotate({
|
|
6770
|
+
"title": "Service Tier",
|
|
6771
|
+
"description": "If the request used the priority, standard, or batch tier.",
|
|
6772
|
+
"default": null
|
|
6773
|
+
}),
|
|
6774
|
+
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
6775
|
+
"description": "The inference speed mode used for this request.",
|
|
6776
|
+
"default": null
|
|
5198
6777
|
}))
|
|
5199
6778
|
}).annotate({
|
|
5200
|
-
"title": "
|
|
6779
|
+
"title": "Usage",
|
|
5201
6780
|
"description": "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude.\n\nTotal input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`."
|
|
5202
|
-
})
|
|
6781
|
+
}),
|
|
6782
|
+
"context_management": Schema.optionalKey(Schema.Union([BetaResponseContextManagement, Schema.Null]).annotate({
|
|
6783
|
+
"description": "Context management response.\n\nInformation about context management strategies applied during the request.",
|
|
6784
|
+
"default": null
|
|
6785
|
+
})),
|
|
6786
|
+
"container": Schema.optionalKey(Schema.Union([BetaContainer, Schema.Null]).annotate({
|
|
6787
|
+
"description": "Information about the container used in this request.\n\nThis will be non-null if a container tool (e.g. code execution) was used.",
|
|
6788
|
+
"default": null
|
|
6789
|
+
}))
|
|
5203
6790
|
}).annotate({
|
|
5204
|
-
"title": "
|
|
6791
|
+
"title": "Message"
|
|
5205
6792
|
});
|
|
5206
|
-
export const
|
|
6793
|
+
export const BetaRequestWebFetchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5207
6794
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5208
6795
|
mode: "oneOf"
|
|
5209
6796
|
}), Schema.Null]).annotate({
|
|
5210
6797
|
"title": "Cache Control",
|
|
5211
6798
|
"description": "Create a cache control breakpoint at this content block."
|
|
5212
6799
|
})),
|
|
5213
|
-
"
|
|
6800
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
6801
|
+
mode: "oneOf"
|
|
6802
|
+
}).annotate({
|
|
6803
|
+
"title": "Caller"
|
|
6804
|
+
})),
|
|
6805
|
+
"content": Schema.Union([BetaRequestWebFetchToolResultError, BetaRequestWebFetchResultBlock]).annotate({
|
|
5214
6806
|
"title": "Content"
|
|
5215
6807
|
}),
|
|
5216
6808
|
"tool_use_id": Schema.String.annotate({
|
|
5217
6809
|
"title": "Tool Use Id"
|
|
5218
6810
|
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5219
|
-
"type": Schema.Literal("
|
|
6811
|
+
"type": Schema.Literal("web_fetch_tool_result").annotate({
|
|
5220
6812
|
"title": "Type"
|
|
5221
6813
|
})
|
|
5222
6814
|
}).annotate({
|
|
5223
|
-
"title": "
|
|
6815
|
+
"title": "RequestWebFetchToolResultBlock"
|
|
5224
6816
|
});
|
|
5225
|
-
export const
|
|
5226
|
-
"
|
|
5227
|
-
"title": "
|
|
6817
|
+
export const Message = /*#__PURE__*/Schema.Struct({
|
|
6818
|
+
"id": Schema.String.annotate({
|
|
6819
|
+
"title": "Id",
|
|
6820
|
+
"description": "Unique object identifier.\n\nThe format and length of IDs may change over time."
|
|
5228
6821
|
}),
|
|
5229
|
-
"
|
|
5230
|
-
"title": "Tool Use Id"
|
|
5231
|
-
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5232
|
-
"type": Schema.Literal("web_fetch_tool_result").annotate({
|
|
6822
|
+
"type": Schema.Literal("message").annotate({
|
|
5233
6823
|
"title": "Type",
|
|
5234
|
-
"
|
|
5235
|
-
|
|
5236
|
-
})
|
|
5237
|
-
"
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
6824
|
+
"description": "Object type.\n\nFor Messages, this is always `\"message\"`.",
|
|
6825
|
+
"default": "message"
|
|
6826
|
+
}),
|
|
6827
|
+
"role": Schema.Literal("assistant").annotate({
|
|
6828
|
+
"title": "Role",
|
|
6829
|
+
"description": "Conversational role of the generated message.\n\nThis will always be `\"assistant\"`.",
|
|
6830
|
+
"default": "assistant"
|
|
6831
|
+
}),
|
|
6832
|
+
"content": Schema.Array(ContentBlock).annotate({
|
|
6833
|
+
"title": "Content",
|
|
6834
|
+
"description": "Content generated by the model.\n\nThis is an array of content blocks, each of which has a `type` that determines its shape.\n\nExample:\n\n```json\n[{\"type\": \"text\", \"text\": \"Hi, I'm Claude.\"}]\n```\n\nIf the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.\n\nFor example, if the input `messages` were:\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"}\n]\n```\n\nThen the response `content` might be:\n\n```json\n[{\"type\": \"text\", \"text\": \"B)\"}]\n```"
|
|
6835
|
+
}),
|
|
6836
|
+
"model": Model,
|
|
6837
|
+
"stop_reason": Schema.Union([StopReason, Schema.Null]).annotate({
|
|
6838
|
+
"title": "Stop Reason",
|
|
6839
|
+
"description": "The reason that we stopped.\n\nThis may be one the following values:\n* `\"end_turn\"`: the model reached a natural stopping point\n* `\"max_tokens\"`: we exceeded the requested `max_tokens` or the model's maximum\n* `\"stop_sequence\"`: one of your provided custom `stop_sequences` was generated\n* `\"tool_use\"`: the model invoked one or more tools\n* `\"pause_turn\"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.\n* `\"refusal\"`: when streaming classifiers intervene to handle potential policy violations\n\nIn non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise."
|
|
6840
|
+
}),
|
|
6841
|
+
"stop_sequence": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6842
|
+
"title": "Stop Sequence",
|
|
6843
|
+
"description": "Which custom stop sequence was generated, if any.\n\nThis value will be a non-null string if one of your custom stop sequences was generated.",
|
|
5242
6844
|
"default": null
|
|
5243
|
-
})),
|
|
5244
|
-
"delta": BetaMessageDelta,
|
|
5245
|
-
"type": Schema.Literal("message_delta").annotate({
|
|
5246
|
-
"title": "Type",
|
|
5247
|
-
"default": "message_delta"
|
|
5248
6845
|
}),
|
|
5249
6846
|
"usage": Schema.Struct({
|
|
6847
|
+
"cache_creation": Schema.Union([CacheCreation, Schema.Null]).annotate({
|
|
6848
|
+
"description": "Breakdown of cached tokens by TTL",
|
|
6849
|
+
"default": null
|
|
6850
|
+
}),
|
|
5250
6851
|
"cache_creation_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5251
6852
|
"title": "Cache Creation Input Tokens",
|
|
5252
|
-
"description": "The
|
|
6853
|
+
"description": "The number of input tokens used to create the cache entry.",
|
|
5253
6854
|
"default": null
|
|
5254
6855
|
}),
|
|
5255
6856
|
"cache_read_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5256
6857
|
"title": "Cache Read Input Tokens",
|
|
5257
|
-
"description": "The
|
|
6858
|
+
"description": "The number of input tokens read from the cache.",
|
|
5258
6859
|
"default": null
|
|
5259
6860
|
}),
|
|
5260
|
-
"
|
|
5261
|
-
"title": "
|
|
5262
|
-
"description": "The
|
|
6861
|
+
"inference_geo": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6862
|
+
"title": "Inference Geo",
|
|
6863
|
+
"description": "The geographic region where inference was performed for this request.",
|
|
5263
6864
|
"default": null
|
|
5264
6865
|
}),
|
|
5265
|
-
"
|
|
6866
|
+
"input_tokens": Schema.Number.annotate({
|
|
6867
|
+
"title": "Input Tokens",
|
|
6868
|
+
"description": "The number of input tokens which were used."
|
|
6869
|
+
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
5266
6870
|
"output_tokens": Schema.Number.annotate({
|
|
5267
6871
|
"title": "Output Tokens",
|
|
5268
|
-
"description": "The
|
|
5269
|
-
}).check(Schema.isInt()),
|
|
5270
|
-
"server_tool_use": Schema.optionalKey(Schema.Union([
|
|
6872
|
+
"description": "The number of output tokens which were used."
|
|
6873
|
+
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
6874
|
+
"server_tool_use": Schema.optionalKey(Schema.Union([ServerToolUsage, Schema.Null]).annotate({
|
|
5271
6875
|
"description": "The number of server tool requests.",
|
|
5272
6876
|
"default": null
|
|
5273
|
-
}))
|
|
6877
|
+
})),
|
|
6878
|
+
"service_tier": Schema.Union([Schema.Literals(["standard", "priority", "batch"]), Schema.Null]).annotate({
|
|
6879
|
+
"title": "Service Tier",
|
|
6880
|
+
"description": "If the request used the priority, standard, or batch tier.",
|
|
6881
|
+
"default": null
|
|
6882
|
+
})
|
|
5274
6883
|
}).annotate({
|
|
5275
|
-
"title": "
|
|
6884
|
+
"title": "Usage",
|
|
5276
6885
|
"description": "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude.\n\nTotal input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`."
|
|
5277
|
-
})
|
|
5278
|
-
}).annotate({
|
|
5279
|
-
"title": "MessageDeltaEvent"
|
|
5280
|
-
});
|
|
5281
|
-
export const BetaRequestDocumentBlock = /*#__PURE__*/Schema.Struct({
|
|
5282
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5283
|
-
mode: "oneOf"
|
|
5284
|
-
}), Schema.Null]).annotate({
|
|
5285
|
-
"title": "Cache Control",
|
|
5286
|
-
"description": "Create a cache control breakpoint at this content block."
|
|
5287
|
-
})),
|
|
5288
|
-
"citations": Schema.optionalKey(Schema.Union([BetaRequestCitationsConfig, Schema.Null])),
|
|
5289
|
-
"context": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)), Schema.Null]).annotate({
|
|
5290
|
-
"title": "Context"
|
|
5291
|
-
})),
|
|
5292
|
-
"source": Schema.Union([BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource, BetaURLPDFSource, BetaFileDocumentSource], {
|
|
5293
|
-
mode: "oneOf"
|
|
5294
|
-
}).annotate({
|
|
5295
|
-
"title": "Source"
|
|
5296
6886
|
}),
|
|
5297
|
-
"
|
|
5298
|
-
"
|
|
5299
|
-
|
|
5300
|
-
"type": Schema.Literal("document").annotate({
|
|
5301
|
-
"title": "Type"
|
|
6887
|
+
"container": Schema.Union([Container, Schema.Null]).annotate({
|
|
6888
|
+
"description": "Information about the container used in this request.\n\nThis will be non-null if a container tool (e.g. code execution) was used.",
|
|
6889
|
+
"default": null
|
|
5302
6890
|
})
|
|
5303
6891
|
}).annotate({
|
|
5304
|
-
"title": "
|
|
6892
|
+
"title": "Message"
|
|
5305
6893
|
});
|
|
5306
|
-
export const
|
|
6894
|
+
export const RequestWebFetchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5307
6895
|
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5308
6896
|
mode: "oneOf"
|
|
5309
6897
|
}), Schema.Null]).annotate({
|
|
5310
6898
|
"title": "Cache Control",
|
|
5311
6899
|
"description": "Create a cache control breakpoint at this content block."
|
|
5312
6900
|
})),
|
|
5313
|
-
"
|
|
5314
|
-
"context": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)), Schema.Null]).annotate({
|
|
5315
|
-
"title": "Context"
|
|
5316
|
-
})),
|
|
5317
|
-
"source": Schema.Union([Base64PDFSource, PlainTextSource, ContentBlockSource, URLPDFSource], {
|
|
6901
|
+
"caller": Schema.optionalKey(Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
5318
6902
|
mode: "oneOf"
|
|
5319
6903
|
}).annotate({
|
|
5320
|
-
"title": "
|
|
5321
|
-
}),
|
|
5322
|
-
"title": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)).check(Schema.isMaxLength(500)), Schema.Null]).annotate({
|
|
5323
|
-
"title": "Title"
|
|
6904
|
+
"title": "Caller"
|
|
5324
6905
|
})),
|
|
5325
|
-
"
|
|
6906
|
+
"content": Schema.Union([RequestWebFetchToolResultError, RequestWebFetchResultBlock]).annotate({
|
|
6907
|
+
"title": "Content"
|
|
6908
|
+
}),
|
|
6909
|
+
"tool_use_id": Schema.String.annotate({
|
|
6910
|
+
"title": "Tool Use Id"
|
|
6911
|
+
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
6912
|
+
"type": Schema.Literal("web_fetch_tool_result").annotate({
|
|
5326
6913
|
"title": "Type"
|
|
5327
6914
|
})
|
|
5328
6915
|
}).annotate({
|
|
5329
|
-
"title": "
|
|
6916
|
+
"title": "RequestWebFetchToolResultBlock"
|
|
5330
6917
|
});
|
|
5331
|
-
export const
|
|
5332
|
-
"
|
|
5333
|
-
|
|
5334
|
-
}).annotate({
|
|
5335
|
-
"title": "Content Block"
|
|
5336
|
-
}),
|
|
5337
|
-
"index": Schema.Number.annotate({
|
|
5338
|
-
"title": "Index"
|
|
5339
|
-
}).check(Schema.isInt()),
|
|
5340
|
-
"type": Schema.Literal("content_block_start").annotate({
|
|
6918
|
+
export const BetaMessageStartEvent = /*#__PURE__*/Schema.Struct({
|
|
6919
|
+
"message": BetaMessage,
|
|
6920
|
+
"type": Schema.Literal("message_start").annotate({
|
|
5341
6921
|
"title": "Type",
|
|
5342
|
-
"default": "
|
|
6922
|
+
"default": "message_start"
|
|
5343
6923
|
})
|
|
5344
6924
|
}).annotate({
|
|
5345
|
-
"title": "
|
|
5346
|
-
});
|
|
5347
|
-
export const ContentBlock = /*#__PURE__*/Schema.Union([ResponseTextBlock, ResponseThinkingBlock, ResponseRedactedThinkingBlock, ResponseToolUseBlock, ResponseServerToolUseBlock, ResponseWebSearchToolResultBlock], {
|
|
5348
|
-
mode: "oneOf"
|
|
6925
|
+
"title": "MessageStartEvent"
|
|
5349
6926
|
});
|
|
5350
|
-
export const
|
|
5351
|
-
"
|
|
5352
|
-
|
|
5353
|
-
}).annotate({
|
|
5354
|
-
"title": "Content Block"
|
|
5355
|
-
}),
|
|
5356
|
-
"index": Schema.Number.annotate({
|
|
5357
|
-
"title": "Index"
|
|
5358
|
-
}).check(Schema.isInt()),
|
|
5359
|
-
"type": Schema.Literal("content_block_start").annotate({
|
|
6927
|
+
export const BetaSucceededResult = /*#__PURE__*/Schema.Struct({
|
|
6928
|
+
"message": BetaMessage,
|
|
6929
|
+
"type": Schema.Literal("succeeded").annotate({
|
|
5360
6930
|
"title": "Type",
|
|
5361
|
-
"default": "
|
|
5362
|
-
})
|
|
5363
|
-
}).annotate({
|
|
5364
|
-
"title": "ContentBlockStartEvent"
|
|
5365
|
-
});
|
|
5366
|
-
export const BetaContentBlock = /*#__PURE__*/Schema.Union([BetaResponseTextBlock, BetaResponseThinkingBlock, BetaResponseRedactedThinkingBlock, BetaResponseToolUseBlock, BetaResponseServerToolUseBlock, BetaResponseWebSearchToolResultBlock, BetaResponseWebFetchToolResultBlock, BetaResponseCodeExecutionToolResultBlock, BetaResponseBashCodeExecutionToolResultBlock, BetaResponseTextEditorCodeExecutionToolResultBlock, BetaResponseToolSearchToolResultBlock, BetaResponseMCPToolUseBlock, BetaResponseMCPToolResultBlock, BetaResponseContainerUploadBlock, BetaResponseCompactionBlock], {
|
|
5367
|
-
mode: "oneOf"
|
|
5368
|
-
});
|
|
5369
|
-
export const BetaRequestWebFetchResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5370
|
-
"content": BetaRequestDocumentBlock,
|
|
5371
|
-
"retrieved_at": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5372
|
-
"title": "Retrieved At",
|
|
5373
|
-
"description": "ISO 8601 timestamp when the content was retrieved"
|
|
5374
|
-
})),
|
|
5375
|
-
"type": Schema.Literal("web_fetch_result").annotate({
|
|
5376
|
-
"title": "Type"
|
|
5377
|
-
}),
|
|
5378
|
-
"url": Schema.String.annotate({
|
|
5379
|
-
"title": "Url",
|
|
5380
|
-
"description": "Fetched content URL"
|
|
6931
|
+
"default": "succeeded"
|
|
5381
6932
|
})
|
|
5382
6933
|
}).annotate({
|
|
5383
|
-
"title": "
|
|
6934
|
+
"title": "SucceededResult"
|
|
5384
6935
|
});
|
|
5385
|
-
export const
|
|
5386
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
6936
|
+
export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Struct({
|
|
6937
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5387
6938
|
mode: "oneOf"
|
|
5388
6939
|
}), Schema.Null]).annotate({
|
|
5389
6940
|
"title": "Cache Control",
|
|
5390
6941
|
"description": "Create a cache control breakpoint at this content block."
|
|
5391
6942
|
})),
|
|
5392
|
-
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([
|
|
6943
|
+
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([BetaRequestCharLocationCitation, BetaRequestPageLocationCitation, BetaRequestContentBlockLocationCitation, BetaRequestWebSearchResultLocationCitation, BetaRequestSearchResultLocationCitation], {
|
|
5393
6944
|
mode: "oneOf"
|
|
5394
6945
|
})), Schema.Null]).annotate({
|
|
5395
6946
|
"title": "Citations"
|
|
@@ -5404,13 +6955,13 @@ export const InputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.
|
|
|
5404
6955
|
"title": "RequestTextBlock",
|
|
5405
6956
|
"description": "Regular text content."
|
|
5406
6957
|
}), /*#__PURE__*/Schema.Struct({
|
|
5407
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
6958
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5408
6959
|
mode: "oneOf"
|
|
5409
6960
|
}), Schema.Null]).annotate({
|
|
5410
6961
|
"title": "Cache Control",
|
|
5411
6962
|
"description": "Create a cache control breakpoint at this content block."
|
|
5412
6963
|
})),
|
|
5413
|
-
"source": Schema.Union([
|
|
6964
|
+
"source": Schema.Union([BetaBase64ImageSource, BetaURLImageSource, BetaFileImageSource], {
|
|
5414
6965
|
mode: "oneOf"
|
|
5415
6966
|
}).annotate({
|
|
5416
6967
|
"title": "Source"
|
|
@@ -5422,17 +6973,17 @@ export const InputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.
|
|
|
5422
6973
|
"title": "RequestImageBlock",
|
|
5423
6974
|
"description": "Image content specified directly as base64 data or as a reference via a URL."
|
|
5424
6975
|
}), /*#__PURE__*/Schema.Struct({
|
|
5425
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
6976
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5426
6977
|
mode: "oneOf"
|
|
5427
6978
|
}), Schema.Null]).annotate({
|
|
5428
6979
|
"title": "Cache Control",
|
|
5429
6980
|
"description": "Create a cache control breakpoint at this content block."
|
|
5430
6981
|
})),
|
|
5431
|
-
"citations": Schema.optionalKey(Schema.Union([
|
|
6982
|
+
"citations": Schema.optionalKey(Schema.Union([BetaRequestCitationsConfig, Schema.Null])),
|
|
5432
6983
|
"context": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)), Schema.Null]).annotate({
|
|
5433
6984
|
"title": "Context"
|
|
5434
6985
|
})),
|
|
5435
|
-
"source": Schema.Union([
|
|
6986
|
+
"source": Schema.Union([BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource, BetaURLPDFSource, BetaFileDocumentSource], {
|
|
5436
6987
|
mode: "oneOf"
|
|
5437
6988
|
}).annotate({
|
|
5438
6989
|
"title": "Source"
|
|
@@ -5447,14 +6998,14 @@ export const InputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.
|
|
|
5447
6998
|
"title": "RequestDocumentBlock",
|
|
5448
6999
|
"description": "Document content, either specified directly as base64 data, as text, or as a reference via a URL."
|
|
5449
7000
|
}), /*#__PURE__*/Schema.Struct({
|
|
5450
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7001
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5451
7002
|
mode: "oneOf"
|
|
5452
7003
|
}), Schema.Null]).annotate({
|
|
5453
7004
|
"title": "Cache Control",
|
|
5454
7005
|
"description": "Create a cache control breakpoint at this content block."
|
|
5455
7006
|
})),
|
|
5456
|
-
"citations": Schema.optionalKey(
|
|
5457
|
-
"content": Schema.Array(
|
|
7007
|
+
"citations": Schema.optionalKey(BetaRequestCitationsConfig),
|
|
7008
|
+
"content": Schema.Array(BetaRequestTextBlock).annotate({
|
|
5458
7009
|
"title": "Content"
|
|
5459
7010
|
}),
|
|
5460
7011
|
"source": Schema.String.annotate({
|
|
@@ -5493,12 +7044,17 @@ export const InputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.
|
|
|
5493
7044
|
"title": "RequestRedactedThinkingBlock",
|
|
5494
7045
|
"description": "A block specifying internal, redacted thinking by the model."
|
|
5495
7046
|
}), /*#__PURE__*/Schema.Struct({
|
|
5496
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7047
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5497
7048
|
mode: "oneOf"
|
|
5498
7049
|
}), Schema.Null]).annotate({
|
|
5499
7050
|
"title": "Cache Control",
|
|
5500
7051
|
"description": "Create a cache control breakpoint at this content block."
|
|
5501
7052
|
})),
|
|
7053
|
+
"caller": Schema.optionalKey(Schema.Union([BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller_20260120], {
|
|
7054
|
+
mode: "oneOf"
|
|
7055
|
+
}).annotate({
|
|
7056
|
+
"title": "Caller"
|
|
7057
|
+
})),
|
|
5502
7058
|
"id": Schema.String.annotate({
|
|
5503
7059
|
"title": "Id"
|
|
5504
7060
|
}).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
@@ -5515,13 +7071,13 @@ export const InputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.
|
|
|
5515
7071
|
"title": "RequestToolUseBlock",
|
|
5516
7072
|
"description": "A block indicating a tool use by the model."
|
|
5517
7073
|
}), /*#__PURE__*/Schema.Struct({
|
|
5518
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7074
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5519
7075
|
mode: "oneOf"
|
|
5520
7076
|
}), Schema.Null]).annotate({
|
|
5521
7077
|
"title": "Cache Control",
|
|
5522
7078
|
"description": "Create a cache control breakpoint at this content block."
|
|
5523
7079
|
})),
|
|
5524
|
-
"content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(Schema.Union([
|
|
7080
|
+
"content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(Schema.Union([BetaRequestTextBlock, BetaRequestImageBlock, BetaRequestSearchResultBlock, BetaRequestDocumentBlock, BetaRequestToolReferenceBlock], {
|
|
5525
7081
|
mode: "oneOf"
|
|
5526
7082
|
}).annotate({
|
|
5527
7083
|
"title": "Block"
|
|
@@ -5540,198 +7096,9 @@ export const InputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.
|
|
|
5540
7096
|
}).annotate({
|
|
5541
7097
|
"title": "RequestToolResultBlock",
|
|
5542
7098
|
"description": "A block specifying the results of a tool use by the model."
|
|
5543
|
-
}),
|
|
7099
|
+
}), BetaRequestServerToolUseBlock, BetaRequestWebSearchToolResultBlock, BetaRequestWebFetchToolResultBlock, BetaRequestCodeExecutionToolResultBlock, BetaRequestBashCodeExecutionToolResultBlock, BetaRequestTextEditorCodeExecutionToolResultBlock, BetaRequestToolSearchToolResultBlock, BetaRequestMCPToolUseBlock, BetaRequestMCPToolResultBlock, BetaRequestContainerUploadBlock, BetaRequestCompactionBlock], {
|
|
5544
7100
|
mode: "oneOf"
|
|
5545
7101
|
});
|
|
5546
|
-
export const Message = /*#__PURE__*/Schema.Struct({
|
|
5547
|
-
"id": Schema.String.annotate({
|
|
5548
|
-
"title": "Id",
|
|
5549
|
-
"description": "Unique object identifier.\n\nThe format and length of IDs may change over time."
|
|
5550
|
-
}),
|
|
5551
|
-
"type": Schema.Literal("message").annotate({
|
|
5552
|
-
"title": "Type",
|
|
5553
|
-
"description": "Object type.\n\nFor Messages, this is always `\"message\"`.",
|
|
5554
|
-
"default": "message"
|
|
5555
|
-
}),
|
|
5556
|
-
"role": Schema.Literal("assistant").annotate({
|
|
5557
|
-
"title": "Role",
|
|
5558
|
-
"description": "Conversational role of the generated message.\n\nThis will always be `\"assistant\"`.",
|
|
5559
|
-
"default": "assistant"
|
|
5560
|
-
}),
|
|
5561
|
-
"content": Schema.Array(ContentBlock).annotate({
|
|
5562
|
-
"title": "Content",
|
|
5563
|
-
"description": "Content generated by the model.\n\nThis is an array of content blocks, each of which has a `type` that determines its shape.\n\nExample:\n\n```json\n[{\"type\": \"text\", \"text\": \"Hi, I'm Claude.\"}]\n```\n\nIf the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.\n\nFor example, if the input `messages` were:\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"}\n]\n```\n\nThen the response `content` might be:\n\n```json\n[{\"type\": \"text\", \"text\": \"B)\"}]\n```"
|
|
5564
|
-
}),
|
|
5565
|
-
"model": Model,
|
|
5566
|
-
"stop_reason": Schema.Union([StopReason, Schema.Null]).annotate({
|
|
5567
|
-
"title": "Stop Reason",
|
|
5568
|
-
"description": "The reason that we stopped.\n\nThis may be one the following values:\n* `\"end_turn\"`: the model reached a natural stopping point\n* `\"max_tokens\"`: we exceeded the requested `max_tokens` or the model's maximum\n* `\"stop_sequence\"`: one of your provided custom `stop_sequences` was generated\n* `\"tool_use\"`: the model invoked one or more tools\n* `\"pause_turn\"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.\n* `\"refusal\"`: when streaming classifiers intervene to handle potential policy violations\n\nIn non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise."
|
|
5569
|
-
}),
|
|
5570
|
-
"stop_sequence": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5571
|
-
"title": "Stop Sequence",
|
|
5572
|
-
"description": "Which custom stop sequence was generated, if any.\n\nThis value will be a non-null string if one of your custom stop sequences was generated.",
|
|
5573
|
-
"default": null
|
|
5574
|
-
}),
|
|
5575
|
-
"usage": Schema.Struct({
|
|
5576
|
-
"cache_creation": Schema.Union([CacheCreation, Schema.Null]).annotate({
|
|
5577
|
-
"description": "Breakdown of cached tokens by TTL",
|
|
5578
|
-
"default": null
|
|
5579
|
-
}),
|
|
5580
|
-
"cache_creation_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5581
|
-
"title": "Cache Creation Input Tokens",
|
|
5582
|
-
"description": "The number of input tokens used to create the cache entry.",
|
|
5583
|
-
"default": null
|
|
5584
|
-
}),
|
|
5585
|
-
"cache_read_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5586
|
-
"title": "Cache Read Input Tokens",
|
|
5587
|
-
"description": "The number of input tokens read from the cache.",
|
|
5588
|
-
"default": null
|
|
5589
|
-
}),
|
|
5590
|
-
"inference_geo": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5591
|
-
"title": "Inference Geo",
|
|
5592
|
-
"description": "The geographic region where inference was performed for this request.",
|
|
5593
|
-
"default": null
|
|
5594
|
-
}),
|
|
5595
|
-
"input_tokens": Schema.Number.annotate({
|
|
5596
|
-
"title": "Input Tokens",
|
|
5597
|
-
"description": "The number of input tokens which were used."
|
|
5598
|
-
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
5599
|
-
"output_tokens": Schema.Number.annotate({
|
|
5600
|
-
"title": "Output Tokens",
|
|
5601
|
-
"description": "The number of output tokens which were used."
|
|
5602
|
-
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
5603
|
-
"server_tool_use": Schema.optionalKey(Schema.Union([ServerToolUsage, Schema.Null]).annotate({
|
|
5604
|
-
"description": "The number of server tool requests.",
|
|
5605
|
-
"default": null
|
|
5606
|
-
})),
|
|
5607
|
-
"service_tier": Schema.Union([Schema.Literals(["standard", "priority", "batch"]), Schema.Null]).annotate({
|
|
5608
|
-
"title": "Service Tier",
|
|
5609
|
-
"description": "If the request used the priority, standard, or batch tier.",
|
|
5610
|
-
"default": null
|
|
5611
|
-
}),
|
|
5612
|
-
"speed": Schema.Unknown
|
|
5613
|
-
}).annotate({
|
|
5614
|
-
"title": "Usage",
|
|
5615
|
-
"description": "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude.\n\nTotal input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`."
|
|
5616
|
-
})
|
|
5617
|
-
}).annotate({
|
|
5618
|
-
"title": "Message"
|
|
5619
|
-
});
|
|
5620
|
-
export const BetaMessage = /*#__PURE__*/Schema.Struct({
|
|
5621
|
-
"id": Schema.String.annotate({
|
|
5622
|
-
"title": "Id",
|
|
5623
|
-
"description": "Unique object identifier.\n\nThe format and length of IDs may change over time."
|
|
5624
|
-
}),
|
|
5625
|
-
"type": Schema.Literal("message").annotate({
|
|
5626
|
-
"title": "Type",
|
|
5627
|
-
"description": "Object type.\n\nFor Messages, this is always `\"message\"`.",
|
|
5628
|
-
"default": "message"
|
|
5629
|
-
}),
|
|
5630
|
-
"role": Schema.Literal("assistant").annotate({
|
|
5631
|
-
"title": "Role",
|
|
5632
|
-
"description": "Conversational role of the generated message.\n\nThis will always be `\"assistant\"`.",
|
|
5633
|
-
"default": "assistant"
|
|
5634
|
-
}),
|
|
5635
|
-
"content": Schema.Array(BetaContentBlock).annotate({
|
|
5636
|
-
"title": "Content",
|
|
5637
|
-
"description": "Content generated by the model.\n\nThis is an array of content blocks, each of which has a `type` that determines its shape.\n\nExample:\n\n```json\n[{\"type\": \"text\", \"text\": \"Hi, I'm Claude.\"}]\n```\n\nIf the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.\n\nFor example, if the input `messages` were:\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"}\n]\n```\n\nThen the response `content` might be:\n\n```json\n[{\"type\": \"text\", \"text\": \"B)\"}]\n```"
|
|
5638
|
-
}),
|
|
5639
|
-
"model": Model,
|
|
5640
|
-
"stop_reason": Schema.Union([BetaStopReason, Schema.Null]).annotate({
|
|
5641
|
-
"title": "Stop Reason",
|
|
5642
|
-
"description": "The reason that we stopped.\n\nThis may be one the following values:\n* `\"end_turn\"`: the model reached a natural stopping point\n* `\"max_tokens\"`: we exceeded the requested `max_tokens` or the model's maximum\n* `\"stop_sequence\"`: one of your provided custom `stop_sequences` was generated\n* `\"tool_use\"`: the model invoked one or more tools\n* `\"pause_turn\"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.\n* `\"refusal\"`: when streaming classifiers intervene to handle potential policy violations\n\nIn non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise."
|
|
5643
|
-
}),
|
|
5644
|
-
"stop_sequence": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5645
|
-
"title": "Stop Sequence",
|
|
5646
|
-
"description": "Which custom stop sequence was generated, if any.\n\nThis value will be a non-null string if one of your custom stop sequences was generated.",
|
|
5647
|
-
"default": null
|
|
5648
|
-
}),
|
|
5649
|
-
"usage": Schema.Struct({
|
|
5650
|
-
"cache_creation": Schema.Union([BetaCacheCreation, Schema.Null]).annotate({
|
|
5651
|
-
"description": "Breakdown of cached tokens by TTL",
|
|
5652
|
-
"default": null
|
|
5653
|
-
}),
|
|
5654
|
-
"cache_creation_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5655
|
-
"title": "Cache Creation Input Tokens",
|
|
5656
|
-
"description": "The number of input tokens used to create the cache entry.",
|
|
5657
|
-
"default": null
|
|
5658
|
-
}),
|
|
5659
|
-
"cache_read_input_tokens": Schema.Union([Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), Schema.Null]).annotate({
|
|
5660
|
-
"title": "Cache Read Input Tokens",
|
|
5661
|
-
"description": "The number of input tokens read from the cache.",
|
|
5662
|
-
"default": null
|
|
5663
|
-
}),
|
|
5664
|
-
"inference_geo": Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5665
|
-
"title": "Inference Geo",
|
|
5666
|
-
"description": "The geographic region where inference was performed for this request.",
|
|
5667
|
-
"default": null
|
|
5668
|
-
}),
|
|
5669
|
-
"input_tokens": Schema.Number.annotate({
|
|
5670
|
-
"title": "Input Tokens",
|
|
5671
|
-
"description": "The number of input tokens which were used."
|
|
5672
|
-
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
5673
|
-
"iterations": Schema.optionalKey(BetaIterationsUsage),
|
|
5674
|
-
"output_tokens": Schema.Number.annotate({
|
|
5675
|
-
"title": "Output Tokens",
|
|
5676
|
-
"description": "The number of output tokens which were used."
|
|
5677
|
-
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)),
|
|
5678
|
-
"server_tool_use": Schema.optionalKey(Schema.Union([BetaServerToolUsage, Schema.Null]).annotate({
|
|
5679
|
-
"description": "The number of server tool requests.",
|
|
5680
|
-
"default": null
|
|
5681
|
-
})),
|
|
5682
|
-
"service_tier": Schema.Union([Schema.Literals(["standard", "priority", "batch"]), Schema.Null]).annotate({
|
|
5683
|
-
"title": "Service Tier",
|
|
5684
|
-
"description": "If the request used the priority, standard, or batch tier.",
|
|
5685
|
-
"default": null
|
|
5686
|
-
}),
|
|
5687
|
-
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
5688
|
-
"description": "The inference speed mode used for this request.",
|
|
5689
|
-
"default": null
|
|
5690
|
-
}))
|
|
5691
|
-
}).annotate({
|
|
5692
|
-
"title": "Usage",
|
|
5693
|
-
"description": "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude.\n\nTotal input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`."
|
|
5694
|
-
}),
|
|
5695
|
-
"context_management": Schema.optionalKey(Schema.Union([BetaResponseContextManagement, Schema.Null]).annotate({
|
|
5696
|
-
"description": "Context management response.\n\nInformation about context management strategies applied during the request.",
|
|
5697
|
-
"default": null
|
|
5698
|
-
})),
|
|
5699
|
-
"container": Schema.optionalKey(Schema.Union([BetaContainer, Schema.Null]).annotate({
|
|
5700
|
-
"description": "Information about the container used in this request.\n\nThis will be non-null if a container tool (e.g. code execution) was used.",
|
|
5701
|
-
"default": null
|
|
5702
|
-
}))
|
|
5703
|
-
}).annotate({
|
|
5704
|
-
"title": "Message"
|
|
5705
|
-
});
|
|
5706
|
-
export const BetaRequestWebFetchToolResultBlock = /*#__PURE__*/Schema.Struct({
|
|
5707
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
5708
|
-
mode: "oneOf"
|
|
5709
|
-
}), Schema.Null]).annotate({
|
|
5710
|
-
"title": "Cache Control",
|
|
5711
|
-
"description": "Create a cache control breakpoint at this content block."
|
|
5712
|
-
})),
|
|
5713
|
-
"content": Schema.Union([BetaRequestWebFetchToolResultError, BetaRequestWebFetchResultBlock]).annotate({
|
|
5714
|
-
"title": "Content"
|
|
5715
|
-
}),
|
|
5716
|
-
"tool_use_id": Schema.String.annotate({
|
|
5717
|
-
"title": "Tool Use Id"
|
|
5718
|
-
}).check(Schema.isPattern(new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
5719
|
-
"type": Schema.Literal("web_fetch_tool_result").annotate({
|
|
5720
|
-
"title": "Type"
|
|
5721
|
-
})
|
|
5722
|
-
}).annotate({
|
|
5723
|
-
"title": "RequestWebFetchToolResultBlock"
|
|
5724
|
-
});
|
|
5725
|
-
export const InputMessage = /*#__PURE__*/Schema.Struct({
|
|
5726
|
-
"content": Schema.Union([Schema.String, Schema.Array(InputContentBlock)]).annotate({
|
|
5727
|
-
"title": "Content"
|
|
5728
|
-
}),
|
|
5729
|
-
"role": Schema.Literals(["user", "assistant"]).annotate({
|
|
5730
|
-
"title": "Role"
|
|
5731
|
-
})
|
|
5732
|
-
}).annotate({
|
|
5733
|
-
"title": "InputMessage"
|
|
5734
|
-
});
|
|
5735
7102
|
export const MessageStartEvent = /*#__PURE__*/Schema.Struct({
|
|
5736
7103
|
"message": Message,
|
|
5737
7104
|
"type": Schema.Literal("message_start").annotate({
|
|
@@ -5750,32 +7117,14 @@ export const SucceededResult = /*#__PURE__*/Schema.Struct({
|
|
|
5750
7117
|
}).annotate({
|
|
5751
7118
|
"title": "SucceededResult"
|
|
5752
7119
|
});
|
|
5753
|
-
export const
|
|
5754
|
-
"
|
|
5755
|
-
"type": Schema.Literal("message_start").annotate({
|
|
5756
|
-
"title": "Type",
|
|
5757
|
-
"default": "message_start"
|
|
5758
|
-
})
|
|
5759
|
-
}).annotate({
|
|
5760
|
-
"title": "MessageStartEvent"
|
|
5761
|
-
});
|
|
5762
|
-
export const BetaSucceededResult = /*#__PURE__*/Schema.Struct({
|
|
5763
|
-
"message": BetaMessage,
|
|
5764
|
-
"type": Schema.Literal("succeeded").annotate({
|
|
5765
|
-
"title": "Type",
|
|
5766
|
-
"default": "succeeded"
|
|
5767
|
-
})
|
|
5768
|
-
}).annotate({
|
|
5769
|
-
"title": "SucceededResult"
|
|
5770
|
-
});
|
|
5771
|
-
export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Struct({
|
|
5772
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
7120
|
+
export const InputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Struct({
|
|
7121
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5773
7122
|
mode: "oneOf"
|
|
5774
7123
|
}), Schema.Null]).annotate({
|
|
5775
7124
|
"title": "Cache Control",
|
|
5776
7125
|
"description": "Create a cache control breakpoint at this content block."
|
|
5777
7126
|
})),
|
|
5778
|
-
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([
|
|
7127
|
+
"citations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([RequestCharLocationCitation, RequestPageLocationCitation, RequestContentBlockLocationCitation, RequestWebSearchResultLocationCitation, RequestSearchResultLocationCitation], {
|
|
5779
7128
|
mode: "oneOf"
|
|
5780
7129
|
})), Schema.Null]).annotate({
|
|
5781
7130
|
"title": "Citations"
|
|
@@ -5790,13 +7139,13 @@ export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Sch
|
|
|
5790
7139
|
"title": "RequestTextBlock",
|
|
5791
7140
|
"description": "Regular text content."
|
|
5792
7141
|
}), /*#__PURE__*/Schema.Struct({
|
|
5793
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7142
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5794
7143
|
mode: "oneOf"
|
|
5795
7144
|
}), Schema.Null]).annotate({
|
|
5796
7145
|
"title": "Cache Control",
|
|
5797
7146
|
"description": "Create a cache control breakpoint at this content block."
|
|
5798
7147
|
})),
|
|
5799
|
-
"source": Schema.Union([
|
|
7148
|
+
"source": Schema.Union([Base64ImageSource, URLImageSource], {
|
|
5800
7149
|
mode: "oneOf"
|
|
5801
7150
|
}).annotate({
|
|
5802
7151
|
"title": "Source"
|
|
@@ -5808,17 +7157,17 @@ export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Sch
|
|
|
5808
7157
|
"title": "RequestImageBlock",
|
|
5809
7158
|
"description": "Image content specified directly as base64 data or as a reference via a URL."
|
|
5810
7159
|
}), /*#__PURE__*/Schema.Struct({
|
|
5811
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7160
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5812
7161
|
mode: "oneOf"
|
|
5813
7162
|
}), Schema.Null]).annotate({
|
|
5814
7163
|
"title": "Cache Control",
|
|
5815
7164
|
"description": "Create a cache control breakpoint at this content block."
|
|
5816
7165
|
})),
|
|
5817
|
-
"citations": Schema.optionalKey(Schema.Union([
|
|
7166
|
+
"citations": Schema.optionalKey(Schema.Union([RequestCitationsConfig, Schema.Null])),
|
|
5818
7167
|
"context": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1)), Schema.Null]).annotate({
|
|
5819
7168
|
"title": "Context"
|
|
5820
7169
|
})),
|
|
5821
|
-
"source": Schema.Union([
|
|
7170
|
+
"source": Schema.Union([Base64PDFSource, PlainTextSource, ContentBlockSource, URLPDFSource], {
|
|
5822
7171
|
mode: "oneOf"
|
|
5823
7172
|
}).annotate({
|
|
5824
7173
|
"title": "Source"
|
|
@@ -5833,14 +7182,14 @@ export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Sch
|
|
|
5833
7182
|
"title": "RequestDocumentBlock",
|
|
5834
7183
|
"description": "Document content, either specified directly as base64 data, as text, or as a reference via a URL."
|
|
5835
7184
|
}), /*#__PURE__*/Schema.Struct({
|
|
5836
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7185
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5837
7186
|
mode: "oneOf"
|
|
5838
7187
|
}), Schema.Null]).annotate({
|
|
5839
7188
|
"title": "Cache Control",
|
|
5840
7189
|
"description": "Create a cache control breakpoint at this content block."
|
|
5841
7190
|
})),
|
|
5842
|
-
"citations": Schema.optionalKey(
|
|
5843
|
-
"content": Schema.Array(
|
|
7191
|
+
"citations": Schema.optionalKey(RequestCitationsConfig),
|
|
7192
|
+
"content": Schema.Array(RequestTextBlock).annotate({
|
|
5844
7193
|
"title": "Content"
|
|
5845
7194
|
}),
|
|
5846
7195
|
"source": Schema.String.annotate({
|
|
@@ -5879,13 +7228,13 @@ export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Sch
|
|
|
5879
7228
|
"title": "RequestRedactedThinkingBlock",
|
|
5880
7229
|
"description": "A block specifying internal, redacted thinking by the model."
|
|
5881
7230
|
}), /*#__PURE__*/Schema.Struct({
|
|
5882
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7231
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5883
7232
|
mode: "oneOf"
|
|
5884
7233
|
}), Schema.Null]).annotate({
|
|
5885
7234
|
"title": "Cache Control",
|
|
5886
7235
|
"description": "Create a cache control breakpoint at this content block."
|
|
5887
7236
|
})),
|
|
5888
|
-
"caller": Schema.optionalKey(Schema.Union([
|
|
7237
|
+
"caller": Schema.optionalKey(Schema.Union([DirectCaller, ServerToolCaller, ServerToolCaller_20260120], {
|
|
5889
7238
|
mode: "oneOf"
|
|
5890
7239
|
}).annotate({
|
|
5891
7240
|
"title": "Caller"
|
|
@@ -5906,13 +7255,13 @@ export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Sch
|
|
|
5906
7255
|
"title": "RequestToolUseBlock",
|
|
5907
7256
|
"description": "A block indicating a tool use by the model."
|
|
5908
7257
|
}), /*#__PURE__*/Schema.Struct({
|
|
5909
|
-
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([
|
|
7258
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
5910
7259
|
mode: "oneOf"
|
|
5911
7260
|
}), Schema.Null]).annotate({
|
|
5912
7261
|
"title": "Cache Control",
|
|
5913
7262
|
"description": "Create a cache control breakpoint at this content block."
|
|
5914
7263
|
})),
|
|
5915
|
-
"content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(Schema.Union([
|
|
7264
|
+
"content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(Schema.Union([RequestTextBlock, RequestImageBlock, RequestSearchResultBlock, RequestDocumentBlock, RequestToolReferenceBlock], {
|
|
5916
7265
|
mode: "oneOf"
|
|
5917
7266
|
}).annotate({
|
|
5918
7267
|
"title": "Block"
|
|
@@ -5931,33 +7280,72 @@ export const BetaInputContentBlock = /*#__PURE__*/Schema.Union([/*#__PURE__*/Sch
|
|
|
5931
7280
|
}).annotate({
|
|
5932
7281
|
"title": "RequestToolResultBlock",
|
|
5933
7282
|
"description": "A block specifying the results of a tool use by the model."
|
|
5934
|
-
}),
|
|
7283
|
+
}), RequestServerToolUseBlock, RequestWebSearchToolResultBlock, RequestWebFetchToolResultBlock, RequestCodeExecutionToolResultBlock, RequestBashCodeExecutionToolResultBlock, RequestTextEditorCodeExecutionToolResultBlock, RequestToolSearchToolResultBlock, RequestContainerUploadBlock], {
|
|
5935
7284
|
mode: "oneOf"
|
|
5936
7285
|
});
|
|
5937
|
-
export const
|
|
5938
|
-
"
|
|
7286
|
+
export const BetaInputMessage = /*#__PURE__*/Schema.Struct({
|
|
7287
|
+
"content": Schema.Union([Schema.String, Schema.Array(BetaInputContentBlock)]).annotate({
|
|
7288
|
+
"title": "Content"
|
|
7289
|
+
}),
|
|
7290
|
+
"role": Schema.Literals(["user", "assistant"]).annotate({
|
|
7291
|
+
"title": "Role"
|
|
7292
|
+
})
|
|
7293
|
+
}).annotate({
|
|
7294
|
+
"title": "InputMessage"
|
|
7295
|
+
});
|
|
7296
|
+
export const InputMessage = /*#__PURE__*/Schema.Struct({
|
|
7297
|
+
"content": Schema.Union([Schema.String, Schema.Array(InputContentBlock)]).annotate({
|
|
7298
|
+
"title": "Content"
|
|
7299
|
+
}),
|
|
7300
|
+
"role": Schema.Literals(["user", "assistant"]).annotate({
|
|
7301
|
+
"title": "Role"
|
|
7302
|
+
})
|
|
7303
|
+
}).annotate({
|
|
7304
|
+
"title": "InputMessage"
|
|
7305
|
+
});
|
|
7306
|
+
export const BetaCountMessageTokensParams = /*#__PURE__*/Schema.Struct({
|
|
7307
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
7308
|
+
mode: "oneOf"
|
|
7309
|
+
}), Schema.Null]).annotate({
|
|
7310
|
+
"title": "Cache Control",
|
|
7311
|
+
"description": "Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request."
|
|
7312
|
+
})),
|
|
7313
|
+
"context_management": Schema.optionalKey(Schema.Union([BetaContextManagementConfig, Schema.Null]).annotate({
|
|
7314
|
+
"description": "Context management configuration.\n\nThis allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not."
|
|
7315
|
+
})),
|
|
7316
|
+
"mcp_servers": Schema.optionalKey(Schema.Array(BetaRequestMCPServerURLDefinition).annotate({
|
|
7317
|
+
"title": "Mcp Servers",
|
|
7318
|
+
"description": "MCP servers to be utilized in this request"
|
|
7319
|
+
}).check(Schema.isMaxLength(20))),
|
|
7320
|
+
"messages": Schema.Array(BetaInputMessage).annotate({
|
|
5939
7321
|
"title": "Messages",
|
|
5940
7322
|
"description": "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nSee [input examples](https://docs.claude.com/en/api/messages-examples).\n\nNote that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API.\n\nThere is a limit of 100,000 messages in a single request."
|
|
5941
7323
|
}),
|
|
5942
7324
|
"model": Model,
|
|
5943
7325
|
"output_config": Schema.optionalKey(Schema.Struct({
|
|
5944
|
-
"effort": Schema.optionalKey(Schema.Union([
|
|
7326
|
+
"effort": Schema.optionalKey(Schema.Union([BetaEffortLevel, Schema.Null]).annotate({
|
|
5945
7327
|
"description": "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.\n\nValid values are `low`, `medium`, `high`, or `max`."
|
|
5946
7328
|
})),
|
|
5947
|
-
"format": Schema.optionalKey(Schema.Union([
|
|
7329
|
+
"format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
5948
7330
|
"description": "A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)"
|
|
5949
7331
|
}))
|
|
5950
7332
|
}).annotate({
|
|
5951
7333
|
"title": "OutputConfig",
|
|
5952
7334
|
"description": "Configuration options for the model's output, such as the output format."
|
|
5953
7335
|
})),
|
|
5954
|
-
"
|
|
7336
|
+
"output_format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
7337
|
+
"description": "Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)\n\nA schema to specify Claude's output format in responses. This parameter will be removed in a future release."
|
|
7338
|
+
})),
|
|
7339
|
+
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
7340
|
+
"description": "The inference speed mode for this request. `\"fast\"` enables high output-tokens-per-second inference."
|
|
7341
|
+
})),
|
|
7342
|
+
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(BetaRequestTextBlock)]).annotate({
|
|
5955
7343
|
"title": "System",
|
|
5956
7344
|
"description": "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts)."
|
|
5957
7345
|
})),
|
|
5958
|
-
"thinking": Schema.optionalKey(
|
|
5959
|
-
"tool_choice": Schema.optionalKey(
|
|
5960
|
-
"tools": Schema.optionalKey(Schema.Array(Schema.Union([
|
|
7346
|
+
"thinking": Schema.optionalKey(BetaThinkingConfigParam),
|
|
7347
|
+
"tool_choice": Schema.optionalKey(BetaToolChoice),
|
|
7348
|
+
"tools": Schema.optionalKey(Schema.Array(Schema.Union([BetaTool, BetaBashTool_20241022, BetaBashTool_20250124, BetaCodeExecutionTool_20250522, BetaCodeExecutionTool_20250825, BetaCodeExecutionTool_20260120, BetaComputerUseTool_20241022, BetaMemoryTool_20250818, BetaComputerUseTool_20250124, BetaTextEditor_20241022, BetaComputerUseTool_20251124, BetaTextEditor_20250124, BetaTextEditor_20250429, BetaTextEditor_20250728, BetaWebSearchTool_20250305, BetaWebFetchTool_20250910, BetaWebSearchTool_20260209, BetaWebFetchTool_20260209, BetaToolSearchToolBM25_20251119, BetaToolSearchToolRegex_20251119, BetaMCPToolset], {
|
|
5961
7349
|
mode: "oneOf"
|
|
5962
7350
|
})).annotate({
|
|
5963
7351
|
"title": "Tools",
|
|
@@ -5966,12 +7354,25 @@ export const CountMessageTokensParams = /*#__PURE__*/Schema.Struct({
|
|
|
5966
7354
|
}).annotate({
|
|
5967
7355
|
"title": "CountMessageTokensParams"
|
|
5968
7356
|
});
|
|
5969
|
-
export const
|
|
7357
|
+
export const BetaCreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
5970
7358
|
"model": Model,
|
|
5971
|
-
"messages": Schema.Array(
|
|
7359
|
+
"messages": Schema.Array(BetaInputMessage).annotate({
|
|
5972
7360
|
"title": "Messages",
|
|
5973
7361
|
"description": "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nSee [input examples](https://docs.claude.com/en/api/messages-examples).\n\nNote that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API.\n\nThere is a limit of 100,000 messages in a single request."
|
|
5974
7362
|
}),
|
|
7363
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
7364
|
+
mode: "oneOf"
|
|
7365
|
+
}), Schema.Null]).annotate({
|
|
7366
|
+
"title": "Cache Control",
|
|
7367
|
+
"description": "Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request."
|
|
7368
|
+
})),
|
|
7369
|
+
"container": Schema.optionalKey(Schema.Union([BetaContainerParams, Schema.String, Schema.Null]).annotate({
|
|
7370
|
+
"title": "Container",
|
|
7371
|
+
"description": "Container identifier for reuse across requests."
|
|
7372
|
+
})),
|
|
7373
|
+
"context_management": Schema.optionalKey(Schema.Union([BetaContextManagementConfig, Schema.Null]).annotate({
|
|
7374
|
+
"description": "Context management configuration.\n\nThis allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not."
|
|
7375
|
+
})),
|
|
5975
7376
|
"inference_geo": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
5976
7377
|
"title": "Inference Geo",
|
|
5977
7378
|
"description": "Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used."
|
|
@@ -5980,6 +7381,10 @@ export const CreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
5980
7381
|
"title": "Max Tokens",
|
|
5981
7382
|
"description": "The maximum number of tokens to generate before stopping.\n\nNote that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.\n\nDifferent models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details."
|
|
5982
7383
|
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(1)),
|
|
7384
|
+
"mcp_servers": Schema.optionalKey(Schema.Array(BetaRequestMCPServerURLDefinition).annotate({
|
|
7385
|
+
"title": "Mcp Servers",
|
|
7386
|
+
"description": "MCP servers to be utilized in this request"
|
|
7387
|
+
}).check(Schema.isMaxLength(20))),
|
|
5983
7388
|
"metadata": Schema.optionalKey(Schema.Struct({
|
|
5984
7389
|
"user_id": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxLength(256)), Schema.Null]).annotate({
|
|
5985
7390
|
"title": "User Id",
|
|
@@ -5990,20 +7395,26 @@ export const CreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
5990
7395
|
"description": "An object describing metadata about the request."
|
|
5991
7396
|
})),
|
|
5992
7397
|
"output_config": Schema.optionalKey(Schema.Struct({
|
|
5993
|
-
"effort": Schema.optionalKey(Schema.Union([
|
|
7398
|
+
"effort": Schema.optionalKey(Schema.Union([BetaEffortLevel, Schema.Null]).annotate({
|
|
5994
7399
|
"description": "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.\n\nValid values are `low`, `medium`, `high`, or `max`."
|
|
5995
7400
|
})),
|
|
5996
|
-
"format": Schema.optionalKey(Schema.Union([
|
|
7401
|
+
"format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
5997
7402
|
"description": "A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)"
|
|
5998
7403
|
}))
|
|
5999
7404
|
}).annotate({
|
|
6000
7405
|
"title": "OutputConfig",
|
|
6001
7406
|
"description": "Configuration options for the model's output, such as the output format."
|
|
6002
7407
|
})),
|
|
7408
|
+
"output_format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
7409
|
+
"description": "Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)\n\nA schema to specify Claude's output format in responses. This parameter will be removed in a future release."
|
|
7410
|
+
})),
|
|
6003
7411
|
"service_tier": Schema.optionalKey(Schema.Literals(["auto", "standard_only"]).annotate({
|
|
6004
7412
|
"title": "Service Tier",
|
|
6005
7413
|
"description": "Determines whether to use priority capacity (if available) or standard capacity for this request.\n\nAnthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details."
|
|
6006
7414
|
})),
|
|
7415
|
+
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
7416
|
+
"description": "The inference speed mode for this request. `\"fast\"` enables high output-tokens-per-second inference."
|
|
7417
|
+
})),
|
|
6007
7418
|
"stop_sequences": Schema.optionalKey(Schema.Array(Schema.String).annotate({
|
|
6008
7419
|
"title": "Stop Sequences",
|
|
6009
7420
|
"description": "Custom text sequences that will cause the model to stop generating.\n\nOur models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `\"end_turn\"`.\n\nIf you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `\"stop_sequence\"` and the response `stop_sequence` value will contain the matched stop sequence."
|
|
@@ -6012,7 +7423,7 @@ export const CreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6012
7423
|
"title": "Stream",
|
|
6013
7424
|
"description": "Whether to incrementally stream the response using server-sent events.\n\nSee [streaming](https://docs.claude.com/en/api/messages-streaming) for details."
|
|
6014
7425
|
})),
|
|
6015
|
-
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(
|
|
7426
|
+
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(BetaRequestTextBlock)]).annotate({
|
|
6016
7427
|
"title": "System",
|
|
6017
7428
|
"description": "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts)."
|
|
6018
7429
|
})),
|
|
@@ -6020,9 +7431,9 @@ export const CreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6020
7431
|
"title": "Temperature",
|
|
6021
7432
|
"description": "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic."
|
|
6022
7433
|
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
6023
|
-
"thinking": Schema.optionalKey(
|
|
6024
|
-
"tool_choice": Schema.optionalKey(
|
|
6025
|
-
"tools": Schema.optionalKey(Schema.Array(Schema.Union([
|
|
7434
|
+
"thinking": Schema.optionalKey(BetaThinkingConfigParam),
|
|
7435
|
+
"tool_choice": Schema.optionalKey(BetaToolChoice),
|
|
7436
|
+
"tools": Schema.optionalKey(Schema.Array(Schema.Union([BetaTool, BetaBashTool_20241022, BetaBashTool_20250124, BetaCodeExecutionTool_20250522, BetaCodeExecutionTool_20250825, BetaCodeExecutionTool_20260120, BetaComputerUseTool_20241022, BetaMemoryTool_20250818, BetaComputerUseTool_20250124, BetaTextEditor_20241022, BetaComputerUseTool_20251124, BetaTextEditor_20250124, BetaTextEditor_20250429, BetaTextEditor_20250728, BetaWebSearchTool_20250305, BetaWebFetchTool_20250910, BetaWebSearchTool_20260209, BetaWebFetchTool_20260209, BetaToolSearchToolBM25_20251119, BetaToolSearchToolRegex_20251119, BetaMCPToolset], {
|
|
6026
7437
|
mode: "oneOf"
|
|
6027
7438
|
})).annotate({
|
|
6028
7439
|
"title": "Tools",
|
|
@@ -6039,17 +7450,30 @@ export const CreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6039
7450
|
}).annotate({
|
|
6040
7451
|
"title": "CreateMessageParams"
|
|
6041
7452
|
});
|
|
6042
|
-
export const
|
|
7453
|
+
export const BetaMessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struct({
|
|
6043
7454
|
"custom_id": Schema.String.annotate({
|
|
6044
7455
|
"title": "Custom Id",
|
|
6045
7456
|
"description": "Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.\n\nMust be unique for each request within the Message Batch."
|
|
6046
7457
|
}).check(Schema.isMinLength(1)).check(Schema.isMaxLength(64)).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]{1,64}$"))),
|
|
6047
7458
|
"params": Schema.Struct({
|
|
6048
7459
|
"model": Model,
|
|
6049
|
-
"messages": Schema.Array(
|
|
7460
|
+
"messages": Schema.Array(BetaInputMessage).annotate({
|
|
6050
7461
|
"title": "Messages",
|
|
6051
7462
|
"description": "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nSee [input examples](https://docs.claude.com/en/api/messages-examples).\n\nNote that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API.\n\nThere is a limit of 100,000 messages in a single request."
|
|
6052
7463
|
}),
|
|
7464
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([BetaCacheControlEphemeral], {
|
|
7465
|
+
mode: "oneOf"
|
|
7466
|
+
}), Schema.Null]).annotate({
|
|
7467
|
+
"title": "Cache Control",
|
|
7468
|
+
"description": "Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request."
|
|
7469
|
+
})),
|
|
7470
|
+
"container": Schema.optionalKey(Schema.Union([BetaContainerParams, Schema.String, Schema.Null]).annotate({
|
|
7471
|
+
"title": "Container",
|
|
7472
|
+
"description": "Container identifier for reuse across requests."
|
|
7473
|
+
})),
|
|
7474
|
+
"context_management": Schema.optionalKey(Schema.Union([BetaContextManagementConfig, Schema.Null]).annotate({
|
|
7475
|
+
"description": "Context management configuration.\n\nThis allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not."
|
|
7476
|
+
})),
|
|
6053
7477
|
"inference_geo": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6054
7478
|
"title": "Inference Geo",
|
|
6055
7479
|
"description": "Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used."
|
|
@@ -6058,6 +7482,10 @@ export const MessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struct({
|
|
|
6058
7482
|
"title": "Max Tokens",
|
|
6059
7483
|
"description": "The maximum number of tokens to generate before stopping.\n\nNote that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.\n\nDifferent models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details."
|
|
6060
7484
|
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(1)),
|
|
7485
|
+
"mcp_servers": Schema.optionalKey(Schema.Array(BetaRequestMCPServerURLDefinition).annotate({
|
|
7486
|
+
"title": "Mcp Servers",
|
|
7487
|
+
"description": "MCP servers to be utilized in this request"
|
|
7488
|
+
}).check(Schema.isMaxLength(20))),
|
|
6061
7489
|
"metadata": Schema.optionalKey(Schema.Struct({
|
|
6062
7490
|
"user_id": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxLength(256)), Schema.Null]).annotate({
|
|
6063
7491
|
"title": "User Id",
|
|
@@ -6068,20 +7496,26 @@ export const MessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struct({
|
|
|
6068
7496
|
"description": "An object describing metadata about the request."
|
|
6069
7497
|
})),
|
|
6070
7498
|
"output_config": Schema.optionalKey(Schema.Struct({
|
|
6071
|
-
"effort": Schema.optionalKey(Schema.Union([
|
|
7499
|
+
"effort": Schema.optionalKey(Schema.Union([BetaEffortLevel, Schema.Null]).annotate({
|
|
6072
7500
|
"description": "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.\n\nValid values are `low`, `medium`, `high`, or `max`."
|
|
6073
7501
|
})),
|
|
6074
|
-
"format": Schema.optionalKey(Schema.Union([
|
|
7502
|
+
"format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
6075
7503
|
"description": "A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)"
|
|
6076
7504
|
}))
|
|
6077
7505
|
}).annotate({
|
|
6078
7506
|
"title": "OutputConfig",
|
|
6079
7507
|
"description": "Configuration options for the model's output, such as the output format."
|
|
6080
7508
|
})),
|
|
7509
|
+
"output_format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
7510
|
+
"description": "Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)\n\nA schema to specify Claude's output format in responses. This parameter will be removed in a future release."
|
|
7511
|
+
})),
|
|
6081
7512
|
"service_tier": Schema.optionalKey(Schema.Literals(["auto", "standard_only"]).annotate({
|
|
6082
7513
|
"title": "Service Tier",
|
|
6083
7514
|
"description": "Determines whether to use priority capacity (if available) or standard capacity for this request.\n\nAnthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details."
|
|
6084
7515
|
})),
|
|
7516
|
+
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
7517
|
+
"description": "The inference speed mode for this request. `\"fast\"` enables high output-tokens-per-second inference."
|
|
7518
|
+
})),
|
|
6085
7519
|
"stop_sequences": Schema.optionalKey(Schema.Array(Schema.String).annotate({
|
|
6086
7520
|
"title": "Stop Sequences",
|
|
6087
7521
|
"description": "Custom text sequences that will cause the model to stop generating.\n\nOur models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `\"end_turn\"`.\n\nIf you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `\"stop_sequence\"` and the response `stop_sequence` value will contain the matched stop sequence."
|
|
@@ -6090,7 +7524,7 @@ export const MessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struct({
|
|
|
6090
7524
|
"title": "Stream",
|
|
6091
7525
|
"description": "Whether to incrementally stream the response using server-sent events.\n\nSee [streaming](https://docs.claude.com/en/api/messages-streaming) for details."
|
|
6092
7526
|
})),
|
|
6093
|
-
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(
|
|
7527
|
+
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(BetaRequestTextBlock)]).annotate({
|
|
6094
7528
|
"title": "System",
|
|
6095
7529
|
"description": "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts)."
|
|
6096
7530
|
})),
|
|
@@ -6098,9 +7532,9 @@ export const MessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struct({
|
|
|
6098
7532
|
"title": "Temperature",
|
|
6099
7533
|
"description": "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic."
|
|
6100
7534
|
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
6101
|
-
"thinking": Schema.optionalKey(
|
|
6102
|
-
"tool_choice": Schema.optionalKey(
|
|
6103
|
-
"tools": Schema.optionalKey(Schema.Array(Schema.Union([
|
|
7535
|
+
"thinking": Schema.optionalKey(BetaThinkingConfigParam),
|
|
7536
|
+
"tool_choice": Schema.optionalKey(BetaToolChoice),
|
|
7537
|
+
"tools": Schema.optionalKey(Schema.Array(Schema.Union([BetaTool, BetaBashTool_20241022, BetaBashTool_20250124, BetaCodeExecutionTool_20250522, BetaCodeExecutionTool_20250825, BetaCodeExecutionTool_20260120, BetaComputerUseTool_20241022, BetaMemoryTool_20250818, BetaComputerUseTool_20250124, BetaTextEditor_20241022, BetaComputerUseTool_20251124, BetaTextEditor_20250124, BetaTextEditor_20250429, BetaTextEditor_20250728, BetaWebSearchTool_20250305, BetaWebFetchTool_20250910, BetaWebSearchTool_20260209, BetaWebFetchTool_20260209, BetaToolSearchToolBM25_20251119, BetaToolSearchToolRegex_20251119, BetaMCPToolset], {
|
|
6104
7538
|
mode: "oneOf"
|
|
6105
7539
|
})).annotate({
|
|
6106
7540
|
"title": "Tools",
|
|
@@ -6121,61 +7555,36 @@ export const MessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struct({
|
|
|
6121
7555
|
}).annotate({
|
|
6122
7556
|
"title": "MessageBatchIndividualRequestParams"
|
|
6123
7557
|
});
|
|
6124
|
-
export const
|
|
6125
|
-
"
|
|
6126
|
-
|
|
6127
|
-
}),
|
|
6128
|
-
|
|
6129
|
-
"
|
|
6130
|
-
})
|
|
6131
|
-
}).annotate({
|
|
6132
|
-
"title": "InputMessage"
|
|
6133
|
-
});
|
|
6134
|
-
export const CreateMessageBatchParams = /*#__PURE__*/Schema.Struct({
|
|
6135
|
-
"requests": Schema.Array(MessageBatchIndividualRequestParams).annotate({
|
|
6136
|
-
"title": "Requests",
|
|
6137
|
-
"description": "List of requests for prompt completion. Each is an individual request to create a Message."
|
|
6138
|
-
}).check(Schema.isMinLength(1)).check(Schema.isMaxLength(100000))
|
|
6139
|
-
}).annotate({
|
|
6140
|
-
"title": "CreateMessageBatchParams"
|
|
6141
|
-
});
|
|
6142
|
-
export const BetaCountMessageTokensParams = /*#__PURE__*/Schema.Struct({
|
|
6143
|
-
"context_management": Schema.optionalKey(Schema.Union([BetaContextManagementConfig, Schema.Null]).annotate({
|
|
6144
|
-
"description": "Context management configuration.\n\nThis allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not."
|
|
7558
|
+
export const CountMessageTokensParams = /*#__PURE__*/Schema.Struct({
|
|
7559
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
7560
|
+
mode: "oneOf"
|
|
7561
|
+
}), Schema.Null]).annotate({
|
|
7562
|
+
"title": "Cache Control",
|
|
7563
|
+
"description": "Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request."
|
|
6145
7564
|
})),
|
|
6146
|
-
"
|
|
6147
|
-
"title": "Mcp Servers",
|
|
6148
|
-
"description": "MCP servers to be utilized in this request"
|
|
6149
|
-
}).check(Schema.isMaxLength(20))),
|
|
6150
|
-
"messages": Schema.Array(BetaInputMessage).annotate({
|
|
7565
|
+
"messages": Schema.Array(InputMessage).annotate({
|
|
6151
7566
|
"title": "Messages",
|
|
6152
7567
|
"description": "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nSee [input examples](https://docs.claude.com/en/api/messages-examples).\n\nNote that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API.\n\nThere is a limit of 100,000 messages in a single request."
|
|
6153
7568
|
}),
|
|
6154
7569
|
"model": Model,
|
|
6155
7570
|
"output_config": Schema.optionalKey(Schema.Struct({
|
|
6156
|
-
"effort": Schema.optionalKey(Schema.Union([
|
|
7571
|
+
"effort": Schema.optionalKey(Schema.Union([EffortLevel, Schema.Null]).annotate({
|
|
6157
7572
|
"description": "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.\n\nValid values are `low`, `medium`, `high`, or `max`."
|
|
6158
7573
|
})),
|
|
6159
|
-
"format": Schema.optionalKey(Schema.Union([
|
|
7574
|
+
"format": Schema.optionalKey(Schema.Union([JsonOutputFormat, Schema.Null]).annotate({
|
|
6160
7575
|
"description": "A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)"
|
|
6161
7576
|
}))
|
|
6162
7577
|
}).annotate({
|
|
6163
7578
|
"title": "OutputConfig",
|
|
6164
7579
|
"description": "Configuration options for the model's output, such as the output format."
|
|
6165
7580
|
})),
|
|
6166
|
-
"
|
|
6167
|
-
"description": "Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)\n\nA schema to specify Claude's output format in responses. This parameter will be removed in a future release."
|
|
6168
|
-
})),
|
|
6169
|
-
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
6170
|
-
"description": "The inference speed mode for this request. `\"fast\"` enables high output-tokens-per-second inference."
|
|
6171
|
-
})),
|
|
6172
|
-
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(BetaRequestTextBlock)]).annotate({
|
|
7581
|
+
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(RequestTextBlock)]).annotate({
|
|
6173
7582
|
"title": "System",
|
|
6174
7583
|
"description": "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts)."
|
|
6175
7584
|
})),
|
|
6176
|
-
"thinking": Schema.optionalKey(
|
|
6177
|
-
"tool_choice": Schema.optionalKey(
|
|
6178
|
-
"tools": Schema.optionalKey(Schema.Array(Schema.Union([
|
|
7585
|
+
"thinking": Schema.optionalKey(ThinkingConfigParam),
|
|
7586
|
+
"tool_choice": Schema.optionalKey(ToolChoice),
|
|
7587
|
+
"tools": Schema.optionalKey(Schema.Array(Schema.Union([Tool, BashTool_20250124, CodeExecutionTool_20250522, CodeExecutionTool_20250825, CodeExecutionTool_20260120, MemoryTool_20250818, TextEditor_20250124, TextEditor_20250429, TextEditor_20250728, WebSearchTool_20250305, WebFetchTool_20250910, WebSearchTool_20260209, WebFetchTool_20260209, ToolSearchToolBM25_20251119, ToolSearchToolRegex_20251119], {
|
|
6179
7588
|
mode: "oneOf"
|
|
6180
7589
|
})).annotate({
|
|
6181
7590
|
"title": "Tools",
|
|
@@ -6184,19 +7593,22 @@ export const BetaCountMessageTokensParams = /*#__PURE__*/Schema.Struct({
|
|
|
6184
7593
|
}).annotate({
|
|
6185
7594
|
"title": "CountMessageTokensParams"
|
|
6186
7595
|
});
|
|
6187
|
-
export const
|
|
7596
|
+
export const CreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
6188
7597
|
"model": Model,
|
|
6189
|
-
"messages": Schema.Array(
|
|
7598
|
+
"messages": Schema.Array(InputMessage).annotate({
|
|
6190
7599
|
"title": "Messages",
|
|
6191
7600
|
"description": "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nSee [input examples](https://docs.claude.com/en/api/messages-examples).\n\nNote that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API.\n\nThere is a limit of 100,000 messages in a single request."
|
|
6192
7601
|
}),
|
|
6193
|
-
"
|
|
7602
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
7603
|
+
mode: "oneOf"
|
|
7604
|
+
}), Schema.Null]).annotate({
|
|
7605
|
+
"title": "Cache Control",
|
|
7606
|
+
"description": "Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request."
|
|
7607
|
+
})),
|
|
7608
|
+
"container": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6194
7609
|
"title": "Container",
|
|
6195
7610
|
"description": "Container identifier for reuse across requests."
|
|
6196
7611
|
})),
|
|
6197
|
-
"context_management": Schema.optionalKey(Schema.Union([BetaContextManagementConfig, Schema.Null]).annotate({
|
|
6198
|
-
"description": "Context management configuration.\n\nThis allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not."
|
|
6199
|
-
})),
|
|
6200
7612
|
"inference_geo": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6201
7613
|
"title": "Inference Geo",
|
|
6202
7614
|
"description": "Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used."
|
|
@@ -6205,10 +7617,6 @@ export const BetaCreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6205
7617
|
"title": "Max Tokens",
|
|
6206
7618
|
"description": "The maximum number of tokens to generate before stopping.\n\nNote that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.\n\nDifferent models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details."
|
|
6207
7619
|
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(1)),
|
|
6208
|
-
"mcp_servers": Schema.optionalKey(Schema.Array(BetaRequestMCPServerURLDefinition).annotate({
|
|
6209
|
-
"title": "Mcp Servers",
|
|
6210
|
-
"description": "MCP servers to be utilized in this request"
|
|
6211
|
-
}).check(Schema.isMaxLength(20))),
|
|
6212
7620
|
"metadata": Schema.optionalKey(Schema.Struct({
|
|
6213
7621
|
"user_id": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxLength(256)), Schema.Null]).annotate({
|
|
6214
7622
|
"title": "User Id",
|
|
@@ -6219,26 +7627,20 @@ export const BetaCreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6219
7627
|
"description": "An object describing metadata about the request."
|
|
6220
7628
|
})),
|
|
6221
7629
|
"output_config": Schema.optionalKey(Schema.Struct({
|
|
6222
|
-
"effort": Schema.optionalKey(Schema.Union([
|
|
7630
|
+
"effort": Schema.optionalKey(Schema.Union([EffortLevel, Schema.Null]).annotate({
|
|
6223
7631
|
"description": "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.\n\nValid values are `low`, `medium`, `high`, or `max`."
|
|
6224
7632
|
})),
|
|
6225
|
-
"format": Schema.optionalKey(Schema.Union([
|
|
7633
|
+
"format": Schema.optionalKey(Schema.Union([JsonOutputFormat, Schema.Null]).annotate({
|
|
6226
7634
|
"description": "A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)"
|
|
6227
7635
|
}))
|
|
6228
7636
|
}).annotate({
|
|
6229
7637
|
"title": "OutputConfig",
|
|
6230
7638
|
"description": "Configuration options for the model's output, such as the output format."
|
|
6231
7639
|
})),
|
|
6232
|
-
"output_format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
6233
|
-
"description": "Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)\n\nA schema to specify Claude's output format in responses. This parameter will be removed in a future release."
|
|
6234
|
-
})),
|
|
6235
7640
|
"service_tier": Schema.optionalKey(Schema.Literals(["auto", "standard_only"]).annotate({
|
|
6236
7641
|
"title": "Service Tier",
|
|
6237
7642
|
"description": "Determines whether to use priority capacity (if available) or standard capacity for this request.\n\nAnthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details."
|
|
6238
7643
|
})),
|
|
6239
|
-
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
6240
|
-
"description": "The inference speed mode for this request. `\"fast\"` enables high output-tokens-per-second inference."
|
|
6241
|
-
})),
|
|
6242
7644
|
"stop_sequences": Schema.optionalKey(Schema.Array(Schema.String).annotate({
|
|
6243
7645
|
"title": "Stop Sequences",
|
|
6244
7646
|
"description": "Custom text sequences that will cause the model to stop generating.\n\nOur models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `\"end_turn\"`.\n\nIf you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `\"stop_sequence\"` and the response `stop_sequence` value will contain the matched stop sequence."
|
|
@@ -6247,7 +7649,7 @@ export const BetaCreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6247
7649
|
"title": "Stream",
|
|
6248
7650
|
"description": "Whether to incrementally stream the response using server-sent events.\n\nSee [streaming](https://docs.claude.com/en/api/messages-streaming) for details."
|
|
6249
7651
|
})),
|
|
6250
|
-
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(
|
|
7652
|
+
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(RequestTextBlock)]).annotate({
|
|
6251
7653
|
"title": "System",
|
|
6252
7654
|
"description": "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts)."
|
|
6253
7655
|
})),
|
|
@@ -6255,9 +7657,9 @@ export const BetaCreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6255
7657
|
"title": "Temperature",
|
|
6256
7658
|
"description": "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic."
|
|
6257
7659
|
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
6258
|
-
"thinking": Schema.optionalKey(
|
|
6259
|
-
"tool_choice": Schema.optionalKey(
|
|
6260
|
-
"tools": Schema.optionalKey(Schema.Array(Schema.Union([
|
|
7660
|
+
"thinking": Schema.optionalKey(ThinkingConfigParam),
|
|
7661
|
+
"tool_choice": Schema.optionalKey(ToolChoice),
|
|
7662
|
+
"tools": Schema.optionalKey(Schema.Array(Schema.Union([Tool, BashTool_20250124, CodeExecutionTool_20250522, CodeExecutionTool_20250825, CodeExecutionTool_20260120, MemoryTool_20250818, TextEditor_20250124, TextEditor_20250429, TextEditor_20250728, WebSearchTool_20250305, WebFetchTool_20250910, WebSearchTool_20260209, WebFetchTool_20260209, ToolSearchToolBM25_20251119, ToolSearchToolRegex_20251119], {
|
|
6261
7663
|
mode: "oneOf"
|
|
6262
7664
|
})).annotate({
|
|
6263
7665
|
"title": "Tools",
|
|
@@ -6274,24 +7676,27 @@ export const BetaCreateMessageParams = /*#__PURE__*/Schema.Struct({
|
|
|
6274
7676
|
}).annotate({
|
|
6275
7677
|
"title": "CreateMessageParams"
|
|
6276
7678
|
});
|
|
6277
|
-
export const
|
|
7679
|
+
export const MessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struct({
|
|
6278
7680
|
"custom_id": Schema.String.annotate({
|
|
6279
7681
|
"title": "Custom Id",
|
|
6280
7682
|
"description": "Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.\n\nMust be unique for each request within the Message Batch."
|
|
6281
7683
|
}).check(Schema.isMinLength(1)).check(Schema.isMaxLength(64)).check(Schema.isPattern(new RegExp("^[a-zA-Z0-9_-]{1,64}$"))),
|
|
6282
7684
|
"params": Schema.Struct({
|
|
6283
7685
|
"model": Model,
|
|
6284
|
-
"messages": Schema.Array(
|
|
7686
|
+
"messages": Schema.Array(InputMessage).annotate({
|
|
6285
7687
|
"title": "Messages",
|
|
6286
7688
|
"description": "Input messages.\n\nOur models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello, Claude\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"Hello there.\"},\n {\"role\": \"assistant\", \"content\": \"Hi, I'm Claude. How can I help you?\"},\n {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from Claude:\n\n```json\n[\n {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello, Claude\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello, Claude\"}]}\n```\n\nSee [input examples](https://docs.claude.com/en/api/messages-examples).\n\nNote that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `\"system\"` role for input messages in the Messages API.\n\nThere is a limit of 100,000 messages in a single request."
|
|
6287
7689
|
}),
|
|
6288
|
-
"
|
|
7690
|
+
"cache_control": Schema.optionalKey(Schema.Union([Schema.Union([CacheControlEphemeral], {
|
|
7691
|
+
mode: "oneOf"
|
|
7692
|
+
}), Schema.Null]).annotate({
|
|
7693
|
+
"title": "Cache Control",
|
|
7694
|
+
"description": "Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request."
|
|
7695
|
+
})),
|
|
7696
|
+
"container": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6289
7697
|
"title": "Container",
|
|
6290
7698
|
"description": "Container identifier for reuse across requests."
|
|
6291
7699
|
})),
|
|
6292
|
-
"context_management": Schema.optionalKey(Schema.Union([BetaContextManagementConfig, Schema.Null]).annotate({
|
|
6293
|
-
"description": "Context management configuration.\n\nThis allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not."
|
|
6294
|
-
})),
|
|
6295
7700
|
"inference_geo": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]).annotate({
|
|
6296
7701
|
"title": "Inference Geo",
|
|
6297
7702
|
"description": "Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used."
|
|
@@ -6300,10 +7705,6 @@ export const BetaMessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struc
|
|
|
6300
7705
|
"title": "Max Tokens",
|
|
6301
7706
|
"description": "The maximum number of tokens to generate before stopping.\n\nNote that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.\n\nDifferent models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details."
|
|
6302
7707
|
}).check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(1)),
|
|
6303
|
-
"mcp_servers": Schema.optionalKey(Schema.Array(BetaRequestMCPServerURLDefinition).annotate({
|
|
6304
|
-
"title": "Mcp Servers",
|
|
6305
|
-
"description": "MCP servers to be utilized in this request"
|
|
6306
|
-
}).check(Schema.isMaxLength(20))),
|
|
6307
7708
|
"metadata": Schema.optionalKey(Schema.Struct({
|
|
6308
7709
|
"user_id": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxLength(256)), Schema.Null]).annotate({
|
|
6309
7710
|
"title": "User Id",
|
|
@@ -6314,26 +7715,20 @@ export const BetaMessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struc
|
|
|
6314
7715
|
"description": "An object describing metadata about the request."
|
|
6315
7716
|
})),
|
|
6316
7717
|
"output_config": Schema.optionalKey(Schema.Struct({
|
|
6317
|
-
"effort": Schema.optionalKey(Schema.Union([
|
|
7718
|
+
"effort": Schema.optionalKey(Schema.Union([EffortLevel, Schema.Null]).annotate({
|
|
6318
7719
|
"description": "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.\n\nValid values are `low`, `medium`, `high`, or `max`."
|
|
6319
7720
|
})),
|
|
6320
|
-
"format": Schema.optionalKey(Schema.Union([
|
|
7721
|
+
"format": Schema.optionalKey(Schema.Union([JsonOutputFormat, Schema.Null]).annotate({
|
|
6321
7722
|
"description": "A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)"
|
|
6322
7723
|
}))
|
|
6323
7724
|
}).annotate({
|
|
6324
7725
|
"title": "OutputConfig",
|
|
6325
7726
|
"description": "Configuration options for the model's output, such as the output format."
|
|
6326
7727
|
})),
|
|
6327
|
-
"output_format": Schema.optionalKey(Schema.Union([BetaJsonOutputFormat, Schema.Null]).annotate({
|
|
6328
|
-
"description": "Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)\n\nA schema to specify Claude's output format in responses. This parameter will be removed in a future release."
|
|
6329
|
-
})),
|
|
6330
7728
|
"service_tier": Schema.optionalKey(Schema.Literals(["auto", "standard_only"]).annotate({
|
|
6331
7729
|
"title": "Service Tier",
|
|
6332
7730
|
"description": "Determines whether to use priority capacity (if available) or standard capacity for this request.\n\nAnthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details."
|
|
6333
7731
|
})),
|
|
6334
|
-
"speed": Schema.optionalKey(Schema.Union([BetaSpeed, Schema.Null]).annotate({
|
|
6335
|
-
"description": "The inference speed mode for this request. `\"fast\"` enables high output-tokens-per-second inference."
|
|
6336
|
-
})),
|
|
6337
7732
|
"stop_sequences": Schema.optionalKey(Schema.Array(Schema.String).annotate({
|
|
6338
7733
|
"title": "Stop Sequences",
|
|
6339
7734
|
"description": "Custom text sequences that will cause the model to stop generating.\n\nOur models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `\"end_turn\"`.\n\nIf you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `\"stop_sequence\"` and the response `stop_sequence` value will contain the matched stop sequence."
|
|
@@ -6342,7 +7737,7 @@ export const BetaMessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struc
|
|
|
6342
7737
|
"title": "Stream",
|
|
6343
7738
|
"description": "Whether to incrementally stream the response using server-sent events.\n\nSee [streaming](https://docs.claude.com/en/api/messages-streaming) for details."
|
|
6344
7739
|
})),
|
|
6345
|
-
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(
|
|
7740
|
+
"system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(RequestTextBlock)]).annotate({
|
|
6346
7741
|
"title": "System",
|
|
6347
7742
|
"description": "System prompt.\n\nA system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts)."
|
|
6348
7743
|
})),
|
|
@@ -6350,9 +7745,9 @@ export const BetaMessageBatchIndividualRequestParams = /*#__PURE__*/Schema.Struc
|
|
|
6350
7745
|
"title": "Temperature",
|
|
6351
7746
|
"description": "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic."
|
|
6352
7747
|
}).check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(1))),
|
|
6353
|
-
"thinking": Schema.optionalKey(
|
|
6354
|
-
"tool_choice": Schema.optionalKey(
|
|
6355
|
-
"tools": Schema.optionalKey(Schema.Array(Schema.Union([
|
|
7748
|
+
"thinking": Schema.optionalKey(ThinkingConfigParam),
|
|
7749
|
+
"tool_choice": Schema.optionalKey(ToolChoice),
|
|
7750
|
+
"tools": Schema.optionalKey(Schema.Array(Schema.Union([Tool, BashTool_20250124, CodeExecutionTool_20250522, CodeExecutionTool_20250825, CodeExecutionTool_20260120, MemoryTool_20250818, TextEditor_20250124, TextEditor_20250429, TextEditor_20250728, WebSearchTool_20250305, WebFetchTool_20250910, WebSearchTool_20260209, WebFetchTool_20260209, ToolSearchToolBM25_20251119, ToolSearchToolRegex_20251119], {
|
|
6356
7751
|
mode: "oneOf"
|
|
6357
7752
|
})).annotate({
|
|
6358
7753
|
"title": "Tools",
|
|
@@ -6381,6 +7776,14 @@ export const BetaCreateMessageBatchParams = /*#__PURE__*/Schema.Struct({
|
|
|
6381
7776
|
}).annotate({
|
|
6382
7777
|
"title": "CreateMessageBatchParams"
|
|
6383
7778
|
});
|
|
7779
|
+
export const CreateMessageBatchParams = /*#__PURE__*/Schema.Struct({
|
|
7780
|
+
"requests": Schema.Array(MessageBatchIndividualRequestParams).annotate({
|
|
7781
|
+
"title": "Requests",
|
|
7782
|
+
"description": "List of requests for prompt completion. Each is an individual request to create a Message."
|
|
7783
|
+
}).check(Schema.isMinLength(1)).check(Schema.isMaxLength(100000))
|
|
7784
|
+
}).annotate({
|
|
7785
|
+
"title": "CreateMessageBatchParams"
|
|
7786
|
+
});
|
|
6384
7787
|
export const MessagesPostParams = /*#__PURE__*/Schema.Struct({
|
|
6385
7788
|
"anthropic-version": /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.String.annotate({
|
|
6386
7789
|
"title": "Anthropic-Version",
|
|
@@ -7259,7 +8662,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7259
8662
|
"4xx": decodeError("MessageBatchesRetrieve4XX", MessageBatchesRetrieve4XX),
|
|
7260
8663
|
orElse: unexpectedStatus
|
|
7261
8664
|
}))),
|
|
7262
|
-
"messageBatchesDelete": (messageBatchId, options) => HttpClientRequest.
|
|
8665
|
+
"messageBatchesDelete": (messageBatchId, options) => HttpClientRequest.delete(`/v1/messages/batches/${messageBatchId}`).pipe(HttpClientRequest.setHeaders({
|
|
7263
8666
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7264
8667
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|
|
7265
8668
|
}), withResponse(options?.config)(HttpClientResponse.matchStatus({
|
|
@@ -7318,7 +8721,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7318
8721
|
"4xx": decodeError("GetFileMetadataV1FilesFileIdGet4XX", GetFileMetadataV1FilesFileIdGet4XX),
|
|
7319
8722
|
orElse: unexpectedStatus
|
|
7320
8723
|
}))),
|
|
7321
|
-
"deleteFileV1FilesFileIdDelete": (fileId, options) => HttpClientRequest.
|
|
8724
|
+
"deleteFileV1FilesFileIdDelete": (fileId, options) => HttpClientRequest.delete(`/v1/files/${fileId}`).pipe(HttpClientRequest.setHeaders({
|
|
7322
8725
|
"anthropic-beta": options?.params?.["anthropic-beta"] ?? undefined,
|
|
7323
8726
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7324
8727
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|
|
@@ -7369,7 +8772,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7369
8772
|
"4xx": decodeError("GetSkillV1SkillsSkillIdGet4XX", GetSkillV1SkillsSkillIdGet4XX),
|
|
7370
8773
|
orElse: unexpectedStatus
|
|
7371
8774
|
}))),
|
|
7372
|
-
"deleteSkillV1SkillsSkillIdDelete": (skillId, options) => HttpClientRequest.
|
|
8775
|
+
"deleteSkillV1SkillsSkillIdDelete": (skillId, options) => HttpClientRequest.delete(`/v1/skills/${skillId}`).pipe(HttpClientRequest.setHeaders({
|
|
7373
8776
|
"anthropic-beta": options?.params?.["anthropic-beta"] ?? undefined,
|
|
7374
8777
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7375
8778
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|
|
@@ -7407,7 +8810,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7407
8810
|
"4xx": decodeError("GetSkillVersionV1SkillsSkillIdVersionsVersionGet4XX", GetSkillVersionV1SkillsSkillIdVersionsVersionGet4XX),
|
|
7408
8811
|
orElse: unexpectedStatus
|
|
7409
8812
|
}))),
|
|
7410
|
-
"deleteSkillVersionV1SkillsSkillIdVersionsVersionDelete": (skillId, version, options) => HttpClientRequest.
|
|
8813
|
+
"deleteSkillVersionV1SkillsSkillIdVersionsVersionDelete": (skillId, version, options) => HttpClientRequest.delete(`/v1/skills/${skillId}/versions/${version}`).pipe(HttpClientRequest.setHeaders({
|
|
7411
8814
|
"anthropic-beta": options?.params?.["anthropic-beta"] ?? undefined,
|
|
7412
8815
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7413
8816
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|
|
@@ -7476,7 +8879,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7476
8879
|
"4xx": decodeError("BetaMessageBatchesRetrieve4XX", BetaMessageBatchesRetrieve4XX),
|
|
7477
8880
|
orElse: unexpectedStatus
|
|
7478
8881
|
}))),
|
|
7479
|
-
"betaMessageBatchesDelete": (messageBatchId, options) => HttpClientRequest.
|
|
8882
|
+
"betaMessageBatchesDelete": (messageBatchId, options) => HttpClientRequest.delete(`/v1/messages/batches/${messageBatchId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
7480
8883
|
"anthropic-beta": options?.params?.["anthropic-beta"] ?? undefined,
|
|
7481
8884
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7482
8885
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|
|
@@ -7539,7 +8942,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7539
8942
|
"4xx": decodeError("BetaGetFileMetadataV1FilesFileIdGet4XX", BetaGetFileMetadataV1FilesFileIdGet4XX),
|
|
7540
8943
|
orElse: unexpectedStatus
|
|
7541
8944
|
}))),
|
|
7542
|
-
"betaDeleteFileV1FilesFileIdDelete": (fileId, options) => HttpClientRequest.
|
|
8945
|
+
"betaDeleteFileV1FilesFileIdDelete": (fileId, options) => HttpClientRequest.delete(`/v1/files/${fileId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
7543
8946
|
"anthropic-beta": options?.params?.["anthropic-beta"] ?? undefined,
|
|
7544
8947
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7545
8948
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|
|
@@ -7590,7 +8993,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7590
8993
|
"4xx": decodeError("BetaGetSkillV1SkillsSkillIdGet4XX", BetaGetSkillV1SkillsSkillIdGet4XX),
|
|
7591
8994
|
orElse: unexpectedStatus
|
|
7592
8995
|
}))),
|
|
7593
|
-
"betaDeleteSkillV1SkillsSkillIdDelete": (skillId, options) => HttpClientRequest.
|
|
8996
|
+
"betaDeleteSkillV1SkillsSkillIdDelete": (skillId, options) => HttpClientRequest.delete(`/v1/skills/${skillId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
7594
8997
|
"anthropic-beta": options?.params?.["anthropic-beta"] ?? undefined,
|
|
7595
8998
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7596
8999
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|
|
@@ -7628,7 +9031,7 @@ export const make = (httpClient, options = {}) => {
|
|
|
7628
9031
|
"4xx": decodeError("BetaGetSkillVersionV1SkillsSkillIdVersionsVersionGet4XX", BetaGetSkillVersionV1SkillsSkillIdVersionsVersionGet4XX),
|
|
7629
9032
|
orElse: unexpectedStatus
|
|
7630
9033
|
}))),
|
|
7631
|
-
"betaDeleteSkillVersionV1SkillsSkillIdVersionsVersionDelete": (skillId, version, options) => HttpClientRequest.
|
|
9034
|
+
"betaDeleteSkillVersionV1SkillsSkillIdVersionsVersionDelete": (skillId, version, options) => HttpClientRequest.delete(`/v1/skills/${skillId}/versions/${version}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
7632
9035
|
"anthropic-beta": options?.params?.["anthropic-beta"] ?? undefined,
|
|
7633
9036
|
"anthropic-version": options?.params?.["anthropic-version"] ?? undefined,
|
|
7634
9037
|
"x-api-key": options?.params?.["x-api-key"] ?? undefined
|