objectiveai 1.2.0 → 1.2.1

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.
Files changed (4) hide show
  1. package/dist/index.cjs +993 -777
  2. package/dist/index.d.ts +3086 -3083
  3. package/dist/index.js +992 -776
  4. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4,145 +4,114 @@ export const ExpressionSchema = z
4
4
  .object({
5
5
  $jmespath: z.string().describe("A JMESPath expression."),
6
6
  })
7
- .describe("An expression which evaluates to a value.");
7
+ .describe("An expression which evaluates to a value.")
8
+ .meta({ title: "Expression" });
8
9
  export const JsonValueSchema = z
9
10
  .lazy(() => z.union([
10
11
  z.null(),
11
12
  z.boolean(),
12
13
  z.number(),
13
14
  z.string(),
14
- z.array(JsonValueSchema),
15
- z.record(z.string(), JsonValueSchema),
15
+ z.array(JsonValueSchema.meta({
16
+ title: "JsonValue",
17
+ recursive: true,
18
+ })),
19
+ z.record(z.string(), JsonValueSchema.meta({
20
+ title: "JsonValue",
21
+ recursive: true,
22
+ })),
16
23
  ]))
17
- .describe("A JSON value.");
24
+ .describe("A JSON value.")
25
+ .meta({ title: "JsonValue" });
18
26
  export const JsonValueExpressionSchema = z
19
27
  .lazy(() => z.union([
20
28
  z.null(),
21
29
  z.boolean(),
22
30
  z.number(),
23
31
  z.string(),
24
- z.array(JsonValueExpressionSchema),
25
- z.record(z.string(), JsonValueExpressionSchema),
32
+ z.array(JsonValueExpressionSchema.meta({
33
+ title: "JsonValueExpression",
34
+ recursive: true,
35
+ })),
36
+ z.record(z.string(), JsonValueExpressionSchema.meta({
37
+ title: "JsonValueExpression",
38
+ recursive: true,
39
+ })),
26
40
  ExpressionSchema.describe("An expression which evaluates to a JSON value."),
27
41
  ]))
28
- .describe(JsonValueSchema.description);
42
+ .describe(JsonValueSchema.description)
43
+ .meta({ title: "JsonValueExpression" });
29
44
  // Errors
30
45
  export const ObjectiveAIErrorSchema = z
31
46
  .object({
32
47
  code: z.uint32().describe("The status code of the error."),
33
48
  message: z.any().describe("The message or details of the error."),
34
49
  })
35
- .describe("An error returned by the ObjectiveAI API.");
50
+ .describe("An error returned by the ObjectiveAI API.")
51
+ .meta({ title: "ObjectiveAIError" });
36
52
  // Messages
37
- export const MessageSchema = z
38
- .discriminatedUnion("role", [
39
- Message.DeveloperSchema,
40
- Message.SystemSchema,
41
- Message.UserSchema,
42
- Message.ToolSchema,
43
- Message.AssistantSchema,
44
- ])
45
- .describe("A message exchanged in a chat conversation.");
46
- export const MessageExpressionSchema = z
47
- .union([
48
- z
49
- .discriminatedUnion("role", [
50
- Message.DeveloperExpressionSchema,
51
- Message.SystemExpressionSchema,
52
- Message.UserExpressionSchema,
53
- Message.ToolExpressionSchema,
54
- Message.AssistantExpressionSchema,
55
- ])
56
- .describe(MessageSchema.description),
57
- ExpressionSchema.describe("An expression which evaluates to a message."),
58
- ])
59
- .describe(MessageSchema.description);
60
53
  export var Message;
61
54
  (function (Message) {
62
- Message.SimpleContentPartSchema = z
63
- .object({
64
- type: z.literal("text"),
65
- text: z.string().describe("The text content."),
66
- })
67
- .describe("A simple text content part.");
68
- Message.SimpleContentSchema = z
69
- .union([SimpleContent.TextSchema, SimpleContent.PartsSchema])
70
- .describe("Simple content.");
71
- Message.SimpleContentExpressionSchema = z
72
- .union([
73
- SimpleContent.TextSchema,
74
- SimpleContent.PartsExpressionSchema,
75
- ExpressionSchema.describe("An expression which evaluates to simple content."),
76
- ])
77
- .describe(Message.SimpleContentSchema.description);
78
55
  let SimpleContent;
79
56
  (function (SimpleContent) {
80
- SimpleContent.TextSchema = z.string().describe("Plain text content.");
57
+ SimpleContent.TextSchema = z
58
+ .string()
59
+ .describe("Plain text content.")
60
+ .meta({ title: "SimpleContentText" });
81
61
  SimpleContent.PartSchema = z
82
62
  .object({
83
63
  type: z.literal("text"),
84
64
  text: z.string().describe("The text content."),
85
65
  })
86
- .describe("A simple content part.");
66
+ .describe("A simple content part.")
67
+ .meta({ title: "SimpleContentPart" });
87
68
  SimpleContent.PartExpressionSchema = z
88
69
  .union([
89
70
  SimpleContent.PartSchema,
90
71
  ExpressionSchema.describe("An expression which evaluates to a simple content part."),
91
72
  ])
92
- .describe(SimpleContent.PartSchema.description);
73
+ .describe(SimpleContent.PartSchema.description)
74
+ .meta({ title: "SimpleContentPartExpression" });
93
75
  SimpleContent.PartsSchema = z
94
76
  .array(SimpleContent.PartSchema)
95
- .describe("An array of simple content parts.");
77
+ .describe("An array of simple content parts.")
78
+ .meta({ title: "SimpleContentParts" });
96
79
  SimpleContent.PartsExpressionSchema = z
97
80
  .array(SimpleContent.PartExpressionSchema)
98
- .describe(SimpleContent.PartsSchema.description);
81
+ .describe(SimpleContent.PartsSchema.description)
82
+ .meta({ title: "SimpleContentPartExpressions" });
99
83
  })(SimpleContent = Message.SimpleContent || (Message.SimpleContent = {}));
100
- Message.RichContentSchema = z
101
- .union([RichContent.TextSchema, RichContent.PartsSchema])
102
- .describe("Rich content.");
103
- Message.RichContentExpressionSchema = z
84
+ Message.SimpleContentSchema = z
85
+ .union([SimpleContent.TextSchema, SimpleContent.PartsSchema])
86
+ .describe("Simple content.")
87
+ .meta({ title: "SimpleContent" });
88
+ Message.SimpleContentExpressionSchema = z
104
89
  .union([
105
- RichContent.TextSchema,
106
- RichContent.PartsExpressionSchema,
107
- ExpressionSchema.describe("An expression which evaluates to rich content."),
90
+ SimpleContent.TextSchema,
91
+ SimpleContent.PartsExpressionSchema,
92
+ ExpressionSchema.describe("An expression which evaluates to simple content."),
108
93
  ])
109
- .describe(Message.RichContentSchema.description);
94
+ .describe(Message.SimpleContentSchema.description)
95
+ .meta({ title: "SimpleContentExpression" });
110
96
  let RichContent;
111
97
  (function (RichContent) {
112
- RichContent.TextSchema = z.string().describe("Plain text content.");
113
- RichContent.PartSchema = z
114
- .discriminatedUnion("type", [
115
- Part.TextSchema,
116
- Part.ImageUrlSchema,
117
- Part.InputAudioSchema,
118
- Part.VideoUrlSchema,
119
- Part.FileSchema,
120
- ])
121
- .describe("A rich content part.");
122
- RichContent.PartExpressionSchema = z
123
- .union([
124
- RichContent.PartSchema,
125
- ExpressionSchema.describe("An expression which evaluates to a rich content part."),
126
- ])
127
- .describe(RichContent.PartSchema.description);
98
+ RichContent.TextSchema = z
99
+ .string()
100
+ .describe("Plain text content.")
101
+ .meta({ title: "RichContentText" });
128
102
  let Part;
129
103
  (function (Part) {
130
- Part.TextSchema = z
131
- .object({
132
- type: z.literal("text"),
133
- text: Text.TextSchema,
134
- })
135
- .describe("A text rich content part.");
136
104
  let Text;
137
105
  (function (Text) {
138
106
  Text.TextSchema = z.string().describe("The text content.");
139
107
  })(Text = Part.Text || (Part.Text = {}));
140
- Part.ImageUrlSchema = z
108
+ Part.TextSchema = z
141
109
  .object({
142
- type: z.literal("image_url"),
143
- image_url: ImageUrl.DefinitionSchema,
110
+ type: z.literal("text"),
111
+ text: Text.TextSchema,
144
112
  })
145
- .describe("An image rich content part.");
113
+ .describe("A text rich content part.")
114
+ .meta({ title: "TextRichContentPart" });
146
115
  let ImageUrl;
147
116
  (function (ImageUrl) {
148
117
  ImageUrl.DetailSchema = z
@@ -158,12 +127,13 @@ export var Message;
158
127
  })
159
128
  .describe("The URL of the image and its optional detail level.");
160
129
  })(ImageUrl = Part.ImageUrl || (Part.ImageUrl = {}));
161
- Part.InputAudioSchema = z
130
+ Part.ImageUrlSchema = z
162
131
  .object({
163
- type: z.literal("input_audio"),
164
- input_audio: InputAudio.DefinitionSchema,
132
+ type: z.literal("image_url"),
133
+ image_url: ImageUrl.DefinitionSchema,
165
134
  })
166
- .describe("An audio rich content part.");
135
+ .describe("An image rich content part.")
136
+ .meta({ title: "ImageRichContentPart" });
167
137
  let InputAudio;
168
138
  (function (InputAudio) {
169
139
  InputAudio.FormatSchema = z
@@ -179,12 +149,13 @@ export var Message;
179
149
  })
180
150
  .describe("The audio data and its format.");
181
151
  })(InputAudio = Part.InputAudio || (Part.InputAudio = {}));
182
- Part.VideoUrlSchema = z
152
+ Part.InputAudioSchema = z
183
153
  .object({
184
- type: z.enum(["video_url", "input_video"]),
185
- video_url: VideoUrl.DefinitionSchema,
154
+ type: z.literal("input_audio"),
155
+ input_audio: InputAudio.DefinitionSchema,
186
156
  })
187
- .describe("A video rich content part.");
157
+ .describe("An audio rich content part.")
158
+ .meta({ title: "AudioRichContentPart" });
188
159
  let VideoUrl;
189
160
  (function (VideoUrl) {
190
161
  VideoUrl.UrlSchema = z.string().describe("URL of the video.");
@@ -192,12 +163,13 @@ export var Message;
192
163
  url: VideoUrl.UrlSchema,
193
164
  });
194
165
  })(VideoUrl = Part.VideoUrl || (Part.VideoUrl = {}));
195
- Part.FileSchema = z
166
+ Part.VideoUrlSchema = z
196
167
  .object({
197
- type: z.literal("file"),
198
- file: File.DefinitionSchema,
168
+ type: z.enum(["video_url", "input_video"]),
169
+ video_url: VideoUrl.DefinitionSchema,
199
170
  })
200
- .describe("A file rich content part.");
171
+ .describe("A video rich content part.")
172
+ .meta({ title: "VideoRichContentPart" });
201
173
  let File;
202
174
  (function (File) {
203
175
  File.FileDataSchema = z
@@ -221,202 +193,253 @@ export var Message;
221
193
  })
222
194
  .describe("The file to be used as input, either as base64 data, an uploaded file ID, or a URL.");
223
195
  })(File = Part.File || (Part.File = {}));
196
+ Part.FileSchema = z
197
+ .object({
198
+ type: z.literal("file"),
199
+ file: File.DefinitionSchema,
200
+ })
201
+ .describe("A file rich content part.")
202
+ .meta({ title: "FileRichContentPart" });
224
203
  })(Part = RichContent.Part || (RichContent.Part = {}));
204
+ RichContent.PartSchema = z
205
+ .discriminatedUnion("type", [
206
+ Part.TextSchema,
207
+ Part.ImageUrlSchema,
208
+ Part.InputAudioSchema,
209
+ Part.VideoUrlSchema,
210
+ Part.FileSchema,
211
+ ])
212
+ .describe("A rich content part.")
213
+ .meta({ title: "RichContentPart" });
214
+ RichContent.PartExpressionSchema = z
215
+ .union([
216
+ RichContent.PartSchema,
217
+ ExpressionSchema.describe("An expression which evaluates to a rich content part."),
218
+ ])
219
+ .describe(RichContent.PartSchema.description)
220
+ .meta({ title: "RichContentPartExpression" });
225
221
  RichContent.PartsSchema = z
226
222
  .array(RichContent.PartSchema)
227
- .describe("An array of rich content parts.");
223
+ .describe("An array of rich content parts.")
224
+ .meta({ title: "RichContentParts" });
228
225
  RichContent.PartsExpressionSchema = z
229
226
  .array(RichContent.PartExpressionSchema)
230
- .describe(RichContent.PartsSchema.description);
227
+ .describe(RichContent.PartsSchema.description)
228
+ .meta({ title: "RichContentPartExpressions" });
231
229
  })(RichContent = Message.RichContent || (Message.RichContent = {}));
230
+ Message.RichContentSchema = z
231
+ .union([RichContent.TextSchema, RichContent.PartsSchema])
232
+ .describe("Rich content.")
233
+ .meta({ title: "RichContent" });
234
+ Message.RichContentExpressionSchema = z
235
+ .union([
236
+ RichContent.TextSchema,
237
+ RichContent.PartsExpressionSchema,
238
+ ExpressionSchema.describe("An expression which evaluates to rich content."),
239
+ ])
240
+ .describe(Message.RichContentSchema.description)
241
+ .meta({ title: "RichContentExpression" });
232
242
  Message.NameSchema = z
233
243
  .string()
234
- .describe("An optional name for the participant. Provides the model information to differentiate between participants of the same role.");
244
+ .describe("An optional name for the participant. Provides the model information to differentiate between participants of the same role.")
245
+ .meta({ title: "MessageName" });
235
246
  Message.NameExpressionSchema = z
236
247
  .union([
237
248
  Message.NameSchema,
238
249
  ExpressionSchema.describe("An expression which evaluates to a string."),
239
250
  ])
240
- .describe(Message.NameSchema.description);
251
+ .describe(Message.NameSchema.description)
252
+ .meta({ title: "MessageNameExpression" });
241
253
  Message.DeveloperSchema = z
242
254
  .object({
243
255
  role: z.literal("developer"),
244
256
  content: Message.SimpleContentSchema,
245
257
  name: Message.NameSchema.optional().nullable(),
246
258
  })
247
- .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.");
259
+ .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.")
260
+ .meta({ title: "DeveloperMessage" });
248
261
  Message.DeveloperExpressionSchema = z
249
262
  .object({
250
263
  role: z.literal("developer"),
251
264
  content: Message.SimpleContentExpressionSchema,
252
265
  name: Message.NameExpressionSchema.optional().nullable(),
253
266
  })
254
- .describe(Message.DeveloperSchema.description);
267
+ .describe(Message.DeveloperSchema.description)
268
+ .meta({ title: "DeveloperMessageExpression" });
255
269
  Message.SystemSchema = z
256
270
  .object({
257
271
  role: z.literal("system"),
258
272
  content: Message.SimpleContentSchema,
259
273
  name: Message.NameSchema.optional().nullable(),
260
274
  })
261
- .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.");
275
+ .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.")
276
+ .meta({ title: "SystemMessage" });
262
277
  Message.SystemExpressionSchema = z
263
278
  .object({
264
279
  role: z.literal("system"),
265
280
  content: Message.SimpleContentExpressionSchema,
266
281
  name: Message.NameExpressionSchema.optional().nullable(),
267
282
  })
