@retab/node 0.0.0-reserved → 0.0.43
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 +293 -2
- package/dist/api/client.d.ts +15 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +16 -0
- package/dist/api/consensus/client.d.ts +7 -0
- package/dist/api/consensus/client.d.ts.map +1 -0
- package/dist/api/consensus/client.js +14 -0
- package/dist/api/deployments/client.d.ts +20 -0
- package/dist/api/deployments/client.d.ts.map +1 -0
- package/dist/api/deployments/client.js +23 -0
- package/dist/api/documents/client.d.ts +10 -0
- package/dist/api/documents/client.d.ts.map +1 -0
- package/dist/api/documents/client.js +35 -0
- package/dist/api/models/client.d.ts +17 -0
- package/dist/api/models/client.d.ts.map +1 -0
- package/dist/api/models/client.js +15 -0
- package/dist/api/schemas/client.d.ts +12 -0
- package/dist/api/schemas/client.d.ts.map +1 -0
- package/dist/api/schemas/client.js +14 -0
- package/dist/client.d.ts +50 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +135 -0
- package/dist/errors.d.ts +34 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +53 -0
- package/dist/generated_types.d.ts +64373 -0
- package/dist/generated_types.d.ts.map +1 -0
- package/dist/generated_types.js +2267 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/mime.d.ts +5 -0
- package/dist/mime.d.ts.map +1 -0
- package/dist/mime.js +66 -0
- package/dist/resource.d.ts +12 -0
- package/dist/resource.d.ts.map +1 -0
- package/dist/resource.js +19 -0
- package/dist/resources/consensus/completions.d.ts +66 -0
- package/dist/resources/consensus/completions.d.ts.map +1 -0
- package/dist/resources/consensus/completions.js +84 -0
- package/dist/resources/consensus/index.d.ts +72 -0
- package/dist/resources/consensus/index.d.ts.map +1 -0
- package/dist/resources/consensus/index.js +76 -0
- package/dist/resources/consensus/responses.d.ts +69 -0
- package/dist/resources/consensus/responses.d.ts.map +1 -0
- package/dist/resources/consensus/responses.js +99 -0
- package/dist/resources/documents/extractions.d.ts +74 -0
- package/dist/resources/documents/extractions.d.ts.map +1 -0
- package/dist/resources/documents/extractions.js +196 -0
- package/dist/resources/documents/index.d.ts +21 -0
- package/dist/resources/documents/index.d.ts.map +1 -0
- package/dist/resources/documents/index.js +55 -0
- package/dist/resources/evaluations/documents.d.ts +40 -0
- package/dist/resources/evaluations/documents.d.ts.map +1 -0
- package/dist/resources/evaluations/documents.js +123 -0
- package/dist/resources/evaluations/index.d.ts +14 -0
- package/dist/resources/evaluations/index.d.ts.map +1 -0
- package/dist/resources/evaluations/index.js +17 -0
- package/dist/resources/evaluations/iterations.d.ts +50 -0
- package/dist/resources/evaluations/iterations.d.ts.map +1 -0
- package/dist/resources/evaluations/iterations.js +156 -0
- package/dist/resources/files.d.ts +82 -0
- package/dist/resources/files.d.ts.map +1 -0
- package/dist/resources/files.js +150 -0
- package/dist/resources/finetuning.d.ts +105 -0
- package/dist/resources/finetuning.d.ts.map +1 -0
- package/dist/resources/finetuning.js +181 -0
- package/dist/resources/index.d.ts +11 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +10 -0
- package/dist/resources/models.d.ts +57 -0
- package/dist/resources/models.d.ts.map +1 -0
- package/dist/resources/models.js +72 -0
- package/dist/resources/processors/automations/endpoints.d.ts +90 -0
- package/dist/resources/processors/automations/endpoints.d.ts.map +1 -0
- package/dist/resources/processors/automations/endpoints.js +145 -0
- package/dist/resources/processors/automations/index.d.ts +7 -0
- package/dist/resources/processors/automations/index.d.ts.map +1 -0
- package/dist/resources/processors/automations/index.js +6 -0
- package/dist/resources/processors/automations/links.d.ts +90 -0
- package/dist/resources/processors/automations/links.d.ts.map +1 -0
- package/dist/resources/processors/automations/links.js +149 -0
- package/dist/resources/processors/automations/logs.d.ts +35 -0
- package/dist/resources/processors/automations/logs.d.ts.map +1 -0
- package/dist/resources/processors/automations/logs.js +60 -0
- package/dist/resources/processors/automations/mailboxes.d.ts +102 -0
- package/dist/resources/processors/automations/mailboxes.d.ts.map +1 -0
- package/dist/resources/processors/automations/mailboxes.js +157 -0
- package/dist/resources/processors/automations/outlook.d.ts +114 -0
- package/dist/resources/processors/automations/outlook.d.ts.map +1 -0
- package/dist/resources/processors/automations/outlook.js +170 -0
- package/dist/resources/processors/automations/tests.d.ts +58 -0
- package/dist/resources/processors/automations/tests.d.ts.map +1 -0
- package/dist/resources/processors/automations/tests.js +90 -0
- package/dist/resources/processors/index.d.ts +303 -0
- package/dist/resources/processors/index.d.ts.map +1 -0
- package/dist/resources/processors/index.js +261 -0
- package/dist/resources/schemas.d.ts +63 -0
- package/dist/resources/schemas.d.ts.map +1 -0
- package/dist/resources/schemas.js +183 -0
- package/dist/resources/secrets/external_api_keys.d.ts +61 -0
- package/dist/resources/secrets/external_api_keys.d.ts.map +1 -0
- package/dist/resources/secrets/external_api_keys.js +120 -0
- package/dist/resources/secrets/index.d.ts +14 -0
- package/dist/resources/secrets/index.d.ts.map +1 -0
- package/dist/resources/secrets/index.js +17 -0
- package/dist/resources/secrets/webhooks.d.ts +73 -0
- package/dist/resources/secrets/webhooks.d.ts.map +1 -0
- package/dist/resources/secrets/webhooks.js +145 -0
- package/dist/resources/usage.d.ts +223 -0
- package/dist/resources/usage.d.ts.map +1 -0
- package/dist/resources/usage.js +310 -0
- package/dist/types/ai_models.d.ts +389 -0
- package/dist/types/ai_models.d.ts.map +1 -0
- package/dist/types/ai_models.js +145 -0
- package/dist/types/automations/cron.d.ts +28 -0
- package/dist/types/automations/cron.d.ts.map +1 -0
- package/dist/types/automations/cron.js +1 -0
- package/dist/types/automations/endpoints.d.ts +13 -0
- package/dist/types/automations/endpoints.d.ts.map +1 -0
- package/dist/types/automations/endpoints.js +1 -0
- package/dist/types/automations/index.d.ts +7 -0
- package/dist/types/automations/index.d.ts.map +1 -0
- package/dist/types/automations/index.js +6 -0
- package/dist/types/automations/links.d.ts +15 -0
- package/dist/types/automations/links.d.ts.map +1 -0
- package/dist/types/automations/links.js +1 -0
- package/dist/types/automations/mailboxes.d.ts +18 -0
- package/dist/types/automations/mailboxes.d.ts.map +1 -0
- package/dist/types/automations/mailboxes.js +1 -0
- package/dist/types/automations/outlook.d.ts +37 -0
- package/dist/types/automations/outlook.d.ts.map +1 -0
- package/dist/types/automations/outlook.js +1 -0
- package/dist/types/automations/webhooks.d.ts +13 -0
- package/dist/types/automations/webhooks.d.ts.map +1 -0
- package/dist/types/automations/webhooks.js +1 -0
- package/dist/types/browser_canvas.d.ts +4 -0
- package/dist/types/browser_canvas.d.ts.map +1 -0
- package/dist/types/browser_canvas.js +2 -0
- package/dist/types/chat.d.ts +99 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +20 -0
- package/dist/types/consensus.d.ts +10 -0
- package/dist/types/consensus.d.ts.map +1 -0
- package/dist/types/consensus.js +1 -0
- package/dist/types/db/annotations.d.ts +108 -0
- package/dist/types/db/annotations.d.ts.map +1 -0
- package/dist/types/db/annotations.js +6 -0
- package/dist/types/db/files.d.ts +133 -0
- package/dist/types/db/files.d.ts.map +1 -0
- package/dist/types/db/files.js +5 -0
- package/dist/types/documents/extractions.d.ts +1849 -0
- package/dist/types/documents/extractions.d.ts.map +1 -0
- package/dist/types/documents/extractions.js +211 -0
- package/dist/types/documents/processing.d.ts +249 -0
- package/dist/types/documents/processing.d.ts.map +1 -0
- package/dist/types/documents/processing.js +6 -0
- package/dist/types/evaluations/iterations.d.ts +41 -0
- package/dist/types/evaluations/iterations.d.ts.map +1 -0
- package/dist/types/evaluations/iterations.js +1 -0
- package/dist/types/jobs/base.d.ts +162 -0
- package/dist/types/jobs/base.d.ts.map +1 -0
- package/dist/types/jobs/base.js +6 -0
- package/dist/types/jobs/specialized.d.ts +200 -0
- package/dist/types/jobs/specialized.d.ts.map +1 -0
- package/dist/types/jobs/specialized.js +37 -0
- package/dist/types/logs.d.ts +92 -0
- package/dist/types/logs.d.ts.map +1 -0
- package/dist/types/logs.js +1 -0
- package/dist/types/mime.d.ts +426 -0
- package/dist/types/mime.d.ts.map +1 -0
- package/dist/types/mime.js +48 -0
- package/dist/types/modalities.d.ts +31 -0
- package/dist/types/modalities.d.ts.map +1 -0
- package/dist/types/modalities.js +109 -0
- package/dist/types/pagination.d.ts +5 -0
- package/dist/types/pagination.d.ts.map +1 -0
- package/dist/types/pagination.js +1 -0
- package/dist/types/schemas/enhancement.d.ts +250 -0
- package/dist/types/schemas/enhancement.d.ts.map +1 -0
- package/dist/types/schemas/enhancement.js +6 -0
- package/dist/types/schemas/generate.d.ts +160 -0
- package/dist/types/schemas/generate.d.ts.map +1 -0
- package/dist/types/schemas/generate.js +19 -0
- package/dist/types/schemas/object.d.ts +116 -0
- package/dist/types/schemas/object.d.ts.map +1 -0
- package/dist/types/schemas/object.js +861 -0
- package/dist/types/secrets/external_api_keys.d.ts +27 -0
- package/dist/types/secrets/external_api_keys.d.ts.map +1 -0
- package/dist/types/secrets/external_api_keys.js +11 -0
- package/dist/types/secrets/index.d.ts +2 -0
- package/dist/types/secrets/index.d.ts.map +1 -0
- package/dist/types/secrets/index.js +1 -0
- package/dist/types/standards.d.ts +37 -0
- package/dist/types/standards.d.ts.map +1 -0
- package/dist/types/standards.js +1 -0
- package/dist/types.d.ts +276 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +85 -0
- package/dist/utils/ai_models.d.ts +10 -0
- package/dist/utils/ai_models.d.ts.map +1 -0
- package/dist/utils/ai_models.js +183 -0
- package/dist/utils/batch_processing.d.ts +227 -0
- package/dist/utils/batch_processing.d.ts.map +1 -0
- package/dist/utils/batch_processing.js +268 -0
- package/dist/utils/benchmarking.d.ts +115 -0
- package/dist/utils/benchmarking.d.ts.map +1 -0
- package/dist/utils/benchmarking.js +355 -0
- package/dist/utils/chat.d.ts +70 -0
- package/dist/utils/chat.d.ts.map +1 -0
- package/dist/utils/chat.js +79 -0
- package/dist/utils/cost_calculation.d.ts +26 -0
- package/dist/utils/cost_calculation.d.ts.map +1 -0
- package/dist/utils/cost_calculation.js +99 -0
- package/dist/utils/datasets.d.ts +135 -0
- package/dist/utils/datasets.d.ts.map +1 -0
- package/dist/utils/datasets.js +359 -0
- package/dist/utils/display.d.ts +108 -0
- package/dist/utils/display.d.ts.map +1 -0
- package/dist/utils/display.js +244 -0
- package/dist/utils/hash.d.ts +18 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +31 -0
- package/dist/utils/hashing.d.ts +18 -0
- package/dist/utils/hashing.d.ts.map +1 -0
- package/dist/utils/hashing.js +28 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/json_schema.d.ts +18 -0
- package/dist/utils/json_schema.d.ts.map +1 -0
- package/dist/utils/json_schema.js +334 -0
- package/dist/utils/json_schema_utils.d.ts +42 -0
- package/dist/utils/json_schema_utils.d.ts.map +1 -0
- package/dist/utils/json_schema_utils.js +212 -0
- package/dist/utils/jsonl.d.ts +60 -0
- package/dist/utils/jsonl.d.ts.map +1 -0
- package/dist/utils/jsonl.js +259 -0
- package/dist/utils/mime.d.ts +6 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +129 -0
- package/dist/utils/model_cards.d.ts +219 -0
- package/dist/utils/model_cards.d.ts.map +1 -0
- package/dist/utils/model_cards.js +462 -0
- package/dist/utils/prompt_optimization.d.ts +96 -0
- package/dist/utils/prompt_optimization.d.ts.map +1 -0
- package/dist/utils/prompt_optimization.js +275 -0
- package/dist/utils/responses.d.ts +35 -0
- package/dist/utils/responses.d.ts.map +1 -0
- package/dist/utils/responses.js +37 -0
- package/dist/utils/stream.d.ts +13 -0
- package/dist/utils/stream.d.ts.map +1 -0
- package/dist/utils/stream.js +64 -0
- package/dist/utils/stream_context_managers.d.ts +147 -0
- package/dist/utils/stream_context_managers.d.ts.map +1 -0
- package/dist/utils/stream_context_managers.js +380 -0
- package/dist/utils/usage.d.ts +57 -0
- package/dist/utils/usage.d.ts.map +1 -0
- package/dist/utils/usage.js +97 -0
- package/dist/utils/webhook_secrets.d.ts +59 -0
- package/dist/utils/webhook_secrets.d.ts.map +1 -0
- package/dist/utils/webhook_secrets.js +107 -0
- package/dist/utils/zod_to_json_schema.d.ts +11 -0
- package/dist/utils/zod_to_json_schema.d.ts.map +1 -0
- package/dist/utils/zod_to_json_schema.js +123 -0
- package/dist/utils.d.ts +19 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +1 -0
- package/package.json +62 -6
- package/index.js +0 -7
|
@@ -0,0 +1,2267 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export const ZDistancesResult = z.lazy(() => z.object({
|
|
3
|
+
distances: z.record(z.string(), z.any()),
|
|
4
|
+
mean_distance: z.number(),
|
|
5
|
+
metric_type: z.union([z.literal("levenshtein"), z.literal("jaccard"), z.literal("hamming")]),
|
|
6
|
+
}));
|
|
7
|
+
export const ZItemMetric = z.lazy(() => z.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
similarity: z.number(),
|
|
11
|
+
similarities: z.record(z.string(), z.any()),
|
|
12
|
+
flat_similarities: z.record(z.string(), z.number().nullable().optional()),
|
|
13
|
+
aligned_similarity: z.number(),
|
|
14
|
+
aligned_similarities: z.record(z.string(), z.any()),
|
|
15
|
+
aligned_flat_similarities: z.record(z.string(), z.number().nullable().optional()),
|
|
16
|
+
}));
|
|
17
|
+
export const ZMetricResult = z.lazy(() => z.object({
|
|
18
|
+
item_metrics: z.array(ZItemMetric),
|
|
19
|
+
mean_similarity: z.number(),
|
|
20
|
+
aligned_mean_similarity: z.number(),
|
|
21
|
+
metric_type: z.union([z.literal("levenshtein"), z.literal("jaccard"), z.literal("hamming")]),
|
|
22
|
+
}));
|
|
23
|
+
export const ZMetricType = z.lazy(() => z.union([z.literal("levenshtein"), z.literal("jaccard"), z.literal("hamming")]));
|
|
24
|
+
export const ZAttachmentMIMEData = z.lazy(() => z.object({
|
|
25
|
+
filename: z.string(),
|
|
26
|
+
url: z.string(),
|
|
27
|
+
metadata: ZAttachmentMetadata.default({}),
|
|
28
|
+
}).merge(ZMIMEData.schema));
|
|
29
|
+
export const ZAttachmentMetadata = z.lazy(() => z.object({
|
|
30
|
+
is_inline: z.boolean().default(false),
|
|
31
|
+
inline_cid: z.string().nullable().optional(),
|
|
32
|
+
source: z.string().nullable().optional(),
|
|
33
|
+
}));
|
|
34
|
+
export const ZBaseAttachmentMIMEData = z.lazy(() => z.object({
|
|
35
|
+
filename: z.string(),
|
|
36
|
+
url: z.string(),
|
|
37
|
+
metadata: ZAttachmentMetadata.default({}),
|
|
38
|
+
}).merge(ZBaseMIMEData.schema));
|
|
39
|
+
export const ZBaseEmailData = z.lazy(() => z.object({
|
|
40
|
+
id: z.string(),
|
|
41
|
+
tree_id: z.string(),
|
|
42
|
+
subject: z.string().nullable().optional(),
|
|
43
|
+
body_plain: z.string().nullable().optional(),
|
|
44
|
+
body_html: z.string().nullable().optional(),
|
|
45
|
+
sender: ZEmailAddressData,
|
|
46
|
+
recipients_to: z.array(ZEmailAddressData),
|
|
47
|
+
recipients_cc: z.array(ZEmailAddressData).default([]),
|
|
48
|
+
recipients_bcc: z.array(ZEmailAddressData).default([]),
|
|
49
|
+
sent_at: z.string(),
|
|
50
|
+
received_at: z.string().nullable().optional(),
|
|
51
|
+
in_reply_to: z.string().nullable().optional(),
|
|
52
|
+
references: z.array(z.string()).default([]),
|
|
53
|
+
headers: z.record(z.string(), z.string()).default({}),
|
|
54
|
+
url: z.string().nullable().optional(),
|
|
55
|
+
attachments: z.array(ZBaseAttachmentMIMEData).default([]),
|
|
56
|
+
}));
|
|
57
|
+
export const ZBaseMIMEData = z.lazy(() => z.object({
|
|
58
|
+
filename: z.string(),
|
|
59
|
+
url: z.string(),
|
|
60
|
+
}).merge(ZMIMEData.schema));
|
|
61
|
+
export const ZEmailAddressData = z.lazy(() => z.object({
|
|
62
|
+
email: z.string(),
|
|
63
|
+
display_name: z.string().nullable().optional(),
|
|
64
|
+
}));
|
|
65
|
+
export const ZEmailData = z.lazy(() => z.object({
|
|
66
|
+
id: z.string(),
|
|
67
|
+
tree_id: z.string(),
|
|
68
|
+
subject: z.string().nullable().optional(),
|
|
69
|
+
body_plain: z.string().nullable().optional(),
|
|
70
|
+
body_html: z.string().nullable().optional(),
|
|
71
|
+
sender: ZEmailAddressData,
|
|
72
|
+
recipients_to: z.array(ZEmailAddressData),
|
|
73
|
+
recipients_cc: z.array(ZEmailAddressData).default([]),
|
|
74
|
+
recipients_bcc: z.array(ZEmailAddressData).default([]),
|
|
75
|
+
sent_at: z.string(),
|
|
76
|
+
received_at: z.string().nullable().optional(),
|
|
77
|
+
in_reply_to: z.string().nullable().optional(),
|
|
78
|
+
references: z.array(z.string()).default([]),
|
|
79
|
+
headers: z.record(z.string(), z.string()).default({}),
|
|
80
|
+
url: z.string().nullable().optional(),
|
|
81
|
+
attachments: z.array(ZAttachmentMIMEData).default([]),
|
|
82
|
+
}).merge(ZBaseEmailData.schema));
|
|
83
|
+
export const ZMIMEData = z.lazy(() => z.object({
|
|
84
|
+
filename: z.string(),
|
|
85
|
+
url: z.string(),
|
|
86
|
+
}));
|
|
87
|
+
export const ZMatrix = z.lazy(() => z.object({
|
|
88
|
+
rows: z.number(),
|
|
89
|
+
cols: z.number(),
|
|
90
|
+
type_: z.number(),
|
|
91
|
+
data: z.string(),
|
|
92
|
+
}));
|
|
93
|
+
export const ZOCR = z.lazy(() => z.object({
|
|
94
|
+
pages: z.array(ZPage),
|
|
95
|
+
}));
|
|
96
|
+
export const ZPage = z.lazy(() => z.object({
|
|
97
|
+
page_number: z.number(),
|
|
98
|
+
width: z.number(),
|
|
99
|
+
height: z.number(),
|
|
100
|
+
unit: z.string().default("pixels"),
|
|
101
|
+
blocks: z.array(ZTextBox),
|
|
102
|
+
lines: z.array(ZTextBox),
|
|
103
|
+
tokens: z.array(ZTextBox),
|
|
104
|
+
transforms: z.array(ZMatrix).default([]),
|
|
105
|
+
}));
|
|
106
|
+
export const ZPoint = z.lazy(() => z.object({
|
|
107
|
+
x: z.number(),
|
|
108
|
+
y: z.number(),
|
|
109
|
+
}));
|
|
110
|
+
export const ZTextBox = z.lazy(() => z.object({
|
|
111
|
+
width: z.number(),
|
|
112
|
+
height: z.number(),
|
|
113
|
+
center: ZPoint,
|
|
114
|
+
vertices: z.tuple([ZPoint, ZPoint, ZPoint, ZPoint]),
|
|
115
|
+
text: z.string(),
|
|
116
|
+
}));
|
|
117
|
+
export const ZAmount = z.lazy(() => z.object({
|
|
118
|
+
value: z.number(),
|
|
119
|
+
currency: z.string(),
|
|
120
|
+
}));
|
|
121
|
+
export const ZPredictionData = z.lazy(() => z.object({
|
|
122
|
+
prediction: z.record(z.string(), z.any()).default({}),
|
|
123
|
+
metadata: ZPredictionMetadata.nullable().optional(),
|
|
124
|
+
updated_at: z.string().nullable().optional(),
|
|
125
|
+
}));
|
|
126
|
+
export const ZPredictionMetadata = z.lazy(() => z.object({
|
|
127
|
+
extraction_id: z.string().nullable().optional(),
|
|
128
|
+
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
129
|
+
field_locations: z.record(z.string(), z.any()).nullable().optional(),
|
|
130
|
+
agentic_field_locations: z.record(z.string(), z.any()).nullable().optional(),
|
|
131
|
+
consensus_details: z.array(z.record(z.string(), z.any())).nullable().optional(),
|
|
132
|
+
api_cost: ZAmount.nullable().optional(),
|
|
133
|
+
}));
|
|
134
|
+
export const ZBrowserCanvas = z.lazy(() => z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]));
|
|
135
|
+
export const ZChatCompletion = z.lazy(() => z.object({
|
|
136
|
+
id: z.string(),
|
|
137
|
+
choices: z.array(ZChoice),
|
|
138
|
+
created: z.number(),
|
|
139
|
+
model: z.string(),
|
|
140
|
+
object: z.literal("chat.completion"),
|
|
141
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
142
|
+
system_fingerprint: z.string().nullable().optional(),
|
|
143
|
+
usage: ZCompletionUsage.nullable().optional(),
|
|
144
|
+
}));
|
|
145
|
+
export const ZChatCompletionReasoningEffort = z.lazy(() => z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional());
|
|
146
|
+
export const ZChatCompletionRetabMessage = z.lazy(() => z.object({
|
|
147
|
+
role: z.union([z.literal("user"), z.literal("system"), z.literal("assistant"), z.literal("developer")]),
|
|
148
|
+
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartImageParam, ZChatCompletionContentPartInputAudioParam, ZFile]))]),
|
|
149
|
+
}));
|
|
150
|
+
export const ZCostBreakdown = z.lazy(() => z.object({
|
|
151
|
+
total: ZAmount,
|
|
152
|
+
text_prompt_cost: ZAmount,
|
|
153
|
+
text_cached_cost: ZAmount,
|
|
154
|
+
text_completion_cost: ZAmount,
|
|
155
|
+
text_total_cost: ZAmount,
|
|
156
|
+
audio_prompt_cost: ZAmount.nullable().optional(),
|
|
157
|
+
audio_completion_cost: ZAmount.nullable().optional(),
|
|
158
|
+
audio_total_cost: ZAmount.nullable().optional(),
|
|
159
|
+
token_counts: ZTokenCounts,
|
|
160
|
+
model: z.string(),
|
|
161
|
+
is_fine_tuned: z.boolean().default(false),
|
|
162
|
+
}));
|
|
163
|
+
export const ZExtraction = z.lazy(() => z.object({
|
|
164
|
+
id: z.string(),
|
|
165
|
+
messages: z.array(ZChatCompletionRetabMessage),
|
|
166
|
+
messages_gcs: z.string(),
|
|
167
|
+
file_gcs_paths: z.array(z.string()),
|
|
168
|
+
file_ids: z.array(z.string()),
|
|
169
|
+
file_gcs: z.string().default(""),
|
|
170
|
+
file_id: z.string().default(""),
|
|
171
|
+
status: z.union([z.literal("success"), z.literal("failed")]),
|
|
172
|
+
completion: z.union([ZRetabParsedChatCompletion, ZChatCompletion]),
|
|
173
|
+
json_schema: z.any(),
|
|
174
|
+
model: z.string(),
|
|
175
|
+
temperature: z.number().default(0.0),
|
|
176
|
+
source: ZExtractionSource,
|
|
177
|
+
image_resolution_dpi: z.number().default(96),
|
|
178
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
179
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]).default("native"),
|
|
180
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
181
|
+
n_consensus: z.number().default(1),
|
|
182
|
+
timings: z.array(ZExtractionTimingStep),
|
|
183
|
+
schema_id: z.string(),
|
|
184
|
+
schema_data_id: z.string(),
|
|
185
|
+
created_at: z.string(),
|
|
186
|
+
request_at: z.string().nullable().optional(),
|
|
187
|
+
organization_id: z.string(),
|
|
188
|
+
validation_state: z.union([z.literal("pending"), z.literal("validated"), z.literal("invalid")]).nullable().optional(),
|
|
189
|
+
billed: z.boolean().default(false),
|
|
190
|
+
}));
|
|
191
|
+
export const ZExtractionSource = z.lazy(() => z.object({
|
|
192
|
+
type: z.union([z.literal("api"), z.literal("annotation"), z.literal("processor"), z.literal("automation"), z.literal("automation.link"), z.literal("automation.mailbox"), z.literal("automation.cron"), z.literal("automation.outlook"), z.literal("automation.endpoint"), z.literal("schema.extract")]),
|
|
193
|
+
id: z.string().nullable().optional(),
|
|
194
|
+
}));
|
|
195
|
+
export const ZExtractionSteps = z.lazy(() => z.union([z.string(), z.union([z.literal("initialization"), z.literal("prepare_messages"), z.literal("yield_first_token"), z.literal("completion")])]));
|
|
196
|
+
export const ZExtractionTimingStep = z.lazy(() => z.object({
|
|
197
|
+
name: z.union([z.string(), z.union([z.literal("initialization"), z.literal("prepare_messages"), z.literal("yield_first_token"), z.literal("completion")])]),
|
|
198
|
+
duration: z.number(),
|
|
199
|
+
notes: z.string().nullable().optional(),
|
|
200
|
+
}));
|
|
201
|
+
export const ZModality = z.lazy(() => z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]));
|
|
202
|
+
export const ZRetabParsedChatCompletion = z.lazy(() => z.object({
|
|
203
|
+
id: z.string(),
|
|
204
|
+
choices: z.array(ZRetabParsedChoice),
|
|
205
|
+
created: z.number(),
|
|
206
|
+
model: z.string(),
|
|
207
|
+
object: z.literal("chat.completion"),
|
|
208
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
209
|
+
system_fingerprint: z.string().nullable().optional(),
|
|
210
|
+
usage: ZCompletionUsage.nullable().optional(),
|
|
211
|
+
extraction_id: z.string().nullable().optional(),
|
|
212
|
+
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
213
|
+
schema_validation_error: ZErrorDetail.nullable().optional(),
|
|
214
|
+
request_at: z.string().nullable().optional(),
|
|
215
|
+
first_token_at: z.string().nullable().optional(),
|
|
216
|
+
last_token_at: z.string().nullable().optional(),
|
|
217
|
+
}).merge(ZParsedChatCompletion.schema));
|
|
218
|
+
export const ZValidationsState = z.lazy(() => z.union([z.literal("pending"), z.literal("validated"), z.literal("invalid")]));
|
|
219
|
+
export const ZEvent = z.lazy(() => z.object({
|
|
220
|
+
object: z.literal("event").default("event"),
|
|
221
|
+
id: z.string(),
|
|
222
|
+
event: z.string(),
|
|
223
|
+
created_at: z.string(),
|
|
224
|
+
data: z.record(z.string(), z.any()),
|
|
225
|
+
metadata: z.record(z.union([z.literal("automation"), z.literal("cron"), z.literal("data_structure"), z.literal("dataset"), z.literal("dataset_membership"), z.literal("endpoint"), z.literal("evaluation"), z.literal("extraction"), z.literal("file"), z.literal("files"), z.literal("link"), z.literal("mailbox"), z.literal("organization"), z.literal("outlook"), z.literal("preprocessing"), z.literal("reconciliation"), z.literal("schema"), z.literal("schema_data"), z.literal("template"), z.literal("user"), z.literal("webhook")]), z.string()).nullable().optional(),
|
|
226
|
+
}));
|
|
227
|
+
export const ZStoredEvent = z.lazy(() => z.object({
|
|
228
|
+
object: z.literal("event").default("event"),
|
|
229
|
+
id: z.string(),
|
|
230
|
+
event: z.string(),
|
|
231
|
+
created_at: z.string(),
|
|
232
|
+
data: z.record(z.string(), z.any()),
|
|
233
|
+
metadata: z.record(z.union([z.literal("automation"), z.literal("cron"), z.literal("data_structure"), z.literal("dataset"), z.literal("dataset_membership"), z.literal("endpoint"), z.literal("evaluation"), z.literal("extraction"), z.literal("file"), z.literal("files"), z.literal("link"), z.literal("mailbox"), z.literal("organization"), z.literal("outlook"), z.literal("preprocessing"), z.literal("reconciliation"), z.literal("schema"), z.literal("schema_data"), z.literal("template"), z.literal("user"), z.literal("webhook")]), z.string()).nullable().optional(),
|
|
234
|
+
organization_id: z.string(),
|
|
235
|
+
}).merge(ZEvent.schema));
|
|
236
|
+
export const ZAUDIO_TYPES = z.lazy(() => z.union([z.literal(".mp3"), z.literal(".mp4"), z.literal(".mpeg"), z.literal(".mpga"), z.literal(".m4a"), z.literal(".wav"), z.literal(".webm")]));
|
|
237
|
+
export const ZBaseModality = z.lazy(() => z.union([z.literal("text"), z.literal("image")]));
|
|
238
|
+
export const ZEMAIL_TYPES = z.lazy(() => z.union([z.literal(".eml"), z.literal(".msg")]));
|
|
239
|
+
export const ZEXCEL_TYPES = z.lazy(() => z.union([z.literal(".xls"), z.literal(".xlsx"), z.literal(".ods")]));
|
|
240
|
+
export const ZHTML_TYPES = z.lazy(() => z.union([z.literal(".html"), z.literal(".htm")]));
|
|
241
|
+
export const ZIMAGE_TYPES = z.lazy(() => z.union([z.literal(".jpg"), z.literal(".jpeg"), z.literal(".png"), z.literal(".gif"), z.literal(".bmp"), z.literal(".tiff"), z.literal(".webp")]));
|
|
242
|
+
export const ZPDF_TYPES = z.lazy(() => z.literal(".pdf"));
|
|
243
|
+
export const ZPPT_TYPES = z.lazy(() => z.union([z.literal(".ppt"), z.literal(".pptx"), z.literal(".odp")]));
|
|
244
|
+
export const ZSUPPORTED_TYPES = z.lazy(() => z.union([z.literal(".xls"), z.literal(".xlsx"), z.literal(".ods"), z.literal(".doc"), z.literal(".docx"), z.literal(".odt"), z.literal(".ppt"), z.literal(".pptx"), z.literal(".odp"), z.literal(".pdf"), z.literal(".jpg"), z.literal(".jpeg"), z.literal(".png"), z.literal(".gif"), z.literal(".bmp"), z.literal(".tiff"), z.literal(".webp"), z.literal(".txt"), z.literal(".csv"), z.literal(".tsv"), z.literal(".md"), z.literal(".log"), z.literal(".xml"), z.literal(".json"), z.literal(".yaml"), z.literal(".yml"), z.literal(".rtf"), z.literal(".ini"), z.literal(".conf"), z.literal(".cfg"), z.literal(".nfo"), z.literal(".srt"), z.literal(".sql"), z.literal(".sh"), z.literal(".bat"), z.literal(".ps1"), z.literal(".js"), z.literal(".jsx"), z.literal(".ts"), z.literal(".tsx"), z.literal(".py"), z.literal(".java"), z.literal(".c"), z.literal(".cpp"), z.literal(".cs"), z.literal(".rb"), z.literal(".php"), z.literal(".swift"), z.literal(".kt"), z.literal(".go"), z.literal(".rs"), z.literal(".pl"), z.literal(".r"), z.literal(".m"), z.literal(".scala"), z.literal(".html"), z.literal(".htm"), z.literal(".mhtml"), z.literal(".eml"), z.literal(".msg"), z.literal(".mp3"), z.literal(".mp4"), z.literal(".mpeg"), z.literal(".mpga"), z.literal(".m4a"), z.literal(".wav"), z.literal(".webm")]));
|
|
245
|
+
export const ZTEXT_TYPES = z.lazy(() => z.union([z.literal(".txt"), z.literal(".csv"), z.literal(".tsv"), z.literal(".md"), z.literal(".log"), z.literal(".xml"), z.literal(".json"), z.literal(".yaml"), z.literal(".yml"), z.literal(".rtf"), z.literal(".ini"), z.literal(".conf"), z.literal(".cfg"), z.literal(".nfo"), z.literal(".srt"), z.literal(".sql"), z.literal(".sh"), z.literal(".bat"), z.literal(".ps1"), z.literal(".js"), z.literal(".jsx"), z.literal(".ts"), z.literal(".tsx"), z.literal(".py"), z.literal(".java"), z.literal(".c"), z.literal(".cpp"), z.literal(".cs"), z.literal(".rb"), z.literal(".php"), z.literal(".swift"), z.literal(".kt"), z.literal(".go"), z.literal(".rs"), z.literal(".pl"), z.literal(".r"), z.literal(".m"), z.literal(".scala")]));
|
|
246
|
+
export const ZTYPE_FAMILIES = z.lazy(() => z.union([z.literal("excel"), z.literal("word"), z.literal("powerpoint"), z.literal("pdf"), z.literal("image"), z.literal("text"), z.literal("email"), z.literal("audio"), z.literal("html"), z.literal("web")]));
|
|
247
|
+
export const ZWEB_TYPES = z.lazy(() => z.literal(".mhtml"));
|
|
248
|
+
export const ZWORD_TYPES = z.lazy(() => z.union([z.literal(".doc"), z.literal(".docx"), z.literal(".odt")]));
|
|
249
|
+
export const ZDeleteResponse = z.lazy(() => z.object({
|
|
250
|
+
success: z.boolean(),
|
|
251
|
+
id: z.string(),
|
|
252
|
+
}));
|
|
253
|
+
export const ZDocumentPreprocessResponseContent = z.lazy(() => z.object({
|
|
254
|
+
messages: z.array(z.record(z.string(), z.any())),
|
|
255
|
+
json_schema: z.record(z.string(), z.any()),
|
|
256
|
+
}));
|
|
257
|
+
export const ZErrorDetail = z.lazy(() => z.object({
|
|
258
|
+
code: z.string(),
|
|
259
|
+
message: z.string(),
|
|
260
|
+
details: z.record(z.any()).nullable().optional(),
|
|
261
|
+
}));
|
|
262
|
+
export const ZExportResponse = z.lazy(() => z.object({
|
|
263
|
+
success: z.boolean(),
|
|
264
|
+
path: z.string(),
|
|
265
|
+
}));
|
|
266
|
+
export const ZPreparedRequest = z.lazy(() => z.object({
|
|
267
|
+
method: z.union([z.literal("POST"), z.literal("GET"), z.literal("PUT"), z.literal("PATCH"), z.literal("DELETE"), z.literal("HEAD"), z.literal("OPTIONS"), z.literal("CONNECT"), z.literal("TRACE")]),
|
|
268
|
+
url: z.string(),
|
|
269
|
+
data: z.record(z.any()).nullable().optional(),
|
|
270
|
+
params: z.record(z.any()).nullable().optional(),
|
|
271
|
+
form_data: z.record(z.any()).nullable().optional(),
|
|
272
|
+
files: z.union([z.record(z.any()), z.array(z.tuple([z.string(), z.tuple([z.string(), z.instanceof(Uint8Array), z.string()])]))]).nullable().optional(),
|
|
273
|
+
idempotency_key: z.string().nullable().optional(),
|
|
274
|
+
raise_for_status: z.boolean().default(false),
|
|
275
|
+
}));
|
|
276
|
+
export const ZStandardErrorResponse = z.lazy(() => z.object({
|
|
277
|
+
detail: ZErrorDetail,
|
|
278
|
+
}));
|
|
279
|
+
export const ZStreamingBaseModel = z.lazy(() => z.object({
|
|
280
|
+
streaming_error: ZErrorDetail.nullable().optional(),
|
|
281
|
+
}));
|
|
282
|
+
export const ZT = z.lazy(() => z.any());
|
|
283
|
+
export const ZTuple = z.lazy(() => z.tuple([]));
|
|
284
|
+
export const ZAIProvider = z.lazy(() => z.union([z.literal("OpenAI"), z.literal("Anthropic"), z.literal("Gemini"), z.literal("xAI"), z.literal("Retab")]));
|
|
285
|
+
export const ZReasoning = z.lazy(() => z.object({
|
|
286
|
+
effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
287
|
+
generate_summary: z.union([z.literal("auto"), z.literal("concise"), z.literal("detailed")]).nullable().optional(),
|
|
288
|
+
summary: z.union([z.literal("auto"), z.literal("concise"), z.literal("detailed")]).nullable().optional(),
|
|
289
|
+
}));
|
|
290
|
+
export const ZResponseFormatJSONSchema = z.lazy(() => z.object({
|
|
291
|
+
json_schema: ZJSONSchema,
|
|
292
|
+
type: z.literal("json_schema"),
|
|
293
|
+
}));
|
|
294
|
+
export const ZResponseInputParam = z.lazy(() => z.array(z.union([ZEasyInputMessageParam, ZMessage, ZResponseOutputMessageParam, ZResponseFileSearchToolCallParam, ZResponseComputerToolCallParam, ZComputerCallOutput, ZResponseFunctionWebSearchParam, ZResponseFunctionToolCallParam, ZFunctionCallOutput, ZResponseReasoningItemParam, ZImageGenerationCall, ZResponseCodeInterpreterToolCallParam, ZLocalShellCall, ZLocalShellCallOutput, ZMcpListTools, ZMcpApprovalRequest, ZMcpApprovalResponse, ZMcpCall, ZItemReference])));
|
|
295
|
+
export const ZResponseTextConfigParam = z.lazy(() => z.object({
|
|
296
|
+
format: z.union([ZResponseFormatText, ZResponseFormatTextJSONSchemaConfigParam, ZResponseFormatJSONObject]),
|
|
297
|
+
}));
|
|
298
|
+
export const ZRetabChatCompletionsParseRequest = z.lazy(() => z.object({
|
|
299
|
+
model: z.string(),
|
|
300
|
+
messages: z.array(ZChatCompletionRetabMessage),
|
|
301
|
+
json_schema: z.record(z.string(), z.any()),
|
|
302
|
+
temperature: z.number().default(0.0),
|
|
303
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
304
|
+
stream: z.boolean().default(false),
|
|
305
|
+
seed: z.number().nullable().optional(),
|
|
306
|
+
n_consensus: z.number().default(1),
|
|
307
|
+
}));
|
|
308
|
+
export const ZRetabChatCompletionsRequest = z.lazy(() => z.object({
|
|
309
|
+
model: z.string(),
|
|
310
|
+
messages: z.array(ZChatCompletionRetabMessage),
|
|
311
|
+
response_format: ZResponseFormatJSONSchema,
|
|
312
|
+
temperature: z.number().default(0.0),
|
|
313
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
314
|
+
stream: z.boolean().default(false),
|
|
315
|
+
seed: z.number().nullable().optional(),
|
|
316
|
+
n_consensus: z.number().default(1),
|
|
317
|
+
}));
|
|
318
|
+
export const ZRetabChatResponseCreateRequest = z.lazy(() => z.object({
|
|
319
|
+
input: z.union([z.string(), z.array(z.union([ZEasyInputMessageParam, ZMessage, ZResponseOutputMessageParam, ZResponseFileSearchToolCallParam, ZResponseComputerToolCallParam, ZComputerCallOutput, ZResponseFunctionWebSearchParam, ZResponseFunctionToolCallParam, ZFunctionCallOutput, ZResponseReasoningItemParam, ZImageGenerationCall, ZResponseCodeInterpreterToolCallParam, ZLocalShellCall, ZLocalShellCallOutput, ZMcpListTools, ZMcpApprovalRequest, ZMcpApprovalResponse, ZMcpCall, ZItemReference]))]),
|
|
320
|
+
instructions: z.string().nullable().optional(),
|
|
321
|
+
model: z.string(),
|
|
322
|
+
temperature: z.number().nullable().optional().default(0.0),
|
|
323
|
+
reasoning: ZReasoning.nullable().optional(),
|
|
324
|
+
stream: z.boolean().nullable().optional().default(false),
|
|
325
|
+
seed: z.number().nullable().optional(),
|
|
326
|
+
text: ZResponseTextConfigParam.default({ "format": { "type": "text" } }),
|
|
327
|
+
n_consensus: z.number().default(1),
|
|
328
|
+
}));
|
|
329
|
+
export const ZChatCompletionContentPartParam = z.lazy(() => z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartImageParam, ZChatCompletionContentPartInputAudioParam, ZFile]));
|
|
330
|
+
export const ZReconciliationRequest = z.lazy(() => z.object({
|
|
331
|
+
list_dicts: z.array(z.record(z.any())),
|
|
332
|
+
reference_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
333
|
+
mode: z.union([z.literal("direct"), z.literal("aligned")]).default("direct"),
|
|
334
|
+
}));
|
|
335
|
+
export const ZReconciliationResponse = z.lazy(() => z.object({
|
|
336
|
+
consensus_dict: z.record(z.any()),
|
|
337
|
+
likelihoods: z.record(z.any()),
|
|
338
|
+
}));
|
|
339
|
+
export const ZAutomationConfig = z.lazy(() => z.object({
|
|
340
|
+
id: z.string(),
|
|
341
|
+
name: z.string(),
|
|
342
|
+
processor_id: z.string(),
|
|
343
|
+
updated_at: z.string(),
|
|
344
|
+
default_language: z.string().default("en"),
|
|
345
|
+
webhook_url: z.string(),
|
|
346
|
+
webhook_headers: z.record(z.string(), z.string()),
|
|
347
|
+
need_validation: z.boolean().default(false),
|
|
348
|
+
}));
|
|
349
|
+
export const ZAutomationLog = z.lazy(() => z.object({
|
|
350
|
+
object: z.literal("automation_log").default("automation_log"),
|
|
351
|
+
id: z.string(),
|
|
352
|
+
user_email: z.string().email().nullable().optional(),
|
|
353
|
+
organization_id: z.string(),
|
|
354
|
+
created_at: z.string(),
|
|
355
|
+
automation_snapshot: ZAutomationConfig,
|
|
356
|
+
completion: z.union([ZRetabParsedChatCompletion, ZChatCompletion]),
|
|
357
|
+
file_metadata: ZBaseMIMEData.nullable().optional(),
|
|
358
|
+
external_request_log: ZExternalRequestLog.nullable().optional(),
|
|
359
|
+
extraction_id: z.string().nullable().optional(),
|
|
360
|
+
}));
|
|
361
|
+
export const ZDict = z.lazy(() => z.record(z.any()));
|
|
362
|
+
export const ZEmailStr = z.lazy(() => z.string().email());
|
|
363
|
+
export const ZExternalRequestLog = z.lazy(() => z.object({
|
|
364
|
+
webhook_url: z.string().nullable().optional(),
|
|
365
|
+
request_body: z.record(z.string(), z.any()),
|
|
366
|
+
request_headers: z.record(z.string(), z.string()),
|
|
367
|
+
request_at: z.string(),
|
|
368
|
+
response_body: z.record(z.string(), z.any()),
|
|
369
|
+
response_headers: z.record(z.string(), z.string()),
|
|
370
|
+
response_at: z.string(),
|
|
371
|
+
status_code: z.number(),
|
|
372
|
+
error: z.string().nullable().optional(),
|
|
373
|
+
duration_ms: z.number(),
|
|
374
|
+
}));
|
|
375
|
+
export const ZListLogs = z.lazy(() => z.object({
|
|
376
|
+
data: z.array(ZAutomationLog),
|
|
377
|
+
list_metadata: ZListMetadata,
|
|
378
|
+
}));
|
|
379
|
+
export const ZListMetadata = z.lazy(() => z.object({
|
|
380
|
+
before: z.string().nullable().optional(),
|
|
381
|
+
after: z.string().nullable().optional(),
|
|
382
|
+
}));
|
|
383
|
+
export const ZLogCompletionRequest = z.lazy(() => z.object({
|
|
384
|
+
json_schema: z.record(z.string(), z.any()),
|
|
385
|
+
completion: ZChatCompletion,
|
|
386
|
+
}));
|
|
387
|
+
export const ZOpenAIRequestConfig = z.lazy(() => z.object({
|
|
388
|
+
object: z.literal("openai_request").default("openai_request"),
|
|
389
|
+
id: z.string(),
|
|
390
|
+
model: z.string(),
|
|
391
|
+
json_schema: z.record(z.string(), z.any()),
|
|
392
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
393
|
+
}));
|
|
394
|
+
export const ZProcessorConfig = z.lazy(() => z.object({
|
|
395
|
+
object: z.string().default("processor"),
|
|
396
|
+
id: z.string(),
|
|
397
|
+
updated_at: z.string(),
|
|
398
|
+
name: z.string(),
|
|
399
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
400
|
+
image_resolution_dpi: z.number().default(96),
|
|
401
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
402
|
+
model: z.string(),
|
|
403
|
+
json_schema: z.record(z.string(), z.any()),
|
|
404
|
+
temperature: z.number().default(0.0),
|
|
405
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
406
|
+
n_consensus: z.number().default(1),
|
|
407
|
+
}));
|
|
408
|
+
export const ZUpdateAutomationRequest = z.lazy(() => z.object({
|
|
409
|
+
name: z.string().nullable().optional(),
|
|
410
|
+
default_language: z.string().nullable().optional(),
|
|
411
|
+
webhook_url: z.string().nullable().optional(),
|
|
412
|
+
webhook_headers: z.record(z.string(), z.string()).nullable().optional(),
|
|
413
|
+
need_validation: z.boolean().nullable().optional(),
|
|
414
|
+
}));
|
|
415
|
+
export const ZUpdateProcessorRequest = z.lazy(() => z.object({
|
|
416
|
+
name: z.string().nullable().optional(),
|
|
417
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]).nullable().optional(),
|
|
418
|
+
image_resolution_dpi: z.number().nullable().optional(),
|
|
419
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).nullable().optional(),
|
|
420
|
+
model: z.string().nullable().optional(),
|
|
421
|
+
json_schema: z.record(z.any()).nullable().optional(),
|
|
422
|
+
temperature: z.number().nullable().optional(),
|
|
423
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
424
|
+
n_consensus: z.number().nullable().optional(),
|
|
425
|
+
}));
|
|
426
|
+
export const ZAnthropicModel = z.lazy(() => z.union([z.literal("claude-3-5-sonnet-latest"), z.literal("claude-3-5-sonnet-20241022"), z.literal("claude-3-opus-20240229"), z.literal("claude-3-sonnet-20240229"), z.literal("claude-3-haiku-20240307")]));
|
|
427
|
+
export const ZEndpointType = z.lazy(() => z.union([z.literal("chat_completions"), z.literal("responses"), z.literal("assistants"), z.literal("batch"), z.literal("fine_tuning"), z.literal("embeddings"), z.literal("speech_generation"), z.literal("translation"), z.literal("completions_legacy"), z.literal("image_generation"), z.literal("transcription"), z.literal("moderation"), z.literal("realtime")]));
|
|
428
|
+
export const ZFeatureType = z.lazy(() => z.union([z.literal("streaming"), z.literal("function_calling"), z.literal("structured_outputs"), z.literal("distillation"), z.literal("fine_tuning"), z.literal("predicted_outputs"), z.literal("schema_generation")]));
|
|
429
|
+
export const ZFinetunedModel = z.lazy(() => z.object({
|
|
430
|
+
object: z.literal("finetuned_model").default("finetuned_model"),
|
|
431
|
+
organization_id: z.string(),
|
|
432
|
+
model: z.string(),
|
|
433
|
+
schema_id: z.string(),
|
|
434
|
+
schema_data_id: z.string(),
|
|
435
|
+
finetuning_props: ZInferenceSettings,
|
|
436
|
+
project_id: z.string().nullable().optional(),
|
|
437
|
+
created_at: z.string(),
|
|
438
|
+
}));
|
|
439
|
+
export const ZGeminiModel = z.lazy(() => z.union([z.literal("gemini-2.5-pro"), z.literal("gemini-2.5-flash"), z.literal("gemini-2.5-pro-preview-06-05"), z.literal("gemini-2.5-pro-preview-05-06"), z.literal("gemini-2.5-pro-preview-03-25"), z.literal("gemini-2.5-flash-preview-05-20"), z.literal("gemini-2.5-flash-preview-04-17"), z.literal("gemini-2.5-flash-lite-preview-06-17"), z.literal("gemini-2.5-pro-exp-03-25"), z.literal("gemini-2.0-flash-lite"), z.literal("gemini-2.0-flash")]));
|
|
440
|
+
export const ZInferenceSettings = z.lazy(() => z.object({
|
|
441
|
+
model: z.string().default("gpt-4.1-mini"),
|
|
442
|
+
temperature: z.number().default(0.0),
|
|
443
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]).default("native"),
|
|
444
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
445
|
+
image_resolution_dpi: z.number().default(96),
|
|
446
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
447
|
+
n_consensus: z.number().default(1),
|
|
448
|
+
}));
|
|
449
|
+
export const ZLLMModel = z.lazy(() => z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-4.1"), z.literal("gpt-4.1-mini"), z.literal("gpt-4.1-mini-2025-04-14"), z.literal("gpt-4.1-2025-04-14"), z.literal("gpt-4.1-nano"), z.literal("gpt-4.1-nano-2025-04-14"), z.literal("gpt-4o-2024-11-20"), z.literal("gpt-4o-2024-08-06"), z.literal("gpt-4o-2024-05-13"), z.literal("gpt-4o-mini-2024-07-18"), z.literal("o1"), z.literal("o1-2024-12-17"), z.literal("o3"), z.literal("o3-2025-04-16"), z.literal("o4-mini"), z.literal("o4-mini-2025-04-16"), z.literal("gpt-4o-audio-preview-2024-12-17"), z.literal("gpt-4o-audio-preview-2024-10-01"), z.literal("gpt-4o-realtime-preview-2024-12-17"), z.literal("gpt-4o-realtime-preview-2024-10-01"), z.literal("gpt-4o-mini-audio-preview-2024-12-17"), z.literal("gpt-4o-mini-realtime-preview-2024-12-17"), z.literal("claude-3-5-sonnet-latest"), z.literal("claude-3-5-sonnet-20241022"), z.literal("claude-3-opus-20240229"), z.literal("claude-3-sonnet-20240229"), z.literal("claude-3-haiku-20240307"), z.literal("grok-3"), z.literal("grok-3-mini"), z.literal("gemini-2.5-pro"), z.literal("gemini-2.5-flash"), z.literal("gemini-2.5-pro-preview-06-05"), z.literal("gemini-2.5-pro-preview-05-06"), z.literal("gemini-2.5-pro-preview-03-25"), z.literal("gemini-2.5-flash-preview-05-20"), z.literal("gemini-2.5-flash-preview-04-17"), z.literal("gemini-2.5-flash-lite-preview-06-17"), z.literal("gemini-2.5-pro-exp-03-25"), z.literal("gemini-2.0-flash-lite"), z.literal("gemini-2.0-flash"), z.literal("auto-large"), z.literal("auto-small"), z.literal("auto-micro"), z.literal("human")]));
|
|
450
|
+
export const ZModel = z.lazy(() => z.object({
|
|
451
|
+
id: z.string(),
|
|
452
|
+
created: z.number(),
|
|
453
|
+
object: z.literal("model"),
|
|
454
|
+
owned_by: z.string(),
|
|
455
|
+
}));
|
|
456
|
+
export const ZModelCapabilities = z.lazy(() => z.object({
|
|
457
|
+
modalities: z.array(z.union([z.literal("text"), z.literal("audio"), z.literal("image")])),
|
|
458
|
+
endpoints: z.array(z.union([z.literal("chat_completions"), z.literal("responses"), z.literal("assistants"), z.literal("batch"), z.literal("fine_tuning"), z.literal("embeddings"), z.literal("speech_generation"), z.literal("translation"), z.literal("completions_legacy"), z.literal("image_generation"), z.literal("transcription"), z.literal("moderation"), z.literal("realtime")])),
|
|
459
|
+
features: z.array(z.union([z.literal("streaming"), z.literal("function_calling"), z.literal("structured_outputs"), z.literal("distillation"), z.literal("fine_tuning"), z.literal("predicted_outputs"), z.literal("schema_generation")])),
|
|
460
|
+
}));
|
|
461
|
+
export const ZModelCard = z.lazy(() => z.object({
|
|
462
|
+
model: z.union([z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-4.1"), z.literal("gpt-4.1-mini"), z.literal("gpt-4.1-mini-2025-04-14"), z.literal("gpt-4.1-2025-04-14"), z.literal("gpt-4.1-nano"), z.literal("gpt-4.1-nano-2025-04-14"), z.literal("gpt-4o-2024-11-20"), z.literal("gpt-4o-2024-08-06"), z.literal("gpt-4o-2024-05-13"), z.literal("gpt-4o-mini-2024-07-18"), z.literal("o1"), z.literal("o1-2024-12-17"), z.literal("o3"), z.literal("o3-2025-04-16"), z.literal("o4-mini"), z.literal("o4-mini-2025-04-16"), z.literal("gpt-4o-audio-preview-2024-12-17"), z.literal("gpt-4o-audio-preview-2024-10-01"), z.literal("gpt-4o-realtime-preview-2024-12-17"), z.literal("gpt-4o-realtime-preview-2024-10-01"), z.literal("gpt-4o-mini-audio-preview-2024-12-17"), z.literal("gpt-4o-mini-realtime-preview-2024-12-17"), z.literal("claude-3-5-sonnet-latest"), z.literal("claude-3-5-sonnet-20241022"), z.literal("claude-3-opus-20240229"), z.literal("claude-3-sonnet-20240229"), z.literal("claude-3-haiku-20240307"), z.literal("grok-3"), z.literal("grok-3-mini"), z.literal("gemini-2.5-pro"), z.literal("gemini-2.5-flash"), z.literal("gemini-2.5-pro-preview-06-05"), z.literal("gemini-2.5-pro-preview-05-06"), z.literal("gemini-2.5-pro-preview-03-25"), z.literal("gemini-2.5-flash-preview-05-20"), z.literal("gemini-2.5-flash-preview-04-17"), z.literal("gemini-2.5-flash-lite-preview-06-17"), z.literal("gemini-2.5-pro-exp-03-25"), z.literal("gemini-2.0-flash-lite"), z.literal("gemini-2.0-flash"), z.literal("auto-large"), z.literal("auto-small"), z.literal("auto-micro"), z.literal("human")]), z.string()]),
|
|
463
|
+
pricing: ZPricing,
|
|
464
|
+
capabilities: ZModelCapabilities,
|
|
465
|
+
temperature_support: z.boolean().default(true),
|
|
466
|
+
reasoning_effort_support: z.boolean().default(false),
|
|
467
|
+
permissions: ZModelCardPermissions.default({}),
|
|
468
|
+
}));
|
|
469
|
+
export const ZModelCardPermissions = z.lazy(() => z.object({
|
|
470
|
+
show_in_free_picker: z.boolean().default(false),
|
|
471
|
+
show_in_paid_picker: z.boolean().default(false),
|
|
472
|
+
}));
|
|
473
|
+
export const ZModelModality = z.lazy(() => z.union([z.literal("text"), z.literal("audio"), z.literal("image")]));
|
|
474
|
+
export const ZMonthlyUsageResponse = z.lazy(() => z.object({
|
|
475
|
+
credits_count: z.number(),
|
|
476
|
+
}));
|
|
477
|
+
export const ZMonthlyUsageResponseContent = z.lazy(() => z.object({
|
|
478
|
+
credits_count: z.number(),
|
|
479
|
+
}));
|
|
480
|
+
export const ZOpenAICompatibleProvider = z.lazy(() => z.union([z.literal("OpenAI"), z.literal("xAI")]));
|
|
481
|
+
export const ZOpenAIModel = z.lazy(() => z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-4.1"), z.literal("gpt-4.1-mini"), z.literal("gpt-4.1-mini-2025-04-14"), z.literal("gpt-4.1-2025-04-14"), z.literal("gpt-4.1-nano"), z.literal("gpt-4.1-nano-2025-04-14"), z.literal("gpt-4o-2024-11-20"), z.literal("gpt-4o-2024-08-06"), z.literal("gpt-4o-2024-05-13"), z.literal("gpt-4o-mini-2024-07-18"), z.literal("o1"), z.literal("o1-2024-12-17"), z.literal("o3"), z.literal("o3-2025-04-16"), z.literal("o4-mini"), z.literal("o4-mini-2025-04-16"), z.literal("gpt-4o-audio-preview-2024-12-17"), z.literal("gpt-4o-audio-preview-2024-10-01"), z.literal("gpt-4o-realtime-preview-2024-12-17"), z.literal("gpt-4o-realtime-preview-2024-10-01"), z.literal("gpt-4o-mini-audio-preview-2024-12-17"), z.literal("gpt-4o-mini-realtime-preview-2024-12-17")]));
|
|
482
|
+
export const ZPricing = z.lazy(() => z.object({
|
|
483
|
+
text: ZTokenPrice,
|
|
484
|
+
audio: ZTokenPrice.nullable().optional(),
|
|
485
|
+
ft_price_hike: z.number().default(1.0),
|
|
486
|
+
}));
|
|
487
|
+
export const ZPureLLMModel = z.lazy(() => z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-4.1"), z.literal("gpt-4.1-mini"), z.literal("gpt-4.1-mini-2025-04-14"), z.literal("gpt-4.1-2025-04-14"), z.literal("gpt-4.1-nano"), z.literal("gpt-4.1-nano-2025-04-14"), z.literal("gpt-4o-2024-11-20"), z.literal("gpt-4o-2024-08-06"), z.literal("gpt-4o-2024-05-13"), z.literal("gpt-4o-mini-2024-07-18"), z.literal("o1"), z.literal("o1-2024-12-17"), z.literal("o3"), z.literal("o3-2025-04-16"), z.literal("o4-mini"), z.literal("o4-mini-2025-04-16"), z.literal("gpt-4o-audio-preview-2024-12-17"), z.literal("gpt-4o-audio-preview-2024-10-01"), z.literal("gpt-4o-realtime-preview-2024-12-17"), z.literal("gpt-4o-realtime-preview-2024-10-01"), z.literal("gpt-4o-mini-audio-preview-2024-12-17"), z.literal("gpt-4o-mini-realtime-preview-2024-12-17"), z.literal("claude-3-5-sonnet-latest"), z.literal("claude-3-5-sonnet-20241022"), z.literal("claude-3-opus-20240229"), z.literal("claude-3-sonnet-20240229"), z.literal("claude-3-haiku-20240307"), z.literal("grok-3"), z.literal("grok-3-mini"), z.literal("gemini-2.5-pro"), z.literal("gemini-2.5-flash"), z.literal("gemini-2.5-pro-preview-06-05"), z.literal("gemini-2.5-pro-preview-05-06"), z.literal("gemini-2.5-pro-preview-03-25"), z.literal("gemini-2.5-flash-preview-05-20"), z.literal("gemini-2.5-flash-preview-04-17"), z.literal("gemini-2.5-flash-lite-preview-06-17"), z.literal("gemini-2.5-pro-exp-03-25"), z.literal("gemini-2.0-flash-lite"), z.literal("gemini-2.0-flash"), z.literal("auto-large"), z.literal("auto-small"), z.literal("auto-micro")]));
|
|
488
|
+
export const ZRetabModel = z.lazy(() => z.union([z.literal("auto-large"), z.literal("auto-small"), z.literal("auto-micro")]));
|
|
489
|
+
export const ZTokenPrice = z.lazy(() => z.object({
|
|
490
|
+
prompt: z.number(),
|
|
491
|
+
completion: z.number(),
|
|
492
|
+
cached_discount: z.number().default(1.0),
|
|
493
|
+
}));
|
|
494
|
+
export const ZAddIterationFromJsonlRequest = z.lazy(() => z.object({
|
|
495
|
+
jsonl_gcs_path: z.string(),
|
|
496
|
+
}));
|
|
497
|
+
export const ZAnnotatedDocument = z.lazy(() => z.object({
|
|
498
|
+
mime_data: ZMIMEData,
|
|
499
|
+
annotation: z.record(z.string(), z.any()).default({}),
|
|
500
|
+
}));
|
|
501
|
+
export const ZCreateIterationRequest = z.lazy(() => z.object({
|
|
502
|
+
inference_settings: ZInferenceSettings,
|
|
503
|
+
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
504
|
+
}));
|
|
505
|
+
export const ZDocumentItem = z.lazy(() => z.object({
|
|
506
|
+
mime_data: ZMIMEData,
|
|
507
|
+
annotation: z.record(z.string(), z.any()).default({}),
|
|
508
|
+
annotation_metadata: ZPredictionMetadata.nullable().optional(),
|
|
509
|
+
}).merge(ZAnnotatedDocument.schema));
|
|
510
|
+
export const ZIteration = z.lazy(() => z.object({
|
|
511
|
+
id: z.string(),
|
|
512
|
+
inference_settings: ZInferenceSettings,
|
|
513
|
+
json_schema: z.record(z.string(), z.any()),
|
|
514
|
+
predictions: z.array(ZPredictionData),
|
|
515
|
+
metric_results: ZMetricResult.nullable().optional(),
|
|
516
|
+
}));
|
|
517
|
+
export const ZProject = z.lazy(() => z.object({
|
|
518
|
+
id: z.string(),
|
|
519
|
+
updated_at: z.string(),
|
|
520
|
+
name: z.string(),
|
|
521
|
+
old_documents: z.array(ZProjectDocument).nullable().optional(),
|
|
522
|
+
documents: z.array(ZProjectDocument),
|
|
523
|
+
iterations: z.array(ZIteration),
|
|
524
|
+
json_schema: z.record(z.string(), z.any()),
|
|
525
|
+
project_id: z.string().default("default_spreadsheets"),
|
|
526
|
+
default_inference_settings: ZInferenceSettings.nullable().optional(),
|
|
527
|
+
}));
|
|
528
|
+
export const ZProjectDocument = z.lazy(() => z.object({
|
|
529
|
+
mime_data: ZMIMEData,
|
|
530
|
+
annotation: z.record(z.string(), z.any()).default({}),
|
|
531
|
+
annotation_metadata: ZPredictionMetadata.nullable().optional(),
|
|
532
|
+
id: z.string(),
|
|
533
|
+
}).merge(ZDocumentItem.schema));
|
|
534
|
+
export const ZUpdateProjectDocumentRequest = z.lazy(() => z.object({
|
|
535
|
+
annotation: z.record(z.string(), z.any()).nullable().optional(),
|
|
536
|
+
annotation_metadata: ZPredictionMetadata.nullable().optional(),
|
|
537
|
+
}));
|
|
538
|
+
export const ZUpdateProjectRequest = z.lazy(() => z.object({
|
|
539
|
+
name: z.string().nullable().optional(),
|
|
540
|
+
documents: z.array(ZProjectDocument).nullable().optional(),
|
|
541
|
+
iterations: z.array(ZIteration).nullable().optional(),
|
|
542
|
+
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
543
|
+
project_id: z.string().nullable().optional(),
|
|
544
|
+
default_inference_settings: ZInferenceSettings.nullable().optional(),
|
|
545
|
+
}));
|
|
546
|
+
export const ZExternalAPIKey = z.lazy(() => z.object({
|
|
547
|
+
provider: z.union([z.literal("OpenAI"), z.literal("Anthropic"), z.literal("Gemini"), z.literal("xAI"), z.literal("Retab")]),
|
|
548
|
+
is_configured: z.boolean(),
|
|
549
|
+
last_updated: z.string().nullable().optional(),
|
|
550
|
+
}));
|
|
551
|
+
export const ZExternalAPIKeyRequest = z.lazy(() => z.object({
|
|
552
|
+
provider: z.union([z.literal("OpenAI"), z.literal("Anthropic"), z.literal("Gemini"), z.literal("xAI"), z.literal("Retab")]),
|
|
553
|
+
api_key: z.string(),
|
|
554
|
+
}));
|
|
555
|
+
export const ZBaseIteration = z.lazy(() => z.object({
|
|
556
|
+
id: z.string(),
|
|
557
|
+
inference_settings: ZInferenceSettings,
|
|
558
|
+
json_schema: z.record(z.string(), z.any()),
|
|
559
|
+
updated_at: z.string(),
|
|
560
|
+
}));
|
|
561
|
+
export const ZDocumentStatus = z.lazy(() => z.object({
|
|
562
|
+
document_id: z.string(),
|
|
563
|
+
filename: z.string(),
|
|
564
|
+
needs_update: z.boolean(),
|
|
565
|
+
has_prediction: z.boolean(),
|
|
566
|
+
prediction_updated_at: z.string().nullable().optional(),
|
|
567
|
+
iteration_updated_at: z.string(),
|
|
568
|
+
}));
|
|
569
|
+
export const ZIterationDocumentStatusResponse = z.lazy(() => z.object({
|
|
570
|
+
iteration_id: z.string(),
|
|
571
|
+
documents: z.array(ZDocumentStatus),
|
|
572
|
+
total_documents: z.number(),
|
|
573
|
+
documents_needing_update: z.number(),
|
|
574
|
+
documents_up_to_date: z.number(),
|
|
575
|
+
}));
|
|
576
|
+
export const ZPatchIterationRequest = z.lazy(() => z.object({
|
|
577
|
+
inference_settings: ZInferenceSettings.nullable().optional(),
|
|
578
|
+
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
579
|
+
version: z.number().nullable().optional(),
|
|
580
|
+
}));
|
|
581
|
+
export const ZProcessIterationRequest = z.lazy(() => z.object({
|
|
582
|
+
document_ids: z.array(z.string()).nullable().optional(),
|
|
583
|
+
only_outdated: z.boolean().default(true),
|
|
584
|
+
}));
|
|
585
|
+
export const ZCreateProjectDocumentRequest = z.lazy(() => z.object({
|
|
586
|
+
mime_data: ZMIMEData,
|
|
587
|
+
annotation: z.record(z.string(), z.any()).default({}),
|
|
588
|
+
annotation_metadata: ZPredictionMetadata.nullable().optional(),
|
|
589
|
+
}).merge(ZDocumentItem.schema));
|
|
590
|
+
export const ZPatchProjectDocumentRequest = z.lazy(() => z.object({
|
|
591
|
+
annotation: z.record(z.string(), z.any()).nullable().optional(),
|
|
592
|
+
annotation_metadata: ZPredictionMetadata.nullable().optional(),
|
|
593
|
+
}));
|
|
594
|
+
export const ZBaseProject = z.lazy(() => z.object({
|
|
595
|
+
id: z.string(),
|
|
596
|
+
name: z.string().default(""),
|
|
597
|
+
json_schema: z.record(z.string(), z.any()),
|
|
598
|
+
default_inference_settings: ZInferenceSettings.default({}),
|
|
599
|
+
updated_at: z.string(),
|
|
600
|
+
}));
|
|
601
|
+
export const ZCreateProjectRequest = z.lazy(() => z.object({
|
|
602
|
+
name: z.string(),
|
|
603
|
+
json_schema: z.record(z.string(), z.any()),
|
|
604
|
+
default_inference_settings: ZInferenceSettings,
|
|
605
|
+
}));
|
|
606
|
+
export const ZListProjectParams = z.lazy(() => z.object({
|
|
607
|
+
schema_id: z.string().nullable().optional(),
|
|
608
|
+
schema_data_id: z.string().nullable().optional(),
|
|
609
|
+
}));
|
|
610
|
+
export const ZPatchProjectRequest = z.lazy(() => z.object({
|
|
611
|
+
name: z.string().nullable().optional(),
|
|
612
|
+
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
613
|
+
default_inference_settings: ZInferenceSettings.nullable().optional(),
|
|
614
|
+
}));
|
|
615
|
+
export const ZAnnotationInputData = z.lazy(() => z.object({
|
|
616
|
+
data_file: z.string(),
|
|
617
|
+
schema_id: z.string(),
|
|
618
|
+
inference_settings: ZInferenceSettings,
|
|
619
|
+
}));
|
|
620
|
+
export const ZAnnotationModel = z.lazy(() => z.union([z.literal("human"), z.string()]));
|
|
621
|
+
export const ZFinetuningWorkflowInputData = z.lazy(() => z.object({
|
|
622
|
+
prepare_dataset_input_data: ZPrepareDatasetInputData,
|
|
623
|
+
annotation_model: z.union([z.literal("human"), z.string()]),
|
|
624
|
+
inference_settings: ZInferenceSettings.nullable().optional(),
|
|
625
|
+
finetuning_props: ZInferenceSettings,
|
|
626
|
+
}));
|
|
627
|
+
export const ZPrepareDatasetInputData = z.lazy(() => z.object({
|
|
628
|
+
dataset_id: z.string().nullable().optional(),
|
|
629
|
+
schema_id: z.string().nullable().optional(),
|
|
630
|
+
schema_data_id: z.string().nullable().optional(),
|
|
631
|
+
selection_model: z.union([z.literal("all"), z.literal("manual")]).default("all"),
|
|
632
|
+
}));
|
|
633
|
+
export const ZProjectInputData = z.lazy(() => z.object({
|
|
634
|
+
eval_data_file: z.string(),
|
|
635
|
+
schema_id: z.string(),
|
|
636
|
+
inference_settings_1: ZInferenceSettings.nullable().optional(),
|
|
637
|
+
inference_settings_2: ZInferenceSettings,
|
|
638
|
+
}));
|
|
639
|
+
export const ZStandaloneAnnotationWorkflowInputData = z.lazy(() => z.object({
|
|
640
|
+
data_file: z.string(),
|
|
641
|
+
schema_id: z.string(),
|
|
642
|
+
inference_settings: ZInferenceSettings,
|
|
643
|
+
}).merge(ZAnnotationInputData.schema));
|
|
644
|
+
export const ZStandaloneProjectWorkflowInputData = z.lazy(() => z.object({
|
|
645
|
+
eval_data_file: z.string(),
|
|
646
|
+
schema_id: z.string(),
|
|
647
|
+
inference_settings_1: ZInferenceSettings.nullable().optional(),
|
|
648
|
+
inference_settings_2: ZInferenceSettings,
|
|
649
|
+
}).merge(ZProjectInputData.schema));
|
|
650
|
+
export const ZWorkflows = z.lazy(() => z.union([z.literal("finetuning-workflow"), z.literal("annotation-workflow"), z.literal("evaluation-workflow")]));
|
|
651
|
+
export const ZChatCompletionMessageParam = z.lazy(() => z.union([ZChatCompletionDeveloperMessageParam, ZChatCompletionSystemMessageParam, ZChatCompletionUserMessageParam, ZChatCompletionAssistantMessageParam, ZChatCompletionToolMessageParam, ZChatCompletionFunctionMessageParam]));
|
|
652
|
+
export const ZContentUnionDict = z.lazy(() => z.union([ZContent, z.array(z.union([ZFile, ZPart, z.instanceof(Uint8Array), z.string()])), ZFile, ZPart, z.instanceof(Uint8Array), z.string(), ZContentDict]));
|
|
653
|
+
export const ZMessageParam = z.lazy(() => z.object({
|
|
654
|
+
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam, ZDocumentBlockParam, ZThinkingBlockParam, ZRedactedThinkingBlockParam, ZToolUseBlockParam, ZToolResultBlockParam, ZServerToolUseBlockParam, ZWebSearchToolResultBlockParam, z.union([ZTextBlock, ZThinkingBlock, ZRedactedThinkingBlock, ZToolUseBlock, ZServerToolUseBlock, ZWebSearchToolResultBlock])]))]),
|
|
655
|
+
role: z.union([z.literal("user"), z.literal("assistant")]),
|
|
656
|
+
}));
|
|
657
|
+
export const ZPartialSchema = z.lazy(() => z.object({
|
|
658
|
+
object: z.literal("schema").default("schema"),
|
|
659
|
+
created_at: z.string(),
|
|
660
|
+
json_schema: z.record(z.string(), z.any()).default({}),
|
|
661
|
+
strict: z.boolean().default(true),
|
|
662
|
+
}));
|
|
663
|
+
export const ZPartialSchemaChunk = z.lazy(() => z.object({
|
|
664
|
+
streaming_error: ZErrorDetail.nullable().optional(),
|
|
665
|
+
object: z.literal("schema.chunk").default("schema.chunk"),
|
|
666
|
+
created_at: z.string(),
|
|
667
|
+
delta_json_schema_flat: z.record(z.string(), z.any()).default({}),
|
|
668
|
+
}).merge(ZStreamingBaseModel.schema));
|
|
669
|
+
export const ZResponseInputItemParam = z.lazy(() => z.union([ZEasyInputMessageParam, ZMessage, ZResponseOutputMessageParam, ZResponseFileSearchToolCallParam, ZResponseComputerToolCallParam, ZComputerCallOutput, ZResponseFunctionWebSearchParam, ZResponseFunctionToolCallParam, ZFunctionCallOutput, ZResponseReasoningItemParam, ZImageGenerationCall, ZResponseCodeInterpreterToolCallParam, ZLocalShellCall, ZLocalShellCallOutput, ZMcpListTools, ZMcpApprovalRequest, ZMcpApprovalResponse, ZMcpCall, ZItemReference]));
|
|
670
|
+
export const ZSchema = z.lazy(() => z.object({
|
|
671
|
+
object: z.literal("schema").default("schema"),
|
|
672
|
+
created_at: z.string(),
|
|
673
|
+
json_schema: z.record(z.string(), z.any()).default({}),
|
|
674
|
+
strict: z.boolean().default(true),
|
|
675
|
+
}).merge(ZPartialSchema.schema));
|
|
676
|
+
export const ZGenerateSchemaRequest = z.lazy(() => z.object({
|
|
677
|
+
documents: z.array(ZMIMEData),
|
|
678
|
+
model: z.string().default("gpt-4o-mini"),
|
|
679
|
+
temperature: z.number().default(0.0),
|
|
680
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
681
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
682
|
+
instructions: z.string().nullable().optional(),
|
|
683
|
+
image_resolution_dpi: z.number().default(96),
|
|
684
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
685
|
+
stream: z.boolean().default(false),
|
|
686
|
+
}));
|
|
687
|
+
export const ZGenerateSystemPromptRequest = z.lazy(() => z.object({
|
|
688
|
+
documents: z.array(ZMIMEData),
|
|
689
|
+
model: z.string().default("gpt-4o-mini"),
|
|
690
|
+
temperature: z.number().default(0.0),
|
|
691
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
692
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
693
|
+
instructions: z.string().nullable().optional(),
|
|
694
|
+
image_resolution_dpi: z.number().default(96),
|
|
695
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
696
|
+
stream: z.boolean().default(false),
|
|
697
|
+
json_schema: z.record(z.string(), z.any()),
|
|
698
|
+
}).merge(ZGenerateSchemaRequest.schema));
|
|
699
|
+
export const ZColumn = z.lazy(() => z.object({
|
|
700
|
+
type: z.literal("column"),
|
|
701
|
+
size: z.number(),
|
|
702
|
+
items: z.array(z.union([ZRow, ZFieldItem, ZRefObject, ZRowList])),
|
|
703
|
+
name: z.string().nullable().optional(),
|
|
704
|
+
}));
|
|
705
|
+
export const ZFieldItem = z.lazy(() => z.object({
|
|
706
|
+
type: z.literal("field"),
|
|
707
|
+
name: z.string(),
|
|
708
|
+
size: z.number().nullable().optional(),
|
|
709
|
+
}));
|
|
710
|
+
export const ZLayout = z.lazy(() => z.object({
|
|
711
|
+
defs: z.record(z.string(), ZColumn),
|
|
712
|
+
type: z.literal("column"),
|
|
713
|
+
size: z.number(),
|
|
714
|
+
items: z.array(z.union([ZRow, ZRowList, ZFieldItem, ZRefObject])),
|
|
715
|
+
}));
|
|
716
|
+
export const ZRefObject = z.lazy(() => z.object({
|
|
717
|
+
type: z.literal("object"),
|
|
718
|
+
size: z.number().nullable().optional(),
|
|
719
|
+
name: z.string().nullable().optional(),
|
|
720
|
+
ref: z.string(),
|
|
721
|
+
}));
|
|
722
|
+
export const ZRow = z.lazy(() => z.object({
|
|
723
|
+
type: z.literal("row"),
|
|
724
|
+
name: z.string().nullable().optional(),
|
|
725
|
+
items: z.array(z.union([ZColumn, ZFieldItem, ZRefObject])),
|
|
726
|
+
}));
|
|
727
|
+
export const ZRowList = z.lazy(() => z.object({
|
|
728
|
+
type: z.literal("rowList"),
|
|
729
|
+
name: z.string().nullable().optional(),
|
|
730
|
+
items: z.array(z.union([ZColumn, ZFieldItem, ZRefObject])),
|
|
731
|
+
}));
|
|
732
|
+
export const ZEnhanceSchemaConfig = z.lazy(() => z.object({
|
|
733
|
+
allow_reasoning_fields_added: z.boolean().default(true),
|
|
734
|
+
allow_field_description_update: z.boolean().default(false),
|
|
735
|
+
allow_system_prompt_update: z.boolean().default(true),
|
|
736
|
+
allow_field_simple_type_change: z.boolean().default(false),
|
|
737
|
+
allow_field_data_structure_breakdown: z.boolean().default(false),
|
|
738
|
+
}));
|
|
739
|
+
export const ZEnhanceSchemaConfigDict = z.lazy(() => z.object({
|
|
740
|
+
allow_reasoning_fields_added: z.boolean(),
|
|
741
|
+
allow_field_description_update: z.boolean(),
|
|
742
|
+
allow_system_prompt_update: z.boolean(),
|
|
743
|
+
allow_field_simple_type_change: z.boolean(),
|
|
744
|
+
allow_field_data_structure_breakdown: z.boolean(),
|
|
745
|
+
}));
|
|
746
|
+
export const ZEnhanceSchemaRequest = z.lazy(() => z.object({
|
|
747
|
+
documents: z.array(ZMIMEData),
|
|
748
|
+
ground_truths: z.array(z.record(z.string(), z.any())).nullable().optional(),
|
|
749
|
+
model: z.string().default("gpt-4o-mini"),
|
|
750
|
+
temperature: z.number().default(0.0),
|
|
751
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
752
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
753
|
+
image_resolution_dpi: z.number().default(96),
|
|
754
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
755
|
+
stream: z.boolean().default(false),
|
|
756
|
+
tools_config: ZEnhanceSchemaConfig,
|
|
757
|
+
json_schema: z.record(z.string(), z.any()),
|
|
758
|
+
instructions: z.string().nullable().optional(),
|
|
759
|
+
flat_likelihoods: z.union([z.array(z.record(z.string(), z.number())), z.record(z.string(), z.number())]).nullable().optional(),
|
|
760
|
+
}));
|
|
761
|
+
export const ZTemplateSchema = z.lazy(() => z.object({
|
|
762
|
+
id: z.string(),
|
|
763
|
+
name: z.string(),
|
|
764
|
+
object: z.literal("template").default("template"),
|
|
765
|
+
updated_at: z.string(),
|
|
766
|
+
json_schema: z.record(z.string(), z.any()).default({}),
|
|
767
|
+
python_code: z.string().nullable().optional(),
|
|
768
|
+
sample_document_filename: z.string().nullable().optional(),
|
|
769
|
+
}));
|
|
770
|
+
export const ZUpdateTemplateRequest = z.lazy(() => z.object({
|
|
771
|
+
id: z.string(),
|
|
772
|
+
name: z.string().nullable().optional(),
|
|
773
|
+
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
774
|
+
python_code: z.string().nullable().optional(),
|
|
775
|
+
sample_document: ZMIMEData.nullable().optional(),
|
|
776
|
+
}));
|
|
777
|
+
export const ZEvaluateSchemaRequest = z.lazy(() => z.object({
|
|
778
|
+
documents: z.array(ZMIMEData),
|
|
779
|
+
ground_truths: z.array(z.record(z.string(), z.any())).nullable().optional(),
|
|
780
|
+
model: z.string().default("gpt-4o-mini"),
|
|
781
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
782
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
783
|
+
image_resolution_dpi: z.number().default(96),
|
|
784
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
785
|
+
n_consensus: z.number().default(1),
|
|
786
|
+
json_schema: z.record(z.string(), z.any()),
|
|
787
|
+
}));
|
|
788
|
+
export const ZEvaluateSchemaResponse = z.lazy(() => z.object({
|
|
789
|
+
item_metrics: z.array(ZItemMetric),
|
|
790
|
+
}));
|
|
791
|
+
export const ZBinaryIO = z.lazy(() => z.instanceof(Uint8Array));
|
|
792
|
+
export const ZDBFile = z.lazy(() => z.object({
|
|
793
|
+
object: z.literal("file").default("file"),
|
|
794
|
+
id: z.string(),
|
|
795
|
+
filename: z.string(),
|
|
796
|
+
}));
|
|
797
|
+
export const ZFileData = z.lazy(() => z.tuple([z.string(), z.instanceof(Uint8Array), z.string()]));
|
|
798
|
+
export const ZFileLink = z.lazy(() => z.object({
|
|
799
|
+
download_url: z.string(),
|
|
800
|
+
expires_in: z.string(),
|
|
801
|
+
filename: z.string(),
|
|
802
|
+
}));
|
|
803
|
+
export const ZFileTuple = z.lazy(() => z.tuple([z.string(), z.tuple([z.string(), z.instanceof(Uint8Array), z.string()])]));
|
|
804
|
+
export const ZAnnotation = z.lazy(() => z.object({
|
|
805
|
+
file_id: z.string(),
|
|
806
|
+
parameters: ZAnnotationParameters,
|
|
807
|
+
data: z.record(z.string(), z.any()),
|
|
808
|
+
schema_id: z.string(),
|
|
809
|
+
organization_id: z.string(),
|
|
810
|
+
updated_at: z.string(),
|
|
811
|
+
}));
|
|
812
|
+
export const ZAnnotationParameters = z.lazy(() => z.object({
|
|
813
|
+
model: z.string(),
|
|
814
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]).nullable().optional().default("native"),
|
|
815
|
+
image_resolution_dpi: z.number().default(96),
|
|
816
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
817
|
+
temperature: z.number().default(0.0),
|
|
818
|
+
}));
|
|
819
|
+
export const ZCronSchedule = z.lazy(() => z.object({
|
|
820
|
+
second: z.number().nullable().optional().default(0),
|
|
821
|
+
minute: z.number(),
|
|
822
|
+
hour: z.number(),
|
|
823
|
+
day_of_month: z.number().nullable().optional(),
|
|
824
|
+
month: z.number().nullable().optional(),
|
|
825
|
+
day_of_week: z.number().nullable().optional(),
|
|
826
|
+
}));
|
|
827
|
+
export const ZScrappingConfig = z.lazy(() => z.object({
|
|
828
|
+
id: z.string(),
|
|
829
|
+
name: z.string(),
|
|
830
|
+
processor_id: z.string(),
|
|
831
|
+
updated_at: z.string(),
|
|
832
|
+
default_language: z.string().default("en"),
|
|
833
|
+
webhook_url: z.string(),
|
|
834
|
+
webhook_headers: z.record(z.string(), z.string()),
|
|
835
|
+
need_validation: z.boolean().default(false),
|
|
836
|
+
link: z.string(),
|
|
837
|
+
schedule: ZCronSchedule,
|
|
838
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
839
|
+
image_resolution_dpi: z.number().default(96),
|
|
840
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
841
|
+
model: z.string(),
|
|
842
|
+
json_schema: z.record(z.string(), z.any()),
|
|
843
|
+
temperature: z.number().default(0.0),
|
|
844
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
845
|
+
}).merge(ZAutomationConfig.schema));
|
|
846
|
+
export const ZListMailboxes = z.lazy(() => z.object({
|
|
847
|
+
data: z.array(ZMailbox),
|
|
848
|
+
list_metadata: ZListMetadata,
|
|
849
|
+
}));
|
|
850
|
+
export const ZMailbox = z.lazy(() => z.object({
|
|
851
|
+
id: z.string(),
|
|
852
|
+
name: z.string(),
|
|
853
|
+
processor_id: z.string(),
|
|
854
|
+
updated_at: z.string(),
|
|
855
|
+
default_language: z.string().default("en"),
|
|
856
|
+
webhook_url: z.string(),
|
|
857
|
+
webhook_headers: z.record(z.string(), z.string()),
|
|
858
|
+
need_validation: z.boolean().default(false),
|
|
859
|
+
email: z.string(),
|
|
860
|
+
authorized_domains: z.array(z.string()),
|
|
861
|
+
authorized_emails: z.array(z.string().email()),
|
|
862
|
+
}).merge(ZAutomationConfig.schema));
|
|
863
|
+
export const ZUpdateMailboxRequest = z.lazy(() => z.object({
|
|
864
|
+
name: z.string().nullable().optional(),
|
|
865
|
+
default_language: z.string().nullable().optional(),
|
|
866
|
+
webhook_url: z.string().nullable().optional(),
|
|
867
|
+
webhook_headers: z.record(z.string(), z.string()).nullable().optional(),
|
|
868
|
+
need_validation: z.boolean().nullable().optional(),
|
|
869
|
+
authorized_domains: z.array(z.string()).nullable().optional(),
|
|
870
|
+
authorized_emails: z.array(z.string().email()).nullable().optional(),
|
|
871
|
+
}).merge(ZUpdateAutomationRequest.schema));
|
|
872
|
+
export const ZLink = z.lazy(() => z.object({
|
|
873
|
+
id: z.string(),
|
|
874
|
+
name: z.string(),
|
|
875
|
+
processor_id: z.string(),
|
|
876
|
+
updated_at: z.string(),
|
|
877
|
+
default_language: z.string().default("en"),
|
|
878
|
+
webhook_url: z.string(),
|
|
879
|
+
webhook_headers: z.record(z.string(), z.string()),
|
|
880
|
+
need_validation: z.boolean().default(false),
|
|
881
|
+
password: z.string().nullable().optional(),
|
|
882
|
+
}).merge(ZAutomationConfig.schema));
|
|
883
|
+
export const ZListLinks = z.lazy(() => z.object({
|
|
884
|
+
data: z.array(ZLink),
|
|
885
|
+
list_metadata: ZListMetadata,
|
|
886
|
+
}));
|
|
887
|
+
export const ZUpdateLinkRequest = z.lazy(() => z.object({
|
|
888
|
+
name: z.string().nullable().optional(),
|
|
889
|
+
default_language: z.string().nullable().optional(),
|
|
890
|
+
webhook_url: z.string().nullable().optional(),
|
|
891
|
+
webhook_headers: z.record(z.string(), z.string()).nullable().optional(),
|
|
892
|
+
need_validation: z.boolean().nullable().optional(),
|
|
893
|
+
password: z.string().nullable().optional(),
|
|
894
|
+
}).merge(ZUpdateAutomationRequest.schema));
|
|
895
|
+
export const ZAutomationLevel = z.lazy(() => z.object({
|
|
896
|
+
distance_threshold: z.number().default(0.9),
|
|
897
|
+
score_threshold: z.number().default(0.9),
|
|
898
|
+
}));
|
|
899
|
+
export const ZFetchParams = z.lazy(() => z.object({
|
|
900
|
+
endpoint: z.string(),
|
|
901
|
+
headers: z.record(z.string(), z.string()),
|
|
902
|
+
name: z.string(),
|
|
903
|
+
}));
|
|
904
|
+
export const ZListOutlooks = z.lazy(() => z.object({
|
|
905
|
+
data: z.array(ZOutlook),
|
|
906
|
+
list_metadata: ZListMetadata,
|
|
907
|
+
}));
|
|
908
|
+
export const ZMatchParams = z.lazy(() => z.object({
|
|
909
|
+
endpoint: z.string(),
|
|
910
|
+
headers: z.record(z.string(), z.string()),
|
|
911
|
+
path: z.string(),
|
|
912
|
+
}));
|
|
913
|
+
export const ZOutlook = z.lazy(() => z.object({
|
|
914
|
+
id: z.string(),
|
|
915
|
+
name: z.string(),
|
|
916
|
+
processor_id: z.string(),
|
|
917
|
+
updated_at: z.string(),
|
|
918
|
+
default_language: z.string().default("en"),
|
|
919
|
+
webhook_url: z.string(),
|
|
920
|
+
webhook_headers: z.record(z.string(), z.string()),
|
|
921
|
+
need_validation: z.boolean().default(false),
|
|
922
|
+
authorized_domains: z.array(z.string()),
|
|
923
|
+
authorized_emails: z.array(z.string().email()),
|
|
924
|
+
layout_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
925
|
+
match_params: z.array(ZMatchParams),
|
|
926
|
+
fetch_params: z.array(ZFetchParams),
|
|
927
|
+
}).merge(ZAutomationConfig.schema));
|
|
928
|
+
export const ZUpdateOutlookRequest = z.lazy(() => z.object({
|
|
929
|
+
name: z.string().nullable().optional(),
|
|
930
|
+
default_language: z.string().nullable().optional(),
|
|
931
|
+
webhook_url: z.string().nullable().optional(),
|
|
932
|
+
webhook_headers: z.record(z.string(), z.string()).nullable().optional(),
|
|
933
|
+
need_validation: z.boolean().nullable().optional(),
|
|
934
|
+
authorized_domains: z.array(z.string()).nullable().optional(),
|
|
935
|
+
authorized_emails: z.array(z.string().email()).nullable().optional(),
|
|
936
|
+
match_params: z.array(ZMatchParams).nullable().optional(),
|
|
937
|
+
fetch_params: z.array(ZFetchParams).nullable().optional(),
|
|
938
|
+
layout_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
939
|
+
}).merge(ZUpdateAutomationRequest.schema));
|
|
940
|
+
export const ZBaseWebhookRequest = z.lazy(() => z.object({
|
|
941
|
+
completion: ZRetabParsedChatCompletion,
|
|
942
|
+
user: z.string().email().nullable().optional(),
|
|
943
|
+
file_payload: ZBaseMIMEData,
|
|
944
|
+
metadata: z.record(z.string(), z.any()).nullable().optional(),
|
|
945
|
+
}));
|
|
946
|
+
export const ZWebhookRequest = z.lazy(() => z.object({
|
|
947
|
+
completion: ZRetabParsedChatCompletion,
|
|
948
|
+
user: z.string().email().nullable().optional(),
|
|
949
|
+
file_payload: ZMIMEData,
|
|
950
|
+
metadata: z.record(z.string(), z.any()).nullable().optional(),
|
|
951
|
+
}));
|
|
952
|
+
export const ZEndpoint = z.lazy(() => z.object({
|
|
953
|
+
id: z.string(),
|
|
954
|
+
name: z.string(),
|
|
955
|
+
processor_id: z.string(),
|
|
956
|
+
updated_at: z.string(),
|
|
957
|
+
default_language: z.string().default("en"),
|
|
958
|
+
webhook_url: z.string(),
|
|
959
|
+
webhook_headers: z.record(z.string(), z.string()),
|
|
960
|
+
need_validation: z.boolean().default(false),
|
|
961
|
+
}).merge(ZAutomationConfig.schema));
|
|
962
|
+
export const ZListEndpoints = z.lazy(() => z.object({
|
|
963
|
+
data: z.array(ZEndpoint),
|
|
964
|
+
list_metadata: ZListMetadata,
|
|
965
|
+
}));
|
|
966
|
+
export const ZUpdateEndpointRequest = z.lazy(() => z.object({
|
|
967
|
+
name: z.string().nullable().optional(),
|
|
968
|
+
default_language: z.string().nullable().optional(),
|
|
969
|
+
webhook_url: z.string().nullable().optional(),
|
|
970
|
+
webhook_headers: z.record(z.string(), z.string()).nullable().optional(),
|
|
971
|
+
need_validation: z.boolean().nullable().optional(),
|
|
972
|
+
}).merge(ZUpdateAutomationRequest.schema));
|
|
973
|
+
export const ZChatCompletionChunk = z.lazy(() => z.object({
|
|
974
|
+
id: z.string(),
|
|
975
|
+
choices: z.array(ZChoice),
|
|
976
|
+
created: z.number(),
|
|
977
|
+
model: z.string(),
|
|
978
|
+
object: z.literal("chat.completion.chunk"),
|
|
979
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
980
|
+
system_fingerprint: z.string().nullable().optional(),
|
|
981
|
+
usage: ZCompletionUsage.nullable().optional(),
|
|
982
|
+
}));
|
|
983
|
+
export const ZChoiceChunk = z.lazy(() => z.object({
|
|
984
|
+
delta: ZChoiceDelta,
|
|
985
|
+
finish_reason: z.union([z.literal("stop"), z.literal("length"), z.literal("tool_calls"), z.literal("content_filter"), z.literal("function_call")]).nullable().optional(),
|
|
986
|
+
index: z.number(),
|
|
987
|
+
logprobs: ZChoiceLogprobs.nullable().optional(),
|
|
988
|
+
}));
|
|
989
|
+
export const ZChoiceDeltaChunk = z.lazy(() => z.object({
|
|
990
|
+
content: z.string().nullable().optional(),
|
|
991
|
+
function_call: ZChoiceDeltaFunctionCall.nullable().optional(),
|
|
992
|
+
refusal: z.string().nullable().optional(),
|
|
993
|
+
role: z.union([z.literal("developer"), z.literal("system"), z.literal("user"), z.literal("assistant"), z.literal("tool")]).nullable().optional(),
|
|
994
|
+
tool_calls: z.array(ZChoiceDeltaToolCall).nullable().optional(),
|
|
995
|
+
}));
|
|
996
|
+
export const ZConsensusModel = z.lazy(() => z.object({
|
|
997
|
+
model: z.string(),
|
|
998
|
+
temperature: z.number().default(0.0),
|
|
999
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
1000
|
+
}));
|
|
1001
|
+
export const ZDocumentExtractRequest = z.lazy(() => z.object({
|
|
1002
|
+
document: ZMIMEData,
|
|
1003
|
+
documents: z.array(ZMIMEData),
|
|
1004
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
1005
|
+
image_resolution_dpi: z.number().default(96),
|
|
1006
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
1007
|
+
model: z.string(),
|
|
1008
|
+
json_schema: z.record(z.string(), z.any()),
|
|
1009
|
+
temperature: z.number().default(0.0),
|
|
1010
|
+
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
1011
|
+
n_consensus: z.number().default(1),
|
|
1012
|
+
stream: z.boolean().default(false),
|
|
1013
|
+
seed: z.number().nullable().optional(),
|
|
1014
|
+
store: z.boolean().default(true),
|
|
1015
|
+
need_validation: z.boolean().default(false),
|
|
1016
|
+
}));
|
|
1017
|
+
export const ZFieldLocation = z.lazy(() => z.object({
|
|
1018
|
+
label: z.string(),
|
|
1019
|
+
value: z.string(),
|
|
1020
|
+
quote: z.string(),
|
|
1021
|
+
file_id: z.string().nullable().optional(),
|
|
1022
|
+
page: z.number().nullable().optional(),
|
|
1023
|
+
bbox_normalized: z.tuple([z.number(), z.number(), z.number(), z.number()]).nullable().optional(),
|
|
1024
|
+
score: z.number().nullable().optional(),
|
|
1025
|
+
match_level: z.union([z.literal("token"), z.literal("line"), z.literal("block")]).nullable().optional(),
|
|
1026
|
+
}));
|
|
1027
|
+
export const ZLikelihoodsSource = z.lazy(() => z.union([z.literal("consensus"), z.literal("log_probs")]));
|
|
1028
|
+
export const ZLogExtractionRequest = z.lazy(() => z.object({
|
|
1029
|
+
messages: z.array(ZChatCompletionRetabMessage).nullable().optional(),
|
|
1030
|
+
openai_messages: z.array(z.union([ZChatCompletionDeveloperMessageParam, ZChatCompletionSystemMessageParam, ZChatCompletionUserMessageParam, ZChatCompletionAssistantMessageParam, ZChatCompletionToolMessageParam, ZChatCompletionFunctionMessageParam])).nullable().optional(),
|
|
1031
|
+
openai_responses_input: z.array(z.union([ZEasyInputMessageParam, ZMessage, ZResponseOutputMessageParam, ZResponseFileSearchToolCallParam, ZResponseComputerToolCallParam, ZComputerCallOutput, ZResponseFunctionWebSearchParam, ZResponseFunctionToolCallParam, ZFunctionCallOutput, ZResponseReasoningItemParam, ZImageGenerationCall, ZResponseCodeInterpreterToolCallParam, ZLocalShellCall, ZLocalShellCallOutput, ZMcpListTools, ZMcpApprovalRequest, ZMcpApprovalResponse, ZMcpCall, ZItemReference])).nullable().optional(),
|
|
1032
|
+
anthropic_messages: z.array(ZMessageParam).nullable().optional(),
|
|
1033
|
+
anthropic_system_prompt: z.string().nullable().optional(),
|
|
1034
|
+
document: ZMIMEData.default({ "filename": "dummy.txt", "url": "data:text/plain;base64,Tm8gZG9jdW1lbnQgcHJvdmlkZWQ=" }),
|
|
1035
|
+
completion: z.union([z.record(z.any()), ZRetabParsedChatCompletion, ZMessage, ZParsedChatCompletion, ZChatCompletion]).nullable().optional(),
|
|
1036
|
+
openai_responses_output: ZResponse.nullable().optional(),
|
|
1037
|
+
json_schema: z.record(z.string(), z.any()),
|
|
1038
|
+
model: z.string(),
|
|
1039
|
+
temperature: z.number(),
|
|
1040
|
+
}));
|
|
1041
|
+
export const ZLogExtractionResponse = z.lazy(() => z.object({
|
|
1042
|
+
extraction_id: z.string().nullable().optional(),
|
|
1043
|
+
status: z.union([z.literal("success"), z.literal("error")]),
|
|
1044
|
+
error_message: z.string().nullable().optional(),
|
|
1045
|
+
}));
|
|
1046
|
+
export const ZMessage = z.lazy(() => z.object({
|
|
1047
|
+
id: z.string(),
|
|
1048
|
+
content: z.array(z.union([ZTextBlock, ZThinkingBlock, ZRedactedThinkingBlock, ZToolUseBlock, ZServerToolUseBlock, ZWebSearchToolResultBlock])),
|
|
1049
|
+
model: z.union([z.union([z.literal("claude-3-7-sonnet-latest"), z.literal("claude-3-7-sonnet-20250219"), z.literal("claude-3-5-haiku-latest"), z.literal("claude-3-5-haiku-20241022"), z.literal("claude-sonnet-4-20250514"), z.literal("claude-sonnet-4-0"), z.literal("claude-4-sonnet-20250514"), z.literal("claude-3-5-sonnet-latest"), z.literal("claude-3-5-sonnet-20241022"), z.literal("claude-3-5-sonnet-20240620"), z.literal("claude-opus-4-0"), z.literal("claude-opus-4-20250514"), z.literal("claude-4-opus-20250514"), z.literal("claude-3-opus-latest"), z.literal("claude-3-opus-20240229"), z.literal("claude-3-sonnet-20240229"), z.literal("claude-3-haiku-20240307"), z.literal("claude-2.1"), z.literal("claude-2.0")]), z.string()]),
|
|
1050
|
+
role: z.literal("assistant"),
|
|
1051
|
+
stop_reason: z.union([z.literal("end_turn"), z.literal("max_tokens"), z.literal("stop_sequence"), z.literal("tool_use"), z.literal("pause_turn"), z.literal("refusal")]).nullable().optional(),
|
|
1052
|
+
stop_sequence: z.string().nullable().optional(),
|
|
1053
|
+
type: z.literal("message"),
|
|
1054
|
+
usage: ZUsage,
|
|
1055
|
+
}));
|
|
1056
|
+
export const ZParsedChatCompletion = z.lazy(() => z.object({
|
|
1057
|
+
id: z.string(),
|
|
1058
|
+
choices: z.array(ZParsedChoice),
|
|
1059
|
+
created: z.number(),
|
|
1060
|
+
model: z.string(),
|
|
1061
|
+
object: z.literal("chat.completion"),
|
|
1062
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
1063
|
+
system_fingerprint: z.string().nullable().optional(),
|
|
1064
|
+
usage: ZCompletionUsage.nullable().optional(),
|
|
1065
|
+
}).merge(ZChatCompletion.schema));
|
|
1066
|
+
export const ZParsedChoice = z.lazy(() => z.object({
|
|
1067
|
+
finish_reason: z.union([z.literal("stop"), z.literal("length"), z.literal("tool_calls"), z.literal("content_filter"), z.literal("function_call")]),
|
|
1068
|
+
index: z.number(),
|
|
1069
|
+
logprobs: ZChoiceLogprobs.nullable().optional(),
|
|
1070
|
+
message: ZParsedChatCompletionMessage,
|
|
1071
|
+
}).merge(ZChoice.schema));
|
|
1072
|
+
export const ZResponse = z.lazy(() => z.object({
|
|
1073
|
+
id: z.string(),
|
|
1074
|
+
created_at: z.number(),
|
|
1075
|
+
error: ZResponseError.nullable().optional(),
|
|
1076
|
+
incomplete_details: ZIncompleteDetails.nullable().optional(),
|
|
1077
|
+
instructions: z.union([z.string(), z.array(z.union([ZEasyInputMessage, ZMessage, ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseComputerToolCall, ZComputerCallOutput, ZResponseFunctionWebSearch, ZResponseFunctionToolCall, ZFunctionCallOutput, ZResponseReasoningItem, ZImageGenerationCall, ZResponseCodeInterpreterToolCall, ZLocalShellCall, ZLocalShellCallOutput, ZMcpListTools, ZMcpApprovalRequest, ZMcpApprovalResponse, ZMcpCall, ZItemReference]))]).nullable().optional(),
|
|
1078
|
+
metadata: z.record(z.string(), z.string()).nullable().optional(),
|
|
1079
|
+
model: z.union([z.string(), z.union([z.literal("gpt-4.1"), z.literal("gpt-4.1-mini"), z.literal("gpt-4.1-nano"), z.literal("gpt-4.1-2025-04-14"), z.literal("gpt-4.1-mini-2025-04-14"), z.literal("gpt-4.1-nano-2025-04-14"), z.literal("o4-mini"), z.literal("o4-mini-2025-04-16"), z.literal("o3"), z.literal("o3-2025-04-16"), z.literal("o3-mini"), z.literal("o3-mini-2025-01-31"), z.literal("o1"), z.literal("o1-2024-12-17"), z.literal("o1-preview"), z.literal("o1-preview-2024-09-12"), z.literal("o1-mini"), z.literal("o1-mini-2024-09-12"), z.literal("gpt-4o"), z.literal("gpt-4o-2024-11-20"), z.literal("gpt-4o-2024-08-06"), z.literal("gpt-4o-2024-05-13"), z.literal("gpt-4o-audio-preview"), z.literal("gpt-4o-audio-preview-2024-10-01"), z.literal("gpt-4o-audio-preview-2024-12-17"), z.literal("gpt-4o-audio-preview-2025-06-03"), z.literal("gpt-4o-mini-audio-preview"), z.literal("gpt-4o-mini-audio-preview-2024-12-17"), z.literal("gpt-4o-search-preview"), z.literal("gpt-4o-mini-search-preview"), z.literal("gpt-4o-search-preview-2025-03-11"), z.literal("gpt-4o-mini-search-preview-2025-03-11"), z.literal("chatgpt-4o-latest"), z.literal("codex-mini-latest"), z.literal("gpt-4o-mini"), z.literal("gpt-4o-mini-2024-07-18"), z.literal("gpt-4-turbo"), z.literal("gpt-4-turbo-2024-04-09"), z.literal("gpt-4-0125-preview"), z.literal("gpt-4-turbo-preview"), z.literal("gpt-4-1106-preview"), z.literal("gpt-4-vision-preview"), z.literal("gpt-4"), z.literal("gpt-4-0314"), z.literal("gpt-4-0613"), z.literal("gpt-4-32k"), z.literal("gpt-4-32k-0314"), z.literal("gpt-4-32k-0613"), z.literal("gpt-3.5-turbo"), z.literal("gpt-3.5-turbo-16k"), z.literal("gpt-3.5-turbo-0301"), z.literal("gpt-3.5-turbo-0613"), z.literal("gpt-3.5-turbo-1106"), z.literal("gpt-3.5-turbo-0125"), z.literal("gpt-3.5-turbo-16k-0613")]), z.union([z.literal("o1-pro"), z.literal("o1-pro-2025-03-19"), z.literal("o3-pro"), z.literal("o3-pro-2025-06-10"), z.literal("o3-deep-research"), z.literal("o3-deep-research-2025-06-26"), z.literal("o4-mini-deep-research"), z.literal("o4-mini-deep-research-2025-06-26"), z.literal("computer-use-preview"), z.literal("computer-use-preview-2025-03-11")])]),
|
|
1080
|
+
object: z.literal("response"),
|
|
1081
|
+
output: z.array(z.union([ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseFunctionToolCall, ZResponseFunctionWebSearch, ZResponseComputerToolCall, ZResponseReasoningItem, ZImageGenerationCall, ZResponseCodeInterpreterToolCall, ZLocalShellCall, ZMcpCall, ZMcpListTools, ZMcpApprovalRequest])),
|
|
1082
|
+
parallel_tool_calls: z.boolean(),
|
|
1083
|
+
temperature: z.number().nullable().optional(),
|
|
1084
|
+
tool_choice: z.union([z.union([z.literal("none"), z.literal("auto"), z.literal("required")]), ZToolChoiceTypes, ZToolChoiceFunction, ZToolChoiceMcp]),
|
|
1085
|
+
tools: z.array(z.union([ZFunctionTool, ZFileSearchTool, ZWebSearchTool, ZComputerTool, ZMcp, ZCodeInterpreter, ZImageGeneration, ZLocalShell])),
|
|
1086
|
+
top_p: z.number().nullable().optional(),
|
|
1087
|
+
background: z.boolean().nullable().optional(),
|
|
1088
|
+
max_output_tokens: z.number().nullable().optional(),
|
|
1089
|
+
max_tool_calls: z.number().nullable().optional(),
|
|
1090
|
+
previous_response_id: z.string().nullable().optional(),
|
|
1091
|
+
prompt: ZResponsePrompt.nullable().optional(),
|
|
1092
|
+
reasoning: ZReasoning.nullable().optional(),
|
|
1093
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
1094
|
+
status: z.union([z.literal("completed"), z.literal("failed"), z.literal("in_progress"), z.literal("cancelled"), z.literal("queued"), z.literal("incomplete")]).nullable().optional(),
|
|
1095
|
+
text: ZResponseTextConfig.nullable().optional(),
|
|
1096
|
+
top_logprobs: z.number().nullable().optional(),
|
|
1097
|
+
truncation: z.union([z.literal("auto"), z.literal("disabled")]).nullable().optional(),
|
|
1098
|
+
usage: ZResponseUsage.nullable().optional(),
|
|
1099
|
+
user: z.string().nullable().optional(),
|
|
1100
|
+
}));
|
|
1101
|
+
export const ZRetabParsedChatCompletionChunk = z.lazy(() => z.object({
|
|
1102
|
+
id: z.string(),
|
|
1103
|
+
choices: z.array(ZRetabParsedChoiceChunk),
|
|
1104
|
+
created: z.number(),
|
|
1105
|
+
model: z.string(),
|
|
1106
|
+
object: z.literal("chat.completion.chunk"),
|
|
1107
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
1108
|
+
system_fingerprint: z.string().nullable().optional(),
|
|
1109
|
+
usage: ZCompletionUsage.nullable().optional(),
|
|
1110
|
+
streaming_error: ZErrorDetail.nullable().optional(),
|
|
1111
|
+
extraction_id: z.string().nullable().optional(),
|
|
1112
|
+
schema_validation_error: ZErrorDetail.nullable().optional(),
|
|
1113
|
+
request_at: z.string().nullable().optional(),
|
|
1114
|
+
first_token_at: z.string().nullable().optional(),
|
|
1115
|
+
last_token_at: z.string().nullable().optional(),
|
|
1116
|
+
}).merge(ZStreamingBaseModel.schema).merge(ZChatCompletionChunk.schema));
|
|
1117
|
+
export const ZRetabParsedChoice = z.lazy(() => z.object({
|
|
1118
|
+
finish_reason: z.union([z.literal("stop"), z.literal("length"), z.literal("tool_calls"), z.literal("content_filter"), z.literal("function_call")]).nullable().optional(),
|
|
1119
|
+
index: z.number(),
|
|
1120
|
+
logprobs: ZChoiceLogprobs.nullable().optional(),
|
|
1121
|
+
message: ZParsedChatCompletionMessage,
|
|
1122
|
+
field_locations: z.record(z.string(), ZFieldLocation).nullable().optional(),
|
|
1123
|
+
key_mapping: z.record(z.string(), z.string().nullable().optional()).nullable().optional(),
|
|
1124
|
+
}).merge(ZParsedChoice.schema));
|
|
1125
|
+
export const ZRetabParsedChoiceChunk = z.lazy(() => z.object({
|
|
1126
|
+
delta: ZRetabParsedChoiceDeltaChunk,
|
|
1127
|
+
finish_reason: z.union([z.literal("stop"), z.literal("length"), z.literal("tool_calls"), z.literal("content_filter"), z.literal("function_call")]).nullable().optional(),
|
|
1128
|
+
index: z.number(),
|
|
1129
|
+
logprobs: ZChoiceLogprobs.nullable().optional(),
|
|
1130
|
+
}).merge(ZChoice.schema));
|
|
1131
|
+
export const ZRetabParsedChoiceDeltaChunk = z.lazy(() => z.object({
|
|
1132
|
+
content: z.string().nullable().optional(),
|
|
1133
|
+
function_call: ZChoiceDeltaFunctionCall.nullable().optional(),
|
|
1134
|
+
refusal: z.string().nullable().optional(),
|
|
1135
|
+
role: z.union([z.literal("developer"), z.literal("system"), z.literal("user"), z.literal("assistant"), z.literal("tool")]).nullable().optional(),
|
|
1136
|
+
tool_calls: z.array(ZChoiceDeltaToolCall).nullable().optional(),
|
|
1137
|
+
flat_likelihoods: z.record(z.string(), z.number()).default({}),
|
|
1138
|
+
flat_parsed: z.record(z.string(), z.any()).default({}),
|
|
1139
|
+
flat_deleted_keys: z.array(z.string()).default([]),
|
|
1140
|
+
field_locations: z.record(z.string(), z.array(ZFieldLocation)).nullable().optional(),
|
|
1141
|
+
is_valid_json: z.boolean().default(false),
|
|
1142
|
+
key_mapping: z.record(z.string(), z.string().nullable().optional()).nullable().optional(),
|
|
1143
|
+
}).merge(ZChoiceDelta.schema));
|
|
1144
|
+
export const ZUiResponse = z.lazy(() => z.object({
|
|
1145
|
+
id: z.string(),
|
|
1146
|
+
created_at: z.number(),
|
|
1147
|
+
error: ZResponseError.nullable().optional(),
|
|
1148
|
+
incomplete_details: ZIncompleteDetails.nullable().optional(),
|
|
1149
|
+
instructions: z.union([z.string(), z.array(z.union([ZEasyInputMessage, ZMessage, ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseComputerToolCall, ZComputerCallOutput, ZResponseFunctionWebSearch, ZResponseFunctionToolCall, ZFunctionCallOutput, ZResponseReasoningItem, ZImageGenerationCall, ZResponseCodeInterpreterToolCall, ZLocalShellCall, ZLocalShellCallOutput, ZMcpListTools, ZMcpApprovalRequest, ZMcpApprovalResponse, ZMcpCall, ZItemReference]))]).nullable().optional(),
|
|
1150
|
+
metadata: z.record(z.string(), z.string()).nullable().optional(),
|
|
1151
|
+
model: z.union([z.string(), z.union([z.literal("gpt-4.1"), z.literal("gpt-4.1-mini"), z.literal("gpt-4.1-nano"), z.literal("gpt-4.1-2025-04-14"), z.literal("gpt-4.1-mini-2025-04-14"), z.literal("gpt-4.1-nano-2025-04-14"), z.literal("o4-mini"), z.literal("o4-mini-2025-04-16"), z.literal("o3"), z.literal("o3-2025-04-16"), z.literal("o3-mini"), z.literal("o3-mini-2025-01-31"), z.literal("o1"), z.literal("o1-2024-12-17"), z.literal("o1-preview"), z.literal("o1-preview-2024-09-12"), z.literal("o1-mini"), z.literal("o1-mini-2024-09-12"), z.literal("gpt-4o"), z.literal("gpt-4o-2024-11-20"), z.literal("gpt-4o-2024-08-06"), z.literal("gpt-4o-2024-05-13"), z.literal("gpt-4o-audio-preview"), z.literal("gpt-4o-audio-preview-2024-10-01"), z.literal("gpt-4o-audio-preview-2024-12-17"), z.literal("gpt-4o-audio-preview-2025-06-03"), z.literal("gpt-4o-mini-audio-preview"), z.literal("gpt-4o-mini-audio-preview-2024-12-17"), z.literal("gpt-4o-search-preview"), z.literal("gpt-4o-mini-search-preview"), z.literal("gpt-4o-search-preview-2025-03-11"), z.literal("gpt-4o-mini-search-preview-2025-03-11"), z.literal("chatgpt-4o-latest"), z.literal("codex-mini-latest"), z.literal("gpt-4o-mini"), z.literal("gpt-4o-mini-2024-07-18"), z.literal("gpt-4-turbo"), z.literal("gpt-4-turbo-2024-04-09"), z.literal("gpt-4-0125-preview"), z.literal("gpt-4-turbo-preview"), z.literal("gpt-4-1106-preview"), z.literal("gpt-4-vision-preview"), z.literal("gpt-4"), z.literal("gpt-4-0314"), z.literal("gpt-4-0613"), z.literal("gpt-4-32k"), z.literal("gpt-4-32k-0314"), z.literal("gpt-4-32k-0613"), z.literal("gpt-3.5-turbo"), z.literal("gpt-3.5-turbo-16k"), z.literal("gpt-3.5-turbo-0301"), z.literal("gpt-3.5-turbo-0613"), z.literal("gpt-3.5-turbo-1106"), z.literal("gpt-3.5-turbo-0125"), z.literal("gpt-3.5-turbo-16k-0613")]), z.union([z.literal("o1-pro"), z.literal("o1-pro-2025-03-19"), z.literal("o3-pro"), z.literal("o3-pro-2025-06-10"), z.literal("o3-deep-research"), z.literal("o3-deep-research-2025-06-26"), z.literal("o4-mini-deep-research"), z.literal("o4-mini-deep-research-2025-06-26"), z.literal("computer-use-preview"), z.literal("computer-use-preview-2025-03-11")])]),
|
|
1152
|
+
object: z.literal("response"),
|
|
1153
|
+
output: z.array(z.union([ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseFunctionToolCall, ZResponseFunctionWebSearch, ZResponseComputerToolCall, ZResponseReasoningItem, ZImageGenerationCall, ZResponseCodeInterpreterToolCall, ZLocalShellCall, ZMcpCall, ZMcpListTools, ZMcpApprovalRequest])),
|
|
1154
|
+
parallel_tool_calls: z.boolean(),
|
|
1155
|
+
temperature: z.number().nullable().optional(),
|
|
1156
|
+
tool_choice: z.union([z.union([z.literal("none"), z.literal("auto"), z.literal("required")]), ZToolChoiceTypes, ZToolChoiceFunction, ZToolChoiceMcp]),
|
|
1157
|
+
tools: z.array(z.union([ZFunctionTool, ZFileSearchTool, ZWebSearchTool, ZComputerTool, ZMcp, ZCodeInterpreter, ZImageGeneration, ZLocalShell])),
|
|
1158
|
+
top_p: z.number().nullable().optional(),
|
|
1159
|
+
background: z.boolean().nullable().optional(),
|
|
1160
|
+
max_output_tokens: z.number().nullable().optional(),
|
|
1161
|
+
max_tool_calls: z.number().nullable().optional(),
|
|
1162
|
+
previous_response_id: z.string().nullable().optional(),
|
|
1163
|
+
prompt: ZResponsePrompt.nullable().optional(),
|
|
1164
|
+
reasoning: ZReasoning.nullable().optional(),
|
|
1165
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
1166
|
+
status: z.union([z.literal("completed"), z.literal("failed"), z.literal("in_progress"), z.literal("cancelled"), z.literal("queued"), z.literal("incomplete")]).nullable().optional(),
|
|
1167
|
+
text: ZResponseTextConfig.nullable().optional(),
|
|
1168
|
+
top_logprobs: z.number().nullable().optional(),
|
|
1169
|
+
truncation: z.union([z.literal("auto"), z.literal("disabled")]).nullable().optional(),
|
|
1170
|
+
usage: ZResponseUsage.nullable().optional(),
|
|
1171
|
+
user: z.string().nullable().optional(),
|
|
1172
|
+
extraction_id: z.string().nullable().optional(),
|
|
1173
|
+
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
1174
|
+
schema_validation_error: ZErrorDetail.nullable().optional(),
|
|
1175
|
+
request_at: z.string().nullable().optional(),
|
|
1176
|
+
first_token_at: z.string().nullable().optional(),
|
|
1177
|
+
last_token_at: z.string().nullable().optional(),
|
|
1178
|
+
}).merge(ZResponse.schema));
|
|
1179
|
+
export const ZDocumentTransformRequest = z.lazy(() => z.object({
|
|
1180
|
+
document: ZMIMEData,
|
|
1181
|
+
}));
|
|
1182
|
+
export const ZDocumentTransformResponse = z.lazy(() => z.object({
|
|
1183
|
+
document: ZMIMEData,
|
|
1184
|
+
}));
|
|
1185
|
+
export const ZParseRequest = z.lazy(() => z.object({
|
|
1186
|
+
document: ZMIMEData,
|
|
1187
|
+
model: z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-4.1"), z.literal("gpt-4.1-mini"), z.literal("gpt-4.1-mini-2025-04-14"), z.literal("gpt-4.1-2025-04-14"), z.literal("gpt-4.1-nano"), z.literal("gpt-4.1-nano-2025-04-14"), z.literal("gpt-4o-2024-11-20"), z.literal("gpt-4o-2024-08-06"), z.literal("gpt-4o-2024-05-13"), z.literal("gpt-4o-mini-2024-07-18"), z.literal("o1"), z.literal("o1-2024-12-17"), z.literal("o3"), z.literal("o3-2025-04-16"), z.literal("o4-mini"), z.literal("o4-mini-2025-04-16"), z.literal("gpt-4o-audio-preview-2024-12-17"), z.literal("gpt-4o-audio-preview-2024-10-01"), z.literal("gpt-4o-realtime-preview-2024-12-17"), z.literal("gpt-4o-realtime-preview-2024-10-01"), z.literal("gpt-4o-mini-audio-preview-2024-12-17"), z.literal("gpt-4o-mini-realtime-preview-2024-12-17"), z.literal("claude-3-5-sonnet-latest"), z.literal("claude-3-5-sonnet-20241022"), z.literal("claude-3-opus-20240229"), z.literal("claude-3-sonnet-20240229"), z.literal("claude-3-haiku-20240307"), z.literal("grok-3"), z.literal("grok-3-mini"), z.literal("gemini-2.5-pro"), z.literal("gemini-2.5-flash"), z.literal("gemini-2.5-pro-preview-06-05"), z.literal("gemini-2.5-pro-preview-05-06"), z.literal("gemini-2.5-pro-preview-03-25"), z.literal("gemini-2.5-flash-preview-05-20"), z.literal("gemini-2.5-flash-preview-04-17"), z.literal("gemini-2.5-flash-lite-preview-06-17"), z.literal("gemini-2.5-pro-exp-03-25"), z.literal("gemini-2.0-flash-lite"), z.literal("gemini-2.0-flash"), z.literal("auto-large"), z.literal("auto-small"), z.literal("auto-micro"), z.literal("human")]).default("gemini-2.5-flash"),
|
|
1188
|
+
table_parsing_format: z.union([z.literal("markdown"), z.literal("yaml"), z.literal("html"), z.literal("json")]).default("html"),
|
|
1189
|
+
image_resolution_dpi: z.number().default(72),
|
|
1190
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
1191
|
+
}));
|
|
1192
|
+
export const ZParseResult = z.lazy(() => z.object({
|
|
1193
|
+
document: ZBaseMIMEData,
|
|
1194
|
+
usage: ZRetabUsage,
|
|
1195
|
+
pages: z.array(z.string()),
|
|
1196
|
+
text: z.string(),
|
|
1197
|
+
}));
|
|
1198
|
+
export const ZRetabUsage = z.lazy(() => z.object({
|
|
1199
|
+
page_count: z.number(),
|
|
1200
|
+
credits: z.number(),
|
|
1201
|
+
}));
|
|
1202
|
+
export const ZTableParsingFormat = z.lazy(() => z.union([z.literal("markdown"), z.literal("yaml"), z.literal("html"), z.literal("json")]));
|
|
1203
|
+
export const ZDocumentCreateInputRequest = z.lazy(() => z.object({
|
|
1204
|
+
document: ZMIMEData,
|
|
1205
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
1206
|
+
image_resolution_dpi: z.number().default(96),
|
|
1207
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
1208
|
+
json_schema: z.record(z.string(), z.any()),
|
|
1209
|
+
}).merge(ZDocumentCreateMessageRequest.schema));
|
|
1210
|
+
export const ZDocumentCreateMessageRequest = z.lazy(() => z.object({
|
|
1211
|
+
document: ZMIMEData,
|
|
1212
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
1213
|
+
image_resolution_dpi: z.number().default(96),
|
|
1214
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
1215
|
+
}));
|
|
1216
|
+
export const ZDocumentMessage = z.lazy(() => z.object({
|
|
1217
|
+
id: z.string(),
|
|
1218
|
+
object: z.literal("document_message").default("document_message"),
|
|
1219
|
+
messages: z.array(ZChatCompletionRetabMessage),
|
|
1220
|
+
created: z.number(),
|
|
1221
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
1222
|
+
}));
|
|
1223
|
+
export const ZMediaType = z.lazy(() => z.union([z.literal("image/jpeg"), z.literal("image/png"), z.literal("image/gif"), z.literal("image/webp")]));
|
|
1224
|
+
export const ZTokenCount = z.lazy(() => z.object({
|
|
1225
|
+
total_tokens: z.number().default(0),
|
|
1226
|
+
developer_tokens: z.number().default(0),
|
|
1227
|
+
user_tokens: z.number().default(0),
|
|
1228
|
+
}));
|
|
1229
|
+
export const ZDatasetSplitInputData = z.lazy(() => z.object({
|
|
1230
|
+
dataset_id: z.string(),
|
|
1231
|
+
train_size: z.union([z.number(), z.number()]).nullable().optional(),
|
|
1232
|
+
eval_size: z.union([z.number(), z.number()]).nullable().optional(),
|
|
1233
|
+
}));
|
|
1234
|
+
export const ZSelectionMode = z.lazy(() => z.union([z.literal("all"), z.literal("manual")]));
|
|
1235
|
+
export const ZChoice = z.lazy(() => z.object({
|
|
1236
|
+
finish_reason: z.union([z.literal("stop"), z.literal("length"), z.literal("tool_calls"), z.literal("content_filter"), z.literal("function_call")]),
|
|
1237
|
+
index: z.number(),
|
|
1238
|
+
logprobs: ZChoiceLogprobs.nullable().optional(),
|
|
1239
|
+
message: ZChatCompletionMessage,
|
|
1240
|
+
}));
|
|
1241
|
+
export const ZCompletionUsage = z.lazy(() => z.object({
|
|
1242
|
+
completion_tokens: z.number(),
|
|
1243
|
+
prompt_tokens: z.number(),
|
|
1244
|
+
total_tokens: z.number(),
|
|
1245
|
+
completion_tokens_details: ZCompletionTokensDetails.nullable().optional(),
|
|
1246
|
+
prompt_tokens_details: ZPromptTokensDetails.nullable().optional(),
|
|
1247
|
+
}));
|
|
1248
|
+
export const ZChatCompletionContentPartTextParam = z.lazy(() => z.object({
|
|
1249
|
+
text: z.string(),
|
|
1250
|
+
type: z.literal("text"),
|
|
1251
|
+
}));
|
|
1252
|
+
export const ZChatCompletionContentPartImageParam = z.lazy(() => z.object({
|
|
1253
|
+
image_url: ZImageURL,
|
|
1254
|
+
type: z.literal("image_url"),
|
|
1255
|
+
}));
|
|
1256
|
+
export const ZChatCompletionContentPartInputAudioParam = z.lazy(() => z.object({
|
|
1257
|
+
input_audio: ZInputAudio,
|
|
1258
|
+
type: z.literal("input_audio"),
|
|
1259
|
+
}));
|
|
1260
|
+
export const ZFile = z.lazy(() => z.object({
|
|
1261
|
+
file: ZFileFile,
|
|
1262
|
+
type: z.literal("file"),
|
|
1263
|
+
}));
|
|
1264
|
+
export const ZTokenCounts = z.lazy(() => z.object({
|
|
1265
|
+
prompt_regular_text: z.number(),
|
|
1266
|
+
prompt_cached_text: z.number(),
|
|
1267
|
+
prompt_audio: z.number(),
|
|
1268
|
+
completion_regular_text: z.number(),
|
|
1269
|
+
completion_audio: z.number(),
|
|
1270
|
+
total_tokens: z.number(),
|
|
1271
|
+
}));
|
|
1272
|
+
export const ZJSONSchema = z.lazy(() => z.object({
|
|
1273
|
+
name: z.string(),
|
|
1274
|
+
description: z.string(),
|
|
1275
|
+
schema: z.record(z.string(), z.object({}).passthrough()),
|
|
1276
|
+
strict: z.boolean().nullable().optional(),
|
|
1277
|
+
}));
|
|
1278
|
+
export const ZEasyInputMessageParam = z.lazy(() => z.object({
|
|
1279
|
+
content: z.union([z.string(), z.array(z.union([ZResponseInputTextParam, ZResponseInputImageParam, ZResponseInputFileParam]))]),
|
|
1280
|
+
role: z.union([z.literal("user"), z.literal("assistant"), z.literal("system"), z.literal("developer")]),
|
|
1281
|
+
type: z.literal("message"),
|
|
1282
|
+
}));
|
|
1283
|
+
export const ZResponseOutputMessageParam = z.lazy(() => z.object({
|
|
1284
|
+
id: z.string(),
|
|
1285
|
+
content: z.array(z.union([ZResponseOutputTextParam, ZResponseOutputRefusalParam])),
|
|
1286
|
+
role: z.literal("assistant"),
|
|
1287
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1288
|
+
type: z.literal("message"),
|
|
1289
|
+
}));
|
|
1290
|
+
export const ZResponseFileSearchToolCallParam = z.lazy(() => z.object({
|
|
1291
|
+
id: z.string(),
|
|
1292
|
+
queries: z.array(z.string()),
|
|
1293
|
+
status: z.union([z.literal("in_progress"), z.literal("searching"), z.literal("completed"), z.literal("incomplete"), z.literal("failed")]),
|
|
1294
|
+
type: z.literal("file_search_call"),
|
|
1295
|
+
results: z.array(ZResult).nullable().optional(),
|
|
1296
|
+
}));
|
|
1297
|
+
export const ZResponseComputerToolCallParam = z.lazy(() => z.object({
|
|
1298
|
+
id: z.string(),
|
|
1299
|
+
action: z.union([ZActionClick, ZActionDoubleClick, ZActionDrag, ZActionKeypress, ZActionMove, ZActionScreenshot, ZActionScroll, ZActionType, ZActionWait]),
|
|
1300
|
+
call_id: z.string(),
|
|
1301
|
+
pending_safety_checks: z.array(ZPendingSafetyCheck),
|
|
1302
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1303
|
+
type: z.literal("computer_call"),
|
|
1304
|
+
}));
|
|
1305
|
+
export const ZComputerCallOutput = z.lazy(() => z.object({
|
|
1306
|
+
call_id: z.string(),
|
|
1307
|
+
output: ZResponseComputerToolCallOutputScreenshotParam,
|
|
1308
|
+
type: z.literal("computer_call_output"),
|
|
1309
|
+
id: z.string().nullable().optional(),
|
|
1310
|
+
acknowledged_safety_checks: z.array(ZComputerCallOutputAcknowledgedSafetyCheck).nullable().optional(),
|
|
1311
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1312
|
+
}));
|
|
1313
|
+
export const ZResponseFunctionWebSearchParam = z.lazy(() => z.object({
|
|
1314
|
+
id: z.string(),
|
|
1315
|
+
action: z.union([ZActionSearch, ZActionOpenPage, ZActionFind]),
|
|
1316
|
+
status: z.union([z.literal("in_progress"), z.literal("searching"), z.literal("completed"), z.literal("failed")]),
|
|
1317
|
+
type: z.literal("web_search_call"),
|
|
1318
|
+
}));
|
|
1319
|
+
export const ZResponseFunctionToolCallParam = z.lazy(() => z.object({
|
|
1320
|
+
arguments: z.string(),
|
|
1321
|
+
call_id: z.string(),
|
|
1322
|
+
name: z.string(),
|
|
1323
|
+
type: z.literal("function_call"),
|
|
1324
|
+
id: z.string(),
|
|
1325
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1326
|
+
}));
|
|
1327
|
+
export const ZFunctionCallOutput = z.lazy(() => z.object({
|
|
1328
|
+
call_id: z.string(),
|
|
1329
|
+
output: z.string(),
|
|
1330
|
+
type: z.literal("function_call_output"),
|
|
1331
|
+
id: z.string().nullable().optional(),
|
|
1332
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1333
|
+
}));
|
|
1334
|
+
export const ZResponseReasoningItemParam = z.lazy(() => z.object({
|
|
1335
|
+
id: z.string(),
|
|
1336
|
+
summary: z.array(ZSummary),
|
|
1337
|
+
type: z.literal("reasoning"),
|
|
1338
|
+
encrypted_content: z.string().nullable().optional(),
|
|
1339
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1340
|
+
}));
|
|
1341
|
+
export const ZImageGenerationCall = z.lazy(() => z.object({
|
|
1342
|
+
id: z.string(),
|
|
1343
|
+
result: z.string().nullable().optional(),
|
|
1344
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("generating"), z.literal("failed")]),
|
|
1345
|
+
type: z.literal("image_generation_call"),
|
|
1346
|
+
}));
|
|
1347
|
+
export const ZResponseCodeInterpreterToolCallParam = z.lazy(() => z.object({
|
|
1348
|
+
id: z.string(),
|
|
1349
|
+
code: z.string().nullable().optional(),
|
|
1350
|
+
container_id: z.string(),
|
|
1351
|
+
outputs: z.array(z.union([ZOutputLogs, ZOutputImage])).nullable().optional(),
|
|
1352
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete"), z.literal("interpreting"), z.literal("failed")]),
|
|
1353
|
+
type: z.literal("code_interpreter_call"),
|
|
1354
|
+
}));
|
|
1355
|
+
export const ZLocalShellCall = z.lazy(() => z.object({
|
|
1356
|
+
id: z.string(),
|
|
1357
|
+
action: ZLocalShellCallAction,
|
|
1358
|
+
call_id: z.string(),
|
|
1359
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1360
|
+
type: z.literal("local_shell_call"),
|
|
1361
|
+
}));
|
|
1362
|
+
export const ZLocalShellCallOutput = z.lazy(() => z.object({
|
|
1363
|
+
id: z.string(),
|
|
1364
|
+
output: z.string(),
|
|
1365
|
+
type: z.literal("local_shell_call_output"),
|
|
1366
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1367
|
+
}));
|
|
1368
|
+
export const ZMcpListTools = z.lazy(() => z.object({
|
|
1369
|
+
id: z.string(),
|
|
1370
|
+
server_label: z.string(),
|
|
1371
|
+
tools: z.array(ZMcpListToolsTool),
|
|
1372
|
+
type: z.literal("mcp_list_tools"),
|
|
1373
|
+
error: z.string().nullable().optional(),
|
|
1374
|
+
}));
|
|
1375
|
+
export const ZMcpApprovalRequest = z.lazy(() => z.object({
|
|
1376
|
+
id: z.string(),
|
|
1377
|
+
arguments: z.string(),
|
|
1378
|
+
name: z.string(),
|
|
1379
|
+
server_label: z.string(),
|
|
1380
|
+
type: z.literal("mcp_approval_request"),
|
|
1381
|
+
}));
|
|
1382
|
+
export const ZMcpApprovalResponse = z.lazy(() => z.object({
|
|
1383
|
+
approval_request_id: z.string(),
|
|
1384
|
+
approve: z.boolean(),
|
|
1385
|
+
type: z.literal("mcp_approval_response"),
|
|
1386
|
+
id: z.string().nullable().optional(),
|
|
1387
|
+
reason: z.string().nullable().optional(),
|
|
1388
|
+
}));
|
|
1389
|
+
export const ZMcpCall = z.lazy(() => z.object({
|
|
1390
|
+
id: z.string(),
|
|
1391
|
+
arguments: z.string(),
|
|
1392
|
+
name: z.string(),
|
|
1393
|
+
server_label: z.string(),
|
|
1394
|
+
type: z.literal("mcp_call"),
|
|
1395
|
+
error: z.string().nullable().optional(),
|
|
1396
|
+
output: z.string().nullable().optional(),
|
|
1397
|
+
}));
|
|
1398
|
+
export const ZItemReference = z.lazy(() => z.object({
|
|
1399
|
+
id: z.string(),
|
|
1400
|
+
type: z.literal("item_reference").nullable().optional(),
|
|
1401
|
+
}));
|
|
1402
|
+
export const ZResponseFormatText = z.lazy(() => z.object({
|
|
1403
|
+
type: z.literal("text"),
|
|
1404
|
+
}));
|
|
1405
|
+
export const ZResponseFormatTextJSONSchemaConfigParam = z.lazy(() => z.object({
|
|
1406
|
+
name: z.string(),
|
|
1407
|
+
schema: z.record(z.string(), z.object({}).passthrough()),
|
|
1408
|
+
type: z.literal("json_schema"),
|
|
1409
|
+
description: z.string(),
|
|
1410
|
+
strict: z.boolean().nullable().optional(),
|
|
1411
|
+
}));
|
|
1412
|
+
export const ZResponseFormatJSONObject = z.lazy(() => z.object({
|
|
1413
|
+
type: z.literal("json_object"),
|
|
1414
|
+
}));
|
|
1415
|
+
export const ZChatCompletionDeveloperMessageParam = z.lazy(() => z.object({
|
|
1416
|
+
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
1417
|
+
role: z.literal("developer"),
|
|
1418
|
+
name: z.string(),
|
|
1419
|
+
}));
|
|
1420
|
+
export const ZChatCompletionSystemMessageParam = z.lazy(() => z.object({
|
|
1421
|
+
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
1422
|
+
role: z.literal("system"),
|
|
1423
|
+
name: z.string(),
|
|
1424
|
+
}));
|
|
1425
|
+
export const ZChatCompletionUserMessageParam = z.lazy(() => z.object({
|
|
1426
|
+
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartImageParam, ZChatCompletionContentPartInputAudioParam, ZFile]))]),
|
|
1427
|
+
role: z.literal("user"),
|
|
1428
|
+
name: z.string(),
|
|
1429
|
+
}));
|
|
1430
|
+
export const ZChatCompletionAssistantMessageParam = z.lazy(() => z.object({
|
|
1431
|
+
role: z.literal("assistant"),
|
|
1432
|
+
audio: ZAudio.nullable().optional(),
|
|
1433
|
+
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartRefusalParam]))]).nullable().optional(),
|
|
1434
|
+
function_call: ZFunctionCall.nullable().optional(),
|
|
1435
|
+
name: z.string(),
|
|
1436
|
+
refusal: z.string().nullable().optional(),
|
|
1437
|
+
tool_calls: z.array(ZChatCompletionMessageToolCallParam),
|
|
1438
|
+
}));
|
|
1439
|
+
export const ZChatCompletionToolMessageParam = z.lazy(() => z.object({
|
|
1440
|
+
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
1441
|
+
role: z.literal("tool"),
|
|
1442
|
+
tool_call_id: z.string(),
|
|
1443
|
+
}));
|
|
1444
|
+
export const ZChatCompletionFunctionMessageParam = z.lazy(() => z.object({
|
|
1445
|
+
content: z.string().nullable().optional(),
|
|
1446
|
+
name: z.string(),
|
|
1447
|
+
role: z.literal("function"),
|
|
1448
|
+
}));
|
|
1449
|
+
export const ZContent = z.lazy(() => z.object({
|
|
1450
|
+
parts: z.array(ZPart).nullable().optional(),
|
|
1451
|
+
role: z.string().nullable().optional(),
|
|
1452
|
+
}));
|
|
1453
|
+
export const ZPart = z.lazy(() => z.object({
|
|
1454
|
+
video_metadata: ZVideoMetadata.nullable().optional(),
|
|
1455
|
+
thought: z.boolean().nullable().optional(),
|
|
1456
|
+
inline_data: ZBlob.nullable().optional(),
|
|
1457
|
+
file_data: ZFileData.nullable().optional(),
|
|
1458
|
+
thought_signature: z.instanceof(Uint8Array).nullable().optional(),
|
|
1459
|
+
code_execution_result: ZCodeExecutionResult.nullable().optional(),
|
|
1460
|
+
executable_code: ZExecutableCode.nullable().optional(),
|
|
1461
|
+
function_call: ZFunctionCall.nullable().optional(),
|
|
1462
|
+
function_response: ZFunctionResponse.nullable().optional(),
|
|
1463
|
+
text: z.string().nullable().optional(),
|
|
1464
|
+
}));
|
|
1465
|
+
export const ZContentDict = z.lazy(() => z.object({
|
|
1466
|
+
parts: z.array(ZPartDict).nullable().optional(),
|
|
1467
|
+
role: z.string().nullable().optional(),
|
|
1468
|
+
}));
|
|
1469
|
+
export const ZTextBlockParam = z.lazy(() => z.object({
|
|
1470
|
+
text: z.string(),
|
|
1471
|
+
type: z.literal("text"),
|
|
1472
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1473
|
+
citations: z.array(z.union([ZCitationCharLocationParam, ZCitationPageLocationParam, ZCitationContentBlockLocationParam, ZCitationWebSearchResultLocationParam])).nullable().optional(),
|
|
1474
|
+
}));
|
|
1475
|
+
export const ZImageBlockParam = z.lazy(() => z.object({
|
|
1476
|
+
source: z.union([ZBase64ImageSourceParam, ZURLImageSourceParam]),
|
|
1477
|
+
type: z.literal("image"),
|
|
1478
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1479
|
+
}));
|
|
1480
|
+
export const ZDocumentBlockParam = z.lazy(() => z.object({
|
|
1481
|
+
source: z.union([ZBase64PDFSourceParam, ZPlainTextSourceParam, ZContentBlockSourceParam, ZURLPDFSourceParam]),
|
|
1482
|
+
type: z.literal("document"),
|
|
1483
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1484
|
+
citations: ZCitationsConfigParam,
|
|
1485
|
+
context: z.string().nullable().optional(),
|
|
1486
|
+
title: z.string().nullable().optional(),
|
|
1487
|
+
}));
|
|
1488
|
+
export const ZThinkingBlockParam = z.lazy(() => z.object({
|
|
1489
|
+
signature: z.string(),
|
|
1490
|
+
thinking: z.string(),
|
|
1491
|
+
type: z.literal("thinking"),
|
|
1492
|
+
}));
|
|
1493
|
+
export const ZRedactedThinkingBlockParam = z.lazy(() => z.object({
|
|
1494
|
+
data: z.string(),
|
|
1495
|
+
type: z.literal("redacted_thinking"),
|
|
1496
|
+
}));
|
|
1497
|
+
export const ZToolUseBlockParam = z.lazy(() => z.object({
|
|
1498
|
+
id: z.string(),
|
|
1499
|
+
input: z.object({}).passthrough(),
|
|
1500
|
+
name: z.string(),
|
|
1501
|
+
type: z.literal("tool_use"),
|
|
1502
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1503
|
+
}));
|
|
1504
|
+
export const ZToolResultBlockParam = z.lazy(() => z.object({
|
|
1505
|
+
tool_use_id: z.string(),
|
|
1506
|
+
type: z.literal("tool_result"),
|
|
1507
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1508
|
+
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam]))]),
|
|
1509
|
+
is_error: z.boolean(),
|
|
1510
|
+
}));
|
|
1511
|
+
export const ZServerToolUseBlockParam = z.lazy(() => z.object({
|
|
1512
|
+
id: z.string(),
|
|
1513
|
+
input: z.object({}).passthrough(),
|
|
1514
|
+
name: z.literal("web_search"),
|
|
1515
|
+
type: z.literal("server_tool_use"),
|
|
1516
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1517
|
+
}));
|
|
1518
|
+
export const ZWebSearchToolResultBlockParam = z.lazy(() => z.object({
|
|
1519
|
+
content: z.union([z.array(ZWebSearchResultBlockParam), ZWebSearchToolRequestErrorParam]),
|
|
1520
|
+
tool_use_id: z.string(),
|
|
1521
|
+
type: z.literal("web_search_tool_result"),
|
|
1522
|
+
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1523
|
+
}));
|
|
1524
|
+
export const ZTextBlock = z.lazy(() => z.object({
|
|
1525
|
+
citations: z.array(z.union([ZCitationCharLocation, ZCitationPageLocation, ZCitationContentBlockLocation, ZCitationsWebSearchResultLocation])).nullable().optional(),
|
|
1526
|
+
text: z.string(),
|
|
1527
|
+
type: z.literal("text"),
|
|
1528
|
+
}));
|
|
1529
|
+
export const ZThinkingBlock = z.lazy(() => z.object({
|
|
1530
|
+
signature: z.string(),
|
|
1531
|
+
thinking: z.string(),
|
|
1532
|
+
type: z.literal("thinking"),
|
|
1533
|
+
}));
|
|
1534
|
+
export const ZRedactedThinkingBlock = z.lazy(() => z.object({
|
|
1535
|
+
data: z.string(),
|
|
1536
|
+
type: z.literal("redacted_thinking"),
|
|
1537
|
+
}));
|
|
1538
|
+
export const ZToolUseBlock = z.lazy(() => z.object({
|
|
1539
|
+
id: z.string(),
|
|
1540
|
+
input: z.object({}).passthrough(),
|
|
1541
|
+
name: z.string(),
|
|
1542
|
+
type: z.literal("tool_use"),
|
|
1543
|
+
}));
|
|
1544
|
+
export const ZServerToolUseBlock = z.lazy(() => z.object({
|
|
1545
|
+
id: z.string(),
|
|
1546
|
+
input: z.object({}).passthrough(),
|
|
1547
|
+
name: z.literal("web_search"),
|
|
1548
|
+
type: z.literal("server_tool_use"),
|
|
1549
|
+
}));
|
|
1550
|
+
export const ZWebSearchToolResultBlock = z.lazy(() => z.object({
|
|
1551
|
+
content: z.union([ZWebSearchToolResultError, z.array(ZWebSearchResultBlock)]),
|
|
1552
|
+
tool_use_id: z.string(),
|
|
1553
|
+
type: z.literal("web_search_tool_result"),
|
|
1554
|
+
}));
|
|
1555
|
+
export const ZChoiceDelta = z.lazy(() => z.object({
|
|
1556
|
+
content: z.string().nullable().optional(),
|
|
1557
|
+
function_call: ZChoiceDeltaFunctionCall.nullable().optional(),
|
|
1558
|
+
refusal: z.string().nullable().optional(),
|
|
1559
|
+
role: z.union([z.literal("developer"), z.literal("system"), z.literal("user"), z.literal("assistant"), z.literal("tool")]).nullable().optional(),
|
|
1560
|
+
tool_calls: z.array(ZChoiceDeltaToolCall).nullable().optional(),
|
|
1561
|
+
}));
|
|
1562
|
+
export const ZChoiceLogprobs = z.lazy(() => z.object({
|
|
1563
|
+
content: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
1564
|
+
refusal: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
1565
|
+
}));
|
|
1566
|
+
export const ZChoiceDeltaFunctionCall = z.lazy(() => z.object({
|
|
1567
|
+
arguments: z.string().nullable().optional(),
|
|
1568
|
+
name: z.string().nullable().optional(),
|
|
1569
|
+
}));
|
|
1570
|
+
export const ZChoiceDeltaToolCall = z.lazy(() => z.object({
|
|
1571
|
+
index: z.number(),
|
|
1572
|
+
id: z.string().nullable().optional(),
|
|
1573
|
+
function: ZChoiceDeltaToolCallFunction.nullable().optional(),
|
|
1574
|
+
type: z.literal("function").nullable().optional(),
|
|
1575
|
+
}));
|
|
1576
|
+
export const ZUsage = z.lazy(() => z.object({
|
|
1577
|
+
cache_creation_input_tokens: z.number().nullable().optional(),
|
|
1578
|
+
cache_read_input_tokens: z.number().nullable().optional(),
|
|
1579
|
+
input_tokens: z.number(),
|
|
1580
|
+
output_tokens: z.number(),
|
|
1581
|
+
server_tool_use: ZServerToolUsage.nullable().optional(),
|
|
1582
|
+
service_tier: z.union([z.literal("standard"), z.literal("priority"), z.literal("batch")]).nullable().optional(),
|
|
1583
|
+
}));
|
|
1584
|
+
export const ZParsedChatCompletionMessage = z.lazy(() => z.object({
|
|
1585
|
+
content: z.string().nullable().optional(),
|
|
1586
|
+
refusal: z.string().nullable().optional(),
|
|
1587
|
+
role: z.literal("assistant"),
|
|
1588
|
+
annotations: z.array(ZAnnotation).nullable().optional(),
|
|
1589
|
+
audio: ZChatCompletionAudio.nullable().optional(),
|
|
1590
|
+
function_call: ZFunctionCall.nullable().optional(),
|
|
1591
|
+
tool_calls: z.array(ZParsedFunctionToolCall).nullable().optional(),
|
|
1592
|
+
parsed: z.any().nullable().optional(),
|
|
1593
|
+
}).merge(ZChatCompletionMessage.schema));
|
|
1594
|
+
export const ZResponseError = z.lazy(() => z.object({
|
|
1595
|
+
code: z.union([z.literal("server_error"), z.literal("rate_limit_exceeded"), z.literal("invalid_prompt"), z.literal("vector_store_timeout"), z.literal("invalid_image"), z.literal("invalid_image_format"), z.literal("invalid_base64_image"), z.literal("invalid_image_url"), z.literal("image_too_large"), z.literal("image_too_small"), z.literal("image_parse_error"), z.literal("image_content_policy_violation"), z.literal("invalid_image_mode"), z.literal("image_file_too_large"), z.literal("unsupported_image_media_type"), z.literal("empty_image_file"), z.literal("failed_to_download_image"), z.literal("image_file_not_found")]),
|
|
1596
|
+
message: z.string(),
|
|
1597
|
+
}));
|
|
1598
|
+
export const ZIncompleteDetails = z.lazy(() => z.object({
|
|
1599
|
+
reason: z.union([z.literal("max_output_tokens"), z.literal("content_filter")]).nullable().optional(),
|
|
1600
|
+
}));
|
|
1601
|
+
export const ZEasyInputMessage = z.lazy(() => z.object({
|
|
1602
|
+
content: z.union([z.string(), z.array(z.union([ZResponseInputText, ZResponseInputImage, ZResponseInputFile]))]),
|
|
1603
|
+
role: z.union([z.literal("user"), z.literal("assistant"), z.literal("system"), z.literal("developer")]),
|
|
1604
|
+
type: z.literal("message").nullable().optional(),
|
|
1605
|
+
}));
|
|
1606
|
+
export const ZResponseOutputMessage = z.lazy(() => z.object({
|
|
1607
|
+
id: z.string(),
|
|
1608
|
+
content: z.array(z.union([ZResponseOutputText, ZResponseOutputRefusal])),
|
|
1609
|
+
role: z.literal("assistant"),
|
|
1610
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1611
|
+
type: z.literal("message"),
|
|
1612
|
+
}));
|
|
1613
|
+
export const ZResponseFileSearchToolCall = z.lazy(() => z.object({
|
|
1614
|
+
id: z.string(),
|
|
1615
|
+
queries: z.array(z.string()),
|
|
1616
|
+
status: z.union([z.literal("in_progress"), z.literal("searching"), z.literal("completed"), z.literal("incomplete"), z.literal("failed")]),
|
|
1617
|
+
type: z.literal("file_search_call"),
|
|
1618
|
+
results: z.array(ZResult).nullable().optional(),
|
|
1619
|
+
}));
|
|
1620
|
+
export const ZResponseComputerToolCall = z.lazy(() => z.object({
|
|
1621
|
+
id: z.string(),
|
|
1622
|
+
action: z.union([ZActionClick, ZActionDoubleClick, ZActionDrag, ZActionKeypress, ZActionMove, ZActionScreenshot, ZActionScroll, ZActionType, ZActionWait]),
|
|
1623
|
+
call_id: z.string(),
|
|
1624
|
+
pending_safety_checks: z.array(ZPendingSafetyCheck),
|
|
1625
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1626
|
+
type: z.literal("computer_call"),
|
|
1627
|
+
}));
|
|
1628
|
+
export const ZResponseFunctionWebSearch = z.lazy(() => z.object({
|
|
1629
|
+
id: z.string(),
|
|
1630
|
+
action: z.union([ZActionSearch, ZActionOpenPage, ZActionFind]),
|
|
1631
|
+
status: z.union([z.literal("in_progress"), z.literal("searching"), z.literal("completed"), z.literal("failed")]),
|
|
1632
|
+
type: z.literal("web_search_call"),
|
|
1633
|
+
}));
|
|
1634
|
+
export const ZResponseFunctionToolCall = z.lazy(() => z.object({
|
|
1635
|
+
arguments: z.string(),
|
|
1636
|
+
call_id: z.string(),
|
|
1637
|
+
name: z.string(),
|
|
1638
|
+
type: z.literal("function_call"),
|
|
1639
|
+
id: z.string().nullable().optional(),
|
|
1640
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1641
|
+
}));
|
|
1642
|
+
export const ZResponseReasoningItem = z.lazy(() => z.object({
|
|
1643
|
+
id: z.string(),
|
|
1644
|
+
summary: z.array(ZSummary),
|
|
1645
|
+
type: z.literal("reasoning"),
|
|
1646
|
+
encrypted_content: z.string().nullable().optional(),
|
|
1647
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1648
|
+
}));
|
|
1649
|
+
export const ZResponseCodeInterpreterToolCall = z.lazy(() => z.object({
|
|
1650
|
+
id: z.string(),
|
|
1651
|
+
code: z.string().nullable().optional(),
|
|
1652
|
+
container_id: z.string(),
|
|
1653
|
+
outputs: z.array(z.union([ZOutputLogs, ZOutputImage])).nullable().optional(),
|
|
1654
|
+
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete"), z.literal("interpreting"), z.literal("failed")]),
|
|
1655
|
+
type: z.literal("code_interpreter_call"),
|
|
1656
|
+
}));
|
|
1657
|
+
export const ZToolChoiceTypes = z.lazy(() => z.object({
|
|
1658
|
+
type: z.union([z.literal("file_search"), z.literal("web_search_preview"), z.literal("computer_use_preview"), z.literal("web_search_preview_2025_03_11"), z.literal("image_generation"), z.literal("code_interpreter")]),
|
|
1659
|
+
}));
|
|
1660
|
+
export const ZToolChoiceFunction = z.lazy(() => z.object({
|
|
1661
|
+
name: z.string(),
|
|
1662
|
+
type: z.literal("function"),
|
|
1663
|
+
}));
|
|
1664
|
+
export const ZToolChoiceMcp = z.lazy(() => z.object({
|
|
1665
|
+
server_label: z.string(),
|
|
1666
|
+
type: z.literal("mcp"),
|
|
1667
|
+
name: z.string().nullable().optional(),
|
|
1668
|
+
}));
|
|
1669
|
+
export const ZFunctionTool = z.lazy(() => z.object({
|
|
1670
|
+
name: z.string(),
|
|
1671
|
+
parameters: z.record(z.string(), z.object({}).passthrough()).nullable().optional(),
|
|
1672
|
+
strict: z.boolean().nullable().optional(),
|
|
1673
|
+
type: z.literal("function"),
|
|
1674
|
+
description: z.string().nullable().optional(),
|
|
1675
|
+
}));
|
|
1676
|
+
export const ZFileSearchTool = z.lazy(() => z.object({
|
|
1677
|
+
type: z.literal("file_search"),
|
|
1678
|
+
vector_store_ids: z.array(z.string()),
|
|
1679
|
+
filters: z.union([ZComparisonFilter, ZCompoundFilter]).nullable().optional(),
|
|
1680
|
+
max_num_results: z.number().nullable().optional(),
|
|
1681
|
+
ranking_options: ZRankingOptions.nullable().optional(),
|
|
1682
|
+
}));
|
|
1683
|
+
export const ZWebSearchTool = z.lazy(() => z.object({
|
|
1684
|
+
type: z.union([z.literal("web_search_preview"), z.literal("web_search_preview_2025_03_11")]),
|
|
1685
|
+
search_context_size: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
1686
|
+
user_location: ZUserLocation.nullable().optional(),
|
|
1687
|
+
}));
|
|
1688
|
+
export const ZComputerTool = z.lazy(() => z.object({
|
|
1689
|
+
display_height: z.number(),
|
|
1690
|
+
display_width: z.number(),
|
|
1691
|
+
environment: z.union([z.literal("windows"), z.literal("mac"), z.literal("linux"), z.literal("ubuntu"), z.literal("browser")]),
|
|
1692
|
+
type: z.literal("computer_use_preview"),
|
|
1693
|
+
}));
|
|
1694
|
+
export const ZMcp = z.lazy(() => z.object({
|
|
1695
|
+
server_label: z.string(),
|
|
1696
|
+
server_url: z.string(),
|
|
1697
|
+
type: z.literal("mcp"),
|
|
1698
|
+
allowed_tools: z.union([z.array(z.string()), ZMcpAllowedToolsMcpAllowedToolsFilter]).nullable().optional(),
|
|
1699
|
+
headers: z.record(z.string(), z.string()).nullable().optional(),
|
|
1700
|
+
require_approval: z.union([ZMcpRequireApprovalMcpToolApprovalFilter, z.union([z.literal("always"), z.literal("never")])]).nullable().optional(),
|
|
1701
|
+
server_description: z.string().nullable().optional(),
|
|
1702
|
+
}));
|
|
1703
|
+
export const ZCodeInterpreter = z.lazy(() => z.object({
|
|
1704
|
+
container: z.union([z.string(), ZCodeInterpreterContainerCodeInterpreterToolAuto]),
|
|
1705
|
+
type: z.literal("code_interpreter"),
|
|
1706
|
+
}));
|
|
1707
|
+
export const ZImageGeneration = z.lazy(() => z.object({
|
|
1708
|
+
type: z.literal("image_generation"),
|
|
1709
|
+
background: z.union([z.literal("transparent"), z.literal("opaque"), z.literal("auto")]).nullable().optional(),
|
|
1710
|
+
input_image_mask: ZImageGenerationInputImageMask.nullable().optional(),
|
|
1711
|
+
model: z.literal("gpt-image-1").nullable().optional(),
|
|
1712
|
+
moderation: z.union([z.literal("auto"), z.literal("low")]).nullable().optional(),
|
|
1713
|
+
output_compression: z.number().nullable().optional(),
|
|
1714
|
+
output_format: z.union([z.literal("png"), z.literal("webp"), z.literal("jpeg")]).nullable().optional(),
|
|
1715
|
+
partial_images: z.number().nullable().optional(),
|
|
1716
|
+
quality: z.union([z.literal("low"), z.literal("medium"), z.literal("high"), z.literal("auto")]).nullable().optional(),
|
|
1717
|
+
size: z.union([z.literal("1024x1024"), z.literal("1024x1536"), z.literal("1536x1024"), z.literal("auto")]).nullable().optional(),
|
|
1718
|
+
}));
|
|
1719
|
+
export const ZLocalShell = z.lazy(() => z.object({
|
|
1720
|
+
type: z.literal("local_shell"),
|
|
1721
|
+
}));
|
|
1722
|
+
export const ZResponsePrompt = z.lazy(() => z.object({
|
|
1723
|
+
id: z.string(),
|
|
1724
|
+
variables: z.record(z.string(), z.union([z.string(), ZResponseInputText, ZResponseInputImage, ZResponseInputFile])).nullable().optional(),
|
|
1725
|
+
version: z.string().nullable().optional(),
|
|
1726
|
+
}));
|
|
1727
|
+
export const ZResponseTextConfig = z.lazy(() => z.object({
|
|
1728
|
+
format: z.union([ZResponseFormatText, ZResponseFormatTextJSONSchemaConfig, ZResponseFormatJSONObject]).nullable().optional(),
|
|
1729
|
+
}));
|
|
1730
|
+
export const ZResponseUsage = z.lazy(() => z.object({
|
|
1731
|
+
input_tokens: z.number(),
|
|
1732
|
+
input_tokens_details: ZInputTokensDetails,
|
|
1733
|
+
output_tokens: z.number(),
|
|
1734
|
+
output_tokens_details: ZOutputTokensDetails,
|
|
1735
|
+
total_tokens: z.number(),
|
|
1736
|
+
}));
|
|
1737
|
+
export const ZChatCompletionMessage = z.lazy(() => z.object({
|
|
1738
|
+
content: z.string().nullable().optional(),
|
|
1739
|
+
refusal: z.string().nullable().optional(),
|
|
1740
|
+
role: z.literal("assistant"),
|
|
1741
|
+
annotations: z.array(ZAnnotation).nullable().optional(),
|
|
1742
|
+
audio: ZChatCompletionAudio.nullable().optional(),
|
|
1743
|
+
function_call: ZFunctionCall.nullable().optional(),
|
|
1744
|
+
tool_calls: z.array(ZChatCompletionMessageToolCall).nullable().optional(),
|
|
1745
|
+
}));
|
|
1746
|
+
export const ZCompletionTokensDetails = z.lazy(() => z.object({
|
|
1747
|
+
accepted_prediction_tokens: z.number().nullable().optional(),
|
|
1748
|
+
audio_tokens: z.number().nullable().optional(),
|
|
1749
|
+
reasoning_tokens: z.number().nullable().optional(),
|
|
1750
|
+
rejected_prediction_tokens: z.number().nullable().optional(),
|
|
1751
|
+
}));
|
|
1752
|
+
export const ZPromptTokensDetails = z.lazy(() => z.object({
|
|
1753
|
+
audio_tokens: z.number().nullable().optional(),
|
|
1754
|
+
cached_tokens: z.number().nullable().optional(),
|
|
1755
|
+
}));
|
|
1756
|
+
export const ZImageURL = z.lazy(() => z.object({
|
|
1757
|
+
url: z.string(),
|
|
1758
|
+
detail: z.union([z.literal("auto"), z.literal("low"), z.literal("high")]),
|
|
1759
|
+
}));
|
|
1760
|
+
export const ZInputAudio = z.lazy(() => z.object({
|
|
1761
|
+
data: z.string(),
|
|
1762
|
+
format: z.union([z.literal("wav"), z.literal("mp3")]),
|
|
1763
|
+
}));
|
|
1764
|
+
export const ZFileFile = z.lazy(() => z.object({
|
|
1765
|
+
file_data: z.string(),
|
|
1766
|
+
file_id: z.string(),
|
|
1767
|
+
filename: z.string(),
|
|
1768
|
+
}));
|
|
1769
|
+
export const ZResponseInputTextParam = z.lazy(() => z.object({
|
|
1770
|
+
text: z.string(),
|
|
1771
|
+
type: z.literal("input_text"),
|
|
1772
|
+
}));
|
|
1773
|
+
export const ZResponseInputImageParam = z.lazy(() => z.object({
|
|
1774
|
+
detail: z.union([z.literal("low"), z.literal("high"), z.literal("auto")]),
|
|
1775
|
+
type: z.literal("input_image"),
|
|
1776
|
+
file_id: z.string().nullable().optional(),
|
|
1777
|
+
image_url: z.string().nullable().optional(),
|
|
1778
|
+
}));
|
|
1779
|
+
export const ZResponseInputFileParam = z.lazy(() => z.object({
|
|
1780
|
+
type: z.literal("input_file"),
|
|
1781
|
+
file_data: z.string(),
|
|
1782
|
+
file_id: z.string().nullable().optional(),
|
|
1783
|
+
file_url: z.string(),
|
|
1784
|
+
filename: z.string(),
|
|
1785
|
+
}));
|
|
1786
|
+
export const ZResponseOutputTextParam = z.lazy(() => z.object({
|
|
1787
|
+
annotations: z.array(z.union([ZAnnotationFileCitation, ZAnnotationURLCitation, ZAnnotationContainerFileCitation, ZAnnotationFilePath])),
|
|
1788
|
+
text: z.string(),
|
|
1789
|
+
type: z.literal("output_text"),
|
|
1790
|
+
logprobs: z.array(ZLogprob),
|
|
1791
|
+
}));
|
|
1792
|
+
export const ZResponseOutputRefusalParam = z.lazy(() => z.object({
|
|
1793
|
+
refusal: z.string(),
|
|
1794
|
+
type: z.literal("refusal"),
|
|
1795
|
+
}));
|
|
1796
|
+
export const ZResult = z.lazy(() => z.object({
|
|
1797
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).nullable().optional(),
|
|
1798
|
+
file_id: z.string(),
|
|
1799
|
+
filename: z.string(),
|
|
1800
|
+
score: z.number(),
|
|
1801
|
+
text: z.string(),
|
|
1802
|
+
}));
|
|
1803
|
+
export const ZActionClick = z.lazy(() => z.object({
|
|
1804
|
+
button: z.union([z.literal("left"), z.literal("right"), z.literal("wheel"), z.literal("back"), z.literal("forward")]),
|
|
1805
|
+
type: z.literal("click"),
|
|
1806
|
+
x: z.number(),
|
|
1807
|
+
y: z.number(),
|
|
1808
|
+
}));
|
|
1809
|
+
export const ZActionDoubleClick = z.lazy(() => z.object({
|
|
1810
|
+
type: z.literal("double_click"),
|
|
1811
|
+
x: z.number(),
|
|
1812
|
+
y: z.number(),
|
|
1813
|
+
}));
|
|
1814
|
+
export const ZActionDrag = z.lazy(() => z.object({
|
|
1815
|
+
path: z.array(ZActionDragPath),
|
|
1816
|
+
type: z.literal("drag"),
|
|
1817
|
+
}));
|
|
1818
|
+
export const ZActionKeypress = z.lazy(() => z.object({
|
|
1819
|
+
keys: z.array(z.string()),
|
|
1820
|
+
type: z.literal("keypress"),
|
|
1821
|
+
}));
|
|
1822
|
+
export const ZActionMove = z.lazy(() => z.object({
|
|
1823
|
+
type: z.literal("move"),
|
|
1824
|
+
x: z.number(),
|
|
1825
|
+
y: z.number(),
|
|
1826
|
+
}));
|
|
1827
|
+
export const ZActionScreenshot = z.lazy(() => z.object({
|
|
1828
|
+
type: z.literal("screenshot"),
|
|
1829
|
+
}));
|
|
1830
|
+
export const ZActionScroll = z.lazy(() => z.object({
|
|
1831
|
+
scroll_x: z.number(),
|
|
1832
|
+
scroll_y: z.number(),
|
|
1833
|
+
type: z.literal("scroll"),
|
|
1834
|
+
x: z.number(),
|
|
1835
|
+
y: z.number(),
|
|
1836
|
+
}));
|
|
1837
|
+
export const ZActionType = z.lazy(() => z.object({
|
|
1838
|
+
text: z.string(),
|
|
1839
|
+
type: z.literal("type"),
|
|
1840
|
+
}));
|
|
1841
|
+
export const ZActionWait = z.lazy(() => z.object({
|
|
1842
|
+
type: z.literal("wait"),
|
|
1843
|
+
}));
|
|
1844
|
+
export const ZPendingSafetyCheck = z.lazy(() => z.object({
|
|
1845
|
+
id: z.string(),
|
|
1846
|
+
code: z.string(),
|
|
1847
|
+
message: z.string(),
|
|
1848
|
+
}));
|
|
1849
|
+
export const ZResponseComputerToolCallOutputScreenshotParam = z.lazy(() => z.object({
|
|
1850
|
+
type: z.literal("computer_screenshot"),
|
|
1851
|
+
file_id: z.string(),
|
|
1852
|
+
image_url: z.string(),
|
|
1853
|
+
}));
|
|
1854
|
+
export const ZComputerCallOutputAcknowledgedSafetyCheck = z.lazy(() => z.object({
|
|
1855
|
+
id: z.string(),
|
|
1856
|
+
code: z.string().nullable().optional(),
|
|
1857
|
+
message: z.string().nullable().optional(),
|
|
1858
|
+
}));
|
|
1859
|
+
export const ZActionSearch = z.lazy(() => z.object({
|
|
1860
|
+
query: z.string(),
|
|
1861
|
+
type: z.literal("search"),
|
|
1862
|
+
}));
|
|
1863
|
+
export const ZActionOpenPage = z.lazy(() => z.object({
|
|
1864
|
+
type: z.literal("open_page"),
|
|
1865
|
+
url: z.string(),
|
|
1866
|
+
}));
|
|
1867
|
+
export const ZActionFind = z.lazy(() => z.object({
|
|
1868
|
+
pattern: z.string(),
|
|
1869
|
+
type: z.literal("find"),
|
|
1870
|
+
url: z.string(),
|
|
1871
|
+
}));
|
|
1872
|
+
export const ZSummary = z.lazy(() => z.object({
|
|
1873
|
+
text: z.string(),
|
|
1874
|
+
type: z.literal("summary_text"),
|
|
1875
|
+
}));
|
|
1876
|
+
export const ZOutputLogs = z.lazy(() => z.object({
|
|
1877
|
+
logs: z.string(),
|
|
1878
|
+
type: z.literal("logs"),
|
|
1879
|
+
}));
|
|
1880
|
+
export const ZOutputImage = z.lazy(() => z.object({
|
|
1881
|
+
type: z.literal("image"),
|
|
1882
|
+
url: z.string(),
|
|
1883
|
+
}));
|
|
1884
|
+
export const ZLocalShellCallAction = z.lazy(() => z.object({
|
|
1885
|
+
command: z.array(z.string()),
|
|
1886
|
+
env: z.record(z.string(), z.string()),
|
|
1887
|
+
type: z.literal("exec"),
|
|
1888
|
+
timeout_ms: z.number().nullable().optional(),
|
|
1889
|
+
user: z.string().nullable().optional(),
|
|
1890
|
+
working_directory: z.string().nullable().optional(),
|
|
1891
|
+
}));
|
|
1892
|
+
export const ZMcpListToolsTool = z.lazy(() => z.object({
|
|
1893
|
+
input_schema: z.object({}).passthrough(),
|
|
1894
|
+
name: z.string(),
|
|
1895
|
+
annotations: z.object({}).passthrough().nullable().optional(),
|
|
1896
|
+
description: z.string().nullable().optional(),
|
|
1897
|
+
}));
|
|
1898
|
+
export const ZAudio = z.lazy(() => z.object({
|
|
1899
|
+
id: z.string(),
|
|
1900
|
+
}));
|
|
1901
|
+
export const ZChatCompletionContentPartRefusalParam = z.lazy(() => z.object({
|
|
1902
|
+
refusal: z.string(),
|
|
1903
|
+
type: z.literal("refusal"),
|
|
1904
|
+
}));
|
|
1905
|
+
export const ZFunctionCall = z.lazy(() => z.object({
|
|
1906
|
+
arguments: z.string(),
|
|
1907
|
+
name: z.string(),
|
|
1908
|
+
}));
|
|
1909
|
+
export const ZChatCompletionMessageToolCallParam = z.lazy(() => z.object({
|
|
1910
|
+
id: z.string(),
|
|
1911
|
+
function: ZFunction,
|
|
1912
|
+
type: z.literal("function"),
|
|
1913
|
+
}));
|
|
1914
|
+
export const ZVideoMetadata = z.lazy(() => z.object({
|
|
1915
|
+
fps: z.number().nullable().optional(),
|
|
1916
|
+
end_offset: z.string().nullable().optional(),
|
|
1917
|
+
start_offset: z.string().nullable().optional(),
|
|
1918
|
+
}));
|
|
1919
|
+
export const ZBlob = z.lazy(() => z.object({
|
|
1920
|
+
display_name: z.string().nullable().optional(),
|
|
1921
|
+
data: z.instanceof(Uint8Array).nullable().optional(),
|
|
1922
|
+
mime_type: z.string().nullable().optional(),
|
|
1923
|
+
}));
|
|
1924
|
+
export const ZCodeExecutionResult = z.lazy(() => z.object({
|
|
1925
|
+
outcome: z.any().nullable().optional(),
|
|
1926
|
+
output: z.string().nullable().optional(),
|
|
1927
|
+
}));
|
|
1928
|
+
export const ZExecutableCode = z.lazy(() => z.object({
|
|
1929
|
+
code: z.string().nullable().optional(),
|
|
1930
|
+
language: z.any().nullable().optional(),
|
|
1931
|
+
}));
|
|
1932
|
+
export const ZFunctionResponse = z.lazy(() => z.object({
|
|
1933
|
+
will_continue: z.boolean().nullable().optional(),
|
|
1934
|
+
scheduling: z.any().nullable().optional(),
|
|
1935
|
+
id: z.string().nullable().optional(),
|
|
1936
|
+
name: z.string().nullable().optional(),
|
|
1937
|
+
response: z.record(z.string(), z.any()).nullable().optional(),
|
|
1938
|
+
}));
|
|
1939
|
+
export const ZPartDict = z.lazy(() => z.object({
|
|
1940
|
+
video_metadata: ZVideoMetadataDict.nullable().optional(),
|
|
1941
|
+
thought: z.boolean().nullable().optional(),
|
|
1942
|
+
inline_data: ZBlobDict.nullable().optional(),
|
|
1943
|
+
file_data: ZFileDataDict.nullable().optional(),
|
|
1944
|
+
thought_signature: z.instanceof(Uint8Array).nullable().optional(),
|
|
1945
|
+
code_execution_result: ZCodeExecutionResultDict.nullable().optional(),
|
|
1946
|
+
executable_code: ZExecutableCodeDict.nullable().optional(),
|
|
1947
|
+
function_call: ZFunctionCallDict.nullable().optional(),
|
|
1948
|
+
function_response: ZFunctionResponseDict.nullable().optional(),
|
|
1949
|
+
text: z.string().nullable().optional(),
|
|
1950
|
+
}));
|
|
1951
|
+
export const ZCacheControlEphemeralParam = z.lazy(() => z.object({
|
|
1952
|
+
type: z.literal("ephemeral"),
|
|
1953
|
+
}));
|
|
1954
|
+
export const ZCitationCharLocationParam = z.lazy(() => z.object({
|
|
1955
|
+
cited_text: z.string(),
|
|
1956
|
+
document_index: z.number(),
|
|
1957
|
+
document_title: z.string().nullable().optional(),
|
|
1958
|
+
end_char_index: z.number(),
|
|
1959
|
+
start_char_index: z.number(),
|
|
1960
|
+
type: z.literal("char_location"),
|
|
1961
|
+
}));
|
|
1962
|
+
export const ZCitationPageLocationParam = z.lazy(() => z.object({
|
|
1963
|
+
cited_text: z.string(),
|
|
1964
|
+
document_index: z.number(),
|
|
1965
|
+
document_title: z.string().nullable().optional(),
|
|
1966
|
+
end_page_number: z.number(),
|
|
1967
|
+
start_page_number: z.number(),
|
|
1968
|
+
type: z.literal("page_location"),
|
|
1969
|
+
}));
|
|
1970
|
+
export const ZCitationContentBlockLocationParam = z.lazy(() => z.object({
|
|
1971
|
+
cited_text: z.string(),
|
|
1972
|
+
document_index: z.number(),
|
|
1973
|
+
document_title: z.string().nullable().optional(),
|
|
1974
|
+
end_block_index: z.number(),
|
|
1975
|
+
start_block_index: z.number(),
|
|
1976
|
+
type: z.literal("content_block_location"),
|
|
1977
|
+
}));
|
|
1978
|
+
export const ZCitationWebSearchResultLocationParam = z.lazy(() => z.object({
|
|
1979
|
+
cited_text: z.string(),
|
|
1980
|
+
encrypted_index: z.string(),
|
|
1981
|
+
title: z.string().nullable().optional(),
|
|
1982
|
+
type: z.literal("web_search_result_location"),
|
|
1983
|
+
url: z.string(),
|
|
1984
|
+
}));
|
|
1985
|
+
export const ZBase64ImageSourceParam = z.lazy(() => z.object({
|
|
1986
|
+
data: z.union([z.string(), z.instanceof(Uint8Array), z.string()]),
|
|
1987
|
+
media_type: z.union([z.literal("image/jpeg"), z.literal("image/png"), z.literal("image/gif"), z.literal("image/webp")]),
|
|
1988
|
+
type: z.literal("base64"),
|
|
1989
|
+
}));
|
|
1990
|
+
export const ZURLImageSourceParam = z.lazy(() => z.object({
|
|
1991
|
+
type: z.literal("url"),
|
|
1992
|
+
url: z.string(),
|
|
1993
|
+
}));
|
|
1994
|
+
export const ZBase64PDFSourceParam = z.lazy(() => z.object({
|
|
1995
|
+
data: z.union([z.string(), z.instanceof(Uint8Array), z.string()]),
|
|
1996
|
+
media_type: z.literal("application/pdf"),
|
|
1997
|
+
type: z.literal("base64"),
|
|
1998
|
+
}));
|
|
1999
|
+
export const ZPlainTextSourceParam = z.lazy(() => z.object({
|
|
2000
|
+
data: z.string(),
|
|
2001
|
+
media_type: z.literal("text/plain"),
|
|
2002
|
+
type: z.literal("text"),
|
|
2003
|
+
}));
|
|
2004
|
+
export const ZContentBlockSourceParam = z.lazy(() => z.object({
|
|
2005
|
+
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam]))]),
|
|
2006
|
+
type: z.literal("content"),
|
|
2007
|
+
}));
|
|
2008
|
+
export const ZURLPDFSourceParam = z.lazy(() => z.object({
|
|
2009
|
+
type: z.literal("url"),
|
|
2010
|
+
url: z.string(),
|
|
2011
|
+
}));
|
|
2012
|
+
export const ZCitationsConfigParam = z.lazy(() => z.object({
|
|
2013
|
+
enabled: z.boolean(),
|
|
2014
|
+
}));
|
|
2015
|
+
export const ZWebSearchResultBlockParam = z.lazy(() => z.object({
|
|
2016
|
+
encrypted_content: z.string(),
|
|
2017
|
+
title: z.string(),
|
|
2018
|
+
type: z.literal("web_search_result"),
|
|
2019
|
+
url: z.string(),
|
|
2020
|
+
page_age: z.string().nullable().optional(),
|
|
2021
|
+
}));
|
|
2022
|
+
export const ZWebSearchToolRequestErrorParam = z.lazy(() => z.object({
|
|
2023
|
+
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")]),
|
|
2024
|
+
type: z.literal("web_search_tool_result_error"),
|
|
2025
|
+
}));
|
|
2026
|
+
export const ZCitationCharLocation = z.lazy(() => z.object({
|
|
2027
|
+
cited_text: z.string(),
|
|
2028
|
+
document_index: z.number(),
|
|
2029
|
+
document_title: z.string().nullable().optional(),
|
|
2030
|
+
end_char_index: z.number(),
|
|
2031
|
+
start_char_index: z.number(),
|
|
2032
|
+
type: z.literal("char_location"),
|
|
2033
|
+
}));
|
|
2034
|
+
export const ZCitationPageLocation = z.lazy(() => z.object({
|
|
2035
|
+
cited_text: z.string(),
|
|
2036
|
+
document_index: z.number(),
|
|
2037
|
+
document_title: z.string().nullable().optional(),
|
|
2038
|
+
end_page_number: z.number(),
|
|
2039
|
+
start_page_number: z.number(),
|
|
2040
|
+
type: z.literal("page_location"),
|
|
2041
|
+
}));
|
|
2042
|
+
export const ZCitationContentBlockLocation = z.lazy(() => z.object({
|
|
2043
|
+
cited_text: z.string(),
|
|
2044
|
+
document_index: z.number(),
|
|
2045
|
+
document_title: z.string().nullable().optional(),
|
|
2046
|
+
end_block_index: z.number(),
|
|
2047
|
+
start_block_index: z.number(),
|
|
2048
|
+
type: z.literal("content_block_location"),
|
|
2049
|
+
}));
|
|
2050
|
+
export const ZCitationsWebSearchResultLocation = z.lazy(() => z.object({
|
|
2051
|
+
cited_text: z.string(),
|
|
2052
|
+
encrypted_index: z.string(),
|
|
2053
|
+
title: z.string().nullable().optional(),
|
|
2054
|
+
type: z.literal("web_search_result_location"),
|
|
2055
|
+
url: z.string(),
|
|
2056
|
+
}));
|
|
2057
|
+
export const ZWebSearchToolResultError = z.lazy(() => z.object({
|
|
2058
|
+
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")]),
|
|
2059
|
+
type: z.literal("web_search_tool_result_error"),
|
|
2060
|
+
}));
|
|
2061
|
+
export const ZWebSearchResultBlock = z.lazy(() => z.object({
|
|
2062
|
+
encrypted_content: z.string(),
|
|
2063
|
+
page_age: z.string().nullable().optional(),
|
|
2064
|
+
title: z.string(),
|
|
2065
|
+
type: z.literal("web_search_result"),
|
|
2066
|
+
url: z.string(),
|
|
2067
|
+
}));
|
|
2068
|
+
export const ZChatCompletionTokenLogprob = z.lazy(() => z.object({
|
|
2069
|
+
token: z.string(),
|
|
2070
|
+
bytes: z.array(z.number()).nullable().optional(),
|
|
2071
|
+
logprob: z.number(),
|
|
2072
|
+
top_logprobs: z.array(ZTopLogprob),
|
|
2073
|
+
}));
|
|
2074
|
+
export const ZChoiceDeltaToolCallFunction = z.lazy(() => z.object({
|
|
2075
|
+
arguments: z.string().nullable().optional(),
|
|
2076
|
+
name: z.string().nullable().optional(),
|
|
2077
|
+
}));
|
|
2078
|
+
export const ZServerToolUsage = z.lazy(() => z.object({
|
|
2079
|
+
web_search_requests: z.number(),
|
|
2080
|
+
}));
|
|
2081
|
+
export const ZChatCompletionAudio = z.lazy(() => z.object({
|
|
2082
|
+
id: z.string(),
|
|
2083
|
+
data: z.string(),
|
|
2084
|
+
expires_at: z.number(),
|
|
2085
|
+
transcript: z.string(),
|
|
2086
|
+
}));
|
|
2087
|
+
export const ZParsedFunctionToolCall = z.lazy(() => z.object({
|
|
2088
|
+
id: z.string(),
|
|
2089
|
+
function: ZParsedFunction,
|
|
2090
|
+
type: z.literal("function"),
|
|
2091
|
+
}).merge(ZChatCompletionMessageToolCall.schema));
|
|
2092
|
+
export const ZResponseInputText = z.lazy(() => z.object({
|
|
2093
|
+
text: z.string(),
|
|
2094
|
+
type: z.literal("input_text"),
|
|
2095
|
+
}));
|
|
2096
|
+
export const ZResponseInputImage = z.lazy(() => z.object({
|
|
2097
|
+
detail: z.union([z.literal("low"), z.literal("high"), z.literal("auto")]),
|
|
2098
|
+
type: z.literal("input_image"),
|
|
2099
|
+
file_id: z.string().nullable().optional(),
|
|
2100
|
+
image_url: z.string().nullable().optional(),
|
|
2101
|
+
}));
|
|
2102
|
+
export const ZResponseInputFile = z.lazy(() => z.object({
|
|
2103
|
+
type: z.literal("input_file"),
|
|
2104
|
+
file_data: z.string().nullable().optional(),
|
|
2105
|
+
file_id: z.string().nullable().optional(),
|
|
2106
|
+
file_url: z.string().nullable().optional(),
|
|
2107
|
+
filename: z.string().nullable().optional(),
|
|
2108
|
+
}));
|
|
2109
|
+
export const ZResponseOutputText = z.lazy(() => z.object({
|
|
2110
|
+
annotations: z.array(z.union([ZAnnotationFileCitation, ZAnnotationURLCitation, ZAnnotationContainerFileCitation, ZAnnotationFilePath])),
|
|
2111
|
+
text: z.string(),
|
|
2112
|
+
type: z.literal("output_text"),
|
|
2113
|
+
logprobs: z.array(ZLogprob).nullable().optional(),
|
|
2114
|
+
}));
|
|
2115
|
+
export const ZResponseOutputRefusal = z.lazy(() => z.object({
|
|
2116
|
+
refusal: z.string(),
|
|
2117
|
+
type: z.literal("refusal"),
|
|
2118
|
+
}));
|
|
2119
|
+
export const ZComparisonFilter = z.lazy(() => z.object({
|
|
2120
|
+
key: z.string(),
|
|
2121
|
+
type: z.union([z.literal("eq"), z.literal("ne"), z.literal("gt"), z.literal("gte"), z.literal("lt"), z.literal("lte")]),
|
|
2122
|
+
value: z.union([z.string(), z.number(), z.boolean()]),
|
|
2123
|
+
}));
|
|
2124
|
+
export const ZCompoundFilter = z.lazy(() => z.object({
|
|
2125
|
+
filters: z.array(z.union([ZComparisonFilter, z.object({}).passthrough()])),
|
|
2126
|
+
type: z.union([z.literal("and"), z.literal("or")]),
|
|
2127
|
+
}));
|
|
2128
|
+
export const ZRankingOptions = z.lazy(() => z.object({
|
|
2129
|
+
ranker: z.union([z.literal("auto"), z.literal("default-2024-11-15")]).nullable().optional(),
|
|
2130
|
+
score_threshold: z.number().nullable().optional(),
|
|
2131
|
+
}));
|
|
2132
|
+
export const ZUserLocation = z.lazy(() => z.object({
|
|
2133
|
+
type: z.literal("approximate"),
|
|
2134
|
+
city: z.string().nullable().optional(),
|
|
2135
|
+
country: z.string().nullable().optional(),
|
|
2136
|
+
region: z.string().nullable().optional(),
|
|
2137
|
+
timezone: z.string().nullable().optional(),
|
|
2138
|
+
}));
|
|
2139
|
+
export const ZMcpAllowedToolsMcpAllowedToolsFilter = z.lazy(() => z.object({
|
|
2140
|
+
tool_names: z.array(z.string()).nullable().optional(),
|
|
2141
|
+
}));
|
|
2142
|
+
export const ZMcpRequireApprovalMcpToolApprovalFilter = z.lazy(() => z.object({
|
|
2143
|
+
always: ZMcpRequireApprovalMcpToolApprovalFilterAlways.nullable().optional(),
|
|
2144
|
+
never: ZMcpRequireApprovalMcpToolApprovalFilterNever.nullable().optional(),
|
|
2145
|
+
}));
|
|
2146
|
+
export const ZCodeInterpreterContainerCodeInterpreterToolAuto = z.lazy(() => z.object({
|
|
2147
|
+
type: z.literal("auto"),
|
|
2148
|
+
file_ids: z.array(z.string()).nullable().optional(),
|
|
2149
|
+
}));
|
|
2150
|
+
export const ZImageGenerationInputImageMask = z.lazy(() => z.object({
|
|
2151
|
+
file_id: z.string().nullable().optional(),
|
|
2152
|
+
image_url: z.string().nullable().optional(),
|
|
2153
|
+
}));
|
|
2154
|
+
export const ZResponseFormatTextJSONSchemaConfig = z.lazy(() => z.object({
|
|
2155
|
+
name: z.string(),
|
|
2156
|
+
schema_: z.record(z.string(), z.object({}).passthrough()),
|
|
2157
|
+
type: z.literal("json_schema"),
|
|
2158
|
+
description: z.string().nullable().optional(),
|
|
2159
|
+
strict: z.boolean().nullable().optional(),
|
|
2160
|
+
}));
|
|
2161
|
+
export const ZInputTokensDetails = z.lazy(() => z.object({
|
|
2162
|
+
cached_tokens: z.number(),
|
|
2163
|
+
}));
|
|
2164
|
+
export const ZOutputTokensDetails = z.lazy(() => z.object({
|
|
2165
|
+
reasoning_tokens: z.number(),
|
|
2166
|
+
}));
|
|
2167
|
+
export const ZChatCompletionMessageToolCall = z.lazy(() => z.object({
|
|
2168
|
+
id: z.string(),
|
|
2169
|
+
function: ZFunction,
|
|
2170
|
+
type: z.literal("function"),
|
|
2171
|
+
}));
|
|
2172
|
+
export const ZAnnotationFileCitation = z.lazy(() => z.object({
|
|
2173
|
+
file_id: z.string(),
|
|
2174
|
+
filename: z.string(),
|
|
2175
|
+
index: z.number(),
|
|
2176
|
+
type: z.literal("file_citation"),
|
|
2177
|
+
}));
|
|
2178
|
+
export const ZAnnotationURLCitation = z.lazy(() => z.object({
|
|
2179
|
+
end_index: z.number(),
|
|
2180
|
+
start_index: z.number(),
|
|
2181
|
+
title: z.string(),
|
|
2182
|
+
type: z.literal("url_citation"),
|
|
2183
|
+
url: z.string(),
|
|
2184
|
+
}));
|
|
2185
|
+
export const ZAnnotationContainerFileCitation = z.lazy(() => z.object({
|
|
2186
|
+
container_id: z.string(),
|
|
2187
|
+
end_index: z.number(),
|
|
2188
|
+
file_id: z.string(),
|
|
2189
|
+
filename: z.string(),
|
|
2190
|
+
start_index: z.number(),
|
|
2191
|
+
type: z.literal("container_file_citation"),
|
|
2192
|
+
}));
|
|
2193
|
+
export const ZAnnotationFilePath = z.lazy(() => z.object({
|
|
2194
|
+
file_id: z.string(),
|
|
2195
|
+
index: z.number(),
|
|
2196
|
+
type: z.literal("file_path"),
|
|
2197
|
+
}));
|
|
2198
|
+
export const ZLogprob = z.lazy(() => z.object({
|
|
2199
|
+
token: z.string(),
|
|
2200
|
+
bytes: z.array(z.number()),
|
|
2201
|
+
logprob: z.number(),
|
|
2202
|
+
top_logprobs: z.array(ZLogprobTopLogprob),
|
|
2203
|
+
}));
|
|
2204
|
+
export const ZActionDragPath = z.lazy(() => z.object({
|
|
2205
|
+
x: z.number(),
|
|
2206
|
+
y: z.number(),
|
|
2207
|
+
}));
|
|
2208
|
+
export const ZFunction = z.lazy(() => z.object({
|
|
2209
|
+
arguments: z.string(),
|
|
2210
|
+
name: z.string(),
|
|
2211
|
+
}));
|
|
2212
|
+
export const ZVideoMetadataDict = z.lazy(() => z.object({
|
|
2213
|
+
fps: z.number().nullable().optional(),
|
|
2214
|
+
end_offset: z.string().nullable().optional(),
|
|
2215
|
+
start_offset: z.string().nullable().optional(),
|
|
2216
|
+
}));
|
|
2217
|
+
export const ZBlobDict = z.lazy(() => z.object({
|
|
2218
|
+
display_name: z.string().nullable().optional(),
|
|
2219
|
+
data: z.instanceof(Uint8Array).nullable().optional(),
|
|
2220
|
+
mime_type: z.string().nullable().optional(),
|
|
2221
|
+
}));
|
|
2222
|
+
export const ZFileDataDict = z.lazy(() => z.object({
|
|
2223
|
+
display_name: z.string().nullable().optional(),
|
|
2224
|
+
file_uri: z.string().nullable().optional(),
|
|
2225
|
+
mime_type: z.string().nullable().optional(),
|
|
2226
|
+
}));
|
|
2227
|
+
export const ZCodeExecutionResultDict = z.lazy(() => z.object({
|
|
2228
|
+
outcome: z.any().nullable().optional(),
|
|
2229
|
+
output: z.string().nullable().optional(),
|
|
2230
|
+
}));
|
|
2231
|
+
export const ZExecutableCodeDict = z.lazy(() => z.object({
|
|
2232
|
+
code: z.string().nullable().optional(),
|
|
2233
|
+
language: z.any().nullable().optional(),
|
|
2234
|
+
}));
|
|
2235
|
+
export const ZFunctionCallDict = z.lazy(() => z.object({
|
|
2236
|
+
id: z.string().nullable().optional(),
|
|
2237
|
+
args: z.record(z.string(), z.any()).nullable().optional(),
|
|
2238
|
+
name: z.string().nullable().optional(),
|
|
2239
|
+
}));
|
|
2240
|
+
export const ZFunctionResponseDict = z.lazy(() => z.object({
|
|
2241
|
+
will_continue: z.boolean().nullable().optional(),
|
|
2242
|
+
scheduling: z.any().nullable().optional(),
|
|
2243
|
+
id: z.string().nullable().optional(),
|
|
2244
|
+
name: z.string().nullable().optional(),
|
|
2245
|
+
response: z.record(z.string(), z.any()).nullable().optional(),
|
|
2246
|
+
}));
|
|
2247
|
+
export const ZTopLogprob = z.lazy(() => z.object({
|
|
2248
|
+
token: z.string(),
|
|
2249
|
+
bytes: z.array(z.number()).nullable().optional(),
|
|
2250
|
+
logprob: z.number(),
|
|
2251
|
+
}));
|
|
2252
|
+
export const ZParsedFunction = z.lazy(() => z.object({
|
|
2253
|
+
arguments: z.string(),
|
|
2254
|
+
name: z.string(),
|
|
2255
|
+
parsed_arguments: z.object({}).passthrough().nullable().optional(),
|
|
2256
|
+
}).merge(ZFunction.schema));
|
|
2257
|
+
export const ZMcpRequireApprovalMcpToolApprovalFilterAlways = z.lazy(() => z.object({
|
|
2258
|
+
tool_names: z.array(z.string()).nullable().optional(),
|
|
2259
|
+
}));
|
|
2260
|
+
export const ZMcpRequireApprovalMcpToolApprovalFilterNever = z.lazy(() => z.object({
|
|
2261
|
+
tool_names: z.array(z.string()).nullable().optional(),
|
|
2262
|
+
}));
|
|
2263
|
+
export const ZLogprobTopLogprob = z.lazy(() => z.object({
|
|
2264
|
+
token: z.string(),
|
|
2265
|
+
bytes: z.array(z.number()),
|
|
2266
|
+
logprob: z.number(),
|
|
2267
|
+
}));
|