@retab/node 1.0.87 → 1.0.91
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/README.md +1 -1
- package/dist/api/extractions/client.d.ts +4 -8
- package/dist/api/extractions/client.d.ts.map +1 -1
- package/dist/api/extractions/client.js +4 -11
- package/dist/api/jobs/client.d.ts +54 -12
- package/dist/api/jobs/client.d.ts.map +1 -1
- package/dist/api/jobs/client.js +88 -4
- package/dist/api/projects/client.d.ts +1 -4
- package/dist/api/projects/client.d.ts.map +1 -1
- package/dist/api/projects/client.js +1 -7
- package/dist/api/workflows/runs/client.d.ts +171 -1
- package/dist/api/workflows/runs/client.d.ts.map +1 -1
- package/dist/api/workflows/runs/client.js +233 -6
- package/dist/api/workflows/runs/steps/client.d.ts +46 -0
- package/dist/api/workflows/runs/steps/client.d.ts.map +1 -0
- package/dist/api/workflows/runs/steps/client.js +62 -0
- package/dist/generated_types.d.ts +16346 -5904
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +408 -39
- package/dist/types.d.ts +5 -20
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/generated_types.js
CHANGED
|
@@ -117,7 +117,7 @@ export const ZJob = z.lazy(() => (z.object({
|
|
|
117
117
|
object: z.literal("job").default("job"),
|
|
118
118
|
status: z.union([z.literal("validating"), z.literal("queued"), z.literal("in_progress"), z.literal("completed"), z.literal("failed"), z.literal("cancelled"), z.literal("expired")]),
|
|
119
119
|
endpoint: z.union([z.literal("/v1/documents/extract"), z.literal("/v1/documents/parse"), z.literal("/v1/documents/split"), z.literal("/v1/documents/classify"), z.literal("/v1/schemas/generate"), z.literal("/v1/edit/agent/fill"), z.literal("/v1/edit/templates/fill"), z.literal("/v1/edit/templates/generate"), z.literal("/v1/projects/extract")]),
|
|
120
|
-
request: z.record(z.string(), z.any()),
|
|
120
|
+
request: z.record(z.string(), z.any()).nullable().optional(),
|
|
121
121
|
response: ZJobResponse.nullable().optional(),
|
|
122
122
|
error: ZJobError.nullable().optional(),
|
|
123
123
|
created_at: z.number(),
|
|
@@ -167,12 +167,10 @@ export const ZExtractionSettings = z.lazy(() => (ZInferenceSettings.schema).merg
|
|
|
167
167
|
})));
|
|
168
168
|
export const ZInferenceSettings = z.lazy(() => (z.object({
|
|
169
169
|
model: z.string().default("gpt-5-mini"),
|
|
170
|
-
temperature: z.number().default(0.0),
|
|
171
170
|
reasoning_effort: z.union([z.literal("none"), z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high"), z.literal("xhigh")]).nullable().optional().default("minimal"),
|
|
172
171
|
image_resolution_dpi: z.number().default(192),
|
|
173
172
|
n_consensus: z.number().default(1),
|
|
174
173
|
chunking_keys: z.record(z.string(), z.string()).nullable().optional(),
|
|
175
|
-
web_search: z.boolean().default(false),
|
|
176
174
|
})));
|
|
177
175
|
export const ZDistancesResult = z.lazy(() => (z.object({
|
|
178
176
|
distances: z.record(z.string(), z.any()),
|
|
@@ -247,15 +245,10 @@ export const ZComputationSpec = z.lazy(() => (z.object({
|
|
|
247
245
|
computations: z.record(z.string(), ZComputation),
|
|
248
246
|
})));
|
|
249
247
|
export const ZDraftConfig = z.lazy(() => (z.object({
|
|
250
|
-
inference_settings: ZInferenceSettings.default({ "model": "retab-small", "
|
|
248
|
+
inference_settings: ZInferenceSettings.default({ "model": "retab-small", "reasoning_effort": "minimal", "image_resolution_dpi": 192, "n_consensus": 1 }),
|
|
251
249
|
json_schema: z.record(z.string(), z.any()),
|
|
252
|
-
human_in_the_loop_criteria: z.array(ZHilCriterion),
|
|
253
250
|
computation_spec: ZComputationSpec,
|
|
254
251
|
})));
|
|
255
|
-
export const ZHilCriterion = z.lazy(() => (z.object({
|
|
256
|
-
path: z.string(),
|
|
257
|
-
agentic_fix: z.boolean().default(false),
|
|
258
|
-
})));
|
|
259
252
|
export const ZPatchBuilderDocumentRequest = z.lazy(() => (z.object({
|
|
260
253
|
extraction_id: z.string().nullable().optional(),
|
|
261
254
|
prediction_data: ZPredictionData.nullable().optional(),
|
|
@@ -269,32 +262,48 @@ export const ZStoredBuilderDocument = z.lazy(() => (ZBuilderDocument.schema).mer
|
|
|
269
262
|
export const ZStoredProject = z.lazy(() => (ZProject.schema).merge(z.object({
|
|
270
263
|
organization_id: z.string(),
|
|
271
264
|
})));
|
|
265
|
+
export const ZCancelWorkflowResponse = z.lazy(() => (z.object({
|
|
266
|
+
run: ZWorkflowRun,
|
|
267
|
+
cancellation_status: z.union([z.literal("cancelled"), z.literal("cancellation_requested"), z.literal("cancellation_failed")]).default("cancellation_requested"),
|
|
268
|
+
})));
|
|
272
269
|
export const ZHandlePayload = z.lazy(() => (z.object({
|
|
273
270
|
type: z.union([z.literal("file"), z.literal("json"), z.literal("text")]),
|
|
274
|
-
document:
|
|
271
|
+
document: ZBaseMIMEData.nullable().optional(),
|
|
275
272
|
data: z.record(z.any()).nullable().optional(),
|
|
276
273
|
text: z.string().nullable().optional(),
|
|
277
274
|
})));
|
|
278
|
-
export const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
275
|
+
export const ZResumeWorkflowResponse = z.lazy(() => (z.object({
|
|
276
|
+
run: ZWorkflowRun,
|
|
277
|
+
resume_status: z.union([z.literal("processing"), z.literal("queued"), z.literal("already_processed")]),
|
|
278
|
+
queue_position: z.number().nullable().optional(),
|
|
279
|
+
queue_item_id: z.string(),
|
|
280
|
+
})));
|
|
281
|
+
export const ZStepOutputResponse = z.lazy(() => (z.object({
|
|
282
|
+
node_id: z.string(),
|
|
283
|
+
node_type: z.string(),
|
|
284
|
+
node_label: z.string(),
|
|
285
|
+
status: z.string(),
|
|
286
|
+
output: z.record(z.any()).nullable().optional(),
|
|
287
|
+
handle_outputs: z.record(z.string(), z.any()).nullable().optional(),
|
|
288
|
+
handle_inputs: z.record(z.string(), z.any()).nullable().optional(),
|
|
289
|
+
})));
|
|
290
|
+
export const ZStepOutputsBatchResponse = z.lazy(() => (z.object({
|
|
291
|
+
outputs: z.record(z.string(), ZStepOutputResponse),
|
|
283
292
|
})));
|
|
284
293
|
export const ZStepStatus = z.lazy(() => (z.object({
|
|
285
294
|
node_id: z.string(),
|
|
286
295
|
node_type: z.union([z.literal("start"), z.literal("extract"), z.literal("split"), z.literal("end"), z.literal("hil")]),
|
|
287
296
|
node_label: z.string(),
|
|
288
|
-
status: z.union([z.literal("pending"), z.literal("running"), z.literal("completed"), z.literal("error"), z.literal("waiting_for_human")]),
|
|
297
|
+
status: z.union([z.literal("pending"), z.literal("running"), z.literal("completed"), z.literal("error"), z.literal("waiting_for_human"), z.literal("cancelled")]),
|
|
289
298
|
started_at: z.string().nullable().optional(),
|
|
290
299
|
completed_at: z.string().nullable().optional(),
|
|
291
300
|
duration_ms: z.number().nullable().optional(),
|
|
292
301
|
error: z.string().nullable().optional(),
|
|
293
302
|
output: z.record(z.any()).nullable().optional(),
|
|
294
303
|
handle_outputs: z.record(z.string(), ZHandlePayload).nullable().optional(),
|
|
295
|
-
input_document:
|
|
296
|
-
output_document:
|
|
297
|
-
split_documents: z.record(z.string(),
|
|
304
|
+
input_document: ZBaseMIMEData.nullable().optional(),
|
|
305
|
+
output_document: ZBaseMIMEData.nullable().optional(),
|
|
306
|
+
split_documents: z.record(z.string(), ZBaseMIMEData).nullable().optional(),
|
|
298
307
|
requires_human_review: z.boolean().nullable().optional(),
|
|
299
308
|
human_reviewed_at: z.string().nullable().optional(),
|
|
300
309
|
human_review_approved: z.boolean().nullable().optional(),
|
|
@@ -304,12 +313,12 @@ export const ZWorkflowRun = z.lazy(() => (z.object({
|
|
|
304
313
|
workflow_id: z.string(),
|
|
305
314
|
workflow_name: z.string(),
|
|
306
315
|
organization_id: z.string(),
|
|
307
|
-
status: z.union([z.literal("pending"), z.literal("running"), z.literal("completed"), z.literal("error"), z.literal("waiting_for_human")]).default("pending"),
|
|
316
|
+
status: z.union([z.literal("pending"), z.literal("running"), z.literal("completed"), z.literal("error"), z.literal("waiting_for_human"), z.literal("cancelled")]).default("pending"),
|
|
308
317
|
started_at: z.string(),
|
|
309
318
|
completed_at: z.string().nullable().optional(),
|
|
310
319
|
duration_ms: z.number().nullable().optional(),
|
|
311
320
|
steps: z.array(ZStepStatus),
|
|
312
|
-
input_documents: z.record(z.string(),
|
|
321
|
+
input_documents: z.record(z.string(), ZBaseMIMEData).nullable().optional(),
|
|
313
322
|
final_outputs: z.record(z.any()).nullable().optional(),
|
|
314
323
|
error: z.string().nullable().optional(),
|
|
315
324
|
created_at: z.string(),
|
|
@@ -320,7 +329,6 @@ export const ZWorkflowRun = z.lazy(() => (z.object({
|
|
|
320
329
|
export const ZGenerateSchemaRequest = z.lazy(() => (z.object({
|
|
321
330
|
documents: z.array(ZMIMEData),
|
|
322
331
|
model: z.string().default("gpt-5-mini"),
|
|
323
|
-
temperature: z.number().default(0.0),
|
|
324
332
|
reasoning_effort: z.union([z.literal("none"), z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high"), z.literal("xhigh")]).nullable().optional().default("minimal"),
|
|
325
333
|
instructions: z.string().nullable().optional(),
|
|
326
334
|
image_resolution_dpi: z.number().default(192),
|
|
@@ -365,7 +373,7 @@ export const ZSchema = z.lazy(() => (ZPartialSchema.schema).merge(z.object({
|
|
|
365
373
|
json_schema: z.record(z.string(), z.any()).default({}),
|
|
366
374
|
})));
|
|
367
375
|
export const ZMessageParam = z.lazy(() => (z.object({
|
|
368
|
-
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam, ZDocumentBlockParam, ZSearchResultBlockParam, ZThinkingBlockParam, ZRedactedThinkingBlockParam, ZToolUseBlockParam, ZToolResultBlockParam, ZServerToolUseBlockParam, ZWebSearchToolResultBlockParam, z.union([ZTextBlock, ZThinkingBlock, ZRedactedThinkingBlock, ZToolUseBlock, ZServerToolUseBlock, ZWebSearchToolResultBlock])]))]),
|
|
376
|
+
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam, ZDocumentBlockParam, ZSearchResultBlockParam, ZThinkingBlockParam, ZRedactedThinkingBlockParam, ZToolUseBlockParam, ZToolResultBlockParam, ZServerToolUseBlockParam, ZWebSearchToolResultBlockParam, ZWebFetchToolResultBlockParam, ZCodeExecutionToolResultBlockParam, ZBashCodeExecutionToolResultBlockParam, ZTextEditorCodeExecutionToolResultBlockParam, ZToolSearchToolResultBlockParam, ZContainerUploadBlockParam, z.union([ZTextBlock, ZThinkingBlock, ZRedactedThinkingBlock, ZToolUseBlock, ZServerToolUseBlock, ZWebSearchToolResultBlock, ZWebFetchToolResultBlock, ZCodeExecutionToolResultBlock, ZBashCodeExecutionToolResultBlock, ZTextEditorCodeExecutionToolResultBlock, ZToolSearchToolResultBlock, ZContainerUploadBlock])]))]),
|
|
369
377
|
role: z.union([z.literal("user"), z.literal("assistant")]),
|
|
370
378
|
})));
|
|
371
379
|
export const ZPartialSchema = z.lazy(() => (z.object({
|
|
@@ -513,7 +521,6 @@ export const ZRetabParsedChatCompletion = z.lazy(() => (ZParsedChatCompletion.sc
|
|
|
513
521
|
choices: z.array(ZRetabParsedChoice),
|
|
514
522
|
extraction_id: z.string().nullable().optional(),
|
|
515
523
|
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
516
|
-
requires_human_review: z.boolean().default(false),
|
|
517
524
|
request_at: z.string().nullable().optional(),
|
|
518
525
|
first_token_at: z.string().nullable().optional(),
|
|
519
526
|
last_token_at: z.string().nullable().optional(),
|
|
@@ -541,6 +548,7 @@ export const ZEditTemplate = z.lazy(() => (z.object({
|
|
|
541
548
|
name: z.string(),
|
|
542
549
|
file: ZBaseMIMEData,
|
|
543
550
|
form_fields: z.array(ZFormField),
|
|
551
|
+
field_count: z.number().default(0),
|
|
544
552
|
organization_id: z.string().nullable().optional(),
|
|
545
553
|
created_at: z.string(),
|
|
546
554
|
updated_at: z.string(),
|
|
@@ -610,6 +618,7 @@ export const ZSplitRequest = z.lazy(() => (z.object({
|
|
|
610
618
|
subdocuments: z.array(ZSubdocument),
|
|
611
619
|
model: z.string().default("retab-small"),
|
|
612
620
|
context: z.string().nullable().optional(),
|
|
621
|
+
n_consensus: z.number().default(1),
|
|
613
622
|
})));
|
|
614
623
|
export const ZSplitResponse = z.lazy(() => (z.object({
|
|
615
624
|
splits: z.array(ZSplitResult),
|
|
@@ -617,6 +626,8 @@ export const ZSplitResponse = z.lazy(() => (z.object({
|
|
|
617
626
|
export const ZSplitResult = z.lazy(() => (z.object({
|
|
618
627
|
name: z.string(),
|
|
619
628
|
pages: z.array(z.number()),
|
|
629
|
+
confidence: z.number().nullable().optional(),
|
|
630
|
+
votes: z.array(ZSplitVote),
|
|
620
631
|
partitions: z.array(ZPartition),
|
|
621
632
|
})));
|
|
622
633
|
export const ZSubdocument = z.lazy(() => (z.object({
|
|
@@ -689,6 +700,9 @@ export const ZSplitOutputItem = z.lazy(() => (z.object({
|
|
|
689
700
|
export const ZSplitOutputSchema = z.lazy(() => (z.object({
|
|
690
701
|
splits: z.array(ZSplitOutputItem),
|
|
691
702
|
})));
|
|
703
|
+
export const ZSplitVote = z.lazy(() => (z.object({
|
|
704
|
+
pages: z.array(z.number()),
|
|
705
|
+
})));
|
|
692
706
|
export const ZDocumentCreateInputRequest = z.lazy(() => (ZDocumentCreateMessageRequest.schema).merge(z.object({
|
|
693
707
|
json_schema: z.record(z.string(), z.any()),
|
|
694
708
|
})));
|
|
@@ -751,14 +765,9 @@ export const ZDocumentExtractRequest = z.lazy(() => (z.object({
|
|
|
751
765
|
image_resolution_dpi: z.number().default(192),
|
|
752
766
|
model: z.string(),
|
|
753
767
|
json_schema: z.record(z.string(), z.any()),
|
|
754
|
-
temperature: z.number().default(0.0),
|
|
755
|
-
reasoning_effort: z.union([z.literal("none"), z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high"), z.literal("xhigh")]).nullable().optional().default("minimal"),
|
|
756
768
|
n_consensus: z.number().default(1),
|
|
757
769
|
stream: z.boolean().default(false),
|
|
758
|
-
seed: z.number().nullable().optional(),
|
|
759
|
-
store: z.boolean().default(true),
|
|
760
770
|
chunking_keys: z.record(z.string(), z.string()).nullable().optional(),
|
|
761
|
-
web_search: z.boolean().default(false),
|
|
762
771
|
metadata: z.record(z.string(), z.string()),
|
|
763
772
|
extraction_id: z.string().nullable().optional(),
|
|
764
773
|
additional_messages: z.array(ZChatCompletionRetabMessage).nullable().optional(),
|
|
@@ -841,26 +850,65 @@ export const ZToolUseBlockParam = z.lazy(() => (z.object({
|
|
|
841
850
|
name: z.string(),
|
|
842
851
|
type: z.literal("tool_use"),
|
|
843
852
|
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
853
|
+
caller: z.union([ZDirectCallerParam, ZServerToolCallerParam, ZServerToolCaller20260120Param]),
|
|
844
854
|
})));
|
|
845
855
|
export const ZToolResultBlockParam = z.lazy(() => (z.object({
|
|
846
856
|
tool_use_id: z.string(),
|
|
847
857
|
type: z.literal("tool_result"),
|
|
848
858
|
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
849
|
-
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam, ZSearchResultBlockParam, ZDocumentBlockParam]))]),
|
|
859
|
+
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam, ZSearchResultBlockParam, ZDocumentBlockParam, ZToolReferenceBlockParam]))]),
|
|
850
860
|
is_error: z.boolean(),
|
|
851
861
|
})));
|
|
852
862
|
export const ZServerToolUseBlockParam = z.lazy(() => (z.object({
|
|
853
863
|
id: z.string(),
|
|
854
864
|
input: z.record(z.string(), z.object({}).passthrough()),
|
|
855
|
-
name: z.literal("web_search"),
|
|
865
|
+
name: z.union([z.literal("web_search"), z.literal("web_fetch"), z.literal("code_execution"), z.literal("bash_code_execution"), z.literal("text_editor_code_execution"), z.literal("tool_search_tool_regex"), z.literal("tool_search_tool_bm25")]),
|
|
856
866
|
type: z.literal("server_tool_use"),
|
|
857
867
|
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
868
|
+
caller: z.union([ZDirectCallerParam, ZServerToolCallerParam, ZServerToolCaller20260120Param]),
|
|
858
869
|
})));
|
|
859
870
|
export const ZWebSearchToolResultBlockParam = z.lazy(() => (z.object({
|
|
860
871
|
content: z.union([z.array(ZWebSearchResultBlockParam), ZWebSearchToolRequestErrorParam]),
|
|
861
872
|
tool_use_id: z.string(),
|
|
862
873
|
type: z.literal("web_search_tool_result"),
|
|
863
874
|
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
875
|
+
caller: z.union([ZDirectCallerParam, ZServerToolCallerParam, ZServerToolCaller20260120Param]),
|
|
876
|
+
})));
|
|
877
|
+
export const ZWebFetchToolResultBlockParam = z.lazy(() => (z.object({
|
|
878
|
+
content: z.union([ZWebFetchToolResultErrorBlockParam, ZWebFetchBlockParam]),
|
|
879
|
+
tool_use_id: z.string(),
|
|
880
|
+
type: z.literal("web_fetch_tool_result"),
|
|
881
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
882
|
+
caller: z.union([ZDirectCallerParam, ZServerToolCallerParam, ZServerToolCaller20260120Param]),
|
|
883
|
+
})));
|
|
884
|
+
export const ZCodeExecutionToolResultBlockParam = z.lazy(() => (z.object({
|
|
885
|
+
content: z.union([ZCodeExecutionToolResultErrorParam, ZCodeExecutionResultBlockParam, ZEncryptedCodeExecutionResultBlockParam]),
|
|
886
|
+
tool_use_id: z.string(),
|
|
887
|
+
type: z.literal("code_execution_tool_result"),
|
|
888
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
889
|
+
})));
|
|
890
|
+
export const ZBashCodeExecutionToolResultBlockParam = z.lazy(() => (z.object({
|
|
891
|
+
content: z.union([ZBashCodeExecutionToolResultErrorParam, ZBashCodeExecutionResultBlockParam]),
|
|
892
|
+
tool_use_id: z.string(),
|
|
893
|
+
type: z.literal("bash_code_execution_tool_result"),
|
|
894
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
895
|
+
})));
|
|
896
|
+
export const ZTextEditorCodeExecutionToolResultBlockParam = z.lazy(() => (z.object({
|
|
897
|
+
content: z.union([ZTextEditorCodeExecutionToolResultErrorParam, ZTextEditorCodeExecutionViewResultBlockParam, ZTextEditorCodeExecutionCreateResultBlockParam, ZTextEditorCodeExecutionStrReplaceResultBlockParam]),
|
|
898
|
+
tool_use_id: z.string(),
|
|
899
|
+
type: z.literal("text_editor_code_execution_tool_result"),
|
|
900
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
901
|
+
})));
|
|
902
|
+
export const ZToolSearchToolResultBlockParam = z.lazy(() => (z.object({
|
|
903
|
+
content: z.union([ZToolSearchToolResultErrorParam, ZToolSearchToolSearchResultBlockParam]),
|
|
904
|
+
tool_use_id: z.string(),
|
|
905
|
+
type: z.literal("tool_search_tool_result"),
|
|
906
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
907
|
+
})));
|
|
908
|
+
export const ZContainerUploadBlockParam = z.lazy(() => (z.object({
|
|
909
|
+
file_id: z.string(),
|
|
910
|
+
type: z.literal("container_upload"),
|
|
911
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
864
912
|
})));
|
|
865
913
|
export const ZTextBlock = z.lazy(() => (z.object({
|
|
866
914
|
citations: z.array(z.union([ZCitationCharLocation, ZCitationPageLocation, ZCitationContentBlockLocation, ZCitationsWebSearchResultLocation, ZCitationsSearchResultLocation])).nullable().optional(),
|
|
@@ -878,21 +926,54 @@ export const ZRedactedThinkingBlock = z.lazy(() => (z.object({
|
|
|
878
926
|
})));
|
|
879
927
|
export const ZToolUseBlock = z.lazy(() => (z.object({
|
|
880
928
|
id: z.string(),
|
|
929
|
+
caller: z.union([ZDirectCaller, ZServerToolCaller, ZServerToolCaller20260120]).nullable().optional(),
|
|
881
930
|
input: z.record(z.string(), z.object({}).passthrough()),
|
|
882
931
|
name: z.string(),
|
|
883
932
|
type: z.literal("tool_use"),
|
|
884
933
|
})));
|
|
885
934
|
export const ZServerToolUseBlock = z.lazy(() => (z.object({
|
|
886
935
|
id: z.string(),
|
|
936
|
+
caller: z.union([ZDirectCaller, ZServerToolCaller, ZServerToolCaller20260120]).nullable().optional(),
|
|
887
937
|
input: z.record(z.string(), z.object({}).passthrough()),
|
|
888
|
-
name: z.literal("web_search"),
|
|
938
|
+
name: z.union([z.literal("web_search"), z.literal("web_fetch"), z.literal("code_execution"), z.literal("bash_code_execution"), z.literal("text_editor_code_execution"), z.literal("tool_search_tool_regex"), z.literal("tool_search_tool_bm25")]),
|
|
889
939
|
type: z.literal("server_tool_use"),
|
|
890
940
|
})));
|
|
891
941
|
export const ZWebSearchToolResultBlock = z.lazy(() => (z.object({
|
|
942
|
+
caller: z.union([ZDirectCaller, ZServerToolCaller, ZServerToolCaller20260120]).nullable().optional(),
|
|
892
943
|
content: z.union([ZWebSearchToolResultError, z.array(ZWebSearchResultBlock)]),
|
|
893
944
|
tool_use_id: z.string(),
|
|
894
945
|
type: z.literal("web_search_tool_result"),
|
|
895
946
|
})));
|
|
947
|
+
export const ZWebFetchToolResultBlock = z.lazy(() => (z.object({
|
|
948
|
+
caller: z.union([ZDirectCaller, ZServerToolCaller, ZServerToolCaller20260120]).nullable().optional(),
|
|
949
|
+
content: z.union([ZWebFetchToolResultErrorBlock, ZWebFetchBlock]),
|
|
950
|
+
tool_use_id: z.string(),
|
|
951
|
+
type: z.literal("web_fetch_tool_result"),
|
|
952
|
+
})));
|
|
953
|
+
export const ZCodeExecutionToolResultBlock = z.lazy(() => (z.object({
|
|
954
|
+
content: z.union([ZCodeExecutionToolResultError, ZCodeExecutionResultBlock, ZEncryptedCodeExecutionResultBlock]),
|
|
955
|
+
tool_use_id: z.string(),
|
|
956
|
+
type: z.literal("code_execution_tool_result"),
|
|
957
|
+
})));
|
|
958
|
+
export const ZBashCodeExecutionToolResultBlock = z.lazy(() => (z.object({
|
|
959
|
+
content: z.union([ZBashCodeExecutionToolResultError, ZBashCodeExecutionResultBlock]),
|
|
960
|
+
tool_use_id: z.string(),
|
|
961
|
+
type: z.literal("bash_code_execution_tool_result"),
|
|
962
|
+
})));
|
|
963
|
+
export const ZTextEditorCodeExecutionToolResultBlock = z.lazy(() => (z.object({
|
|
964
|
+
content: z.union([ZTextEditorCodeExecutionToolResultError, ZTextEditorCodeExecutionViewResultBlock, ZTextEditorCodeExecutionCreateResultBlock, ZTextEditorCodeExecutionStrReplaceResultBlock]),
|
|
965
|
+
tool_use_id: z.string(),
|
|
966
|
+
type: z.literal("text_editor_code_execution_tool_result"),
|
|
967
|
+
})));
|
|
968
|
+
export const ZToolSearchToolResultBlock = z.lazy(() => (z.object({
|
|
969
|
+
content: z.union([ZToolSearchToolResultError, ZToolSearchToolSearchResultBlock]),
|
|
970
|
+
tool_use_id: z.string(),
|
|
971
|
+
type: z.literal("tool_search_tool_result"),
|
|
972
|
+
})));
|
|
973
|
+
export const ZContainerUploadBlock = z.lazy(() => (z.object({
|
|
974
|
+
file_id: z.string(),
|
|
975
|
+
type: z.literal("container_upload"),
|
|
976
|
+
})));
|
|
896
977
|
export const ZInputAudio = z.lazy(() => (z.object({
|
|
897
978
|
data: z.string(),
|
|
898
979
|
format: z.union([z.literal("wav"), z.literal("mp3")]),
|
|
@@ -1071,6 +1152,7 @@ export const ZShellCall = z.lazy(() => (z.object({
|
|
|
1071
1152
|
call_id: z.string(),
|
|
1072
1153
|
type: z.literal("shell_call"),
|
|
1073
1154
|
id: z.string().nullable().optional(),
|
|
1155
|
+
environment: z.union([ZLocalEnvironment, ZContainerReference]).nullable().optional().nullable().optional(),
|
|
1074
1156
|
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1075
1157
|
})));
|
|
1076
1158
|
export const ZShellCallOutput = z.lazy(() => (z.object({
|
|
@@ -1079,6 +1161,7 @@ export const ZShellCallOutput = z.lazy(() => (z.object({
|
|
|
1079
1161
|
type: z.literal("shell_call_output"),
|
|
1080
1162
|
id: z.string().nullable().optional(),
|
|
1081
1163
|
max_output_length: z.number().nullable().optional(),
|
|
1164
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1082
1165
|
})));
|
|
1083
1166
|
export const ZApplyPatchCall = z.lazy(() => (z.object({
|
|
1084
1167
|
call_id: z.string(),
|
|
@@ -1166,6 +1249,7 @@ export const ZResponseFunctionShellToolCall = z.lazy(() => (z.object({
|
|
|
1166
1249
|
id: z.string(),
|
|
1167
1250
|
action: ZAction,
|
|
1168
1251
|
call_id: z.string(),
|
|
1252
|
+
environment: z.union([ZResponseLocalEnvironment, ZResponseContainerReference]).nullable().optional().nullable().optional(),
|
|
1169
1253
|
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1170
1254
|
type: z.literal("shell_call"),
|
|
1171
1255
|
created_by: z.string().nullable().optional(),
|
|
@@ -1290,10 +1374,11 @@ export const ZCodeInterpreter = z.lazy(() => (z.object({
|
|
|
1290
1374
|
})));
|
|
1291
1375
|
export const ZImageGeneration = z.lazy(() => (z.object({
|
|
1292
1376
|
type: z.literal("image_generation"),
|
|
1377
|
+
action: z.union([z.literal("generate"), z.literal("edit"), z.literal("auto")]).nullable().optional(),
|
|
1293
1378
|
background: z.union([z.literal("transparent"), z.literal("opaque"), z.literal("auto")]).nullable().optional(),
|
|
1294
1379
|
input_fidelity: z.union([z.literal("high"), z.literal("low")]).nullable().optional(),
|
|
1295
1380
|
input_image_mask: ZImageGenerationInputImageMask.nullable().optional(),
|
|
1296
|
-
model: z.union([z.string(), z.union([z.literal("gpt-image-1"), z.literal("gpt-image-1-mini")])]).nullable().optional(),
|
|
1381
|
+
model: z.union([z.string(), z.union([z.literal("gpt-image-1"), z.literal("gpt-image-1-mini"), z.literal("gpt-image-1.5")])]).nullable().optional(),
|
|
1297
1382
|
moderation: z.union([z.literal("auto"), z.literal("low")]).nullable().optional(),
|
|
1298
1383
|
output_compression: z.number().nullable().optional(),
|
|
1299
1384
|
output_format: z.union([z.literal("png"), z.literal("webp"), z.literal("jpeg")]).nullable().optional(),
|
|
@@ -1306,6 +1391,7 @@ export const ZLocalShell = z.lazy(() => (z.object({
|
|
|
1306
1391
|
})));
|
|
1307
1392
|
export const ZFunctionShellTool = z.lazy(() => (z.object({
|
|
1308
1393
|
type: z.literal("shell"),
|
|
1394
|
+
environment: z.union([ZContainerAuto, ZLocalEnvironment, ZContainerReference]).nullable().optional().nullable().optional(),
|
|
1309
1395
|
})));
|
|
1310
1396
|
export const ZCustomTool = z.lazy(() => (z.object({
|
|
1311
1397
|
name: z.string(),
|
|
@@ -1541,6 +1627,7 @@ export const ZResponseInputParamShellCall = z.lazy(() => (z.object({
|
|
|
1541
1627
|
call_id: z.string(),
|
|
1542
1628
|
type: z.literal("shell_call"),
|
|
1543
1629
|
id: z.string().nullable().optional(),
|
|
1630
|
+
environment: z.union([ZLocalEnvironmentParam, ZContainerReferenceParam]).nullable().optional(),
|
|
1544
1631
|
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1545
1632
|
})));
|
|
1546
1633
|
export const ZResponseInputParamShellCallOutput = z.lazy(() => (z.object({
|
|
@@ -1549,6 +1636,7 @@ export const ZResponseInputParamShellCallOutput = z.lazy(() => (z.object({
|
|
|
1549
1636
|
type: z.literal("shell_call_output"),
|
|
1550
1637
|
id: z.string().nullable().optional(),
|
|
1551
1638
|
max_output_length: z.number().nullable().optional(),
|
|
1639
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1552
1640
|
})));
|
|
1553
1641
|
export const ZResponseInputParamApplyPatchCall = z.lazy(() => (z.object({
|
|
1554
1642
|
call_id: z.string(),
|
|
@@ -1639,6 +1727,22 @@ export const ZURLPDFSourceParam = z.lazy(() => (z.object({
|
|
|
1639
1727
|
export const ZCitationsConfigParam = z.lazy(() => (z.object({
|
|
1640
1728
|
enabled: z.boolean(),
|
|
1641
1729
|
})));
|
|
1730
|
+
export const ZDirectCallerParam = z.lazy(() => (z.object({
|
|
1731
|
+
type: z.literal("direct"),
|
|
1732
|
+
})));
|
|
1733
|
+
export const ZServerToolCallerParam = z.lazy(() => (z.object({
|
|
1734
|
+
tool_id: z.string(),
|
|
1735
|
+
type: z.literal("code_execution_20250825"),
|
|
1736
|
+
})));
|
|
1737
|
+
export const ZServerToolCaller20260120Param = z.lazy(() => (z.object({
|
|
1738
|
+
tool_id: z.string(),
|
|
1739
|
+
type: z.literal("code_execution_20260120"),
|
|
1740
|
+
})));
|
|
1741
|
+
export const ZToolReferenceBlockParam = z.lazy(() => (z.object({
|
|
1742
|
+
tool_name: z.string(),
|
|
1743
|
+
type: z.literal("tool_reference"),
|
|
1744
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1745
|
+
})));
|
|
1642
1746
|
export const ZWebSearchResultBlockParam = z.lazy(() => (z.object({
|
|
1643
1747
|
encrypted_content: z.string(),
|
|
1644
1748
|
title: z.string(),
|
|
@@ -1647,9 +1751,81 @@ export const ZWebSearchResultBlockParam = z.lazy(() => (z.object({
|
|
|
1647
1751
|
page_age: z.string().nullable().optional(),
|
|
1648
1752
|
})));
|
|
1649
1753
|
export const ZWebSearchToolRequestErrorParam = z.lazy(() => (z.object({
|
|
1650
|
-
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("max_uses_exceeded"), z.literal("too_many_requests"), z.literal("query_too_long")]),
|
|
1754
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("max_uses_exceeded"), z.literal("too_many_requests"), z.literal("query_too_long"), z.literal("request_too_large")]),
|
|
1651
1755
|
type: z.literal("web_search_tool_result_error"),
|
|
1652
1756
|
})));
|
|
1757
|
+
export const ZWebFetchToolResultErrorBlockParam = z.lazy(() => (z.object({
|
|
1758
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("url_too_long"), z.literal("url_not_allowed"), z.literal("url_not_accessible"), z.literal("unsupported_content_type"), z.literal("too_many_requests"), z.literal("max_uses_exceeded"), z.literal("unavailable")]),
|
|
1759
|
+
type: z.literal("web_fetch_tool_result_error"),
|
|
1760
|
+
})));
|
|
1761
|
+
export const ZWebFetchBlockParam = z.lazy(() => (z.object({
|
|
1762
|
+
content: ZDocumentBlockParam,
|
|
1763
|
+
type: z.literal("web_fetch_result"),
|
|
1764
|
+
url: z.string(),
|
|
1765
|
+
retrieved_at: z.string().nullable().optional(),
|
|
1766
|
+
})));
|
|
1767
|
+
export const ZCodeExecutionToolResultErrorParam = z.lazy(() => (z.object({
|
|
1768
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded")]),
|
|
1769
|
+
type: z.literal("code_execution_tool_result_error"),
|
|
1770
|
+
})));
|
|
1771
|
+
export const ZCodeExecutionResultBlockParam = z.lazy(() => (z.object({
|
|
1772
|
+
content: z.array(ZCodeExecutionOutputBlockParam),
|
|
1773
|
+
return_code: z.number(),
|
|
1774
|
+
stderr: z.string(),
|
|
1775
|
+
stdout: z.string(),
|
|
1776
|
+
type: z.literal("code_execution_result"),
|
|
1777
|
+
})));
|
|
1778
|
+
export const ZEncryptedCodeExecutionResultBlockParam = z.lazy(() => (z.object({
|
|
1779
|
+
content: z.array(ZCodeExecutionOutputBlockParam),
|
|
1780
|
+
encrypted_stdout: z.string(),
|
|
1781
|
+
return_code: z.number(),
|
|
1782
|
+
stderr: z.string(),
|
|
1783
|
+
type: z.literal("encrypted_code_execution_result"),
|
|
1784
|
+
})));
|
|
1785
|
+
export const ZBashCodeExecutionToolResultErrorParam = z.lazy(() => (z.object({
|
|
1786
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded"), z.literal("output_file_too_large")]),
|
|
1787
|
+
type: z.literal("bash_code_execution_tool_result_error"),
|
|
1788
|
+
})));
|
|
1789
|
+
export const ZBashCodeExecutionResultBlockParam = z.lazy(() => (z.object({
|
|
1790
|
+
content: z.array(ZBashCodeExecutionOutputBlockParam),
|
|
1791
|
+
return_code: z.number(),
|
|
1792
|
+
stderr: z.string(),
|
|
1793
|
+
stdout: z.string(),
|
|
1794
|
+
type: z.literal("bash_code_execution_result"),
|
|
1795
|
+
})));
|
|
1796
|
+
export const ZTextEditorCodeExecutionToolResultErrorParam = z.lazy(() => (z.object({
|
|
1797
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded"), z.literal("file_not_found")]),
|
|
1798
|
+
type: z.literal("text_editor_code_execution_tool_result_error"),
|
|
1799
|
+
error_message: z.string().nullable().optional(),
|
|
1800
|
+
})));
|
|
1801
|
+
export const ZTextEditorCodeExecutionViewResultBlockParam = z.lazy(() => (z.object({
|
|
1802
|
+
content: z.string(),
|
|
1803
|
+
file_type: z.union([z.literal("text"), z.literal("image"), z.literal("pdf")]),
|
|
1804
|
+
type: z.literal("text_editor_code_execution_view_result"),
|
|
1805
|
+
num_lines: z.number().nullable().optional(),
|
|
1806
|
+
start_line: z.number().nullable().optional(),
|
|
1807
|
+
total_lines: z.number().nullable().optional(),
|
|
1808
|
+
})));
|
|
1809
|
+
export const ZTextEditorCodeExecutionCreateResultBlockParam = z.lazy(() => (z.object({
|
|
1810
|
+
is_file_update: z.boolean(),
|
|
1811
|
+
type: z.literal("text_editor_code_execution_create_result"),
|
|
1812
|
+
})));
|
|
1813
|
+
export const ZTextEditorCodeExecutionStrReplaceResultBlockParam = z.lazy(() => (z.object({
|
|
1814
|
+
type: z.literal("text_editor_code_execution_str_replace_result"),
|
|
1815
|
+
lines: z.array(z.string()).nullable().optional(),
|
|
1816
|
+
new_lines: z.number().nullable().optional(),
|
|
1817
|
+
new_start: z.number().nullable().optional(),
|
|
1818
|
+
old_lines: z.number().nullable().optional(),
|
|
1819
|
+
old_start: z.number().nullable().optional(),
|
|
1820
|
+
})));
|
|
1821
|
+
export const ZToolSearchToolResultErrorParam = z.lazy(() => (z.object({
|
|
1822
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded")]),
|
|
1823
|
+
type: z.literal("tool_search_tool_result_error"),
|
|
1824
|
+
})));
|
|
1825
|
+
export const ZToolSearchToolSearchResultBlockParam = z.lazy(() => (z.object({
|
|
1826
|
+
tool_references: z.array(ZToolReferenceBlockParam),
|
|
1827
|
+
type: z.literal("tool_search_tool_search_result"),
|
|
1828
|
+
})));
|
|
1653
1829
|
export const ZCitationCharLocation = z.lazy(() => (z.object({
|
|
1654
1830
|
cited_text: z.string(),
|
|
1655
1831
|
document_index: z.number(),
|
|
@@ -1693,8 +1869,19 @@ export const ZCitationsSearchResultLocation = z.lazy(() => (z.object({
|
|
|
1693
1869
|
title: z.string().nullable().optional(),
|
|
1694
1870
|
type: z.literal("search_result_location"),
|
|
1695
1871
|
})));
|
|
1872
|
+
export const ZDirectCaller = z.lazy(() => (z.object({
|
|
1873
|
+
type: z.literal("direct"),
|
|
1874
|
+
})));
|
|
1875
|
+
export const ZServerToolCaller = z.lazy(() => (z.object({
|
|
1876
|
+
tool_id: z.string(),
|
|
1877
|
+
type: z.literal("code_execution_20250825"),
|
|
1878
|
+
})));
|
|
1879
|
+
export const ZServerToolCaller20260120 = z.lazy(() => (z.object({
|
|
1880
|
+
tool_id: z.string(),
|
|
1881
|
+
type: z.literal("code_execution_20260120"),
|
|
1882
|
+
})));
|
|
1696
1883
|
export const ZWebSearchToolResultError = z.lazy(() => (z.object({
|
|
1697
|
-
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("max_uses_exceeded"), z.literal("too_many_requests"), z.literal("query_too_long")]),
|
|
1884
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("max_uses_exceeded"), z.literal("too_many_requests"), z.literal("query_too_long"), z.literal("request_too_large")]),
|
|
1698
1885
|
type: z.literal("web_search_tool_result_error"),
|
|
1699
1886
|
})));
|
|
1700
1887
|
export const ZWebSearchResultBlock = z.lazy(() => (z.object({
|
|
@@ -1704,6 +1891,79 @@ export const ZWebSearchResultBlock = z.lazy(() => (z.object({
|
|
|
1704
1891
|
type: z.literal("web_search_result"),
|
|
1705
1892
|
url: z.string(),
|
|
1706
1893
|
})));
|
|
1894
|
+
export const ZWebFetchToolResultErrorBlock = z.lazy(() => (z.object({
|
|
1895
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("url_too_long"), z.literal("url_not_allowed"), z.literal("url_not_accessible"), z.literal("unsupported_content_type"), z.literal("too_many_requests"), z.literal("max_uses_exceeded"), z.literal("unavailable")]),
|
|
1896
|
+
type: z.literal("web_fetch_tool_result_error"),
|
|
1897
|
+
})));
|
|
1898
|
+
export const ZWebFetchBlock = z.lazy(() => (z.object({
|
|
1899
|
+
content: ZDocumentBlock,
|
|
1900
|
+
retrieved_at: z.string().nullable().optional(),
|
|
1901
|
+
type: z.literal("web_fetch_result"),
|
|
1902
|
+
url: z.string(),
|
|
1903
|
+
})));
|
|
1904
|
+
export const ZCodeExecutionToolResultError = z.lazy(() => (z.object({
|
|
1905
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded")]),
|
|
1906
|
+
type: z.literal("code_execution_tool_result_error"),
|
|
1907
|
+
})));
|
|
1908
|
+
export const ZCodeExecutionResultBlock = z.lazy(() => (z.object({
|
|
1909
|
+
content: z.array(ZCodeExecutionOutputBlock),
|
|
1910
|
+
return_code: z.number(),
|
|
1911
|
+
stderr: z.string(),
|
|
1912
|
+
stdout: z.string(),
|
|
1913
|
+
type: z.literal("code_execution_result"),
|
|
1914
|
+
})));
|
|
1915
|
+
export const ZEncryptedCodeExecutionResultBlock = z.lazy(() => (z.object({
|
|
1916
|
+
content: z.array(ZCodeExecutionOutputBlock),
|
|
1917
|
+
encrypted_stdout: z.string(),
|
|
1918
|
+
return_code: z.number(),
|
|
1919
|
+
stderr: z.string(),
|
|
1920
|
+
type: z.literal("encrypted_code_execution_result"),
|
|
1921
|
+
})));
|
|
1922
|
+
export const ZBashCodeExecutionToolResultError = z.lazy(() => (z.object({
|
|
1923
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded"), z.literal("output_file_too_large")]),
|
|
1924
|
+
type: z.literal("bash_code_execution_tool_result_error"),
|
|
1925
|
+
})));
|
|
1926
|
+
export const ZBashCodeExecutionResultBlock = z.lazy(() => (z.object({
|
|
1927
|
+
content: z.array(ZBashCodeExecutionOutputBlock),
|
|
1928
|
+
return_code: z.number(),
|
|
1929
|
+
stderr: z.string(),
|
|
1930
|
+
stdout: z.string(),
|
|
1931
|
+
type: z.literal("bash_code_execution_result"),
|
|
1932
|
+
})));
|
|
1933
|
+
export const ZTextEditorCodeExecutionToolResultError = z.lazy(() => (z.object({
|
|
1934
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded"), z.literal("file_not_found")]),
|
|
1935
|
+
error_message: z.string().nullable().optional(),
|
|
1936
|
+
type: z.literal("text_editor_code_execution_tool_result_error"),
|
|
1937
|
+
})));
|
|
1938
|
+
export const ZTextEditorCodeExecutionViewResultBlock = z.lazy(() => (z.object({
|
|
1939
|
+
content: z.string(),
|
|
1940
|
+
file_type: z.union([z.literal("text"), z.literal("image"), z.literal("pdf")]),
|
|
1941
|
+
num_lines: z.number().nullable().optional(),
|
|
1942
|
+
start_line: z.number().nullable().optional(),
|
|
1943
|
+
total_lines: z.number().nullable().optional(),
|
|
1944
|
+
type: z.literal("text_editor_code_execution_view_result"),
|
|
1945
|
+
})));
|
|
1946
|
+
export const ZTextEditorCodeExecutionCreateResultBlock = z.lazy(() => (z.object({
|
|
1947
|
+
is_file_update: z.boolean(),
|
|
1948
|
+
type: z.literal("text_editor_code_execution_create_result"),
|
|
1949
|
+
})));
|
|
1950
|
+
export const ZTextEditorCodeExecutionStrReplaceResultBlock = z.lazy(() => (z.object({
|
|
1951
|
+
lines: z.array(z.string()).nullable().optional(),
|
|
1952
|
+
new_lines: z.number().nullable().optional(),
|
|
1953
|
+
new_start: z.number().nullable().optional(),
|
|
1954
|
+
old_lines: z.number().nullable().optional(),
|
|
1955
|
+
old_start: z.number().nullable().optional(),
|
|
1956
|
+
type: z.literal("text_editor_code_execution_str_replace_result"),
|
|
1957
|
+
})));
|
|
1958
|
+
export const ZToolSearchToolResultError = z.lazy(() => (z.object({
|
|
1959
|
+
error_code: z.union([z.literal("invalid_tool_input"), z.literal("unavailable"), z.literal("too_many_requests"), z.literal("execution_time_exceeded")]),
|
|
1960
|
+
error_message: z.string().nullable().optional(),
|
|
1961
|
+
type: z.literal("tool_search_tool_result_error"),
|
|
1962
|
+
})));
|
|
1963
|
+
export const ZToolSearchToolSearchResultBlock = z.lazy(() => (z.object({
|
|
1964
|
+
tool_references: z.array(ZToolReferenceBlock),
|
|
1965
|
+
type: z.literal("tool_search_tool_search_result"),
|
|
1966
|
+
})));
|
|
1707
1967
|
export const ZParsedFunction = z.lazy(() => (ZChatCompletionMessageFunctionToolCallFunction.schema).merge(z.object({
|
|
1708
1968
|
parsed_arguments: z.object({}).passthrough().nullable().optional(),
|
|
1709
1969
|
})));
|
|
@@ -1817,11 +2077,11 @@ export const ZActionSearch = z.lazy(() => (z.object({
|
|
|
1817
2077
|
})));
|
|
1818
2078
|
export const ZActionOpenPage = z.lazy(() => (z.object({
|
|
1819
2079
|
type: z.literal("open_page"),
|
|
1820
|
-
url: z.string(),
|
|
2080
|
+
url: z.string().nullable().optional(),
|
|
1821
2081
|
})));
|
|
1822
2082
|
export const ZActionFind = z.lazy(() => (z.object({
|
|
1823
2083
|
pattern: z.string(),
|
|
1824
|
-
type: z.literal("
|
|
2084
|
+
type: z.literal("find_in_page"),
|
|
1825
2085
|
url: z.string(),
|
|
1826
2086
|
})));
|
|
1827
2087
|
export const ZResponseInputTextContent = z.lazy(() => (z.object({
|
|
@@ -1870,6 +2130,14 @@ export const ZShellCallAction = z.lazy(() => (z.object({
|
|
|
1870
2130
|
max_output_length: z.number().nullable().optional(),
|
|
1871
2131
|
timeout_ms: z.number().nullable().optional(),
|
|
1872
2132
|
})));
|
|
2133
|
+
export const ZLocalEnvironment = z.lazy(() => (z.object({
|
|
2134
|
+
type: z.literal("local"),
|
|
2135
|
+
skills: z.array(ZLocalSkill).nullable().optional(),
|
|
2136
|
+
})));
|
|
2137
|
+
export const ZContainerReference = z.lazy(() => (z.object({
|
|
2138
|
+
container_id: z.string(),
|
|
2139
|
+
type: z.literal("container_reference"),
|
|
2140
|
+
})));
|
|
1873
2141
|
export const ZResponseFunctionShellCallOutputContent = z.lazy(() => (z.object({
|
|
1874
2142
|
outcome: z.union([ZOutcomeTimeout, ZOutcomeExit]),
|
|
1875
2143
|
stderr: z.string(),
|
|
@@ -1908,6 +2176,13 @@ export const ZAction = z.lazy(() => (z.object({
|
|
|
1908
2176
|
max_output_length: z.number().nullable().optional(),
|
|
1909
2177
|
timeout_ms: z.number().nullable().optional(),
|
|
1910
2178
|
})));
|
|
2179
|
+
export const ZResponseLocalEnvironment = z.lazy(() => (z.object({
|
|
2180
|
+
type: z.literal("local"),
|
|
2181
|
+
})));
|
|
2182
|
+
export const ZResponseContainerReference = z.lazy(() => (z.object({
|
|
2183
|
+
container_id: z.string(),
|
|
2184
|
+
type: z.literal("container_reference"),
|
|
2185
|
+
})));
|
|
1911
2186
|
export const ZOutput = z.lazy(() => (z.object({
|
|
1912
2187
|
outcome: z.union([ZOutputOutcomeTimeout, ZOutputOutcomeExit]),
|
|
1913
2188
|
stderr: z.string(),
|
|
@@ -1970,11 +2245,19 @@ export const ZCodeInterpreterContainerCodeInterpreterToolAuto = z.lazy(() => (z.
|
|
|
1970
2245
|
type: z.literal("auto"),
|
|
1971
2246
|
file_ids: z.array(z.string()).nullable().optional(),
|
|
1972
2247
|
memory_limit: z.union([z.literal("1g"), z.literal("4g"), z.literal("16g"), z.literal("64g")]).nullable().optional(),
|
|
2248
|
+
network_policy: z.union([ZContainerNetworkPolicyDisabled, ZContainerNetworkPolicyAllowlist]).nullable().optional(),
|
|
1973
2249
|
})));
|
|
1974
2250
|
export const ZImageGenerationInputImageMask = z.lazy(() => (z.object({
|
|
1975
2251
|
file_id: z.string().nullable().optional(),
|
|
1976
2252
|
image_url: z.string().nullable().optional(),
|
|
1977
2253
|
})));
|
|
2254
|
+
export const ZContainerAuto = z.lazy(() => (z.object({
|
|
2255
|
+
type: z.literal("container_auto"),
|
|
2256
|
+
file_ids: z.array(z.string()).nullable().optional(),
|
|
2257
|
+
memory_limit: z.union([z.literal("1g"), z.literal("4g"), z.literal("16g"), z.literal("64g")]).nullable().optional(),
|
|
2258
|
+
network_policy: z.union([ZContainerNetworkPolicyDisabled, ZContainerNetworkPolicyAllowlist]).nullable().optional(),
|
|
2259
|
+
skills: z.array(z.union([ZSkillReference, ZInlineSkill])).nullable().optional(),
|
|
2260
|
+
})));
|
|
1978
2261
|
export const ZText = z.lazy(() => (z.object({
|
|
1979
2262
|
type: z.literal("text"),
|
|
1980
2263
|
})));
|
|
@@ -2129,11 +2412,11 @@ export const ZResponseFunctionWebSearchParamActionSearch = z.lazy(() => (z.objec
|
|
|
2129
2412
|
})));
|
|
2130
2413
|
export const ZResponseFunctionWebSearchParamActionOpenPage = z.lazy(() => (z.object({
|
|
2131
2414
|
type: z.literal("open_page"),
|
|
2132
|
-
url: z.string(),
|
|
2415
|
+
url: z.string().nullable().optional(),
|
|
2133
2416
|
})));
|
|
2134
2417
|
export const ZResponseFunctionWebSearchParamActionFind = z.lazy(() => (z.object({
|
|
2135
2418
|
pattern: z.string(),
|
|
2136
|
-
type: z.literal("
|
|
2419
|
+
type: z.literal("find_in_page"),
|
|
2137
2420
|
url: z.string(),
|
|
2138
2421
|
})));
|
|
2139
2422
|
export const ZResponseInputTextContentParam = z.lazy(() => (z.object({
|
|
@@ -2182,6 +2465,14 @@ export const ZResponseInputParamShellCallAction = z.lazy(() => (z.object({
|
|
|
2182
2465
|
max_output_length: z.number().nullable().optional(),
|
|
2183
2466
|
timeout_ms: z.number().nullable().optional(),
|
|
2184
2467
|
})));
|
|
2468
|
+
export const ZLocalEnvironmentParam = z.lazy(() => (z.object({
|
|
2469
|
+
type: z.literal("local"),
|
|
2470
|
+
skills: z.array(ZLocalSkillParam),
|
|
2471
|
+
})));
|
|
2472
|
+
export const ZContainerReferenceParam = z.lazy(() => (z.object({
|
|
2473
|
+
container_id: z.string(),
|
|
2474
|
+
type: z.literal("container_reference"),
|
|
2475
|
+
})));
|
|
2185
2476
|
export const ZResponseFunctionShellCallOutputContentParam = z.lazy(() => (z.object({
|
|
2186
2477
|
outcome: z.union([ZResponseFunctionShellCallOutputContentParamOutcomeTimeout, ZResponseFunctionShellCallOutputContentParamOutcomeExit]),
|
|
2187
2478
|
stderr: z.string(),
|
|
@@ -2207,6 +2498,32 @@ export const ZResponseInputParamMcpListToolsTool = z.lazy(() => (z.object({
|
|
|
2207
2498
|
annotations: z.object({}).passthrough().nullable().optional(),
|
|
2208
2499
|
description: z.string().nullable().optional(),
|
|
2209
2500
|
})));
|
|
2501
|
+
export const ZCodeExecutionOutputBlockParam = z.lazy(() => (z.object({
|
|
2502
|
+
file_id: z.string(),
|
|
2503
|
+
type: z.literal("code_execution_output"),
|
|
2504
|
+
})));
|
|
2505
|
+
export const ZBashCodeExecutionOutputBlockParam = z.lazy(() => (z.object({
|
|
2506
|
+
file_id: z.string(),
|
|
2507
|
+
type: z.literal("bash_code_execution_output"),
|
|
2508
|
+
})));
|
|
2509
|
+
export const ZDocumentBlock = z.lazy(() => (z.object({
|
|
2510
|
+
citations: ZCitationsConfig.nullable().optional(),
|
|
2511
|
+
source: z.union([ZBase64PDFSource, ZPlainTextSource]),
|
|
2512
|
+
title: z.string().nullable().optional(),
|
|
2513
|
+
type: z.literal("document"),
|
|
2514
|
+
})));
|
|
2515
|
+
export const ZCodeExecutionOutputBlock = z.lazy(() => (z.object({
|
|
2516
|
+
file_id: z.string(),
|
|
2517
|
+
type: z.literal("code_execution_output"),
|
|
2518
|
+
})));
|
|
2519
|
+
export const ZBashCodeExecutionOutputBlock = z.lazy(() => (z.object({
|
|
2520
|
+
file_id: z.string(),
|
|
2521
|
+
type: z.literal("bash_code_execution_output"),
|
|
2522
|
+
})));
|
|
2523
|
+
export const ZToolReferenceBlock = z.lazy(() => (z.object({
|
|
2524
|
+
tool_name: z.string(),
|
|
2525
|
+
type: z.literal("tool_reference"),
|
|
2526
|
+
})));
|
|
2210
2527
|
export const ZFunctionResponseBlobDict = z.lazy(() => (z.object({
|
|
2211
2528
|
mime_type: z.string().nullable().optional(),
|
|
2212
2529
|
data: z.instanceof(Uint8Array).nullable().optional(),
|
|
@@ -2257,6 +2574,11 @@ export const ZActionSearchSource = z.lazy(() => (z.object({
|
|
|
2257
2574
|
type: z.literal("url"),
|
|
2258
2575
|
url: z.string(),
|
|
2259
2576
|
})));
|
|
2577
|
+
export const ZLocalSkill = z.lazy(() => (z.object({
|
|
2578
|
+
description: z.string(),
|
|
2579
|
+
name: z.string(),
|
|
2580
|
+
path: z.string(),
|
|
2581
|
+
})));
|
|
2260
2582
|
export const ZOutcomeTimeout = z.lazy(() => (z.object({
|
|
2261
2583
|
type: z.literal("timeout"),
|
|
2262
2584
|
})));
|
|
@@ -2283,6 +2605,25 @@ export const ZMcpRequireApprovalMcpToolApprovalFilterNever = z.lazy(() => (z.obj
|
|
|
2283
2605
|
read_only: z.boolean().nullable().optional(),
|
|
2284
2606
|
tool_names: z.array(z.string()).nullable().optional(),
|
|
2285
2607
|
})));
|
|
2608
|
+
export const ZContainerNetworkPolicyDisabled = z.lazy(() => (z.object({
|
|
2609
|
+
type: z.literal("disabled"),
|
|
2610
|
+
})));
|
|
2611
|
+
export const ZContainerNetworkPolicyAllowlist = z.lazy(() => (z.object({
|
|
2612
|
+
allowed_domains: z.array(z.string()),
|
|
2613
|
+
type: z.literal("allowlist"),
|
|
2614
|
+
domain_secrets: z.array(ZContainerNetworkPolicyDomainSecret).nullable().optional(),
|
|
2615
|
+
})));
|
|
2616
|
+
export const ZSkillReference = z.lazy(() => (z.object({
|
|
2617
|
+
skill_id: z.string(),
|
|
2618
|
+
type: z.literal("skill_reference"),
|
|
2619
|
+
version: z.string().nullable().optional(),
|
|
2620
|
+
})));
|
|
2621
|
+
export const ZInlineSkill = z.lazy(() => (z.object({
|
|
2622
|
+
description: z.string(),
|
|
2623
|
+
name: z.string(),
|
|
2624
|
+
source: ZInlineSkillSource,
|
|
2625
|
+
type: z.literal("inline"),
|
|
2626
|
+
})));
|
|
2286
2627
|
export const ZAnnotation = z.lazy(() => (z.object({
|
|
2287
2628
|
type: z.literal("url_citation"),
|
|
2288
2629
|
url_citation: ZChatCompletionMessageAnnotationURLCitation,
|
|
@@ -2356,6 +2697,11 @@ export const ZResponseFunctionWebSearchParamActionSearchSource = z.lazy(() => (z
|
|
|
2356
2697
|
type: z.literal("url"),
|
|
2357
2698
|
url: z.string(),
|
|
2358
2699
|
})));
|
|
2700
|
+
export const ZLocalSkillParam = z.lazy(() => (z.object({
|
|
2701
|
+
description: z.string(),
|
|
2702
|
+
name: z.string(),
|
|
2703
|
+
path: z.string(),
|
|
2704
|
+
})));
|
|
2359
2705
|
export const ZResponseFunctionShellCallOutputContentParamOutcomeTimeout = z.lazy(() => (z.object({
|
|
2360
2706
|
type: z.literal("timeout"),
|
|
2361
2707
|
})));
|
|
@@ -2363,11 +2709,34 @@ export const ZResponseFunctionShellCallOutputContentParamOutcomeExit = z.lazy(()
|
|
|
2363
2709
|
exit_code: z.number(),
|
|
2364
2710
|
type: z.literal("exit"),
|
|
2365
2711
|
})));
|
|
2712
|
+
export const ZCitationsConfig = z.lazy(() => (z.object({
|
|
2713
|
+
enabled: z.boolean(),
|
|
2714
|
+
})));
|
|
2715
|
+
export const ZBase64PDFSource = z.lazy(() => (z.object({
|
|
2716
|
+
data: z.string(),
|
|
2717
|
+
media_type: z.literal("application/pdf"),
|
|
2718
|
+
type: z.literal("base64"),
|
|
2719
|
+
})));
|
|
2720
|
+
export const ZPlainTextSource = z.lazy(() => (z.object({
|
|
2721
|
+
data: z.string(),
|
|
2722
|
+
media_type: z.literal("text/plain"),
|
|
2723
|
+
type: z.literal("text"),
|
|
2724
|
+
})));
|
|
2366
2725
|
export const ZLogprobTopLogprob = z.lazy(() => (z.object({
|
|
2367
2726
|
token: z.string(),
|
|
2368
2727
|
bytes: z.array(z.number()),
|
|
2369
2728
|
logprob: z.number(),
|
|
2370
2729
|
})));
|
|
2730
|
+
export const ZContainerNetworkPolicyDomainSecret = z.lazy(() => (z.object({
|
|
2731
|
+
domain: z.string(),
|
|
2732
|
+
name: z.string(),
|
|
2733
|
+
value: z.string(),
|
|
2734
|
+
})));
|
|
2735
|
+
export const ZInlineSkillSource = z.lazy(() => (z.object({
|
|
2736
|
+
data: z.string(),
|
|
2737
|
+
media_type: z.literal("application/zip"),
|
|
2738
|
+
type: z.literal("base64"),
|
|
2739
|
+
})));
|
|
2371
2740
|
export const ZChatCompletionMessageAnnotationURLCitation = z.lazy(() => (z.object({
|
|
2372
2741
|
end_index: z.number(),
|
|
2373
2742
|
start_index: z.number(),
|