268
- .describe(Message.SystemSchema.description);
283
+ .describe(Message.SystemSchema.description)
284
+ .meta({ title: "SystemMessageExpression" });
269
285
  Message.UserSchema = z
270
286
  .object({
271
287
  role: z.literal("user"),
272
288
  content: Message.RichContentSchema,
273
289
  name: Message.NameSchema.optional().nullable(),
274
290
  })
275
- .describe("Messages sent by an end user, containing prompts or additional context information.");
291
+ .describe("Messages sent by an end user, containing prompts or additional context information.")
292
+ .meta({ title: "UserMessage" });
276
293
  Message.UserExpressionSchema = z
277
294
  .object({
278
295
  role: z.literal("user"),
279
296
  content: Message.RichContentExpressionSchema,
280
297
  name: Message.NameExpressionSchema.optional().nullable(),
281
298
  })
282
- .describe(Message.UserSchema.description);
283
- Message.ToolSchema = z
284
- .object({
285
- role: z.literal("tool"),
286
- content: Message.RichContentSchema,
287
- tool_call_id: Tool.ToolCallIdSchema,
288
- })
289
- .describe("Messages sent by tools in response to tool calls made by the assistant.");
290
- Message.ToolExpressionSchema = z
291
- .object({
292
- role: z.literal("tool"),
293
- content: Message.RichContentExpressionSchema,
294
- tool_call_id: Tool.ToolCallIdExpressionSchema,
295
- })
296
- .describe(Message.ToolSchema.description);
299
+ .describe(Message.UserSchema.description)
300
+ .meta({ title: "UserMessageExpression" });
297
301
  let Tool;
298
302
  (function (Tool) {
299
303
  Tool.ToolCallIdSchema = z
300
304
  .string()
301
- .describe("The ID of the tool call that this message is responding to.");
305
+ .describe("The ID of the tool call that this message is responding to.")
306
+ .meta({ title: "ToolMessageToolCallId" });
302
307
  Tool.ToolCallIdExpressionSchema = z
303
308
  .union([
304
309
  Tool.ToolCallIdSchema,
305
310
  ExpressionSchema.describe("An expression which evaluates to a string."),
306
311
  ])
307
- .describe(Tool.ToolCallIdSchema.description);
312
+ .describe(Tool.ToolCallIdSchema.description)
313
+ .meta({ title: "ToolMessageToolCallIdExpression" });
308
314
  })(Tool = Message.Tool || (Message.Tool = {}));
309
- Message.AssistantSchema = z
315
+ Message.ToolSchema = z
310
316
  .object({
311
- role: z.literal("assistant"),
312
- content: Message.RichContentSchema.optional().nullable(),
313
- name: Message.NameSchema.optional().nullable(),
314
- refusal: Assistant.RefusalSchema.optional().nullable(),
315
- tool_calls: Assistant.ToolCallsSchema.optional().nullable(),
316
- reasoning: Assistant.ReasoningSchema.optional().nullable(),
317
+ role: z.literal("tool"),
318
+ content: Message.RichContentSchema,
319
+ tool_call_id: Tool.ToolCallIdSchema,
317
320
  })
318
- .describe("Messages sent by the model in response to user messages.");
319
- Message.AssistantExpressionSchema = z
321
+ .describe("Messages sent by tools in response to tool calls made by the assistant.")
322
+ .meta({ title: "ToolMessage" });
323
+ Message.ToolExpressionSchema = z
320
324
  .object({
321
- role: z.literal("assistant"),
322
- content: Message.RichContentExpressionSchema.optional().nullable(),
323
- name: Message.NameExpressionSchema.optional().nullable(),
324
- refusal: Assistant.RefusalExpressionSchema.optional().nullable(),
325
- tool_calls: Assistant.ToolCallsExpressionSchema.optional().nullable(),
326
- reasoning: Assistant.ReasoningExpressionSchema.optional().nullable(),
325
+ role: z.literal("tool"),
326
+ content: Message.RichContentExpressionSchema,
327
+ tool_call_id: Tool.ToolCallIdExpressionSchema,
327
328
  })
328
- .describe(Message.AssistantSchema.description);
329
+ .describe(Message.ToolSchema.description)
330
+ .meta({ title: "ToolMessageExpression" });
329
331
  let Assistant;
330
332
  (function (Assistant) {
331
333
  Assistant.RefusalSchema = z
332
334
  .string()
333
- .describe("The refusal message by the assistant.");
335
+ .describe("The refusal message by the assistant.")
336
+ .meta({ title: "AssistantMessageRefusal" });
334
337
  Assistant.RefusalExpressionSchema = z
335
338
  .union([
336
339
  Assistant.RefusalSchema,
337
340
  ExpressionSchema.describe("An expression which evaluates to a string."),
338
341
  ])
339
- .describe(Assistant.RefusalSchema.description);
342
+ .describe(Assistant.RefusalSchema.description)
343
+ .meta({ title: "AssistantMessageRefusalExpression" });
340
344
  Assistant.ReasoningSchema = z
341
345
  .string()
342
- .describe("The reasoning provided by the assistant.");
346
+ .describe("The reasoning provided by the assistant.")
347
+ .meta({ title: "AssistantMessageReasoning" });
343
348
  Assistant.ReasoningExpressionSchema = z
344
349
  .union([
345
350
  Assistant.ReasoningSchema,
346
351
  ExpressionSchema.describe("An expression which evaluates to a string."),
347
352
  ])
348
- .describe(Assistant.ReasoningSchema.description);
349
- Assistant.ToolCallSchema = z
350
- .union([ToolCall.FunctionSchema])
351
- .describe("A tool call made by the assistant.");
352
- Assistant.ToolCallExpressionSchema = z
353
- .union([
354
- ToolCall.FunctionExpressionSchema,
355
- ExpressionSchema.describe("An expression which evaluates to a tool call."),
356
- ])
357
- .describe(Assistant.ToolCallSchema.description);
353
+ .describe(Assistant.ReasoningSchema.description)
354
+ .meta({ title: "AssistantMessageReasoningExpression" });
358
355
  let ToolCall;
359
356
  (function (ToolCall) {
360
357
  ToolCall.IdSchema = z
361
358
  .string()
362
- .describe("The unique identifier for the tool call.");
359
+ .describe("The unique identifier for the tool call.")
360
+ .meta({ title: "AssistantMessageToolCallId" });
363
361
  ToolCall.IdExpressionSchema = z
364
362
  .union([
365
363
  ToolCall.IdSchema,
366
364
  ExpressionSchema.describe("An expression which evaluates to a string."),
367
365
  ])
368
- .describe(ToolCall.IdSchema.description);
369
- ToolCall.FunctionSchema = z
370
- .object({
371
- type: z.literal("function"),
372
- id: ToolCall.IdSchema,
373
- function: Function.DefinitionSchema,
374
- })
375
- .describe("A function tool call made by the assistant.");
376
- ToolCall.FunctionExpressionSchema = z
377
- .object({
378
- type: z.literal("function"),
379
- id: ToolCall.IdExpressionSchema,
380
- function: Function.DefinitionExpressionSchema,
381
- })
382
- .describe(ToolCall.FunctionSchema.description);
366
+ .describe(ToolCall.IdSchema.description)
367
+ .meta({ title: "AssistantMessageToolCallIdExpression" });
383
368
  let Function;
384
369
  (function (Function) {
385
370
  Function.NameSchema = z
386
371
  .string()
387
- .describe("The name of the function called.");
372
+ .describe("The name of the function called.")
373
+ .meta({ title: "AssistantMessageToolCallFunctionName" });
388
374
  Function.NameExpressionSchema = z
389
375
  .union([
390
376
  Function.NameSchema,
391
377
  ExpressionSchema.describe("An expression which evaluates to a string."),
392
378
  ])
393
- .describe(Function.NameSchema.description);
379
+ .describe(Function.NameSchema.description)
380
+ .meta({ title: "AssistantMessageToolCallFunctionNameExpression" });
394
381
  Function.ArgumentsSchema = z
395
382
  .string()
396
- .describe("The arguments passed to the function.");
383
+ .describe("The arguments passed to the function.")
384
+ .meta({ title: "AssistantMessageToolCallFunctionArguments" });
397
385
  Function.ArgumentsExpressionSchema = z
398
386
  .union([
399
387
  Function.ArgumentsSchema,
400
388
  ExpressionSchema.describe("An expression which evaluates to a string."),
401
389
  ])
402
- .describe(Function.ArgumentsSchema.description);
390
+ .describe(Function.ArgumentsSchema.description)
391
+ .meta({
392
+ title: "AssistantMessageToolCallFunctionArgumentsExpression",
393
+ });
403
394
  Function.DefinitionSchema = z
404
395
  .object({
405
396
  name: Function.NameSchema,
406
397
  arguments: Function.ArgumentsSchema,
407
398
  })
408
- .describe("The name and arguments of the function called.");
399
+ .describe("The name and arguments of the function called.")
400
+ .meta({ title: "AssistantMessageToolCallFunctionDefinition" });
409
401
  Function.DefinitionExpressionSchema = z
410
402
  .object({
411
403
  name: Function.NameExpressionSchema,
412
404
  arguments: Function.ArgumentsExpressionSchema,
413
405
  })
414
- .describe(Function.DefinitionSchema.description);
406
+ .describe(Function.DefinitionSchema.description)
407
+ .meta({
408
+ title: "AssistantMessageToolCallFunctionDefinitionExpression",
409
+ });
415
410
  })(Function = ToolCall.Function || (ToolCall.Function = {}));
411
+ ToolCall.FunctionSchema = z
412
+ .object({
413
+ type: z.literal("function"),
414
+ id: ToolCall.IdSchema,
415
+ function: Function.DefinitionSchema,
416
+ })
417
+ .describe("A function tool call made by the assistant.")
418
+ .meta({ title: "AssistantMessageToolCallFunction" });
419
+ ToolCall.FunctionExpressionSchema = z
420
+ .object({
421
+ type: z.literal("function"),
422
+ id: ToolCall.IdExpressionSchema,
423
+ function: Function.DefinitionExpressionSchema,
424
+ })
425
+ .describe(ToolCall.FunctionSchema.description)
426
+ .meta({ title: "AssistantMessageToolCallFunctionExpression" });
416
427
  })(ToolCall = Assistant.ToolCall || (Assistant.ToolCall = {}));
428
+ Assistant.ToolCallSchema = z
429
+ .union([ToolCall.FunctionSchema])
430
+ .describe("A tool call made by the assistant.")
431
+ .meta({ title: "AssistantMessageToolCall" });
432
+ Assistant.ToolCallExpressionSchema = z
433
+ .union([
434
+ ToolCall.FunctionExpressionSchema,
435
+ ExpressionSchema.describe("An expression which evaluates to a tool call."),
436
+ ])
437
+ .describe(Assistant.ToolCallSchema.description)
438
+ .meta({ title: "AssistantMessageToolCallExpression" });
417
439
  Assistant.ToolCallsSchema = z
418
440
  .array(Assistant.ToolCallSchema)
419
- .describe("Tool calls made by the assistant.");
441
+ .describe("Tool calls made by the assistant.")
442
+ .meta({ title: "AssistantMessageToolCalls" });
420
443
  Assistant.ToolCallsExpressionSchema = z
421
444
  .union([
422
445
  z
@@ -424,78 +447,120 @@ export var Message;
424
447
  .describe(Assistant.ToolCallsSchema.description),
425
448
  ExpressionSchema.describe("An expression which evaluates to an array of tool calls."),
426
449
  ])
427
- .describe(Assistant.ToolCallsSchema.description);
450
+ .describe(Assistant.ToolCallsSchema.description)
451
+ .meta({ title: "AssistantMessageToolCallsExpression" });
428
452
  })(Assistant = Message.Assistant || (Message.Assistant = {}));
453
+ Message.AssistantSchema = z
454
+ .object({
455
+ role: z.literal("assistant"),
456
+ content: Message.RichContentSchema.optional().nullable(),
457
+ name: Message.NameSchema.optional().nullable(),
458
+ refusal: Assistant.RefusalSchema.optional().nullable(),
459
+ tool_calls: Assistant.ToolCallsSchema.optional().nullable(),
460
+ reasoning: Assistant.ReasoningSchema.optional().nullable(),
461
+ })
462
+ .describe("Messages sent by the model in response to user messages.")
463
+ .meta({ title: "AssistantMessage" });
464
+ Message.AssistantExpressionSchema = z
465
+ .object({
466
+ role: z.literal("assistant"),
467
+ content: Message.RichContentExpressionSchema.optional().nullable(),
468
+ name: Message.NameExpressionSchema.optional().nullable(),
469
+ refusal: Assistant.RefusalExpressionSchema.optional().nullable(),
470
+ tool_calls: Assistant.ToolCallsExpressionSchema.optional().nullable(),
471
+ reasoning: Assistant.ReasoningExpressionSchema.optional().nullable(),
472
+ })
473
+ .describe(Message.AssistantSchema.description)
474
+ .meta({ title: "AssistantMessageExpression" });
429
475
  })(Message || (Message = {}));
476
+ export const MessageSchema = z
477
+ .discriminatedUnion("role", [
478
+ Message.DeveloperSchema,
479
+ Message.SystemSchema,
480
+ Message.UserSchema,
481
+ Message.ToolSchema,
482
+ Message.AssistantSchema,
483
+ ])
484
+ .describe("A message exchanged in a chat conversation.")
485
+ .meta({ title: "Message" });
486
+ export const MessageExpressionSchema = z
487
+ .union([
488
+ z
489
+ .discriminatedUnion("role", [
490
+ Message.DeveloperExpressionSchema,
491
+ Message.SystemExpressionSchema,
492
+ Message.UserExpressionSchema,
493
+ Message.ToolExpressionSchema,
494
+ Message.AssistantExpressionSchema,
495
+ ])
496
+ .describe(MessageSchema.description),
497
+ ExpressionSchema.describe("An expression which evaluates to a message."),
498
+ ])
499
+ .describe(MessageSchema.description)
500
+ .meta({ title: "MessageExpression" });
430
501
  export const MessagesSchema = z
431
502
  .array(MessageSchema)
432
- .describe("A list of messages exchanged in a chat conversation.");
503
+ .describe("A list of messages exchanged in a chat conversation.")
504
+ .meta({ title: "Messages" });
433
505
  export const MessagesExpressionSchema = z
434
506
  .union([
435
- z.array(MessageExpressionSchema).describe(MessagesSchema.description),
507
+ z
508
+ .array(MessageExpressionSchema)
509
+ .describe(MessagesSchema.description)
510
+ .meta({ title: "MessageExpressions" }),
436
511
  ExpressionSchema.describe("An expression which evaluates to an array of messages."),
437
512
  ])
438
- .describe(MessagesSchema.description);
513
+ .describe(MessagesSchema.description)
514
+ .meta({ title: "MessagesExpression" });
439
515
  // Tools
440
- export const ToolSchema = z
441
- .union([Tool.FunctionSchema])
442
- .describe("A tool that the assistant can call.");
443
- export const ToolExpressionSchema = z
444
- .union([
445
- Tool.FunctionExpressionSchema,
446
- ExpressionSchema.describe("An expression which evaluates to a tool."),
447
- ])
448
- .describe(ToolSchema.description);
449
516
  export var Tool;
