@retab/node 0.0.48 → 0.0.52
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 +8 -215
- package/dist/api/client.d.ts +2 -2
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +2 -2
- package/dist/api/documents/client.d.ts +3 -3
- package/dist/api/documents/client.d.ts.map +1 -1
- package/dist/api/documents/client.js +3 -3
- package/dist/api/projects/client.d.ts +15 -0
- package/dist/api/projects/client.d.ts.map +1 -0
- package/dist/api/projects/client.js +43 -0
- package/dist/api/projects/documents/client.d.ts +12 -0
- package/dist/api/projects/documents/client.d.ts.map +1 -0
- package/dist/api/projects/documents/client.js +39 -0
- package/dist/api/projects/iterations/client.d.ts +17 -0
- package/dist/api/projects/iterations/client.d.ts.map +1 -0
- package/dist/api/projects/iterations/client.js +64 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -1
- package/dist/generated_types.d.ts +17837 -40090
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +309 -979
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +188 -80
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +22 -1
- package/package.json +6 -9
- package/dist/api/consensus/client.d.ts +0 -7
- package/dist/api/consensus/client.d.ts.map +0 -1
- package/dist/api/consensus/client.js +0 -14
- package/dist/errors.d.ts +0 -34
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -53
- package/dist/resource.d.ts +0 -12
- package/dist/resource.d.ts.map +0 -1
- package/dist/resource.js +0 -19
- package/dist/resources/consensus/completions.d.ts +0 -66
- package/dist/resources/consensus/completions.d.ts.map +0 -1
- package/dist/resources/consensus/completions.js +0 -84
- package/dist/resources/consensus/index.d.ts +0 -72
- package/dist/resources/consensus/index.d.ts.map +0 -1
- package/dist/resources/consensus/index.js +0 -76
- package/dist/resources/consensus/responses.d.ts +0 -69
- package/dist/resources/consensus/responses.d.ts.map +0 -1
- package/dist/resources/consensus/responses.js +0 -99
- package/dist/resources/documents/extractions.d.ts +0 -74
- package/dist/resources/documents/extractions.d.ts.map +0 -1
- package/dist/resources/documents/extractions.js +0 -196
- package/dist/resources/documents/index.d.ts +0 -21
- package/dist/resources/documents/index.d.ts.map +0 -1
- package/dist/resources/documents/index.js +0 -55
- package/dist/resources/evaluations/documents.d.ts +0 -40
- package/dist/resources/evaluations/documents.d.ts.map +0 -1
- package/dist/resources/evaluations/documents.js +0 -123
- package/dist/resources/evaluations/index.d.ts +0 -14
- package/dist/resources/evaluations/index.d.ts.map +0 -1
- package/dist/resources/evaluations/index.js +0 -17
- package/dist/resources/evaluations/iterations.d.ts +0 -50
- package/dist/resources/evaluations/iterations.d.ts.map +0 -1
- package/dist/resources/evaluations/iterations.js +0 -156
- package/dist/resources/files.d.ts +0 -82
- package/dist/resources/files.d.ts.map +0 -1
- package/dist/resources/files.js +0 -150
- package/dist/resources/finetuning.d.ts +0 -105
- package/dist/resources/finetuning.d.ts.map +0 -1
- package/dist/resources/finetuning.js +0 -181
- package/dist/resources/index.d.ts +0 -11
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/resources/index.js +0 -10
- package/dist/resources/models.d.ts +0 -57
- package/dist/resources/models.d.ts.map +0 -1
- package/dist/resources/models.js +0 -72
- package/dist/resources/processors/automations/endpoints.d.ts +0 -90
- package/dist/resources/processors/automations/endpoints.d.ts.map +0 -1
- package/dist/resources/processors/automations/endpoints.js +0 -145
- package/dist/resources/processors/automations/index.d.ts +0 -7
- package/dist/resources/processors/automations/index.d.ts.map +0 -1
- package/dist/resources/processors/automations/index.js +0 -6
- package/dist/resources/processors/automations/links.d.ts +0 -90
- package/dist/resources/processors/automations/links.d.ts.map +0 -1
- package/dist/resources/processors/automations/links.js +0 -149
- package/dist/resources/processors/automations/logs.d.ts +0 -35
- package/dist/resources/processors/automations/logs.d.ts.map +0 -1
- package/dist/resources/processors/automations/logs.js +0 -60
- package/dist/resources/processors/automations/mailboxes.d.ts +0 -102
- package/dist/resources/processors/automations/mailboxes.d.ts.map +0 -1
- package/dist/resources/processors/automations/mailboxes.js +0 -157
- package/dist/resources/processors/automations/outlook.d.ts +0 -114
- package/dist/resources/processors/automations/outlook.d.ts.map +0 -1
- package/dist/resources/processors/automations/outlook.js +0 -170
- package/dist/resources/processors/automations/tests.d.ts +0 -58
- package/dist/resources/processors/automations/tests.d.ts.map +0 -1
- package/dist/resources/processors/automations/tests.js +0 -90
- package/dist/resources/processors/index.d.ts +0 -303
- package/dist/resources/processors/index.d.ts.map +0 -1
- package/dist/resources/processors/index.js +0 -261
- package/dist/resources/schemas.d.ts +0 -63
- package/dist/resources/schemas.d.ts.map +0 -1
- package/dist/resources/schemas.js +0 -183
- package/dist/resources/secrets/external_api_keys.d.ts +0 -61
- package/dist/resources/secrets/external_api_keys.d.ts.map +0 -1
- package/dist/resources/secrets/external_api_keys.js +0 -120
- package/dist/resources/secrets/index.d.ts +0 -14
- package/dist/resources/secrets/index.d.ts.map +0 -1
- package/dist/resources/secrets/index.js +0 -17
- package/dist/resources/secrets/webhooks.d.ts +0 -73
- package/dist/resources/secrets/webhooks.d.ts.map +0 -1
- package/dist/resources/secrets/webhooks.js +0 -145
- package/dist/resources/usage.d.ts +0 -223
- package/dist/resources/usage.d.ts.map +0 -1
- package/dist/resources/usage.js +0 -310
- package/dist/types/ai_models.d.ts +0 -389
- package/dist/types/ai_models.d.ts.map +0 -1
- package/dist/types/ai_models.js +0 -145
- package/dist/types/automations/cron.d.ts +0 -28
- package/dist/types/automations/cron.d.ts.map +0 -1
- package/dist/types/automations/cron.js +0 -1
- package/dist/types/automations/endpoints.d.ts +0 -13
- package/dist/types/automations/endpoints.d.ts.map +0 -1
- package/dist/types/automations/endpoints.js +0 -1
- package/dist/types/automations/index.d.ts +0 -7
- package/dist/types/automations/index.d.ts.map +0 -1
- package/dist/types/automations/index.js +0 -6
- package/dist/types/automations/links.d.ts +0 -15
- package/dist/types/automations/links.d.ts.map +0 -1
- package/dist/types/automations/links.js +0 -1
- package/dist/types/automations/mailboxes.d.ts +0 -18
- package/dist/types/automations/mailboxes.d.ts.map +0 -1
- package/dist/types/automations/mailboxes.js +0 -1
- package/dist/types/automations/outlook.d.ts +0 -37
- package/dist/types/automations/outlook.d.ts.map +0 -1
- package/dist/types/automations/outlook.js +0 -1
- package/dist/types/automations/webhooks.d.ts +0 -13
- package/dist/types/automations/webhooks.d.ts.map +0 -1
- package/dist/types/automations/webhooks.js +0 -1
- package/dist/types/browser_canvas.d.ts +0 -4
- package/dist/types/browser_canvas.d.ts.map +0 -1
- package/dist/types/browser_canvas.js +0 -2
- package/dist/types/chat.d.ts +0 -99
- package/dist/types/chat.d.ts.map +0 -1
- package/dist/types/chat.js +0 -20
- package/dist/types/consensus.d.ts +0 -10
- package/dist/types/consensus.d.ts.map +0 -1
- package/dist/types/consensus.js +0 -1
- package/dist/types/db/annotations.d.ts +0 -108
- package/dist/types/db/annotations.d.ts.map +0 -1
- package/dist/types/db/annotations.js +0 -6
- package/dist/types/db/files.d.ts +0 -133
- package/dist/types/db/files.d.ts.map +0 -1
- package/dist/types/db/files.js +0 -5
- package/dist/types/documents/extractions.d.ts +0 -1849
- package/dist/types/documents/extractions.d.ts.map +0 -1
- package/dist/types/documents/extractions.js +0 -211
- package/dist/types/documents/processing.d.ts +0 -249
- package/dist/types/documents/processing.d.ts.map +0 -1
- package/dist/types/documents/processing.js +0 -6
- package/dist/types/evaluations/iterations.d.ts +0 -41
- package/dist/types/evaluations/iterations.d.ts.map +0 -1
- package/dist/types/evaluations/iterations.js +0 -1
- package/dist/types/jobs/base.d.ts +0 -162
- package/dist/types/jobs/base.d.ts.map +0 -1
- package/dist/types/jobs/base.js +0 -6
- package/dist/types/jobs/specialized.d.ts +0 -200
- package/dist/types/jobs/specialized.d.ts.map +0 -1
- package/dist/types/jobs/specialized.js +0 -37
- package/dist/types/logs.d.ts +0 -92
- package/dist/types/logs.d.ts.map +0 -1
- package/dist/types/logs.js +0 -1
- package/dist/types/mime.d.ts +0 -426
- package/dist/types/mime.d.ts.map +0 -1
- package/dist/types/mime.js +0 -48
- package/dist/types/modalities.d.ts +0 -31
- package/dist/types/modalities.d.ts.map +0 -1
- package/dist/types/modalities.js +0 -109
- package/dist/types/pagination.d.ts +0 -5
- package/dist/types/pagination.d.ts.map +0 -1
- package/dist/types/pagination.js +0 -1
- package/dist/types/schemas/enhancement.d.ts +0 -250
- package/dist/types/schemas/enhancement.d.ts.map +0 -1
- package/dist/types/schemas/enhancement.js +0 -6
- package/dist/types/schemas/generate.d.ts +0 -160
- package/dist/types/schemas/generate.d.ts.map +0 -1
- package/dist/types/schemas/generate.js +0 -19
- package/dist/types/schemas/object.d.ts +0 -116
- package/dist/types/schemas/object.d.ts.map +0 -1
- package/dist/types/schemas/object.js +0 -861
- package/dist/types/secrets/external_api_keys.d.ts +0 -27
- package/dist/types/secrets/external_api_keys.d.ts.map +0 -1
- package/dist/types/secrets/external_api_keys.js +0 -11
- package/dist/types/secrets/index.d.ts +0 -2
- package/dist/types/secrets/index.d.ts.map +0 -1
- package/dist/types/secrets/index.js +0 -1
- package/dist/types/standards.d.ts +0 -37
- package/dist/types/standards.d.ts.map +0 -1
- package/dist/types/standards.js +0 -1
- package/dist/utils/ai_models.d.ts +0 -10
- package/dist/utils/ai_models.d.ts.map +0 -1
- package/dist/utils/ai_models.js +0 -183
- package/dist/utils/batch_processing.d.ts +0 -227
- package/dist/utils/batch_processing.d.ts.map +0 -1
- package/dist/utils/batch_processing.js +0 -268
- package/dist/utils/benchmarking.d.ts +0 -115
- package/dist/utils/benchmarking.d.ts.map +0 -1
- package/dist/utils/benchmarking.js +0 -355
- package/dist/utils/chat.d.ts +0 -70
- package/dist/utils/chat.d.ts.map +0 -1
- package/dist/utils/chat.js +0 -79
- package/dist/utils/cost_calculation.d.ts +0 -26
- package/dist/utils/cost_calculation.d.ts.map +0 -1
- package/dist/utils/cost_calculation.js +0 -99
- package/dist/utils/datasets.d.ts +0 -135
- package/dist/utils/datasets.d.ts.map +0 -1
- package/dist/utils/datasets.js +0 -359
- package/dist/utils/display.d.ts +0 -108
- package/dist/utils/display.d.ts.map +0 -1
- package/dist/utils/display.js +0 -244
- package/dist/utils/hash.d.ts +0 -18
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/hash.js +0 -31
- package/dist/utils/hashing.d.ts +0 -18
- package/dist/utils/hashing.d.ts.map +0 -1
- package/dist/utils/hashing.js +0 -28
- package/dist/utils/index.d.ts +0 -8
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -10
- package/dist/utils/json_schema.d.ts +0 -18
- package/dist/utils/json_schema.d.ts.map +0 -1
- package/dist/utils/json_schema.js +0 -334
- package/dist/utils/json_schema_utils.d.ts +0 -42
- package/dist/utils/json_schema_utils.d.ts.map +0 -1
- package/dist/utils/json_schema_utils.js +0 -212
- package/dist/utils/jsonl.d.ts +0 -60
- package/dist/utils/jsonl.d.ts.map +0 -1
- package/dist/utils/jsonl.js +0 -259
- package/dist/utils/mime.d.ts +0 -6
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/mime.js +0 -129
- package/dist/utils/model_cards.d.ts +0 -219
- package/dist/utils/model_cards.d.ts.map +0 -1
- package/dist/utils/model_cards.js +0 -462
- package/dist/utils/prompt_optimization.d.ts +0 -96
- package/dist/utils/prompt_optimization.d.ts.map +0 -1
- package/dist/utils/prompt_optimization.js +0 -275
- package/dist/utils/responses.d.ts +0 -35
- package/dist/utils/responses.d.ts.map +0 -1
- package/dist/utils/responses.js +0 -37
- package/dist/utils/stream.d.ts +0 -13
- package/dist/utils/stream.d.ts.map +0 -1
- package/dist/utils/stream.js +0 -64
- package/dist/utils/stream_context_managers.d.ts +0 -147
- package/dist/utils/stream_context_managers.d.ts.map +0 -1
- package/dist/utils/stream_context_managers.js +0 -380
- package/dist/utils/usage.d.ts +0 -57
- package/dist/utils/usage.d.ts.map +0 -1
- package/dist/utils/usage.js +0 -97
- package/dist/utils/webhook_secrets.d.ts +0 -59
- package/dist/utils/webhook_secrets.d.ts.map +0 -1
- package/dist/utils/webhook_secrets.js +0 -107
- package/dist/utils/zod_to_json_schema.d.ts +0 -11
- package/dist/utils/zod_to_json_schema.d.ts.map +0 -1
- package/dist/utils/zod_to_json_schema.js +0 -123
package/dist/generated_types.js
CHANGED
|
@@ -1,25 +1,4 @@
|
|
|
1
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
2
|
export const ZAttachmentMIMEData = z.lazy(() => (ZMIMEData.schema).merge(z.object({
|
|
24
3
|
metadata: ZAttachmentMetadata.default({}),
|
|
25
4
|
})));
|
|
@@ -91,107 +70,6 @@ export const ZTextBox = z.lazy(() => (z.object({
|
|
|
91
70
|
vertices: z.tuple([ZPoint, ZPoint, ZPoint, ZPoint]),
|
|
92
71
|
text: z.string(),
|
|
93
72
|
})));
|
|
94
|
-
export const ZAmount = z.lazy(() => (z.object({
|
|
95
|
-
value: z.number(),
|
|
96
|
-
currency: z.string(),
|
|
97
|
-
})));
|
|
98
|
-
export const ZPredictionData = z.lazy(() => (z.object({
|
|
99
|
-
prediction: z.record(z.string(), z.any()).default({}),
|
|
100
|
-
metadata: ZPredictionMetadata.nullable().optional(),
|
|
101
|
-
updated_at: z.string().nullable().optional(),
|
|
102
|
-
})));
|
|
103
|
-
export const ZPredictionMetadata = z.lazy(() => (z.object({
|
|
104
|
-
extraction_id: z.string().nullable().optional(),
|
|
105
|
-
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
106
|
-
field_locations: z.record(z.string(), z.any()).nullable().optional(),
|
|
107
|
-
agentic_field_locations: z.record(z.string(), z.any()).nullable().optional(),
|
|
108
|
-
consensus_details: z.array(z.record(z.string(), z.any())).nullable().optional(),
|
|
109
|
-
api_cost: ZAmount.nullable().optional(),
|
|
110
|
-
})));
|
|
111
|
-
export const ZChatCompletion = z.lazy(() => (z.object({
|
|
112
|
-
id: z.string(),
|
|
113
|
-
choices: z.array(ZChatCompletionChoice),
|
|
114
|
-
created: z.number(),
|
|
115
|
-
model: z.string(),
|
|
116
|
-
object: z.literal("chat.completion"),
|
|
117
|
-
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
118
|
-
system_fingerprint: z.string().nullable().optional(),
|
|
119
|
-
usage: ZCompletionUsage.nullable().optional(),
|
|
120
|
-
})));
|
|
121
|
-
export const ZChatCompletionRetabMessage = z.lazy(() => (z.object({
|
|
122
|
-
role: z.union([z.literal("user"), z.literal("system"), z.literal("assistant"), z.literal("developer")]),
|
|
123
|
-
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartImageParam, ZChatCompletionContentPartInputAudioParam, ZFile]))]),
|
|
124
|
-
})));
|
|
125
|
-
export const ZCostBreakdown = z.lazy(() => (z.object({
|
|
126
|
-
total: ZAmount,
|
|
127
|
-
text_prompt_cost: ZAmount,
|
|
128
|
-
text_cached_cost: ZAmount,
|
|
129
|
-
text_completion_cost: ZAmount,
|
|
130
|
-
text_total_cost: ZAmount,
|
|
131
|
-
audio_prompt_cost: ZAmount.nullable().optional(),
|
|
132
|
-
audio_completion_cost: ZAmount.nullable().optional(),
|
|
133
|
-
audio_total_cost: ZAmount.nullable().optional(),
|
|
134
|
-
token_counts: ZTokenCounts,
|
|
135
|
-
model: z.string(),
|
|
136
|
-
is_fine_tuned: z.boolean().default(false),
|
|
137
|
-
})));
|
|
138
|
-
export const ZExtraction = z.lazy(() => (z.object({
|
|
139
|
-
id: z.string(),
|
|
140
|
-
messages: z.array(ZChatCompletionRetabMessage),
|
|
141
|
-
messages_gcs: z.string(),
|
|
142
|
-
file_gcs_paths: z.array(z.string()),
|
|
143
|
-
file_ids: z.array(z.string()),
|
|
144
|
-
file_gcs: z.string().default(""),
|
|
145
|
-
file_id: z.string().default(""),
|
|
146
|
-
status: z.union([z.literal("success"), z.literal("failed")]),
|
|
147
|
-
completion: z.union([ZRetabParsedChatCompletion, ZChatCompletion]),
|
|
148
|
-
json_schema: z.any(),
|
|
149
|
-
model: z.string(),
|
|
150
|
-
temperature: z.number().default(0.0),
|
|
151
|
-
source: ZExtractionSource,
|
|
152
|
-
image_resolution_dpi: z.number().default(96),
|
|
153
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
154
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]).default("native"),
|
|
155
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
156
|
-
n_consensus: z.number().default(1),
|
|
157
|
-
timings: z.array(ZExtractionTimingStep),
|
|
158
|
-
schema_id: z.string(),
|
|
159
|
-
schema_data_id: z.string(),
|
|
160
|
-
created_at: z.string(),
|
|
161
|
-
request_at: z.string().nullable().optional(),
|
|
162
|
-
organization_id: z.string(),
|
|
163
|
-
validation_state: z.union([z.literal("pending"), z.literal("validated"), z.literal("invalid")]).nullable().optional(),
|
|
164
|
-
billed: z.boolean().default(false),
|
|
165
|
-
})));
|
|
166
|
-
export const ZExtractionSource = z.lazy(() => (z.object({
|
|
167
|
-
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")]),
|
|
168
|
-
id: z.string().nullable().optional(),
|
|
169
|
-
})));
|
|
170
|
-
export const ZExtractionTimingStep = z.lazy(() => (z.object({
|
|
171
|
-
name: z.union([z.string(), z.union([z.literal("initialization"), z.literal("prepare_messages"), z.literal("yield_first_token"), z.literal("completion")])]),
|
|
172
|
-
duration: z.number(),
|
|
173
|
-
notes: z.string().nullable().optional(),
|
|
174
|
-
})));
|
|
175
|
-
export const ZRetabParsedChatCompletion = z.lazy(() => (ZParsedChatCompletion.schema).merge(z.object({
|
|
176
|
-
choices: z.array(ZRetabParsedChoice),
|
|
177
|
-
extraction_id: z.string().nullable().optional(),
|
|
178
|
-
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
179
|
-
schema_validation_error: ZErrorDetail.nullable().optional(),
|
|
180
|
-
request_at: z.string().nullable().optional(),
|
|
181
|
-
first_token_at: z.string().nullable().optional(),
|
|
182
|
-
last_token_at: z.string().nullable().optional(),
|
|
183
|
-
})));
|
|
184
|
-
export const ZEvent = z.lazy(() => (z.object({
|
|
185
|
-
object: z.literal("event").default("event"),
|
|
186
|
-
id: z.string(),
|
|
187
|
-
event: z.string(),
|
|
188
|
-
created_at: z.string(),
|
|
189
|
-
data: z.record(z.string(), z.any()),
|
|
190
|
-
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(),
|
|
191
|
-
})));
|
|
192
|
-
export const ZStoredEvent = z.lazy(() => (ZEvent.schema).merge(z.object({
|
|
193
|
-
organization_id: z.string(),
|
|
194
|
-
})));
|
|
195
73
|
export const ZDeleteResponse = z.lazy(() => (z.object({
|
|
196
74
|
success: z.boolean(),
|
|
197
75
|
id: z.string(),
|
|
@@ -225,143 +103,13 @@ export const ZStandardErrorResponse = z.lazy(() => (z.object({
|
|
|
225
103
|
export const ZStreamingBaseModel = z.lazy(() => (z.object({
|
|
226
104
|
streaming_error: ZErrorDetail.nullable().optional(),
|
|
227
105
|
})));
|
|
228
|
-
export const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
summary: z.union([z.literal("auto"), z.literal("concise"), z.literal("detailed")]).nullable().optional(),
|
|
232
|
-
})));
|
|
233
|
-
export const ZResponseFormatJSONSchema = z.lazy(() => (z.object({
|
|
234
|
-
json_schema: ZJSONSchema,
|
|
235
|
-
type: z.literal("json_schema"),
|
|
236
|
-
})));
|
|
237
|
-
export const ZResponseTextConfigParam = z.lazy(() => (z.object({
|
|
238
|
-
format: z.union([ZResponseFormatText, ZResponseFormatTextJSONSchemaConfigParam, ZResponseFormatJSONObject]),
|
|
239
|
-
})));
|
|
240
|
-
export const ZRetabChatCompletionsParseRequest = z.lazy(() => (z.object({
|
|
241
|
-
model: z.string(),
|
|
242
|
-
messages: z.array(ZChatCompletionRetabMessage),
|
|
243
|
-
json_schema: z.record(z.string(), z.any()),
|
|
244
|
-
temperature: z.number().default(0.0),
|
|
245
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
246
|
-
stream: z.boolean().default(false),
|
|
247
|
-
seed: z.number().nullable().optional(),
|
|
248
|
-
n_consensus: z.number().default(1),
|
|
249
|
-
})));
|
|
250
|
-
export const ZRetabChatCompletionsRequest = z.lazy(() => (z.object({
|
|
251
|
-
model: z.string(),
|
|
252
|
-
messages: z.array(ZChatCompletionRetabMessage),
|
|
253
|
-
response_format: ZResponseFormatJSONSchema,
|
|
254
|
-
temperature: z.number().default(0.0),
|
|
255
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
256
|
-
stream: z.boolean().default(false),
|
|
257
|
-
seed: z.number().nullable().optional(),
|
|
258
|
-
n_consensus: z.number().default(1),
|
|
259
|
-
})));
|
|
260
|
-
export const ZRetabChatResponseCreateRequest = z.lazy(() => (z.object({
|
|
261
|
-
input: z.union([z.string(), z.array(z.union([ZEasyInputMessageParam, ZResponseInputParamMessage, ZResponseOutputMessageParam, ZResponseFileSearchToolCallParam, ZResponseComputerToolCallParam, ZComputerCallOutput, ZResponseFunctionWebSearchParam, ZResponseFunctionToolCallParam, ZFunctionCallOutput, ZResponseReasoningItemParam, ZImageGenerationCall, ZResponseCodeInterpreterToolCallParam, ZLocalShellCall, ZLocalShellCallOutput, ZMcpListTools, ZMcpApprovalRequest, ZMcpApprovalResponse, ZMcpCall, ZItemReference]))]),
|
|
262
|
-
instructions: z.string().nullable().optional(),
|
|
263
|
-
model: z.string(),
|
|
264
|
-
temperature: z.number().nullable().optional().default(0.0),
|
|
265
|
-
reasoning: ZReasoning.nullable().optional(),
|
|
266
|
-
stream: z.boolean().nullable().optional().default(false),
|
|
267
|
-
seed: z.number().nullable().optional(),
|
|
268
|
-
text: ZResponseTextConfigParam.default({ "format": { "type": "text" } }),
|
|
269
|
-
n_consensus: z.number().default(1),
|
|
270
|
-
})));
|
|
271
|
-
export const ZReconciliationRequest = z.lazy(() => (z.object({
|
|
272
|
-
list_dicts: z.array(z.record(z.any())),
|
|
273
|
-
reference_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
274
|
-
mode: z.union([z.literal("direct"), z.literal("aligned")]).default("direct"),
|
|
275
|
-
})));
|
|
276
|
-
export const ZReconciliationResponse = z.lazy(() => (z.object({
|
|
277
|
-
consensus_dict: z.record(z.any()),
|
|
278
|
-
likelihoods: z.record(z.any()),
|
|
279
|
-
})));
|
|
280
|
-
export const ZAutomationConfig = z.lazy(() => (z.object({
|
|
281
|
-
id: z.string(),
|
|
282
|
-
name: z.string(),
|
|
283
|
-
processor_id: z.string(),
|
|
284
|
-
updated_at: z.string(),
|
|
285
|
-
default_language: z.string().default("en"),
|
|
286
|
-
webhook_url: z.string(),
|
|
287
|
-
webhook_headers: z.record(z.string(), z.string()),
|
|
288
|
-
need_validation: z.boolean().default(false),
|
|
289
|
-
})));
|
|
290
|
-
export const ZAutomationLog = z.lazy(() => (z.object({
|
|
291
|
-
object: z.literal("automation_log").default("automation_log"),
|
|
292
|
-
id: z.string(),
|
|
293
|
-
user_email: z.string().email().nullable().optional(),
|
|
294
|
-
organization_id: z.string(),
|
|
295
|
-
created_at: z.string(),
|
|
296
|
-
automation_snapshot: ZAutomationConfig,
|
|
297
|
-
completion: z.union([ZRetabParsedChatCompletion, ZChatCompletion]),
|
|
298
|
-
file_metadata: ZBaseMIMEData.nullable().optional(),
|
|
299
|
-
external_request_log: ZExternalRequestLog.nullable().optional(),
|
|
300
|
-
extraction_id: z.string().nullable().optional(),
|
|
301
|
-
})));
|
|
302
|
-
export const ZEmailStr = z.lazy(() => z.string().email());
|
|
303
|
-
export const ZExternalRequestLog = z.lazy(() => (z.object({
|
|
304
|
-
webhook_url: z.string().nullable().optional(),
|
|
305
|
-
request_body: z.record(z.string(), z.any()),
|
|
306
|
-
request_headers: z.record(z.string(), z.string()),
|
|
307
|
-
request_at: z.string(),
|
|
308
|
-
response_body: z.record(z.string(), z.any()),
|
|
309
|
-
response_headers: z.record(z.string(), z.string()),
|
|
310
|
-
response_at: z.string(),
|
|
311
|
-
status_code: z.number(),
|
|
312
|
-
error: z.string().nullable().optional(),
|
|
313
|
-
duration_ms: z.number(),
|
|
314
|
-
})));
|
|
315
|
-
export const ZListLogs = z.lazy(() => (z.object({
|
|
316
|
-
data: z.array(ZAutomationLog),
|
|
317
|
-
list_metadata: ZListMetadata,
|
|
318
|
-
})));
|
|
319
|
-
export const ZListMetadata = z.lazy(() => (z.object({
|
|
320
|
-
before: z.string().nullable().optional(),
|
|
321
|
-
after: z.string().nullable().optional(),
|
|
322
|
-
})));
|
|
323
|
-
export const ZLogCompletionRequest = z.lazy(() => (z.object({
|
|
324
|
-
json_schema: z.record(z.string(), z.any()),
|
|
325
|
-
completion: ZChatCompletion,
|
|
326
|
-
})));
|
|
327
|
-
export const ZOpenAIRequestConfig = z.lazy(() => (z.object({
|
|
328
|
-
object: z.literal("openai_request").default("openai_request"),
|
|
329
|
-
id: z.string(),
|
|
330
|
-
model: z.string(),
|
|
331
|
-
json_schema: z.record(z.string(), z.any()),
|
|
332
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
333
|
-
})));
|
|
334
|
-
export const ZProcessorConfig = z.lazy(() => (z.object({
|
|
335
|
-
object: z.string().default("processor"),
|
|
336
|
-
id: z.string(),
|
|
337
|
-
updated_at: z.string(),
|
|
338
|
-
name: z.string(),
|
|
339
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
340
|
-
image_resolution_dpi: z.number().default(96),
|
|
341
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
342
|
-
model: z.string(),
|
|
343
|
-
json_schema: z.record(z.string(), z.any()),
|
|
344
|
-
temperature: z.number().default(0.0),
|
|
345
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
346
|
-
n_consensus: z.number().default(1),
|
|
347
|
-
})));
|
|
348
|
-
export const ZUpdateAutomationRequest = z.lazy(() => (z.object({
|
|
349
|
-
name: z.string().nullable().optional(),
|
|
350
|
-
default_language: z.string().nullable().optional(),
|
|
351
|
-
webhook_url: z.string().nullable().optional(),
|
|
352
|
-
webhook_headers: z.record(z.string(), z.string()).nullable().optional(),
|
|
353
|
-
need_validation: z.boolean().nullable().optional(),
|
|
106
|
+
export const ZChatCompletionRetabMessage = z.lazy(() => (z.object({
|
|
107
|
+
role: z.union([z.literal("user"), z.literal("system"), z.literal("assistant"), z.literal("developer")]),
|
|
108
|
+
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartImageParam, ZChatCompletionContentPartInputAudioParam, ZFile]))]),
|
|
354
109
|
})));
|
|
355
|
-
export const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
image_resolution_dpi: z.number().nullable().optional(),
|
|
359
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).nullable().optional(),
|
|
360
|
-
model: z.string().nullable().optional(),
|
|
361
|
-
json_schema: z.record(z.any()).nullable().optional(),
|
|
362
|
-
temperature: z.number().nullable().optional(),
|
|
363
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
364
|
-
n_consensus: z.number().nullable().optional(),
|
|
110
|
+
export const ZAmount = z.lazy(() => (z.object({
|
|
111
|
+
value: z.number(),
|
|
112
|
+
currency: z.string().default("USD"),
|
|
365
113
|
})));
|
|
366
114
|
export const ZFinetunedModel = z.lazy(() => (z.object({
|
|
367
115
|
object: z.literal("finetuned_model").default("finetuned_model"),
|
|
@@ -374,27 +122,22 @@ export const ZFinetunedModel = z.lazy(() => (z.object({
|
|
|
374
122
|
created_at: z.string(),
|
|
375
123
|
})));
|
|
376
124
|
export const ZInferenceSettings = z.lazy(() => (z.object({
|
|
377
|
-
model: z.string().default("gpt-
|
|
125
|
+
model: z.string().default("gpt-5-mini"),
|
|
378
126
|
temperature: z.number().default(0.0),
|
|
379
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]).default("native"),
|
|
380
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("
|
|
127
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text"), z.literal("native_fast")]).default("native"),
|
|
128
|
+
reasoning_effort: z.union([z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("minimal"),
|
|
381
129
|
image_resolution_dpi: z.number().default(96),
|
|
382
130
|
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
383
131
|
n_consensus: z.number().default(1),
|
|
384
132
|
})));
|
|
385
|
-
export const ZModel = z.lazy(() => (z.object({
|
|
386
|
-
id: z.string(),
|
|
387
|
-
created: z.number(),
|
|
388
|
-
object: z.literal("model"),
|
|
389
|
-
owned_by: z.string(),
|
|
390
|
-
})));
|
|
391
133
|
export const ZModelCapabilities = z.lazy(() => (z.object({
|
|
392
134
|
modalities: z.array(z.union([z.literal("text"), z.literal("audio"), z.literal("image")])),
|
|
393
135
|
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")])),
|
|
394
136
|
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")])),
|
|
395
137
|
})));
|
|
396
138
|
export const ZModelCard = z.lazy(() => (z.object({
|
|
397
|
-
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
|
|
139
|
+
model: z.union([z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-5"), z.literal("gpt-5-2025-08-07"), z.literal("gpt-5-mini"), z.literal("gpt-5-mini-2025-08-07"), z.literal("gpt-5-nano"), z.literal("gpt-5-nano-2025-08-07"), 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("claude-opus-4.1"), z.literal("claude-opus-4"), z.literal("claude-sonnet-4"), z.literal("claude-sonnet-4-20250514"), 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"), 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()]),
|
|
140
|
+
display_name: z.string().nullable().optional(),
|
|
398
141
|
pricing: ZPricing,
|
|
399
142
|
capabilities: ZModelCapabilities,
|
|
400
143
|
temperature_support: z.boolean().default(true),
|
|
@@ -407,6 +150,7 @@ export const ZModelCardPermissions = z.lazy(() => (z.object({
|
|
|
407
150
|
})));
|
|
408
151
|
export const ZMonthlyUsageResponseContent = z.lazy(() => (z.object({
|
|
409
152
|
credits_count: z.number(),
|
|
153
|
+
credits_limit: z.number().default(-1),
|
|
410
154
|
})));
|
|
411
155
|
export const ZPricing = z.lazy(() => (z.object({
|
|
412
156
|
text: ZTokenPrice,
|
|
@@ -418,26 +162,16 @@ export const ZTokenPrice = z.lazy(() => (z.object({
|
|
|
418
162
|
completion: z.number(),
|
|
419
163
|
cached_discount: z.number().default(1.0),
|
|
420
164
|
})));
|
|
421
|
-
export const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
export const ZAnnotatedDocument = z.lazy(() => (z.object({
|
|
425
|
-
mime_data: ZMIMEData,
|
|
426
|
-
annotation: z.record(z.string(), z.any()).default({}),
|
|
427
|
-
})));
|
|
428
|
-
export const ZCreateIterationRequest = z.lazy(() => (z.object({
|
|
429
|
-
inference_settings: ZInferenceSettings,
|
|
430
|
-
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
165
|
+
export const ZListMetadata = z.lazy(() => (z.object({
|
|
166
|
+
before: z.string().nullable().optional(),
|
|
167
|
+
after: z.string().nullable().optional(),
|
|
431
168
|
})));
|
|
432
|
-
export const
|
|
169
|
+
export const ZDistancesResult = z.lazy(() => (z.object({
|
|
433
170
|
distances: z.record(z.string(), z.any()),
|
|
434
171
|
mean_distance: z.number(),
|
|
435
172
|
metric_type: z.union([z.literal("levenshtein"), z.literal("jaccard"), z.literal("hamming")]),
|
|
436
173
|
})));
|
|
437
|
-
export const
|
|
438
|
-
annotation_metadata: ZDeprecatedEvalsPredictionMetadata.nullable().optional(),
|
|
439
|
-
})));
|
|
440
|
-
export const ZDeprecatedEvalsItemMetric = z.lazy(() => (z.object({
|
|
174
|
+
export const ZItemMetric = z.lazy(() => (z.object({
|
|
441
175
|
id: z.string(),
|
|
442
176
|
name: z.string(),
|
|
443
177
|
similarity: z.number(),
|
|
@@ -447,24 +181,18 @@ export const ZDeprecatedEvalsItemMetric = z.lazy(() => (z.object({
|
|
|
447
181
|
aligned_similarities: z.record(z.string(), z.any()),
|
|
448
182
|
aligned_flat_similarities: z.record(z.string(), z.number().nullable().optional()),
|
|
449
183
|
})));
|
|
450
|
-
export const
|
|
451
|
-
|
|
452
|
-
inference_settings: ZInferenceSettings,
|
|
453
|
-
json_schema: z.record(z.string(), z.any()),
|
|
454
|
-
predictions: z.array(ZDeprecatedEvalsPredictionData),
|
|
455
|
-
metric_results: ZDeprecatedEvalsMetricResult.nullable().optional(),
|
|
456
|
-
})));
|
|
457
|
-
export const ZDeprecatedEvalsMetricResult = z.lazy(() => (z.object({
|
|
458
|
-
item_metrics: z.array(ZDeprecatedEvalsItemMetric),
|
|
184
|
+
export const ZMetricResult = z.lazy(() => (z.object({
|
|
185
|
+
item_metrics: z.array(ZItemMetric),
|
|
459
186
|
mean_similarity: z.number(),
|
|
460
187
|
aligned_mean_similarity: z.number(),
|
|
461
188
|
metric_type: z.union([z.literal("levenshtein"), z.literal("jaccard"), z.literal("hamming")]),
|
|
462
189
|
})));
|
|
463
|
-
export const
|
|
190
|
+
export const ZPredictionData = z.lazy(() => (z.object({
|
|
464
191
|
prediction: z.record(z.string(), z.any()).default({}),
|
|
465
|
-
metadata:
|
|
192
|
+
metadata: ZPredictionMetadata.nullable().optional(),
|
|
193
|
+
updated_at: z.string().nullable().optional(),
|
|
466
194
|
})));
|
|
467
|
-
export const
|
|
195
|
+
export const ZPredictionMetadata = z.lazy(() => (z.object({
|
|
468
196
|
extraction_id: z.string().nullable().optional(),
|
|
469
197
|
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
470
198
|
field_locations: z.record(z.string(), z.any()).nullable().optional(),
|
|
@@ -472,54 +200,20 @@ export const ZDeprecatedEvalsPredictionMetadata = z.lazy(() => (z.object({
|
|
|
472
200
|
consensus_details: z.array(z.record(z.string(), z.any())).nullable().optional(),
|
|
473
201
|
api_cost: ZAmount.nullable().optional(),
|
|
474
202
|
})));
|
|
475
|
-
export const
|
|
476
|
-
id: z.string(),
|
|
477
|
-
updated_at: z.string(),
|
|
478
|
-
name: z.string(),
|
|
479
|
-
old_documents: z.array(ZProjectDocument).nullable().optional(),
|
|
480
|
-
documents: z.array(ZProjectDocument),
|
|
481
|
-
iterations: z.array(ZIteration),
|
|
482
|
-
json_schema: z.record(z.string(), z.any()),
|
|
483
|
-
project_id: z.string().default("default_spreadsheets"),
|
|
484
|
-
default_inference_settings: ZInferenceSettings.nullable().optional(),
|
|
485
|
-
})));
|
|
486
|
-
export const ZProjectDocument = z.lazy(() => (ZDocumentItem.schema).merge(z.object({
|
|
487
|
-
id: z.string(),
|
|
488
|
-
})));
|
|
489
|
-
export const ZUpdateProjectDocumentRequest = z.lazy(() => (z.object({
|
|
490
|
-
annotation: z.record(z.string(), z.any()).nullable().optional(),
|
|
491
|
-
annotation_metadata: ZDeprecatedEvalsPredictionMetadata.nullable().optional(),
|
|
492
|
-
})));
|
|
493
|
-
export const ZUpdateProjectRequest = z.lazy(() => (z.object({
|
|
494
|
-
name: z.string().nullable().optional(),
|
|
495
|
-
documents: z.array(ZProjectDocument).nullable().optional(),
|
|
496
|
-
iterations: z.array(ZIteration).nullable().optional(),
|
|
497
|
-
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
498
|
-
project_id: z.string().nullable().optional(),
|
|
499
|
-
default_inference_settings: ZInferenceSettings.nullable().optional(),
|
|
500
|
-
})));
|
|
501
|
-
export const ZExternalAPIKey = z.lazy(() => (z.object({
|
|
502
|
-
provider: z.union([z.literal("OpenAI"), z.literal("Anthropic"), z.literal("Gemini"), z.literal("xAI"), z.literal("Retab")]),
|
|
503
|
-
is_configured: z.boolean(),
|
|
504
|
-
last_updated: z.string().nullable().optional(),
|
|
505
|
-
})));
|
|
506
|
-
export const ZExternalAPIKeyRequest = z.lazy(() => (z.object({
|
|
507
|
-
provider: z.union([z.literal("OpenAI"), z.literal("Anthropic"), z.literal("Gemini"), z.literal("xAI"), z.literal("Retab")]),
|
|
508
|
-
api_key: z.string(),
|
|
509
|
-
})));
|
|
510
|
-
export const ZIterationsAddIterationFromJsonlRequest = z.lazy(() => (z.object({
|
|
203
|
+
export const ZAddIterationFromJsonlRequest = z.lazy(() => (z.object({
|
|
511
204
|
jsonl_gcs_path: z.string(),
|
|
512
205
|
})));
|
|
513
206
|
export const ZBaseIteration = z.lazy(() => (z.object({
|
|
514
207
|
id: z.string(),
|
|
208
|
+
parent_id: z.string().nullable().optional(),
|
|
515
209
|
inference_settings: ZInferenceSettings,
|
|
516
210
|
json_schema: z.record(z.string(), z.any()),
|
|
517
211
|
updated_at: z.string(),
|
|
518
212
|
})));
|
|
519
|
-
export const
|
|
213
|
+
export const ZCreateIterationRequest = z.lazy(() => (z.object({
|
|
520
214
|
inference_settings: ZInferenceSettings,
|
|
521
215
|
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
522
|
-
|
|
216
|
+
parent_id: z.string().nullable().optional(),
|
|
523
217
|
})));
|
|
524
218
|
export const ZDocumentStatus = z.lazy(() => (z.object({
|
|
525
219
|
document_id: z.string(),
|
|
@@ -529,7 +223,7 @@ export const ZDocumentStatus = z.lazy(() => (z.object({
|
|
|
529
223
|
prediction_updated_at: z.string().nullable().optional(),
|
|
530
224
|
iteration_updated_at: z.string(),
|
|
531
225
|
})));
|
|
532
|
-
export const
|
|
226
|
+
export const ZIteration = z.lazy(() => (ZBaseIteration.schema).merge(z.object({
|
|
533
227
|
predictions: z.record(z.string(), ZPredictionData),
|
|
534
228
|
})));
|
|
535
229
|
export const ZIterationDocumentStatusResponse = z.lazy(() => (z.object({
|
|
@@ -548,12 +242,12 @@ export const ZProcessIterationRequest = z.lazy(() => (z.object({
|
|
|
548
242
|
document_ids: z.array(z.string()).nullable().optional(),
|
|
549
243
|
only_outdated: z.boolean().default(true),
|
|
550
244
|
})));
|
|
551
|
-
export const
|
|
245
|
+
export const ZAnnotatedDocument = z.lazy(() => (z.object({
|
|
552
246
|
mime_data: ZMIMEData,
|
|
553
247
|
annotation: z.record(z.string(), z.any()).default({}),
|
|
554
248
|
})));
|
|
555
|
-
export const ZCreateProjectDocumentRequest = z.lazy(() => (
|
|
556
|
-
export const
|
|
249
|
+
export const ZCreateProjectDocumentRequest = z.lazy(() => (ZDocumentItem.schema).merge(z.object({})));
|
|
250
|
+
export const ZDocumentItem = z.lazy(() => (ZAnnotatedDocument.schema).merge(z.object({
|
|
557
251
|
annotation_metadata: ZPredictionMetadata.nullable().optional(),
|
|
558
252
|
})));
|
|
559
253
|
export const ZPatchProjectDocumentRequest = z.lazy(() => (z.object({
|
|
@@ -561,7 +255,7 @@ export const ZPatchProjectDocumentRequest = z.lazy(() => (z.object({
|
|
|
561
255
|
annotation_metadata: ZPredictionMetadata.nullable().optional(),
|
|
562
256
|
ocr_file_id: z.string().nullable().optional(),
|
|
563
257
|
})));
|
|
564
|
-
export const
|
|
258
|
+
export const ZProjectDocument = z.lazy(() => (ZDocumentItem.schema).merge(z.object({
|
|
565
259
|
id: z.string(),
|
|
566
260
|
ocr_file_id: z.string().nullable().optional(),
|
|
567
261
|
})));
|
|
@@ -569,89 +263,34 @@ export const ZBaseProject = z.lazy(() => (z.object({
|
|
|
569
263
|
id: z.string(),
|
|
570
264
|
name: z.string().default(""),
|
|
571
265
|
json_schema: z.record(z.string(), z.any()),
|
|
572
|
-
default_inference_settings: ZInferenceSettings.default({}),
|
|
573
266
|
updated_at: z.string(),
|
|
574
267
|
})));
|
|
575
268
|
export const ZCreateProjectRequest = z.lazy(() => (z.object({
|
|
576
269
|
name: z.string(),
|
|
577
270
|
json_schema: z.record(z.string(), z.any()),
|
|
578
|
-
default_inference_settings: ZInferenceSettings,
|
|
579
|
-
})));
|
|
580
|
-
export const ZListProjectParams = z.lazy(() => (z.object({
|
|
581
|
-
schema_id: z.string().nullable().optional(),
|
|
582
|
-
schema_data_id: z.string().nullable().optional(),
|
|
583
271
|
})));
|
|
584
272
|
export const ZPatchProjectRequest = z.lazy(() => (z.object({
|
|
585
273
|
name: z.string().nullable().optional(),
|
|
586
274
|
json_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
587
|
-
default_inference_settings: ZInferenceSettings.nullable().optional(),
|
|
588
275
|
})));
|
|
589
|
-
export const
|
|
590
|
-
documents: z.array(
|
|
591
|
-
iterations: z.array(
|
|
276
|
+
export const ZProject = z.lazy(() => (ZBaseProject.schema).merge(z.object({
|
|
277
|
+
documents: z.array(ZProjectDocument).default([]),
|
|
278
|
+
iterations: z.array(ZIteration).default([]),
|
|
592
279
|
})));
|
|
593
280
|
export const ZModelAddIterationFromJsonlRequest = z.lazy(() => (z.object({
|
|
594
281
|
jsonl_gcs_path: z.string(),
|
|
595
282
|
})));
|
|
596
|
-
export const ZAnnotationInputData = z.lazy(() => (z.object({
|
|
597
|
-
data_file: z.string(),
|
|
598
|
-
schema_id: z.string(),
|
|
599
|
-
inference_settings: ZInferenceSettings,
|
|
600
|
-
})));
|
|
601
|
-
export const ZFinetuningWorkflowInputData = z.lazy(() => (z.object({
|
|
602
|
-
prepare_dataset_input_data: ZPrepareDatasetInputData,
|
|
603
|
-
annotation_model: z.union([z.literal("human"), z.string()]),
|
|
604
|
-
inference_settings: ZInferenceSettings.nullable().optional(),
|
|
605
|
-
finetuning_props: ZInferenceSettings,
|
|
606
|
-
})));
|
|
607
|
-
export const ZPrepareDatasetInputData = z.lazy(() => (z.object({
|
|
608
|
-
dataset_id: z.string().nullable().optional(),
|
|
609
|
-
schema_id: z.string().nullable().optional(),
|
|
610
|
-
schema_data_id: z.string().nullable().optional(),
|
|
611
|
-
selection_model: z.union([z.literal("all"), z.literal("manual")]).default("all"),
|
|
612
|
-
})));
|
|
613
|
-
export const ZProjectInputData = z.lazy(() => (z.object({
|
|
614
|
-
eval_data_file: z.string(),
|
|
615
|
-
schema_id: z.string(),
|
|
616
|
-
inference_settings_1: ZInferenceSettings.nullable().optional(),
|
|
617
|
-
inference_settings_2: ZInferenceSettings,
|
|
618
|
-
})));
|
|
619
|
-
export const ZStandaloneAnnotationWorkflowInputData = z.lazy(() => (ZAnnotationInputData.schema).merge(z.object({})));
|
|
620
|
-
export const ZStandaloneProjectWorkflowInputData = z.lazy(() => (ZProjectInputData.schema).merge(z.object({})));
|
|
621
|
-
export const ZMessageParam = z.lazy(() => (z.object({
|
|
622
|
-
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])]))]),
|
|
623
|
-
role: z.union([z.literal("user"), z.literal("assistant")]),
|
|
624
|
-
})));
|
|
625
|
-
export const ZPartialSchema = z.lazy(() => (z.object({
|
|
626
|
-
object: z.literal("schema").default("schema"),
|
|
627
|
-
created_at: z.string(),
|
|
628
|
-
json_schema: z.record(z.string(), z.any()).default({}),
|
|
629
|
-
strict: z.boolean().default(true),
|
|
630
|
-
})));
|
|
631
|
-
export const ZPartialSchemaChunk = z.lazy(() => (ZStreamingBaseModel.schema).merge(z.object({
|
|
632
|
-
object: z.literal("schema.chunk").default("schema.chunk"),
|
|
633
|
-
created_at: z.string(),
|
|
634
|
-
delta_json_schema_flat: z.record(z.string(), z.any()).default({}),
|
|
635
|
-
})));
|
|
636
|
-
export const ZSchema = z.lazy(() => (ZPartialSchema.schema).merge(z.object({
|
|
637
|
-
object: z.literal("schema").default("schema"),
|
|
638
|
-
created_at: z.string(),
|
|
639
|
-
json_schema: z.record(z.string(), z.any()).default({}),
|
|
640
|
-
})));
|
|
641
283
|
export const ZGenerateSchemaRequest = z.lazy(() => (z.object({
|
|
642
284
|
documents: z.array(ZMIMEData),
|
|
643
285
|
model: z.string().default("gpt-4o-mini"),
|
|
644
286
|
temperature: z.number().default(0.0),
|
|
645
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("
|
|
646
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
287
|
+
reasoning_effort: z.union([z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("minimal"),
|
|
288
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text"), z.literal("native_fast")]).default("native_fast"),
|
|
647
289
|
instructions: z.string().nullable().optional(),
|
|
648
290
|
image_resolution_dpi: z.number().default(96),
|
|
649
291
|
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
650
292
|
stream: z.boolean().default(false),
|
|
651
293
|
})));
|
|
652
|
-
export const ZGenerateSystemPromptRequest = z.lazy(() => (ZGenerateSchemaRequest.schema).merge(z.object({
|
|
653
|
-
json_schema: z.record(z.string(), z.any()),
|
|
654
|
-
})));
|
|
655
294
|
export const ZColumn = z.lazy(() => (z.object({
|
|
656
295
|
type: z.literal("column"),
|
|
657
296
|
size: z.number(),
|
|
@@ -685,35 +324,6 @@ export const ZRowList = z.lazy(() => (z.object({
|
|
|
685
324
|
name: z.string().nullable().optional(),
|
|
686
325
|
items: z.array(z.union([ZColumn, ZFieldItem, ZRefObject])),
|
|
687
326
|
})));
|
|
688
|
-
export const ZEnhanceSchemaConfig = z.lazy(() => (z.object({
|
|
689
|
-
allow_reasoning_fields_added: z.boolean().default(true),
|
|
690
|
-
allow_field_description_update: z.boolean().default(false),
|
|
691
|
-
allow_system_prompt_update: z.boolean().default(true),
|
|
692
|
-
allow_field_simple_type_change: z.boolean().default(false),
|
|
693
|
-
allow_field_data_structure_breakdown: z.boolean().default(false),
|
|
694
|
-
})));
|
|
695
|
-
export const ZEnhanceSchemaConfigDict = z.lazy(() => (z.object({
|
|
696
|
-
allow_reasoning_fields_added: z.boolean(),
|
|
697
|
-
allow_field_description_update: z.boolean(),
|
|
698
|
-
allow_system_prompt_update: z.boolean(),
|
|
699
|
-
allow_field_simple_type_change: z.boolean(),
|
|
700
|
-
allow_field_data_structure_breakdown: z.boolean(),
|
|
701
|
-
})));
|
|
702
|
-
export const ZEnhanceSchemaRequest = z.lazy(() => (z.object({
|
|
703
|
-
documents: z.array(ZMIMEData),
|
|
704
|
-
ground_truths: z.array(z.record(z.string(), z.any())).nullable().optional(),
|
|
705
|
-
model: z.string().default("gpt-4o-mini"),
|
|
706
|
-
temperature: z.number().default(0.0),
|
|
707
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
708
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
709
|
-
image_resolution_dpi: z.number().default(96),
|
|
710
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
711
|
-
stream: z.boolean().default(false),
|
|
712
|
-
tools_config: ZEnhanceSchemaConfig,
|
|
713
|
-
json_schema: z.record(z.string(), z.any()),
|
|
714
|
-
instructions: z.string().nullable().optional(),
|
|
715
|
-
flat_likelihoods: z.union([z.array(z.record(z.string(), z.number())), z.record(z.string(), z.number())]).nullable().optional(),
|
|
716
|
-
})));
|
|
717
327
|
export const ZTemplateSchema = z.lazy(() => (z.object({
|
|
718
328
|
id: z.string(),
|
|
719
329
|
name: z.string(),
|
|
@@ -730,147 +340,61 @@ export const ZUpdateTemplateRequest = z.lazy(() => (z.object({
|
|
|
730
340
|
python_code: z.string().nullable().optional(),
|
|
731
341
|
sample_document: ZMIMEData.nullable().optional(),
|
|
732
342
|
})));
|
|
733
|
-
export const
|
|
734
|
-
|
|
735
|
-
ground_truths: z.array(z.record(z.string(), z.any())).nullable().optional(),
|
|
736
|
-
model: z.string().default("gpt-4o-mini"),
|
|
737
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
738
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
739
|
-
image_resolution_dpi: z.number().default(96),
|
|
740
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
741
|
-
n_consensus: z.number().default(1),
|
|
742
|
-
json_schema: z.record(z.string(), z.any()),
|
|
743
|
-
})));
|
|
744
|
-
export const ZEvaluateSchemaResponse = z.lazy(() => (z.object({
|
|
745
|
-
item_metrics: z.array(ZItemMetric),
|
|
746
|
-
})));
|
|
747
|
-
export const ZBinaryIO = z.lazy(() => z.instanceof(Uint8Array));
|
|
748
|
-
export const ZDBFile = z.lazy(() => (z.object({
|
|
749
|
-
object: z.literal("file").default("file"),
|
|
750
|
-
id: z.string(),
|
|
751
|
-
filename: z.string(),
|
|
752
|
-
})));
|
|
753
|
-
export const ZFileLink = z.lazy(() => (z.object({
|
|
754
|
-
download_url: z.string(),
|
|
755
|
-
expires_in: z.string(),
|
|
756
|
-
filename: z.string(),
|
|
343
|
+
export const ZDocumentTransformRequest = z.lazy(() => (z.object({
|
|
344
|
+
document: ZMIMEData,
|
|
757
345
|
})));
|
|
758
|
-
export const
|
|
759
|
-
|
|
760
|
-
parameters: ZAnnotationParameters,
|
|
761
|
-
data: z.record(z.string(), z.any()),
|
|
762
|
-
schema_id: z.string(),
|
|
763
|
-
organization_id: z.string(),
|
|
764
|
-
updated_at: z.string(),
|
|
346
|
+
export const ZDocumentTransformResponse = z.lazy(() => (z.object({
|
|
347
|
+
document: ZMIMEData,
|
|
765
348
|
})));
|
|
766
|
-
export const
|
|
767
|
-
|
|
768
|
-
|
|
349
|
+
export const ZParseRequest = z.lazy(() => (z.object({
|
|
350
|
+
document: ZMIMEData,
|
|
351
|
+
model: z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-5"), z.literal("gpt-5-2025-08-07"), z.literal("gpt-5-mini"), z.literal("gpt-5-mini-2025-08-07"), z.literal("gpt-5-nano"), z.literal("gpt-5-nano-2025-08-07"), 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("claude-opus-4.1"), z.literal("claude-opus-4"), z.literal("claude-sonnet-4"), z.literal("claude-sonnet-4-20250514"), 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"), 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"),
|
|
352
|
+
table_parsing_format: z.union([z.literal("markdown"), z.literal("yaml"), z.literal("html"), z.literal("json")]).default("html"),
|
|
769
353
|
image_resolution_dpi: z.number().default(96),
|
|
770
354
|
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
771
|
-
temperature: z.number().default(0.0),
|
|
772
|
-
})));
|
|
773
|
-
export const ZCronSchedule = z.lazy(() => (z.object({
|
|
774
|
-
second: z.number().nullable().optional().default(0),
|
|
775
|
-
minute: z.number(),
|
|
776
|
-
hour: z.number(),
|
|
777
|
-
day_of_month: z.number().nullable().optional(),
|
|
778
|
-
month: z.number().nullable().optional(),
|
|
779
|
-
day_of_week: z.number().nullable().optional(),
|
|
780
355
|
})));
|
|
781
|
-
export const
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
link: z.string(),
|
|
787
|
-
schedule: ZCronSchedule,
|
|
788
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
789
|
-
image_resolution_dpi: z.number().default(96),
|
|
790
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
791
|
-
model: z.string(),
|
|
792
|
-
json_schema: z.record(z.string(), z.any()),
|
|
793
|
-
temperature: z.number().default(0.0),
|
|
794
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("medium"),
|
|
356
|
+
export const ZParseResult = z.lazy(() => (z.object({
|
|
357
|
+
document: ZBaseMIMEData,
|
|
358
|
+
usage: ZRetabUsage,
|
|
359
|
+
pages: z.array(z.string()),
|
|
360
|
+
text: z.string(),
|
|
795
361
|
})));
|
|
796
|
-
export const
|
|
797
|
-
|
|
798
|
-
|
|
362
|
+
export const ZRetabUsage = z.lazy(() => (z.object({
|
|
363
|
+
page_count: z.number(),
|
|
364
|
+
credits: z.number(),
|
|
799
365
|
})));
|
|
800
|
-
export const
|
|
801
|
-
|
|
802
|
-
email: z.string(),
|
|
803
|
-
authorized_domains: z.array(z.string()),
|
|
804
|
-
authorized_emails: z.array(z.string().email()),
|
|
366
|
+
export const ZDocumentCreateInputRequest = z.lazy(() => (ZDocumentCreateMessageRequest.schema).merge(z.object({
|
|
367
|
+
json_schema: z.record(z.string(), z.any()),
|
|
805
368
|
})));
|
|
806
|
-
export const
|
|
807
|
-
|
|
808
|
-
|
|
369
|
+
export const ZDocumentCreateMessageRequest = z.lazy(() => (z.object({
|
|
370
|
+
document: ZMIMEData,
|
|
371
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text"), z.literal("native_fast")]).default("native"),
|
|
372
|
+
image_resolution_dpi: z.number().default(96),
|
|
373
|
+
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
374
|
+
model: z.union([z.literal("gpt-4o"), z.literal("gpt-4o-mini"), z.literal("chatgpt-4o-latest"), z.literal("gpt-5"), z.literal("gpt-5-2025-08-07"), z.literal("gpt-5-mini"), z.literal("gpt-5-mini-2025-08-07"), z.literal("gpt-5-nano"), z.literal("gpt-5-nano-2025-08-07"), 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("claude-opus-4.1"), z.literal("claude-opus-4"), z.literal("claude-sonnet-4"), z.literal("claude-sonnet-4-20250514"), 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"), 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"),
|
|
809
375
|
})));
|
|
810
|
-
export const
|
|
376
|
+
export const ZDocumentMessage = z.lazy(() => (z.object({
|
|
811
377
|
id: z.string(),
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
list_metadata: ZListMetadata,
|
|
817
|
-
})));
|
|
818
|
-
export const ZUpdateLinkRequest = z.lazy(() => (ZUpdateAutomationRequest.schema).merge(z.object({
|
|
819
|
-
password: z.string().nullable().optional(),
|
|
820
|
-
})));
|
|
821
|
-
export const ZAutomationLevel = z.lazy(() => (z.object({
|
|
822
|
-
distance_threshold: z.number().default(0.9),
|
|
823
|
-
score_threshold: z.number().default(0.9),
|
|
824
|
-
})));
|
|
825
|
-
export const ZFetchParams = z.lazy(() => (z.object({
|
|
826
|
-
endpoint: z.string(),
|
|
827
|
-
headers: z.record(z.string(), z.string()),
|
|
828
|
-
name: z.string(),
|
|
829
|
-
})));
|
|
830
|
-
export const ZListOutlooks = z.lazy(() => (z.object({
|
|
831
|
-
data: z.array(ZOutlook),
|
|
832
|
-
list_metadata: ZListMetadata,
|
|
378
|
+
object: z.literal("document_message").default("document_message"),
|
|
379
|
+
messages: z.array(ZChatCompletionRetabMessage),
|
|
380
|
+
created: z.number(),
|
|
381
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text"), z.literal("native_fast")]).default("native"),
|
|
833
382
|
})));
|
|
834
|
-
export const
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
383
|
+
export const ZTokenCount = z.lazy(() => (z.object({
|
|
384
|
+
total_tokens: z.number().default(0),
|
|
385
|
+
developer_tokens: z.number().default(0),
|
|
386
|
+
user_tokens: z.number().default(0),
|
|
838
387
|
})));
|
|
839
|
-
export const
|
|
840
|
-
id: z.string(),
|
|
841
|
-
authorized_domains: z.array(z.string()),
|
|
842
|
-
authorized_emails: z.array(z.string().email()),
|
|
843
|
-
layout_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
844
|
-
match_params: z.array(ZMatchParams),
|
|
845
|
-
fetch_params: z.array(ZFetchParams),
|
|
846
|
-
})));
|
|
847
|
-
export const ZUpdateOutlookRequest = z.lazy(() => (ZUpdateAutomationRequest.schema).merge(z.object({
|
|
848
|
-
authorized_domains: z.array(z.string()).nullable().optional(),
|
|
849
|
-
authorized_emails: z.array(z.string().email()).nullable().optional(),
|
|
850
|
-
match_params: z.array(ZMatchParams).nullable().optional(),
|
|
851
|
-
fetch_params: z.array(ZFetchParams).nullable().optional(),
|
|
852
|
-
layout_schema: z.record(z.string(), z.any()).nullable().optional(),
|
|
853
|
-
})));
|
|
854
|
-
export const ZBaseWebhookRequest = z.lazy(() => (z.object({
|
|
855
|
-
completion: ZRetabParsedChatCompletion,
|
|
856
|
-
user: z.string().email().nullable().optional(),
|
|
857
|
-
file_payload: ZBaseMIMEData,
|
|
858
|
-
metadata: z.record(z.string(), z.any()).nullable().optional(),
|
|
859
|
-
})));
|
|
860
|
-
export const ZWebhookRequest = z.lazy(() => (z.object({
|
|
861
|
-
completion: ZRetabParsedChatCompletion,
|
|
862
|
-
user: z.string().email().nullable().optional(),
|
|
863
|
-
file_payload: ZMIMEData,
|
|
864
|
-
metadata: z.record(z.string(), z.any()).nullable().optional(),
|
|
865
|
-
})));
|
|
866
|
-
export const ZEndpoint = z.lazy(() => (ZAutomationConfig.schema).merge(z.object({
|
|
388
|
+
export const ZChatCompletion = z.lazy(() => (z.object({
|
|
867
389
|
id: z.string(),
|
|
390
|
+
choices: z.array(ZChatCompletionChoice),
|
|
391
|
+
created: z.number(),
|
|
392
|
+
model: z.string(),
|
|
393
|
+
object: z.literal("chat.completion"),
|
|
394
|
+
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
395
|
+
system_fingerprint: z.string().nullable().optional(),
|
|
396
|
+
usage: ZCompletionUsage.nullable().optional(),
|
|
868
397
|
})));
|
|
869
|
-
export const ZListEndpoints = z.lazy(() => (z.object({
|
|
870
|
-
data: z.array(ZEndpoint),
|
|
871
|
-
list_metadata: ZListMetadata,
|
|
872
|
-
})));
|
|
873
|
-
export const ZUpdateEndpointRequest = z.lazy(() => (ZUpdateAutomationRequest.schema).merge(z.object({})));
|
|
874
398
|
export const ZChatCompletionChunk = z.lazy(() => (z.object({
|
|
875
399
|
id: z.string(),
|
|
876
400
|
choices: z.array(ZChoice),
|
|
@@ -897,18 +421,31 @@ export const ZChoiceDelta = z.lazy(() => (z.object({
|
|
|
897
421
|
export const ZConsensusModel = z.lazy(() => (z.object({
|
|
898
422
|
model: z.string(),
|
|
899
423
|
temperature: z.number().default(0.0),
|
|
900
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("
|
|
424
|
+
reasoning_effort: z.union([z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("minimal"),
|
|
425
|
+
})));
|
|
426
|
+
export const ZCostBreakdown = z.lazy(() => (z.object({
|
|
427
|
+
total: ZAmount,
|
|
428
|
+
text_prompt_cost: ZAmount,
|
|
429
|
+
text_cached_cost: ZAmount,
|
|
430
|
+
text_completion_cost: ZAmount,
|
|
431
|
+
text_total_cost: ZAmount,
|
|
432
|
+
audio_prompt_cost: ZAmount.nullable().optional(),
|
|
433
|
+
audio_completion_cost: ZAmount.nullable().optional(),
|
|
434
|
+
audio_total_cost: ZAmount.nullable().optional(),
|
|
435
|
+
token_counts: ZTokenCounts,
|
|
436
|
+
model: z.string(),
|
|
437
|
+
is_fine_tuned: z.boolean().default(false),
|
|
901
438
|
})));
|
|
902
439
|
export const ZDocumentExtractRequest = z.lazy(() => (z.object({
|
|
903
440
|
document: ZMIMEData,
|
|
904
|
-
documents: z.array(ZMIMEData),
|
|
905
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
441
|
+
documents: z.array(ZMIMEData).default([]),
|
|
442
|
+
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text"), z.literal("native_fast")]).default("native"),
|
|
906
443
|
image_resolution_dpi: z.number().default(96),
|
|
907
444
|
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
908
445
|
model: z.string(),
|
|
909
446
|
json_schema: z.record(z.string(), z.any()),
|
|
910
447
|
temperature: z.number().default(0.0),
|
|
911
|
-
reasoning_effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("
|
|
448
|
+
reasoning_effort: z.union([z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional().default("minimal"),
|
|
912
449
|
n_consensus: z.number().default(1),
|
|
913
450
|
stream: z.boolean().default(false),
|
|
914
451
|
seed: z.number().nullable().optional(),
|
|
@@ -928,11 +465,9 @@ export const ZFieldLocation = z.lazy(() => (z.object({
|
|
|
928
465
|
export const ZLogExtractionRequest = z.lazy(() => (z.object({
|
|
929
466
|
messages: z.array(ZChatCompletionRetabMessage).nullable().optional(),
|
|
930
467
|
openai_messages: z.array(z.union([ZChatCompletionDeveloperMessageParam, ZChatCompletionSystemMessageParam, ZChatCompletionUserMessageParam, ZChatCompletionAssistantMessageParam, ZChatCompletionToolMessageParam, ZChatCompletionFunctionMessageParam])).nullable().optional(),
|
|
931
|
-
openai_responses_input: z.array(z.union([ZEasyInputMessageParam,
|
|
932
|
-
anthropic_messages: z.array(ZMessageParam).nullable().optional(),
|
|
933
|
-
anthropic_system_prompt: z.string().nullable().optional(),
|
|
468
|
+
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, ZResponseCustomToolCallOutputParam, ZResponseCustomToolCallParam, ZItemReference])).nullable().optional(),
|
|
934
469
|
document: ZMIMEData.default({ "filename": "dummy.txt", "url": "data:text/plain;base64,Tm8gZG9jdW1lbnQgcHJvdmlkZWQ=" }),
|
|
935
|
-
completion: z.union([z.record(z.any()), ZRetabParsedChatCompletion,
|
|
470
|
+
completion: z.union([z.record(z.any()), ZRetabParsedChatCompletion, ZParsedChatCompletion, ZChatCompletion]).nullable().optional(),
|
|
936
471
|
openai_responses_output: ZResponse.nullable().optional(),
|
|
937
472
|
json_schema: z.record(z.string(), z.any()),
|
|
938
473
|
model: z.string(),
|
|
@@ -943,16 +478,6 @@ export const ZLogExtractionResponse = z.lazy(() => (z.object({
|
|
|
943
478
|
status: z.union([z.literal("success"), z.literal("error")]),
|
|
944
479
|
error_message: z.string().nullable().optional(),
|
|
945
480
|
})));
|
|
946
|
-
export const ZMessage = z.lazy(() => (z.object({
|
|
947
|
-
id: z.string(),
|
|
948
|
-
content: z.array(z.union([ZTextBlock, ZThinkingBlock, ZRedactedThinkingBlock, ZToolUseBlock, ZServerToolUseBlock, ZWebSearchToolResultBlock])),
|
|
949
|
-
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()]),
|
|
950
|
-
role: z.literal("assistant"),
|
|
951
|
-
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(),
|
|
952
|
-
stop_sequence: z.string().nullable().optional(),
|
|
953
|
-
type: z.literal("message"),
|
|
954
|
-
usage: ZUsage,
|
|
955
|
-
})));
|
|
956
481
|
export const ZParsedChatCompletion = z.lazy(() => (ZChatCompletion.schema).merge(z.object({
|
|
957
482
|
choices: z.array(ZParsedChoice),
|
|
958
483
|
})));
|
|
@@ -964,22 +489,24 @@ export const ZResponse = z.lazy(() => (z.object({
|
|
|
964
489
|
created_at: z.number(),
|
|
965
490
|
error: ZResponseError.nullable().optional(),
|
|
966
491
|
incomplete_details: ZIncompleteDetails.nullable().optional(),
|
|
967
|
-
instructions: z.union([z.string(), z.array(z.union([ZEasyInputMessage, ZResponseInputItemMessage, ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseComputerToolCall, ZResponseInputItemComputerCallOutput, ZResponseFunctionWebSearch, ZResponseFunctionToolCall, ZResponseInputItemFunctionCallOutput, ZResponseReasoningItem, ZResponseInputItemImageGenerationCall, ZResponseCodeInterpreterToolCall, ZResponseInputItemLocalShellCall, ZResponseInputItemLocalShellCallOutput, ZResponseInputItemMcpListTools, ZResponseInputItemMcpApprovalRequest, ZResponseInputItemMcpApprovalResponse, ZResponseInputItemMcpCall, ZResponseInputItemItemReference]))]).nullable().optional(),
|
|
492
|
+
instructions: z.union([z.string(), z.array(z.union([ZEasyInputMessage, ZResponseInputItemMessage, ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseComputerToolCall, ZResponseInputItemComputerCallOutput, ZResponseFunctionWebSearch, ZResponseFunctionToolCall, ZResponseInputItemFunctionCallOutput, ZResponseReasoningItem, ZResponseInputItemImageGenerationCall, ZResponseCodeInterpreterToolCall, ZResponseInputItemLocalShellCall, ZResponseInputItemLocalShellCallOutput, ZResponseInputItemMcpListTools, ZResponseInputItemMcpApprovalRequest, ZResponseInputItemMcpApprovalResponse, ZResponseInputItemMcpCall, ZResponseCustomToolCallOutput, ZResponseCustomToolCall, ZResponseInputItemItemReference]))]).nullable().optional(),
|
|
968
493
|
metadata: z.record(z.string(), z.string()).nullable().optional(),
|
|
969
|
-
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")])]),
|
|
494
|
+
model: z.union([z.string(), z.union([z.literal("gpt-5"), z.literal("gpt-5-mini"), z.literal("gpt-5-nano"), z.literal("gpt-5-2025-08-07"), z.literal("gpt-5-mini-2025-08-07"), z.literal("gpt-5-nano-2025-08-07"), z.literal("gpt-5-chat-latest"), 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")])]),
|
|
970
495
|
object: z.literal("response"),
|
|
971
|
-
output: z.array(z.union([ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseFunctionToolCall, ZResponseFunctionWebSearch, ZResponseComputerToolCall, ZResponseReasoningItem, ZResponseOutputItemImageGenerationCall, ZResponseCodeInterpreterToolCall, ZResponseOutputItemLocalShellCall, ZResponseOutputItemMcpCall, ZResponseOutputItemMcpListTools, ZResponseOutputItemMcpApprovalRequest])),
|
|
496
|
+
output: z.array(z.union([ZResponseOutputMessage, ZResponseFileSearchToolCall, ZResponseFunctionToolCall, ZResponseFunctionWebSearch, ZResponseComputerToolCall, ZResponseReasoningItem, ZResponseOutputItemImageGenerationCall, ZResponseCodeInterpreterToolCall, ZResponseOutputItemLocalShellCall, ZResponseOutputItemMcpCall, ZResponseOutputItemMcpListTools, ZResponseOutputItemMcpApprovalRequest, ZResponseCustomToolCall])),
|
|
972
497
|
parallel_tool_calls: z.boolean(),
|
|
973
498
|
temperature: z.number().nullable().optional(),
|
|
974
|
-
tool_choice: z.union([z.union([z.literal("none"), z.literal("auto"), z.literal("required")]), ZToolChoiceTypes, ZToolChoiceFunction, ZToolChoiceMcp]),
|
|
975
|
-
tools: z.array(z.union([ZFunctionTool, ZFileSearchTool, ZWebSearchTool, ZComputerTool, ZMcp, ZCodeInterpreter, ZImageGeneration, ZLocalShell])),
|
|
499
|
+
tool_choice: z.union([z.union([z.literal("none"), z.literal("auto"), z.literal("required")]), ZToolChoiceAllowed, ZToolChoiceTypes, ZToolChoiceFunction, ZToolChoiceMcp, ZToolChoiceCustom]),
|
|
500
|
+
tools: z.array(z.union([ZFunctionTool, ZFileSearchTool, ZWebSearchTool, ZComputerTool, ZMcp, ZCodeInterpreter, ZImageGeneration, ZLocalShell, ZCustomTool])),
|
|
976
501
|
top_p: z.number().nullable().optional(),
|
|
977
502
|
background: z.boolean().nullable().optional(),
|
|
978
503
|
max_output_tokens: z.number().nullable().optional(),
|
|
979
504
|
max_tool_calls: z.number().nullable().optional(),
|
|
980
505
|
previous_response_id: z.string().nullable().optional(),
|
|
981
506
|
prompt: ZResponsePrompt.nullable().optional(),
|
|
982
|
-
|
|
507
|
+
prompt_cache_key: z.string().nullable().optional(),
|
|
508
|
+
reasoning: ZReasoning.nullable().optional(),
|
|
509
|
+
safety_identifier: z.string().nullable().optional(),
|
|
983
510
|
service_tier: z.union([z.literal("auto"), z.literal("default"), z.literal("flex"), z.literal("scale"), z.literal("priority")]).nullable().optional(),
|
|
984
511
|
status: z.union([z.literal("completed"), z.literal("failed"), z.literal("in_progress"), z.literal("cancelled"), z.literal("queued"), z.literal("incomplete")]).nullable().optional(),
|
|
985
512
|
text: ZResponseTextConfig.nullable().optional(),
|
|
@@ -988,6 +515,15 @@ export const ZResponse = z.lazy(() => (z.object({
|
|
|
988
515
|
usage: ZResponseUsage.nullable().optional(),
|
|
989
516
|
user: z.string().nullable().optional(),
|
|
990
517
|
})));
|
|
518
|
+
export const ZRetabParsedChatCompletion = z.lazy(() => (ZParsedChatCompletion.schema).merge(z.object({
|
|
519
|
+
choices: z.array(ZRetabParsedChoice),
|
|
520
|
+
extraction_id: z.string().nullable().optional(),
|
|
521
|
+
likelihoods: z.record(z.string(), z.any()).nullable().optional(),
|
|
522
|
+
schema_validation_error: ZErrorDetail.nullable().optional(),
|
|
523
|
+
request_at: z.string().nullable().optional(),
|
|
524
|
+
first_token_at: z.string().nullable().optional(),
|
|
525
|
+
last_token_at: z.string().nullable().optional(),
|
|
526
|
+
})));
|
|
991
527
|
export const ZRetabParsedChatCompletionChunk = z.lazy(() => (ZStreamingBaseModel.schema).merge(ZChatCompletionChunk.schema).merge(z.object({
|
|
992
528
|
choices: z.array(ZRetabParsedChoiceChunk),
|
|
993
529
|
extraction_id: z.string().nullable().optional(),
|
|
@@ -1020,67 +556,21 @@ export const ZUiResponse = z.lazy(() => (ZResponse.schema).merge(z.object({
|
|
|
1020
556
|
first_token_at: z.string().nullable().optional(),
|
|
1021
557
|
last_token_at: z.string().nullable().optional(),
|
|
1022
558
|
})));
|
|
1023
|
-
export const
|
|
1024
|
-
document: ZMIMEData,
|
|
1025
|
-
})));
|
|
1026
|
-
export const ZDocumentTransformResponse = z.lazy(() => (z.object({
|
|
1027
|
-
document: ZMIMEData,
|
|
1028
|
-
})));
|
|
1029
|
-
export const ZParseRequest = z.lazy(() => (z.object({
|
|
1030
|
-
document: ZMIMEData,
|
|
1031
|
-
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"),
|
|
1032
|
-
table_parsing_format: z.union([z.literal("markdown"), z.literal("yaml"), z.literal("html"), z.literal("json")]).default("html"),
|
|
1033
|
-
image_resolution_dpi: z.number().default(72),
|
|
1034
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
1035
|
-
})));
|
|
1036
|
-
export const ZParseResult = z.lazy(() => (z.object({
|
|
1037
|
-
document: ZBaseMIMEData,
|
|
1038
|
-
usage: ZRetabUsage,
|
|
1039
|
-
pages: z.array(z.string()),
|
|
559
|
+
export const ZChatCompletionContentPartTextParam = z.lazy(() => (z.object({
|
|
1040
560
|
text: z.string(),
|
|
561
|
+
type: z.literal("text"),
|
|
1041
562
|
})));
|
|
1042
|
-
export const
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
})));
|
|
1046
|
-
export const ZDocumentCreateInputRequest = z.lazy(() => (ZDocumentCreateMessageRequest.schema).merge(z.object({
|
|
1047
|
-
json_schema: z.record(z.string(), z.any()),
|
|
1048
|
-
})));
|
|
1049
|
-
export const ZDocumentCreateMessageRequest = z.lazy(() => (z.object({
|
|
1050
|
-
document: ZMIMEData,
|
|
1051
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
1052
|
-
image_resolution_dpi: z.number().default(96),
|
|
1053
|
-
browser_canvas: z.union([z.literal("A3"), z.literal("A4"), z.literal("A5")]).default("A4"),
|
|
1054
|
-
})));
|
|
1055
|
-
export const ZDocumentMessage = z.lazy(() => (z.object({
|
|
1056
|
-
id: z.string(),
|
|
1057
|
-
object: z.literal("document_message").default("document_message"),
|
|
1058
|
-
messages: z.array(ZChatCompletionRetabMessage),
|
|
1059
|
-
created: z.number(),
|
|
1060
|
-
modality: z.union([z.literal("text"), z.literal("image"), z.literal("native"), z.literal("image+text")]),
|
|
1061
|
-
})));
|
|
1062
|
-
export const ZTokenCount = z.lazy(() => (z.object({
|
|
1063
|
-
total_tokens: z.number().default(0),
|
|
1064
|
-
developer_tokens: z.number().default(0),
|
|
1065
|
-
user_tokens: z.number().default(0),
|
|
1066
|
-
})));
|
|
1067
|
-
export const ZEvaluationProjectInputData = z.lazy(() => (z.object({
|
|
1068
|
-
original_dataset_id: z.string(),
|
|
1069
|
-
schema_id: z.string(),
|
|
1070
|
-
schema_data_id: z.string(),
|
|
1071
|
-
inference_settings_1: ZInferenceSettings,
|
|
1072
|
-
inference_settings_2: ZInferenceSettings,
|
|
563
|
+
export const ZChatCompletionContentPartImageParam = z.lazy(() => (z.object({
|
|
564
|
+
image_url: ZImageURL,
|
|
565
|
+
type: z.literal("image_url"),
|
|
1073
566
|
})));
|
|
1074
|
-
export const
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
upsert: z.boolean().default(false),
|
|
1078
|
-
inference_settings: ZInferenceSettings,
|
|
567
|
+
export const ZChatCompletionContentPartInputAudioParam = z.lazy(() => (z.object({
|
|
568
|
+
input_audio: ZInputAudio,
|
|
569
|
+
type: z.literal("input_audio"),
|
|
1079
570
|
})));
|
|
1080
|
-
export const
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
eval_size: z.union([z.number(), z.number()]).nullable().optional(),
|
|
571
|
+
export const ZFile = z.lazy(() => (z.object({
|
|
572
|
+
file: ZFileFile,
|
|
573
|
+
type: z.literal("file"),
|
|
1084
574
|
})));
|
|
1085
575
|
export const ZChatCompletionChoice = z.lazy(() => (z.object({
|
|
1086
576
|
finish_reason: z.union([z.literal("stop"), z.literal("length"), z.literal("tool_calls"), z.literal("content_filter"), z.literal("function_call")]),
|
|
@@ -1095,21 +585,19 @@ export const ZCompletionUsage = z.lazy(() => (z.object({
|
|
|
1095
585
|
completion_tokens_details: ZCompletionTokensDetails.nullable().optional(),
|
|
1096
586
|
prompt_tokens_details: ZPromptTokensDetails.nullable().optional(),
|
|
1097
587
|
})));
|
|
1098
|
-
export const
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
})));
|
|
1102
|
-
export const ZChatCompletionContentPartImageParam = z.lazy(() => (z.object({
|
|
1103
|
-
image_url: ZImageURL,
|
|
1104
|
-
type: z.literal("image_url"),
|
|
588
|
+
export const ZChoiceLogprobs = z.lazy(() => (z.object({
|
|
589
|
+
content: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
590
|
+
refusal: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
1105
591
|
})));
|
|
1106
|
-
export const
|
|
1107
|
-
|
|
1108
|
-
|
|
592
|
+
export const ZChoiceDeltaFunctionCall = z.lazy(() => (z.object({
|
|
593
|
+
arguments: z.string().nullable().optional(),
|
|
594
|
+
name: z.string().nullable().optional(),
|
|
1109
595
|
})));
|
|
1110
|
-
export const
|
|
1111
|
-
|
|
1112
|
-
|
|
596
|
+
export const ZChoiceDeltaToolCall = z.lazy(() => (z.object({
|
|
597
|
+
index: z.number(),
|
|
598
|
+
id: z.string().nullable().optional(),
|
|
599
|
+
function: ZChoiceDeltaToolCallFunction.nullable().optional(),
|
|
600
|
+
type: z.literal("function").nullable().optional(),
|
|
1113
601
|
})));
|
|
1114
602
|
export const ZTokenCounts = z.lazy(() => (z.object({
|
|
1115
603
|
prompt_regular_text: z.number(),
|
|
@@ -1119,31 +607,46 @@ export const ZTokenCounts = z.lazy(() => (z.object({
|
|
|
1119
607
|
completion_audio: z.number(),
|
|
1120
608
|
total_tokens: z.number(),
|
|
1121
609
|
})));
|
|
1122
|
-
export const
|
|
610
|
+
export const ZChatCompletionDeveloperMessageParam = z.lazy(() => (z.object({
|
|
611
|
+
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
612
|
+
role: z.literal("developer"),
|
|
613
|
+
name: z.string(),
|
|
614
|
+
})));
|
|
615
|
+
export const ZChatCompletionSystemMessageParam = z.lazy(() => (z.object({
|
|
616
|
+
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
617
|
+
role: z.literal("system"),
|
|
1123
618
|
name: z.string(),
|
|
1124
|
-
description: z.string(),
|
|
1125
|
-
schema: z.record(z.string(), z.object({}).passthrough()),
|
|
1126
|
-
strict: z.boolean().nullable().optional(),
|
|
1127
619
|
})));
|
|
1128
|
-
export const
|
|
1129
|
-
|
|
620
|
+
export const ZChatCompletionUserMessageParam = z.lazy(() => (z.object({
|
|
621
|
+
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartImageParam, ZChatCompletionContentPartInputAudioParam, ZFile]))]),
|
|
622
|
+
role: z.literal("user"),
|
|
623
|
+
name: z.string(),
|
|
1130
624
|
})));
|
|
1131
|
-
export const
|
|
625
|
+
export const ZChatCompletionAssistantMessageParam = z.lazy(() => (z.object({
|
|
626
|
+
role: z.literal("assistant"),
|
|
627
|
+
audio: ZAudio.nullable().optional(),
|
|
628
|
+
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartRefusalParam]))]).nullable().optional(),
|
|
629
|
+
function_call: ZFunctionCall.nullable().optional(),
|
|
1132
630
|
name: z.string(),
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
description: z.string(),
|
|
1136
|
-
strict: z.boolean().nullable().optional(),
|
|
631
|
+
refusal: z.string().nullable().optional(),
|
|
632
|
+
tool_calls: z.array(z.union([ZChatCompletionMessageFunctionToolCallParam, ZChatCompletionMessageCustomToolCallParam])),
|
|
1137
633
|
})));
|
|
1138
|
-
export const
|
|
1139
|
-
|
|
634
|
+
export const ZChatCompletionToolMessageParam = z.lazy(() => (z.object({
|
|
635
|
+
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
636
|
+
role: z.literal("tool"),
|
|
637
|
+
tool_call_id: z.string(),
|
|
638
|
+
})));
|
|
639
|
+
export const ZChatCompletionFunctionMessageParam = z.lazy(() => (z.object({
|
|
640
|
+
content: z.string().nullable().optional(),
|
|
641
|
+
name: z.string(),
|
|
642
|
+
role: z.literal("function"),
|
|
1140
643
|
})));
|
|
1141
644
|
export const ZEasyInputMessageParam = z.lazy(() => (z.object({
|
|
1142
645
|
content: z.union([z.string(), z.array(z.union([ZResponseInputTextParam, ZResponseInputImageParam, ZResponseInputFileParam]))]),
|
|
1143
646
|
role: z.union([z.literal("user"), z.literal("assistant"), z.literal("system"), z.literal("developer")]),
|
|
1144
647
|
type: z.literal("message"),
|
|
1145
648
|
})));
|
|
1146
|
-
export const
|
|
649
|
+
export const ZMessage = z.lazy(() => (z.object({
|
|
1147
650
|
content: z.array(z.union([ZResponseInputTextParam, ZResponseInputImageParam, ZResponseInputFileParam])),
|
|
1148
651
|
role: z.union([z.literal("user"), z.literal("system"), z.literal("developer")]),
|
|
1149
652
|
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
@@ -1204,6 +707,7 @@ export const ZResponseReasoningItemParam = z.lazy(() => (z.object({
|
|
|
1204
707
|
id: z.string(),
|
|
1205
708
|
summary: z.array(ZSummary),
|
|
1206
709
|
type: z.literal("reasoning"),
|
|
710
|
+
content: z.array(ZContent),
|
|
1207
711
|
encrypted_content: z.string().nullable().optional(),
|
|
1208
712
|
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]),
|
|
1209
713
|
})));
|
|
@@ -1264,151 +768,22 @@ export const ZMcpCall = z.lazy(() => (z.object({
|
|
|
1264
768
|
error: z.string().nullable().optional(),
|
|
1265
769
|
output: z.string().nullable().optional(),
|
|
1266
770
|
})));
|
|
1267
|
-
export const
|
|
771
|
+
export const ZResponseCustomToolCallOutputParam = z.lazy(() => (z.object({
|
|
772
|
+
call_id: z.string(),
|
|
773
|
+
output: z.string(),
|
|
774
|
+
type: z.literal("custom_tool_call_output"),
|
|
1268
775
|
id: z.string(),
|
|
1269
|
-
type: z.literal("item_reference").nullable().optional(),
|
|
1270
|
-
})));
|
|
1271
|
-
export const ZTextBlockParam = z.lazy(() => (z.object({
|
|
1272
|
-
text: z.string(),
|
|
1273
|
-
type: z.literal("text"),
|
|
1274
|
-
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1275
|
-
citations: z.array(z.union([ZCitationCharLocationParam, ZCitationPageLocationParam, ZCitationContentBlockLocationParam, ZCitationWebSearchResultLocationParam])).nullable().optional(),
|
|
1276
|
-
})));
|
|
1277
|
-
export const ZImageBlockParam = z.lazy(() => (z.object({
|
|
1278
|
-
source: z.union([ZBase64ImageSourceParam, ZURLImageSourceParam]),
|
|
1279
|
-
type: z.literal("image"),
|
|
1280
|
-
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1281
|
-
})));
|
|
1282
|
-
export const ZDocumentBlockParam = z.lazy(() => (z.object({
|
|
1283
|
-
source: z.union([ZBase64PDFSourceParam, ZPlainTextSourceParam, ZContentBlockSourceParam, ZURLPDFSourceParam]),
|
|
1284
|
-
type: z.literal("document"),
|
|
1285
|
-
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1286
|
-
citations: ZCitationsConfigParam,
|
|
1287
|
-
context: z.string().nullable().optional(),
|
|
1288
|
-
title: z.string().nullable().optional(),
|
|
1289
|
-
})));
|
|
1290
|
-
export const ZThinkingBlockParam = z.lazy(() => (z.object({
|
|
1291
|
-
signature: z.string(),
|
|
1292
|
-
thinking: z.string(),
|
|
1293
|
-
type: z.literal("thinking"),
|
|
1294
|
-
})));
|
|
1295
|
-
export const ZRedactedThinkingBlockParam = z.lazy(() => (z.object({
|
|
1296
|
-
data: z.string(),
|
|
1297
|
-
type: z.literal("redacted_thinking"),
|
|
1298
776
|
})));
|
|
1299
|
-
export const
|
|
1300
|
-
|
|
1301
|
-
input: z.
|
|
777
|
+
export const ZResponseCustomToolCallParam = z.lazy(() => (z.object({
|
|
778
|
+
call_id: z.string(),
|
|
779
|
+
input: z.string(),
|
|
1302
780
|
name: z.string(),
|
|
1303
|
-
type: z.literal("
|
|
1304
|
-
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1305
|
-
})));
|
|
1306
|
-
export const ZToolResultBlockParam = z.lazy(() => (z.object({
|
|
1307
|
-
tool_use_id: z.string(),
|
|
1308
|
-
type: z.literal("tool_result"),
|
|
1309
|
-
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1310
|
-
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam]))]),
|
|
1311
|
-
is_error: z.boolean(),
|
|
1312
|
-
})));
|
|
1313
|
-
export const ZServerToolUseBlockParam = z.lazy(() => (z.object({
|
|
1314
|
-
id: z.string(),
|
|
1315
|
-
input: z.object({}).passthrough(),
|
|
1316
|
-
name: z.literal("web_search"),
|
|
1317
|
-
type: z.literal("server_tool_use"),
|
|
1318
|
-
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1319
|
-
})));
|
|
1320
|
-
export const ZWebSearchToolResultBlockParam = z.lazy(() => (z.object({
|
|
1321
|
-
content: z.union([z.array(ZWebSearchResultBlockParam), ZWebSearchToolRequestErrorParam]),
|
|
1322
|
-
tool_use_id: z.string(),
|
|
1323
|
-
type: z.literal("web_search_tool_result"),
|
|
1324
|
-
cache_control: ZCacheControlEphemeralParam.nullable().optional(),
|
|
1325
|
-
})));
|
|
1326
|
-
export const ZTextBlock = z.lazy(() => (z.object({
|
|
1327
|
-
citations: z.array(z.union([ZCitationCharLocation, ZCitationPageLocation, ZCitationContentBlockLocation, ZCitationsWebSearchResultLocation])).nullable().optional(),
|
|
1328
|
-
text: z.string(),
|
|
1329
|
-
type: z.literal("text"),
|
|
1330
|
-
})));
|
|
1331
|
-
export const ZThinkingBlock = z.lazy(() => (z.object({
|
|
1332
|
-
signature: z.string(),
|
|
1333
|
-
thinking: z.string(),
|
|
1334
|
-
type: z.literal("thinking"),
|
|
1335
|
-
})));
|
|
1336
|
-
export const ZRedactedThinkingBlock = z.lazy(() => (z.object({
|
|
1337
|
-
data: z.string(),
|
|
1338
|
-
type: z.literal("redacted_thinking"),
|
|
1339
|
-
})));
|
|
1340
|
-
export const ZToolUseBlock = z.lazy(() => (z.object({
|
|
781
|
+
type: z.literal("custom_tool_call"),
|
|
1341
782
|
id: z.string(),
|
|
1342
|
-
input: z.object({}).passthrough(),
|
|
1343
|
-
name: z.string(),
|
|
1344
|
-
type: z.literal("tool_use"),
|
|
1345
783
|
})));
|
|
1346
|
-
export const
|
|
784
|
+
export const ZItemReference = z.lazy(() => (z.object({
|
|
1347
785
|
id: z.string(),
|
|
1348
|
-
|
|
1349
|
-
name: z.literal("web_search"),
|
|
1350
|
-
type: z.literal("server_tool_use"),
|
|
1351
|
-
})));
|
|
1352
|
-
export const ZWebSearchToolResultBlock = z.lazy(() => (z.object({
|
|
1353
|
-
content: z.union([ZWebSearchToolResultError, z.array(ZWebSearchResultBlock)]),
|
|
1354
|
-
tool_use_id: z.string(),
|
|
1355
|
-
type: z.literal("web_search_tool_result"),
|
|
1356
|
-
})));
|
|
1357
|
-
export const ZChoiceLogprobs = z.lazy(() => (z.object({
|
|
1358
|
-
content: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
1359
|
-
refusal: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
1360
|
-
})));
|
|
1361
|
-
export const ZChoiceDeltaFunctionCall = z.lazy(() => (z.object({
|
|
1362
|
-
arguments: z.string().nullable().optional(),
|
|
1363
|
-
name: z.string().nullable().optional(),
|
|
1364
|
-
})));
|
|
1365
|
-
export const ZChoiceDeltaToolCall = z.lazy(() => (z.object({
|
|
1366
|
-
index: z.number(),
|
|
1367
|
-
id: z.string().nullable().optional(),
|
|
1368
|
-
function: ZChoiceDeltaToolCallFunction.nullable().optional(),
|
|
1369
|
-
type: z.literal("function").nullable().optional(),
|
|
1370
|
-
})));
|
|
1371
|
-
export const ZChatCompletionDeveloperMessageParam = z.lazy(() => (z.object({
|
|
1372
|
-
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
1373
|
-
role: z.literal("developer"),
|
|
1374
|
-
name: z.string(),
|
|
1375
|
-
})));
|
|
1376
|
-
export const ZChatCompletionSystemMessageParam = z.lazy(() => (z.object({
|
|
1377
|
-
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
1378
|
-
role: z.literal("system"),
|
|
1379
|
-
name: z.string(),
|
|
1380
|
-
})));
|
|
1381
|
-
export const ZChatCompletionUserMessageParam = z.lazy(() => (z.object({
|
|
1382
|
-
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartImageParam, ZChatCompletionContentPartInputAudioParam, ZFile]))]),
|
|
1383
|
-
role: z.literal("user"),
|
|
1384
|
-
name: z.string(),
|
|
1385
|
-
})));
|
|
1386
|
-
export const ZChatCompletionAssistantMessageParam = z.lazy(() => (z.object({
|
|
1387
|
-
role: z.literal("assistant"),
|
|
1388
|
-
audio: ZAudio.nullable().optional(),
|
|
1389
|
-
content: z.union([z.string(), z.array(z.union([ZChatCompletionContentPartTextParam, ZChatCompletionContentPartRefusalParam]))]).nullable().optional(),
|
|
1390
|
-
function_call: ZFunctionCall.nullable().optional(),
|
|
1391
|
-
name: z.string(),
|
|
1392
|
-
refusal: z.string().nullable().optional(),
|
|
1393
|
-
tool_calls: z.array(ZChatCompletionMessageToolCallParam),
|
|
1394
|
-
})));
|
|
1395
|
-
export const ZChatCompletionToolMessageParam = z.lazy(() => (z.object({
|
|
1396
|
-
content: z.union([z.string(), z.array(ZChatCompletionContentPartTextParam)]),
|
|
1397
|
-
role: z.literal("tool"),
|
|
1398
|
-
tool_call_id: z.string(),
|
|
1399
|
-
})));
|
|
1400
|
-
export const ZChatCompletionFunctionMessageParam = z.lazy(() => (z.object({
|
|
1401
|
-
content: z.string().nullable().optional(),
|
|
1402
|
-
name: z.string(),
|
|
1403
|
-
role: z.literal("function"),
|
|
1404
|
-
})));
|
|
1405
|
-
export const ZUsage = z.lazy(() => (z.object({
|
|
1406
|
-
cache_creation_input_tokens: z.number().nullable().optional(),
|
|
1407
|
-
cache_read_input_tokens: z.number().nullable().optional(),
|
|
1408
|
-
input_tokens: z.number(),
|
|
1409
|
-
output_tokens: z.number(),
|
|
1410
|
-
server_tool_use: ZServerToolUsage.nullable().optional(),
|
|
1411
|
-
service_tier: z.union([z.literal("standard"), z.literal("priority"), z.literal("batch")]).nullable().optional(),
|
|
786
|
+
type: z.literal("item_reference").nullable().optional(),
|
|
1412
787
|
})));
|
|
1413
788
|
export const ZParsedChatCompletionMessage = z.lazy(() => (ZChatCompletionMessage.schema).merge(z.object({
|
|
1414
789
|
tool_calls: z.array(ZParsedFunctionToolCall).nullable().optional(),
|
|
@@ -1487,6 +862,7 @@ export const ZResponseReasoningItem = z.lazy(() => (z.object({
|
|
|
1487
862
|
id: z.string(),
|
|
1488
863
|
summary: z.array(ZResponseReasoningItemSummary),
|
|
1489
864
|
type: z.literal("reasoning"),
|
|
865
|
+
content: z.array(ZResponseReasoningItemContent).nullable().optional(),
|
|
1490
866
|
encrypted_content: z.string().nullable().optional(),
|
|
1491
867
|
status: z.union([z.literal("in_progress"), z.literal("completed"), z.literal("incomplete")]).nullable().optional(),
|
|
1492
868
|
})));
|
|
@@ -1547,6 +923,19 @@ export const ZResponseInputItemMcpCall = z.lazy(() => (z.object({
|
|
|
1547
923
|
error: z.string().nullable().optional(),
|
|
1548
924
|
output: z.string().nullable().optional(),
|
|
1549
925
|
})));
|
|
926
|
+
export const ZResponseCustomToolCallOutput = z.lazy(() => (z.object({
|
|
927
|
+
call_id: z.string(),
|
|
928
|
+
output: z.string(),
|
|
929
|
+
type: z.literal("custom_tool_call_output"),
|
|
930
|
+
id: z.string().nullable().optional(),
|
|
931
|
+
})));
|
|
932
|
+
export const ZResponseCustomToolCall = z.lazy(() => (z.object({
|
|
933
|
+
call_id: z.string(),
|
|
934
|
+
input: z.string(),
|
|
935
|
+
name: z.string(),
|
|
936
|
+
type: z.literal("custom_tool_call"),
|
|
937
|
+
id: z.string().nullable().optional(),
|
|
938
|
+
})));
|
|
1550
939
|
export const ZResponseInputItemItemReference = z.lazy(() => (z.object({
|
|
1551
940
|
id: z.string(),
|
|
1552
941
|
type: z.literal("item_reference").nullable().optional(),
|
|
@@ -1587,6 +976,11 @@ export const ZResponseOutputItemMcpApprovalRequest = z.lazy(() => (z.object({
|
|
|
1587
976
|
server_label: z.string(),
|
|
1588
977
|
type: z.literal("mcp_approval_request"),
|
|
1589
978
|
})));
|
|
979
|
+
export const ZToolChoiceAllowed = z.lazy(() => (z.object({
|
|
980
|
+
mode: z.union([z.literal("auto"), z.literal("required")]),
|
|
981
|
+
tools: z.array(z.record(z.string(), z.object({}).passthrough())),
|
|
982
|
+
type: z.literal("allowed_tools"),
|
|
983
|
+
})));
|
|
1590
984
|
export const ZToolChoiceTypes = z.lazy(() => (z.object({
|
|
1591
985
|
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")]),
|
|
1592
986
|
})));
|
|
@@ -1599,6 +993,10 @@ export const ZToolChoiceMcp = z.lazy(() => (z.object({
|
|
|
1599
993
|
type: z.literal("mcp"),
|
|
1600
994
|
name: z.string().nullable().optional(),
|
|
1601
995
|
})));
|
|
996
|
+
export const ZToolChoiceCustom = z.lazy(() => (z.object({
|
|
997
|
+
name: z.string(),
|
|
998
|
+
type: z.literal("custom"),
|
|
999
|
+
})));
|
|
1602
1000
|
export const ZFunctionTool = z.lazy(() => (z.object({
|
|
1603
1001
|
name: z.string(),
|
|
1604
1002
|
parameters: z.record(z.string(), z.object({}).passthrough()).nullable().optional(),
|
|
@@ -1653,18 +1051,25 @@ export const ZImageGeneration = z.lazy(() => (z.object({
|
|
|
1653
1051
|
export const ZLocalShell = z.lazy(() => (z.object({
|
|
1654
1052
|
type: z.literal("local_shell"),
|
|
1655
1053
|
})));
|
|
1054
|
+
export const ZCustomTool = z.lazy(() => (z.object({
|
|
1055
|
+
name: z.string(),
|
|
1056
|
+
type: z.literal("custom"),
|
|
1057
|
+
description: z.string().nullable().optional(),
|
|
1058
|
+
format: z.union([ZText, ZGrammar]).nullable().optional(),
|
|
1059
|
+
})));
|
|
1656
1060
|
export const ZResponsePrompt = z.lazy(() => (z.object({
|
|
1657
1061
|
id: z.string(),
|
|
1658
1062
|
variables: z.record(z.string(), z.union([z.string(), ZResponseInputText, ZResponseInputImage, ZResponseInputFile])).nullable().optional(),
|
|
1659
1063
|
version: z.string().nullable().optional(),
|
|
1660
1064
|
})));
|
|
1661
|
-
export const
|
|
1662
|
-
effort: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
1065
|
+
export const ZReasoning = z.lazy(() => (z.object({
|
|
1066
|
+
effort: z.union([z.literal("minimal"), z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
1663
1067
|
generate_summary: z.union([z.literal("auto"), z.literal("concise"), z.literal("detailed")]).nullable().optional(),
|
|
1664
1068
|
summary: z.union([z.literal("auto"), z.literal("concise"), z.literal("detailed")]).nullable().optional(),
|
|
1665
1069
|
})));
|
|
1666
1070
|
export const ZResponseTextConfig = z.lazy(() => (z.object({
|
|
1667
|
-
format: z.union([
|
|
1071
|
+
format: z.union([ZResponseFormatText, ZResponseFormatTextJSONSchemaConfig, ZResponseFormatJSONObject]).nullable().optional(),
|
|
1072
|
+
verbosity: z.union([z.literal("low"), z.literal("medium"), z.literal("high")]).nullable().optional(),
|
|
1668
1073
|
})));
|
|
1669
1074
|
export const ZResponseUsage = z.lazy(() => (z.object({
|
|
1670
1075
|
input_tokens: z.number(),
|
|
@@ -1673,6 +1078,19 @@ export const ZResponseUsage = z.lazy(() => (z.object({
|
|
|
1673
1078
|
output_tokens_details: ZOutputTokensDetails,
|
|
1674
1079
|
total_tokens: z.number(),
|
|
1675
1080
|
})));
|
|
1081
|
+
export const ZImageURL = z.lazy(() => (z.object({
|
|
1082
|
+
url: z.string(),
|
|
1083
|
+
detail: z.union([z.literal("auto"), z.literal("low"), z.literal("high")]),
|
|
1084
|
+
})));
|
|
1085
|
+
export const ZInputAudio = z.lazy(() => (z.object({
|
|
1086
|
+
data: z.string(),
|
|
1087
|
+
format: z.union([z.literal("wav"), z.literal("mp3")]),
|
|
1088
|
+
})));
|
|
1089
|
+
export const ZFileFile = z.lazy(() => (z.object({
|
|
1090
|
+
file_data: z.string(),
|
|
1091
|
+
file_id: z.string(),
|
|
1092
|
+
filename: z.string(),
|
|
1093
|
+
})));
|
|
1676
1094
|
export const ZChatCompletionChoiceLogprobs = z.lazy(() => (z.object({
|
|
1677
1095
|
content: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
1678
1096
|
refusal: z.array(ZChatCompletionTokenLogprob).nullable().optional(),
|
|
@@ -1681,10 +1099,10 @@ export const ZChatCompletionMessage = z.lazy(() => (z.object({
|
|
|
1681
1099
|
content: z.string().nullable().optional(),
|
|
1682
1100
|
refusal: z.string().nullable().optional(),
|
|
1683
1101
|
role: z.literal("assistant"),
|
|
1684
|
-
annotations: z.array(
|
|
1102
|
+
annotations: z.array(ZAnnotation).nullable().optional(),
|
|
1685
1103
|
audio: ZChatCompletionAudio.nullable().optional(),
|
|
1686
1104
|
function_call: ZChatCompletionMessageFunctionCall.nullable().optional(),
|
|
1687
|
-
tool_calls: z.array(
|
|
1105
|
+
tool_calls: z.array(z.union([ZChatCompletionMessageFunctionToolCall, ZChatCompletionMessageCustomToolCall])).nullable().optional(),
|
|
1688
1106
|
})));
|
|
1689
1107
|
export const ZCompletionTokensDetails = z.lazy(() => (z.object({
|
|
1690
1108
|
accepted_prediction_tokens: z.number().nullable().optional(),
|
|
@@ -1696,18 +1114,36 @@ export const ZPromptTokensDetails = z.lazy(() => (z.object({
|
|
|
1696
1114
|
audio_tokens: z.number().nullable().optional(),
|
|
1697
1115
|
cached_tokens: z.number().nullable().optional(),
|
|
1698
1116
|
})));
|
|
1699
|
-
export const
|
|
1700
|
-
|
|
1701
|
-
|
|
1117
|
+
export const ZChatCompletionTokenLogprob = z.lazy(() => (z.object({
|
|
1118
|
+
token: z.string(),
|
|
1119
|
+
bytes: z.array(z.number()).nullable().optional(),
|
|
1120
|
+
logprob: z.number(),
|
|
1121
|
+
top_logprobs: z.array(ZTopLogprob),
|
|
1702
1122
|
})));
|
|
1703
|
-
export const
|
|
1704
|
-
|
|
1705
|
-
|
|
1123
|
+
export const ZChoiceDeltaToolCallFunction = z.lazy(() => (z.object({
|
|
1124
|
+
arguments: z.string().nullable().optional(),
|
|
1125
|
+
name: z.string().nullable().optional(),
|
|
1706
1126
|
})));
|
|
1707
|
-
export const
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1127
|
+
export const ZAudio = z.lazy(() => (z.object({
|
|
1128
|
+
id: z.string(),
|
|
1129
|
+
})));
|
|
1130
|
+
export const ZChatCompletionContentPartRefusalParam = z.lazy(() => (z.object({
|
|
1131
|
+
refusal: z.string(),
|
|
1132
|
+
type: z.literal("refusal"),
|
|
1133
|
+
})));
|
|
1134
|
+
export const ZFunctionCall = z.lazy(() => (z.object({
|
|
1135
|
+
arguments: z.string(),
|
|
1136
|
+
name: z.string(),
|
|
1137
|
+
})));
|
|
1138
|
+
export const ZChatCompletionMessageFunctionToolCallParam = z.lazy(() => (z.object({
|
|
1139
|
+
id: z.string(),
|
|
1140
|
+
function: ZFunction,
|
|
1141
|
+
type: z.literal("function"),
|
|
1142
|
+
})));
|
|
1143
|
+
export const ZChatCompletionMessageCustomToolCallParam = z.lazy(() => (z.object({
|
|
1144
|
+
id: z.string(),
|
|
1145
|
+
custom: ZCustom,
|
|
1146
|
+
type: z.literal("custom"),
|
|
1711
1147
|
})));
|
|
1712
1148
|
export const ZResponseInputTextParam = z.lazy(() => (z.object({
|
|
1713
1149
|
text: z.string(),
|
|
@@ -1816,6 +1252,10 @@ export const ZSummary = z.lazy(() => (z.object({
|
|
|
1816
1252
|
text: z.string(),
|
|
1817
1253
|
type: z.literal("summary_text"),
|
|
1818
1254
|
})));
|
|
1255
|
+
export const ZContent = z.lazy(() => (z.object({
|
|
1256
|
+
text: z.string(),
|
|
1257
|
+
type: z.literal("reasoning_text"),
|
|
1258
|
+
})));
|
|
1819
1259
|
export const ZOutputLogs = z.lazy(() => (z.object({
|
|
1820
1260
|
logs: z.string(),
|
|
1821
1261
|
type: z.literal("logs"),
|
|
@@ -1838,153 +1278,7 @@ export const ZMcpListToolsTool = z.lazy(() => (z.object({
|
|
|
1838
1278
|
annotations: z.object({}).passthrough().nullable().optional(),
|
|
1839
1279
|
description: z.string().nullable().optional(),
|
|
1840
1280
|
})));
|
|
1841
|
-
export const
|
|
1842
|
-
type: z.literal("ephemeral"),
|
|
1843
|
-
})));
|
|
1844
|
-
export const ZCitationCharLocationParam = z.lazy(() => (z.object({
|
|
1845
|
-
cited_text: z.string(),
|
|
1846
|
-
document_index: z.number(),
|
|
1847
|
-
document_title: z.string().nullable().optional(),
|
|
1848
|
-
end_char_index: z.number(),
|
|
1849
|
-
start_char_index: z.number(),
|
|
1850
|
-
type: z.literal("char_location"),
|
|
1851
|
-
})));
|
|
1852
|
-
export const ZCitationPageLocationParam = z.lazy(() => (z.object({
|
|
1853
|
-
cited_text: z.string(),
|
|
1854
|
-
document_index: z.number(),
|
|
1855
|
-
document_title: z.string().nullable().optional(),
|
|
1856
|
-
end_page_number: z.number(),
|
|
1857
|
-
start_page_number: z.number(),
|
|
1858
|
-
type: z.literal("page_location"),
|
|
1859
|
-
})));
|
|
1860
|
-
export const ZCitationContentBlockLocationParam = z.lazy(() => (z.object({
|
|
1861
|
-
cited_text: z.string(),
|
|
1862
|
-
document_index: z.number(),
|
|
1863
|
-
document_title: z.string().nullable().optional(),
|
|
1864
|
-
end_block_index: z.number(),
|
|
1865
|
-
start_block_index: z.number(),
|
|
1866
|
-
type: z.literal("content_block_location"),
|
|
1867
|
-
})));
|
|
1868
|
-
export const ZCitationWebSearchResultLocationParam = z.lazy(() => (z.object({
|
|
1869
|
-
cited_text: z.string(),
|
|
1870
|
-
encrypted_index: z.string(),
|
|
1871
|
-
title: z.string().nullable().optional(),
|
|
1872
|
-
type: z.literal("web_search_result_location"),
|
|
1873
|
-
url: z.string(),
|
|
1874
|
-
})));
|
|
1875
|
-
export const ZBase64ImageSourceParam = z.lazy(() => (z.object({
|
|
1876
|
-
data: z.union([z.string(), z.instanceof(Uint8Array), z.string()]),
|
|
1877
|
-
media_type: z.union([z.literal("image/jpeg"), z.literal("image/png"), z.literal("image/gif"), z.literal("image/webp")]),
|
|
1878
|
-
type: z.literal("base64"),
|
|
1879
|
-
})));
|
|
1880
|
-
export const ZURLImageSourceParam = z.lazy(() => (z.object({
|
|
1881
|
-
type: z.literal("url"),
|
|
1882
|
-
url: z.string(),
|
|
1883
|
-
})));
|
|
1884
|
-
export const ZBase64PDFSourceParam = z.lazy(() => (z.object({
|
|
1885
|
-
data: z.union([z.string(), z.instanceof(Uint8Array), z.string()]),
|
|
1886
|
-
media_type: z.literal("application/pdf"),
|
|
1887
|
-
type: z.literal("base64"),
|
|
1888
|
-
})));
|
|
1889
|
-
export const ZPlainTextSourceParam = z.lazy(() => (z.object({
|
|
1890
|
-
data: z.string(),
|
|
1891
|
-
media_type: z.literal("text/plain"),
|
|
1892
|
-
type: z.literal("text"),
|
|
1893
|
-
})));
|
|
1894
|
-
export const ZContentBlockSourceParam = z.lazy(() => (z.object({
|
|
1895
|
-
content: z.union([z.string(), z.array(z.union([ZTextBlockParam, ZImageBlockParam]))]),
|
|
1896
|
-
type: z.literal("content"),
|
|
1897
|
-
})));
|
|
1898
|
-
export const ZURLPDFSourceParam = z.lazy(() => (z.object({
|
|
1899
|
-
type: z.literal("url"),
|
|
1900
|
-
url: z.string(),
|
|
1901
|
-
})));
|
|
1902
|
-
export const ZCitationsConfigParam = z.lazy(() => (z.object({
|
|
1903
|
-
enabled: z.boolean(),
|
|
1904
|
-
})));
|
|
1905
|
-
export const ZWebSearchResultBlockParam = z.lazy(() => (z.object({
|
|
1906
|
-
encrypted_content: z.string(),
|
|
1907
|
-
title: z.string(),
|
|
1908
|
-
type: z.literal("web_search_result"),
|
|
1909
|
-
url: z.string(),
|
|
1910
|
-
page_age: z.string().nullable().optional(),
|
|
1911
|
-
})));
|
|
1912
|
-
export const ZWebSearchToolRequestErrorParam = z.lazy(() => (z.object({
|
|
1913
|
-
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")]),
|
|
1914
|
-
type: z.literal("web_search_tool_result_error"),
|
|
1915
|
-
})));
|
|
1916
|
-
export const ZCitationCharLocation = z.lazy(() => (z.object({
|
|
1917
|
-
cited_text: z.string(),
|
|
1918
|
-
document_index: z.number(),
|
|
1919
|
-
document_title: z.string().nullable().optional(),
|
|
1920
|
-
end_char_index: z.number(),
|
|
1921
|
-
start_char_index: z.number(),
|
|
1922
|
-
type: z.literal("char_location"),
|
|
1923
|
-
})));
|
|
1924
|
-
export const ZCitationPageLocation = z.lazy(() => (z.object({
|
|
1925
|
-
cited_text: z.string(),
|
|
1926
|
-
document_index: z.number(),
|
|
1927
|
-
document_title: z.string().nullable().optional(),
|
|
1928
|
-
end_page_number: z.number(),
|
|
1929
|
-
start_page_number: z.number(),
|
|
1930
|
-
type: z.literal("page_location"),
|
|
1931
|
-
})));
|
|
1932
|
-
export const ZCitationContentBlockLocation = z.lazy(() => (z.object({
|
|
1933
|
-
cited_text: z.string(),
|
|
1934
|
-
document_index: z.number(),
|
|
1935
|
-
document_title: z.string().nullable().optional(),
|
|
1936
|
-
end_block_index: z.number(),
|
|
1937
|
-
start_block_index: z.number(),
|
|
1938
|
-
type: z.literal("content_block_location"),
|
|
1939
|
-
})));
|
|
1940
|
-
export const ZCitationsWebSearchResultLocation = z.lazy(() => (z.object({
|
|
1941
|
-
cited_text: z.string(),
|
|
1942
|
-
encrypted_index: z.string(),
|
|
1943
|
-
title: z.string().nullable().optional(),
|
|
1944
|
-
type: z.literal("web_search_result_location"),
|
|
1945
|
-
url: z.string(),
|
|
1946
|
-
})));
|
|
1947
|
-
export const ZWebSearchToolResultError = z.lazy(() => (z.object({
|
|
1948
|
-
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")]),
|
|
1949
|
-
type: z.literal("web_search_tool_result_error"),
|
|
1950
|
-
})));
|
|
1951
|
-
export const ZWebSearchResultBlock = z.lazy(() => (z.object({
|
|
1952
|
-
encrypted_content: z.string(),
|
|
1953
|
-
page_age: z.string().nullable().optional(),
|
|
1954
|
-
title: z.string(),
|
|
1955
|
-
type: z.literal("web_search_result"),
|
|
1956
|
-
url: z.string(),
|
|
1957
|
-
})));
|
|
1958
|
-
export const ZChatCompletionTokenLogprob = z.lazy(() => (z.object({
|
|
1959
|
-
token: z.string(),
|
|
1960
|
-
bytes: z.array(z.number()).nullable().optional(),
|
|
1961
|
-
logprob: z.number(),
|
|
1962
|
-
top_logprobs: z.array(ZTopLogprob),
|
|
1963
|
-
})));
|
|
1964
|
-
export const ZChoiceDeltaToolCallFunction = z.lazy(() => (z.object({
|
|
1965
|
-
arguments: z.string().nullable().optional(),
|
|
1966
|
-
name: z.string().nullable().optional(),
|
|
1967
|
-
})));
|
|
1968
|
-
export const ZAudio = z.lazy(() => (z.object({
|
|
1969
|
-
id: z.string(),
|
|
1970
|
-
})));
|
|
1971
|
-
export const ZChatCompletionContentPartRefusalParam = z.lazy(() => (z.object({
|
|
1972
|
-
refusal: z.string(),
|
|
1973
|
-
type: z.literal("refusal"),
|
|
1974
|
-
})));
|
|
1975
|
-
export const ZFunctionCall = z.lazy(() => (z.object({
|
|
1976
|
-
arguments: z.string(),
|
|
1977
|
-
name: z.string(),
|
|
1978
|
-
})));
|
|
1979
|
-
export const ZChatCompletionMessageToolCallParam = z.lazy(() => (z.object({
|
|
1980
|
-
id: z.string(),
|
|
1981
|
-
function: ZFunction,
|
|
1982
|
-
type: z.literal("function"),
|
|
1983
|
-
})));
|
|
1984
|
-
export const ZServerToolUsage = z.lazy(() => (z.object({
|
|
1985
|
-
web_search_requests: z.number(),
|
|
1986
|
-
})));
|
|
1987
|
-
export const ZParsedFunctionToolCall = z.lazy(() => (ZChatCompletionMessageToolCall.schema).merge(z.object({
|
|
1281
|
+
export const ZParsedFunctionToolCall = z.lazy(() => (ZChatCompletionMessageFunctionToolCall.schema).merge(z.object({
|
|
1988
1282
|
function: ZParsedFunction,
|
|
1989
1283
|
})));
|
|
1990
1284
|
export const ZResponseInputText = z.lazy(() => (z.object({
|
|
@@ -2094,6 +1388,10 @@ export const ZResponseReasoningItemSummary = z.lazy(() => (z.object({
|
|
|
2094
1388
|
text: z.string(),
|
|
2095
1389
|
type: z.literal("summary_text"),
|
|
2096
1390
|
})));
|
|
1391
|
+
export const ZResponseReasoningItemContent = z.lazy(() => (z.object({
|
|
1392
|
+
text: z.string(),
|
|
1393
|
+
type: z.literal("reasoning_text"),
|
|
1394
|
+
})));
|
|
2097
1395
|
export const ZResponseCodeInterpreterToolCallOutputLogs = z.lazy(() => (z.object({
|
|
2098
1396
|
logs: z.string(),
|
|
2099
1397
|
type: z.literal("logs"),
|
|
@@ -2165,7 +1463,15 @@ export const ZImageGenerationInputImageMask = z.lazy(() => (z.object({
|
|
|
2165
1463
|
file_id: z.string().nullable().optional(),
|
|
2166
1464
|
image_url: z.string().nullable().optional(),
|
|
2167
1465
|
})));
|
|
2168
|
-
export const
|
|
1466
|
+
export const ZText = z.lazy(() => (z.object({
|
|
1467
|
+
type: z.literal("text"),
|
|
1468
|
+
})));
|
|
1469
|
+
export const ZGrammar = z.lazy(() => (z.object({
|
|
1470
|
+
definition: z.string(),
|
|
1471
|
+
syntax: z.union([z.literal("lark"), z.literal("regex")]),
|
|
1472
|
+
type: z.literal("grammar"),
|
|
1473
|
+
})));
|
|
1474
|
+
export const ZResponseFormatText = z.lazy(() => (z.object({
|
|
2169
1475
|
type: z.literal("text"),
|
|
2170
1476
|
})));
|
|
2171
1477
|
export const ZResponseFormatTextJSONSchemaConfig = z.lazy(() => (z.object({
|
|
@@ -2175,7 +1481,7 @@ export const ZResponseFormatTextJSONSchemaConfig = z.lazy(() => (z.object({
|
|
|
2175
1481
|
description: z.string().nullable().optional(),
|
|
2176
1482
|
strict: z.boolean().nullable().optional(),
|
|
2177
1483
|
})));
|
|
2178
|
-
export const
|
|
1484
|
+
export const ZResponseFormatJSONObject = z.lazy(() => (z.object({
|
|
2179
1485
|
type: z.literal("json_object"),
|
|
2180
1486
|
})));
|
|
2181
1487
|
export const ZInputTokensDetails = z.lazy(() => (z.object({
|
|
@@ -2184,7 +1490,7 @@ export const ZInputTokensDetails = z.lazy(() => (z.object({
|
|
|
2184
1490
|
export const ZOutputTokensDetails = z.lazy(() => (z.object({
|
|
2185
1491
|
reasoning_tokens: z.number(),
|
|
2186
1492
|
})));
|
|
2187
|
-
export const
|
|
1493
|
+
export const ZAnnotation = z.lazy(() => (z.object({
|
|
2188
1494
|
type: z.literal("url_citation"),
|
|
2189
1495
|
url_citation: ZChatCompletionMessageAnnotationURLCitation,
|
|
2190
1496
|
})));
|
|
@@ -2198,11 +1504,29 @@ export const ZChatCompletionMessageFunctionCall = z.lazy(() => (z.object({
|
|
|
2198
1504
|
arguments: z.string(),
|
|
2199
1505
|
name: z.string(),
|
|
2200
1506
|
})));
|
|
2201
|
-
export const
|
|
1507
|
+
export const ZChatCompletionMessageFunctionToolCall = z.lazy(() => (z.object({
|
|
2202
1508
|
id: z.string(),
|
|
2203
|
-
function:
|
|
1509
|
+
function: ZChatCompletionMessageFunctionToolCallFunction,
|
|
2204
1510
|
type: z.literal("function"),
|
|
2205
1511
|
})));
|
|
1512
|
+
export const ZChatCompletionMessageCustomToolCall = z.lazy(() => (z.object({
|
|
1513
|
+
id: z.string(),
|
|
1514
|
+
custom: ZChatCompletionMessageCustomToolCallCustom,
|
|
1515
|
+
type: z.literal("custom"),
|
|
1516
|
+
})));
|
|
1517
|
+
export const ZTopLogprob = z.lazy(() => (z.object({
|
|
1518
|
+
token: z.string(),
|
|
1519
|
+
bytes: z.array(z.number()).nullable().optional(),
|
|
1520
|
+
logprob: z.number(),
|
|
1521
|
+
})));
|
|
1522
|
+
export const ZFunction = z.lazy(() => (z.object({
|
|
1523
|
+
arguments: z.string(),
|
|
1524
|
+
name: z.string(),
|
|
1525
|
+
})));
|
|
1526
|
+
export const ZCustom = z.lazy(() => (z.object({
|
|
1527
|
+
input: z.string(),
|
|
1528
|
+
name: z.string(),
|
|
1529
|
+
})));
|
|
2206
1530
|
export const ZAnnotationFileCitation = z.lazy(() => (z.object({
|
|
2207
1531
|
file_id: z.string(),
|
|
2208
1532
|
filename: z.string(),
|
|
@@ -2239,16 +1563,7 @@ export const ZActionDragPath = z.lazy(() => (z.object({
|
|
|
2239
1563
|
x: z.number(),
|
|
2240
1564
|
y: z.number(),
|
|
2241
1565
|
})));
|
|
2242
|
-
export const
|
|
2243
|
-
token: z.string(),
|
|
2244
|
-
bytes: z.array(z.number()).nullable().optional(),
|
|
2245
|
-
logprob: z.number(),
|
|
2246
|
-
})));
|
|
2247
|
-
export const ZFunction = z.lazy(() => (z.object({
|
|
2248
|
-
arguments: z.string(),
|
|
2249
|
-
name: z.string(),
|
|
2250
|
-
})));
|
|
2251
|
-
export const ZParsedFunction = z.lazy(() => (ZChatCompletionMessageToolCallFunction.schema).merge(z.object({
|
|
1566
|
+
export const ZParsedFunction = z.lazy(() => (ZChatCompletionMessageFunctionToolCallFunction.schema).merge(z.object({
|
|
2252
1567
|
parsed_arguments: z.object({}).passthrough().nullable().optional(),
|
|
2253
1568
|
})));
|
|
2254
1569
|
export const ZResponseOutputTextAnnotationFileCitation = z.lazy(() => (z.object({
|
|
@@ -2299,10 +1614,14 @@ export const ZChatCompletionMessageAnnotationURLCitation = z.lazy(() => (z.objec
|
|
|
2299
1614
|
title: z.string(),
|
|
2300
1615
|
url: z.string(),
|
|
2301
1616
|
})));
|
|
2302
|
-
export const
|
|
1617
|
+
export const ZChatCompletionMessageFunctionToolCallFunction = z.lazy(() => (z.object({
|
|
2303
1618
|
arguments: z.string(),
|
|
2304
1619
|
name: z.string(),
|
|
2305
1620
|
})));
|
|
1621
|
+
export const ZChatCompletionMessageCustomToolCallCustom = z.lazy(() => (z.object({
|
|
1622
|
+
input: z.string(),
|
|
1623
|
+
name: z.string(),
|
|
1624
|
+
})));
|
|
2306
1625
|
export const ZLogprobTopLogprob = z.lazy(() => (z.object({
|
|
2307
1626
|
token: z.string(),
|
|
2308
1627
|
bytes: z.array(z.number()),
|
|
@@ -2313,3 +1632,14 @@ export const ZResponseOutputTextLogprobTopLogprob = z.lazy(() => (z.object({
|
|
|
2313
1632
|
bytes: z.array(z.number()),
|
|
2314
1633
|
logprob: z.number(),
|
|
2315
1634
|
})));
|
|
1635
|
+
export const ZPartialSchema = z.lazy(() => (z.object({
|
|
1636
|
+
object: z.literal("schema").default("schema"),
|
|
1637
|
+
created_at: z.string(),
|
|
1638
|
+
json_schema: z.record(z.string(), z.any()).default({}),
|
|
1639
|
+
strict: z.boolean().default(true),
|
|
1640
|
+
})));
|
|
1641
|
+
export const ZSchema = z.lazy(() => (ZPartialSchema.schema).merge(z.object({
|
|
1642
|
+
object: z.literal("schema").default("schema"),
|
|
1643
|
+
created_at: z.string(),
|
|
1644
|
+
json_schema: z.record(z.string(), z.any()).default({}),
|
|
1645
|
+
})));
|