@mastra/openai 1.0.1-alpha.8 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +126 -0
- package/LICENSE.md +30 -0
- package/README.md +92 -0
- package/dist/docs/SKILL.md +23 -0
- package/dist/docs/assets/SOURCE_MAP.json +6 -0
- package/dist/docs/references/docs-agents-sdk-agents.md +425 -0
- package/dist/docs/references/docs-memory-memory-processors.md +314 -0
- package/dist/index.cjs +1177 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1175 -0
- package/dist/index.js.map +1 -0
- package/dist/utils.d.ts +147 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +58 -52
- package/src/Openai.test.ts +0 -61
- package/src/assets/openai.png +0 -0
- package/src/client/index.ts +0 -4
- package/src/client/schemas.gen.ts +0 -9928
- package/src/client/service-comments.ts +0 -390
- package/src/client/services.gen.ts +0 -1481
- package/src/client/types.gen.ts +0 -7500
- package/src/client/zodSchema.ts +0 -3898
- package/src/index.ts +0 -59
package/src/client/zodSchema.ts
DELETED
|
@@ -1,3898 +0,0 @@
|
|
|
1
|
-
// Generated by ts-to-zod
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const assistantToolsCodeSchema = z.object({
|
|
5
|
-
type: z.literal('code_interpreter'),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const assistantToolsFileSearchSchema = z.object({
|
|
9
|
-
type: z.literal('file_search'),
|
|
10
|
-
file_search: z
|
|
11
|
-
.object({
|
|
12
|
-
max_num_results: z.number().optional(),
|
|
13
|
-
})
|
|
14
|
-
.optional(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const openAiObjectSchema = z.literal('assistant');
|
|
18
|
-
|
|
19
|
-
export const responseFormatTextSchema = z.object({
|
|
20
|
-
type: z.literal('text'),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const responseFormatJsonObjectSchema = z.object({
|
|
24
|
-
type: z.literal('json_object'),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const assistantsNamedToolChoiceSchema = z.object({
|
|
28
|
-
type: z.union([z.literal('function'), z.literal('code_interpreter'), z.literal('file_search')]),
|
|
29
|
-
function: z
|
|
30
|
-
.object({
|
|
31
|
-
name: z.string(),
|
|
32
|
-
})
|
|
33
|
-
.optional(),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export const typeSchema = z.union([z.literal('function'), z.literal('code_interpreter'), z.literal('file_search')]);
|
|
37
|
-
|
|
38
|
-
export const doneEventSchema = z.object({
|
|
39
|
-
event: z.literal('done'),
|
|
40
|
-
data: z.literal('[DONE]'),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export const type2Schema = z.literal('code_interpreter');
|
|
44
|
-
|
|
45
|
-
export const type3Schema = z.literal('file_search');
|
|
46
|
-
|
|
47
|
-
export const assistantToolsFileSearchTypeOnlySchema = z.object({
|
|
48
|
-
type: z.literal('file_search'),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const type4Schema = z.literal('function');
|
|
52
|
-
|
|
53
|
-
export const auditLogEventTypeSchema = z.union([
|
|
54
|
-
z.literal('api_key.created'),
|
|
55
|
-
z.literal('api_key.updated'),
|
|
56
|
-
z.literal('api_key.deleted'),
|
|
57
|
-
z.literal('invite.sent'),
|
|
58
|
-
z.literal('invite.accepted'),
|
|
59
|
-
z.literal('invite.deleted'),
|
|
60
|
-
z.literal('login.succeeded'),
|
|
61
|
-
z.literal('login.failed'),
|
|
62
|
-
z.literal('logout.succeeded'),
|
|
63
|
-
z.literal('logout.failed'),
|
|
64
|
-
z.literal('organization.updated'),
|
|
65
|
-
z.literal('project.created'),
|
|
66
|
-
z.literal('project.updated'),
|
|
67
|
-
z.literal('project.archived'),
|
|
68
|
-
z.literal('service_account.created'),
|
|
69
|
-
z.literal('service_account.updated'),
|
|
70
|
-
z.literal('service_account.deleted'),
|
|
71
|
-
z.literal('user.added'),
|
|
72
|
-
z.literal('user.updated'),
|
|
73
|
-
z.literal('user.deleted'),
|
|
74
|
-
]);
|
|
75
|
-
|
|
76
|
-
export const type5Schema = z.union([z.literal('session'), z.literal('api_key')]);
|
|
77
|
-
|
|
78
|
-
export const auditLogActorUserSchema = z.object({
|
|
79
|
-
id: z.string().optional(),
|
|
80
|
-
email: z.string().optional(),
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
export const auditLogActorServiceAccountSchema = z.object({
|
|
84
|
-
id: z.string().optional(),
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
export const type6Schema = z.union([z.literal('user'), z.literal('service_account')]);
|
|
88
|
-
|
|
89
|
-
export const auditLogActorSessionSchema = z.object({
|
|
90
|
-
user: auditLogActorUserSchema.optional(),
|
|
91
|
-
ip_address: z.string().optional(),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
export const autoChunkingStrategyRequestParamSchema = z.object({
|
|
95
|
-
type: z.literal('auto'),
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
export const type7Schema = z.literal('auto');
|
|
99
|
-
|
|
100
|
-
export const batchSchema = z.object({
|
|
101
|
-
id: z.string(),
|
|
102
|
-
object: z.literal('batch'),
|
|
103
|
-
endpoint: z.string(),
|
|
104
|
-
errors: z
|
|
105
|
-
.object({
|
|
106
|
-
object: z.string().optional(),
|
|
107
|
-
data: z
|
|
108
|
-
.array(
|
|
109
|
-
z.object({
|
|
110
|
-
code: z.string().optional(),
|
|
111
|
-
message: z.string().optional(),
|
|
112
|
-
param: z.string().optional().nullable(),
|
|
113
|
-
line: z.number().optional().nullable(),
|
|
114
|
-
}),
|
|
115
|
-
)
|
|
116
|
-
.optional(),
|
|
117
|
-
})
|
|
118
|
-
.optional(),
|
|
119
|
-
input_file_id: z.string(),
|
|
120
|
-
completion_window: z.string(),
|
|
121
|
-
status: z.union([
|
|
122
|
-
z.literal('validating'),
|
|
123
|
-
z.literal('failed'),
|
|
124
|
-
z.literal('in_progress'),
|
|
125
|
-
z.literal('finalizing'),
|
|
126
|
-
z.literal('completed'),
|
|
127
|
-
z.literal('expired'),
|
|
128
|
-
z.literal('cancelling'),
|
|
129
|
-
z.literal('cancelled'),
|
|
130
|
-
]),
|
|
131
|
-
output_file_id: z.string().optional(),
|
|
132
|
-
error_file_id: z.string().optional(),
|
|
133
|
-
created_at: z.number(),
|
|
134
|
-
in_progress_at: z.number().optional(),
|
|
135
|
-
expires_at: z.number().optional(),
|
|
136
|
-
finalizing_at: z.number().optional(),
|
|
137
|
-
completed_at: z.number().optional(),
|
|
138
|
-
failed_at: z.number().optional(),
|
|
139
|
-
expired_at: z.number().optional(),
|
|
140
|
-
cancelling_at: z.number().optional(),
|
|
141
|
-
cancelled_at: z.number().optional(),
|
|
142
|
-
request_counts: z
|
|
143
|
-
.object({
|
|
144
|
-
total: z.number(),
|
|
145
|
-
completed: z.number(),
|
|
146
|
-
failed: z.number(),
|
|
147
|
-
})
|
|
148
|
-
.optional(),
|
|
149
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
export const object2Schema = z.literal('batch');
|
|
153
|
-
|
|
154
|
-
export const statusSchema = z.union([
|
|
155
|
-
z.literal('validating'),
|
|
156
|
-
z.literal('failed'),
|
|
157
|
-
z.literal('in_progress'),
|
|
158
|
-
z.literal('finalizing'),
|
|
159
|
-
z.literal('completed'),
|
|
160
|
-
z.literal('expired'),
|
|
161
|
-
z.literal('cancelling'),
|
|
162
|
-
z.literal('cancelled'),
|
|
163
|
-
]);
|
|
164
|
-
|
|
165
|
-
export const batchRequestInputSchema = z.object({
|
|
166
|
-
custom_id: z.string().optional(),
|
|
167
|
-
method: z.literal('POST').optional(),
|
|
168
|
-
url: z.string().optional(),
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
export const methodSchema = z.literal('POST');
|
|
172
|
-
|
|
173
|
-
export const batchRequestOutputSchema = z.object({
|
|
174
|
-
id: z.string().optional(),
|
|
175
|
-
custom_id: z.string().optional(),
|
|
176
|
-
response: z
|
|
177
|
-
.object({
|
|
178
|
-
status_code: z.number().optional(),
|
|
179
|
-
request_id: z.string().optional(),
|
|
180
|
-
body: z.record(z.unknown()).optional(),
|
|
181
|
-
})
|
|
182
|
-
.optional()
|
|
183
|
-
.nullable(),
|
|
184
|
-
error: z
|
|
185
|
-
.object({
|
|
186
|
-
code: z.string().optional(),
|
|
187
|
-
message: z.string().optional(),
|
|
188
|
-
})
|
|
189
|
-
.optional()
|
|
190
|
-
.nullable(),
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
export const cancelUploadRequestSchema = z.record(z.unknown());
|
|
194
|
-
|
|
195
|
-
export const chatCompletionFunctionCallOptionSchema = z.object({
|
|
196
|
-
name: z.string(),
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
export const functionParametersSchema = z.record(z.unknown());
|
|
200
|
-
|
|
201
|
-
export const chatCompletionMessageToolCallSchema = z.object({
|
|
202
|
-
id: z.string(),
|
|
203
|
-
type: z.literal('function'),
|
|
204
|
-
function: z.object({
|
|
205
|
-
name: z.string(),
|
|
206
|
-
arguments: z.string(),
|
|
207
|
-
}),
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
export const chatCompletionMessageToolCallChunkSchema = z.object({
|
|
211
|
-
index: z.number(),
|
|
212
|
-
id: z.string().optional(),
|
|
213
|
-
type: z.literal('function').optional(),
|
|
214
|
-
function: z
|
|
215
|
-
.object({
|
|
216
|
-
name: z.string().optional(),
|
|
217
|
-
arguments: z.string().optional(),
|
|
218
|
-
})
|
|
219
|
-
.optional(),
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
export const chatCompletionMessageToolCallsSchema = z.array(chatCompletionMessageToolCallSchema);
|
|
223
|
-
|
|
224
|
-
export const chatCompletionNamedToolChoiceSchema = z.object({
|
|
225
|
-
type: z.literal('function'),
|
|
226
|
-
function: z.object({
|
|
227
|
-
name: z.string(),
|
|
228
|
-
}),
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
export const roleSchema = z.literal('assistant');
|
|
232
|
-
|
|
233
|
-
export const chatCompletionRequestMessageContentPartTextSchema = z.object({
|
|
234
|
-
type: z.literal('text'),
|
|
235
|
-
text: z.string(),
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
export const chatCompletionRequestMessageContentPartRefusalSchema = z.object({
|
|
239
|
-
type: z.literal('refusal'),
|
|
240
|
-
refusal: z.string(),
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
export const chatCompletionRequestFunctionMessageSchema = z.object({
|
|
244
|
-
role: z.literal('function'),
|
|
245
|
-
content: z.string().nullable(),
|
|
246
|
-
name: z.string(),
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
export const role2Schema = z.literal('function');
|
|
250
|
-
|
|
251
|
-
export const chatCompletionRequestMessageContentPartImageSchema = z.object({
|
|
252
|
-
type: z.literal('image_url'),
|
|
253
|
-
image_url: z.object({
|
|
254
|
-
url: z.string(),
|
|
255
|
-
detail: z.union([z.literal('auto'), z.literal('low'), z.literal('high')]).optional(),
|
|
256
|
-
}),
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
export const type8Schema = z.literal('image_url');
|
|
260
|
-
|
|
261
|
-
export const detailSchema = z.union([z.literal('auto'), z.literal('low'), z.literal('high')]);
|
|
262
|
-
|
|
263
|
-
export const type9Schema = z.literal('refusal');
|
|
264
|
-
|
|
265
|
-
export const type10Schema = z.literal('text');
|
|
266
|
-
|
|
267
|
-
export const chatCompletionRequestSystemMessageContentPartSchema = chatCompletionRequestMessageContentPartTextSchema;
|
|
268
|
-
|
|
269
|
-
export const role3Schema = z.literal('system');
|
|
270
|
-
|
|
271
|
-
export const chatCompletionRequestToolMessageContentPartSchema = chatCompletionRequestMessageContentPartTextSchema;
|
|
272
|
-
|
|
273
|
-
export const role4Schema = z.literal('tool');
|
|
274
|
-
|
|
275
|
-
export const chatCompletionRequestUserMessageContentPartSchema = z.union([
|
|
276
|
-
chatCompletionRequestMessageContentPartTextSchema,
|
|
277
|
-
chatCompletionRequestMessageContentPartImageSchema,
|
|
278
|
-
]);
|
|
279
|
-
|
|
280
|
-
export const role5Schema = z.literal('user');
|
|
281
|
-
|
|
282
|
-
export const chatCompletionResponseMessageSchema = z.object({
|
|
283
|
-
content: z.string().nullable(),
|
|
284
|
-
refusal: z.string().nullable(),
|
|
285
|
-
tool_calls: chatCompletionMessageToolCallsSchema.optional(),
|
|
286
|
-
role: z.literal('assistant'),
|
|
287
|
-
function_call: z
|
|
288
|
-
.object({
|
|
289
|
-
arguments: z.string(),
|
|
290
|
-
name: z.string(),
|
|
291
|
-
})
|
|
292
|
-
.optional(),
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
export const chatCompletionRoleSchema = z.union([
|
|
296
|
-
z.literal('system'),
|
|
297
|
-
z.literal('user'),
|
|
298
|
-
z.literal('assistant'),
|
|
299
|
-
z.literal('tool'),
|
|
300
|
-
z.literal('function'),
|
|
301
|
-
]);
|
|
302
|
-
|
|
303
|
-
export const chatCompletionStreamOptionsSchema = z
|
|
304
|
-
.object({
|
|
305
|
-
include_usage: z.boolean().optional(),
|
|
306
|
-
})
|
|
307
|
-
.nullable();
|
|
308
|
-
|
|
309
|
-
export const chatCompletionStreamResponseDeltaSchema = z.object({
|
|
310
|
-
content: z.string().optional().nullable(),
|
|
311
|
-
function_call: z
|
|
312
|
-
.object({
|
|
313
|
-
arguments: z.string().optional(),
|
|
314
|
-
name: z.string().optional(),
|
|
315
|
-
})
|
|
316
|
-
.optional(),
|
|
317
|
-
tool_calls: z.array(chatCompletionMessageToolCallChunkSchema).optional(),
|
|
318
|
-
role: z.union([z.literal('system'), z.literal('user'), z.literal('assistant'), z.literal('tool')]).optional(),
|
|
319
|
-
refusal: z.string().optional().nullable(),
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
export const role6Schema = z.union([z.literal('system'), z.literal('user'), z.literal('assistant'), z.literal('tool')]);
|
|
323
|
-
|
|
324
|
-
export const chatCompletionTokenLogprobSchema = z.object({
|
|
325
|
-
token: z.string(),
|
|
326
|
-
logprob: z.number(),
|
|
327
|
-
bytes: z.array(z.number()).nullable(),
|
|
328
|
-
top_logprobs: z.array(
|
|
329
|
-
z.object({
|
|
330
|
-
token: z.string(),
|
|
331
|
-
logprob: z.number(),
|
|
332
|
-
bytes: z.array(z.number()).nullable(),
|
|
333
|
-
}),
|
|
334
|
-
),
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
export const functionObjectSchema = z.object({
|
|
338
|
-
description: z.string().optional(),
|
|
339
|
-
name: z.string(),
|
|
340
|
-
parameters: functionParametersSchema.optional(),
|
|
341
|
-
strict: z.boolean().optional().nullable(),
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
export const chatCompletionToolChoiceOptionSchema = z.union([
|
|
345
|
-
z.literal('none'),
|
|
346
|
-
z.literal('auto'),
|
|
347
|
-
z.literal('required'),
|
|
348
|
-
chatCompletionNamedToolChoiceSchema,
|
|
349
|
-
]);
|
|
350
|
-
|
|
351
|
-
export const completeUploadRequestSchema = z.object({
|
|
352
|
-
part_ids: z.array(z.string()),
|
|
353
|
-
md5: z.string().optional(),
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
export const completionUsageSchema = z.object({
|
|
357
|
-
completion_tokens: z.number(),
|
|
358
|
-
prompt_tokens: z.number(),
|
|
359
|
-
total_tokens: z.number(),
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
export const assistantToolsFunctionSchema = z.object({
|
|
363
|
-
type: z.literal('function'),
|
|
364
|
-
function: functionObjectSchema,
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
export const createChatCompletionFunctionResponseSchema = z.object({
|
|
368
|
-
id: z.string(),
|
|
369
|
-
choices: z.array(
|
|
370
|
-
z.object({
|
|
371
|
-
finish_reason: z.union([
|
|
372
|
-
z.literal('stop'),
|
|
373
|
-
z.literal('length'),
|
|
374
|
-
z.literal('function_call'),
|
|
375
|
-
z.literal('content_filter'),
|
|
376
|
-
]),
|
|
377
|
-
index: z.number(),
|
|
378
|
-
message: chatCompletionResponseMessageSchema,
|
|
379
|
-
}),
|
|
380
|
-
),
|
|
381
|
-
created: z.number(),
|
|
382
|
-
model: z.string(),
|
|
383
|
-
system_fingerprint: z.string().optional(),
|
|
384
|
-
object: z.literal('chat.completion'),
|
|
385
|
-
usage: completionUsageSchema.optional(),
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
export const object3Schema = z.literal('chat.completion');
|
|
389
|
-
|
|
390
|
-
export const createChatCompletionImageResponseSchema = z.record(z.unknown());
|
|
391
|
-
|
|
392
|
-
export const chatCompletionToolSchema = z.object({
|
|
393
|
-
type: z.literal('function'),
|
|
394
|
-
function: functionObjectSchema,
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
export const parallelToolCallsSchema = z.boolean().nullable();
|
|
398
|
-
|
|
399
|
-
export const chatCompletionFunctionsSchema = z.object({
|
|
400
|
-
description: z.string().optional(),
|
|
401
|
-
name: z.string(),
|
|
402
|
-
parameters: functionParametersSchema.optional(),
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
export const serviceTierSchema = z.union([z.literal('auto'), z.literal('default')]);
|
|
406
|
-
|
|
407
|
-
export const createChatCompletionResponseSchema = z.object({
|
|
408
|
-
id: z.string(),
|
|
409
|
-
choices: z.array(
|
|
410
|
-
z.object({
|
|
411
|
-
finish_reason: z.union([
|
|
412
|
-
z.literal('stop'),
|
|
413
|
-
z.literal('length'),
|
|
414
|
-
z.literal('tool_calls'),
|
|
415
|
-
z.literal('content_filter'),
|
|
416
|
-
z.literal('function_call'),
|
|
417
|
-
]),
|
|
418
|
-
index: z.number(),
|
|
419
|
-
message: chatCompletionResponseMessageSchema,
|
|
420
|
-
logprobs: z
|
|
421
|
-
.object({
|
|
422
|
-
content: z.array(chatCompletionTokenLogprobSchema).nullable(),
|
|
423
|
-
refusal: z.array(chatCompletionTokenLogprobSchema).nullable(),
|
|
424
|
-
})
|
|
425
|
-
.optional()
|
|
426
|
-
.nullable(),
|
|
427
|
-
}),
|
|
428
|
-
),
|
|
429
|
-
created: z.number(),
|
|
430
|
-
model: z.string(),
|
|
431
|
-
service_tier: z
|
|
432
|
-
.union([z.literal('scale'), z.literal('default')])
|
|
433
|
-
.optional()
|
|
434
|
-
.nullable(),
|
|
435
|
-
system_fingerprint: z.string().optional(),
|
|
436
|
-
object: z.literal('chat.completion'),
|
|
437
|
-
usage: completionUsageSchema.optional(),
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
export const serviceTier2Schema = z.union([z.literal('scale'), z.literal('default')]);
|
|
441
|
-
|
|
442
|
-
export const createChatCompletionStreamResponseSchema = z.object({
|
|
443
|
-
id: z.string(),
|
|
444
|
-
choices: z.array(
|
|
445
|
-
z.object({
|
|
446
|
-
delta: chatCompletionStreamResponseDeltaSchema,
|
|
447
|
-
logprobs: z
|
|
448
|
-
.object({
|
|
449
|
-
content: z.array(chatCompletionTokenLogprobSchema).nullable(),
|
|
450
|
-
refusal: z.array(chatCompletionTokenLogprobSchema).nullable(),
|
|
451
|
-
})
|
|
452
|
-
.optional()
|
|
453
|
-
.nullable(),
|
|
454
|
-
finish_reason: z
|
|
455
|
-
.union([
|
|
456
|
-
z.literal('stop'),
|
|
457
|
-
z.literal('length'),
|
|
458
|
-
z.literal('tool_calls'),
|
|
459
|
-
z.literal('content_filter'),
|
|
460
|
-
z.literal('function_call'),
|
|
461
|
-
])
|
|
462
|
-
.nullable(),
|
|
463
|
-
index: z.number(),
|
|
464
|
-
}),
|
|
465
|
-
),
|
|
466
|
-
created: z.number(),
|
|
467
|
-
model: z.string(),
|
|
468
|
-
service_tier: z
|
|
469
|
-
.union([z.literal('scale'), z.literal('default')])
|
|
470
|
-
.optional()
|
|
471
|
-
.nullable(),
|
|
472
|
-
system_fingerprint: z.string().optional(),
|
|
473
|
-
object: z.literal('chat.completion.chunk'),
|
|
474
|
-
usage: z
|
|
475
|
-
.object({
|
|
476
|
-
completion_tokens: z.number(),
|
|
477
|
-
prompt_tokens: z.number(),
|
|
478
|
-
total_tokens: z.number(),
|
|
479
|
-
})
|
|
480
|
-
.optional(),
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
export const object4Schema = z.literal('chat.completion.chunk');
|
|
484
|
-
|
|
485
|
-
export const createCompletionRequestSchema = z.object({
|
|
486
|
-
model: z.union([z.string(), z.literal('gpt-3.5-turbo-instruct'), z.literal('davinci-002'), z.literal('babbage-002')]),
|
|
487
|
-
prompt: z.union([z.string(), z.array(z.string()), z.array(z.number()), z.array(z.array(z.number()))]).nullable(),
|
|
488
|
-
best_of: z.number().optional().nullable(),
|
|
489
|
-
echo: z.boolean().optional().nullable(),
|
|
490
|
-
frequency_penalty: z.number().optional().nullable(),
|
|
491
|
-
logit_bias: z.record(z.number()).optional().nullable(),
|
|
492
|
-
logprobs: z.number().optional().nullable(),
|
|
493
|
-
max_tokens: z.number().optional().nullable(),
|
|
494
|
-
n: z.number().optional().nullable(),
|
|
495
|
-
presence_penalty: z.number().optional().nullable(),
|
|
496
|
-
seed: z.number().optional().nullable(),
|
|
497
|
-
stop: z
|
|
498
|
-
.union([z.string(), z.array(z.string())])
|
|
499
|
-
.optional()
|
|
500
|
-
.nullable(),
|
|
501
|
-
stream: z.boolean().optional().nullable(),
|
|
502
|
-
stream_options: chatCompletionStreamOptionsSchema.optional(),
|
|
503
|
-
suffix: z.string().optional().nullable(),
|
|
504
|
-
temperature: z.number().optional().nullable(),
|
|
505
|
-
top_p: z.number().optional().nullable(),
|
|
506
|
-
user: z.string().optional(),
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
export const createCompletionResponseSchema = z.object({
|
|
510
|
-
id: z.string(),
|
|
511
|
-
choices: z.array(
|
|
512
|
-
z.object({
|
|
513
|
-
finish_reason: z.union([z.literal('stop'), z.literal('length'), z.literal('content_filter')]),
|
|
514
|
-
index: z.number(),
|
|
515
|
-
logprobs: z
|
|
516
|
-
.object({
|
|
517
|
-
text_offset: z.array(z.number()).optional(),
|
|
518
|
-
token_logprobs: z.array(z.number()).optional(),
|
|
519
|
-
tokens: z.array(z.string()).optional(),
|
|
520
|
-
top_logprobs: z.array(z.record(z.number())).optional(),
|
|
521
|
-
})
|
|
522
|
-
.nullable(),
|
|
523
|
-
text: z.string(),
|
|
524
|
-
}),
|
|
525
|
-
),
|
|
526
|
-
created: z.number(),
|
|
527
|
-
model: z.string(),
|
|
528
|
-
system_fingerprint: z.string().optional(),
|
|
529
|
-
object: z.literal('text_completion'),
|
|
530
|
-
usage: completionUsageSchema.optional(),
|
|
531
|
-
});
|
|
532
|
-
|
|
533
|
-
export const object5Schema = z.literal('text_completion');
|
|
534
|
-
|
|
535
|
-
export const createEmbeddingRequestSchema = z.object({
|
|
536
|
-
input: z.union([z.string(), z.array(z.string()), z.array(z.number()), z.array(z.array(z.number()))]),
|
|
537
|
-
model: z.union([
|
|
538
|
-
z.string(),
|
|
539
|
-
z.literal('text-embedding-ada-002'),
|
|
540
|
-
z.literal('text-embedding-3-small'),
|
|
541
|
-
z.literal('text-embedding-3-large'),
|
|
542
|
-
]),
|
|
543
|
-
encoding_format: z.union([z.literal('float'), z.literal('base64')]).optional(),
|
|
544
|
-
dimensions: z.number().optional().nullable(),
|
|
545
|
-
user: z.string().optional(),
|
|
546
|
-
});
|
|
547
|
-
|
|
548
|
-
export const encodingFormatSchema = z.union([z.literal('float'), z.literal('base64')]);
|
|
549
|
-
|
|
550
|
-
export const embeddingSchema = z.object({
|
|
551
|
-
index: z.number(),
|
|
552
|
-
embedding: z.array(z.number()),
|
|
553
|
-
object: z.literal('embedding'),
|
|
554
|
-
});
|
|
555
|
-
|
|
556
|
-
export const object6Schema = z.literal('list');
|
|
557
|
-
|
|
558
|
-
export const purposeSchema = z.union([
|
|
559
|
-
z.literal('assistants'),
|
|
560
|
-
z.literal('batch'),
|
|
561
|
-
z.literal('fine-tune'),
|
|
562
|
-
z.literal('vision'),
|
|
563
|
-
]);
|
|
564
|
-
|
|
565
|
-
export const createFineTuningJobRequestSchema = z.object({
|
|
566
|
-
model: z.union([
|
|
567
|
-
z.string(),
|
|
568
|
-
z.literal('babbage-002'),
|
|
569
|
-
z.literal('davinci-002'),
|
|
570
|
-
z.literal('gpt-3.5-turbo'),
|
|
571
|
-
z.literal('gpt-4o-mini'),
|
|
572
|
-
]),
|
|
573
|
-
training_file: z.string(),
|
|
574
|
-
hyperparameters: z
|
|
575
|
-
.object({
|
|
576
|
-
batch_size: z.union([z.literal('auto'), z.number()]).optional(),
|
|
577
|
-
learning_rate_multiplier: z.union([z.literal('auto'), z.number()]).optional(),
|
|
578
|
-
n_epochs: z.union([z.literal('auto'), z.number()]).optional(),
|
|
579
|
-
})
|
|
580
|
-
.optional(),
|
|
581
|
-
suffix: z.string().optional().nullable(),
|
|
582
|
-
validation_file: z.string().optional().nullable(),
|
|
583
|
-
integrations: z
|
|
584
|
-
.array(
|
|
585
|
-
z.object({
|
|
586
|
-
type: z.literal('wandb'),
|
|
587
|
-
wandb: z.object({
|
|
588
|
-
project: z.string(),
|
|
589
|
-
name: z.string().optional().nullable(),
|
|
590
|
-
entity: z.string().optional().nullable(),
|
|
591
|
-
tags: z.array(z.string()).optional(),
|
|
592
|
-
}),
|
|
593
|
-
}),
|
|
594
|
-
)
|
|
595
|
-
.optional()
|
|
596
|
-
.nullable(),
|
|
597
|
-
seed: z.number().optional().nullable(),
|
|
598
|
-
});
|
|
599
|
-
|
|
600
|
-
export const sizeSchema = z.union([z.literal('256x256'), z.literal('512x512'), z.literal('1024x1024')]);
|
|
601
|
-
|
|
602
|
-
export const responseFormatSchema = z.union([z.literal('url'), z.literal('b64_json')]);
|
|
603
|
-
|
|
604
|
-
export const createImageRequestSchema = z.object({
|
|
605
|
-
prompt: z.string(),
|
|
606
|
-
model: z
|
|
607
|
-
.union([z.string(), z.literal('dall-e-2'), z.literal('dall-e-3')])
|
|
608
|
-
.optional()
|
|
609
|
-
.nullable(),
|
|
610
|
-
n: z.number().optional().nullable(),
|
|
611
|
-
quality: z.union([z.literal('standard'), z.literal('hd')]).optional(),
|
|
612
|
-
response_format: z
|
|
613
|
-
.union([z.literal('url'), z.literal('b64_json')])
|
|
614
|
-
.optional()
|
|
615
|
-
.nullable(),
|
|
616
|
-
size: z
|
|
617
|
-
.union([
|
|
618
|
-
z.literal('256x256'),
|
|
619
|
-
z.literal('512x512'),
|
|
620
|
-
z.literal('1024x1024'),
|
|
621
|
-
z.literal('1792x1024'),
|
|
622
|
-
z.literal('1024x1792'),
|
|
623
|
-
])
|
|
624
|
-
.optional()
|
|
625
|
-
.nullable(),
|
|
626
|
-
style: z
|
|
627
|
-
.union([z.literal('vivid'), z.literal('natural')])
|
|
628
|
-
.optional()
|
|
629
|
-
.nullable(),
|
|
630
|
-
user: z.string().optional(),
|
|
631
|
-
});
|
|
632
|
-
|
|
633
|
-
export const qualitySchema = z.union([z.literal('standard'), z.literal('hd')]);
|
|
634
|
-
|
|
635
|
-
export const size2Schema = z.union([
|
|
636
|
-
z.literal('256x256'),
|
|
637
|
-
z.literal('512x512'),
|
|
638
|
-
z.literal('1024x1024'),
|
|
639
|
-
z.literal('1792x1024'),
|
|
640
|
-
z.literal('1024x1792'),
|
|
641
|
-
]);
|
|
642
|
-
|
|
643
|
-
export const styleSchema = z.union([z.literal('vivid'), z.literal('natural')]);
|
|
644
|
-
|
|
645
|
-
export const messageContentImageFileObjectSchema = z.object({
|
|
646
|
-
type: z.literal('image_file'),
|
|
647
|
-
image_file: z.object({
|
|
648
|
-
file_id: z.string(),
|
|
649
|
-
detail: z.union([z.literal('auto'), z.literal('low'), z.literal('high')]).optional(),
|
|
650
|
-
}),
|
|
651
|
-
});
|
|
652
|
-
|
|
653
|
-
export const messageContentImageUrlObjectSchema = z.object({
|
|
654
|
-
type: z.literal('image_url'),
|
|
655
|
-
image_url: z.object({
|
|
656
|
-
url: z.string(),
|
|
657
|
-
detail: z.union([z.literal('auto'), z.literal('low'), z.literal('high')]).optional(),
|
|
658
|
-
}),
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
export const messageRequestContentTextObjectSchema = z.object({
|
|
662
|
-
type: z.literal('text'),
|
|
663
|
-
text: z.string(),
|
|
664
|
-
});
|
|
665
|
-
|
|
666
|
-
export const role7Schema = z.union([z.literal('user'), z.literal('assistant')]);
|
|
667
|
-
|
|
668
|
-
export const createModerationRequestSchema = z.object({
|
|
669
|
-
input: z.union([z.string(), z.array(z.string())]),
|
|
670
|
-
model: z.union([z.string(), z.literal('text-moderation-latest'), z.literal('text-moderation-stable')]).optional(),
|
|
671
|
-
});
|
|
672
|
-
|
|
673
|
-
export const createModerationResponseSchema = z.object({
|
|
674
|
-
id: z.string(),
|
|
675
|
-
model: z.string(),
|
|
676
|
-
results: z.array(
|
|
677
|
-
z.object({
|
|
678
|
-
flagged: z.boolean(),
|
|
679
|
-
categories: z.object({
|
|
680
|
-
hate: z.boolean(),
|
|
681
|
-
'hate/threatening': z.boolean(),
|
|
682
|
-
harassment: z.boolean(),
|
|
683
|
-
'harassment/threatening': z.boolean(),
|
|
684
|
-
'self-harm': z.boolean(),
|
|
685
|
-
'self-harm/intent': z.boolean(),
|
|
686
|
-
'self-harm/instructions': z.boolean(),
|
|
687
|
-
sexual: z.boolean(),
|
|
688
|
-
'sexual/minors': z.boolean(),
|
|
689
|
-
violence: z.boolean(),
|
|
690
|
-
'violence/graphic': z.boolean(),
|
|
691
|
-
}),
|
|
692
|
-
category_scores: z.object({
|
|
693
|
-
hate: z.number(),
|
|
694
|
-
'hate/threatening': z.number(),
|
|
695
|
-
harassment: z.number(),
|
|
696
|
-
'harassment/threatening': z.number(),
|
|
697
|
-
'self-harm': z.number(),
|
|
698
|
-
'self-harm/intent': z.number(),
|
|
699
|
-
'self-harm/instructions': z.number(),
|
|
700
|
-
sexual: z.number(),
|
|
701
|
-
'sexual/minors': z.number(),
|
|
702
|
-
violence: z.number(),
|
|
703
|
-
'violence/graphic': z.number(),
|
|
704
|
-
}),
|
|
705
|
-
}),
|
|
706
|
-
),
|
|
707
|
-
});
|
|
708
|
-
|
|
709
|
-
export const createMessageRequestSchema = z.object({
|
|
710
|
-
role: z.union([z.literal('user'), z.literal('assistant')]),
|
|
711
|
-
content: z.union([
|
|
712
|
-
z.string(),
|
|
713
|
-
z.array(
|
|
714
|
-
z.union([
|
|
715
|
-
messageContentImageFileObjectSchema,
|
|
716
|
-
messageContentImageUrlObjectSchema,
|
|
717
|
-
messageRequestContentTextObjectSchema,
|
|
718
|
-
]),
|
|
719
|
-
),
|
|
720
|
-
]),
|
|
721
|
-
attachments: z
|
|
722
|
-
.array(
|
|
723
|
-
z.object({
|
|
724
|
-
file_id: z.string().optional(),
|
|
725
|
-
tools: z.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchTypeOnlySchema])).optional(),
|
|
726
|
-
}),
|
|
727
|
-
)
|
|
728
|
-
.optional()
|
|
729
|
-
.nullable(),
|
|
730
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
731
|
-
});
|
|
732
|
-
|
|
733
|
-
export const truncationObjectSchema = z.object({
|
|
734
|
-
type: z.union([z.literal('auto'), z.literal('last_messages')]),
|
|
735
|
-
last_messages: z.number().optional().nullable(),
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
export const assistantsApiToolChoiceOptionSchema = z.union([
|
|
739
|
-
z.literal('none'),
|
|
740
|
-
z.literal('auto'),
|
|
741
|
-
z.literal('required'),
|
|
742
|
-
assistantsNamedToolChoiceSchema,
|
|
743
|
-
]);
|
|
744
|
-
|
|
745
|
-
export const createSpeechRequestSchema = z.object({
|
|
746
|
-
model: z.union([z.string(), z.literal('tts-1'), z.literal('tts-1-hd')]),
|
|
747
|
-
input: z.string(),
|
|
748
|
-
voice: z.union([
|
|
749
|
-
z.literal('alloy'),
|
|
750
|
-
z.literal('echo'),
|
|
751
|
-
z.literal('fable'),
|
|
752
|
-
z.literal('onyx'),
|
|
753
|
-
z.literal('nova'),
|
|
754
|
-
z.literal('shimmer'),
|
|
755
|
-
]),
|
|
756
|
-
response_format: z
|
|
757
|
-
.union([
|
|
758
|
-
z.literal('mp3'),
|
|
759
|
-
z.literal('opus'),
|
|
760
|
-
z.literal('aac'),
|
|
761
|
-
z.literal('flac'),
|
|
762
|
-
z.literal('wav'),
|
|
763
|
-
z.literal('pcm'),
|
|
764
|
-
])
|
|
765
|
-
.optional(),
|
|
766
|
-
speed: z.number().optional(),
|
|
767
|
-
});
|
|
768
|
-
|
|
769
|
-
export const voiceSchema = z.union([
|
|
770
|
-
z.literal('alloy'),
|
|
771
|
-
z.literal('echo'),
|
|
772
|
-
z.literal('fable'),
|
|
773
|
-
z.literal('onyx'),
|
|
774
|
-
z.literal('nova'),
|
|
775
|
-
z.literal('shimmer'),
|
|
776
|
-
]);
|
|
777
|
-
|
|
778
|
-
export const responseFormat2Schema = z.union([
|
|
779
|
-
z.literal('mp3'),
|
|
780
|
-
z.literal('opus'),
|
|
781
|
-
z.literal('aac'),
|
|
782
|
-
z.literal('flac'),
|
|
783
|
-
z.literal('wav'),
|
|
784
|
-
z.literal('pcm'),
|
|
785
|
-
]);
|
|
786
|
-
|
|
787
|
-
export const createThreadRequestSchema = z.object({
|
|
788
|
-
messages: z.array(createMessageRequestSchema).optional(),
|
|
789
|
-
tool_resources: z
|
|
790
|
-
.object({
|
|
791
|
-
code_interpreter: z
|
|
792
|
-
.object({
|
|
793
|
-
file_ids: z.array(z.string()).optional(),
|
|
794
|
-
})
|
|
795
|
-
.optional(),
|
|
796
|
-
file_search: z
|
|
797
|
-
.unknown()
|
|
798
|
-
.and(
|
|
799
|
-
z.object({
|
|
800
|
-
vector_store_ids: z.array(z.string()).optional(),
|
|
801
|
-
vector_stores: z
|
|
802
|
-
.array(
|
|
803
|
-
z.object({
|
|
804
|
-
file_ids: z.array(z.string()).optional(),
|
|
805
|
-
chunking_strategy: z
|
|
806
|
-
.union([
|
|
807
|
-
z.object({
|
|
808
|
-
type: z.literal('auto'),
|
|
809
|
-
}),
|
|
810
|
-
z.object({
|
|
811
|
-
type: z.literal('static'),
|
|
812
|
-
static: z.object({
|
|
813
|
-
max_chunk_size_tokens: z.number(),
|
|
814
|
-
chunk_overlap_tokens: z.number(),
|
|
815
|
-
}),
|
|
816
|
-
}),
|
|
817
|
-
])
|
|
818
|
-
.optional(),
|
|
819
|
-
metadata: z.record(z.unknown()).optional(),
|
|
820
|
-
}),
|
|
821
|
-
)
|
|
822
|
-
.optional(),
|
|
823
|
-
}),
|
|
824
|
-
)
|
|
825
|
-
.optional(),
|
|
826
|
-
})
|
|
827
|
-
.optional()
|
|
828
|
-
.nullable(),
|
|
829
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
830
|
-
});
|
|
831
|
-
|
|
832
|
-
export const responseFormat3Schema = z.union([
|
|
833
|
-
z.literal('json'),
|
|
834
|
-
z.literal('text'),
|
|
835
|
-
z.literal('srt'),
|
|
836
|
-
z.literal('verbose_json'),
|
|
837
|
-
z.literal('vtt'),
|
|
838
|
-
]);
|
|
839
|
-
|
|
840
|
-
export const createTranscriptionResponseJsonSchema = z.object({
|
|
841
|
-
text: z.string(),
|
|
842
|
-
});
|
|
843
|
-
|
|
844
|
-
export const transcriptionWordSchema = z.object({
|
|
845
|
-
word: z.string(),
|
|
846
|
-
start: z.number(),
|
|
847
|
-
end: z.number(),
|
|
848
|
-
});
|
|
849
|
-
|
|
850
|
-
export const transcriptionSegmentSchema = z.object({
|
|
851
|
-
id: z.number(),
|
|
852
|
-
seek: z.number(),
|
|
853
|
-
start: z.number(),
|
|
854
|
-
end: z.number(),
|
|
855
|
-
text: z.string(),
|
|
856
|
-
tokens: z.array(z.number()),
|
|
857
|
-
temperature: z.number(),
|
|
858
|
-
avg_logprob: z.number(),
|
|
859
|
-
compression_ratio: z.number(),
|
|
860
|
-
no_speech_prob: z.number(),
|
|
861
|
-
});
|
|
862
|
-
|
|
863
|
-
export const createTranslationResponseJsonSchema = z.object({
|
|
864
|
-
text: z.string(),
|
|
865
|
-
});
|
|
866
|
-
|
|
867
|
-
export const createTranslationResponseVerboseJsonSchema = z.object({
|
|
868
|
-
language: z.string(),
|
|
869
|
-
duration: z.string(),
|
|
870
|
-
text: z.string(),
|
|
871
|
-
segments: z.array(transcriptionSegmentSchema).optional(),
|
|
872
|
-
});
|
|
873
|
-
|
|
874
|
-
export const createUploadRequestSchema = z.object({
|
|
875
|
-
filename: z.string(),
|
|
876
|
-
purpose: z.union([z.literal('assistants'), z.literal('batch'), z.literal('fine-tune'), z.literal('vision')]),
|
|
877
|
-
bytes: z.number(),
|
|
878
|
-
mime_type: z.string(),
|
|
879
|
-
});
|
|
880
|
-
|
|
881
|
-
export const vectorStoreExpirationAfterSchema = z.object({
|
|
882
|
-
anchor: z.literal('last_active_at'),
|
|
883
|
-
days: z.number(),
|
|
884
|
-
});
|
|
885
|
-
|
|
886
|
-
export const defaultProjectErrorResponseSchema = z.object({
|
|
887
|
-
code: z.number(),
|
|
888
|
-
message: z.string(),
|
|
889
|
-
});
|
|
890
|
-
|
|
891
|
-
export const deleteAssistantResponseSchema = z.object({
|
|
892
|
-
id: z.string(),
|
|
893
|
-
deleted: z.boolean(),
|
|
894
|
-
object: z.literal('assistant.deleted'),
|
|
895
|
-
});
|
|
896
|
-
|
|
897
|
-
export const object7Schema = z.literal('assistant.deleted');
|
|
898
|
-
|
|
899
|
-
export const deleteFileResponseSchema = z.object({
|
|
900
|
-
id: z.string(),
|
|
901
|
-
object: z.literal('file'),
|
|
902
|
-
deleted: z.boolean(),
|
|
903
|
-
});
|
|
904
|
-
|
|
905
|
-
export const object8Schema = z.literal('file');
|
|
906
|
-
|
|
907
|
-
export const deleteMessageResponseSchema = z.object({
|
|
908
|
-
id: z.string(),
|
|
909
|
-
deleted: z.boolean(),
|
|
910
|
-
object: z.literal('thread.message.deleted'),
|
|
911
|
-
});
|
|
912
|
-
|
|
913
|
-
export const object9Schema = z.literal('thread.message.deleted');
|
|
914
|
-
|
|
915
|
-
export const deleteModelResponseSchema = z.object({
|
|
916
|
-
id: z.string(),
|
|
917
|
-
deleted: z.boolean(),
|
|
918
|
-
object: z.string(),
|
|
919
|
-
});
|
|
920
|
-
|
|
921
|
-
export const deleteThreadResponseSchema = z.object({
|
|
922
|
-
id: z.string(),
|
|
923
|
-
deleted: z.boolean(),
|
|
924
|
-
object: z.literal('thread.deleted'),
|
|
925
|
-
});
|
|
926
|
-
|
|
927
|
-
export const object10Schema = z.literal('thread.deleted');
|
|
928
|
-
|
|
929
|
-
export const deleteVectorStoreFileResponseSchema = z.object({
|
|
930
|
-
id: z.string(),
|
|
931
|
-
deleted: z.boolean(),
|
|
932
|
-
object: z.literal('vector_store.file.deleted'),
|
|
933
|
-
});
|
|
934
|
-
|
|
935
|
-
export const object11Schema = z.literal('vector_store.file.deleted');
|
|
936
|
-
|
|
937
|
-
export const deleteVectorStoreResponseSchema = z.object({
|
|
938
|
-
id: z.string(),
|
|
939
|
-
deleted: z.boolean(),
|
|
940
|
-
object: z.literal('vector_store.deleted'),
|
|
941
|
-
});
|
|
942
|
-
|
|
943
|
-
export const object12Schema = z.literal('vector_store.deleted');
|
|
944
|
-
|
|
945
|
-
export const eventSchema = z.literal('done');
|
|
946
|
-
|
|
947
|
-
export const dataSchema = z.literal('[DONE]');
|
|
948
|
-
|
|
949
|
-
export const object13Schema = z.literal('embedding');
|
|
950
|
-
|
|
951
|
-
export const errorSchema = z.object({
|
|
952
|
-
code: z.string().nullable(),
|
|
953
|
-
message: z.string(),
|
|
954
|
-
param: z.string().nullable(),
|
|
955
|
-
type: z.string(),
|
|
956
|
-
});
|
|
957
|
-
|
|
958
|
-
export const errorEventSchema = z.object({
|
|
959
|
-
event: z.literal('error'),
|
|
960
|
-
data: errorSchema,
|
|
961
|
-
});
|
|
962
|
-
|
|
963
|
-
export const event2Schema = z.literal('error');
|
|
964
|
-
|
|
965
|
-
export const errorResponseSchema = z.object({
|
|
966
|
-
error: errorSchema,
|
|
967
|
-
});
|
|
968
|
-
|
|
969
|
-
export const weightSchema = z.union([z.literal(0), z.literal(1)]);
|
|
970
|
-
|
|
971
|
-
export const chatCompletionRequestSystemMessageSchema = z.object({
|
|
972
|
-
content: z.union([z.string(), z.array(chatCompletionRequestSystemMessageContentPartSchema)]),
|
|
973
|
-
role: z.literal('system'),
|
|
974
|
-
name: z.string().optional(),
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
export const chatCompletionRequestUserMessageSchema = z.object({
|
|
978
|
-
content: z.union([z.string(), z.array(chatCompletionRequestUserMessageContentPartSchema)]),
|
|
979
|
-
role: z.literal('user'),
|
|
980
|
-
name: z.string().optional(),
|
|
981
|
-
});
|
|
982
|
-
|
|
983
|
-
export const chatCompletionRequestToolMessageSchema = z.object({
|
|
984
|
-
role: z.literal('tool'),
|
|
985
|
-
content: z.union([z.string(), z.array(chatCompletionRequestToolMessageContentPartSchema)]),
|
|
986
|
-
tool_call_id: z.string(),
|
|
987
|
-
});
|
|
988
|
-
|
|
989
|
-
export const finetuneCompletionRequestInputSchema = z.object({
|
|
990
|
-
prompt: z.string().optional(),
|
|
991
|
-
completion: z.string().optional(),
|
|
992
|
-
});
|
|
993
|
-
|
|
994
|
-
export const fineTuningIntegrationSchema = z.object({
|
|
995
|
-
type: z.literal('wandb'),
|
|
996
|
-
wandb: z.object({
|
|
997
|
-
project: z.string(),
|
|
998
|
-
name: z.string().optional().nullable(),
|
|
999
|
-
entity: z.string().optional().nullable(),
|
|
1000
|
-
tags: z.array(z.string()).optional(),
|
|
1001
|
-
}),
|
|
1002
|
-
});
|
|
1003
|
-
|
|
1004
|
-
export const type11Schema = z.literal('wandb');
|
|
1005
|
-
|
|
1006
|
-
export const fineTuningJobSchema = z.object({
|
|
1007
|
-
id: z.string(),
|
|
1008
|
-
created_at: z.number(),
|
|
1009
|
-
error: z
|
|
1010
|
-
.object({
|
|
1011
|
-
code: z.string(),
|
|
1012
|
-
message: z.string(),
|
|
1013
|
-
param: z.string().nullable(),
|
|
1014
|
-
})
|
|
1015
|
-
.nullable(),
|
|
1016
|
-
fine_tuned_model: z.string().nullable(),
|
|
1017
|
-
finished_at: z.number().nullable(),
|
|
1018
|
-
hyperparameters: z.object({
|
|
1019
|
-
n_epochs: z.union([z.literal('auto'), z.number()]),
|
|
1020
|
-
}),
|
|
1021
|
-
model: z.string(),
|
|
1022
|
-
object: z.literal('fine_tuning.job'),
|
|
1023
|
-
organization_id: z.string(),
|
|
1024
|
-
result_files: z.array(z.string()),
|
|
1025
|
-
status: z.union([
|
|
1026
|
-
z.literal('validating_files'),
|
|
1027
|
-
z.literal('queued'),
|
|
1028
|
-
z.literal('running'),
|
|
1029
|
-
z.literal('succeeded'),
|
|
1030
|
-
z.literal('failed'),
|
|
1031
|
-
z.literal('cancelled'),
|
|
1032
|
-
]),
|
|
1033
|
-
trained_tokens: z.number().nullable(),
|
|
1034
|
-
training_file: z.string(),
|
|
1035
|
-
validation_file: z.string().nullable(),
|
|
1036
|
-
integrations: z.array(fineTuningIntegrationSchema).optional().nullable(),
|
|
1037
|
-
seed: z.number(),
|
|
1038
|
-
estimated_finish: z.number().optional().nullable(),
|
|
1039
|
-
});
|
|
1040
|
-
|
|
1041
|
-
export const object14Schema = z.literal('fine_tuning.job');
|
|
1042
|
-
|
|
1043
|
-
export const status2Schema = z.union([
|
|
1044
|
-
z.literal('validating_files'),
|
|
1045
|
-
z.literal('queued'),
|
|
1046
|
-
z.literal('running'),
|
|
1047
|
-
z.literal('succeeded'),
|
|
1048
|
-
z.literal('failed'),
|
|
1049
|
-
z.literal('cancelled'),
|
|
1050
|
-
]);
|
|
1051
|
-
|
|
1052
|
-
export const fineTuningJobCheckpointSchema = z.object({
|
|
1053
|
-
id: z.string(),
|
|
1054
|
-
created_at: z.number(),
|
|
1055
|
-
fine_tuned_model_checkpoint: z.string(),
|
|
1056
|
-
step_number: z.number(),
|
|
1057
|
-
metrics: z.object({
|
|
1058
|
-
step: z.number().optional(),
|
|
1059
|
-
train_loss: z.number().optional(),
|
|
1060
|
-
train_mean_token_accuracy: z.number().optional(),
|
|
1061
|
-
valid_loss: z.number().optional(),
|
|
1062
|
-
valid_mean_token_accuracy: z.number().optional(),
|
|
1063
|
-
full_valid_loss: z.number().optional(),
|
|
1064
|
-
full_valid_mean_token_accuracy: z.number().optional(),
|
|
1065
|
-
}),
|
|
1066
|
-
fine_tuning_job_id: z.string(),
|
|
1067
|
-
object: z.literal('fine_tuning.job.checkpoint'),
|
|
1068
|
-
});
|
|
1069
|
-
|
|
1070
|
-
export const object15Schema = z.literal('fine_tuning.job.checkpoint');
|
|
1071
|
-
|
|
1072
|
-
export const fineTuningJobEventSchema = z.object({
|
|
1073
|
-
id: z.string(),
|
|
1074
|
-
created_at: z.number(),
|
|
1075
|
-
level: z.union([z.literal('info'), z.literal('warn'), z.literal('error')]),
|
|
1076
|
-
message: z.string(),
|
|
1077
|
-
object: z.literal('fine_tuning.job.event'),
|
|
1078
|
-
});
|
|
1079
|
-
|
|
1080
|
-
export const levelSchema = z.union([z.literal('info'), z.literal('warn'), z.literal('error')]);
|
|
1081
|
-
|
|
1082
|
-
export const object16Schema = z.literal('fine_tuning.job.event');
|
|
1083
|
-
|
|
1084
|
-
export const imageSchema = z.object({
|
|
1085
|
-
b64_json: z.string().optional(),
|
|
1086
|
-
url: z.string().optional(),
|
|
1087
|
-
revised_prompt: z.string().optional(),
|
|
1088
|
-
});
|
|
1089
|
-
|
|
1090
|
-
export const imagesResponseSchema = z.object({
|
|
1091
|
-
created: z.number(),
|
|
1092
|
-
data: z.array(imageSchema),
|
|
1093
|
-
});
|
|
1094
|
-
|
|
1095
|
-
export const inviteSchema = z.object({
|
|
1096
|
-
object: z.literal('organization.invite'),
|
|
1097
|
-
id: z.string(),
|
|
1098
|
-
email: z.string(),
|
|
1099
|
-
role: z.union([z.literal('owner'), z.literal('reader')]),
|
|
1100
|
-
status: z.union([z.literal('accepted'), z.literal('expired'), z.literal('pending')]),
|
|
1101
|
-
invited_at: z.number(),
|
|
1102
|
-
expires_at: z.number(),
|
|
1103
|
-
accepted_at: z.number().optional(),
|
|
1104
|
-
});
|
|
1105
|
-
|
|
1106
|
-
export const object17Schema = z.literal('organization.invite');
|
|
1107
|
-
|
|
1108
|
-
export const role8Schema = z.union([z.literal('owner'), z.literal('reader')]);
|
|
1109
|
-
|
|
1110
|
-
export const status3Schema = z.union([z.literal('accepted'), z.literal('expired'), z.literal('pending')]);
|
|
1111
|
-
|
|
1112
|
-
export const inviteDeleteResponseSchema = z.object({
|
|
1113
|
-
object: z.literal('organization.invite.deleted'),
|
|
1114
|
-
id: z.string(),
|
|
1115
|
-
deleted: z.boolean(),
|
|
1116
|
-
});
|
|
1117
|
-
|
|
1118
|
-
export const object18Schema = z.literal('organization.invite.deleted');
|
|
1119
|
-
|
|
1120
|
-
export const inviteListResponseSchema = z.object({
|
|
1121
|
-
object: z.literal('list'),
|
|
1122
|
-
data: z.array(inviteSchema),
|
|
1123
|
-
first_id: z.string().optional(),
|
|
1124
|
-
last_id: z.string().optional(),
|
|
1125
|
-
has_more: z.boolean().optional(),
|
|
1126
|
-
});
|
|
1127
|
-
|
|
1128
|
-
export const inviteRequestSchema = z.object({
|
|
1129
|
-
email: z.string(),
|
|
1130
|
-
role: z.union([z.literal('reader'), z.literal('owner')]),
|
|
1131
|
-
});
|
|
1132
|
-
|
|
1133
|
-
export const listBatchesResponseSchema = z.object({
|
|
1134
|
-
data: z.array(batchSchema),
|
|
1135
|
-
first_id: z.string().optional(),
|
|
1136
|
-
last_id: z.string().optional(),
|
|
1137
|
-
has_more: z.boolean(),
|
|
1138
|
-
object: z.literal('list'),
|
|
1139
|
-
});
|
|
1140
|
-
|
|
1141
|
-
export const openAIFileSchema = z.object({
|
|
1142
|
-
id: z.string(),
|
|
1143
|
-
bytes: z.number(),
|
|
1144
|
-
created_at: z.number(),
|
|
1145
|
-
filename: z.string(),
|
|
1146
|
-
object: z.literal('file'),
|
|
1147
|
-
purpose: z.union([
|
|
1148
|
-
z.literal('assistants'),
|
|
1149
|
-
z.literal('assistants_output'),
|
|
1150
|
-
z.literal('batch'),
|
|
1151
|
-
z.literal('batch_output'),
|
|
1152
|
-
z.literal('fine-tune'),
|
|
1153
|
-
z.literal('fine-tune-results'),
|
|
1154
|
-
z.literal('vision'),
|
|
1155
|
-
]),
|
|
1156
|
-
status: z.union([z.literal('uploaded'), z.literal('processed'), z.literal('error')]),
|
|
1157
|
-
status_details: z.string().optional(),
|
|
1158
|
-
});
|
|
1159
|
-
|
|
1160
|
-
export const listFineTuningJobCheckpointsResponseSchema = z.object({
|
|
1161
|
-
data: z.array(fineTuningJobCheckpointSchema),
|
|
1162
|
-
object: z.literal('list'),
|
|
1163
|
-
first_id: z.string().optional().nullable(),
|
|
1164
|
-
last_id: z.string().optional().nullable(),
|
|
1165
|
-
has_more: z.boolean(),
|
|
1166
|
-
});
|
|
1167
|
-
|
|
1168
|
-
export const listFineTuningJobEventsResponseSchema = z.object({
|
|
1169
|
-
data: z.array(fineTuningJobEventSchema),
|
|
1170
|
-
object: z.literal('list'),
|
|
1171
|
-
});
|
|
1172
|
-
|
|
1173
|
-
export const modelSchema = z.object({
|
|
1174
|
-
id: z.string(),
|
|
1175
|
-
created: z.number(),
|
|
1176
|
-
object: z.literal('model'),
|
|
1177
|
-
owned_by: z.string(),
|
|
1178
|
-
});
|
|
1179
|
-
|
|
1180
|
-
export const listPaginatedFineTuningJobsResponseSchema = z.object({
|
|
1181
|
-
data: z.array(fineTuningJobSchema),
|
|
1182
|
-
has_more: z.boolean(),
|
|
1183
|
-
object: z.literal('list'),
|
|
1184
|
-
});
|
|
1185
|
-
|
|
1186
|
-
export const threadObjectSchema = z.object({
|
|
1187
|
-
id: z.string(),
|
|
1188
|
-
object: z.literal('thread'),
|
|
1189
|
-
created_at: z.number(),
|
|
1190
|
-
tool_resources: z
|
|
1191
|
-
.object({
|
|
1192
|
-
code_interpreter: z
|
|
1193
|
-
.object({
|
|
1194
|
-
file_ids: z.array(z.string()).optional(),
|
|
1195
|
-
})
|
|
1196
|
-
.optional(),
|
|
1197
|
-
file_search: z
|
|
1198
|
-
.object({
|
|
1199
|
-
vector_store_ids: z.array(z.string()).optional(),
|
|
1200
|
-
})
|
|
1201
|
-
.optional(),
|
|
1202
|
-
})
|
|
1203
|
-
.nullable(),
|
|
1204
|
-
metadata: z.record(z.unknown()).nullable(),
|
|
1205
|
-
});
|
|
1206
|
-
|
|
1207
|
-
export const vectorStoreObjectSchema = z.object({
|
|
1208
|
-
id: z.string(),
|
|
1209
|
-
object: z.literal('vector_store'),
|
|
1210
|
-
created_at: z.number(),
|
|
1211
|
-
name: z.string(),
|
|
1212
|
-
usage_bytes: z.number(),
|
|
1213
|
-
file_counts: z.object({
|
|
1214
|
-
in_progress: z.number(),
|
|
1215
|
-
completed: z.number(),
|
|
1216
|
-
failed: z.number(),
|
|
1217
|
-
cancelled: z.number(),
|
|
1218
|
-
total: z.number(),
|
|
1219
|
-
}),
|
|
1220
|
-
status: z.union([z.literal('expired'), z.literal('in_progress'), z.literal('completed')]),
|
|
1221
|
-
expires_after: vectorStoreExpirationAfterSchema.optional(),
|
|
1222
|
-
expires_at: z.number().optional().nullable(),
|
|
1223
|
-
last_active_at: z.number().nullable(),
|
|
1224
|
-
metadata: z.record(z.unknown()).nullable(),
|
|
1225
|
-
});
|
|
1226
|
-
|
|
1227
|
-
export const type12Schema = z.literal('image_file');
|
|
1228
|
-
|
|
1229
|
-
export const messageContentRefusalObjectSchema = z.object({
|
|
1230
|
-
type: z.literal('refusal'),
|
|
1231
|
-
refusal: z.string(),
|
|
1232
|
-
});
|
|
1233
|
-
|
|
1234
|
-
export const messageContentTextAnnotationsFileCitationObjectSchema = z.object({
|
|
1235
|
-
type: z.literal('file_citation'),
|
|
1236
|
-
text: z.string(),
|
|
1237
|
-
file_citation: z.object({
|
|
1238
|
-
file_id: z.string(),
|
|
1239
|
-
}),
|
|
1240
|
-
start_index: z.number(),
|
|
1241
|
-
end_index: z.number(),
|
|
1242
|
-
});
|
|
1243
|
-
|
|
1244
|
-
export const type13Schema = z.literal('file_citation');
|
|
1245
|
-
|
|
1246
|
-
export const messageContentTextAnnotationsFilePathObjectSchema = z.object({
|
|
1247
|
-
type: z.literal('file_path'),
|
|
1248
|
-
text: z.string(),
|
|
1249
|
-
file_path: z.object({
|
|
1250
|
-
file_id: z.string(),
|
|
1251
|
-
}),
|
|
1252
|
-
start_index: z.number(),
|
|
1253
|
-
end_index: z.number(),
|
|
1254
|
-
});
|
|
1255
|
-
|
|
1256
|
-
export const type14Schema = z.literal('file_path');
|
|
1257
|
-
|
|
1258
|
-
export const messageContentTextObjectSchema = z.object({
|
|
1259
|
-
type: z.literal('text'),
|
|
1260
|
-
text: z.object({
|
|
1261
|
-
value: z.string(),
|
|
1262
|
-
annotations: z.array(
|
|
1263
|
-
z.union([
|
|
1264
|
-
messageContentTextAnnotationsFileCitationObjectSchema,
|
|
1265
|
-
messageContentTextAnnotationsFilePathObjectSchema,
|
|
1266
|
-
]),
|
|
1267
|
-
),
|
|
1268
|
-
}),
|
|
1269
|
-
});
|
|
1270
|
-
|
|
1271
|
-
export const messageDeltaContentImageFileObjectSchema = z.object({
|
|
1272
|
-
index: z.number(),
|
|
1273
|
-
type: z.literal('image_file'),
|
|
1274
|
-
image_file: z
|
|
1275
|
-
.object({
|
|
1276
|
-
file_id: z.string().optional(),
|
|
1277
|
-
detail: z.union([z.literal('auto'), z.literal('low'), z.literal('high')]).optional(),
|
|
1278
|
-
})
|
|
1279
|
-
.optional(),
|
|
1280
|
-
});
|
|
1281
|
-
|
|
1282
|
-
export const messageDeltaContentImageUrlObjectSchema = z.object({
|
|
1283
|
-
index: z.number(),
|
|
1284
|
-
type: z.literal('image_url'),
|
|
1285
|
-
image_url: z
|
|
1286
|
-
.object({
|
|
1287
|
-
url: z.string().optional(),
|
|
1288
|
-
detail: z.union([z.literal('auto'), z.literal('low'), z.literal('high')]).optional(),
|
|
1289
|
-
})
|
|
1290
|
-
.optional(),
|
|
1291
|
-
});
|
|
1292
|
-
|
|
1293
|
-
export const messageDeltaContentRefusalObjectSchema = z.object({
|
|
1294
|
-
index: z.number(),
|
|
1295
|
-
type: z.literal('refusal'),
|
|
1296
|
-
refusal: z.string().optional(),
|
|
1297
|
-
});
|
|
1298
|
-
|
|
1299
|
-
export const messageDeltaContentTextAnnotationsFileCitationObjectSchema = z.object({
|
|
1300
|
-
index: z.number(),
|
|
1301
|
-
type: z.literal('file_citation'),
|
|
1302
|
-
text: z.string().optional(),
|
|
1303
|
-
file_citation: z
|
|
1304
|
-
.object({
|
|
1305
|
-
file_id: z.string().optional(),
|
|
1306
|
-
quote: z.string().optional(),
|
|
1307
|
-
})
|
|
1308
|
-
.optional(),
|
|
1309
|
-
start_index: z.number().optional(),
|
|
1310
|
-
end_index: z.number().optional(),
|
|
1311
|
-
});
|
|
1312
|
-
|
|
1313
|
-
export const messageDeltaContentTextAnnotationsFilePathObjectSchema = z.object({
|
|
1314
|
-
index: z.number(),
|
|
1315
|
-
type: z.literal('file_path'),
|
|
1316
|
-
text: z.string().optional(),
|
|
1317
|
-
file_path: z
|
|
1318
|
-
.object({
|
|
1319
|
-
file_id: z.string().optional(),
|
|
1320
|
-
})
|
|
1321
|
-
.optional(),
|
|
1322
|
-
start_index: z.number().optional(),
|
|
1323
|
-
end_index: z.number().optional(),
|
|
1324
|
-
});
|
|
1325
|
-
|
|
1326
|
-
export const messageDeltaContentTextObjectSchema = z.object({
|
|
1327
|
-
index: z.number(),
|
|
1328
|
-
type: z.literal('text'),
|
|
1329
|
-
text: z
|
|
1330
|
-
.object({
|
|
1331
|
-
value: z.string().optional(),
|
|
1332
|
-
annotations: z
|
|
1333
|
-
.array(
|
|
1334
|
-
z.union([
|
|
1335
|
-
messageDeltaContentTextAnnotationsFileCitationObjectSchema,
|
|
1336
|
-
messageDeltaContentTextAnnotationsFilePathObjectSchema,
|
|
1337
|
-
]),
|
|
1338
|
-
)
|
|
1339
|
-
.optional(),
|
|
1340
|
-
})
|
|
1341
|
-
.optional(),
|
|
1342
|
-
});
|
|
1343
|
-
|
|
1344
|
-
export const messageDeltaObjectSchema = z.object({
|
|
1345
|
-
id: z.string(),
|
|
1346
|
-
object: z.literal('thread.message.delta'),
|
|
1347
|
-
delta: z.object({
|
|
1348
|
-
role: z.union([z.literal('user'), z.literal('assistant')]).optional(),
|
|
1349
|
-
content: z
|
|
1350
|
-
.array(
|
|
1351
|
-
z.union([
|
|
1352
|
-
messageDeltaContentImageFileObjectSchema,
|
|
1353
|
-
messageDeltaContentTextObjectSchema,
|
|
1354
|
-
messageDeltaContentRefusalObjectSchema,
|
|
1355
|
-
messageDeltaContentImageUrlObjectSchema,
|
|
1356
|
-
]),
|
|
1357
|
-
)
|
|
1358
|
-
.optional(),
|
|
1359
|
-
}),
|
|
1360
|
-
});
|
|
1361
|
-
|
|
1362
|
-
export const object19Schema = z.literal('thread.message.delta');
|
|
1363
|
-
|
|
1364
|
-
export const messageObjectSchema = z.object({
|
|
1365
|
-
id: z.string(),
|
|
1366
|
-
object: z.literal('thread.message'),
|
|
1367
|
-
created_at: z.number(),
|
|
1368
|
-
thread_id: z.string(),
|
|
1369
|
-
status: z.union([z.literal('in_progress'), z.literal('incomplete'), z.literal('completed')]),
|
|
1370
|
-
incomplete_details: z
|
|
1371
|
-
.object({
|
|
1372
|
-
reason: z.union([
|
|
1373
|
-
z.literal('content_filter'),
|
|
1374
|
-
z.literal('max_tokens'),
|
|
1375
|
-
z.literal('run_cancelled'),
|
|
1376
|
-
z.literal('run_expired'),
|
|
1377
|
-
z.literal('run_failed'),
|
|
1378
|
-
]),
|
|
1379
|
-
})
|
|
1380
|
-
.nullable(),
|
|
1381
|
-
completed_at: z.number().nullable(),
|
|
1382
|
-
incomplete_at: z.number().nullable(),
|
|
1383
|
-
role: z.union([z.literal('user'), z.literal('assistant')]),
|
|
1384
|
-
content: z.array(
|
|
1385
|
-
z.union([
|
|
1386
|
-
messageContentImageFileObjectSchema,
|
|
1387
|
-
messageContentImageUrlObjectSchema,
|
|
1388
|
-
messageContentTextObjectSchema,
|
|
1389
|
-
messageContentRefusalObjectSchema,
|
|
1390
|
-
]),
|
|
1391
|
-
),
|
|
1392
|
-
assistant_id: z.string().nullable(),
|
|
1393
|
-
run_id: z.string().nullable(),
|
|
1394
|
-
attachments: z
|
|
1395
|
-
.array(
|
|
1396
|
-
z.object({
|
|
1397
|
-
file_id: z.string().optional(),
|
|
1398
|
-
tools: z.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchTypeOnlySchema])).optional(),
|
|
1399
|
-
}),
|
|
1400
|
-
)
|
|
1401
|
-
.nullable(),
|
|
1402
|
-
metadata: z.record(z.unknown()).nullable(),
|
|
1403
|
-
});
|
|
1404
|
-
|
|
1405
|
-
export const object20Schema = z.literal('thread.message');
|
|
1406
|
-
|
|
1407
|
-
export const status4Schema = z.union([z.literal('in_progress'), z.literal('incomplete'), z.literal('completed')]);
|
|
1408
|
-
|
|
1409
|
-
export const reasonSchema = z.union([
|
|
1410
|
-
z.literal('content_filter'),
|
|
1411
|
-
z.literal('max_tokens'),
|
|
1412
|
-
z.literal('run_cancelled'),
|
|
1413
|
-
z.literal('run_expired'),
|
|
1414
|
-
z.literal('run_failed'),
|
|
1415
|
-
]);
|
|
1416
|
-
|
|
1417
|
-
export const messageStreamEventSchema = z.union([
|
|
1418
|
-
z.object({
|
|
1419
|
-
event: z.literal('thread.message.created'),
|
|
1420
|
-
data: messageObjectSchema,
|
|
1421
|
-
}),
|
|
1422
|
-
z.object({
|
|
1423
|
-
event: z.literal('thread.message.in_progress'),
|
|
1424
|
-
data: messageObjectSchema,
|
|
1425
|
-
}),
|
|
1426
|
-
z.object({
|
|
1427
|
-
event: z.literal('thread.message.delta'),
|
|
1428
|
-
data: messageDeltaObjectSchema,
|
|
1429
|
-
}),
|
|
1430
|
-
z.object({
|
|
1431
|
-
event: z.literal('thread.message.completed'),
|
|
1432
|
-
data: messageObjectSchema,
|
|
1433
|
-
}),
|
|
1434
|
-
z.object({
|
|
1435
|
-
event: z.literal('thread.message.incomplete'),
|
|
1436
|
-
data: messageObjectSchema,
|
|
1437
|
-
}),
|
|
1438
|
-
]);
|
|
1439
|
-
|
|
1440
|
-
export const event3Schema = z.literal('thread.message.created');
|
|
1441
|
-
|
|
1442
|
-
export const object21Schema = z.literal('model');
|
|
1443
|
-
|
|
1444
|
-
export const modifyMessageRequestSchema = z.object({
|
|
1445
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
1446
|
-
});
|
|
1447
|
-
|
|
1448
|
-
export const modifyRunRequestSchema = z.object({
|
|
1449
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
1450
|
-
});
|
|
1451
|
-
|
|
1452
|
-
export const modifyThreadRequestSchema = z.object({
|
|
1453
|
-
tool_resources: z
|
|
1454
|
-
.object({
|
|
1455
|
-
code_interpreter: z
|
|
1456
|
-
.object({
|
|
1457
|
-
file_ids: z.array(z.string()).optional(),
|
|
1458
|
-
})
|
|
1459
|
-
.optional(),
|
|
1460
|
-
file_search: z
|
|
1461
|
-
.object({
|
|
1462
|
-
vector_store_ids: z.array(z.string()).optional(),
|
|
1463
|
-
})
|
|
1464
|
-
.optional(),
|
|
1465
|
-
})
|
|
1466
|
-
.optional()
|
|
1467
|
-
.nullable(),
|
|
1468
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
1469
|
-
});
|
|
1470
|
-
|
|
1471
|
-
export const purpose2Schema = z.union([
|
|
1472
|
-
z.literal('assistants'),
|
|
1473
|
-
z.literal('assistants_output'),
|
|
1474
|
-
z.literal('batch'),
|
|
1475
|
-
z.literal('batch_output'),
|
|
1476
|
-
z.literal('fine-tune'),
|
|
1477
|
-
z.literal('fine-tune-results'),
|
|
1478
|
-
z.literal('vision'),
|
|
1479
|
-
]);
|
|
1480
|
-
|
|
1481
|
-
export const status5Schema = z.union([z.literal('uploaded'), z.literal('processed'), z.literal('error')]);
|
|
1482
|
-
|
|
1483
|
-
export const otherChunkingStrategyResponseParamSchema = z.object({
|
|
1484
|
-
type: z.literal('other'),
|
|
1485
|
-
});
|
|
1486
|
-
|
|
1487
|
-
export const type15Schema = z.literal('other');
|
|
1488
|
-
|
|
1489
|
-
export const projectSchema = z.object({
|
|
1490
|
-
id: z.string(),
|
|
1491
|
-
object: z.literal('organization.project'),
|
|
1492
|
-
name: z.string(),
|
|
1493
|
-
created_at: z.number(),
|
|
1494
|
-
archived_at: z.number().optional().nullable(),
|
|
1495
|
-
status: z.union([z.literal('active'), z.literal('archived')]),
|
|
1496
|
-
});
|
|
1497
|
-
|
|
1498
|
-
export const object22Schema = z.literal('organization.project');
|
|
1499
|
-
|
|
1500
|
-
export const status6Schema = z.union([z.literal('active'), z.literal('archived')]);
|
|
1501
|
-
|
|
1502
|
-
export const projectUserSchema = z.object({
|
|
1503
|
-
object: z.literal('organization.project.user'),
|
|
1504
|
-
id: z.string(),
|
|
1505
|
-
name: z.string(),
|
|
1506
|
-
email: z.string(),
|
|
1507
|
-
role: z.union([z.literal('owner'), z.literal('member')]),
|
|
1508
|
-
added_at: z.number(),
|
|
1509
|
-
});
|
|
1510
|
-
|
|
1511
|
-
export const projectServiceAccountSchema = z.object({
|
|
1512
|
-
object: z.literal('organization.project.service_account'),
|
|
1513
|
-
id: z.string(),
|
|
1514
|
-
name: z.string(),
|
|
1515
|
-
role: z.union([z.literal('owner'), z.literal('member')]),
|
|
1516
|
-
created_at: z.number(),
|
|
1517
|
-
});
|
|
1518
|
-
|
|
1519
|
-
export const object23Schema = z.literal('organization.project.api_key');
|
|
1520
|
-
|
|
1521
|
-
export const projectApiKeyDeleteResponseSchema = z.object({
|
|
1522
|
-
object: z.literal('organization.project.api_key.deleted'),
|
|
1523
|
-
id: z.string(),
|
|
1524
|
-
deleted: z.boolean(),
|
|
1525
|
-
});
|
|
1526
|
-
|
|
1527
|
-
export const object24Schema = z.literal('organization.project.api_key.deleted');
|
|
1528
|
-
|
|
1529
|
-
export const projectApiKeySchema = z.object({
|
|
1530
|
-
object: z.literal('organization.project.api_key'),
|
|
1531
|
-
redacted_value: z.string(),
|
|
1532
|
-
name: z.string(),
|
|
1533
|
-
created_at: z.number(),
|
|
1534
|
-
id: z.string(),
|
|
1535
|
-
owner: z.object({
|
|
1536
|
-
type: z.union([z.literal('user'), z.literal('service_account')]).optional(),
|
|
1537
|
-
user: projectUserSchema.optional(),
|
|
1538
|
-
service_account: projectServiceAccountSchema.optional(),
|
|
1539
|
-
}),
|
|
1540
|
-
});
|
|
1541
|
-
|
|
1542
|
-
export const projectCreateRequestSchema = z.object({
|
|
1543
|
-
name: z.string(),
|
|
1544
|
-
});
|
|
1545
|
-
|
|
1546
|
-
export const projectListResponseSchema = z.object({
|
|
1547
|
-
object: z.literal('list'),
|
|
1548
|
-
data: z.array(projectSchema),
|
|
1549
|
-
first_id: z.string(),
|
|
1550
|
-
last_id: z.string(),
|
|
1551
|
-
has_more: z.boolean(),
|
|
1552
|
-
});
|
|
1553
|
-
|
|
1554
|
-
export const object25Schema = z.literal('organization.project.service_account');
|
|
1555
|
-
|
|
1556
|
-
export const role9Schema = z.union([z.literal('owner'), z.literal('member')]);
|
|
1557
|
-
|
|
1558
|
-
export const projectServiceAccountApiKeySchema = z.object({
|
|
1559
|
-
object: z.literal('organization.project.service_account.api_key'),
|
|
1560
|
-
value: z.string(),
|
|
1561
|
-
name: z.string(),
|
|
1562
|
-
created_at: z.number(),
|
|
1563
|
-
id: z.string(),
|
|
1564
|
-
});
|
|
1565
|
-
|
|
1566
|
-
export const object26Schema = z.literal('organization.project.service_account.api_key');
|
|
1567
|
-
|
|
1568
|
-
export const projectServiceAccountCreateRequestSchema = z.object({
|
|
1569
|
-
name: z.string(),
|
|
1570
|
-
});
|
|
1571
|
-
|
|
1572
|
-
export const projectServiceAccountCreateResponseSchema = z.object({
|
|
1573
|
-
object: z.literal('organization.project.service_account'),
|
|
1574
|
-
id: z.string(),
|
|
1575
|
-
name: z.string(),
|
|
1576
|
-
role: z.literal('member'),
|
|
1577
|
-
created_at: z.number(),
|
|
1578
|
-
api_key: projectServiceAccountApiKeySchema,
|
|
1579
|
-
});
|
|
1580
|
-
|
|
1581
|
-
export const role10Schema = z.literal('member');
|
|
1582
|
-
|
|
1583
|
-
export const projectServiceAccountDeleteResponseSchema = z.object({
|
|
1584
|
-
object: z.literal('organization.project.service_account.deleted'),
|
|
1585
|
-
id: z.string(),
|
|
1586
|
-
deleted: z.boolean(),
|
|
1587
|
-
});
|
|
1588
|
-
|
|
1589
|
-
export const object27Schema = z.literal('organization.project.service_account.deleted');
|
|
1590
|
-
|
|
1591
|
-
export const projectServiceAccountListResponseSchema = z.object({
|
|
1592
|
-
object: z.literal('list'),
|
|
1593
|
-
data: z.array(projectServiceAccountSchema),
|
|
1594
|
-
first_id: z.string(),
|
|
1595
|
-
last_id: z.string(),
|
|
1596
|
-
has_more: z.boolean(),
|
|
1597
|
-
});
|
|
1598
|
-
|
|
1599
|
-
export const projectUpdateRequestSchema = z.object({
|
|
1600
|
-
name: z.string(),
|
|
1601
|
-
});
|
|
1602
|
-
|
|
1603
|
-
export const object28Schema = z.literal('organization.project.user');
|
|
1604
|
-
|
|
1605
|
-
export const projectUserCreateRequestSchema = z.object({
|
|
1606
|
-
user_id: z.string(),
|
|
1607
|
-
role: z.union([z.literal('owner'), z.literal('member')]),
|
|
1608
|
-
});
|
|
1609
|
-
|
|
1610
|
-
export const projectUserDeleteResponseSchema = z.object({
|
|
1611
|
-
object: z.literal('organization.project.user.deleted'),
|
|
1612
|
-
id: z.string(),
|
|
1613
|
-
deleted: z.boolean(),
|
|
1614
|
-
});
|
|
1615
|
-
|
|
1616
|
-
export const object29Schema = z.literal('organization.project.user.deleted');
|
|
1617
|
-
|
|
1618
|
-
export const projectUserListResponseSchema = z.object({
|
|
1619
|
-
object: z.string(),
|
|
1620
|
-
data: z.array(projectUserSchema),
|
|
1621
|
-
first_id: z.string(),
|
|
1622
|
-
last_id: z.string(),
|
|
1623
|
-
has_more: z.boolean(),
|
|
1624
|
-
});
|
|
1625
|
-
|
|
1626
|
-
export const projectUserUpdateRequestSchema = z.object({
|
|
1627
|
-
role: z.union([z.literal('owner'), z.literal('member')]),
|
|
1628
|
-
});
|
|
1629
|
-
|
|
1630
|
-
export const type16Schema = z.literal('json_object');
|
|
1631
|
-
|
|
1632
|
-
export const responseFormatJsonSchemaSchemaSchema = z.record(z.unknown());
|
|
1633
|
-
|
|
1634
|
-
export const type17Schema = z.literal('json_schema');
|
|
1635
|
-
|
|
1636
|
-
export const runCompletionUsageSchema = z
|
|
1637
|
-
.object({
|
|
1638
|
-
completion_tokens: z.number(),
|
|
1639
|
-
prompt_tokens: z.number(),
|
|
1640
|
-
total_tokens: z.number(),
|
|
1641
|
-
})
|
|
1642
|
-
.nullable();
|
|
1643
|
-
|
|
1644
|
-
export const runToolCallObjectSchema = z.object({
|
|
1645
|
-
id: z.string(),
|
|
1646
|
-
type: z.literal('function'),
|
|
1647
|
-
function: z.object({
|
|
1648
|
-
name: z.string(),
|
|
1649
|
-
arguments: z.string(),
|
|
1650
|
-
}),
|
|
1651
|
-
});
|
|
1652
|
-
|
|
1653
|
-
export const object30Schema = z.literal('thread.run');
|
|
1654
|
-
|
|
1655
|
-
export const status7Schema = z.union([
|
|
1656
|
-
z.literal('queued'),
|
|
1657
|
-
z.literal('in_progress'),
|
|
1658
|
-
z.literal('requires_action'),
|
|
1659
|
-
z.literal('cancelling'),
|
|
1660
|
-
z.literal('cancelled'),
|
|
1661
|
-
z.literal('failed'),
|
|
1662
|
-
z.literal('completed'),
|
|
1663
|
-
z.literal('incomplete'),
|
|
1664
|
-
z.literal('expired'),
|
|
1665
|
-
]);
|
|
1666
|
-
|
|
1667
|
-
export const type18Schema = z.literal('submit_tool_outputs');
|
|
1668
|
-
|
|
1669
|
-
export const codeSchema = z.union([
|
|
1670
|
-
z.literal('server_error'),
|
|
1671
|
-
z.literal('rate_limit_exceeded'),
|
|
1672
|
-
z.literal('invalid_prompt'),
|
|
1673
|
-
]);
|
|
1674
|
-
|
|
1675
|
-
export const reason2Schema = z.union([z.literal('max_completion_tokens'), z.literal('max_prompt_tokens')]);
|
|
1676
|
-
|
|
1677
|
-
export const runStepCompletionUsageSchema = z
|
|
1678
|
-
.object({
|
|
1679
|
-
completion_tokens: z.number(),
|
|
1680
|
-
prompt_tokens: z.number(),
|
|
1681
|
-
total_tokens: z.number(),
|
|
1682
|
-
})
|
|
1683
|
-
.nullable();
|
|
1684
|
-
|
|
1685
|
-
export const runStepDeltaStepDetailsMessageCreationObjectSchema = z.object({
|
|
1686
|
-
type: z.literal('message_creation'),
|
|
1687
|
-
message_creation: z
|
|
1688
|
-
.object({
|
|
1689
|
-
message_id: z.string().optional(),
|
|
1690
|
-
})
|
|
1691
|
-
.optional(),
|
|
1692
|
-
});
|
|
1693
|
-
|
|
1694
|
-
export const object31Schema = z.literal('thread.run.step.delta');
|
|
1695
|
-
|
|
1696
|
-
export const type19Schema = z.literal('message_creation');
|
|
1697
|
-
|
|
1698
|
-
export const runStepDeltaStepDetailsToolCallsCodeOutputLogsObjectSchema = z.object({
|
|
1699
|
-
index: z.number(),
|
|
1700
|
-
type: z.literal('logs'),
|
|
1701
|
-
logs: z.string().optional(),
|
|
1702
|
-
});
|
|
1703
|
-
|
|
1704
|
-
export const runStepDeltaStepDetailsToolCallsCodeOutputImageObjectSchema = z.object({
|
|
1705
|
-
index: z.number(),
|
|
1706
|
-
type: z.literal('image'),
|
|
1707
|
-
image: z
|
|
1708
|
-
.object({
|
|
1709
|
-
file_id: z.string().optional(),
|
|
1710
|
-
})
|
|
1711
|
-
.optional(),
|
|
1712
|
-
});
|
|
1713
|
-
|
|
1714
|
-
export const type20Schema = z.literal('image');
|
|
1715
|
-
|
|
1716
|
-
export const type21Schema = z.literal('logs');
|
|
1717
|
-
|
|
1718
|
-
export const runStepDeltaStepDetailsToolCallsFileSearchObjectSchema = z.object({
|
|
1719
|
-
index: z.number(),
|
|
1720
|
-
id: z.string().optional(),
|
|
1721
|
-
type: z.literal('file_search'),
|
|
1722
|
-
file_search: z.record(z.unknown()),
|
|
1723
|
-
});
|
|
1724
|
-
|
|
1725
|
-
export const runStepDeltaStepDetailsToolCallsFunctionObjectSchema = z.object({
|
|
1726
|
-
index: z.number(),
|
|
1727
|
-
id: z.string().optional(),
|
|
1728
|
-
type: z.literal('function'),
|
|
1729
|
-
function: z
|
|
1730
|
-
.object({
|
|
1731
|
-
name: z.string().optional(),
|
|
1732
|
-
arguments: z.string().optional(),
|
|
1733
|
-
output: z.string().optional().nullable(),
|
|
1734
|
-
})
|
|
1735
|
-
.optional(),
|
|
1736
|
-
});
|
|
1737
|
-
|
|
1738
|
-
export const runStepDeltaStepDetailsToolCallsCodeObjectSchema = z.object({
|
|
1739
|
-
index: z.number(),
|
|
1740
|
-
id: z.string().optional(),
|
|
1741
|
-
type: z.literal('code_interpreter'),
|
|
1742
|
-
code_interpreter: z
|
|
1743
|
-
.object({
|
|
1744
|
-
input: z.string().optional(),
|
|
1745
|
-
outputs: z
|
|
1746
|
-
.array(
|
|
1747
|
-
z.union([
|
|
1748
|
-
runStepDeltaStepDetailsToolCallsCodeOutputLogsObjectSchema,
|
|
1749
|
-
runStepDeltaStepDetailsToolCallsCodeOutputImageObjectSchema,
|
|
1750
|
-
]),
|
|
1751
|
-
)
|
|
1752
|
-
.optional(),
|
|
1753
|
-
})
|
|
1754
|
-
.optional(),
|
|
1755
|
-
});
|
|
1756
|
-
|
|
1757
|
-
export const type22Schema = z.literal('tool_calls');
|
|
1758
|
-
|
|
1759
|
-
export const runStepDetailsMessageCreationObjectSchema = z.object({
|
|
1760
|
-
type: z.literal('message_creation'),
|
|
1761
|
-
message_creation: z.object({
|
|
1762
|
-
message_id: z.string(),
|
|
1763
|
-
}),
|
|
1764
|
-
});
|
|
1765
|
-
|
|
1766
|
-
export const runStepDetailsToolCallsCodeOutputLogsObjectSchema = z.object({
|
|
1767
|
-
type: z.literal('logs'),
|
|
1768
|
-
logs: z.string(),
|
|
1769
|
-
});
|
|
1770
|
-
|
|
1771
|
-
export const runStepDetailsToolCallsCodeOutputImageObjectSchema = z.object({
|
|
1772
|
-
type: z.literal('image'),
|
|
1773
|
-
image: z.object({
|
|
1774
|
-
file_id: z.string(),
|
|
1775
|
-
}),
|
|
1776
|
-
});
|
|
1777
|
-
|
|
1778
|
-
export const runStepDetailsToolCallsFileSearchObjectSchema = z.object({
|
|
1779
|
-
id: z.string(),
|
|
1780
|
-
type: z.literal('file_search'),
|
|
1781
|
-
file_search: z.record(z.unknown()),
|
|
1782
|
-
});
|
|
1783
|
-
|
|
1784
|
-
export const runStepDetailsToolCallsFunctionObjectSchema = z.object({
|
|
1785
|
-
id: z.string(),
|
|
1786
|
-
type: z.literal('function'),
|
|
1787
|
-
function: z.object({
|
|
1788
|
-
name: z.string(),
|
|
1789
|
-
arguments: z.string(),
|
|
1790
|
-
output: z.string().nullable(),
|
|
1791
|
-
}),
|
|
1792
|
-
});
|
|
1793
|
-
|
|
1794
|
-
export const runStepDetailsToolCallsCodeObjectSchema = z.object({
|
|
1795
|
-
id: z.string(),
|
|
1796
|
-
type: z.literal('code_interpreter'),
|
|
1797
|
-
code_interpreter: z.object({
|
|
1798
|
-
input: z.string(),
|
|
1799
|
-
outputs: z.array(
|
|
1800
|
-
z.union([runStepDetailsToolCallsCodeOutputLogsObjectSchema, runStepDetailsToolCallsCodeOutputImageObjectSchema]),
|
|
1801
|
-
),
|
|
1802
|
-
}),
|
|
1803
|
-
});
|
|
1804
|
-
|
|
1805
|
-
export const runStepDetailsToolCallsObjectSchema = z.object({
|
|
1806
|
-
type: z.literal('tool_calls'),
|
|
1807
|
-
tool_calls: z.array(
|
|
1808
|
-
z.union([
|
|
1809
|
-
runStepDetailsToolCallsCodeObjectSchema,
|
|
1810
|
-
runStepDetailsToolCallsFileSearchObjectSchema,
|
|
1811
|
-
runStepDetailsToolCallsFunctionObjectSchema,
|
|
1812
|
-
]),
|
|
1813
|
-
),
|
|
1814
|
-
});
|
|
1815
|
-
|
|
1816
|
-
export const object32Schema = z.literal('thread.run.step');
|
|
1817
|
-
|
|
1818
|
-
export const type23Schema = z.union([z.literal('message_creation'), z.literal('tool_calls')]);
|
|
1819
|
-
|
|
1820
|
-
export const status8Schema = z.union([
|
|
1821
|
-
z.literal('in_progress'),
|
|
1822
|
-
z.literal('cancelled'),
|
|
1823
|
-
z.literal('failed'),
|
|
1824
|
-
z.literal('completed'),
|
|
1825
|
-
z.literal('expired'),
|
|
1826
|
-
]);
|
|
1827
|
-
|
|
1828
|
-
export const code2Schema = z.union([z.literal('server_error'), z.literal('rate_limit_exceeded')]);
|
|
1829
|
-
|
|
1830
|
-
export const runStepObjectSchema = z.object({
|
|
1831
|
-
id: z.string(),
|
|
1832
|
-
object: z.literal('thread.run.step'),
|
|
1833
|
-
created_at: z.number(),
|
|
1834
|
-
assistant_id: z.string(),
|
|
1835
|
-
thread_id: z.string(),
|
|
1836
|
-
run_id: z.string(),
|
|
1837
|
-
type: z.union([z.literal('message_creation'), z.literal('tool_calls')]),
|
|
1838
|
-
status: z.union([
|
|
1839
|
-
z.literal('in_progress'),
|
|
1840
|
-
z.literal('cancelled'),
|
|
1841
|
-
z.literal('failed'),
|
|
1842
|
-
z.literal('completed'),
|
|
1843
|
-
z.literal('expired'),
|
|
1844
|
-
]),
|
|
1845
|
-
step_details: z.union([runStepDetailsMessageCreationObjectSchema, runStepDetailsToolCallsObjectSchema]),
|
|
1846
|
-
last_error: z
|
|
1847
|
-
.object({
|
|
1848
|
-
code: z.union([z.literal('server_error'), z.literal('rate_limit_exceeded')]),
|
|
1849
|
-
message: z.string(),
|
|
1850
|
-
})
|
|
1851
|
-
.nullable(),
|
|
1852
|
-
expired_at: z.number().nullable(),
|
|
1853
|
-
cancelled_at: z.number().nullable(),
|
|
1854
|
-
failed_at: z.number().nullable(),
|
|
1855
|
-
completed_at: z.number().nullable(),
|
|
1856
|
-
metadata: z.record(z.unknown()).nullable(),
|
|
1857
|
-
usage: runStepCompletionUsageSchema,
|
|
1858
|
-
});
|
|
1859
|
-
|
|
1860
|
-
export const event4Schema = z.literal('thread.run.step.created');
|
|
1861
|
-
|
|
1862
|
-
export const event5Schema = z.literal('thread.run.created');
|
|
1863
|
-
|
|
1864
|
-
export const staticChunkingStrategySchema = z.object({
|
|
1865
|
-
max_chunk_size_tokens: z.number(),
|
|
1866
|
-
chunk_overlap_tokens: z.number(),
|
|
1867
|
-
});
|
|
1868
|
-
|
|
1869
|
-
export const staticChunkingStrategyRequestParamSchema = z.object({
|
|
1870
|
-
type: z.literal('static'),
|
|
1871
|
-
static: staticChunkingStrategySchema,
|
|
1872
|
-
});
|
|
1873
|
-
|
|
1874
|
-
export const type24Schema = z.literal('static');
|
|
1875
|
-
|
|
1876
|
-
export const staticChunkingStrategyResponseParamSchema = z.object({
|
|
1877
|
-
type: z.literal('static'),
|
|
1878
|
-
static: staticChunkingStrategySchema,
|
|
1879
|
-
});
|
|
1880
|
-
|
|
1881
|
-
export const submitToolOutputsRunRequestSchema = z.object({
|
|
1882
|
-
tool_outputs: z.array(
|
|
1883
|
-
z.object({
|
|
1884
|
-
tool_call_id: z.string().optional(),
|
|
1885
|
-
output: z.string().optional(),
|
|
1886
|
-
}),
|
|
1887
|
-
),
|
|
1888
|
-
stream: z.boolean().optional().nullable(),
|
|
1889
|
-
});
|
|
1890
|
-
|
|
1891
|
-
export const object33Schema = z.literal('thread');
|
|
1892
|
-
|
|
1893
|
-
export const threadStreamEventSchema = z.object({
|
|
1894
|
-
event: z.literal('thread.created'),
|
|
1895
|
-
data: threadObjectSchema,
|
|
1896
|
-
});
|
|
1897
|
-
|
|
1898
|
-
export const event6Schema = z.literal('thread.created');
|
|
1899
|
-
|
|
1900
|
-
export const type25Schema = z.union([z.literal('auto'), z.literal('last_messages')]);
|
|
1901
|
-
|
|
1902
|
-
export const updateVectorStoreRequestSchema = z.object({
|
|
1903
|
-
name: z.string().optional().nullable(),
|
|
1904
|
-
expires_after: vectorStoreExpirationAfterSchema.optional(),
|
|
1905
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
1906
|
-
});
|
|
1907
|
-
|
|
1908
|
-
export const uploadSchema = z.object({
|
|
1909
|
-
id: z.string(),
|
|
1910
|
-
created_at: z.number(),
|
|
1911
|
-
filename: z.string(),
|
|
1912
|
-
bytes: z.number(),
|
|
1913
|
-
purpose: z.string(),
|
|
1914
|
-
status: z.union([z.literal('pending'), z.literal('completed'), z.literal('cancelled'), z.literal('expired')]),
|
|
1915
|
-
expires_at: z.number(),
|
|
1916
|
-
object: z.literal('upload').optional(),
|
|
1917
|
-
file: openAIFileSchema.optional(),
|
|
1918
|
-
});
|
|
1919
|
-
|
|
1920
|
-
export const status9Schema = z.union([
|
|
1921
|
-
z.literal('pending'),
|
|
1922
|
-
z.literal('completed'),
|
|
1923
|
-
z.literal('cancelled'),
|
|
1924
|
-
z.literal('expired'),
|
|
1925
|
-
]);
|
|
1926
|
-
|
|
1927
|
-
export const object34Schema = z.literal('upload');
|
|
1928
|
-
|
|
1929
|
-
export const uploadPartSchema = z.object({
|
|
1930
|
-
id: z.string(),
|
|
1931
|
-
created_at: z.number(),
|
|
1932
|
-
upload_id: z.string(),
|
|
1933
|
-
object: z.literal('upload.part'),
|
|
1934
|
-
});
|
|
1935
|
-
|
|
1936
|
-
export const object35Schema = z.literal('upload.part');
|
|
1937
|
-
|
|
1938
|
-
export const userSchema = z.object({
|
|
1939
|
-
object: z.literal('organization.user'),
|
|
1940
|
-
id: z.string(),
|
|
1941
|
-
name: z.string(),
|
|
1942
|
-
email: z.string(),
|
|
1943
|
-
role: z.union([z.literal('owner'), z.literal('reader')]),
|
|
1944
|
-
added_at: z.number(),
|
|
1945
|
-
});
|
|
1946
|
-
|
|
1947
|
-
export const object36Schema = z.literal('organization.user');
|
|
1948
|
-
|
|
1949
|
-
export const userDeleteResponseSchema = z.object({
|
|
1950
|
-
object: z.literal('organization.user.deleted'),
|
|
1951
|
-
id: z.string(),
|
|
1952
|
-
deleted: z.boolean(),
|
|
1953
|
-
});
|
|
1954
|
-
|
|
1955
|
-
export const object37Schema = z.literal('organization.user.deleted');
|
|
1956
|
-
|
|
1957
|
-
export const userListResponseSchema = z.object({
|
|
1958
|
-
object: z.literal('list'),
|
|
1959
|
-
data: z.array(userSchema),
|
|
1960
|
-
first_id: z.string(),
|
|
1961
|
-
last_id: z.string(),
|
|
1962
|
-
has_more: z.boolean(),
|
|
1963
|
-
});
|
|
1964
|
-
|
|
1965
|
-
export const userRoleUpdateRequestSchema = z.object({
|
|
1966
|
-
role: z.union([z.literal('owner'), z.literal('reader')]),
|
|
1967
|
-
});
|
|
1968
|
-
|
|
1969
|
-
export const anchorSchema = z.literal('last_active_at');
|
|
1970
|
-
|
|
1971
|
-
export const vectorStoreFileBatchObjectSchema = z.object({
|
|
1972
|
-
id: z.string(),
|
|
1973
|
-
object: z.literal('vector_store.files_batch'),
|
|
1974
|
-
created_at: z.number(),
|
|
1975
|
-
vector_store_id: z.string(),
|
|
1976
|
-
status: z.union([z.literal('in_progress'), z.literal('completed'), z.literal('cancelled'), z.literal('failed')]),
|
|
1977
|
-
file_counts: z.object({
|
|
1978
|
-
in_progress: z.number(),
|
|
1979
|
-
completed: z.number(),
|
|
1980
|
-
failed: z.number(),
|
|
1981
|
-
cancelled: z.number(),
|
|
1982
|
-
total: z.number(),
|
|
1983
|
-
}),
|
|
1984
|
-
});
|
|
1985
|
-
|
|
1986
|
-
export const object38Schema = z.literal('vector_store.files_batch');
|
|
1987
|
-
|
|
1988
|
-
export const status10Schema = z.union([
|
|
1989
|
-
z.literal('in_progress'),
|
|
1990
|
-
z.literal('completed'),
|
|
1991
|
-
z.literal('cancelled'),
|
|
1992
|
-
z.literal('failed'),
|
|
1993
|
-
]);
|
|
1994
|
-
|
|
1995
|
-
export const vectorStoreFileObjectSchema = z.object({
|
|
1996
|
-
id: z.string(),
|
|
1997
|
-
object: z.literal('vector_store.file'),
|
|
1998
|
-
usage_bytes: z.number(),
|
|
1999
|
-
created_at: z.number(),
|
|
2000
|
-
vector_store_id: z.string(),
|
|
2001
|
-
status: z.union([z.literal('in_progress'), z.literal('completed'), z.literal('cancelled'), z.literal('failed')]),
|
|
2002
|
-
last_error: z
|
|
2003
|
-
.object({
|
|
2004
|
-
code: z.union([z.literal('server_error'), z.literal('unsupported_file'), z.literal('invalid_file')]),
|
|
2005
|
-
message: z.string(),
|
|
2006
|
-
})
|
|
2007
|
-
.nullable(),
|
|
2008
|
-
chunking_strategy: z
|
|
2009
|
-
.union([staticChunkingStrategyResponseParamSchema, otherChunkingStrategyResponseParamSchema])
|
|
2010
|
-
.optional(),
|
|
2011
|
-
});
|
|
2012
|
-
|
|
2013
|
-
export const object39Schema = z.literal('vector_store.file');
|
|
2014
|
-
|
|
2015
|
-
export const code3Schema = z.union([
|
|
2016
|
-
z.literal('server_error'),
|
|
2017
|
-
z.literal('unsupported_file'),
|
|
2018
|
-
z.literal('invalid_file'),
|
|
2019
|
-
]);
|
|
2020
|
-
|
|
2021
|
-
export const object40Schema = z.literal('vector_store');
|
|
2022
|
-
|
|
2023
|
-
export const status11Schema = z.union([z.literal('expired'), z.literal('in_progress'), z.literal('completed')]);
|
|
2024
|
-
|
|
2025
|
-
export const createChatCompletionResponse2Schema = createChatCompletionResponseSchema;
|
|
2026
|
-
|
|
2027
|
-
export const createChatCompletionErrorSchema = z.unknown();
|
|
2028
|
-
|
|
2029
|
-
export const createCompletionDataSchema = z.object({
|
|
2030
|
-
body: createCompletionRequestSchema,
|
|
2031
|
-
});
|
|
2032
|
-
|
|
2033
|
-
export const createCompletionResponse2Schema = createCompletionResponseSchema;
|
|
2034
|
-
|
|
2035
|
-
export const createCompletionErrorSchema = z.unknown();
|
|
2036
|
-
|
|
2037
|
-
export const createImageDataSchema = z.object({
|
|
2038
|
-
body: createImageRequestSchema,
|
|
2039
|
-
});
|
|
2040
|
-
|
|
2041
|
-
export const createImageResponseSchema = imagesResponseSchema;
|
|
2042
|
-
|
|
2043
|
-
export const createImageErrorSchema = z.unknown();
|
|
2044
|
-
|
|
2045
|
-
export const createImageEditResponseSchema = imagesResponseSchema;
|
|
2046
|
-
|
|
2047
|
-
export const createImageEditErrorSchema = z.unknown();
|
|
2048
|
-
|
|
2049
|
-
export const createImageVariationResponseSchema = imagesResponseSchema;
|
|
2050
|
-
|
|
2051
|
-
export const createImageVariationErrorSchema = z.unknown();
|
|
2052
|
-
|
|
2053
|
-
export const createEmbeddingDataSchema = z.object({
|
|
2054
|
-
body: createEmbeddingRequestSchema,
|
|
2055
|
-
});
|
|
2056
|
-
|
|
2057
|
-
export const createEmbeddingResponseSchema = z.object({
|
|
2058
|
-
data: z.array(embeddingSchema),
|
|
2059
|
-
model: z.string(),
|
|
2060
|
-
object: z.literal('list'),
|
|
2061
|
-
usage: z.object({
|
|
2062
|
-
prompt_tokens: z.number(),
|
|
2063
|
-
total_tokens: z.number(),
|
|
2064
|
-
}),
|
|
2065
|
-
});
|
|
2066
|
-
|
|
2067
|
-
export const createEmbeddingErrorSchema = z.unknown();
|
|
2068
|
-
|
|
2069
|
-
export const createSpeechDataSchema = z.object({
|
|
2070
|
-
body: createSpeechRequestSchema,
|
|
2071
|
-
});
|
|
2072
|
-
|
|
2073
|
-
export const createSpeechErrorSchema = z.unknown();
|
|
2074
|
-
|
|
2075
|
-
export const createTranscriptionErrorSchema = z.unknown();
|
|
2076
|
-
|
|
2077
|
-
export const createTranslationResponseSchema = z.union([
|
|
2078
|
-
createTranslationResponseJsonSchema,
|
|
2079
|
-
createTranslationResponseVerboseJsonSchema,
|
|
2080
|
-
]);
|
|
2081
|
-
|
|
2082
|
-
export const createTranslationErrorSchema = z.unknown();
|
|
2083
|
-
|
|
2084
|
-
export const listFilesDataSchema = z.object({
|
|
2085
|
-
query: z
|
|
2086
|
-
.object({
|
|
2087
|
-
purpose: z.string().optional(),
|
|
2088
|
-
})
|
|
2089
|
-
.optional(),
|
|
2090
|
-
});
|
|
2091
|
-
|
|
2092
|
-
export const listFilesResponseSchema = z.object({
|
|
2093
|
-
data: z.array(openAIFileSchema),
|
|
2094
|
-
object: z.literal('list'),
|
|
2095
|
-
});
|
|
2096
|
-
|
|
2097
|
-
export const listFilesErrorSchema = z.unknown();
|
|
2098
|
-
|
|
2099
|
-
export const createFileResponseSchema = openAIFileSchema;
|
|
2100
|
-
|
|
2101
|
-
export const createFileErrorSchema = z.unknown();
|
|
2102
|
-
|
|
2103
|
-
export const deleteFileDataSchema = z.object({
|
|
2104
|
-
path: z.object({
|
|
2105
|
-
file_id: z.string(),
|
|
2106
|
-
}),
|
|
2107
|
-
});
|
|
2108
|
-
|
|
2109
|
-
export const deleteFileResponse2Schema = deleteFileResponseSchema;
|
|
2110
|
-
|
|
2111
|
-
export const deleteFileErrorSchema = z.unknown();
|
|
2112
|
-
|
|
2113
|
-
export const retrieveFileDataSchema = z.object({
|
|
2114
|
-
path: z.object({
|
|
2115
|
-
file_id: z.string(),
|
|
2116
|
-
}),
|
|
2117
|
-
});
|
|
2118
|
-
|
|
2119
|
-
export const retrieveFileResponseSchema = openAIFileSchema;
|
|
2120
|
-
|
|
2121
|
-
export const retrieveFileErrorSchema = z.unknown();
|
|
2122
|
-
|
|
2123
|
-
export const downloadFileDataSchema = z.object({
|
|
2124
|
-
path: z.object({
|
|
2125
|
-
file_id: z.string(),
|
|
2126
|
-
}),
|
|
2127
|
-
});
|
|
2128
|
-
|
|
2129
|
-
export const downloadFileResponseSchema = z.string();
|
|
2130
|
-
|
|
2131
|
-
export const downloadFileErrorSchema = z.unknown();
|
|
2132
|
-
|
|
2133
|
-
export const createUploadDataSchema = z.object({
|
|
2134
|
-
body: createUploadRequestSchema,
|
|
2135
|
-
});
|
|
2136
|
-
|
|
2137
|
-
export const createUploadResponseSchema = uploadSchema;
|
|
2138
|
-
|
|
2139
|
-
export const createUploadErrorSchema = z.unknown();
|
|
2140
|
-
|
|
2141
|
-
export const addUploadPartResponseSchema = uploadPartSchema;
|
|
2142
|
-
|
|
2143
|
-
export const addUploadPartErrorSchema = z.unknown();
|
|
2144
|
-
|
|
2145
|
-
export const completeUploadDataSchema = z.object({
|
|
2146
|
-
body: completeUploadRequestSchema,
|
|
2147
|
-
path: z.object({
|
|
2148
|
-
upload_id: z.string(),
|
|
2149
|
-
}),
|
|
2150
|
-
});
|
|
2151
|
-
|
|
2152
|
-
export const completeUploadResponseSchema = uploadSchema;
|
|
2153
|
-
|
|
2154
|
-
export const completeUploadErrorSchema = z.unknown();
|
|
2155
|
-
|
|
2156
|
-
export const cancelUploadDataSchema = z.object({
|
|
2157
|
-
path: z.object({
|
|
2158
|
-
upload_id: z.string(),
|
|
2159
|
-
}),
|
|
2160
|
-
});
|
|
2161
|
-
|
|
2162
|
-
export const cancelUploadResponseSchema = uploadSchema;
|
|
2163
|
-
|
|
2164
|
-
export const cancelUploadErrorSchema = z.unknown();
|
|
2165
|
-
|
|
2166
|
-
export const createFineTuningJobDataSchema = z.object({
|
|
2167
|
-
body: createFineTuningJobRequestSchema,
|
|
2168
|
-
});
|
|
2169
|
-
|
|
2170
|
-
export const createFineTuningJobResponseSchema = fineTuningJobSchema;
|
|
2171
|
-
|
|
2172
|
-
export const createFineTuningJobErrorSchema = z.unknown();
|
|
2173
|
-
|
|
2174
|
-
export const listPaginatedFineTuningJobsDataSchema = z.object({
|
|
2175
|
-
query: z
|
|
2176
|
-
.object({
|
|
2177
|
-
after: z.string().optional(),
|
|
2178
|
-
limit: z.number().optional(),
|
|
2179
|
-
})
|
|
2180
|
-
.optional(),
|
|
2181
|
-
});
|
|
2182
|
-
|
|
2183
|
-
export const listPaginatedFineTuningJobsResponse2Schema = listPaginatedFineTuningJobsResponseSchema;
|
|
2184
|
-
|
|
2185
|
-
export const listPaginatedFineTuningJobsErrorSchema = z.unknown();
|
|
2186
|
-
|
|
2187
|
-
export const retrieveFineTuningJobDataSchema = z.object({
|
|
2188
|
-
path: z.object({
|
|
2189
|
-
fine_tuning_job_id: z.string(),
|
|
2190
|
-
}),
|
|
2191
|
-
});
|
|
2192
|
-
|
|
2193
|
-
export const retrieveFineTuningJobResponseSchema = fineTuningJobSchema;
|
|
2194
|
-
|
|
2195
|
-
export const retrieveFineTuningJobErrorSchema = z.unknown();
|
|
2196
|
-
|
|
2197
|
-
export const listFineTuningEventsDataSchema = z.object({
|
|
2198
|
-
path: z.object({
|
|
2199
|
-
fine_tuning_job_id: z.string(),
|
|
2200
|
-
}),
|
|
2201
|
-
query: z
|
|
2202
|
-
.object({
|
|
2203
|
-
after: z.string().optional(),
|
|
2204
|
-
limit: z.number().optional(),
|
|
2205
|
-
})
|
|
2206
|
-
.optional(),
|
|
2207
|
-
});
|
|
2208
|
-
|
|
2209
|
-
export const listFineTuningEventsResponseSchema = listFineTuningJobEventsResponseSchema;
|
|
2210
|
-
|
|
2211
|
-
export const listFineTuningEventsErrorSchema = z.unknown();
|
|
2212
|
-
|
|
2213
|
-
export const cancelFineTuningJobDataSchema = z.object({
|
|
2214
|
-
path: z.object({
|
|
2215
|
-
fine_tuning_job_id: z.string(),
|
|
2216
|
-
}),
|
|
2217
|
-
});
|
|
2218
|
-
|
|
2219
|
-
export const cancelFineTuningJobResponseSchema = fineTuningJobSchema;
|
|
2220
|
-
|
|
2221
|
-
export const cancelFineTuningJobErrorSchema = z.unknown();
|
|
2222
|
-
|
|
2223
|
-
export const listFineTuningJobCheckpointsDataSchema = z.object({
|
|
2224
|
-
path: z.object({
|
|
2225
|
-
fine_tuning_job_id: z.string(),
|
|
2226
|
-
}),
|
|
2227
|
-
query: z
|
|
2228
|
-
.object({
|
|
2229
|
-
after: z.string().optional(),
|
|
2230
|
-
limit: z.number().optional(),
|
|
2231
|
-
})
|
|
2232
|
-
.optional(),
|
|
2233
|
-
});
|
|
2234
|
-
|
|
2235
|
-
export const listFineTuningJobCheckpointsResponse2Schema = listFineTuningJobCheckpointsResponseSchema;
|
|
2236
|
-
|
|
2237
|
-
export const listFineTuningJobCheckpointsErrorSchema = z.unknown();
|
|
2238
|
-
|
|
2239
|
-
export const listModelsResponseSchema = z.object({
|
|
2240
|
-
object: z.literal('list'),
|
|
2241
|
-
data: z.array(modelSchema),
|
|
2242
|
-
});
|
|
2243
|
-
|
|
2244
|
-
export const listModelsErrorSchema = z.unknown();
|
|
2245
|
-
|
|
2246
|
-
export const retrieveModelDataSchema = z.object({
|
|
2247
|
-
path: z.object({
|
|
2248
|
-
model: z.string(),
|
|
2249
|
-
}),
|
|
2250
|
-
});
|
|
2251
|
-
|
|
2252
|
-
export const retrieveModelResponseSchema = modelSchema;
|
|
2253
|
-
|
|
2254
|
-
export const retrieveModelErrorSchema = z.unknown();
|
|
2255
|
-
|
|
2256
|
-
export const deleteModelDataSchema = z.object({
|
|
2257
|
-
path: z.object({
|
|
2258
|
-
model: z.string(),
|
|
2259
|
-
}),
|
|
2260
|
-
});
|
|
2261
|
-
|
|
2262
|
-
export const deleteModelResponse2Schema = deleteModelResponseSchema;
|
|
2263
|
-
|
|
2264
|
-
export const deleteModelErrorSchema = z.unknown();
|
|
2265
|
-
|
|
2266
|
-
export const createModerationDataSchema = z.object({
|
|
2267
|
-
body: createModerationRequestSchema,
|
|
2268
|
-
});
|
|
2269
|
-
|
|
2270
|
-
export const createModerationResponse2Schema = createModerationResponseSchema;
|
|
2271
|
-
|
|
2272
|
-
export const createModerationErrorSchema = z.unknown();
|
|
2273
|
-
|
|
2274
|
-
export const listAssistantsDataSchema = z.object({
|
|
2275
|
-
query: z
|
|
2276
|
-
.object({
|
|
2277
|
-
after: z.string().optional(),
|
|
2278
|
-
before: z.string().optional(),
|
|
2279
|
-
limit: z.number().optional(),
|
|
2280
|
-
order: z.union([z.literal('asc'), z.literal('desc')]).optional(),
|
|
2281
|
-
})
|
|
2282
|
-
.optional(),
|
|
2283
|
-
});
|
|
2284
|
-
|
|
2285
|
-
export const listAssistantsErrorSchema = z.unknown();
|
|
2286
|
-
|
|
2287
|
-
export const createAssistantErrorSchema = z.unknown();
|
|
2288
|
-
|
|
2289
|
-
export const getAssistantDataSchema = z.object({
|
|
2290
|
-
path: z.object({
|
|
2291
|
-
assistant_id: z.string(),
|
|
2292
|
-
}),
|
|
2293
|
-
});
|
|
2294
|
-
|
|
2295
|
-
export const getAssistantErrorSchema = z.unknown();
|
|
2296
|
-
|
|
2297
|
-
export const modifyAssistantErrorSchema = z.unknown();
|
|
2298
|
-
|
|
2299
|
-
export const deleteAssistantDataSchema = z.object({
|
|
2300
|
-
path: z.object({
|
|
2301
|
-
assistant_id: z.string(),
|
|
2302
|
-
}),
|
|
2303
|
-
});
|
|
2304
|
-
|
|
2305
|
-
export const deleteAssistantResponse2Schema = deleteAssistantResponseSchema;
|
|
2306
|
-
|
|
2307
|
-
export const deleteAssistantErrorSchema = z.unknown();
|
|
2308
|
-
|
|
2309
|
-
export const createThreadDataSchema = z.object({
|
|
2310
|
-
body: createThreadRequestSchema.optional(),
|
|
2311
|
-
});
|
|
2312
|
-
|
|
2313
|
-
export const createThreadResponseSchema = threadObjectSchema;
|
|
2314
|
-
|
|
2315
|
-
export const createThreadErrorSchema = z.unknown();
|
|
2316
|
-
|
|
2317
|
-
export const getThreadDataSchema = z.object({
|
|
2318
|
-
path: z.object({
|
|
2319
|
-
thread_id: z.string(),
|
|
2320
|
-
}),
|
|
2321
|
-
});
|
|
2322
|
-
|
|
2323
|
-
export const getThreadResponseSchema = threadObjectSchema;
|
|
2324
|
-
|
|
2325
|
-
export const getThreadErrorSchema = z.unknown();
|
|
2326
|
-
|
|
2327
|
-
export const modifyThreadDataSchema = z.object({
|
|
2328
|
-
body: modifyThreadRequestSchema,
|
|
2329
|
-
path: z.object({
|
|
2330
|
-
thread_id: z.string(),
|
|
2331
|
-
}),
|
|
2332
|
-
});
|
|
2333
|
-
|
|
2334
|
-
export const modifyThreadResponseSchema = threadObjectSchema;
|
|
2335
|
-
|
|
2336
|
-
export const modifyThreadErrorSchema = z.unknown();
|
|
2337
|
-
|
|
2338
|
-
export const deleteThreadDataSchema = z.object({
|
|
2339
|
-
path: z.object({
|
|
2340
|
-
thread_id: z.string(),
|
|
2341
|
-
}),
|
|
2342
|
-
});
|
|
2343
|
-
|
|
2344
|
-
export const deleteThreadResponse2Schema = deleteThreadResponseSchema;
|
|
2345
|
-
|
|
2346
|
-
export const deleteThreadErrorSchema = z.unknown();
|
|
2347
|
-
|
|
2348
|
-
export const listMessagesDataSchema = z.object({
|
|
2349
|
-
path: z.object({
|
|
2350
|
-
thread_id: z.string(),
|
|
2351
|
-
}),
|
|
2352
|
-
query: z
|
|
2353
|
-
.object({
|
|
2354
|
-
after: z.string().optional(),
|
|
2355
|
-
before: z.string().optional(),
|
|
2356
|
-
limit: z.number().optional(),
|
|
2357
|
-
order: z.union([z.literal('asc'), z.literal('desc')]).optional(),
|
|
2358
|
-
run_id: z.string().optional(),
|
|
2359
|
-
})
|
|
2360
|
-
.optional(),
|
|
2361
|
-
});
|
|
2362
|
-
|
|
2363
|
-
export const listMessagesResponseSchema = z.object({
|
|
2364
|
-
object: z.string(),
|
|
2365
|
-
data: z.array(messageObjectSchema),
|
|
2366
|
-
first_id: z.string(),
|
|
2367
|
-
last_id: z.string(),
|
|
2368
|
-
has_more: z.boolean(),
|
|
2369
|
-
});
|
|
2370
|
-
|
|
2371
|
-
export const listMessagesErrorSchema = z.unknown();
|
|
2372
|
-
|
|
2373
|
-
export const createMessageDataSchema = z.object({
|
|
2374
|
-
body: createMessageRequestSchema,
|
|
2375
|
-
path: z.object({
|
|
2376
|
-
thread_id: z.string(),
|
|
2377
|
-
}),
|
|
2378
|
-
});
|
|
2379
|
-
|
|
2380
|
-
export const createMessageResponseSchema = messageObjectSchema;
|
|
2381
|
-
|
|
2382
|
-
export const createMessageErrorSchema = z.unknown();
|
|
2383
|
-
|
|
2384
|
-
export const getMessageDataSchema = z.object({
|
|
2385
|
-
path: z.object({
|
|
2386
|
-
message_id: z.string(),
|
|
2387
|
-
thread_id: z.string(),
|
|
2388
|
-
}),
|
|
2389
|
-
});
|
|
2390
|
-
|
|
2391
|
-
export const getMessageResponseSchema = messageObjectSchema;
|
|
2392
|
-
|
|
2393
|
-
export const getMessageErrorSchema = z.unknown();
|
|
2394
|
-
|
|
2395
|
-
export const modifyMessageDataSchema = z.object({
|
|
2396
|
-
body: modifyMessageRequestSchema,
|
|
2397
|
-
path: z.object({
|
|
2398
|
-
message_id: z.string(),
|
|
2399
|
-
thread_id: z.string(),
|
|
2400
|
-
}),
|
|
2401
|
-
});
|
|
2402
|
-
|
|
2403
|
-
export const modifyMessageResponseSchema = messageObjectSchema;
|
|
2404
|
-
|
|
2405
|
-
export const modifyMessageErrorSchema = z.unknown();
|
|
2406
|
-
|
|
2407
|
-
export const deleteMessageDataSchema = z.object({
|
|
2408
|
-
path: z.object({
|
|
2409
|
-
message_id: z.string(),
|
|
2410
|
-
thread_id: z.string(),
|
|
2411
|
-
}),
|
|
2412
|
-
});
|
|
2413
|
-
|
|
2414
|
-
export const deleteMessageResponse2Schema = deleteMessageResponseSchema;
|
|
2415
|
-
|
|
2416
|
-
export const deleteMessageErrorSchema = z.unknown();
|
|
2417
|
-
|
|
2418
|
-
export const createThreadAndRunErrorSchema = z.unknown();
|
|
2419
|
-
|
|
2420
|
-
export const listRunsDataSchema = z.object({
|
|
2421
|
-
path: z.object({
|
|
2422
|
-
thread_id: z.string(),
|
|
2423
|
-
}),
|
|
2424
|
-
query: z
|
|
2425
|
-
.object({
|
|
2426
|
-
after: z.string().optional(),
|
|
2427
|
-
before: z.string().optional(),
|
|
2428
|
-
limit: z.number().optional(),
|
|
2429
|
-
order: z.union([z.literal('asc'), z.literal('desc')]).optional(),
|
|
2430
|
-
})
|
|
2431
|
-
.optional(),
|
|
2432
|
-
});
|
|
2433
|
-
|
|
2434
|
-
export const listRunsErrorSchema = z.unknown();
|
|
2435
|
-
|
|
2436
|
-
export const createRunErrorSchema = z.unknown();
|
|
2437
|
-
|
|
2438
|
-
export const getRunDataSchema = z.object({
|
|
2439
|
-
path: z.object({
|
|
2440
|
-
run_id: z.string(),
|
|
2441
|
-
thread_id: z.string(),
|
|
2442
|
-
}),
|
|
2443
|
-
});
|
|
2444
|
-
|
|
2445
|
-
export const getRunErrorSchema = z.unknown();
|
|
2446
|
-
|
|
2447
|
-
export const modifyRunDataSchema = z.object({
|
|
2448
|
-
body: modifyRunRequestSchema,
|
|
2449
|
-
path: z.object({
|
|
2450
|
-
run_id: z.string(),
|
|
2451
|
-
thread_id: z.string(),
|
|
2452
|
-
}),
|
|
2453
|
-
});
|
|
2454
|
-
|
|
2455
|
-
export const modifyRunErrorSchema = z.unknown();
|
|
2456
|
-
|
|
2457
|
-
export const submitToolOuputsToRunDataSchema = z.object({
|
|
2458
|
-
body: submitToolOutputsRunRequestSchema,
|
|
2459
|
-
path: z.object({
|
|
2460
|
-
run_id: z.string(),
|
|
2461
|
-
thread_id: z.string(),
|
|
2462
|
-
}),
|
|
2463
|
-
});
|
|
2464
|
-
|
|
2465
|
-
export const submitToolOuputsToRunErrorSchema = z.unknown();
|
|
2466
|
-
|
|
2467
|
-
export const cancelRunDataSchema = z.object({
|
|
2468
|
-
path: z.object({
|
|
2469
|
-
run_id: z.string(),
|
|
2470
|
-
thread_id: z.string(),
|
|
2471
|
-
}),
|
|
2472
|
-
});
|
|
2473
|
-
|
|
2474
|
-
export const cancelRunErrorSchema = z.unknown();
|
|
2475
|
-
|
|
2476
|
-
export const listRunStepsDataSchema = z.object({
|
|
2477
|
-
path: z.object({
|
|
2478
|
-
run_id: z.string(),
|
|
2479
|
-
thread_id: z.string(),
|
|
2480
|
-
}),
|
|
2481
|
-
query: z
|
|
2482
|
-
.object({
|
|
2483
|
-
after: z.string().optional(),
|
|
2484
|
-
before: z.string().optional(),
|
|
2485
|
-
limit: z.number().optional(),
|
|
2486
|
-
order: z.union([z.literal('asc'), z.literal('desc')]).optional(),
|
|
2487
|
-
})
|
|
2488
|
-
.optional(),
|
|
2489
|
-
});
|
|
2490
|
-
|
|
2491
|
-
export const listRunStepsResponseSchema = z.object({
|
|
2492
|
-
object: z.string(),
|
|
2493
|
-
data: z.array(runStepObjectSchema),
|
|
2494
|
-
first_id: z.string(),
|
|
2495
|
-
last_id: z.string(),
|
|
2496
|
-
has_more: z.boolean(),
|
|
2497
|
-
});
|
|
2498
|
-
|
|
2499
|
-
export const listRunStepsErrorSchema = z.unknown();
|
|
2500
|
-
|
|
2501
|
-
export const getRunStepDataSchema = z.object({
|
|
2502
|
-
path: z.object({
|
|
2503
|
-
run_id: z.string(),
|
|
2504
|
-
step_id: z.string(),
|
|
2505
|
-
thread_id: z.string(),
|
|
2506
|
-
}),
|
|
2507
|
-
});
|
|
2508
|
-
|
|
2509
|
-
export const getRunStepResponseSchema = runStepObjectSchema;
|
|
2510
|
-
|
|
2511
|
-
export const getRunStepErrorSchema = z.unknown();
|
|
2512
|
-
|
|
2513
|
-
export const listVectorStoresDataSchema = z.object({
|
|
2514
|
-
query: z
|
|
2515
|
-
.object({
|
|
2516
|
-
after: z.string().optional(),
|
|
2517
|
-
before: z.string().optional(),
|
|
2518
|
-
limit: z.number().optional(),
|
|
2519
|
-
order: z.union([z.literal('asc'), z.literal('desc')]).optional(),
|
|
2520
|
-
})
|
|
2521
|
-
.optional(),
|
|
2522
|
-
});
|
|
2523
|
-
|
|
2524
|
-
export const listVectorStoresResponseSchema = z.object({
|
|
2525
|
-
object: z.string(),
|
|
2526
|
-
data: z.array(vectorStoreObjectSchema),
|
|
2527
|
-
first_id: z.string(),
|
|
2528
|
-
last_id: z.string(),
|
|
2529
|
-
has_more: z.boolean(),
|
|
2530
|
-
});
|
|
2531
|
-
|
|
2532
|
-
export const listVectorStoresErrorSchema = z.unknown();
|
|
2533
|
-
|
|
2534
|
-
export const createVectorStoreRequestSchema = z.object({
|
|
2535
|
-
file_ids: z.array(z.string()).optional(),
|
|
2536
|
-
name: z.string().optional(),
|
|
2537
|
-
expires_after: vectorStoreExpirationAfterSchema.optional(),
|
|
2538
|
-
chunking_strategy: z
|
|
2539
|
-
.union([autoChunkingStrategyRequestParamSchema, staticChunkingStrategyRequestParamSchema])
|
|
2540
|
-
.optional(),
|
|
2541
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
2542
|
-
});
|
|
2543
|
-
|
|
2544
|
-
export const createVectorStoreResponseSchema = vectorStoreObjectSchema;
|
|
2545
|
-
|
|
2546
|
-
export const createVectorStoreErrorSchema = z.unknown();
|
|
2547
|
-
|
|
2548
|
-
export const getVectorStoreDataSchema = z.object({
|
|
2549
|
-
path: z.object({
|
|
2550
|
-
vector_store_id: z.string(),
|
|
2551
|
-
}),
|
|
2552
|
-
});
|
|
2553
|
-
|
|
2554
|
-
export const getVectorStoreResponseSchema = vectorStoreObjectSchema;
|
|
2555
|
-
|
|
2556
|
-
export const getVectorStoreErrorSchema = z.unknown();
|
|
2557
|
-
|
|
2558
|
-
export const modifyVectorStoreDataSchema = z.object({
|
|
2559
|
-
body: updateVectorStoreRequestSchema,
|
|
2560
|
-
path: z.object({
|
|
2561
|
-
vector_store_id: z.string(),
|
|
2562
|
-
}),
|
|
2563
|
-
});
|
|
2564
|
-
|
|
2565
|
-
export const modifyVectorStoreResponseSchema = vectorStoreObjectSchema;
|
|
2566
|
-
|
|
2567
|
-
export const modifyVectorStoreErrorSchema = z.unknown();
|
|
2568
|
-
|
|
2569
|
-
export const deleteVectorStoreDataSchema = z.object({
|
|
2570
|
-
path: z.object({
|
|
2571
|
-
vector_store_id: z.string(),
|
|
2572
|
-
}),
|
|
2573
|
-
});
|
|
2574
|
-
|
|
2575
|
-
export const deleteVectorStoreResponse2Schema = deleteVectorStoreResponseSchema;
|
|
2576
|
-
|
|
2577
|
-
export const deleteVectorStoreErrorSchema = z.unknown();
|
|
2578
|
-
|
|
2579
|
-
export const listVectorStoreFilesDataSchema = z.object({
|
|
2580
|
-
path: z.object({
|
|
2581
|
-
vector_store_id: z.string(),
|
|
2582
|
-
}),
|
|
2583
|
-
query: z
|
|
2584
|
-
.object({
|
|
2585
|
-
after: z.string().optional(),
|
|
2586
|
-
before: z.string().optional(),
|
|
2587
|
-
filter: z
|
|
2588
|
-
.union([z.literal('in_progress'), z.literal('completed'), z.literal('failed'), z.literal('cancelled')])
|
|
2589
|
-
.optional(),
|
|
2590
|
-
limit: z.number().optional(),
|
|
2591
|
-
order: z.union([z.literal('asc'), z.literal('desc')]).optional(),
|
|
2592
|
-
})
|
|
2593
|
-
.optional(),
|
|
2594
|
-
});
|
|
2595
|
-
|
|
2596
|
-
export const listVectorStoreFilesResponseSchema = z.object({
|
|
2597
|
-
object: z.string(),
|
|
2598
|
-
data: z.array(vectorStoreFileObjectSchema),
|
|
2599
|
-
first_id: z.string(),
|
|
2600
|
-
last_id: z.string(),
|
|
2601
|
-
has_more: z.boolean(),
|
|
2602
|
-
});
|
|
2603
|
-
|
|
2604
|
-
export const listVectorStoreFilesErrorSchema = z.unknown();
|
|
2605
|
-
|
|
2606
|
-
export const createVectorStoreFileResponseSchema = vectorStoreFileObjectSchema;
|
|
2607
|
-
|
|
2608
|
-
export const createVectorStoreFileErrorSchema = z.unknown();
|
|
2609
|
-
|
|
2610
|
-
export const getVectorStoreFileDataSchema = z.object({
|
|
2611
|
-
path: z.object({
|
|
2612
|
-
file_id: z.string(),
|
|
2613
|
-
vector_store_id: z.string(),
|
|
2614
|
-
}),
|
|
2615
|
-
});
|
|
2616
|
-
|
|
2617
|
-
export const getVectorStoreFileResponseSchema = vectorStoreFileObjectSchema;
|
|
2618
|
-
|
|
2619
|
-
export const getVectorStoreFileErrorSchema = z.unknown();
|
|
2620
|
-
|
|
2621
|
-
export const deleteVectorStoreFileDataSchema = z.object({
|
|
2622
|
-
path: z.object({
|
|
2623
|
-
file_id: z.string(),
|
|
2624
|
-
vector_store_id: z.string(),
|
|
2625
|
-
}),
|
|
2626
|
-
});
|
|
2627
|
-
|
|
2628
|
-
export const deleteVectorStoreFileResponse2Schema = deleteVectorStoreFileResponseSchema;
|
|
2629
|
-
|
|
2630
|
-
export const deleteVectorStoreFileErrorSchema = z.unknown();
|
|
2631
|
-
|
|
2632
|
-
export const createVectorStoreFileBatchResponseSchema = vectorStoreFileBatchObjectSchema;
|
|
2633
|
-
|
|
2634
|
-
export const createVectorStoreFileBatchErrorSchema = z.unknown();
|
|
2635
|
-
|
|
2636
|
-
export const getVectorStoreFileBatchDataSchema = z.object({
|
|
2637
|
-
path: z.object({
|
|
2638
|
-
batch_id: z.string(),
|
|
2639
|
-
vector_store_id: z.string(),
|
|
2640
|
-
}),
|
|
2641
|
-
});
|
|
2642
|
-
|
|
2643
|
-
export const getVectorStoreFileBatchResponseSchema = vectorStoreFileBatchObjectSchema;
|
|
2644
|
-
|
|
2645
|
-
export const getVectorStoreFileBatchErrorSchema = z.unknown();
|
|
2646
|
-
|
|
2647
|
-
export const cancelVectorStoreFileBatchDataSchema = z.object({
|
|
2648
|
-
path: z.object({
|
|
2649
|
-
batch_id: z.string(),
|
|
2650
|
-
vector_store_id: z.string(),
|
|
2651
|
-
}),
|
|
2652
|
-
});
|
|
2653
|
-
|
|
2654
|
-
export const cancelVectorStoreFileBatchResponseSchema = vectorStoreFileBatchObjectSchema;
|
|
2655
|
-
|
|
2656
|
-
export const cancelVectorStoreFileBatchErrorSchema = z.unknown();
|
|
2657
|
-
|
|
2658
|
-
export const listFilesInVectorStoreBatchDataSchema = z.object({
|
|
2659
|
-
path: z.object({
|
|
2660
|
-
batch_id: z.string(),
|
|
2661
|
-
vector_store_id: z.string(),
|
|
2662
|
-
}),
|
|
2663
|
-
query: z
|
|
2664
|
-
.object({
|
|
2665
|
-
after: z.string().optional(),
|
|
2666
|
-
before: z.string().optional(),
|
|
2667
|
-
filter: z
|
|
2668
|
-
.union([z.literal('in_progress'), z.literal('completed'), z.literal('failed'), z.literal('cancelled')])
|
|
2669
|
-
.optional(),
|
|
2670
|
-
limit: z.number().optional(),
|
|
2671
|
-
order: z.union([z.literal('asc'), z.literal('desc')]).optional(),
|
|
2672
|
-
})
|
|
2673
|
-
.optional(),
|
|
2674
|
-
});
|
|
2675
|
-
|
|
2676
|
-
export const listFilesInVectorStoreBatchResponseSchema = listVectorStoreFilesResponseSchema;
|
|
2677
|
-
|
|
2678
|
-
export const listFilesInVectorStoreBatchErrorSchema = z.unknown();
|
|
2679
|
-
|
|
2680
|
-
export const createBatchDataSchema = z.object({
|
|
2681
|
-
body: z.object({
|
|
2682
|
-
input_file_id: z.string(),
|
|
2683
|
-
endpoint: z.union([z.literal('/v1/chat/completions'), z.literal('/v1/embeddings'), z.literal('/v1/completions')]),
|
|
2684
|
-
completion_window: z.literal('24h'),
|
|
2685
|
-
metadata: z.record(z.string()).optional().nullable(),
|
|
2686
|
-
}),
|
|
2687
|
-
});
|
|
2688
|
-
|
|
2689
|
-
export const createBatchResponseSchema = batchSchema;
|
|
2690
|
-
|
|
2691
|
-
export const createBatchErrorSchema = z.unknown();
|
|
2692
|
-
|
|
2693
|
-
export const listBatchesDataSchema = z.object({
|
|
2694
|
-
query: z
|
|
2695
|
-
.object({
|
|
2696
|
-
after: z.string().optional(),
|
|
2697
|
-
limit: z.number().optional(),
|
|
2698
|
-
})
|
|
2699
|
-
.optional(),
|
|
2700
|
-
});
|
|
2701
|
-
|
|
2702
|
-
export const listBatchesResponse2Schema = listBatchesResponseSchema;
|
|
2703
|
-
|
|
2704
|
-
export const listBatchesErrorSchema = z.unknown();
|
|
2705
|
-
|
|
2706
|
-
export const retrieveBatchDataSchema = z.object({
|
|
2707
|
-
path: z.object({
|
|
2708
|
-
batch_id: z.string(),
|
|
2709
|
-
}),
|
|
2710
|
-
});
|
|
2711
|
-
|
|
2712
|
-
export const retrieveBatchResponseSchema = batchSchema;
|
|
2713
|
-
|
|
2714
|
-
export const retrieveBatchErrorSchema = z.unknown();
|
|
2715
|
-
|
|
2716
|
-
export const cancelBatchDataSchema = z.object({
|
|
2717
|
-
path: z.object({
|
|
2718
|
-
batch_id: z.string(),
|
|
2719
|
-
}),
|
|
2720
|
-
});
|
|
2721
|
-
|
|
2722
|
-
export const cancelBatchResponseSchema = batchSchema;
|
|
2723
|
-
|
|
2724
|
-
export const cancelBatchErrorSchema = z.unknown();
|
|
2725
|
-
|
|
2726
|
-
export const listAuditLogsDataSchema = z.object({
|
|
2727
|
-
query: z
|
|
2728
|
-
.object({
|
|
2729
|
-
'actor_emails[]': z.array(z.string()).optional(),
|
|
2730
|
-
'actor_ids[]': z.array(z.string()).optional(),
|
|
2731
|
-
after: z.string().optional(),
|
|
2732
|
-
before: z.string().optional(),
|
|
2733
|
-
effective_at: z
|
|
2734
|
-
.object({
|
|
2735
|
-
gt: z.number().optional(),
|
|
2736
|
-
gte: z.number().optional(),
|
|
2737
|
-
lt: z.number().optional(),
|
|
2738
|
-
lte: z.number().optional(),
|
|
2739
|
-
})
|
|
2740
|
-
.optional(),
|
|
2741
|
-
'event_types[]': z.array(auditLogEventTypeSchema).optional(),
|
|
2742
|
-
limit: z.number().optional(),
|
|
2743
|
-
'project_ids[]': z.array(z.string()).optional(),
|
|
2744
|
-
'resource_ids[]': z.array(z.string()).optional(),
|
|
2745
|
-
})
|
|
2746
|
-
.optional(),
|
|
2747
|
-
});
|
|
2748
|
-
|
|
2749
|
-
export const listAuditLogsErrorSchema = z.unknown();
|
|
2750
|
-
|
|
2751
|
-
export const listInvitesDataSchema = z.object({
|
|
2752
|
-
query: z
|
|
2753
|
-
.object({
|
|
2754
|
-
after: z.string().optional(),
|
|
2755
|
-
limit: z.number().optional(),
|
|
2756
|
-
})
|
|
2757
|
-
.optional(),
|
|
2758
|
-
});
|
|
2759
|
-
|
|
2760
|
-
export const listInvitesResponseSchema = inviteListResponseSchema;
|
|
2761
|
-
|
|
2762
|
-
export const listInvitesErrorSchema = z.unknown();
|
|
2763
|
-
|
|
2764
|
-
export const inviteUserDataSchema = z.object({
|
|
2765
|
-
body: inviteRequestSchema,
|
|
2766
|
-
});
|
|
2767
|
-
|
|
2768
|
-
export const inviteUserResponseSchema = inviteSchema;
|
|
2769
|
-
|
|
2770
|
-
export const inviteUserErrorSchema = z.unknown();
|
|
2771
|
-
|
|
2772
|
-
export const retrieveInviteDataSchema = z.object({
|
|
2773
|
-
path: z.object({
|
|
2774
|
-
invite_id: z.string(),
|
|
2775
|
-
}),
|
|
2776
|
-
});
|
|
2777
|
-
|
|
2778
|
-
export const retrieveInviteResponseSchema = inviteSchema;
|
|
2779
|
-
|
|
2780
|
-
export const retrieveInviteErrorSchema = z.unknown();
|
|
2781
|
-
|
|
2782
|
-
export const deleteInviteDataSchema = z.object({
|
|
2783
|
-
path: z.object({
|
|
2784
|
-
invite_id: z.string(),
|
|
2785
|
-
}),
|
|
2786
|
-
});
|
|
2787
|
-
|
|
2788
|
-
export const deleteInviteResponseSchema = inviteDeleteResponseSchema;
|
|
2789
|
-
|
|
2790
|
-
export const deleteInviteErrorSchema = z.unknown();
|
|
2791
|
-
|
|
2792
|
-
export const listUsersDataSchema = z.object({
|
|
2793
|
-
query: z
|
|
2794
|
-
.object({
|
|
2795
|
-
after: z.string().optional(),
|
|
2796
|
-
limit: z.number().optional(),
|
|
2797
|
-
})
|
|
2798
|
-
.optional(),
|
|
2799
|
-
});
|
|
2800
|
-
|
|
2801
|
-
export const listUsersResponseSchema = userListResponseSchema;
|
|
2802
|
-
|
|
2803
|
-
export const listUsersErrorSchema = z.unknown();
|
|
2804
|
-
|
|
2805
|
-
export const retrieveUserDataSchema = z.object({
|
|
2806
|
-
path: z.object({
|
|
2807
|
-
user_id: z.string(),
|
|
2808
|
-
}),
|
|
2809
|
-
});
|
|
2810
|
-
|
|
2811
|
-
export const retrieveUserResponseSchema = userSchema;
|
|
2812
|
-
|
|
2813
|
-
export const retrieveUserErrorSchema = z.unknown();
|
|
2814
|
-
|
|
2815
|
-
export const modifyUserDataSchema = z.object({
|
|
2816
|
-
body: userRoleUpdateRequestSchema,
|
|
2817
|
-
});
|
|
2818
|
-
|
|
2819
|
-
export const modifyUserResponseSchema = userSchema;
|
|
2820
|
-
|
|
2821
|
-
export const modifyUserErrorSchema = z.unknown();
|
|
2822
|
-
|
|
2823
|
-
export const deleteUserDataSchema = z.object({
|
|
2824
|
-
path: z.object({
|
|
2825
|
-
user_id: z.string(),
|
|
2826
|
-
}),
|
|
2827
|
-
});
|
|
2828
|
-
|
|
2829
|
-
export const deleteUserResponseSchema = userDeleteResponseSchema;
|
|
2830
|
-
|
|
2831
|
-
export const deleteUserErrorSchema = z.unknown();
|
|
2832
|
-
|
|
2833
|
-
export const listProjectsDataSchema = z.object({
|
|
2834
|
-
query: z
|
|
2835
|
-
.object({
|
|
2836
|
-
after: z.string().optional(),
|
|
2837
|
-
include_archived: z.boolean().optional(),
|
|
2838
|
-
limit: z.number().optional(),
|
|
2839
|
-
})
|
|
2840
|
-
.optional(),
|
|
2841
|
-
});
|
|
2842
|
-
|
|
2843
|
-
export const listProjectsResponseSchema = projectListResponseSchema;
|
|
2844
|
-
|
|
2845
|
-
export const listProjectsErrorSchema = z.unknown();
|
|
2846
|
-
|
|
2847
|
-
export const createProjectDataSchema = z.object({
|
|
2848
|
-
body: projectCreateRequestSchema,
|
|
2849
|
-
});
|
|
2850
|
-
|
|
2851
|
-
export const createProjectResponseSchema = projectSchema;
|
|
2852
|
-
|
|
2853
|
-
export const createProjectErrorSchema = z.unknown();
|
|
2854
|
-
|
|
2855
|
-
export const retrieveProjectDataSchema = z.object({
|
|
2856
|
-
path: z.object({
|
|
2857
|
-
project_id: z.string(),
|
|
2858
|
-
}),
|
|
2859
|
-
});
|
|
2860
|
-
|
|
2861
|
-
export const retrieveProjectResponseSchema = projectSchema;
|
|
2862
|
-
|
|
2863
|
-
export const retrieveProjectErrorSchema = z.unknown();
|
|
2864
|
-
|
|
2865
|
-
export const modifyProjectDataSchema = z.object({
|
|
2866
|
-
body: projectUpdateRequestSchema,
|
|
2867
|
-
});
|
|
2868
|
-
|
|
2869
|
-
export const modifyProjectResponseSchema = projectSchema;
|
|
2870
|
-
|
|
2871
|
-
export const modifyProjectErrorSchema = errorResponseSchema;
|
|
2872
|
-
|
|
2873
|
-
export const archiveProjectDataSchema = z.object({
|
|
2874
|
-
path: z.object({
|
|
2875
|
-
project_id: z.string(),
|
|
2876
|
-
}),
|
|
2877
|
-
});
|
|
2878
|
-
|
|
2879
|
-
export const archiveProjectResponseSchema = projectSchema;
|
|
2880
|
-
|
|
2881
|
-
export const archiveProjectErrorSchema = z.unknown();
|
|
2882
|
-
|
|
2883
|
-
export const listProjectUsersDataSchema = z.object({
|
|
2884
|
-
path: z.object({
|
|
2885
|
-
project_id: z.string(),
|
|
2886
|
-
}),
|
|
2887
|
-
query: z
|
|
2888
|
-
.object({
|
|
2889
|
-
after: z.string().optional(),
|
|
2890
|
-
limit: z.number().optional(),
|
|
2891
|
-
})
|
|
2892
|
-
.optional(),
|
|
2893
|
-
});
|
|
2894
|
-
|
|
2895
|
-
export const listProjectUsersResponseSchema = projectUserListResponseSchema;
|
|
2896
|
-
|
|
2897
|
-
export const listProjectUsersErrorSchema = errorResponseSchema;
|
|
2898
|
-
|
|
2899
|
-
export const createProjectUserDataSchema = z.object({
|
|
2900
|
-
body: projectUserCreateRequestSchema,
|
|
2901
|
-
path: z.object({
|
|
2902
|
-
project_id: z.string(),
|
|
2903
|
-
}),
|
|
2904
|
-
});
|
|
2905
|
-
|
|
2906
|
-
export const createProjectUserResponseSchema = projectUserSchema;
|
|
2907
|
-
|
|
2908
|
-
export const createProjectUserErrorSchema = errorResponseSchema;
|
|
2909
|
-
|
|
2910
|
-
export const retrieveProjectUserDataSchema = z.object({
|
|
2911
|
-
path: z.object({
|
|
2912
|
-
project_id: z.string(),
|
|
2913
|
-
user_id: z.string(),
|
|
2914
|
-
}),
|
|
2915
|
-
});
|
|
2916
|
-
|
|
2917
|
-
export const retrieveProjectUserResponseSchema = projectUserSchema;
|
|
2918
|
-
|
|
2919
|
-
export const retrieveProjectUserErrorSchema = z.unknown();
|
|
2920
|
-
|
|
2921
|
-
export const modifyProjectUserDataSchema = z.object({
|
|
2922
|
-
body: projectUserUpdateRequestSchema,
|
|
2923
|
-
});
|
|
2924
|
-
|
|
2925
|
-
export const modifyProjectUserResponseSchema = projectUserSchema;
|
|
2926
|
-
|
|
2927
|
-
export const modifyProjectUserErrorSchema = errorResponseSchema;
|
|
2928
|
-
|
|
2929
|
-
export const deleteProjectUserDataSchema = z.object({
|
|
2930
|
-
path: z.object({
|
|
2931
|
-
project_id: z.string(),
|
|
2932
|
-
user_id: z.string(),
|
|
2933
|
-
}),
|
|
2934
|
-
});
|
|
2935
|
-
|
|
2936
|
-
export const deleteProjectUserResponseSchema = projectUserDeleteResponseSchema;
|
|
2937
|
-
|
|
2938
|
-
export const deleteProjectUserErrorSchema = errorResponseSchema;
|
|
2939
|
-
|
|
2940
|
-
export const listProjectServiceAccountsDataSchema = z.object({
|
|
2941
|
-
path: z.object({
|
|
2942
|
-
project_id: z.string(),
|
|
2943
|
-
}),
|
|
2944
|
-
query: z
|
|
2945
|
-
.object({
|
|
2946
|
-
after: z.string().optional(),
|
|
2947
|
-
limit: z.number().optional(),
|
|
2948
|
-
})
|
|
2949
|
-
.optional(),
|
|
2950
|
-
});
|
|
2951
|
-
|
|
2952
|
-
export const listProjectServiceAccountsResponseSchema = projectServiceAccountListResponseSchema;
|
|
2953
|
-
|
|
2954
|
-
export const listProjectServiceAccountsErrorSchema = errorResponseSchema;
|
|
2955
|
-
|
|
2956
|
-
export const createProjectServiceAccountDataSchema = z.object({
|
|
2957
|
-
body: projectServiceAccountCreateRequestSchema,
|
|
2958
|
-
path: z.object({
|
|
2959
|
-
project_id: z.string(),
|
|
2960
|
-
}),
|
|
2961
|
-
});
|
|
2962
|
-
|
|
2963
|
-
export const createProjectServiceAccountResponseSchema = projectServiceAccountCreateResponseSchema;
|
|
2964
|
-
|
|
2965
|
-
export const createProjectServiceAccountErrorSchema = errorResponseSchema;
|
|
2966
|
-
|
|
2967
|
-
export const retrieveProjectServiceAccountDataSchema = z.object({
|
|
2968
|
-
path: z.object({
|
|
2969
|
-
project_id: z.string(),
|
|
2970
|
-
service_account_id: z.string(),
|
|
2971
|
-
}),
|
|
2972
|
-
});
|
|
2973
|
-
|
|
2974
|
-
export const retrieveProjectServiceAccountResponseSchema = projectServiceAccountSchema;
|
|
2975
|
-
|
|
2976
|
-
export const retrieveProjectServiceAccountErrorSchema = z.unknown();
|
|
2977
|
-
|
|
2978
|
-
export const deleteProjectServiceAccountDataSchema = z.object({
|
|
2979
|
-
path: z.object({
|
|
2980
|
-
project_id: z.string(),
|
|
2981
|
-
service_account_id: z.string(),
|
|
2982
|
-
}),
|
|
2983
|
-
});
|
|
2984
|
-
|
|
2985
|
-
export const deleteProjectServiceAccountResponseSchema = projectServiceAccountDeleteResponseSchema;
|
|
2986
|
-
|
|
2987
|
-
export const deleteProjectServiceAccountErrorSchema = z.unknown();
|
|
2988
|
-
|
|
2989
|
-
export const listProjectApiKeysDataSchema = z.object({
|
|
2990
|
-
path: z.object({
|
|
2991
|
-
project_id: z.string(),
|
|
2992
|
-
}),
|
|
2993
|
-
query: z
|
|
2994
|
-
.object({
|
|
2995
|
-
after: z.string().optional(),
|
|
2996
|
-
limit: z.number().optional(),
|
|
2997
|
-
})
|
|
2998
|
-
.optional(),
|
|
2999
|
-
});
|
|
3000
|
-
|
|
3001
|
-
export const projectApiKeyListResponseSchema = z.object({
|
|
3002
|
-
object: z.literal('list'),
|
|
3003
|
-
data: z.array(projectApiKeySchema),
|
|
3004
|
-
first_id: z.string(),
|
|
3005
|
-
last_id: z.string(),
|
|
3006
|
-
has_more: z.boolean(),
|
|
3007
|
-
});
|
|
3008
|
-
|
|
3009
|
-
export const listProjectApiKeysErrorSchema = z.unknown();
|
|
3010
|
-
|
|
3011
|
-
export const retrieveProjectApiKeyDataSchema = z.object({
|
|
3012
|
-
path: z.object({
|
|
3013
|
-
key_id: z.string(),
|
|
3014
|
-
project_id: z.string(),
|
|
3015
|
-
}),
|
|
3016
|
-
});
|
|
3017
|
-
|
|
3018
|
-
export const retrieveProjectApiKeyResponseSchema = projectApiKeySchema;
|
|
3019
|
-
|
|
3020
|
-
export const retrieveProjectApiKeyErrorSchema = z.unknown();
|
|
3021
|
-
|
|
3022
|
-
export const deleteProjectApiKeyDataSchema = z.object({
|
|
3023
|
-
path: z.object({
|
|
3024
|
-
key_id: z.string(),
|
|
3025
|
-
project_id: z.string(),
|
|
3026
|
-
}),
|
|
3027
|
-
});
|
|
3028
|
-
|
|
3029
|
-
export const deleteProjectApiKeyResponseSchema = projectApiKeyDeleteResponseSchema;
|
|
3030
|
-
|
|
3031
|
-
export const deleteProjectApiKeyErrorSchema = errorResponseSchema;
|
|
3032
|
-
|
|
3033
|
-
export const responseFormatJsonSchemaSchema = z.object({
|
|
3034
|
-
type: z.literal('json_schema'),
|
|
3035
|
-
json_schema: z.object({
|
|
3036
|
-
description: z.string().optional(),
|
|
3037
|
-
name: z.string(),
|
|
3038
|
-
schema: responseFormatJsonSchemaSchemaSchema.optional(),
|
|
3039
|
-
strict: z.boolean().optional().nullable(),
|
|
3040
|
-
}),
|
|
3041
|
-
});
|
|
3042
|
-
|
|
3043
|
-
export const auditLogActorApiKeySchema = z.object({
|
|
3044
|
-
id: z.string().optional(),
|
|
3045
|
-
type: z.union([z.literal('user'), z.literal('service_account')]).optional(),
|
|
3046
|
-
user: auditLogActorUserSchema.optional(),
|
|
3047
|
-
service_account: auditLogActorServiceAccountSchema.optional(),
|
|
3048
|
-
});
|
|
3049
|
-
|
|
3050
|
-
export const chatCompletionRequestAssistantMessageContentPartSchema = z.union([
|
|
3051
|
-
chatCompletionRequestMessageContentPartTextSchema,
|
|
3052
|
-
chatCompletionRequestMessageContentPartRefusalSchema,
|
|
3053
|
-
]);
|
|
3054
|
-
|
|
3055
|
-
export const chatCompletionRequestAssistantMessageSchema = z.object({
|
|
3056
|
-
content: z
|
|
3057
|
-
.union([z.string(), z.array(chatCompletionRequestAssistantMessageContentPartSchema)])
|
|
3058
|
-
.optional()
|
|
3059
|
-
.nullable(),
|
|
3060
|
-
refusal: z.string().optional().nullable(),
|
|
3061
|
-
role: z.literal('assistant'),
|
|
3062
|
-
name: z.string().optional(),
|
|
3063
|
-
tool_calls: chatCompletionMessageToolCallsSchema.optional(),
|
|
3064
|
-
function_call: z
|
|
3065
|
-
.object({
|
|
3066
|
-
arguments: z.string(),
|
|
3067
|
-
name: z.string(),
|
|
3068
|
-
})
|
|
3069
|
-
.optional()
|
|
3070
|
-
.nullable(),
|
|
3071
|
-
});
|
|
3072
|
-
|
|
3073
|
-
export const chunkingStrategyRequestParamSchema = z.union([
|
|
3074
|
-
autoChunkingStrategyRequestParamSchema,
|
|
3075
|
-
staticChunkingStrategyRequestParamSchema,
|
|
3076
|
-
]);
|
|
3077
|
-
|
|
3078
|
-
export const assistantsApiResponseFormatOptionSchema = z.union([
|
|
3079
|
-
z.literal('auto'),
|
|
3080
|
-
responseFormatTextSchema,
|
|
3081
|
-
responseFormatJsonObjectSchema,
|
|
3082
|
-
responseFormatJsonSchemaSchema,
|
|
3083
|
-
]);
|
|
3084
|
-
|
|
3085
|
-
export const chatCompletionRequestMessageSchema = z.union([
|
|
3086
|
-
chatCompletionRequestSystemMessageSchema,
|
|
3087
|
-
chatCompletionRequestUserMessageSchema,
|
|
3088
|
-
chatCompletionRequestAssistantMessageSchema,
|
|
3089
|
-
chatCompletionRequestToolMessageSchema,
|
|
3090
|
-
chatCompletionRequestFunctionMessageSchema,
|
|
3091
|
-
]);
|
|
3092
|
-
|
|
3093
|
-
export const createRunRequestSchema = z.object({
|
|
3094
|
-
assistant_id: z.string(),
|
|
3095
|
-
model: z
|
|
3096
|
-
.union([
|
|
3097
|
-
z.string(),
|
|
3098
|
-
z.literal('gpt-4o'),
|
|
3099
|
-
z.literal('gpt-4o-2024-08-06'),
|
|
3100
|
-
z.literal('gpt-4o-2024-05-13'),
|
|
3101
|
-
z.literal('gpt-4o-mini'),
|
|
3102
|
-
z.literal('gpt-4o-mini-2024-07-18'),
|
|
3103
|
-
z.literal('gpt-4-turbo'),
|
|
3104
|
-
z.literal('gpt-4-turbo-2024-04-09'),
|
|
3105
|
-
z.literal('gpt-4-0125-preview'),
|
|
3106
|
-
z.literal('gpt-4-turbo-preview'),
|
|
3107
|
-
z.literal('gpt-4-1106-preview'),
|
|
3108
|
-
z.literal('gpt-4-vision-preview'),
|
|
3109
|
-
z.literal('gpt-4'),
|
|
3110
|
-
z.literal('gpt-4-0314'),
|
|
3111
|
-
z.literal('gpt-4-0613'),
|
|
3112
|
-
z.literal('gpt-4-32k'),
|
|
3113
|
-
z.literal('gpt-4-32k-0314'),
|
|
3114
|
-
z.literal('gpt-4-32k-0613'),
|
|
3115
|
-
z.literal('gpt-3.5-turbo'),
|
|
3116
|
-
z.literal('gpt-3.5-turbo-16k'),
|
|
3117
|
-
z.literal('gpt-3.5-turbo-0613'),
|
|
3118
|
-
z.literal('gpt-3.5-turbo-1106'),
|
|
3119
|
-
z.literal('gpt-3.5-turbo-0125'),
|
|
3120
|
-
z.literal('gpt-3.5-turbo-16k-0613'),
|
|
3121
|
-
])
|
|
3122
|
-
.optional()
|
|
3123
|
-
.nullable(),
|
|
3124
|
-
instructions: z.string().optional().nullable(),
|
|
3125
|
-
additional_instructions: z.string().optional().nullable(),
|
|
3126
|
-
additional_messages: z.array(createMessageRequestSchema).optional().nullable(),
|
|
3127
|
-
tools: z
|
|
3128
|
-
.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchSchema, assistantToolsFunctionSchema]))
|
|
3129
|
-
.optional()
|
|
3130
|
-
.nullable(),
|
|
3131
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
3132
|
-
temperature: z.number().optional().nullable(),
|
|
3133
|
-
top_p: z.number().optional().nullable(),
|
|
3134
|
-
stream: z.boolean().optional().nullable(),
|
|
3135
|
-
max_prompt_tokens: z.number().optional().nullable(),
|
|
3136
|
-
max_completion_tokens: z.number().optional().nullable(),
|
|
3137
|
-
truncation_strategy: truncationObjectSchema.optional(),
|
|
3138
|
-
tool_choice: assistantsApiToolChoiceOptionSchema.optional(),
|
|
3139
|
-
parallel_tool_calls: parallelToolCallsSchema.optional(),
|
|
3140
|
-
response_format: assistantsApiResponseFormatOptionSchema.optional(),
|
|
3141
|
-
});
|
|
3142
|
-
|
|
3143
|
-
export const createThreadAndRunRequestSchema = z.object({
|
|
3144
|
-
assistant_id: z.string(),
|
|
3145
|
-
thread: createThreadRequestSchema.optional(),
|
|
3146
|
-
model: z
|
|
3147
|
-
.union([
|
|
3148
|
-
z.string(),
|
|
3149
|
-
z.literal('gpt-4o'),
|
|
3150
|
-
z.literal('gpt-4o-2024-08-06'),
|
|
3151
|
-
z.literal('gpt-4o-2024-05-13'),
|
|
3152
|
-
z.literal('gpt-4o-mini'),
|
|
3153
|
-
z.literal('gpt-4o-mini-2024-07-18'),
|
|
3154
|
-
z.literal('gpt-4-turbo'),
|
|
3155
|
-
z.literal('gpt-4-turbo-2024-04-09'),
|
|
3156
|
-
z.literal('gpt-4-0125-preview'),
|
|
3157
|
-
z.literal('gpt-4-turbo-preview'),
|
|
3158
|
-
z.literal('gpt-4-1106-preview'),
|
|
3159
|
-
z.literal('gpt-4-vision-preview'),
|
|
3160
|
-
z.literal('gpt-4'),
|
|
3161
|
-
z.literal('gpt-4-0314'),
|
|
3162
|
-
z.literal('gpt-4-0613'),
|
|
3163
|
-
z.literal('gpt-4-32k'),
|
|
3164
|
-
z.literal('gpt-4-32k-0314'),
|
|
3165
|
-
z.literal('gpt-4-32k-0613'),
|
|
3166
|
-
z.literal('gpt-3.5-turbo'),
|
|
3167
|
-
z.literal('gpt-3.5-turbo-16k'),
|
|
3168
|
-
z.literal('gpt-3.5-turbo-0613'),
|
|
3169
|
-
z.literal('gpt-3.5-turbo-1106'),
|
|
3170
|
-
z.literal('gpt-3.5-turbo-0125'),
|
|
3171
|
-
z.literal('gpt-3.5-turbo-16k-0613'),
|
|
3172
|
-
])
|
|
3173
|
-
.optional()
|
|
3174
|
-
.nullable(),
|
|
3175
|
-
instructions: z.string().optional().nullable(),
|
|
3176
|
-
tools: z
|
|
3177
|
-
.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchSchema, assistantToolsFunctionSchema]))
|
|
3178
|
-
.optional()
|
|
3179
|
-
.nullable(),
|
|
3180
|
-
tool_resources: z
|
|
3181
|
-
.object({
|
|
3182
|
-
code_interpreter: z
|
|
3183
|
-
.object({
|
|
3184
|
-
file_ids: z.array(z.string()).optional(),
|
|
3185
|
-
})
|
|
3186
|
-
.optional(),
|
|
3187
|
-
file_search: z
|
|
3188
|
-
.object({
|
|
3189
|
-
vector_store_ids: z.array(z.string()).optional(),
|
|
3190
|
-
})
|
|
3191
|
-
.optional(),
|
|
3192
|
-
})
|
|
3193
|
-
.optional()
|
|
3194
|
-
.nullable(),
|
|
3195
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
3196
|
-
temperature: z.number().optional().nullable(),
|
|
3197
|
-
top_p: z.number().optional().nullable(),
|
|
3198
|
-
stream: z.boolean().optional().nullable(),
|
|
3199
|
-
max_prompt_tokens: z.number().optional().nullable(),
|
|
3200
|
-
max_completion_tokens: z.number().optional().nullable(),
|
|
3201
|
-
truncation_strategy: truncationObjectSchema.optional(),
|
|
3202
|
-
tool_choice: assistantsApiToolChoiceOptionSchema.optional(),
|
|
3203
|
-
parallel_tool_calls: parallelToolCallsSchema.optional(),
|
|
3204
|
-
response_format: assistantsApiResponseFormatOptionSchema.optional(),
|
|
3205
|
-
});
|
|
3206
|
-
|
|
3207
|
-
export const createTranscriptionResponseVerboseJsonSchema = z.object({
|
|
3208
|
-
language: z.string(),
|
|
3209
|
-
duration: z.string(),
|
|
3210
|
-
text: z.string(),
|
|
3211
|
-
words: z.array(transcriptionWordSchema).optional(),
|
|
3212
|
-
segments: z.array(transcriptionSegmentSchema).optional(),
|
|
3213
|
-
});
|
|
3214
|
-
|
|
3215
|
-
export const createVectorStoreFileBatchRequestSchema = z.object({
|
|
3216
|
-
file_ids: z.array(z.string()),
|
|
3217
|
-
chunking_strategy: chunkingStrategyRequestParamSchema.optional(),
|
|
3218
|
-
});
|
|
3219
|
-
|
|
3220
|
-
export const createVectorStoreFileRequestSchema = z.object({
|
|
3221
|
-
file_id: z.string(),
|
|
3222
|
-
chunking_strategy: chunkingStrategyRequestParamSchema.optional(),
|
|
3223
|
-
});
|
|
3224
|
-
|
|
3225
|
-
export const fineTuneChatCompletionRequestAssistantMessageSchema = z
|
|
3226
|
-
.object({
|
|
3227
|
-
weight: z.union([z.literal(0), z.literal(1)]).optional(),
|
|
3228
|
-
})
|
|
3229
|
-
.and(chatCompletionRequestAssistantMessageSchema);
|
|
3230
|
-
|
|
3231
|
-
export const finetuneChatRequestInputSchema = z.object({
|
|
3232
|
-
messages: z
|
|
3233
|
-
.array(
|
|
3234
|
-
z.union([
|
|
3235
|
-
chatCompletionRequestSystemMessageSchema,
|
|
3236
|
-
chatCompletionRequestUserMessageSchema,
|
|
3237
|
-
fineTuneChatCompletionRequestAssistantMessageSchema,
|
|
3238
|
-
chatCompletionRequestToolMessageSchema,
|
|
3239
|
-
chatCompletionRequestFunctionMessageSchema,
|
|
3240
|
-
]),
|
|
3241
|
-
)
|
|
3242
|
-
.optional(),
|
|
3243
|
-
tools: z.array(chatCompletionToolSchema).optional(),
|
|
3244
|
-
parallel_tool_calls: parallelToolCallsSchema.optional(),
|
|
3245
|
-
functions: z.array(chatCompletionFunctionsSchema).optional(),
|
|
3246
|
-
});
|
|
3247
|
-
|
|
3248
|
-
export const assistantObjectSchema = z.object({
|
|
3249
|
-
id: z.string(),
|
|
3250
|
-
object: z.literal('assistant'),
|
|
3251
|
-
created_at: z.number(),
|
|
3252
|
-
name: z.string().nullable(),
|
|
3253
|
-
description: z.string().nullable(),
|
|
3254
|
-
model: z.string(),
|
|
3255
|
-
instructions: z.string().nullable(),
|
|
3256
|
-
tools: z.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchSchema, assistantToolsFunctionSchema])),
|
|
3257
|
-
tool_resources: z
|
|
3258
|
-
.object({
|
|
3259
|
-
code_interpreter: z
|
|
3260
|
-
.object({
|
|
3261
|
-
file_ids: z.array(z.string()).optional(),
|
|
3262
|
-
})
|
|
3263
|
-
.optional(),
|
|
3264
|
-
file_search: z
|
|
3265
|
-
.object({
|
|
3266
|
-
vector_store_ids: z.array(z.string()).optional(),
|
|
3267
|
-
})
|
|
3268
|
-
.optional(),
|
|
3269
|
-
})
|
|
3270
|
-
.optional()
|
|
3271
|
-
.nullable(),
|
|
3272
|
-
metadata: z.record(z.unknown()).nullable(),
|
|
3273
|
-
temperature: z.number().optional().nullable(),
|
|
3274
|
-
top_p: z.number().optional().nullable(),
|
|
3275
|
-
response_format: assistantsApiResponseFormatOptionSchema.optional(),
|
|
3276
|
-
});
|
|
3277
|
-
|
|
3278
|
-
export const runObjectSchema = z.object({
|
|
3279
|
-
id: z.string(),
|
|
3280
|
-
object: z.literal('thread.run'),
|
|
3281
|
-
created_at: z.number(),
|
|
3282
|
-
thread_id: z.string(),
|
|
3283
|
-
assistant_id: z.string(),
|
|
3284
|
-
status: z.union([
|
|
3285
|
-
z.literal('queued'),
|
|
3286
|
-
z.literal('in_progress'),
|
|
3287
|
-
z.literal('requires_action'),
|
|
3288
|
-
z.literal('cancelling'),
|
|
3289
|
-
z.literal('cancelled'),
|
|
3290
|
-
z.literal('failed'),
|
|
3291
|
-
z.literal('completed'),
|
|
3292
|
-
z.literal('incomplete'),
|
|
3293
|
-
z.literal('expired'),
|
|
3294
|
-
]),
|
|
3295
|
-
required_action: z
|
|
3296
|
-
.object({
|
|
3297
|
-
type: z.literal('submit_tool_outputs'),
|
|
3298
|
-
submit_tool_outputs: z.object({
|
|
3299
|
-
tool_calls: z.array(runToolCallObjectSchema),
|
|
3300
|
-
}),
|
|
3301
|
-
})
|
|
3302
|
-
.nullable(),
|
|
3303
|
-
last_error: z
|
|
3304
|
-
.object({
|
|
3305
|
-
code: z.union([z.literal('server_error'), z.literal('rate_limit_exceeded'), z.literal('invalid_prompt')]),
|
|
3306
|
-
message: z.string(),
|
|
3307
|
-
})
|
|
3308
|
-
.nullable(),
|
|
3309
|
-
expires_at: z.number().nullable(),
|
|
3310
|
-
started_at: z.number().nullable(),
|
|
3311
|
-
cancelled_at: z.number().nullable(),
|
|
3312
|
-
failed_at: z.number().nullable(),
|
|
3313
|
-
completed_at: z.number().nullable(),
|
|
3314
|
-
incomplete_details: z
|
|
3315
|
-
.object({
|
|
3316
|
-
reason: z.union([z.literal('max_completion_tokens'), z.literal('max_prompt_tokens')]).optional(),
|
|
3317
|
-
})
|
|
3318
|
-
.nullable(),
|
|
3319
|
-
model: z.string(),
|
|
3320
|
-
instructions: z.string(),
|
|
3321
|
-
tools: z.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchSchema, assistantToolsFunctionSchema])),
|
|
3322
|
-
metadata: z.record(z.unknown()).nullable(),
|
|
3323
|
-
usage: runCompletionUsageSchema,
|
|
3324
|
-
temperature: z.number().optional().nullable(),
|
|
3325
|
-
top_p: z.number().optional().nullable(),
|
|
3326
|
-
max_prompt_tokens: z.number().nullable(),
|
|
3327
|
-
max_completion_tokens: z.number().nullable(),
|
|
3328
|
-
truncation_strategy: truncationObjectSchema,
|
|
3329
|
-
tool_choice: assistantsApiToolChoiceOptionSchema,
|
|
3330
|
-
parallel_tool_calls: parallelToolCallsSchema,
|
|
3331
|
-
response_format: assistantsApiResponseFormatOptionSchema,
|
|
3332
|
-
});
|
|
3333
|
-
|
|
3334
|
-
export const listThreadsResponseSchema = z.object({
|
|
3335
|
-
object: z.string(),
|
|
3336
|
-
data: z.array(threadObjectSchema),
|
|
3337
|
-
first_id: z.string(),
|
|
3338
|
-
last_id: z.string(),
|
|
3339
|
-
has_more: z.boolean(),
|
|
3340
|
-
});
|
|
3341
|
-
|
|
3342
|
-
export const modifyAssistantRequestSchema = z.object({
|
|
3343
|
-
model: z.string().optional(),
|
|
3344
|
-
name: z.string().optional().nullable(),
|
|
3345
|
-
description: z.string().optional().nullable(),
|
|
3346
|
-
instructions: z.string().optional().nullable(),
|
|
3347
|
-
tools: z
|
|
3348
|
-
.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchSchema, assistantToolsFunctionSchema]))
|
|
3349
|
-
.optional(),
|
|
3350
|
-
tool_resources: z
|
|
3351
|
-
.object({
|
|
3352
|
-
code_interpreter: z
|
|
3353
|
-
.object({
|
|
3354
|
-
file_ids: z.array(z.string()).optional(),
|
|
3355
|
-
})
|
|
3356
|
-
.optional(),
|
|
3357
|
-
file_search: z
|
|
3358
|
-
.object({
|
|
3359
|
-
vector_store_ids: z.array(z.string()).optional(),
|
|
3360
|
-
})
|
|
3361
|
-
.optional(),
|
|
3362
|
-
})
|
|
3363
|
-
.optional()
|
|
3364
|
-
.nullable(),
|
|
3365
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
3366
|
-
temperature: z.number().optional().nullable(),
|
|
3367
|
-
top_p: z.number().optional().nullable(),
|
|
3368
|
-
response_format: assistantsApiResponseFormatOptionSchema.optional(),
|
|
3369
|
-
});
|
|
3370
|
-
|
|
3371
|
-
export const runStepDeltaStepDetailsToolCallsObjectSchema = z.object({
|
|
3372
|
-
type: z.literal('tool_calls'),
|
|
3373
|
-
tool_calls: z
|
|
3374
|
-
.array(
|
|
3375
|
-
z.union([
|
|
3376
|
-
runStepDeltaStepDetailsToolCallsCodeObjectSchema,
|
|
3377
|
-
runStepDeltaStepDetailsToolCallsFileSearchObjectSchema,
|
|
3378
|
-
runStepDeltaStepDetailsToolCallsFunctionObjectSchema,
|
|
3379
|
-
]),
|
|
3380
|
-
)
|
|
3381
|
-
.optional(),
|
|
3382
|
-
});
|
|
3383
|
-
|
|
3384
|
-
export const runStepDeltaObjectSchema = z.object({
|
|
3385
|
-
id: z.string(),
|
|
3386
|
-
object: z.literal('thread.run.step.delta'),
|
|
3387
|
-
delta: z.object({
|
|
3388
|
-
step_details: z
|
|
3389
|
-
.union([runStepDeltaStepDetailsMessageCreationObjectSchema, runStepDeltaStepDetailsToolCallsObjectSchema])
|
|
3390
|
-
.optional(),
|
|
3391
|
-
}),
|
|
3392
|
-
});
|
|
3393
|
-
|
|
3394
|
-
export const runStreamEventSchema = z.union([
|
|
3395
|
-
z.object({
|
|
3396
|
-
event: z.literal('thread.run.created'),
|
|
3397
|
-
data: runObjectSchema,
|
|
3398
|
-
}),
|
|
3399
|
-
z.object({
|
|
3400
|
-
event: z.literal('thread.run.queued'),
|
|
3401
|
-
data: runObjectSchema,
|
|
3402
|
-
}),
|
|
3403
|
-
z.object({
|
|
3404
|
-
event: z.literal('thread.run.in_progress'),
|
|
3405
|
-
data: runObjectSchema,
|
|
3406
|
-
}),
|
|
3407
|
-
z.object({
|
|
3408
|
-
event: z.literal('thread.run.requires_action'),
|
|
3409
|
-
data: runObjectSchema,
|
|
3410
|
-
}),
|
|
3411
|
-
z.object({
|
|
3412
|
-
event: z.literal('thread.run.completed'),
|
|
3413
|
-
data: runObjectSchema,
|
|
3414
|
-
}),
|
|
3415
|
-
z.object({
|
|
3416
|
-
event: z.literal('thread.run.incomplete'),
|
|
3417
|
-
data: runObjectSchema,
|
|
3418
|
-
}),
|
|
3419
|
-
z.object({
|
|
3420
|
-
event: z.literal('thread.run.failed'),
|
|
3421
|
-
data: runObjectSchema,
|
|
3422
|
-
}),
|
|
3423
|
-
z.object({
|
|
3424
|
-
event: z.literal('thread.run.cancelling'),
|
|
3425
|
-
data: runObjectSchema,
|
|
3426
|
-
}),
|
|
3427
|
-
z.object({
|
|
3428
|
-
event: z.literal('thread.run.cancelled'),
|
|
3429
|
-
data: runObjectSchema,
|
|
3430
|
-
}),
|
|
3431
|
-
z.object({
|
|
3432
|
-
event: z.literal('thread.run.expired'),
|
|
3433
|
-
data: runObjectSchema,
|
|
3434
|
-
}),
|
|
3435
|
-
]);
|
|
3436
|
-
|
|
3437
|
-
export const createChatCompletionRequestSchema = z.object({
|
|
3438
|
-
messages: z.array(chatCompletionRequestMessageSchema),
|
|
3439
|
-
model: z.union([
|
|
3440
|
-
z.string(),
|
|
3441
|
-
z.literal('gpt-4o'),
|
|
3442
|
-
z.literal('gpt-4o-2024-08-06'),
|
|
3443
|
-
z.literal('gpt-4o-2024-05-13'),
|
|
3444
|
-
z.literal('gpt-4o-mini'),
|
|
3445
|
-
z.literal('gpt-4o-mini-2024-07-18'),
|
|
3446
|
-
z.literal('gpt-4-turbo'),
|
|
3447
|
-
z.literal('gpt-4-turbo-2024-04-09'),
|
|
3448
|
-
z.literal('gpt-4-0125-preview'),
|
|
3449
|
-
z.literal('gpt-4-turbo-preview'),
|
|
3450
|
-
z.literal('gpt-4-1106-preview'),
|
|
3451
|
-
z.literal('gpt-4-vision-preview'),
|
|
3452
|
-
z.literal('gpt-4'),
|
|
3453
|
-
z.literal('gpt-4-0314'),
|
|
3454
|
-
z.literal('gpt-4-0613'),
|
|
3455
|
-
z.literal('gpt-4-32k'),
|
|
3456
|
-
z.literal('gpt-4-32k-0314'),
|
|
3457
|
-
z.literal('gpt-4-32k-0613'),
|
|
3458
|
-
z.literal('gpt-3.5-turbo'),
|
|
3459
|
-
z.literal('gpt-3.5-turbo-16k'),
|
|
3460
|
-
z.literal('gpt-3.5-turbo-0301'),
|
|
3461
|
-
z.literal('gpt-3.5-turbo-0613'),
|
|
3462
|
-
z.literal('gpt-3.5-turbo-1106'),
|
|
3463
|
-
z.literal('gpt-3.5-turbo-0125'),
|
|
3464
|
-
z.literal('gpt-3.5-turbo-16k-0613'),
|
|
3465
|
-
]),
|
|
3466
|
-
frequency_penalty: z.number().optional().nullable(),
|
|
3467
|
-
logit_bias: z.record(z.number()).optional().nullable(),
|
|
3468
|
-
logprobs: z.boolean().optional().nullable(),
|
|
3469
|
-
top_logprobs: z.number().optional().nullable(),
|
|
3470
|
-
max_tokens: z.number().optional().nullable(),
|
|
3471
|
-
n: z.number().optional().nullable(),
|
|
3472
|
-
presence_penalty: z.number().optional().nullable(),
|
|
3473
|
-
response_format: z
|
|
3474
|
-
.union([responseFormatTextSchema, responseFormatJsonObjectSchema, responseFormatJsonSchemaSchema])
|
|
3475
|
-
.optional(),
|
|
3476
|
-
seed: z.number().optional().nullable(),
|
|
3477
|
-
service_tier: z
|
|
3478
|
-
.union([z.literal('auto'), z.literal('default')])
|
|
3479
|
-
.optional()
|
|
3480
|
-
.nullable(),
|
|
3481
|
-
stop: z
|
|
3482
|
-
.union([z.string(), z.array(z.string())])
|
|
3483
|
-
.optional()
|
|
3484
|
-
.nullable(),
|
|
3485
|
-
stream: z.boolean().optional().nullable(),
|
|
3486
|
-
stream_options: chatCompletionStreamOptionsSchema.optional(),
|
|
3487
|
-
temperature: z.number().optional().nullable(),
|
|
3488
|
-
top_p: z.number().optional().nullable(),
|
|
3489
|
-
tools: z.array(chatCompletionToolSchema).optional(),
|
|
3490
|
-
tool_choice: chatCompletionToolChoiceOptionSchema.optional(),
|
|
3491
|
-
parallel_tool_calls: parallelToolCallsSchema.optional(),
|
|
3492
|
-
user: z.string().optional(),
|
|
3493
|
-
function_call: z.union([z.literal('none'), z.literal('auto'), chatCompletionFunctionCallOptionSchema]).optional(),
|
|
3494
|
-
functions: z.array(chatCompletionFunctionsSchema).optional(),
|
|
3495
|
-
});
|
|
3496
|
-
|
|
3497
|
-
export const createEmbeddingResponse2Schema = createEmbeddingResponseSchema;
|
|
3498
|
-
|
|
3499
|
-
export const createTranscriptionResponseSchema = z.union([
|
|
3500
|
-
createTranscriptionResponseJsonSchema,
|
|
3501
|
-
createTranscriptionResponseVerboseJsonSchema,
|
|
3502
|
-
]);
|
|
3503
|
-
|
|
3504
|
-
export const listFilesResponse2Schema = listFilesResponseSchema;
|
|
3505
|
-
|
|
3506
|
-
export const listModelsResponse2Schema = listModelsResponseSchema;
|
|
3507
|
-
|
|
3508
|
-
export const listAssistantsResponseSchema = z.object({
|
|
3509
|
-
object: z.string(),
|
|
3510
|
-
data: z.array(assistantObjectSchema),
|
|
3511
|
-
first_id: z.string(),
|
|
3512
|
-
last_id: z.string(),
|
|
3513
|
-
has_more: z.boolean(),
|
|
3514
|
-
});
|
|
3515
|
-
|
|
3516
|
-
export const createAssistantRequestSchema = z.object({
|
|
3517
|
-
model: z.union([
|
|
3518
|
-
z.string(),
|
|
3519
|
-
z.literal('gpt-4o'),
|
|
3520
|
-
z.literal('gpt-4o-2024-08-06'),
|
|
3521
|
-
z.literal('gpt-4o-2024-05-13'),
|
|
3522
|
-
z.literal('gpt-4o-mini'),
|
|
3523
|
-
z.literal('gpt-4o-mini-2024-07-18'),
|
|
3524
|
-
z.literal('gpt-4-turbo'),
|
|
3525
|
-
z.literal('gpt-4-turbo-2024-04-09'),
|
|
3526
|
-
z.literal('gpt-4-0125-preview'),
|
|
3527
|
-
z.literal('gpt-4-turbo-preview'),
|
|
3528
|
-
z.literal('gpt-4-1106-preview'),
|
|
3529
|
-
z.literal('gpt-4-vision-preview'),
|
|
3530
|
-
z.literal('gpt-4'),
|
|
3531
|
-
z.literal('gpt-4-0314'),
|
|
3532
|
-
z.literal('gpt-4-0613'),
|
|
3533
|
-
z.literal('gpt-4-32k'),
|
|
3534
|
-
z.literal('gpt-4-32k-0314'),
|
|
3535
|
-
z.literal('gpt-4-32k-0613'),
|
|
3536
|
-
z.literal('gpt-3.5-turbo'),
|
|
3537
|
-
z.literal('gpt-3.5-turbo-16k'),
|
|
3538
|
-
z.literal('gpt-3.5-turbo-0613'),
|
|
3539
|
-
z.literal('gpt-3.5-turbo-1106'),
|
|
3540
|
-
z.literal('gpt-3.5-turbo-0125'),
|
|
3541
|
-
z.literal('gpt-3.5-turbo-16k-0613'),
|
|
3542
|
-
]),
|
|
3543
|
-
name: z.string().optional().nullable(),
|
|
3544
|
-
description: z.string().optional().nullable(),
|
|
3545
|
-
instructions: z.string().optional().nullable(),
|
|
3546
|
-
tools: z
|
|
3547
|
-
.array(z.union([assistantToolsCodeSchema, assistantToolsFileSearchSchema, assistantToolsFunctionSchema]))
|
|
3548
|
-
.optional(),
|
|
3549
|
-
tool_resources: z
|
|
3550
|
-
.object({
|
|
3551
|
-
code_interpreter: z
|
|
3552
|
-
.object({
|
|
3553
|
-
file_ids: z.array(z.string()).optional(),
|
|
3554
|
-
})
|
|
3555
|
-
.optional(),
|
|
3556
|
-
file_search: z
|
|
3557
|
-
.unknown()
|
|
3558
|
-
.and(
|
|
3559
|
-
z.object({
|
|
3560
|
-
vector_store_ids: z.array(z.string()).optional(),
|
|
3561
|
-
vector_stores: z
|
|
3562
|
-
.array(
|
|
3563
|
-
z.object({
|
|
3564
|
-
file_ids: z.array(z.string()).optional(),
|
|
3565
|
-
chunking_strategy: z
|
|
3566
|
-
.union([
|
|
3567
|
-
z.object({
|
|
3568
|
-
type: z.literal('auto'),
|
|
3569
|
-
}),
|
|
3570
|
-
z.object({
|
|
3571
|
-
type: z.literal('static'),
|
|
3572
|
-
static: z.object({
|
|
3573
|
-
max_chunk_size_tokens: z.number(),
|
|
3574
|
-
chunk_overlap_tokens: z.number(),
|
|
3575
|
-
}),
|
|
3576
|
-
}),
|
|
3577
|
-
])
|
|
3578
|
-
.optional(),
|
|
3579
|
-
metadata: z.record(z.unknown()).optional(),
|
|
3580
|
-
}),
|
|
3581
|
-
)
|
|
3582
|
-
.optional(),
|
|
3583
|
-
}),
|
|
3584
|
-
)
|
|
3585
|
-
.optional(),
|
|
3586
|
-
})
|
|
3587
|
-
.optional()
|
|
3588
|
-
.nullable(),
|
|
3589
|
-
metadata: z.record(z.unknown()).optional().nullable(),
|
|
3590
|
-
temperature: z.number().optional().nullable(),
|
|
3591
|
-
top_p: z.number().optional().nullable(),
|
|
3592
|
-
response_format: assistantsApiResponseFormatOptionSchema.optional(),
|
|
3593
|
-
});
|
|
3594
|
-
|
|
3595
|
-
export const createAssistantResponseSchema = assistantObjectSchema;
|
|
3596
|
-
|
|
3597
|
-
export const getAssistantResponseSchema = assistantObjectSchema;
|
|
3598
|
-
|
|
3599
|
-
export const modifyAssistantDataSchema = z.object({
|
|
3600
|
-
body: modifyAssistantRequestSchema,
|
|
3601
|
-
path: z.object({
|
|
3602
|
-
assistant_id: z.string(),
|
|
3603
|
-
}),
|
|
3604
|
-
});
|
|
3605
|
-
|
|
3606
|
-
export const modifyAssistantResponseSchema = assistantObjectSchema;
|
|
3607
|
-
|
|
3608
|
-
export const listMessagesResponse2Schema = listMessagesResponseSchema;
|
|
3609
|
-
|
|
3610
|
-
export const createThreadAndRunDataSchema = z.object({
|
|
3611
|
-
body: createThreadAndRunRequestSchema,
|
|
3612
|
-
});
|
|
3613
|
-
|
|
3614
|
-
export const createThreadAndRunResponseSchema = runObjectSchema;
|
|
3615
|
-
|
|
3616
|
-
export const listRunsResponseSchema = z.object({
|
|
3617
|
-
object: z.string(),
|
|
3618
|
-
data: z.array(runObjectSchema),
|
|
3619
|
-
first_id: z.string(),
|
|
3620
|
-
last_id: z.string(),
|
|
3621
|
-
has_more: z.boolean(),
|
|
3622
|
-
});
|
|
3623
|
-
|
|
3624
|
-
export const createRunDataSchema = z.object({
|
|
3625
|
-
body: createRunRequestSchema,
|
|
3626
|
-
path: z.object({
|
|
3627
|
-
thread_id: z.string(),
|
|
3628
|
-
}),
|
|
3629
|
-
});
|
|
3630
|
-
|
|
3631
|
-
export const createRunResponseSchema = runObjectSchema;
|
|
3632
|
-
|
|
3633
|
-
export const getRunResponseSchema = runObjectSchema;
|
|
3634
|
-
|
|
3635
|
-
export const modifyRunResponseSchema = runObjectSchema;
|
|
3636
|
-
|
|
3637
|
-
export const submitToolOuputsToRunResponseSchema = runObjectSchema;
|
|
3638
|
-
|
|
3639
|
-
export const cancelRunResponseSchema = runObjectSchema;
|
|
3640
|
-
|
|
3641
|
-
export const listRunStepsResponse2Schema = listRunStepsResponseSchema;
|
|
3642
|
-
|
|
3643
|
-
export const listVectorStoresResponse2Schema = listVectorStoresResponseSchema;
|
|
3644
|
-
|
|
3645
|
-
export const createVectorStoreDataSchema = z.object({
|
|
3646
|
-
body: createVectorStoreRequestSchema,
|
|
3647
|
-
});
|
|
3648
|
-
|
|
3649
|
-
export const listVectorStoreFilesResponse2Schema = listVectorStoreFilesResponseSchema;
|
|
3650
|
-
|
|
3651
|
-
export const createVectorStoreFileDataSchema = z.object({
|
|
3652
|
-
body: createVectorStoreFileRequestSchema,
|
|
3653
|
-
path: z.object({
|
|
3654
|
-
vector_store_id: z.string(),
|
|
3655
|
-
}),
|
|
3656
|
-
});
|
|
3657
|
-
|
|
3658
|
-
export const createVectorStoreFileBatchDataSchema = z.object({
|
|
3659
|
-
body: createVectorStoreFileBatchRequestSchema,
|
|
3660
|
-
path: z.object({
|
|
3661
|
-
vector_store_id: z.string(),
|
|
3662
|
-
}),
|
|
3663
|
-
});
|
|
3664
|
-
|
|
3665
|
-
export const listProjectApiKeysResponseSchema = projectApiKeyListResponseSchema;
|
|
3666
|
-
|
|
3667
|
-
export const runStepStreamEventSchema = z.union([
|
|
3668
|
-
z.object({
|
|
3669
|
-
event: z.literal('thread.run.step.created'),
|
|
3670
|
-
data: runStepObjectSchema,
|
|
3671
|
-
}),
|
|
3672
|
-
z.object({
|
|
3673
|
-
event: z.literal('thread.run.step.in_progress'),
|
|
3674
|
-
data: runStepObjectSchema,
|
|
3675
|
-
}),
|
|
3676
|
-
z.object({
|
|
3677
|
-
event: z.literal('thread.run.step.delta'),
|
|
3678
|
-
data: runStepDeltaObjectSchema,
|
|
3679
|
-
}),
|
|
3680
|
-
z.object({
|
|
3681
|
-
event: z.literal('thread.run.step.completed'),
|
|
3682
|
-
data: runStepObjectSchema,
|
|
3683
|
-
}),
|
|
3684
|
-
z.object({
|
|
3685
|
-
event: z.literal('thread.run.step.failed'),
|
|
3686
|
-
data: runStepObjectSchema,
|
|
3687
|
-
}),
|
|
3688
|
-
z.object({
|
|
3689
|
-
event: z.literal('thread.run.step.cancelled'),
|
|
3690
|
-
data: runStepObjectSchema,
|
|
3691
|
-
}),
|
|
3692
|
-
z.object({
|
|
3693
|
-
event: z.literal('thread.run.step.expired'),
|
|
3694
|
-
data: runStepObjectSchema,
|
|
3695
|
-
}),
|
|
3696
|
-
]);
|
|
3697
|
-
|
|
3698
|
-
export const auditLogActorSchema = z.object({
|
|
3699
|
-
type: z.union([z.literal('session'), z.literal('api_key')]).optional(),
|
|
3700
|
-
session: auditLogActorSessionSchema.optional(),
|
|
3701
|
-
api_key: auditLogActorApiKeySchema.optional(),
|
|
3702
|
-
});
|
|
3703
|
-
|
|
3704
|
-
export const auditLogSchema = z.object({
|
|
3705
|
-
id: z.string(),
|
|
3706
|
-
type: auditLogEventTypeSchema,
|
|
3707
|
-
effective_at: z.number(),
|
|
3708
|
-
project: z
|
|
3709
|
-
.object({
|
|
3710
|
-
id: z.string().optional(),
|
|
3711
|
-
name: z.string().optional(),
|
|
3712
|
-
})
|
|
3713
|
-
.optional(),
|
|
3714
|
-
actor: auditLogActorSchema,
|
|
3715
|
-
'api_key.created': z
|
|
3716
|
-
.object({
|
|
3717
|
-
id: z.string().optional(),
|
|
3718
|
-
data: z
|
|
3719
|
-
.object({
|
|
3720
|
-
scopes: z.array(z.string()).optional(),
|
|
3721
|
-
})
|
|
3722
|
-
.optional(),
|
|
3723
|
-
})
|
|
3724
|
-
.optional(),
|
|
3725
|
-
'api_key.updated': z
|
|
3726
|
-
.object({
|
|
3727
|
-
id: z.string().optional(),
|
|
3728
|
-
changes_requested: z
|
|
3729
|
-
.object({
|
|
3730
|
-
scopes: z.array(z.string()).optional(),
|
|
3731
|
-
})
|
|
3732
|
-
.optional(),
|
|
3733
|
-
})
|
|
3734
|
-
.optional(),
|
|
3735
|
-
'api_key.deleted': z
|
|
3736
|
-
.object({
|
|
3737
|
-
id: z.string().optional(),
|
|
3738
|
-
})
|
|
3739
|
-
.optional(),
|
|
3740
|
-
'invite.sent': z
|
|
3741
|
-
.object({
|
|
3742
|
-
id: z.string().optional(),
|
|
3743
|
-
data: z
|
|
3744
|
-
.object({
|
|
3745
|
-
email: z.string().optional(),
|
|
3746
|
-
role: z.string().optional(),
|
|
3747
|
-
})
|
|
3748
|
-
.optional(),
|
|
3749
|
-
})
|
|
3750
|
-
.optional(),
|
|
3751
|
-
'invite.accepted': z
|
|
3752
|
-
.object({
|
|
3753
|
-
id: z.string().optional(),
|
|
3754
|
-
})
|
|
3755
|
-
.optional(),
|
|
3756
|
-
'invite.deleted': z
|
|
3757
|
-
.object({
|
|
3758
|
-
id: z.string().optional(),
|
|
3759
|
-
})
|
|
3760
|
-
.optional(),
|
|
3761
|
-
'login.failed': z
|
|
3762
|
-
.object({
|
|
3763
|
-
error_code: z.string().optional(),
|
|
3764
|
-
error_message: z.string().optional(),
|
|
3765
|
-
})
|
|
3766
|
-
.optional(),
|
|
3767
|
-
'logout.failed': z
|
|
3768
|
-
.object({
|
|
3769
|
-
error_code: z.string().optional(),
|
|
3770
|
-
error_message: z.string().optional(),
|
|
3771
|
-
})
|
|
3772
|
-
.optional(),
|
|
3773
|
-
'organization.updated': z
|
|
3774
|
-
.object({
|
|
3775
|
-
id: z.string().optional(),
|
|
3776
|
-
changes_requested: z
|
|
3777
|
-
.object({
|
|
3778
|
-
title: z.string().optional(),
|
|
3779
|
-
description: z.string().optional(),
|
|
3780
|
-
name: z.string().optional(),
|
|
3781
|
-
settings: z
|
|
3782
|
-
.object({
|
|
3783
|
-
threads_ui_visibility: z.string().optional(),
|
|
3784
|
-
usage_dashboard_visibility: z.string().optional(),
|
|
3785
|
-
})
|
|
3786
|
-
.optional(),
|
|
3787
|
-
})
|
|
3788
|
-
.optional(),
|
|
3789
|
-
})
|
|
3790
|
-
.optional(),
|
|
3791
|
-
'project.created': z
|
|
3792
|
-
.object({
|
|
3793
|
-
id: z.string().optional(),
|
|
3794
|
-
data: z
|
|
3795
|
-
.object({
|
|
3796
|
-
name: z.string().optional(),
|
|
3797
|
-
title: z.string().optional(),
|
|
3798
|
-
})
|
|
3799
|
-
.optional(),
|
|
3800
|
-
})
|
|
3801
|
-
.optional(),
|
|
3802
|
-
'project.updated': z
|
|
3803
|
-
.object({
|
|
3804
|
-
id: z.string().optional(),
|
|
3805
|
-
changes_requested: z
|
|
3806
|
-
.object({
|
|
3807
|
-
title: z.string().optional(),
|
|
3808
|
-
})
|
|
3809
|
-
.optional(),
|
|
3810
|
-
})
|
|
3811
|
-
.optional(),
|
|
3812
|
-
'project.archived': z
|
|
3813
|
-
.object({
|
|
3814
|
-
id: z.string().optional(),
|
|
3815
|
-
})
|
|
3816
|
-
.optional(),
|
|
3817
|
-
'service_account.created': z
|
|
3818
|
-
.object({
|
|
3819
|
-
id: z.string().optional(),
|
|
3820
|
-
data: z
|
|
3821
|
-
.object({
|
|
3822
|
-
role: z.string().optional(),
|
|
3823
|
-
})
|
|
3824
|
-
.optional(),
|
|
3825
|
-
})
|
|
3826
|
-
.optional(),
|
|
3827
|
-
'service_account.updated': z
|
|
3828
|
-
.object({
|
|
3829
|
-
id: z.string().optional(),
|
|
3830
|
-
changes_requested: z
|
|
3831
|
-
.object({
|
|
3832
|
-
role: z.string().optional(),
|
|
3833
|
-
})
|
|
3834
|
-
.optional(),
|
|
3835
|
-
})
|
|
3836
|
-
.optional(),
|
|
3837
|
-
'service_account.deleted': z
|
|
3838
|
-
.object({
|
|
3839
|
-
id: z.string().optional(),
|
|
3840
|
-
})
|
|
3841
|
-
.optional(),
|
|
3842
|
-
'user.added': z
|
|
3843
|
-
.object({
|
|
3844
|
-
id: z.string().optional(),
|
|
3845
|
-
data: z
|
|
3846
|
-
.object({
|
|
3847
|
-
role: z.string().optional(),
|
|
3848
|
-
})
|
|
3849
|
-
.optional(),
|
|
3850
|
-
})
|
|
3851
|
-
.optional(),
|
|
3852
|
-
'user.updated': z
|
|
3853
|
-
.object({
|
|
3854
|
-
id: z.string().optional(),
|
|
3855
|
-
changes_requested: z
|
|
3856
|
-
.object({
|
|
3857
|
-
role: z.string().optional(),
|
|
3858
|
-
})
|
|
3859
|
-
.optional(),
|
|
3860
|
-
})
|
|
3861
|
-
.optional(),
|
|
3862
|
-
'user.deleted': z
|
|
3863
|
-
.object({
|
|
3864
|
-
id: z.string().optional(),
|
|
3865
|
-
})
|
|
3866
|
-
.optional(),
|
|
3867
|
-
});
|
|
3868
|
-
|
|
3869
|
-
export const createChatCompletionDataSchema = z.object({
|
|
3870
|
-
body: createChatCompletionRequestSchema,
|
|
3871
|
-
});
|
|
3872
|
-
|
|
3873
|
-
export const listAssistantsResponse2Schema = listAssistantsResponseSchema;
|
|
3874
|
-
|
|
3875
|
-
export const createAssistantDataSchema = z.object({
|
|
3876
|
-
body: createAssistantRequestSchema,
|
|
3877
|
-
});
|
|
3878
|
-
|
|
3879
|
-
export const listRunsResponse2Schema = listRunsResponseSchema;
|
|
3880
|
-
|
|
3881
|
-
export const listAuditLogsResponseSchema = z.object({
|
|
3882
|
-
object: z.literal('list'),
|
|
3883
|
-
data: z.array(auditLogSchema),
|
|
3884
|
-
first_id: z.string(),
|
|
3885
|
-
last_id: z.string(),
|
|
3886
|
-
has_more: z.boolean(),
|
|
3887
|
-
});
|
|
3888
|
-
|
|
3889
|
-
export const assistantStreamEventSchema = z.union([
|
|
3890
|
-
threadStreamEventSchema,
|
|
3891
|
-
runStreamEventSchema,
|
|
3892
|
-
runStepStreamEventSchema,
|
|
3893
|
-
messageStreamEventSchema,
|
|
3894
|
-
errorEventSchema,
|
|
3895
|
-
doneEventSchema,
|
|
3896
|
-
]);
|
|
3897
|
-
|
|
3898
|
-
export const listAuditLogsResponse2Schema = listAuditLogsResponseSchema;
|