450
517
  (function (Tool) {
451
- Tool.FunctionSchema = z
452
- .object({
453
- type: z.literal("function"),
454
- function: Function.DefinitionSchema,
455
- })
456
- .describe("A function tool that the assistant can call.");
457
- Tool.FunctionExpressionSchema = z
458
- .object({
459
- type: z.literal("function"),
460
- function: Function.DefinitionExpressionSchema,
461
- })
462
- .describe(Tool.FunctionSchema.description);
463
518
  let Function;
464
519
  (function (Function) {
465
- Function.NameSchema = z.string().describe("The name of the function.");
520
+ Function.NameSchema = z
521
+ .string()
522
+ .describe("The name of the function.")
523
+ .meta({ title: "FunctionToolName" });
466
524
  Function.NameExpressionSchema = z
467
525
  .union([
468
526
  Function.NameSchema,
469
527
  ExpressionSchema.describe("An expression which evaluates to a string."),
470
528
  ])
471
- .describe(Function.NameSchema.description);
529
+ .describe(Function.NameSchema.description)
530
+ .meta({ title: "FunctionToolNameExpression" });
472
531
  Function.DescriptionSchema = z
473
532
  .string()
474
- .describe("The description of the function.");
533
+ .describe("The description of the function.")
534
+ .meta({ title: "FunctionToolDescription" });
475
535
  Function.DescriptionExpressionSchema = z
476
536
  .union([
477
537
  Function.DescriptionSchema,
478
538
  ExpressionSchema.describe("An expression which evaluates to a string."),
479
539
  ])
480
- .describe(Function.DescriptionSchema.description);
540
+ .describe(Function.DescriptionSchema.description)
541
+ .meta({ title: "FunctionToolDescriptionExpression" });
481
542
  Function.ParametersSchema = z
482
543
  .record(z.string(), JsonValueSchema)
483
- .describe("The JSON schema defining the parameters of the function.");
544
+ .describe("The JSON schema defining the parameters of the function.")
545
+ .meta({ title: "FunctionToolParameters" });
484
546
  Function.ParametersExpressionSchema = z
485
547
  .union([
486
548
  z.record(z.string(), JsonValueExpressionSchema),
487
549
  ExpressionSchema.describe("An expression which evaluates to a JSON schema object."),
488
550
  ])
489
- .describe(Function.ParametersSchema.description);
551
+ .describe(Function.ParametersSchema.description)
552
+ .meta({ title: "FunctionToolParametersExpression" });
490
553
  Function.StrictSchema = z
491
554
  .boolean()
492
- .describe("Whether to enforce strict adherence to the parameter schema.");
555
+ .describe("Whether to enforce strict adherence to the parameter schema.")
556
+ .meta({ title: "FunctionToolStrict" });
493
557
  Function.StrictExpressionSchema = z
494
558
  .union([
495
559
  Function.StrictSchema,
496
560
  ExpressionSchema.describe("An expression which evaluates to a boolean."),
497
561
  ])
498
- .describe(Function.StrictSchema.description);
562
+ .describe(Function.StrictSchema.description)
563
+ .meta({ title: "FunctionToolStrictExpression" });
499
564
  Function.DefinitionSchema = z
500
565
  .object({
501
566
  name: Function.NameSchema,
@@ -503,7 +568,8 @@ export var Tool;
503
568
  parameters: Function.ParametersSchema.optional().nullable(),
504
569
  strict: Function.StrictSchema.optional().nullable(),
505
570
  })
506
- .describe("The definition of a function tool.");
571
+ .describe("The definition of a function tool.")
572
+ .meta({ title: "FunctionToolDefinition" });
507
573
  Function.DefinitionExpressionSchema = z
508
574
  .object({
509
575
  name: Function.NameExpressionSchema,
@@ -511,38 +577,214 @@ export var Tool;
511
577
  parameters: Function.ParametersExpressionSchema.optional().nullable(),
512
578
  strict: Function.StrictExpressionSchema.optional().nullable(),
513
579
  })
514
- .describe(Function.DefinitionSchema.description);
580
+ .describe(Function.DefinitionSchema.description)
581
+ .meta({ title: "FunctionToolDefinitionExpression" });
515
582
  })(Function = Tool.Function || (Tool.Function = {}));
583
+ Tool.FunctionSchema = z
584
+ .object({
585
+ type: z.literal("function"),
586
+ function: Function.DefinitionSchema,
587
+ })
588
+ .describe("A function tool that the assistant can call.")
589
+ .meta({ title: "FunctionTool" });
590
+ Tool.FunctionExpressionSchema = z
591
+ .object({
592
+ type: z.literal("function"),
593
+ function: Function.DefinitionExpressionSchema,
594
+ })
595
+ .describe(Tool.FunctionSchema.description)
596
+ .meta({ title: "FunctionToolExpression" });
516
597
  })(Tool || (Tool = {}));
598
+ export const ToolSchema = z
599
+ .union([Tool.FunctionSchema])
600
+ .describe("A tool that the assistant can call.")
601
+ .meta({ title: "Tool" });
602
+ export const ToolExpressionSchema = z
603
+ .union([
604
+ Tool.FunctionExpressionSchema,
605
+ ExpressionSchema.describe("An expression which evaluates to a tool."),
606
+ ])
607
+ .describe(ToolSchema.description)
608
+ .meta({ title: "ToolExpression" });
517
609
  export const ToolsSchema = z
518
610
  .array(ToolSchema)
519
- .describe("A list of tools that the assistant can call.");
611
+ .describe("A list of tools that the assistant can call.")
612
+ .meta({ title: "Tools" });
520
613
  export const ToolsExpressionSchema = z
521
614
  .union([
522
- z.array(ToolExpressionSchema).describe(ToolsSchema.description),
615
+ z
616
+ .array(ToolExpressionSchema)
617
+ .describe(ToolsSchema.description)
618
+ .meta({ title: "ToolExpressions" }),
523
619
  ExpressionSchema.describe("An expression which evaluates to an array of tools."),
524
620
  ])
525
- .describe(ToolsSchema.description);
621
+ .describe(ToolsSchema.description)
622
+ .meta({ title: "ToolsExpression" });
526
623
  // Vector Responses
527
- export const VectorResponseSchema = Message.RichContentSchema.describe("A possible assistant response. The LLMs in the Ensemble may vote for this option.");
624
+ export const VectorResponseSchema = Message.RichContentSchema.describe("A possible assistant response. The LLMs in the Ensemble may vote for this option.").meta({ title: "VectorResponse" });
528
625
  export const VectorResponseExpressionSchema = z
529
626
  .union([
530
627
  VectorResponseSchema,
531
628
  ExpressionSchema.describe("An expression which evaluates to a possible assistant response."),
532
629
  ])
533
- .describe(VectorResponseSchema.description);
630
+ .describe(VectorResponseSchema.description)
631
+ .meta({ title: "VectorResponseExpression" });
534
632
  export const VectorResponsesSchema = z
535
633
  .array(VectorResponseSchema)
536
- .describe("A list of possible assistant responses which the LLMs in the Ensemble will vote on. The output scores will be of the same length, each corresponding to one response. The winner is the response with the highest score.");
634
+ .describe("A list of possible assistant responses which the LLMs in the Ensemble will vote on. The output scores will be of the same length, each corresponding to one response. The winner is the response with the highest score.")
635
+ .meta({ title: "VectorResponses" });
537
636
  export const VectorResponsesExpressionSchema = z
538
637
  .union([
539
638
  z
540
639
  .array(VectorResponseExpressionSchema)
541
- .describe(VectorResponsesSchema.description),
640
+ .describe(VectorResponsesSchema.description)
641
+ .meta({ title: "VectorResponseExpressions" }),
542
642
  ExpressionSchema.describe("An expression which evaluates to an array of possible assistant responses."),
543
643
  ])
544
- .describe(VectorResponsesSchema.description);
644
+ .describe(VectorResponsesSchema.description)
645
+ .meta({ title: "VectorResponsesExpression" });
545
646
  // Ensemble LLM
647
+ export var EnsembleLlm;
648
+ (function (EnsembleLlm) {
649
+ EnsembleLlm.OutputModeSchema = z
650
+ .enum(["instruction", "json_schema", "tool_call"])
651
+ .describe('For Vector Completions only, specifies the LLM\'s voting output mode. For "instruction", the assistant is instructed to output a key. For "json_schema", the assistant is constrained to output a valid key using a JSON schema. For "tool_call", the assistant is instructed to output a tool call to select the key.');
652
+ EnsembleLlm.StopSchema = z
653
+ .union([
654
+ z
655
+ .string()
656
+ .describe("Generation will stop when this string is generated.")
657
+ .meta({ title: "StopString" }),
658
+ z
659
+ .array(z.string().meta({ title: "StopString" }))
660
+ .describe("Generation will stop when any of these strings are generated.")
661
+ .meta({ title: "StopStrings" }),
662
+ ])
663
+ .describe("The assistant will stop when any of the provided strings are generated.")
664
+ .meta({ title: "Stop" });
665
+ let Provider;
666
+ (function (Provider) {
667
+ Provider.QuantizationSchema = z
668
+ .enum([
669
+ "int4",
670
+ "int8",
671
+ "fp4",
672
+ "fp6",
673
+ "fp8",
674
+ "fp16",
675
+ "bf16",
676
+ "fp32",
677
+ "unknown",
678
+ ])
679
+ .describe("An LLM quantization.")
680
+ .meta({ title: "ProviderQuantization" });
681
+ })(Provider = EnsembleLlm.Provider || (EnsembleLlm.Provider = {}));
682
+ EnsembleLlm.ProviderSchema = z
683
+ .object({
684
+ allow_fallbacks: z
685
+ .boolean()
686
+ .optional()
687
+ .nullable()
688
+ .describe("Whether to allow fallback providers if the preferred provider is unavailable."),
689
+ require_parameters: z
690
+ .boolean()
691
+ .optional()
692
+ .nullable()
693
+ .describe("Whether to require that the provider supports all specified parameters."),
694
+ order: z
695
+ .array(z.string().meta({ title: "ProviderName" }))
696
+ .optional()
697
+ .nullable()
698
+ .describe("An ordered list of provider names to use when selecting a provider for this model."),
699
+ only: z
700
+ .array(z.string().meta({ title: "ProviderName" }))
701
+ .optional()
702
+ .nullable()
703
+ .describe("A list of provider names to restrict selection to when selecting a provider for this model."),
704
+ ignore: z
705
+ .array(z.string().meta({ title: "ProviderName" }))
706
+ .optional()
707
+ .nullable()
708
+ .describe("A list of provider names to ignore when selecting a provider for this model."),
709
+ quantizations: z
710
+ .array(Provider.QuantizationSchema)
711
+ .optional()
712
+ .nullable()
713
+ .describe("Specifies the quantizations to allow when selecting providers for this model."),
714
+ })
715
+ .describe("Options for selecting the upstream provider of this model.");
716
+ let Reasoning;
717
+ (function (Reasoning) {
718
+ Reasoning.EffortSchema = z
719
+ .enum(["none", "minimal", "low", "medium", "high", "xhigh"])
720
+ .describe("Constrains effort on reasoning for supported reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.")
721
+ .meta({ title: "ReasoningEffort" });
722
+ Reasoning.SummaryVerbositySchema = z
723
+ .enum(["auto", "concise", "detailed"])
724
+ .describe("Controls the verbosity of the reasoning summary for supported reasoning models.")
725
+ .meta({ title: "ReasoningSummaryVerbosity" });
726
+ })(Reasoning = EnsembleLlm.Reasoning || (EnsembleLlm.Reasoning = {}));
727
+ EnsembleLlm.ReasoningSchema = z
728
+ .object({
729
+ enabled: z
730
+ .boolean()
731
+ .optional()
732
+ .nullable()
733
+ .describe("Enables or disables reasoning for supported models."),
734
+ max_tokens: z
735
+ .int()
736
+ .min(0)
737
+ .max(2147483647)
738
+ .optional()
739
+ .nullable()
740
+ .describe("The maximum number of tokens to use for reasoning in a response."),
741
+ effort: Reasoning.EffortSchema.optional().nullable(),
742
+ summary_verbosity: Reasoning.SummaryVerbositySchema.optional().nullable(),
743
+ })
744
+ .optional()
745
+ .nullable()
746
+ .describe("Options for controlling reasoning behavior of the model.");
747
+ EnsembleLlm.VerbositySchema = z
748
+ .enum(["low", "medium", "high"])
749
+ .describe("Controls the verbosity and length of the model response. Lower values produce more concise responses, while higher values produce more detailed and comprehensive responses.");
750
+ EnsembleLlm.ListItemSchema = z.object({
751
+ id: z.string().describe("The unique identifier for the Ensemble LLM."),
752
+ });
753
+ async function list(openai, options) {
754
+ const response = await openai.get("/ensemble_llms", options);
755
+ return response;
756
+ }
757
+ EnsembleLlm.list = list;
758
+ EnsembleLlm.RetrieveItemSchema = z.lazy(() => EnsembleLlmSchema.extend({
759
+ created: z
760
+ .uint32()
761
+ .describe("The Unix timestamp (in seconds) when the Ensemble LLM was created."),
762
+ }));
763
+ async function retrieve(openai, id, options) {
764
+ const response = await openai.get(`/ensemble_llms/${id}`, options);
765
+ return response;
766
+ }
767
+ EnsembleLlm.retrieve = retrieve;
768
+ EnsembleLlm.HistoricalUsageSchema = z.object({
769
+ requests: z
770
+ .uint32()
771
+ .describe("The total number of requests made to this Ensemble LLM."),
772
+ completion_tokens: z
773
+ .uint32()
774
+ .describe("The total number of completion tokens generated by this Ensemble LLM."),
775
+ prompt_tokens: z
776
+ .uint32()
777
+ .describe("The total number of prompt tokens sent to this Ensemble LLM."),
778
+ total_cost: z
779
+ .number()
780
+ .describe("The total cost incurred by using this Ensemble LLM."),
781
+ });
782
+ async function retrieveUsage(openai, id, options) {
783
+ const response = await openai.get(`/ensemble_llms/${id}/usage`, options);
784
+ return response;
785
+ }
786
+ EnsembleLlm.retrieveUsage = retrieveUsage;
787
+ })(EnsembleLlm || (EnsembleLlm = {}));
546
788
  export const EnsembleLlmBaseSchema = z
547
789
  .object({
548
790
  model: z.string().describe("The full ID of the LLM to use."),
@@ -656,155 +898,20 @@ export const EnsembleLlmBaseWithFallbacksAndCountSchema = EnsembleLlmBaseSchema.
656
898
  fallbacks: z
657
899
  .array(EnsembleLlmBaseSchema)
658
900
  .optional()
659
- .nullable()
660
- .describe("A list of fallback LLMs to use if the primary LLM fails."),
661
- }).describe("An LLM to be used within an Ensemble, including optional fallbacks and count.");
662
- export const EnsembleLlmSchema = EnsembleLlmBaseSchema.extend({
663
- id: z.string().describe("The unique identifier for the Ensemble LLM."),
664
- }).describe("An LLM to be used within an Ensemble or standalone with Chat Completions, including its unique identifier.");
665
- export const EnsembleLlmWithFallbacksAndCountSchema = EnsembleLlmSchema.extend({
666
- count: EnsembleLlmBaseWithFallbacksAndCountSchema.shape.count,
667
- fallbacks: z
668
- .array(EnsembleLlmSchema)
669
- .optional()
670
- .nullable()
671
- .describe(EnsembleLlmBaseWithFallbacksAndCountSchema.shape.fallbacks.description),
672
- }).describe("An LLM to be used within an Ensemble, including its unique identifier, optional fallbacks, and count.");
673
- export var EnsembleLlm;
674
- (function (EnsembleLlm) {
675
- EnsembleLlm.OutputModeSchema = z
676
- .enum(["instruction", "json_schema", "tool_call"])
677
- .describe('For Vector Completions only, specifies the LLM\'s voting output mode. For "instruction", the assistant is instructed to output a key. For "json_schema", the assistant is constrained to output a valid key using a JSON schema. For "tool_call", the assistant is instructed to output a tool call to select the key.');
678
- EnsembleLlm.StopSchema = z
679
- .union([
680
- z
681
- .string()
682
- .describe("Generation will stop when this string is generated."),
683
- z
684
- .array(z.string())
685
- .describe("Generation will stop when any of these strings are generated."),
686
- ])
687
- .describe("The assistant will stop when any of the provided strings are generated.");
688
- EnsembleLlm.ProviderSchema = z
689
- .object({
690
- allow_fallbacks: z
691
- .boolean()
692
- .optional()
693
- .nullable()
694
- .describe("Whether to allow fallback providers if the preferred provider is unavailable."),
695
- require_parameters: z
696
- .boolean()
697
- .optional()
698
- .nullable()
699
- .describe("Whether to require that the provider supports all specified parameters."),
700
- order: z
701
- .array(z.string())
702
- .optional()
703
- .nullable()
704
- .describe("An ordered list of provider names to use when selecting a provider for this model."),
705
- only: z
706
- .array(z.string())
707
- .optional()
708
- .nullable()
709
- .describe("A list of provider names to restrict selection to when selecting a provider for this model."),
710
- ignore: z
711
- .array(z.string())
712
- .optional()
713
- .nullable()
714
- .describe("A list of provider names to ignore when selecting a provider for this model."),
715
- quantizations: z
716
- .array(Provider.QuantizationSchema)
717
- .optional()
718
- .nullable()
719
- .describe("Specifies the quantizations to allow when selecting providers for this model."),
720
- })
721
- .describe("Options for selecting the upstream provider of this model.");
722
- let Provider;
723
- (function (Provider) {
724
- Provider.QuantizationSchema = z
725
- .enum([
726
- "int4",
727
- "int8",
728
- "fp4",
729
- "fp6",
730
- "fp8",
731
- "fp16",
732
- "bf16",
733
- "fp32",
734
- "unknown",
735
- ])
736
- .describe("An LLM quantization.");
737
- })(Provider = EnsembleLlm.Provider || (EnsembleLlm.Provider = {}));
738
- EnsembleLlm.ReasoningSchema = z
739
- .object({
740
- enabled: z
741
- .boolean()
742
- .optional()
743
- .nullable()
744
- .describe("Enables or disables reasoning for supported models."),
745
- max_tokens: z
746
- .int()
747
- .min(0)
748
- .max(2147483647)
749
- .optional()
750
- .nullable()
751
- .describe("The maximum number of tokens to use for reasoning in a response."),
752
- effort: Reasoning.EffortSchema.optional().nullable(),
753
- summary_verbosity: Reasoning.SummaryVerbositySchema.optional().nullable(),
754
- })
901
+ .nullable()
902
+ .describe("A list of fallback LLMs to use if the primary LLM fails."),
903
+ }).describe("An LLM to be used within an Ensemble, including optional fallbacks and count.");
904
+ export const EnsembleLlmSchema = EnsembleLlmBaseSchema.extend({
905
+ id: z.string().describe("The unique identifier for the Ensemble LLM."),
906
+ }).describe("An LLM to be used within an Ensemble or standalone with Chat Completions, including its unique identifier.");
907
+ export const EnsembleLlmWithFallbacksAndCountSchema = EnsembleLlmSchema.extend({
908
+ count: EnsembleLlmBaseWithFallbacksAndCountSchema.shape.count,
909
+ fallbacks: z
910
+ .array(EnsembleLlmSchema)
755
911
  .optional()
756
912
  .nullable()
757
- .describe("Options for controlling reasoning behavior of the model.");
758
- let Reasoning;
759
- (function (Reasoning) {
760
- Reasoning.EffortSchema = z
761
- .enum(["none", "minimal", "low", "medium", "high", "xhigh"])
762
- .describe("Constrains effort on reasoning for supported reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.");
763
- Reasoning.SummaryVerbositySchema = z
764
- .enum(["auto", "concise", "detailed"])
765
- .describe("Controls the verbosity of the reasoning summary for supported reasoning models.");
766
- })(Reasoning = EnsembleLlm.Reasoning || (EnsembleLlm.Reasoning = {}));
767
- EnsembleLlm.VerbositySchema = z
768
- .enum(["low", "medium", "high"])
769
- .describe("Controls the verbosity and length of the model response. Lower values produce more concise responses, while higher values produce more detailed and comprehensive responses.");
770
- EnsembleLlm.ListItemSchema = z.object({
771
- id: z.string().describe("The unique identifier for the Ensemble LLM."),
772
- });
773
- async function list(openai, options) {
774
- const response = await openai.get("/ensemble_llms", options);
775
- return response;
776
- }
777
- EnsembleLlm.list = list;
778
- EnsembleLlm.RetrieveItemSchema = EnsembleLlmSchema.extend({
779
- created: z
780
- .uint32()
781
- .describe("The Unix timestamp (in seconds) when the Ensemble LLM was created."),
782
- });
783
- async function retrieve(openai, id, options) {
784
- const response = await openai.get(`/ensemble_llms/${id}`, options);
785
- return response;
786
- }
787
- EnsembleLlm.retrieve = retrieve;
788
- EnsembleLlm.HistoricalUsageSchema = z.object({
789
- requests: z
790
- .uint32()
791
- .describe("The total number of requests made to this Ensemble LLM."),
792
- completion_tokens: z
793
- .uint32()
794
- .describe("The total number of completion tokens generated by this Ensemble LLM."),
795
- prompt_tokens: z
796
- .uint32()
797
- .describe("The total number of prompt tokens sent to this Ensemble LLM."),
798
- total_cost: z
799
- .number()
800
- .describe("The total cost incurred by using this Ensemble LLM."),
801
- });
802
- async function retrieveUsage(openai, id, options) {
803
- const response = await openai.get(`/ensemble_llms/${id}/usage`, options);
804
- return response;
805
- }
806
- EnsembleLlm.retrieveUsage = retrieveUsage;
807
- })(EnsembleLlm || (EnsembleLlm = {}));
913
+ .describe(EnsembleLlmBaseWithFallbacksAndCountSchema.shape.fallbacks.description),
914
+ }).describe("An LLM to be used within an Ensemble, including its unique identifier, optional fallbacks, and count.");
808
915
  // Ensemble
809
916
  export const EnsembleBaseSchema = z
810
917
  .object({
@@ -868,38 +975,6 @@ export var Chat;
868
975
  (function (Completions) {
869
976
  let Request;
870
977
  (function (Request) {
871
- Request.ProviderSchema = z
872
- .object({
873
- data_collection: Provider.DataCollectionSchema.optional().nullable(),
874
- zdr: z
875
- .boolean()
876
- .optional()
877
- .nullable()
878
- .describe("Whether to enforce Zero Data Retention (ZDR) policies when selecting providers."),
879
- sort: Provider.SortSchema.optional().nullable(),
880
- max_price: Provider.MaxPriceSchema.optional().nullable(),
881
- preferred_min_throughput: z
882
- .number()
883
- .optional()
884
- .nullable()
885
- .describe("Preferred minimum throughput for the provider."),
886
- preferred_max_latency: z
887
- .number()
888
- .optional()
889
- .nullable()
890
- .describe("Preferred maximum latency for the provider."),
891
- min_throughput: z
892
- .number()
893
- .optional()
894
- .nullable()
895
- .describe("Minimum throughput for the provider."),
896
- max_latency: z
897
- .number()
898
- .optional()
899
- .nullable()
900
- .describe("Maximum latency for the provider."),
901
- })
902
- .describe("Options for selecting the upstream provider of this completion.");
903
978
  let Provider;
904
979
  (function (Provider) {
905
980
  Provider.DataCollectionSchema = z
@@ -936,36 +1011,55 @@ export var Chat;
936
1011
  .describe("Maximum price per request."),
937
1012
  });
938
1013
  })(Provider = Request.Provider || (Request.Provider = {}));
1014
+ Request.ProviderSchema = z
1015
+ .object({
1016
+ data_collection: Provider.DataCollectionSchema.optional().nullable(),
1017
+ zdr: z
1018
+ .boolean()
1019
+ .optional()
1020
+ .nullable()
1021
+ .describe("Whether to enforce Zero Data Retention (ZDR) policies when selecting providers."),
1022
+ sort: Provider.SortSchema.optional().nullable(),
1023
+ max_price: Provider.MaxPriceSchema.optional().nullable(),
1024
+ preferred_min_throughput: z
1025
+ .number()
1026
+ .optional()
1027
+ .nullable()
1028
+ .describe("Preferred minimum throughput for the provider."),
1029
+ preferred_max_latency: z
1030
+ .number()
1031
+ .optional()
1032
+ .nullable()
1033
+ .describe("Preferred maximum latency for the provider."),
1034
+ min_throughput: z
1035
+ .number()
1036
+ .optional()
1037
+ .nullable()
1038
+ .describe("Minimum throughput for the provider."),
1039
+ max_latency: z
1040
+ .number()
1041
+ .optional()
1042
+ .nullable()
1043
+ .describe("Maximum latency for the provider."),
1044
+ })
1045
+ .describe("Options for selecting the upstream provider of this completion.");
939
1046
  Request.ModelSchema = z
940
1047
  .union([z.string(), EnsembleLlmBaseSchema])
941
1048
  .describe("The Ensemble LLM to use for this completion. May be a unique ID or an inline definition.");
942
- Request.ResponseFormatSchema = z
943
- .union([
944
- ResponseFormat.TextSchema,
945
- ResponseFormat.JsonObjectSchema,
946
- ResponseFormat.JsonSchemaSchema,
947
- ResponseFormat.GrammarSchema,
948
- ResponseFormat.PythonSchema,
949
- ])
950
- .describe("The desired format of the model's response.");
951
1049
  let ResponseFormat;
952
1050
  (function (ResponseFormat) {
953
1051
  ResponseFormat.TextSchema = z
954
1052
  .object({
955
1053
  type: z.literal("text"),
956
1054
  })
957
- .describe("The response will be arbitrary text.");
1055
+ .describe("The response will be arbitrary text.")
1056
+ .meta({ title: "ResponseFormatText" });
958
1057
  ResponseFormat.JsonObjectSchema = z
959
1058
  .object({
960
1059
  type: z.literal("json_object"),
961
1060
  })
962
- .describe("The response will be a JSON object.");
963
- ResponseFormat.JsonSchemaSchema = z
964
- .object({
965
- type: z.literal("json_schema"),
966
- json_schema: JsonSchema.JsonSchemaSchema,
967
- })
968
- .describe("The response will conform to the provided JSON schema.");
1061
+ .describe("The response will be a JSON object.")
1062
+ .meta({ title: "ResponseFormatJsonObject" });
969
1063
  let JsonSchema;
970
1064
  (function (JsonSchema) {
971
1065
  JsonSchema.JsonSchemaSchema = z
@@ -986,8 +1080,16 @@ export var Chat;
986
1080
  .nullable()
987
1081
  .describe("Whether to enforce strict adherence to the JSON schema."),
988
1082
  })
989
- .describe("A JSON schema definition for constraining model output.");
1083
+ .describe("A JSON schema definition for constraining model output.")
1084
+ .meta({ title: "ResponseFormatJsonSchemaJsonSchema" });
990
1085
  })(JsonSchema = ResponseFormat.JsonSchema || (ResponseFormat.JsonSchema = {}));
1086
+ ResponseFormat.JsonSchemaSchema = z
1087
+ .object({
1088
+ type: z.literal("json_schema"),
1089
+ json_schema: JsonSchema.JsonSchemaSchema,
1090
+ })
1091
+ .describe("The response will conform to the provided JSON schema.")
1092
+ .meta({ title: "ResponseFormatJsonSchema" });
991
1093
  ResponseFormat.GrammarSchema = z
992
1094
  .object({
993
1095
  type: z.literal("grammar"),
@@ -995,50 +1097,56 @@ export var Chat;
995
1097
  .string()
996
1098
  .describe("The grammar definition to constrain the response."),
997
1099
  })
998
- .describe("The response will conform to the provided grammar definition.");
1100
+ .describe("The response will conform to the provided grammar definition.")
1101
+ .meta({ title: "ResponseFormatGrammar" });
999
1102
  ResponseFormat.PythonSchema = z
1000
1103
  .object({
1001
1104
  type: z.literal("python"),
1002
1105
  })
1003
- .describe("The response will be Python code.");
1106
+ .describe("The response will be Python code.")
1107
+ .meta({ title: "ResponseFormatPython" });
1004
1108
  })(ResponseFormat = Request.ResponseFormat || (Request.ResponseFormat = {}));
1005
- Request.ToolChoiceSchema = z
1109
+ Request.ResponseFormatSchema = z
1006
1110
  .union([
1007
- z.literal("none"),
1008
- z.literal("auto"),
1009
- z.literal("required"),
1010
- ToolChoice.FunctionSchema,
1111
+ ResponseFormat.TextSchema,
1112
+ ResponseFormat.JsonObjectSchema,
1113
+ ResponseFormat.JsonSchemaSchema,
1114
+ ResponseFormat.GrammarSchema,
1115
+ ResponseFormat.PythonSchema,
1011
1116
  ])
1012
- .describe("Specifies tool call behavior for the assistant.");
1117
+ .describe("The desired format of the model's response.")
1118
+ .meta({ title: "ResponseFormat" });
1013
1119
  let ToolChoice;
1014
1120
  (function (ToolChoice) {
1015
- ToolChoice.FunctionSchema = z
1016
- .object({
1017
- type: z.literal("function"),
1018
- function: Function.FunctionSchema,
1019
- })
1020
- .describe("Specify a function for the assistant to call.");
1021
1121
  let Function;
1022
1122
  (function (Function) {
1023
- Function.FunctionSchema = z.object({
1123
+ Function.FunctionSchema = z
1124
+ .object({
1024
1125
  name: z
1025
1126
  .string()
1026
1127
  .describe("The name of the function the assistant will call."),
1027
- });
1128
+ })
1129
+ .meta({ title: "ToolChoiceFunctionFunction" });
1028
1130
  })(Function = ToolChoice.Function || (ToolChoice.Function = {}));
1131
+ ToolChoice.FunctionSchema = z
1132
+ .object({
1133
+ type: z.literal("function"),
1134
+ function: Function.FunctionSchema,
1135
+ })
1136
+ .describe("Specify a function for the assistant to call.")
1137
+ .meta({ title: "ToolChoiceFunction" });
1029
1138
  })(ToolChoice = Request.ToolChoice || (Request.ToolChoice = {}));
1030
- Request.PredictionSchema = z
1031
- .object({
1032
- type: z.literal("content"),
1033
- content: Prediction.ContentSchema,
1034
- })
1035
- .describe("Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time. This is most common when you are regenerating a file with only minor changes to most of the content.");
1139
+ Request.ToolChoiceSchema = z
1140
+ .union([
1141
+ z.literal("none"),
1142
+ z.literal("auto"),
1143
+ z.literal("required"),
1144
+ ToolChoice.FunctionSchema,
1145
+ ])
1146
+ .describe("Specifies tool call behavior for the assistant.")
1147
+ .meta({ title: "ToolChoice" });
1036
1148
  let Prediction;
1037
1149
  (function (Prediction) {
1038
- Prediction.ContentSchema = z.union([
1039
- z.string(),
1040
- z.array(Content.PartSchema),
1041
- ]);
1042
1150
  let Content;
1043
1151
  (function (Content) {
1044
1152
  Content.PartSchema = z
@@ -1046,9 +1154,20 @@ export var Chat;
1046
1154
  type: z.literal("text"),
1047
1155
  text: z.string(),
1048
1156
  })
1049
- .describe("A part of the predicted content.");
1157
+ .describe("A part of the predicted content.")
1158
+ .meta({ title: "PredictionContentPart" });
1050
1159
  })(Content = Prediction.Content || (Prediction.Content = {}));
1160
+ Prediction.ContentSchema = z.union([
1161
+ z.string().meta({ title: "PredictionContentText" }),
1162
+ z.array(Content.PartSchema).meta({ title: "PredictionContentParts" }),
1163
+ ]);
1051
1164
  })(Prediction = Request.Prediction || (Request.Prediction = {}));
1165
+ Request.PredictionSchema = z
1166
+ .object({
1167
+ type: z.literal("content"),
1168
+ content: Prediction.ContentSchema,
1169
+ })
1170
+ .describe("Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time. This is most common when you are regenerating a file with only minor changes to most of the content.");
1052
1171
  Request.SeedSchema = z
1053
1172
  .bigint()
1054
1173
  .describe("If specified, upstream systems will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.");
@@ -1098,53 +1217,30 @@ export var Chat;
1098
1217
  .describe("Whether to stream the response as a series of chunks.");
1099
1218
  Request.ChatCompletionCreateParamsStreamingSchema = Request.ChatCompletionCreateParamsBaseSchema.extend({
1100
1219
  stream: Request.StreamTrueSchema,
1101
- }).describe("Parameters for creating a streaming chat completion.");
1220
+ })
1221
+ .describe("Parameters for creating a streaming chat completion.")
1222
+ .meta({ title: "ChatCompletionCreateParamsStreaming" });
1102
1223
  Request.StreamFalseSchema = z
1103
1224
  .literal(false)
1104
1225
  .describe("Whether to stream the response as a series of chunks.");
1105
1226
  Request.ChatCompletionCreateParamsNonStreamingSchema = Request.ChatCompletionCreateParamsBaseSchema.extend({
1106
1227
  stream: Request.StreamFalseSchema.optional().nullable(),
1107
- }).describe("Parameters for creating a unary chat completion.");
1228
+ })
1229
+ .describe("Parameters for creating a unary chat completion.")
1230
+ .meta({ title: "ChatCompletionCreateParamsNonStreaming" });
1108
1231
  Request.ChatCompletionCreateParamsSchema = z
1109
1232
  .union([
1110
1233
  Request.ChatCompletionCreateParamsStreamingSchema,
1111
1234
  Request.ChatCompletionCreateParamsNonStreamingSchema,
1112
1235
  ])
1113
- .describe("Parameters for creating a chat completion.");
1236
+ .describe("Parameters for creating a chat completion.")
1237
+ .meta({ title: "ChatCompletionCreateParams" });
1114
1238
  })(Request = Completions.Request || (Completions.Request = {}));
1115
1239
  let Response;
1116
1240
  (function (Response) {
1117
1241
  Response.FinishReasonSchema = z
1118
1242
  .enum(["stop", "length", "tool_calls", "content_filter", "error"])
1119
1243
  .describe("The reason why the assistant ceased to generate further tokens.");
1120
- Response.UsageSchema = z
1121
- .object({
1122
- completion_tokens: z
1123
- .uint32()
1124
- .describe("The number of tokens generated in the completion."),
1125
- prompt_tokens: z
1126
- .uint32()
1127
- .describe("The number of tokens in the prompt."),
1128
- total_tokens: z
1129
- .uint32()
1130
- .describe("The total number of tokens used in the prompt or generated in the completion."),
1131
- completion_tokens_details: Usage.CompletionTokensDetailsSchema.optional(),
1132
- prompt_tokens_details: Usage.PromptTokensDetailsSchema.optional(),
1133
- cost: z
1134
- .number()
1135
- .describe("The cost in credits incurred for this completion."),
1136
- cost_details: Usage.CostDetailsSchema.optional(),
1137
- total_cost: z
1138
- .number()
1139
- .describe("The total cost in credits incurred including upstream costs."),
1140
- cost_multiplier: z
1141
- .number()
1142
- .describe("The cost multiplier applied to upstream costs for computing ObjectiveAI costs."),
1143
- is_byok: z
1144
- .boolean()
1145
- .describe("Whether the completion used a BYOK (Bring Your Own Key) API Key."),
1146
- })
1147
- .describe("Token and cost usage statistics for the completion.");
1148
1244
  let Usage;
1149
1245
  (function (Usage) {
1150
1246
  Usage.CompletionTokensDetailsSchema = z
@@ -1200,20 +1296,34 @@ export var Chat;
1200
1296
  })
1201
1297
  .describe("Detailed breakdown of upstream costs incurred.");
1202
1298
  })(Usage = Response.Usage || (Response.Usage = {}));
1203
- Response.LogprobsSchema = z
1299
+ Response.UsageSchema = z
1204
1300
  .object({
1205
- content: z
1206
- .array(Logprobs.LogprobSchema)
1207
- .optional()
1208
- .nullable()
1209
- .describe("The log probabilities of the tokens in the content."),
1210
- refusal: z
1211
- .array(Logprobs.LogprobSchema)
1212
- .optional()
1213
- .nullable()
1214
- .describe("The log probabilities of the tokens in the refusal."),
1301
+ completion_tokens: z
1302
+ .uint32()
1303
+ .describe("The number of tokens generated in the completion."),
1304
+ prompt_tokens: z
1305
+ .uint32()
1306
+ .describe("The number of tokens in the prompt."),
1307
+ total_tokens: z
1308
+ .uint32()
1309
+ .describe("The total number of tokens used in the prompt or generated in the completion."),
1310
+ completion_tokens_details: Usage.CompletionTokensDetailsSchema.optional(),
1311
+ prompt_tokens_details: Usage.PromptTokensDetailsSchema.optional(),
1312
+ cost: z
1313
+ .number()
1314
+ .describe("The cost in credits incurred for this completion."),
1315
+ cost_details: Usage.CostDetailsSchema.optional(),
1316
+ total_cost: z
1317
+ .number()
1318
+ .describe("The total cost in credits incurred including upstream costs."),
1319
+ cost_multiplier: z
1320
+ .number()
1321
+ .describe("The cost multiplier applied to upstream costs for computing ObjectiveAI costs."),
1322
+ is_byok: z
1323
+ .boolean()
1324
+ .describe("Whether the completion used a BYOK (Bring Your Own Key) API Key."),
1215
1325
  })
1216
- .describe("The log probabilities of the tokens generated by the model.");
1326
+ .describe("Token and cost usage statistics for the completion.");
1217
1327
  let Logprobs;
1218
1328
  (function (Logprobs) {
1219
1329
  function merged(a, b) {
@@ -1227,24 +1337,6 @@ export var Chat;
1227
1337
  }
1228
1338
  }
1229
1339
  Logprobs.merged = merged;
1230
- Logprobs.LogprobSchema = z
1231
- .object({
1232
- token: z
1233
- .string()
1234
- .describe("The token string which was selected by the sampler."),
1235
- bytes: z
1236
- .array(z.uint32())
1237
- .optional()
1238
- .nullable()
1239
- .describe("The byte representation of the token which was selected by the sampler."),
1240
- logprob: z
1241
- .number()
1242
- .describe("The log probability of the token which was selected by the sampler."),
1243
- top_logprobs: z
1244
- .array(Logprob.TopLogprobSchema)
1245
- .describe("The log probabilities of the top tokens for this position."),
1246
- })
1247
- .describe("The token which was selected by the sampler for this position as well as the logprobabilities of the top options.");
1248
1340
  let Logprob;
1249
1341
  (function (Logprob) {
1250
1342
  function mergedList(a, b) {
@@ -1275,13 +1367,42 @@ export var Chat;
1275
1367
  })
1276
1368
  .describe("The log probability of a token in the list of top tokens.");
1277
1369
  })(Logprob = Logprobs.Logprob || (Logprobs.Logprob = {}));
1370
+ Logprobs.LogprobSchema = z
1371
+ .object({
1372
+ token: z
1373
+ .string()
1374
+ .describe("The token string which was selected by the sampler."),
1375
+ bytes: z
1376
+ .array(z.uint32())
1377
+ .optional()
1378
+ .nullable()
1379
+ .describe("The byte representation of the token which was selected by the sampler."),
1380
+ logprob: z
1381
+ .number()
1382
+ .describe("The log probability of the token which was selected by the sampler."),
1383
+ top_logprobs: z
1384
+ .array(Logprob.TopLogprobSchema)
1385
+ .describe("The log probabilities of the top tokens for this position."),
1386
+ })
1387
+ .describe("The token which was selected by the sampler for this position as well as the logprobabilities of the top options.");
1278
1388
  })(Logprobs = Response.Logprobs || (Response.Logprobs = {}));
1389
+ Response.LogprobsSchema = z
1390
+ .object({
1391
+ content: z
1392
+ .array(Logprobs.LogprobSchema)
1393
+ .optional()
1394
+ .nullable()
1395
+ .describe("The log probabilities of the tokens in the content."),
1396
+ refusal: z
1397
+ .array(Logprobs.LogprobSchema)
1398
+ .optional()
1399
+ .nullable()
1400
+ .describe("The log probabilities of the tokens in the refusal."),
1401
+ })
1402
+ .describe("The log probabilities of the tokens generated by the model.");
1279
1403
  Response.RoleSchema = z
1280
1404
  .enum(["assistant"])
1281
1405
  .describe("The role of the message author.");
1282
- Response.ImageSchema = z
1283
- .union([Image.ImageUrlSchema])
1284
- .describe("An image generated by the model.");
1285
1406
  let Image;
1286
1407
  (function (Image) {
1287
1408
  function mergedList(a, b) {
@@ -1303,11 +1424,11 @@ export var Chat;
1303
1424
  }),
1304
1425
  });
1305
1426
  })(Image = Response.Image || (Response.Image = {}));
1427
+ Response.ImageSchema = z
1428
+ .union([Image.ImageUrlSchema])
1429
+ .describe("An image generated by the model.");
1306
1430
  let Streaming;
1307
1431
  (function (Streaming) {
1308
- Streaming.ToolCallSchema = z
1309
- .union([ToolCall.FunctionSchema])
1310
- .describe("A tool call made by the assistant.");
1311
1432
  let ToolCall;
1312
1433
  (function (ToolCall) {
1313
1434
  function merged(a, b) {
@@ -1339,19 +1460,6 @@ export var Chat;
1339
1460
  return merged ? [merged, true] : [a, false];
1340
1461
  }
1341
1462
  ToolCall.mergedList = mergedList;
1342
- ToolCall.FunctionSchema = z
1343
- .object({
1344
- index: z
1345
- .uint32()
1346
- .describe("The index of the tool call in the sequence of tool calls."),
1347
- type: z.literal("function").optional(),
1348
- id: z
1349
- .string()
1350
- .optional()
1351
- .describe("The unique identifier of the function tool."),
1352
- function: Function.DefinitionSchema.optional(),
1353
- })
1354
- .describe("A function tool call made by the assistant.");
1355
1463
  let Function;
1356
1464
  (function (Function) {
1357
1465
  function merged(a, b) {
@@ -1370,13 +1478,6 @@ export var Chat;
1370
1478
  }
1371
1479
  }
1372
1480
  Function.merged = merged;
1373
- Function.DefinitionSchema = z.object({
1374
- name: z.string().optional().describe("The name of the function."),
1375
- arguments: z
1376
- .string()
1377
- .optional()
1378
- .describe("The arguments passed to the function."),
1379
- });
1380
1481
  let Definition;
1381
1482
  (function (Definition) {
1382
1483
  function merged(a, b) {
@@ -1396,8 +1497,31 @@ export var Chat;
1396
1497
  }
1397
1498
  Definition.merged = merged;
1398
1499
  })(Definition = Function.Definition || (Function.Definition = {}));
1500
+ Function.DefinitionSchema = z.object({
1501
+ name: z.string().optional().describe("The name of the function."),
1502
+ arguments: z
1503
+ .string()
1504
+ .optional()
1505
+ .describe("The arguments passed to the function."),
1506
+ });
1399
1507
  })(Function = ToolCall.Function || (ToolCall.Function = {}));
1508
+ ToolCall.FunctionSchema = z
1509
+ .object({
1510
+ index: z
1511
+ .uint32()
1512
+ .describe("The index of the tool call in the sequence of tool calls."),
1513
+ type: z.literal("function").optional(),
1514
+ id: z
1515
+ .string()
1516
+ .optional()
1517
+ .describe("The unique identifier of the function tool."),
1518
+ function: Function.DefinitionSchema.optional(),
1519
+ })
1520
+ .describe("A function tool call made by the assistant.");
1400
1521
  })(ToolCall = Streaming.ToolCall || (Streaming.ToolCall = {}));
1522
+ Streaming.ToolCallSchema = z
1523
+ .union([ToolCall.FunctionSchema])
1524
+ .describe("A tool call made by the assistant.");
1401
1525
  Streaming.DeltaSchema = z
1402
1526
  .object({
1403
1527
  content: z
@@ -1576,20 +1700,8 @@ export var Chat;
1576
1700
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
1577
1701
  let Unary;
1578
1702
  (function (Unary) {
1579
- Unary.ToolCallSchema = z
1580
- .union([ToolCall.FunctionSchema])
1581
- .describe(Streaming.ToolCallSchema.description);
1582
1703
  let ToolCall;
1583
1704
  (function (ToolCall) {
1584
- ToolCall.FunctionSchema = z
1585
- .object({
1586
- type: z.literal("function"),
1587
- id: z
1588
- .string()
1589
- .describe(Streaming.ToolCall.FunctionSchema.shape.id.description),
1590
- function: Function.DefinitionSchema,
1591
- })
1592
- .describe(Streaming.ToolCall.FunctionSchema.description);
1593
1705
  let Function;
1594
1706
  (function (Function) {
1595
1707
  Function.DefinitionSchema = z.object({
@@ -1603,7 +1715,19 @@ export var Chat;
1603
1715
  .description),
1604
1716
  });
1605
1717
  })(Function = ToolCall.Function || (ToolCall.Function = {}));
1718
+ ToolCall.FunctionSchema = z
1719
+ .object({
1720
+ type: z.literal("function"),
1721
+ id: z
1722
+ .string()
1723
+ .describe(Streaming.ToolCall.FunctionSchema.shape.id.description),
1724
+ function: Function.DefinitionSchema,
1725
+ })
1726
+ .describe(Streaming.ToolCall.FunctionSchema.description);
1606
1727
  })(ToolCall = Unary.ToolCall || (Unary.ToolCall = {}));
1728
+ Unary.ToolCallSchema = z
1729
+ .union([ToolCall.FunctionSchema])
1730
+ .describe(Streaming.ToolCallSchema.description);
1607
1731
  Unary.MessageSchema = z
1608
1732
  .object({
1609
1733
  content: z
@@ -1715,19 +1839,43 @@ export var Vector;
1715
1839
  .describe("Base parameters for creating a vector completion.");
1716
1840
  Request.VectorCompletionCreateParamsStreamingSchema = Request.VectorCompletionCreateParamsBaseSchema.extend({
1717
1841
  stream: Chat.Completions.Request.StreamTrueSchema,
1718
- }).describe("Parameters for creating a streaming vector completion.");
1842
+ })
1843
+ .describe("Parameters for creating a streaming vector completion.")
1844
+ .meta({ title: "VectorCompletionCreateParamsStreaming" });
1719
1845
  Request.VectorCompletionCreateParamsNonStreamingSchema = Request.VectorCompletionCreateParamsBaseSchema.extend({
1720
1846
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
1721
- }).describe("Parameters for creating a unary vector completion.");
1847
+ })
1848
+ .describe("Parameters for creating a unary vector completion.")
1849
+ .meta({ title: "VectorCompletionCreateParamsNonStreaming" });
1722
1850
  Request.VectorCompletionCreateParamsSchema = z
1723
1851
  .union([
1724
1852
  Request.VectorCompletionCreateParamsStreamingSchema,
1725
1853
  Request.VectorCompletionCreateParamsNonStreamingSchema,
1726
1854
  ])
1727
- .describe("Parameters for creating a vector completion.");
1855
+ .describe("Parameters for creating a vector completion.")
1856
+ .meta({ title: "VectorCompletionCreateParams" });
1728
1857
  })(Request = Completions.Request || (Completions.Request = {}));
1729
1858
  let Response;
1730
1859
  (function (Response) {
1860
+ let Vote;
1861
+ (function (Vote) {
1862
+ function mergedList(a, b) {
1863
+ let merged = undefined;
1864
+ for (const vote of b) {
1865
+ const existingIndex = a.findIndex(({ flat_ensemble_index }) => flat_ensemble_index === vote.flat_ensemble_index);
1866
+ if (existingIndex === -1) {
1867
+ if (merged === undefined) {
1868
+ merged = [...a, vote];
1869
+ }
1870
+ else {
1871
+ merged.push(vote);
1872
+ }
1873
+ }
1874
+ }
1875
+ return merged ? [merged, true] : [a, false];
1876
+ }
1877
+ Vote.mergedList = mergedList;
1878
+ })(Vote = Response.Vote || (Response.Vote = {}));
1731
1879
  Response.VoteSchema = z
1732
1880
  .object({
1733
1881
  model: z
@@ -1749,25 +1897,42 @@ export var Vector;
1749
1897
  .describe("Whether this vote came from a previous Vector Completion which was retried."),
1750
1898
  })
1751
1899
  .describe("A vote from an Ensemble LLM within a Vector Completion.");
1752
- let Vote;
1753
- (function (Vote) {
1754
- function mergedList(a, b) {
1755
- let merged = undefined;
1756
- for (const vote of b) {
1757
- const existingIndex = a.findIndex(({ flat_ensemble_index }) => flat_ensemble_index === vote.flat_ensemble_index);
1758
- if (existingIndex === -1) {
1759
- if (merged === undefined) {
1760
- merged = [...a, vote];
1761
- }
1762
- else {
1763
- merged.push(vote);
1900
+ Response.VotesSchema = z
1901
+ .array(Response.VoteSchema)
1902
+ .describe("The list of votes for responses in the request from the Ensemble LLMs within the provided Ensemble.");
1903
+ let Scores;
1904
+ (function (Scores) {
1905
+ function merged(a, b) {
1906
+ if (a.length === b.length) {
1907
+ for (let i = 0; i < a.length; i++) {
1908
+ if (a[i] !== b[i]) {
1909
+ return [b, true];
1764
1910
  }
1765
1911
  }
1912
+ return [a, false];
1913
+ }
1914
+ else {
1915
+ return [b, true];
1766
1916
  }
1767
- return merged ? [merged, true] : [a, false];
1768
1917
  }
1769
- Vote.mergedList = mergedList;
1770
- })(Vote = Response.Vote || (Response.Vote = {}));
1918
+ Scores.merged = merged;
1919
+ })(Scores = Response.Scores || (Response.Scores = {}));
1920
+ Response.ScoresSchema = z
1921
+ .array(z.number())
1922
+ .describe("The scores for each response in the request, aggregated from the votes of the Ensemble LLMs.");
1923
+ let Weights;
1924
+ (function (Weights) {
1925
+ function merged(a, b) {
1926
+ return Scores.merged(a, b);
1927
+ }
1928
+ Weights.merged = merged;
1929
+ })(Weights = Response.Weights || (Response.Weights = {}));
1930
+ Response.WeightsSchema = z
1931
+ .array(z.number())
1932
+ .describe("The weights assigned to each response in the request, aggregated from the votes of the Ensemble LLMs.");
1933
+ Response.EnsembleSchema = z
1934
+ .string()
1935
+ .describe("The unique identifier of the Ensemble used for this vector completion.");
1771
1936
  Response.UsageSchema = z
1772
1937
  .object({
1773
1938
  completion_tokens: z
@@ -1790,26 +1955,8 @@ export var Vector;
1790
1955
  .describe("The total cost in credits incurred including upstream costs."),
1791
1956
  })
1792
1957
  .describe("Token and cost usage statistics for the completion.");
1793
- Response.VotesSchema = z
1794
- .array(Response.VoteSchema)
1795
- .describe("The list of votes for responses in the request from the Ensemble LLMs within the provided Ensemble.");
1796
- Response.ScoresSchema = z
1797
- .array(z.number())
1798
- .describe("The scores for each response in the request, aggregated from the votes of the Ensemble LLMs.");
1799
- Response.WeightsSchema = z
1800
- .array(z.number())
1801
- .describe("The weights assigned to each response in the request, aggregated from the votes of the Ensemble LLMs.");
1802
- Response.EnsembleSchema = z
1803
- .string()
1804
- .describe("The unique identifier of the Ensemble used for this vector completion.");
1805
1958
  let Streaming;
1806
1959
  (function (Streaming) {
1807
- Streaming.ChatCompletionChunkSchema = Chat.Completions.Response.Streaming.ChatCompletionChunkSchema.extend({
1808
- index: z
1809
- .uint32()
1810
- .describe("The index of the completion amongst all chat completions."),
1811
- error: ObjectiveAIErrorSchema.optional().describe("An error encountered during the generation of this chat completion."),
1812
- }).describe("A chat completion chunk generated in the pursuit of a vector completion.");
1813
1960
  let ChatCompletionChunk;
1814
1961
  (function (ChatCompletionChunk) {
1815
1962
  function merged(a, b) {
@@ -1853,25 +2000,12 @@ export var Vector;
1853
2000
  }
1854
2001
  ChatCompletionChunk.mergedList = mergedList;
1855
2002
  })(ChatCompletionChunk = Streaming.ChatCompletionChunk || (Streaming.ChatCompletionChunk = {}));
1856
- Streaming.VectorCompletionChunkSchema = z
1857
- .object({
1858
- id: z
1859
- .string()
1860
- .describe("The unique identifier of the vector completion."),
1861
- completions: z
1862
- .array(Streaming.ChatCompletionChunkSchema)
1863
- .describe("The list of chat completion chunks created for this vector completion."),
1864
- votes: Response.VotesSchema,
1865
- scores: Response.ScoresSchema,
1866
- weights: Response.WeightsSchema,
1867
- created: z
2003
+ Streaming.ChatCompletionChunkSchema = Chat.Completions.Response.Streaming.ChatCompletionChunkSchema.extend({
2004
+ index: z
1868
2005
  .uint32()
1869
- .describe("The Unix timestamp (in seconds) when the vector completion was created."),
1870
- ensemble: Response.EnsembleSchema,
1871
- object: z.literal("vector.completion.chunk"),
1872
- usage: Response.UsageSchema.optional(),
1873
- })
1874
- .describe("A chunk in a streaming vector completion response.");
2006
+ .describe("The index of the completion amongst all chat completions."),
2007
+ error: ObjectiveAIErrorSchema.optional().describe("An error encountered during the generation of this chat completion."),
2008
+ }).describe("A chat completion chunk generated in the pursuit of a vector completion.");
1875
2009
  let VectorCompletionChunk;
1876
2010
  (function (VectorCompletionChunk) {
1877
2011
  function merged(a, b) {
@@ -1907,30 +2041,25 @@ export var Vector;
1907
2041
  }
1908
2042
  VectorCompletionChunk.merged = merged;
1909
2043
  })(VectorCompletionChunk = Streaming.VectorCompletionChunk || (Streaming.VectorCompletionChunk = {}));
1910
- let Scores;
1911
- (function (Scores) {
1912
- function merged(a, b) {
1913
- if (a.length === b.length) {
1914
- for (let i = 0; i < a.length; i++) {
1915
- if (a[i] !== b[i]) {
1916
- return [b, true];
1917
- }
1918
- }
1919
- return [a, false];
1920
- }
1921
- else {
1922
- return [b, true];
1923
- }
1924
- }
1925
- Scores.merged = merged;
1926
- })(Scores = Streaming.Scores || (Streaming.Scores = {}));
1927
- let Weights;
1928
- (function (Weights) {
1929
- function merged(a, b) {
1930
- return Scores.merged(a, b);
1931
- }
1932
- Weights.merged = merged;
1933
- })(Weights = Streaming.Weights || (Streaming.Weights = {}));
2044
+ Streaming.VectorCompletionChunkSchema = z
2045
+ .object({
2046
+ id: z
2047
+ .string()
2048
+ .describe("The unique identifier of the vector completion."),
2049
+ completions: z
2050
+ .array(Streaming.ChatCompletionChunkSchema)
2051
+ .describe("The list of chat completion chunks created for this vector completion."),
2052
+ votes: Response.VotesSchema,
2053
+ scores: Response.ScoresSchema,
2054
+ weights: Response.WeightsSchema,
2055
+ created: z
2056
+ .uint32()
2057
+ .describe("The Unix timestamp (in seconds) when the vector completion was created."),
2058
+ ensemble: Response.EnsembleSchema,
2059
+ object: z.literal("vector.completion.chunk"),
2060
+ usage: Response.UsageSchema.optional(),
2061
+ })
2062
+ .describe("A chunk in a streaming vector completion response.");
1934
2063
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
1935
2064
  let Unary;
1936
2065
  (function (Unary) {
@@ -1969,10 +2098,7 @@ export var Vector;
1969
2098
  Completions.create = create;
1970
2099
  })(Completions = Vector.Completions || (Vector.Completions = {}));
1971
2100
  })(Vector || (Vector = {}));
1972
- // Function
1973
- export const FunctionSchema = z
1974
- .discriminatedUnion("type", [Function.ScalarSchema, Function.VectorSchema])
1975
- .describe("A function.");
2101
+ // Function
1976
2102
  export var Function;
1977
2103
  (function (Function_1) {
1978
2104
  Function_1.VectorCompletionProfileSchema = z
@@ -1994,7 +2120,10 @@ export var Function;
1994
2120
  id: z.string().describe("The unique identifier of the profile."),
1995
2121
  version: z.uint32().describe("The version of the profile."),
1996
2122
  }),
1997
- z.lazy(() => z.array(Function_1.ProfileVersionRequiredSchema)),
2123
+ z.lazy(() => z.array(Function_1.ProfileVersionRequiredSchema).meta({
2124
+ title: "ProfileVersionRequiredArray",
2125
+ recursive: true,
2126
+ })),
1998
2127
  ])
1999
2128
  .describe("A function profile where remote profiles must specify a version.");
2000
2129
  Function_1.FunctionProfileVersionOptionalSchema = z
@@ -2014,7 +2143,12 @@ export var Function;
2014
2143
  .nullable()
2015
2144
  .describe("The version of the profile."),
2016
2145
  }),
2017
- z.lazy(() => z.array(Function_1.ProfileVersionOptionalSchema)),
2146
+ z
2147
+ .lazy(() => z.array(Function_1.ProfileVersionOptionalSchema))
2148
+ .meta({
2149
+ title: "ProfileVersionOptionalArray",
2150
+ recursive: true,
2151
+ }),
2018
2152
  ])
2019
2153
  .describe("A function profile where remote profiles may omit a version.");
2020
2154
  Function_1.ProfileVersionRequiredSchema = z
@@ -2054,7 +2188,10 @@ export var Function;
2054
2188
  .nullable()
2055
2189
  .describe("The description of the object input."),
2056
2190
  properties: z
2057
- .record(z.string(), Function_1.InputSchemaSchema)
2191
+ .record(z.string(), Function_1.InputSchemaSchema.meta({
2192
+ title: "InputSchema",
2193
+ recursive: true,
2194
+ }))
2058
2195
  .describe("The properties of the object input."),
2059
2196
  required: z
2060
2197
  .array(z.string())
@@ -2081,7 +2218,10 @@ export var Function;
2081
2218
  .optional()
2082
2219
  .nullable()
2083
2220
  .describe("The maximum number of items in the array input."),
2084
- items: Function_1.InputSchemaSchema.describe("The schema of the items in the array input."),
2221
+ items: Function_1.InputSchemaSchema.describe("The schema of the items in the array input.").meta({
2222
+ title: "InputSchema",
2223
+ recursive: true,
2224
+ }),
2085
2225
  })
2086
2226
  .describe("An array input schema.");
2087
2227
  InputSchema.StringSchema = z
@@ -2193,8 +2333,14 @@ export var Function;
2193
2333
  Function_1.InputSchema_ = z
2194
2334
  .lazy(() => z.union([
2195
2335
  Message.RichContent.PartSchema,
2196
- z.record(z.string(), Function_1.InputSchema_),
2197
- z.array(Function_1.InputSchema_),
2336
+ z.record(z.string(), Function_1.InputSchema_.meta({
2337
+ title: "Input",
2338
+ recursive: true,
2339
+ })),
2340
+ z.array(Function_1.InputSchema_.meta({
2341
+ title: "Input",
2342
+ recursive: true,
2343
+ })),
2198
2344
  z.string(),
2199
2345
  z.number(),
2200
2346
  z.boolean(),
@@ -2203,8 +2349,14 @@ export var Function;
2203
2349
  Function_1.InputExpressionSchema = z.lazy(() => z
2204
2350
  .union([
2205
2351
  Message.RichContent.PartSchema,
2206
- z.record(z.string(), Function_1.InputExpressionSchema),
2207
- z.array(Function_1.InputExpressionSchema),
2352
+ z.record(z.string(), Function_1.InputExpressionSchema.meta({
2353
+ title: "InputExpression",
2354
+ recursive: true,
2355
+ })),
2356
+ z.array(Function_1.InputExpressionSchema.meta({
2357
+ title: "InputExpression",
2358
+ recursive: true,
2359
+ })),
2208
2360
  z.string(),
2209
2361
  z.number(),
2210
2362
  z.boolean(),
@@ -2219,13 +2371,6 @@ export var Function;
2219
2371
  .describe("A list of expressions which each evaluate to a 1D array of Inputs."),
2220
2372
  ])
2221
2373
  .describe("An expression or list of expressions which evaluate to a 2D array of Inputs. Each sub-array will be fed into Tasks which specify an index of this input map.");
2222
- Function_1.TaskExpressionSchema = z
2223
- .discriminatedUnion("type", [
2224
- TaskExpression.ScalarFunctionSchema,
2225
- TaskExpression.VectorFunctionSchema,
2226
- TaskExpression.VectorCompletionSchema,
2227
- ])
2228
- .describe("A task to be executed as part of the function. Will first be compiled using the parent function's input. May be skipped or mapped.");
2229
2374
  let TaskExpression;
2230
2375
  (function (TaskExpression) {
2231
2376
  TaskExpression.SkipSchema = ExpressionSchema.describe("An expression which evaluates to a boolean indicating whether to skip this task.");
@@ -2279,6 +2424,13 @@ export var Function;
2279
2424
  })
2280
2425
  .describe("A vector completion task.");
2281
2426
  })(TaskExpression = Function_1.TaskExpression || (Function_1.TaskExpression = {}));
2427
+ Function_1.TaskExpressionSchema = z
2428
+ .discriminatedUnion("type", [
2429
+ TaskExpression.ScalarFunctionSchema,
2430
+ TaskExpression.VectorFunctionSchema,
2431
+ TaskExpression.VectorCompletionSchema,
2432
+ ])
2433
+ .describe("A task to be executed as part of the function. Will first be compiled using the parent function's input. May be skipped or mapped.");
2282
2434
  Function_1.TaskExpressionsSchema = z
2283
2435
  .array(Function_1.TaskExpressionSchema)
2284
2436
  .describe("The list of tasks to be executed as part of the function.");
@@ -2301,7 +2453,8 @@ export var Function;
2301
2453
  tasks: Function_1.TaskExpressionsSchema,
2302
2454
  output: ExpressionSchema.describe("An expression which evaluates to a single number. This is the output of the scalar function. Will be provided with the outputs of all tasks."),
2303
2455
  })
2304
- .describe("A scalar function.");
2456
+ .describe("A scalar function.")
2457
+ .meta({ title: "ScalarFunction" });
2305
2458
  Function_1.VectorSchema = z
2306
2459
  .object({
2307
2460
  type: z.literal("vector.function"),
@@ -2327,7 +2480,8 @@ export var Function;
2327
2480
  ])
2328
2481
  .describe("The length of the output vector."),
2329
2482
  })
2330
- .describe("A vector function.");
2483
+ .describe("A vector function.")
2484
+ .meta({ title: "VectorFunction" });
2331
2485
  let Executions;
2332
2486
  (function (Executions) {
2333
2487
  let Request;
@@ -2349,37 +2503,47 @@ export var Function;
2349
2503
  .describe("Base parameters for executing a function.");
2350
2504
  // Execute Inline Function
2351
2505
  Request.FunctionExecutionParamsExecuteInlineBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2352
- function: FunctionSchema,
2506
+ function: z.lazy(() => FunctionSchema),
2353
2507
  profile: Function_1.FunctionProfileVersionOptionalSchema,
2354
2508
  }).describe("Base parameters for executing an inline function.");
2355
2509
  Request.FunctionExecutionParamsExecuteInlineStreamingSchema = Request.FunctionExecutionParamsExecuteInlineBaseSchema.extend({
2356
2510
  stream: Chat.Completions.Request.StreamTrueSchema,
2357
- }).describe("Parameters for executing an inline function and streaming the response.");
2511
+ })
2512
+ .describe("Parameters for executing an inline function and streaming the response.")
2513
+ .meta({ title: "FunctionExecutionParamsExecuteInlineStreaming" });
2358
2514
  Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema = Request.FunctionExecutionParamsExecuteInlineBaseSchema.extend({
2359
2515
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2360
- }).describe("Parameters for executing an inline function with a unary response.");
2516
+ })
2517
+ .describe("Parameters for executing an inline function with a unary response.")
2518
+ .meta({ title: "FunctionExecutionParamsExecuteInlineNonStreaming" });
2361
2519
  Request.FunctionExecutionParamsExecuteInlineSchema = z
2362
2520
  .union([
2363
2521
  Request.FunctionExecutionParamsExecuteInlineStreamingSchema,
2364
2522
  Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema,
2365
2523
  ])
2366
- .describe("Parameters for executing an inline function.");
2524
+ .describe("Parameters for executing an inline function.")
2525
+ .meta({ title: "FunctionExecutionParamsExecuteInline" });
2367
2526
  // Execute Published Function
2368
2527
  Request.FunctionExecutionParamsExecuteBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2369
2528
  profile: Function_1.FunctionProfileVersionOptionalSchema.optional().nullable(),
2370
2529
  }).describe("Base parameters for executing a remote published function.");
2371
2530
  Request.FunctionExecutionParamsExecuteStreamingSchema = Request.FunctionExecutionParamsExecuteBaseSchema.extend({
2372
2531
  stream: Chat.Completions.Request.StreamTrueSchema,
2373
- }).describe("Parameters for executing a remote published function and streaming the response.");
2532
+ })
2533
+ .describe("Parameters for executing a remote published function and streaming the response.")
2534
+ .meta({ title: "FunctionExecutionParamsExecuteStreaming" });
2374
2535
  Request.FunctionExecutionParamsExecuteNonStreamingSchema = Request.FunctionExecutionParamsExecuteBaseSchema.extend({
2375
2536
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2376
- }).describe("Parameters for executing a remote published function with a unary response.");
2537
+ })
2538
+ .describe("Parameters for executing a remote published function with a unary response.")
2539
+ .meta({ title: "FunctionExecutionParamsExecuteNonStreaming" });
2377
2540
  Request.FunctionExecutionParamsExecuteSchema = z
2378
2541
  .union([
2379
2542
  Request.FunctionExecutionParamsExecuteStreamingSchema,
2380
2543
  Request.FunctionExecutionParamsExecuteNonStreamingSchema,
2381
2544
  ])
2382
- .describe("Parameters for executing a remote published function.");
2545
+ .describe("Parameters for executing a remote published function.")
2546
+ .meta({ title: "FunctionExecutionParamsExecute" });
2383
2547
  // Publish Scalar Function
2384
2548
  Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2385
2549
  function: Function_1.ScalarSchema,
@@ -2418,16 +2582,25 @@ export var Function;
2418
2582
  }).describe("Base parameters for executing and publishing an inline scalar function.");
2419
2583
  Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema = Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema.extend({
2420
2584
  stream: Chat.Completions.Request.StreamTrueSchema,
2421
- }).describe("Parameters for executing and publishing an inline scalar function and streaming the response.");
2585
+ })
2586
+ .describe("Parameters for executing and publishing an inline scalar function and streaming the response.")
2587
+ .meta({
2588
+ title: "FunctionExecutionParamsPublishScalarFunctionStreaming",
2589
+ });
2422
2590
  Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema.extend({
2423
2591
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2424
- }).describe("Parameters for executing and publishing an inline scalar function with a unary response.");
2592
+ })
2593
+ .describe("Parameters for executing and publishing an inline scalar function with a unary response.")
2594
+ .meta({
2595
+ title: "FunctionExecutionParamsPublishScalarFunctionNonStreaming",
2596
+ });
2425
2597
  Request.FunctionExecutionParamsPublishScalarFunctionSchema = z
2426
2598
  .union([
2427
2599
  Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2428
2600
  Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema,
2429
2601
  ])
2430
- .describe("Parameters for executing and publishing an inline scalar function.");
2602
+ .describe("Parameters for executing and publishing an inline scalar function.")
2603
+ .meta({ title: "FunctionExecutionParamsPublishScalarFunction" });
2431
2604
  // Publish Vector Function
2432
2605
  Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2433
2606
  function: Function_1.VectorSchema,
@@ -2472,35 +2645,47 @@ export var Function;
2472
2645
  }).describe("Base parameters for executing and publishing an inline vector function.");
2473
2646
  Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema = Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema.extend({
2474
2647
  stream: Chat.Completions.Request.StreamTrueSchema,
2475
- }).describe("Parameters for executing and publishing an inline vector function and streaming the response.");
2648
+ })
2649
+ .describe("Parameters for executing and publishing an inline vector function and streaming the response.")
2650
+ .meta({
2651
+ title: "FunctionExecutionParamsPublishVectorFunctionStreaming",
2652
+ });
2476
2653
  Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema.extend({
2477
2654
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2478
- }).describe("Parameters for executing and publishing an inline vector function with a unary response.");
2655
+ })
2656
+ .describe("Parameters for executing and publishing an inline vector function with a unary response.")
2657
+ .meta({
2658
+ title: "FunctionExecutionParamsPublishVectorFunctionNonStreaming",
2659
+ });
2479
2660
  Request.FunctionExecutionParamsPublishVectorFunctionSchema = z
2480
2661
  .union([
2481
2662
  Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema,
2482
2663
  Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema,
2483
2664
  ])
2484
- .describe("Parameters for executing and publishing an inline vector function.");
2665
+ .describe("Parameters for executing and publishing an inline vector function.")
2666
+ .meta({ title: "FunctionExecutionParamsPublishVectorFunction" });
2485
2667
  // Publish Function
2486
2668
  Request.FunctionExecutionParamsPublishFunctionStreamingSchema = z
2487
2669
  .union([
2488
2670
  Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2489
2671
  Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema,
2490
2672
  ])
2491
- .describe("Parameters for executing and publishing an inline function and streaming the response.");
2673
+ .describe("Parameters for executing and publishing an inline function and streaming the response.")
2674
+ .meta({ title: "FunctionExecutionParamsPublishFunctionStreaming" });
2492
2675
  Request.FunctionExecutionParamsPublishFunctionNonStreamingSchema = z
2493
2676
  .union([
2494
2677
  Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema,
2495
2678
  Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema,
2496
2679
  ])
2497
- .describe("Parameters for executing and publishing an inline function with a unary response.");
2680
+ .describe("Parameters for executing and publishing an inline function with a unary response.")
2681
+ .meta({ title: "FunctionExecutionParamsPublishFunctionNonStreaming" });
2498
2682
  Request.FunctionExecutionParamsPublishFunctionSchema = z
2499
2683
  .union([
2500
2684
  Request.FunctionExecutionParamsPublishScalarFunctionSchema,
2501
2685
  Request.FunctionExecutionParamsPublishVectorFunctionSchema,
2502
2686
  ])
2503
- .describe("Parameters for executing and publishing an inline function.");
2687
+ .describe("Parameters for executing and publishing an inline function.")
2688
+ .meta({ title: "FunctionExecutionParamsPublishFunction" });
2504
2689
  // Publish Profile
2505
2690
  Request.FunctionExecutionParamsPublishProfileBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2506
2691
  profile: z
@@ -2527,16 +2712,21 @@ export var Function;
2527
2712
  }).describe("Base parameters for executing a remote published function and publishing a profile.");
2528
2713
  Request.FunctionExecutionParamsPublishProfileStreamingSchema = Request.FunctionExecutionParamsPublishProfileBaseSchema.extend({
2529
2714
  stream: Chat.Completions.Request.StreamTrueSchema,
2530
- }).describe("Parameters for executing a remote published function, publishing a profile, and streaming the response.");
2715
+ })
2716
+ .describe("Parameters for executing a remote published function, publishing a profile, and streaming the response.")
2717
+ .meta({ title: "FunctionExecutionParamsPublishProfileStreaming" });
2531
2718
  Request.FunctionExecutionParamsPublishProfileNonStreamingSchema = Request.FunctionExecutionParamsPublishProfileBaseSchema.extend({
2532
2719
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2533
- }).describe("Parameters for executing a remote published function and publishing a profile with a unary response.");
2720
+ })
2721
+ .describe("Parameters for executing a remote published function and publishing a profile with a unary response.")
2722
+ .meta({ title: "FunctionExecutionParamsPublishProfileNonStreaming" });
2534
2723
  Request.FunctionExecutionParamsPublishProfileSchema = z
2535
2724
  .union([
2536
2725
  Request.FunctionExecutionParamsPublishProfileStreamingSchema,
2537
2726
  Request.FunctionExecutionParamsPublishProfileNonStreamingSchema,
2538
2727
  ])
2539
- .describe("Parameters for executing a remote published function and publishing a profile.");
2728
+ .describe("Parameters for executing a remote published function and publishing a profile.")
2729
+ .meta({ title: "FunctionExecutionParamsPublishProfile" });
2540
2730
  })(Request = Executions.Request || (Executions.Request = {}));
2541
2731
  let Response;
2542
2732
  (function (Response) {
@@ -2554,9 +2744,6 @@ export var Function;
2554
2744
  })(Task = Response.Task || (Response.Task = {}));
2555
2745
  let Streaming;
2556
2746
  (function (Streaming) {
2557
- Streaming.TaskChunkSchema = z
2558
- .union([TaskChunk.FunctionSchema, TaskChunk.VectorCompletionSchema])
2559
- .describe("A chunk of a task execution.");
2560
2747
  let TaskChunk;
2561
2748
  (function (TaskChunk) {
2562
2749
  function merged(a, b) {
@@ -2593,13 +2780,6 @@ export var Function;
2593
2780
  return merged ? [merged, true] : [a, false];
2594
2781
  }
2595
2782
  TaskChunk.mergedList = mergedList;
2596
- TaskChunk.FunctionSchema = z
2597
- .lazy(() => Streaming.FunctionExecutionChunkSchema.extend({
2598
- index: Task.IndexSchema,
2599
- task_index: Task.TaskIndexSchema,
2600
- task_path: Task.TaskPathSchema,
2601
- }))
2602
- .describe("A chunk of a function execution task.");
2603
2783
  let Function;
2604
2784
  (function (Function) {
2605
2785
  function merged(a, b) {
@@ -2621,12 +2801,20 @@ export var Function;
2621
2801
  }
2622
2802
  Function.merged = merged;
2623
2803
  })(Function = TaskChunk.Function || (TaskChunk.Function = {}));
2624
- TaskChunk.VectorCompletionSchema = Vector.Completions.Response.Streaming.VectorCompletionChunkSchema.extend({
2804
+ TaskChunk.FunctionSchema = z
2805
+ .lazy(() => Streaming.FunctionExecutionChunkSchema.extend({
2625
2806
  index: Task.IndexSchema,
2626
2807
  task_index: Task.TaskIndexSchema,
2627
2808
  task_path: Task.TaskPathSchema,
2628
- error: ObjectiveAIErrorSchema.optional().describe("When present, indicates that an error occurred during the vector completion task."),
2629
- }).describe("A chunk of a vector completion task.");
2809
+ tasks: z
2810
+ .array(Streaming.TaskChunkSchema)
2811
+ .meta({
2812
+ title: "TaskChunkArray",
2813
+ recursive: true,
2814
+ })
2815
+ .describe("The tasks executed as part of the function execution."),
2816
+ }))
2817
+ .describe("A chunk of a function execution task.");
2630
2818
  let VectorCompletion;
2631
2819
  (function (VectorCompletion) {
2632
2820
  function merged(a, b) {
@@ -2649,7 +2837,57 @@ export var Function;
2649
2837
  }
2650
2838
  VectorCompletion.merged = merged;
2651
2839
  })(VectorCompletion = TaskChunk.VectorCompletion || (TaskChunk.VectorCompletion = {}));
2840
+ TaskChunk.VectorCompletionSchema = Vector.Completions.Response.Streaming.VectorCompletionChunkSchema.extend({
2841
+ index: Task.IndexSchema,
2842
+ task_index: Task.TaskIndexSchema,
2843
+ task_path: Task.TaskPathSchema,
2844
+ error: ObjectiveAIErrorSchema.optional().describe("When present, indicates that an error occurred during the vector completion task."),
2845
+ }).describe("A chunk of a vector completion task.");
2652
2846
  })(TaskChunk = Streaming.TaskChunk || (Streaming.TaskChunk = {}));
2847
+ Streaming.TaskChunkSchema = z
2848
+ .union([TaskChunk.FunctionSchema, TaskChunk.VectorCompletionSchema])
2849
+ .describe("A chunk of a task execution.");
2850
+ let FunctionExecutionChunk;
2851
+ (function (FunctionExecutionChunk) {
2852
+ function merged(a, b) {
2853
+ const id = a.id;
2854
+ const [tasks, tasksChanged] = TaskChunk.mergedList(a.tasks, b.tasks);
2855
+ const [tasks_errors, tasks_errorsChanged] = merge(a.tasks_errors, b.tasks_errors);
2856
+ const [output, outputChanged] = merge(a.output, b.output);
2857
+ const [error, errorChanged] = merge(a.error, b.error);
2858
+ const [retry_token, retry_tokenChanged] = merge(a.retry_token, b.retry_token);
2859
+ const [function_published, function_publishedChanged] = merge(a.function_published, b.function_published);
2860
+ const [profile_published, profile_publishedChanged] = merge(a.profile_published, b.profile_published);
2861
+ const created = a.created;
2862
+ const function_ = a.function;
2863
+ const profile = a.profile;
2864
+ const object = a.object;
2865
+ const [usage, usageChanged] = merge(a.usage, b.usage);
2866
+ if (tasksChanged ||
2867
+ tasks_errorsChanged ||
2868
+ outputChanged ||
2869
+ errorChanged ||
2870
+ retry_tokenChanged ||
2871
+ function_publishedChanged ||
2872
+ profile_publishedChanged ||
2873
+ usageChanged) {
2874
+ return [
2875
+ Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
2876
+ tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), (function_published !== undefined
2877
+ ? { function_published }
2878
+ : {})), (profile_published !== undefined
2879
+ ? { profile_published }
2880
+ : {})), { created, function: function_, profile,
2881
+ object }), (usage !== undefined ? { usage } : {})),
2882
+ true,
2883
+ ];
2884
+ }
2885
+ else {
2886
+ return [a, false];
2887
+ }
2888
+ }
2889
+ FunctionExecutionChunk.merged = merged;
2890
+ })(FunctionExecutionChunk = Streaming.FunctionExecutionChunk || (Streaming.FunctionExecutionChunk = {}));
2653
2891
  Streaming.FunctionExecutionChunkSchema = z
2654
2892
  .object({
2655
2893
  id: z
@@ -2707,53 +2945,9 @@ export var Function;
2707
2945
  usage: Vector.Completions.Response.UsageSchema.optional(),
2708
2946
  })
2709
2947
  .describe("A chunk of a function execution.");
2710
- let FunctionExecutionChunk;
2711
- (function (FunctionExecutionChunk) {
2712
- function merged(a, b) {
2713
- const id = a.id;
2714
- const [tasks, tasksChanged] = TaskChunk.mergedList(a.tasks, b.tasks);
2715
- const [tasks_errors, tasks_errorsChanged] = merge(a.tasks_errors, b.tasks_errors);
2716
- const [output, outputChanged] = merge(a.output, b.output);
2717
- const [error, errorChanged] = merge(a.error, b.error);
2718
- const [retry_token, retry_tokenChanged] = merge(a.retry_token, b.retry_token);
2719
- const [function_published, function_publishedChanged] = merge(a.function_published, b.function_published);
2720
- const [profile_published, profile_publishedChanged] = merge(a.profile_published, b.profile_published);
2721
- const created = a.created;
2722
- const function_ = a.function;
2723
- const profile = a.profile;
2724
- const object = a.object;
2725
- const [usage, usageChanged] = merge(a.usage, b.usage);
2726
- if (tasksChanged ||
2727
- tasks_errorsChanged ||
2728
- outputChanged ||
2729
- errorChanged ||
2730
- retry_tokenChanged ||
2731
- function_publishedChanged ||
2732
- profile_publishedChanged ||
2733
- usageChanged) {
2734
- return [
2735
- Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
2736
- tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), (function_published !== undefined
2737
- ? { function_published }
2738
- : {})), (profile_published !== undefined
2739
- ? { profile_published }
2740
- : {})), { created, function: function_, profile,
2741
- object }), (usage !== undefined ? { usage } : {})),
2742
- true,
2743
- ];
2744
- }
2745
- else {
2746
- return [a, false];
2747
- }
2748
- }
2749
- FunctionExecutionChunk.merged = merged;
2750
- })(FunctionExecutionChunk = Streaming.FunctionExecutionChunk || (Streaming.FunctionExecutionChunk = {}));
2751
2948
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
2752
2949
  let Unary;
2753
2950
  (function (Unary) {
2754
- Unary.TaskSchema = z
2755
- .union([Task.FunctionSchema, Task.VectorCompletionSchema])
2756
- .describe("A task execution.");
2757
2951
  let Task;
2758
2952
  (function (Task) {
2759
2953
  Task.FunctionSchema = z
@@ -2761,8 +2955,15 @@ export var Function;
2761
2955
  index: Response.Task.IndexSchema,
2762
2956
  task_index: Response.Task.TaskIndexSchema,
2763
2957
  task_path: Response.Task.TaskPathSchema,
2958
+ tasks: z
2959
+ .array(Unary.TaskSchema)
2960
+ .meta({
2961
+ title: "TaskArray",
2962
+ recursive: true,
2963
+ })
2964
+ .describe("The tasks executed as part of the function execution."),
2764
2965
  }))
2765
- .describe("A chunk of a function execution task.");
2966
+ .describe("A function execution task.");
2766
2967
  Task.VectorCompletionSchema = Vector.Completions.Response.Unary.VectorCompletionSchema.extend({
2767
2968
  index: Response.Task.IndexSchema,
2768
2969
  task_index: Response.Task.TaskIndexSchema,
@@ -2770,6 +2971,9 @@ export var Function;
2770
2971
  error: ObjectiveAIErrorSchema.nullable().describe("When non-null, indicates that an error occurred during the vector completion task."),
2771
2972
  }).describe("A vector completion task.");
2772
2973
  })(Task = Unary.Task || (Unary.Task = {}));
2974
+ Unary.TaskSchema = z
2975
+ .union([Task.FunctionSchema, Task.VectorCompletionSchema])
2976
+ .describe("A task execution.");
2773
2977
  Unary.FunctionExecutionSchema = z
2774
2978
  .object({
2775
2979
  id: z
@@ -2829,21 +3033,8 @@ export var Function;
2829
3033
  (function (ComputeProfile) {
2830
3034
  let Request;
2831
3035
  (function (Request) {
2832
- Request.DatasetItemSchema = z
2833
- .object({
2834
- input: Function_1.InputSchema_,
2835
- target: DatasetItem.TargetSchema,
2836
- })
2837
- .describe("A Function input and its corresponding target output.");
2838
3036
  let DatasetItem;
2839
3037
  (function (DatasetItem) {
2840
- DatasetItem.TargetSchema = z
2841
- .union([
2842
- Target.ScalarSchema,
2843
- Target.VectorSchema,
2844
- Target.VectorWinnerSchema,
2845
- ])
2846
- .describe("The target output for a given function input.");
2847
3038
  let Target;
2848
3039
  (function (Target) {
2849
3040
  Target.ScalarSchema = z
@@ -2865,7 +3056,20 @@ export var Function;
2865
3056
  })
2866
3057
  .describe("A vector winner target output. The desired output is a vector where the highest value is at the specified index.");
2867
3058
  })(Target = DatasetItem.Target || (DatasetItem.Target = {}));
3059
+ DatasetItem.TargetSchema = z
3060
+ .discriminatedUnion("type", [
3061
+ Target.ScalarSchema,
3062
+ Target.VectorSchema,
3063
+ Target.VectorWinnerSchema,
3064
+ ])
3065
+ .describe("The target output for a given function input.");
2868
3066
  })(DatasetItem = Request.DatasetItem || (Request.DatasetItem = {}));
3067
+ Request.DatasetItemSchema = z
3068
+ .object({
3069
+ input: Function_1.InputSchema_,
3070
+ target: DatasetItem.TargetSchema,
3071
+ })
3072
+ .describe("A Function input and its corresponding target output.");
2869
3073
  Request.FunctionComputeProfileParamsBaseSchema = z
2870
3074
  .object({
2871
3075
  retry_token: z
@@ -2894,16 +3098,21 @@ export var Function;
2894
3098
  .describe("Base parameters for computing a function profile.");
2895
3099
  Request.FunctionComputeProfileParamsStreamingSchema = Request.FunctionComputeProfileParamsBaseSchema.extend({
2896
3100
  stream: Chat.Completions.Request.StreamTrueSchema,
2897
- }).describe("Parameters for computing a function profile and streaming the response.");
3101
+ })
3102
+ .describe("Parameters for computing a function profile and streaming the response.")
3103
+ .meta({ title: "FunctionComputeProfileParamsStreaming" });
2898
3104
  Request.FunctionComputeProfileParamsNonStreamingSchema = Request.FunctionComputeProfileParamsBaseSchema.extend({
2899
3105
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2900
- }).describe("Parameters for computing a function profile with a unary response.");
3106
+ })
3107
+ .describe("Parameters for computing a function profile with a unary response.")
3108
+ .meta({ title: "FunctionComputeProfileParamsNonStreaming" });
2901
3109
  Request.FunctionComputeProfileParamsSchema = z
2902
3110
  .union([
2903
3111
  Request.FunctionComputeProfileParamsStreamingSchema,
2904
3112
  Request.FunctionComputeProfileParamsNonStreamingSchema,
2905
3113
  ])
2906
- .describe("Parameters for computing a function profile.");
3114
+ .describe("Parameters for computing a function profile.")
3115
+ .meta({ title: "FunctionComputeProfileParams" });
2907
3116
  })(Request = ComputeProfile.Request || (ComputeProfile.Request = {}));
2908
3117
  let Response;
2909
3118
  (function (Response) {
@@ -2928,20 +3137,6 @@ export var Function;
2928
3137
  .describe("Statistics about the fitting process used to compute the weights for the profile.");
2929
3138
  let Streaming;
2930
3139
  (function (Streaming) {
2931
- Streaming.FunctionExecutionChunkSchema = Executions.Response.Streaming.FunctionExecutionChunkSchema.extend({
2932
- index: z
2933
- .uint32()
2934
- .describe("The index of the function execution chunk in the list of executions."),
2935
- dataset: z
2936
- .uint32()
2937
- .describe("The index of the dataset item this function execution chunk corresponds to."),
2938
- n: z
2939
- .uint32()
2940
- .describe("The N index for this function execution chunk. There will be N function executions, and N comes from the request parameters."),
2941
- retry: z
2942
- .uint32()
2943
- .describe("The retry index for this function execution chunk. There may be multiple retries for a given dataset item and N index."),
2944
- }).describe("A chunk of a function execution ran during profile computation.");
2945
3140
  let FunctionExecutionChunk;
2946
3141
  (function (FunctionExecutionChunk) {
2947
3142
  function merged(a, b) {
@@ -2990,33 +3185,20 @@ export var Function;
2990
3185
  }
2991
3186
  FunctionExecutionChunk.mergedList = mergedList;
2992
3187
  })(FunctionExecutionChunk = Streaming.FunctionExecutionChunk || (Streaming.FunctionExecutionChunk = {}));
2993
- Streaming.FunctionComputeProfileChunkSchema = z
2994
- .object({
2995
- id: z
2996
- .string()
2997
- .describe("The unique identifier of the function profile computation chunk."),
2998
- executions: z
2999
- .array(Streaming.FunctionExecutionChunkSchema)
3000
- .describe("The function executions performed as part of computing the profile."),
3001
- executions_errors: z
3002
- .boolean()
3003
- .optional()
3004
- .describe("When true, indicates that one or more function executions encountered errors during profile computation."),
3005
- profile: z
3006
- .array(Function_1.ProfileVersionRequiredSchema)
3007
- .optional()
3008
- .describe("The computed function profile."),
3009
- fitting_stats: Response.FittingStatsSchema.optional(),
3010
- created: z
3188
+ Streaming.FunctionExecutionChunkSchema = Executions.Response.Streaming.FunctionExecutionChunkSchema.extend({
3189
+ index: z
3011
3190
  .uint32()
3012
- .describe("The UNIX timestamp (in seconds) when the function profile computation was created."),
3013
- function: z
3014
- .string()
3015
- .describe("The unique identifier of the function for which the profile is being computed."),
3016
- object: z.literal("function.compute.profile.chunk"),
3017
- usage: Vector.Completions.Response.UsageSchema.optional(),
3018
- })
3019
- .describe("A chunk of a function profile computation.");
3191
+ .describe("The index of the function execution chunk in the list of executions."),
3192
+ dataset: z
3193
+ .uint32()
3194
+ .describe("The index of the dataset item this function execution chunk corresponds to."),
3195
+ n: z
3196
+ .uint32()
3197
+ .describe("The N index for this function execution chunk. There will be N function executions, and N comes from the request parameters."),
3198
+ retry: z
3199
+ .uint32()
3200
+ .describe("The retry index for this function execution chunk. There may be multiple retries for a given dataset item and N index."),
3201
+ }).describe("A chunk of a function execution ran during profile computation.");
3020
3202
  let FunctionComputeProfileChunk;
3021
3203
  (function (FunctionComputeProfileChunk) {
3022
3204
  function merged(a, b) {
@@ -3048,6 +3230,33 @@ export var Function;
3048
3230
  }
3049
3231
  FunctionComputeProfileChunk.merged = merged;
3050
3232
  })(FunctionComputeProfileChunk = Streaming.FunctionComputeProfileChunk || (Streaming.FunctionComputeProfileChunk = {}));
3233
+ Streaming.FunctionComputeProfileChunkSchema = z
3234
+ .object({
3235
+ id: z
3236
+ .string()
3237
+ .describe("The unique identifier of the function profile computation chunk."),
3238
+ executions: z
3239
+ .array(Streaming.FunctionExecutionChunkSchema)
3240
+ .describe("The function executions performed as part of computing the profile."),
3241
+ executions_errors: z
3242
+ .boolean()
3243
+ .optional()
3244
+ .describe("When true, indicates that one or more function executions encountered errors during profile computation."),
3245
+ profile: z
3246
+ .array(Function_1.ProfileVersionRequiredSchema)
3247
+ .optional()
3248
+ .describe("The computed function profile."),
3249
+ fitting_stats: Response.FittingStatsSchema.optional(),
3250
+ created: z
3251
+ .uint32()
3252
+ .describe("The UNIX timestamp (in seconds) when the function profile computation was created."),
3253
+ function: z
3254
+ .string()
3255
+ .describe("The unique identifier of the function for which the profile is being computed."),
3256
+ object: z.literal("function.compute.profile.chunk"),
3257
+ usage: Vector.Completions.Response.UsageSchema.optional(),
3258
+ })
3259
+ .describe("A chunk of a function profile computation.");
3051
3260
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
3052
3261
  let Unary;
3053
3262
  (function (Unary) {
@@ -3211,7 +3420,9 @@ export var Function;
3211
3420
  shape: z
3212
3421
  .string()
3213
3422
  .describe("The shape of the function. Unless Task Skip expressions work out favorably, functions only work with profiles that have the same shape."),
3214
- });
3423
+ })
3424
+ .describe("A retrieved scalar function.")
3425
+ .meta({ title: "RetrievedScalarFunction" });
3215
3426
  Function_1.VectorRetrieveItemSchema = Function_1.VectorSchema.extend({
3216
3427
  created: z
3217
3428
  .uint32()
@@ -3219,7 +3430,9 @@ export var Function;
3219
3430
  shape: z
3220
3431
  .string()
3221
3432
  .describe("The shape of the function. Unless Task Skip expressions work out favorably, functions only work with profiles that have the same shape."),
3222
- });
3433
+ })
3434
+ .describe("A retrieved vector function.")
3435
+ .meta({ title: "RetrievedVectorFunction" });
3223
3436
  Function_1.RetrieveItemSchema = z.discriminatedUnion("type", [
3224
3437
  Function_1.ScalarRetrieveItemSchema,
3225
3438
  Function_1.VectorRetrieveItemSchema,
@@ -3253,6 +3466,9 @@ export var Function;
3253
3466
  }
3254
3467
  Function_1.retrieveUsage = retrieveUsage;
3255
3468
  })(Function || (Function = {}));
3469
+ export const FunctionSchema = z
3470
+ .discriminatedUnion("type", [Function.ScalarSchema, Function.VectorSchema])
3471
+ .describe("A function.");
3256
3472
  export var Auth;
3257
3473
  (function (Auth) {
3258
3474
  Auth.ApiKeySchema = z.object({