objectiveai 1.2.0 → 1.2.2

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 +1132 -1073
  2. package/dist/index.d.ts +7328 -11841
  3. package/dist/index.js +1131 -1072
  4. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -3,152 +3,121 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Auth = exports.Function = exports.FunctionSchema = exports.Vector = exports.Chat = exports.Ensemble = exports.EnsembleSchema = exports.EnsembleBaseSchema = exports.EnsembleLlm = exports.EnsembleLlmWithFallbacksAndCountSchema = exports.EnsembleLlmSchema = exports.EnsembleLlmBaseWithFallbacksAndCountSchema = exports.EnsembleLlmBaseSchema = exports.VectorResponsesExpressionSchema = exports.VectorResponsesSchema = exports.VectorResponseExpressionSchema = exports.VectorResponseSchema = exports.ToolsExpressionSchema = exports.ToolsSchema = exports.Tool = exports.ToolExpressionSchema = exports.ToolSchema = exports.MessagesExpressionSchema = exports.MessagesSchema = exports.Message = exports.MessageExpressionSchema = exports.MessageSchema = exports.ObjectiveAIErrorSchema = exports.JsonValueExpressionSchema = exports.JsonValueSchema = exports.ExpressionSchema = void 0;
6
+ exports.Auth = exports.FunctionSchema = exports.Function = exports.Vector = exports.Chat = exports.Ensemble = exports.EnsembleSchema = exports.EnsembleBaseSchema = exports.EnsembleLlmWithFallbacksAndCountSchema = exports.EnsembleLlmSchema = exports.EnsembleLlmBaseWithFallbacksAndCountSchema = exports.EnsembleLlmBaseSchema = exports.EnsembleLlm = exports.VectorResponsesExpressionSchema = exports.VectorResponsesSchema = exports.VectorResponseExpressionSchema = exports.VectorResponseSchema = exports.ToolsExpressionSchema = exports.ToolsSchema = exports.ToolExpressionSchema = exports.ToolSchema = exports.Tool = exports.MessagesExpressionSchema = exports.MessagesSchema = exports.MessageExpressionSchema = exports.MessageSchema = exports.Message = exports.ObjectiveAIErrorSchema = exports.JsonValueExpressionSchema = exports.JsonValueSchema = exports.ExpressionSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
8
  // Expressions
9
9
  exports.ExpressionSchema = zod_1.default
10
10
  .object({
11
11
  $jmespath: zod_1.default.string().describe("A JMESPath expression."),
12
12
  })
13
- .describe("An expression which evaluates to a value.");
13
+ .describe("An expression which evaluates to a value.")
14
+ .meta({ title: "Expression" });
14
15
  exports.JsonValueSchema = zod_1.default
15
16
  .lazy(() => zod_1.default.union([
16
17
  zod_1.default.null(),
17
18
  zod_1.default.boolean(),
18
19
  zod_1.default.number(),
19
20
  zod_1.default.string(),
20
- zod_1.default.array(exports.JsonValueSchema),
21
- zod_1.default.record(zod_1.default.string(), exports.JsonValueSchema),
21
+ zod_1.default.array(exports.JsonValueSchema.meta({
22
+ title: "JsonValue",
23
+ recursive: true,
24
+ })),
25
+ zod_1.default.record(zod_1.default.string(), exports.JsonValueSchema.meta({
26
+ title: "JsonValue",
27
+ recursive: true,
28
+ })),
22
29
  ]))
23
- .describe("A JSON value.");
30
+ .describe("A JSON value.")
31
+ .meta({ title: "JsonValue" });
24
32
  exports.JsonValueExpressionSchema = zod_1.default
25
33
  .lazy(() => zod_1.default.union([
26
34
  zod_1.default.null(),
27
35
  zod_1.default.boolean(),
28
36
  zod_1.default.number(),
29
37
  zod_1.default.string(),
30
- zod_1.default.array(exports.JsonValueExpressionSchema),
31
- zod_1.default.record(zod_1.default.string(), exports.JsonValueExpressionSchema),
38
+ zod_1.default.array(exports.JsonValueExpressionSchema.meta({
39
+ title: "JsonValueExpression",
40
+ recursive: true,
41
+ })),
42
+ zod_1.default.record(zod_1.default.string(), exports.JsonValueExpressionSchema.meta({
43
+ title: "JsonValueExpression",
44
+ recursive: true,
45
+ })),
32
46
  exports.ExpressionSchema.describe("An expression which evaluates to a JSON value."),
33
47
  ]))
34
- .describe(exports.JsonValueSchema.description);
48
+ .describe(exports.JsonValueSchema.description)
49
+ .meta({ title: "JsonValueExpression" });
35
50
  // Errors
36
51
  exports.ObjectiveAIErrorSchema = zod_1.default
37
52
  .object({
38
53
  code: zod_1.default.uint32().describe("The status code of the error."),
39
54
  message: zod_1.default.any().describe("The message or details of the error."),
40
55
  })
41
- .describe("An error returned by the ObjectiveAI API.");
56
+ .describe("An error returned by the ObjectiveAI API.")
57
+ .meta({ title: "ObjectiveAIError" });
42
58
  // Messages
43
- exports.MessageSchema = zod_1.default
44
- .discriminatedUnion("role", [
45
- Message.DeveloperSchema,
46
- Message.SystemSchema,
47
- Message.UserSchema,
48
- Message.ToolSchema,
49
- Message.AssistantSchema,
50
- ])
51
- .describe("A message exchanged in a chat conversation.");
52
- exports.MessageExpressionSchema = zod_1.default
53
- .union([
54
- zod_1.default
55
- .discriminatedUnion("role", [
56
- Message.DeveloperExpressionSchema,
57
- Message.SystemExpressionSchema,
58
- Message.UserExpressionSchema,
59
- Message.ToolExpressionSchema,
60
- Message.AssistantExpressionSchema,
61
- ])
62
- .describe(exports.MessageSchema.description),
63
- exports.ExpressionSchema.describe("An expression which evaluates to a message."),
64
- ])
65
- .describe(exports.MessageSchema.description);
66
59
  var Message;
67
60
  (function (Message) {
68
- Message.SimpleContentPartSchema = zod_1.default
69
- .object({
70
- type: zod_1.default.literal("text"),
71
- text: zod_1.default.string().describe("The text content."),
72
- })
73
- .describe("A simple text content part.");
74
- Message.SimpleContentSchema = zod_1.default
75
- .union([SimpleContent.TextSchema, SimpleContent.PartsSchema])
76
- .describe("Simple content.");
77
- Message.SimpleContentExpressionSchema = zod_1.default
78
- .union([
79
- SimpleContent.TextSchema,
80
- SimpleContent.PartsExpressionSchema,
81
- exports.ExpressionSchema.describe("An expression which evaluates to simple content."),
82
- ])
83
- .describe(Message.SimpleContentSchema.description);
84
61
  let SimpleContent;
85
62
  (function (SimpleContent) {
86
- SimpleContent.TextSchema = zod_1.default.string().describe("Plain text content.");
63
+ SimpleContent.TextSchema = zod_1.default
64
+ .string()
65
+ .describe("Plain text content.")
66
+ .meta({ title: "SimpleContentText" });
87
67
  SimpleContent.PartSchema = zod_1.default
88
68
  .object({
89
69
  type: zod_1.default.literal("text"),
90
70
  text: zod_1.default.string().describe("The text content."),
91
71
  })
92
- .describe("A simple content part.");
72
+ .describe("A simple content part.")
73
+ .meta({ title: "SimpleContentPart" });
93
74
  SimpleContent.PartExpressionSchema = zod_1.default
94
75
  .union([
95
76
  SimpleContent.PartSchema,
96
77
  exports.ExpressionSchema.describe("An expression which evaluates to a simple content part."),
97
78
  ])
98
- .describe(SimpleContent.PartSchema.description);
79
+ .describe(SimpleContent.PartSchema.description)
80
+ .meta({ title: "SimpleContentPartExpression" });
99
81
  SimpleContent.PartsSchema = zod_1.default
100
82
  .array(SimpleContent.PartSchema)
101
- .describe("An array of simple content parts.");
83
+ .describe("An array of simple content parts.")
84
+ .meta({ title: "SimpleContentParts" });
102
85
  SimpleContent.PartsExpressionSchema = zod_1.default
103
86
  .array(SimpleContent.PartExpressionSchema)
104
- .describe(SimpleContent.PartsSchema.description);
87
+ .describe(SimpleContent.PartsSchema.description)
88
+ .meta({ title: "SimpleContentPartExpressions" });
105
89
  })(SimpleContent = Message.SimpleContent || (Message.SimpleContent = {}));
106
- Message.RichContentSchema = zod_1.default
107
- .union([RichContent.TextSchema, RichContent.PartsSchema])
108
- .describe("Rich content.");
109
- Message.RichContentExpressionSchema = zod_1.default
90
+ Message.SimpleContentSchema = zod_1.default
91
+ .union([SimpleContent.TextSchema, SimpleContent.PartsSchema])
92
+ .describe("Simple content.")
93
+ .meta({ title: "SimpleContent" });
94
+ Message.SimpleContentExpressionSchema = zod_1.default
110
95
  .union([
111
- RichContent.TextSchema,
112
- RichContent.PartsExpressionSchema,
113
- exports.ExpressionSchema.describe("An expression which evaluates to rich content."),
96
+ SimpleContent.TextSchema,
97
+ SimpleContent.PartsExpressionSchema,
98
+ exports.ExpressionSchema.describe("An expression which evaluates to simple content."),
114
99
  ])
115
- .describe(Message.RichContentSchema.description);
100
+ .describe(Message.SimpleContentSchema.description)
101
+ .meta({ title: "SimpleContentExpression" });
116
102
  let RichContent;
117
103
  (function (RichContent) {
118
- RichContent.TextSchema = zod_1.default.string().describe("Plain text content.");
119
- RichContent.PartSchema = zod_1.default
120
- .discriminatedUnion("type", [
121
- Part.TextSchema,
122
- Part.ImageUrlSchema,
123
- Part.InputAudioSchema,
124
- Part.VideoUrlSchema,
125
- Part.FileSchema,
126
- ])
127
- .describe("A rich content part.");
128
- RichContent.PartExpressionSchema = zod_1.default
129
- .union([
130
- RichContent.PartSchema,
131
- exports.ExpressionSchema.describe("An expression which evaluates to a rich content part."),
132
- ])
133
- .describe(RichContent.PartSchema.description);
104
+ RichContent.TextSchema = zod_1.default
105
+ .string()
106
+ .describe("Plain text content.")
107
+ .meta({ title: "RichContentText" });
134
108
  let Part;
135
109
  (function (Part) {
136
- Part.TextSchema = zod_1.default
137
- .object({
138
- type: zod_1.default.literal("text"),
139
- text: Text.TextSchema,
140
- })
141
- .describe("A text rich content part.");
142
110
  let Text;
143
111
  (function (Text) {
144
112
  Text.TextSchema = zod_1.default.string().describe("The text content.");
145
113
  })(Text = Part.Text || (Part.Text = {}));
146
- Part.ImageUrlSchema = zod_1.default
114
+ Part.TextSchema = zod_1.default
147
115
  .object({
148
- type: zod_1.default.literal("image_url"),
149
- image_url: ImageUrl.DefinitionSchema,
116
+ type: zod_1.default.literal("text"),
117
+ text: Text.TextSchema,
150
118
  })
151
- .describe("An image rich content part.");
119
+ .describe("A text rich content part.")
120
+ .meta({ title: "TextRichContentPart" });
152
121
  let ImageUrl;
153
122
  (function (ImageUrl) {
154
123
  ImageUrl.DetailSchema = zod_1.default
@@ -164,12 +133,13 @@ var Message;
164
133
  })
165
134
  .describe("The URL of the image and its optional detail level.");
166
135
  })(ImageUrl = Part.ImageUrl || (Part.ImageUrl = {}));
167
- Part.InputAudioSchema = zod_1.default
136
+ Part.ImageUrlSchema = zod_1.default
168
137
  .object({
169
- type: zod_1.default.literal("input_audio"),
170
- input_audio: InputAudio.DefinitionSchema,
138
+ type: zod_1.default.literal("image_url"),
139
+ image_url: ImageUrl.DefinitionSchema,
171
140
  })
172
- .describe("An audio rich content part.");
141
+ .describe("An image rich content part.")
142
+ .meta({ title: "ImageRichContentPart" });
173
143
  let InputAudio;
174
144
  (function (InputAudio) {
175
145
  InputAudio.FormatSchema = zod_1.default
@@ -185,12 +155,13 @@ var Message;
185
155
  })
186
156
  .describe("The audio data and its format.");
187
157
  })(InputAudio = Part.InputAudio || (Part.InputAudio = {}));
188
- Part.VideoUrlSchema = zod_1.default
158
+ Part.InputAudioSchema = zod_1.default
189
159
  .object({
190
- type: zod_1.default.enum(["video_url", "input_video"]),
191
- video_url: VideoUrl.DefinitionSchema,
160
+ type: zod_1.default.literal("input_audio"),
161
+ input_audio: InputAudio.DefinitionSchema,
192
162
  })
193
- .describe("A video rich content part.");
163
+ .describe("An audio rich content part.")
164
+ .meta({ title: "AudioRichContentPart" });
194
165
  let VideoUrl;
195
166
  (function (VideoUrl) {
196
167
  VideoUrl.UrlSchema = zod_1.default.string().describe("URL of the video.");
@@ -198,12 +169,13 @@ var Message;
198
169
  url: VideoUrl.UrlSchema,
199
170
  });
200
171
  })(VideoUrl = Part.VideoUrl || (Part.VideoUrl = {}));
201
- Part.FileSchema = zod_1.default
172
+ Part.VideoUrlSchema = zod_1.default
202
173
  .object({
203
- type: zod_1.default.literal("file"),
204
- file: File.DefinitionSchema,
174
+ type: zod_1.default.enum(["video_url", "input_video"]),
175
+ video_url: VideoUrl.DefinitionSchema,
205
176
  })
206
- .describe("A file rich content part.");
177
+ .describe("A video rich content part.")
178
+ .meta({ title: "VideoRichContentPart" });
207
179
  let File;
208
180
  (function (File) {
209
181
  File.FileDataSchema = zod_1.default
@@ -227,202 +199,253 @@ var Message;
227
199
  })
228
200
  .describe("The file to be used as input, either as base64 data, an uploaded file ID, or a URL.");
229
201
  })(File = Part.File || (Part.File = {}));
202
+ Part.FileSchema = zod_1.default
203
+ .object({
204
+ type: zod_1.default.literal("file"),
205
+ file: File.DefinitionSchema,
206
+ })
207
+ .describe("A file rich content part.")
208
+ .meta({ title: "FileRichContentPart" });
230
209
  })(Part = RichContent.Part || (RichContent.Part = {}));
210
+ RichContent.PartSchema = zod_1.default
211
+ .discriminatedUnion("type", [
212
+ Part.TextSchema,
213
+ Part.ImageUrlSchema,
214
+ Part.InputAudioSchema,
215
+ Part.VideoUrlSchema,
216
+ Part.FileSchema,
217
+ ])
218
+ .describe("A rich content part.")
219
+ .meta({ title: "RichContentPart" });
220
+ RichContent.PartExpressionSchema = zod_1.default
221
+ .union([
222
+ RichContent.PartSchema,
223
+ exports.ExpressionSchema.describe("An expression which evaluates to a rich content part."),
224
+ ])
225
+ .describe(RichContent.PartSchema.description)
226
+ .meta({ title: "RichContentPartExpression" });
231
227
  RichContent.PartsSchema = zod_1.default
232
228
  .array(RichContent.PartSchema)
233
- .describe("An array of rich content parts.");
229
+ .describe("An array of rich content parts.")
230
+ .meta({ title: "RichContentParts" });
234
231
  RichContent.PartsExpressionSchema = zod_1.default
235
232
  .array(RichContent.PartExpressionSchema)
236
- .describe(RichContent.PartsSchema.description);
233
+ .describe(RichContent.PartsSchema.description)
234
+ .meta({ title: "RichContentPartExpressions" });
237
235
  })(RichContent = Message.RichContent || (Message.RichContent = {}));
236
+ Message.RichContentSchema = zod_1.default
237
+ .union([RichContent.TextSchema, RichContent.PartsSchema])
238
+ .describe("Rich content.")
239
+ .meta({ title: "RichContent" });
240
+ Message.RichContentExpressionSchema = zod_1.default
241
+ .union([
242
+ RichContent.TextSchema,
243
+ RichContent.PartsExpressionSchema,
244
+ exports.ExpressionSchema.describe("An expression which evaluates to rich content."),
245
+ ])
246
+ .describe(Message.RichContentSchema.description)
247
+ .meta({ title: "RichContentExpression" });
238
248
  Message.NameSchema = zod_1.default
239
249
  .string()
240
- .describe("An optional name for the participant. Provides the model information to differentiate between participants of the same role.");
250
+ .describe("An optional name for the participant. Provides the model information to differentiate between participants of the same role.")
251
+ .meta({ title: "MessageName" });
241
252
  Message.NameExpressionSchema = zod_1.default
242
253
  .union([
243
254
  Message.NameSchema,
244
255
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
245
256
  ])
246
- .describe(Message.NameSchema.description);
257
+ .describe(Message.NameSchema.description)
258
+ .meta({ title: "MessageNameExpression" });
247
259
  Message.DeveloperSchema = zod_1.default
248
260
  .object({
249
261
  role: zod_1.default.literal("developer"),
250
262
  content: Message.SimpleContentSchema,
251
263
  name: Message.NameSchema.optional().nullable(),
252
264
  })
253
- .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.");
265
+ .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.")
266
+ .meta({ title: "DeveloperMessage" });
254
267
  Message.DeveloperExpressionSchema = zod_1.default
255
268
  .object({
256
269
  role: zod_1.default.literal("developer"),
257
270
  content: Message.SimpleContentExpressionSchema,
258
271
  name: Message.NameExpressionSchema.optional().nullable(),
259
272
  })
260
- .describe(Message.DeveloperSchema.description);
273
+ .describe(Message.DeveloperSchema.description)
274
+ .meta({ title: "DeveloperMessageExpression" });
261
275
  Message.SystemSchema = zod_1.default
262
276
  .object({
263
277
  role: zod_1.default.literal("system"),
264
278
  content: Message.SimpleContentSchema,
265
279
  name: Message.NameSchema.optional().nullable(),
266
280
  })
267
- .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.");
281
+ .describe("Developer-provided instructions that the model should follow, regardless of messages sent by the user.")
282
+ .meta({ title: "SystemMessage" });
268
283
  Message.SystemExpressionSchema = zod_1.default
269
284
  .object({
270
285
  role: zod_1.default.literal("system"),
271
286
  content: Message.SimpleContentExpressionSchema,
272
287
  name: Message.NameExpressionSchema.optional().nullable(),
273
288
  })
274
- .describe(Message.SystemSchema.description);
289
+ .describe(Message.SystemSchema.description)
290
+ .meta({ title: "SystemMessageExpression" });
275
291
  Message.UserSchema = zod_1.default
276
292
  .object({
277
293
  role: zod_1.default.literal("user"),
278
294
  content: Message.RichContentSchema,
279
295
  name: Message.NameSchema.optional().nullable(),
280
296
  })
281
- .describe("Messages sent by an end user, containing prompts or additional context information.");
297
+ .describe("Messages sent by an end user, containing prompts or additional context information.")
298
+ .meta({ title: "UserMessage" });
282
299
  Message.UserExpressionSchema = zod_1.default
283
300
  .object({
284
301
  role: zod_1.default.literal("user"),
285
302
  content: Message.RichContentExpressionSchema,
286
303
  name: Message.NameExpressionSchema.optional().nullable(),
287
304
  })
288
- .describe(Message.UserSchema.description);
289
- Message.ToolSchema = zod_1.default
290
- .object({
291
- role: zod_1.default.literal("tool"),
292
- content: Message.RichContentSchema,
293
- tool_call_id: Tool.ToolCallIdSchema,
294
- })
295
- .describe("Messages sent by tools in response to tool calls made by the assistant.");
296
- Message.ToolExpressionSchema = zod_1.default
297
- .object({
298
- role: zod_1.default.literal("tool"),
299
- content: Message.RichContentExpressionSchema,
300
- tool_call_id: Tool.ToolCallIdExpressionSchema,
301
- })
302
- .describe(Message.ToolSchema.description);
305
+ .describe(Message.UserSchema.description)
306
+ .meta({ title: "UserMessageExpression" });
303
307
  let Tool;
304
308
  (function (Tool) {
305
309
  Tool.ToolCallIdSchema = zod_1.default
306
310
  .string()
307
- .describe("The ID of the tool call that this message is responding to.");
311
+ .describe("The ID of the tool call that this message is responding to.")
312
+ .meta({ title: "ToolMessageToolCallId" });
308
313
  Tool.ToolCallIdExpressionSchema = zod_1.default
309
314
  .union([
310
315
  Tool.ToolCallIdSchema,
311
316
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
312
317
  ])
313
- .describe(Tool.ToolCallIdSchema.description);
318
+ .describe(Tool.ToolCallIdSchema.description)
319
+ .meta({ title: "ToolMessageToolCallIdExpression" });
314
320
  })(Tool = Message.Tool || (Message.Tool = {}));
315
- Message.AssistantSchema = zod_1.default
321
+ Message.ToolSchema = zod_1.default
316
322
  .object({
317
- role: zod_1.default.literal("assistant"),
318
- content: Message.RichContentSchema.optional().nullable(),
319
- name: Message.NameSchema.optional().nullable(),
320
- refusal: Assistant.RefusalSchema.optional().nullable(),
321
- tool_calls: Assistant.ToolCallsSchema.optional().nullable(),
322
- reasoning: Assistant.ReasoningSchema.optional().nullable(),
323
+ role: zod_1.default.literal("tool"),
324
+ content: Message.RichContentSchema,
325
+ tool_call_id: Tool.ToolCallIdSchema,
323
326
  })
324
- .describe("Messages sent by the model in response to user messages.");
325
- Message.AssistantExpressionSchema = zod_1.default
327
+ .describe("Messages sent by tools in response to tool calls made by the assistant.")
328
+ .meta({ title: "ToolMessage" });
329
+ Message.ToolExpressionSchema = zod_1.default
326
330
  .object({
327
- role: zod_1.default.literal("assistant"),
328
- content: Message.RichContentExpressionSchema.optional().nullable(),
329
- name: Message.NameExpressionSchema.optional().nullable(),
330
- refusal: Assistant.RefusalExpressionSchema.optional().nullable(),
331
- tool_calls: Assistant.ToolCallsExpressionSchema.optional().nullable(),
332
- reasoning: Assistant.ReasoningExpressionSchema.optional().nullable(),
331
+ role: zod_1.default.literal("tool"),
332
+ content: Message.RichContentExpressionSchema,
333
+ tool_call_id: Tool.ToolCallIdExpressionSchema,
333
334
  })
334
- .describe(Message.AssistantSchema.description);
335
+ .describe(Message.ToolSchema.description)
336
+ .meta({ title: "ToolMessageExpression" });
335
337
  let Assistant;
336
338
  (function (Assistant) {
337
339
  Assistant.RefusalSchema = zod_1.default
338
340
  .string()
339
- .describe("The refusal message by the assistant.");
341
+ .describe("The refusal message by the assistant.")
342
+ .meta({ title: "AssistantMessageRefusal" });
340
343
  Assistant.RefusalExpressionSchema = zod_1.default
341
344
  .union([
342
345
  Assistant.RefusalSchema,
343
346
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
344
347
  ])
345
- .describe(Assistant.RefusalSchema.description);
348
+ .describe(Assistant.RefusalSchema.description)
349
+ .meta({ title: "AssistantMessageRefusalExpression" });
346
350
  Assistant.ReasoningSchema = zod_1.default
347
351
  .string()
348
- .describe("The reasoning provided by the assistant.");
352
+ .describe("The reasoning provided by the assistant.")
353
+ .meta({ title: "AssistantMessageReasoning" });
349
354
  Assistant.ReasoningExpressionSchema = zod_1.default
350
355
  .union([
351
356
  Assistant.ReasoningSchema,
352
357
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
353
358
  ])
354
- .describe(Assistant.ReasoningSchema.description);
355
- Assistant.ToolCallSchema = zod_1.default
356
- .union([ToolCall.FunctionSchema])
357
- .describe("A tool call made by the assistant.");
358
- Assistant.ToolCallExpressionSchema = zod_1.default
359
- .union([
360
- ToolCall.FunctionExpressionSchema,
361
- exports.ExpressionSchema.describe("An expression which evaluates to a tool call."),
362
- ])
363
- .describe(Assistant.ToolCallSchema.description);
359
+ .describe(Assistant.ReasoningSchema.description)
360
+ .meta({ title: "AssistantMessageReasoningExpression" });
364
361
  let ToolCall;
365
362
  (function (ToolCall) {
366
363
  ToolCall.IdSchema = zod_1.default
367
364
  .string()
368
- .describe("The unique identifier for the tool call.");
365
+ .describe("The unique identifier for the tool call.")
366
+ .meta({ title: "AssistantMessageToolCallId" });
369
367
  ToolCall.IdExpressionSchema = zod_1.default
370
368
  .union([
371
369
  ToolCall.IdSchema,
372
370
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
373
371
  ])
374
- .describe(ToolCall.IdSchema.description);
375
- ToolCall.FunctionSchema = zod_1.default
376
- .object({
377
- type: zod_1.default.literal("function"),
378
- id: ToolCall.IdSchema,
379
- function: Function.DefinitionSchema,
380
- })
381
- .describe("A function tool call made by the assistant.");
382
- ToolCall.FunctionExpressionSchema = zod_1.default
383
- .object({
384
- type: zod_1.default.literal("function"),
385
- id: ToolCall.IdExpressionSchema,
386
- function: Function.DefinitionExpressionSchema,
387
- })
388
- .describe(ToolCall.FunctionSchema.description);
372
+ .describe(ToolCall.IdSchema.description)
373
+ .meta({ title: "AssistantMessageToolCallIdExpression" });
389
374
  let Function;
390
375
  (function (Function) {
391
376
  Function.NameSchema = zod_1.default
392
377
  .string()
393
- .describe("The name of the function called.");
378
+ .describe("The name of the function called.")
379
+ .meta({ title: "AssistantMessageToolCallFunctionName" });
394
380
  Function.NameExpressionSchema = zod_1.default
395
381
  .union([
396
382
  Function.NameSchema,
397
383
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
398
384
  ])
399
- .describe(Function.NameSchema.description);
385
+ .describe(Function.NameSchema.description)
386
+ .meta({ title: "AssistantMessageToolCallFunctionNameExpression" });
400
387
  Function.ArgumentsSchema = zod_1.default
401
388
  .string()
402
- .describe("The arguments passed to the function.");
389
+ .describe("The arguments passed to the function.")
390
+ .meta({ title: "AssistantMessageToolCallFunctionArguments" });
403
391
  Function.ArgumentsExpressionSchema = zod_1.default
404
392
  .union([
405
393
  Function.ArgumentsSchema,
406
394
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
407
395
  ])
408
- .describe(Function.ArgumentsSchema.description);
396
+ .describe(Function.ArgumentsSchema.description)
397
+ .meta({
398
+ title: "AssistantMessageToolCallFunctionArgumentsExpression",
399
+ });
409
400
  Function.DefinitionSchema = zod_1.default
410
401
  .object({
411
402
  name: Function.NameSchema,
412
403
  arguments: Function.ArgumentsSchema,
413
404
  })
414
- .describe("The name and arguments of the function called.");
405
+ .describe("The name and arguments of the function called.")
406
+ .meta({ title: "AssistantMessageToolCallFunctionDefinition" });
415
407
  Function.DefinitionExpressionSchema = zod_1.default
416
408
  .object({
417
409
  name: Function.NameExpressionSchema,
418
410
  arguments: Function.ArgumentsExpressionSchema,
419
411
  })
420
- .describe(Function.DefinitionSchema.description);
412
+ .describe(Function.DefinitionSchema.description)
413
+ .meta({
414
+ title: "AssistantMessageToolCallFunctionDefinitionExpression",
415
+ });
421
416
  })(Function = ToolCall.Function || (ToolCall.Function = {}));
417
+ ToolCall.FunctionSchema = zod_1.default
418
+ .object({
419
+ type: zod_1.default.literal("function"),
420
+ id: ToolCall.IdSchema,
421
+ function: Function.DefinitionSchema,
422
+ })
423
+ .describe("A function tool call made by the assistant.")
424
+ .meta({ title: "AssistantMessageToolCallFunction" });
425
+ ToolCall.FunctionExpressionSchema = zod_1.default
426
+ .object({
427
+ type: zod_1.default.literal("function"),
428
+ id: ToolCall.IdExpressionSchema,
429
+ function: Function.DefinitionExpressionSchema,
430
+ })
431
+ .describe(ToolCall.FunctionSchema.description)
432
+ .meta({ title: "AssistantMessageToolCallFunctionExpression" });
422
433
  })(ToolCall = Assistant.ToolCall || (Assistant.ToolCall = {}));
434
+ Assistant.ToolCallSchema = zod_1.default
435
+ .union([ToolCall.FunctionSchema])
436
+ .describe("A tool call made by the assistant.")
437
+ .meta({ title: "AssistantMessageToolCall" });
438
+ Assistant.ToolCallExpressionSchema = zod_1.default
439
+ .union([
440
+ ToolCall.FunctionExpressionSchema,
441
+ exports.ExpressionSchema.describe("An expression which evaluates to a tool call."),
442
+ ])
443
+ .describe(Assistant.ToolCallSchema.description)
444
+ .meta({ title: "AssistantMessageToolCallExpression" });
423
445
  Assistant.ToolCallsSchema = zod_1.default
424
446
  .array(Assistant.ToolCallSchema)
425
- .describe("Tool calls made by the assistant.");
447
+ .describe("Tool calls made by the assistant.")
448
+ .meta({ title: "AssistantMessageToolCalls" });
426
449
  Assistant.ToolCallsExpressionSchema = zod_1.default
427
450
  .union([
428
451
  zod_1.default
@@ -430,78 +453,120 @@ var Message;
430
453
  .describe(Assistant.ToolCallsSchema.description),
431
454
  exports.ExpressionSchema.describe("An expression which evaluates to an array of tool calls."),
432
455
  ])
433
- .describe(Assistant.ToolCallsSchema.description);
456
+ .describe(Assistant.ToolCallsSchema.description)
457
+ .meta({ title: "AssistantMessageToolCallsExpression" });
434
458
  })(Assistant = Message.Assistant || (Message.Assistant = {}));
459
+ Message.AssistantSchema = zod_1.default
460
+ .object({
461
+ role: zod_1.default.literal("assistant"),
462
+ content: Message.RichContentSchema.optional().nullable(),
463
+ name: Message.NameSchema.optional().nullable(),
464
+ refusal: Assistant.RefusalSchema.optional().nullable(),
465
+ tool_calls: Assistant.ToolCallsSchema.optional().nullable(),
466
+ reasoning: Assistant.ReasoningSchema.optional().nullable(),
467
+ })
468
+ .describe("Messages sent by the model in response to user messages.")
469
+ .meta({ title: "AssistantMessage" });
470
+ Message.AssistantExpressionSchema = zod_1.default
471
+ .object({
472
+ role: zod_1.default.literal("assistant"),
473
+ content: Message.RichContentExpressionSchema.optional().nullable(),
474
+ name: Message.NameExpressionSchema.optional().nullable(),
475
+ refusal: Assistant.RefusalExpressionSchema.optional().nullable(),
476
+ tool_calls: Assistant.ToolCallsExpressionSchema.optional().nullable(),
477
+ reasoning: Assistant.ReasoningExpressionSchema.optional().nullable(),
478
+ })
479
+ .describe(Message.AssistantSchema.description)
480
+ .meta({ title: "AssistantMessageExpression" });
435
481
  })(Message || (exports.Message = Message = {}));
482
+ exports.MessageSchema = zod_1.default
483
+ .discriminatedUnion("role", [
484
+ Message.DeveloperSchema,
485
+ Message.SystemSchema,
486
+ Message.UserSchema,
487
+ Message.ToolSchema,
488
+ Message.AssistantSchema,
489
+ ])
490
+ .describe("A message exchanged in a chat conversation.")
491
+ .meta({ title: "Message" });
492
+ exports.MessageExpressionSchema = zod_1.default
493
+ .union([
494
+ zod_1.default
495
+ .discriminatedUnion("role", [
496
+ Message.DeveloperExpressionSchema,
497
+ Message.SystemExpressionSchema,
498
+ Message.UserExpressionSchema,
499
+ Message.ToolExpressionSchema,
500
+ Message.AssistantExpressionSchema,
501
+ ])
502
+ .describe(exports.MessageSchema.description),
503
+ exports.ExpressionSchema.describe("An expression which evaluates to a message."),
504
+ ])
505
+ .describe(exports.MessageSchema.description)
506
+ .meta({ title: "MessageExpression" });
436
507
  exports.MessagesSchema = zod_1.default
437
508
  .array(exports.MessageSchema)
438
- .describe("A list of messages exchanged in a chat conversation.");
509
+ .describe("A list of messages exchanged in a chat conversation.")
510
+ .meta({ title: "Messages" });
439
511
  exports.MessagesExpressionSchema = zod_1.default
440
512
  .union([
441
- zod_1.default.array(exports.MessageExpressionSchema).describe(exports.MessagesSchema.description),
513
+ zod_1.default
514
+ .array(exports.MessageExpressionSchema)
515
+ .describe(exports.MessagesSchema.description)
516
+ .meta({ title: "MessageExpressions" }),
442
517
  exports.ExpressionSchema.describe("An expression which evaluates to an array of messages."),
443
518
  ])
444
- .describe(exports.MessagesSchema.description);
519
+ .describe(exports.MessagesSchema.description)
520
+ .meta({ title: "MessagesExpression" });
445
521
  // Tools
446
- exports.ToolSchema = zod_1.default
447
- .union([Tool.FunctionSchema])
448
- .describe("A tool that the assistant can call.");
449
- exports.ToolExpressionSchema = zod_1.default
450
- .union([
451
- Tool.FunctionExpressionSchema,
452
- exports.ExpressionSchema.describe("An expression which evaluates to a tool."),
453
- ])
454
- .describe(exports.ToolSchema.description);
455
522
  var Tool;
456
523
  (function (Tool) {
457
- Tool.FunctionSchema = zod_1.default
458
- .object({
459
- type: zod_1.default.literal("function"),
460
- function: Function.DefinitionSchema,
461
- })
462
- .describe("A function tool that the assistant can call.");
463
- Tool.FunctionExpressionSchema = zod_1.default
464
- .object({
465
- type: zod_1.default.literal("function"),
466
- function: Function.DefinitionExpressionSchema,
467
- })
468
- .describe(Tool.FunctionSchema.description);
469
524
  let Function;
470
525
  (function (Function) {
471
- Function.NameSchema = zod_1.default.string().describe("The name of the function.");
526
+ Function.NameSchema = zod_1.default
527
+ .string()
528
+ .describe("The name of the function.")
529
+ .meta({ title: "FunctionToolName" });
472
530
  Function.NameExpressionSchema = zod_1.default
473
531
  .union([
474
532
  Function.NameSchema,
475
533
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
476
534
  ])
477
- .describe(Function.NameSchema.description);
535
+ .describe(Function.NameSchema.description)
536
+ .meta({ title: "FunctionToolNameExpression" });
478
537
  Function.DescriptionSchema = zod_1.default
479
538
  .string()
480
- .describe("The description of the function.");
539
+ .describe("The description of the function.")
540
+ .meta({ title: "FunctionToolDescription" });
481
541
  Function.DescriptionExpressionSchema = zod_1.default
482
542
  .union([
483
543
  Function.DescriptionSchema,
484
544
  exports.ExpressionSchema.describe("An expression which evaluates to a string."),
485
545
  ])
486
- .describe(Function.DescriptionSchema.description);
546
+ .describe(Function.DescriptionSchema.description)
547
+ .meta({ title: "FunctionToolDescriptionExpression" });
487
548
  Function.ParametersSchema = zod_1.default
488
549
  .record(zod_1.default.string(), exports.JsonValueSchema)
489
- .describe("The JSON schema defining the parameters of the function.");
550
+ .describe("The JSON schema defining the parameters of the function.")
551
+ .meta({ title: "FunctionToolParameters" });
490
552
  Function.ParametersExpressionSchema = zod_1.default
491
553
  .union([
492
554
  zod_1.default.record(zod_1.default.string(), exports.JsonValueExpressionSchema),
493
555
  exports.ExpressionSchema.describe("An expression which evaluates to a JSON schema object."),
494
556
  ])
495
- .describe(Function.ParametersSchema.description);
557
+ .describe(Function.ParametersSchema.description)
558
+ .meta({ title: "FunctionToolParametersExpression" });
496
559
  Function.StrictSchema = zod_1.default
497
560
  .boolean()
498
- .describe("Whether to enforce strict adherence to the parameter schema.");
561
+ .describe("Whether to enforce strict adherence to the parameter schema.")
562
+ .meta({ title: "FunctionToolStrict" });
499
563
  Function.StrictExpressionSchema = zod_1.default
500
564
  .union([
501
565
  Function.StrictSchema,
502
566
  exports.ExpressionSchema.describe("An expression which evaluates to a boolean."),
503
567
  ])
504
- .describe(Function.StrictSchema.description);
568
+ .describe(Function.StrictSchema.description)
569
+ .meta({ title: "FunctionToolStrictExpression" });
505
570
  Function.DefinitionSchema = zod_1.default
506
571
  .object({
507
572
  name: Function.NameSchema,
@@ -509,7 +574,8 @@ var Tool;
509
574
  parameters: Function.ParametersSchema.optional().nullable(),
510
575
  strict: Function.StrictSchema.optional().nullable(),
511
576
  })
512
- .describe("The definition of a function tool.");
577
+ .describe("The definition of a function tool.")
578
+ .meta({ title: "FunctionToolDefinition" });
513
579
  Function.DefinitionExpressionSchema = zod_1.default
514
580
  .object({
515
581
  name: Function.NameExpressionSchema,
@@ -517,38 +583,214 @@ var Tool;
517
583
  parameters: Function.ParametersExpressionSchema.optional().nullable(),
518
584
  strict: Function.StrictExpressionSchema.optional().nullable(),
519
585
  })
520
- .describe(Function.DefinitionSchema.description);
586
+ .describe(Function.DefinitionSchema.description)
587
+ .meta({ title: "FunctionToolDefinitionExpression" });
521
588
  })(Function = Tool.Function || (Tool.Function = {}));
589
+ Tool.FunctionSchema = zod_1.default
590
+ .object({
591
+ type: zod_1.default.literal("function"),
592
+ function: Function.DefinitionSchema,
593
+ })
594
+ .describe("A function tool that the assistant can call.")
595
+ .meta({ title: "FunctionTool" });
596
+ Tool.FunctionExpressionSchema = zod_1.default
597
+ .object({
598
+ type: zod_1.default.literal("function"),
599
+ function: Function.DefinitionExpressionSchema,
600
+ })
601
+ .describe(Tool.FunctionSchema.description)
602
+ .meta({ title: "FunctionToolExpression" });
522
603
  })(Tool || (exports.Tool = Tool = {}));
523
- exports.ToolsSchema = zod_1.default
604
+ exports.ToolSchema = zod_1.default
605
+ .union([Tool.FunctionSchema])
606
+ .describe("A tool that the assistant can call.")
607
+ .meta({ title: "Tool" });
608
+ exports.ToolExpressionSchema = zod_1.default
609
+ .union([
610
+ Tool.FunctionExpressionSchema,
611
+ exports.ExpressionSchema.describe("An expression which evaluates to a tool."),
612
+ ])
613
+ .describe(exports.ToolSchema.description)
614
+ .meta({ title: "ToolExpression" });
615
+ exports.ToolsSchema = zod_1.default
524
616
  .array(exports.ToolSchema)
525
- .describe("A list of tools that the assistant can call.");
617
+ .describe("A list of tools that the assistant can call.")
618
+ .meta({ title: "Tools" });
526
619
  exports.ToolsExpressionSchema = zod_1.default
527
620
  .union([
528
- zod_1.default.array(exports.ToolExpressionSchema).describe(exports.ToolsSchema.description),
621
+ zod_1.default
622
+ .array(exports.ToolExpressionSchema)
623
+ .describe(exports.ToolsSchema.description)
624
+ .meta({ title: "ToolExpressions" }),
529
625
  exports.ExpressionSchema.describe("An expression which evaluates to an array of tools."),
530
626
  ])
531
- .describe(exports.ToolsSchema.description);
627
+ .describe(exports.ToolsSchema.description)
628
+ .meta({ title: "ToolsExpression" });
532
629
  // Vector Responses
533
- exports.VectorResponseSchema = Message.RichContentSchema.describe("A possible assistant response. The LLMs in the Ensemble may vote for this option.");
630
+ exports.VectorResponseSchema = Message.RichContentSchema.describe("A possible assistant response. The LLMs in the Ensemble may vote for this option.").meta({ title: "VectorResponse" });
534
631
  exports.VectorResponseExpressionSchema = zod_1.default
535
632
  .union([
536
633
  exports.VectorResponseSchema,
537
634
  exports.ExpressionSchema.describe("An expression which evaluates to a possible assistant response."),
538
635
  ])
539
- .describe(exports.VectorResponseSchema.description);
636
+ .describe(exports.VectorResponseSchema.description)
637
+ .meta({ title: "VectorResponseExpression" });
540
638
  exports.VectorResponsesSchema = zod_1.default
541
639
  .array(exports.VectorResponseSchema)
542
- .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.");
640
+ .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.")
641
+ .meta({ title: "VectorResponses" });
543
642
  exports.VectorResponsesExpressionSchema = zod_1.default
544
643
  .union([
545
644
  zod_1.default
546
645
  .array(exports.VectorResponseExpressionSchema)
547
- .describe(exports.VectorResponsesSchema.description),
646
+ .describe(exports.VectorResponsesSchema.description)
647
+ .meta({ title: "VectorResponseExpressions" }),
548
648
  exports.ExpressionSchema.describe("An expression which evaluates to an array of possible assistant responses."),
549
649
  ])
550
- .describe(exports.VectorResponsesSchema.description);
650
+ .describe(exports.VectorResponsesSchema.description)
651
+ .meta({ title: "VectorResponsesExpression" });
551
652
  // Ensemble LLM
653
+ var EnsembleLlm;
654
+ (function (EnsembleLlm) {
655
+ EnsembleLlm.OutputModeSchema = zod_1.default
656
+ .enum(["instruction", "json_schema", "tool_call"])
657
+ .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.');
658
+ EnsembleLlm.StopSchema = zod_1.default
659
+ .union([
660
+ zod_1.default
661
+ .string()
662
+ .describe("Generation will stop when this string is generated.")
663
+ .meta({ title: "StopString" }),
664
+ zod_1.default
665
+ .array(zod_1.default.string().meta({ title: "StopString" }))
666
+ .describe("Generation will stop when any of these strings are generated.")
667
+ .meta({ title: "StopStrings" }),
668
+ ])
669
+ .describe("The assistant will stop when any of the provided strings are generated.")
670
+ .meta({ title: "Stop" });
671
+ let Provider;
672
+ (function (Provider) {
673
+ Provider.QuantizationSchema = zod_1.default
674
+ .enum([
675
+ "int4",
676
+ "int8",
677
+ "fp4",
678
+ "fp6",
679
+ "fp8",
680
+ "fp16",
681
+ "bf16",
682
+ "fp32",
683
+ "unknown",
684
+ ])
685
+ .describe("An LLM quantization.")
686
+ .meta({ title: "ProviderQuantization" });
687
+ })(Provider = EnsembleLlm.Provider || (EnsembleLlm.Provider = {}));
688
+ EnsembleLlm.ProviderSchema = zod_1.default
689
+ .object({
690
+ allow_fallbacks: zod_1.default
691
+ .boolean()
692
+ .optional()
693
+ .nullable()
694
+ .describe("Whether to allow fallback providers if the preferred provider is unavailable."),
695
+ require_parameters: zod_1.default
696
+ .boolean()
697
+ .optional()
698
+ .nullable()
699
+ .describe("Whether to require that the provider supports all specified parameters."),
700
+ order: zod_1.default
701
+ .array(zod_1.default.string().meta({ title: "ProviderName" }))
702
+ .optional()
703
+ .nullable()
704
+ .describe("An ordered list of provider names to use when selecting a provider for this model."),
705
+ only: zod_1.default
706
+ .array(zod_1.default.string().meta({ title: "ProviderName" }))
707
+ .optional()
708
+ .nullable()
709
+ .describe("A list of provider names to restrict selection to when selecting a provider for this model."),
710
+ ignore: zod_1.default
711
+ .array(zod_1.default.string().meta({ title: "ProviderName" }))
712
+ .optional()
713
+ .nullable()
714
+ .describe("A list of provider names to ignore when selecting a provider for this model."),
715
+ quantizations: zod_1.default
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 Reasoning;
723
+ (function (Reasoning) {
724
+ Reasoning.EffortSchema = zod_1.default
725
+ .enum(["none", "minimal", "low", "medium", "high", "xhigh"])
726
+ .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.")
727
+ .meta({ title: "ReasoningEffort" });
728
+ Reasoning.SummaryVerbositySchema = zod_1.default
729
+ .enum(["auto", "concise", "detailed"])
730
+ .describe("Controls the verbosity of the reasoning summary for supported reasoning models.")
731
+ .meta({ title: "ReasoningSummaryVerbosity" });
732
+ })(Reasoning = EnsembleLlm.Reasoning || (EnsembleLlm.Reasoning = {}));
733
+ EnsembleLlm.ReasoningSchema = zod_1.default
734
+ .object({
735
+ enabled: zod_1.default
736
+ .boolean()
737
+ .optional()
738
+ .nullable()
739
+ .describe("Enables or disables reasoning for supported models."),
740
+ max_tokens: zod_1.default
741
+ .int()
742
+ .min(0)
743
+ .max(2147483647)
744
+ .optional()
745
+ .nullable()
746
+ .describe("The maximum number of tokens to use for reasoning in a response."),
747
+ effort: Reasoning.EffortSchema.optional().nullable(),
748
+ summary_verbosity: Reasoning.SummaryVerbositySchema.optional().nullable(),
749
+ })
750
+ .optional()
751
+ .nullable()
752
+ .describe("Options for controlling reasoning behavior of the model.");
753
+ EnsembleLlm.VerbositySchema = zod_1.default
754
+ .enum(["low", "medium", "high"])
755
+ .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.");
756
+ EnsembleLlm.ListItemSchema = zod_1.default.object({
757
+ id: zod_1.default.string().describe("The unique identifier for the Ensemble LLM."),
758
+ });
759
+ async function list(openai, options) {
760
+ const response = await openai.get("/ensemble_llms", options);
761
+ return response;
762
+ }
763
+ EnsembleLlm.list = list;
764
+ EnsembleLlm.RetrieveItemSchema = zod_1.default.lazy(() => exports.EnsembleLlmSchema.extend({
765
+ created: zod_1.default
766
+ .uint32()
767
+ .describe("The Unix timestamp (in seconds) when the Ensemble LLM was created."),
768
+ }));
769
+ async function retrieve(openai, id, options) {
770
+ const response = await openai.get(`/ensemble_llms/${id}`, options);
771
+ return response;
772
+ }
773
+ EnsembleLlm.retrieve = retrieve;
774
+ EnsembleLlm.HistoricalUsageSchema = zod_1.default.object({
775
+ requests: zod_1.default
776
+ .uint32()
777
+ .describe("The total number of requests made to this Ensemble LLM."),
778
+ completion_tokens: zod_1.default
779
+ .uint32()
780
+ .describe("The total number of completion tokens generated by this Ensemble LLM."),
781
+ prompt_tokens: zod_1.default
782
+ .uint32()
783
+ .describe("The total number of prompt tokens sent to this Ensemble LLM."),
784
+ total_cost: zod_1.default
785
+ .number()
786
+ .describe("The total cost incurred by using this Ensemble LLM."),
787
+ });
788
+ async function retrieveUsage(openai, id, options) {
789
+ const response = await openai.get(`/ensemble_llms/${id}/usage`, options);
790
+ return response;
791
+ }
792
+ EnsembleLlm.retrieveUsage = retrieveUsage;
793
+ })(EnsembleLlm || (exports.EnsembleLlm = EnsembleLlm = {}));
552
794
  exports.EnsembleLlmBaseSchema = zod_1.default
553
795
  .object({
554
796
  model: zod_1.default.string().describe("The full ID of the LLM to use."),
@@ -676,141 +918,6 @@ exports.EnsembleLlmWithFallbacksAndCountSchema = exports.EnsembleLlmSchema.exten
676
918
  .nullable()
677
919
  .describe(exports.EnsembleLlmBaseWithFallbacksAndCountSchema.shape.fallbacks.description),
678
920
  }).describe("An LLM to be used within an Ensemble, including its unique identifier, optional fallbacks, and count.");
679
- var EnsembleLlm;
680
- (function (EnsembleLlm) {
681
- EnsembleLlm.OutputModeSchema = zod_1.default
682
- .enum(["instruction", "json_schema", "tool_call"])
683
- .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.');
684
- EnsembleLlm.StopSchema = zod_1.default
685
- .union([
686
- zod_1.default
687
- .string()
688
- .describe("Generation will stop when this string is generated."),
689
- zod_1.default
690
- .array(zod_1.default.string())
691
- .describe("Generation will stop when any of these strings are generated."),
692
- ])
693
- .describe("The assistant will stop when any of the provided strings are generated.");
694
- EnsembleLlm.ProviderSchema = zod_1.default
695
- .object({
696
- allow_fallbacks: zod_1.default
697
- .boolean()
698
- .optional()
699
- .nullable()
700
- .describe("Whether to allow fallback providers if the preferred provider is unavailable."),
701
- require_parameters: zod_1.default
702
- .boolean()
703
- .optional()
704
- .nullable()
705
- .describe("Whether to require that the provider supports all specified parameters."),
706
- order: zod_1.default
707
- .array(zod_1.default.string())
708
- .optional()
709
- .nullable()
710
- .describe("An ordered list of provider names to use when selecting a provider for this model."),
711
- only: zod_1.default
712
- .array(zod_1.default.string())
713
- .optional()
714
- .nullable()
715
- .describe("A list of provider names to restrict selection to when selecting a provider for this model."),
716
- ignore: zod_1.default
717
- .array(zod_1.default.string())
718
- .optional()
719
- .nullable()
720
- .describe("A list of provider names to ignore when selecting a provider for this model."),
721
- quantizations: zod_1.default
722
- .array(Provider.QuantizationSchema)
723
- .optional()
724
- .nullable()
725
- .describe("Specifies the quantizations to allow when selecting providers for this model."),
726
- })
727
- .describe("Options for selecting the upstream provider of this model.");
728
- let Provider;
729
- (function (Provider) {
730
- Provider.QuantizationSchema = zod_1.default
731
- .enum([
732
- "int4",
733
- "int8",
734
- "fp4",
735
- "fp6",
736
- "fp8",
737
- "fp16",
738
- "bf16",
739
- "fp32",
740
- "unknown",
741
- ])
742
- .describe("An LLM quantization.");
743
- })(Provider = EnsembleLlm.Provider || (EnsembleLlm.Provider = {}));
744
- EnsembleLlm.ReasoningSchema = zod_1.default
745
- .object({
746
- enabled: zod_1.default
747
- .boolean()
748
- .optional()
749
- .nullable()
750
- .describe("Enables or disables reasoning for supported models."),
751
- max_tokens: zod_1.default
752
- .int()
753
- .min(0)
754
- .max(2147483647)
755
- .optional()
756
- .nullable()
757
- .describe("The maximum number of tokens to use for reasoning in a response."),
758
- effort: Reasoning.EffortSchema.optional().nullable(),
759
- summary_verbosity: Reasoning.SummaryVerbositySchema.optional().nullable(),
760
- })
761
- .optional()
762
- .nullable()
763
- .describe("Options for controlling reasoning behavior of the model.");
764
- let Reasoning;
765
- (function (Reasoning) {
766
- Reasoning.EffortSchema = zod_1.default
767
- .enum(["none", "minimal", "low", "medium", "high", "xhigh"])
768
- .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.");
769
- Reasoning.SummaryVerbositySchema = zod_1.default
770
- .enum(["auto", "concise", "detailed"])
771
- .describe("Controls the verbosity of the reasoning summary for supported reasoning models.");
772
- })(Reasoning = EnsembleLlm.Reasoning || (EnsembleLlm.Reasoning = {}));
773
- EnsembleLlm.VerbositySchema = zod_1.default
774
- .enum(["low", "medium", "high"])
775
- .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.");
776
- EnsembleLlm.ListItemSchema = zod_1.default.object({
777
- id: zod_1.default.string().describe("The unique identifier for the Ensemble LLM."),
778
- });
779
- async function list(openai, options) {
780
- const response = await openai.get("/ensemble_llms", options);
781
- return response;
782
- }
783
- EnsembleLlm.list = list;
784
- EnsembleLlm.RetrieveItemSchema = exports.EnsembleLlmSchema.extend({
785
- created: zod_1.default
786
- .uint32()
787
- .describe("The Unix timestamp (in seconds) when the Ensemble LLM was created."),
788
- });
789
- async function retrieve(openai, id, options) {
790
- const response = await openai.get(`/ensemble_llms/${id}`, options);
791
- return response;
792
- }
793
- EnsembleLlm.retrieve = retrieve;
794
- EnsembleLlm.HistoricalUsageSchema = zod_1.default.object({
795
- requests: zod_1.default
796
- .uint32()
797
- .describe("The total number of requests made to this Ensemble LLM."),
798
- completion_tokens: zod_1.default
799
- .uint32()
800
- .describe("The total number of completion tokens generated by this Ensemble LLM."),
801
- prompt_tokens: zod_1.default
802
- .uint32()
803
- .describe("The total number of prompt tokens sent to this Ensemble LLM."),
804
- total_cost: zod_1.default
805
- .number()
806
- .describe("The total cost incurred by using this Ensemble LLM."),
807
- });
808
- async function retrieveUsage(openai, id, options) {
809
- const response = await openai.get(`/ensemble_llms/${id}/usage`, options);
810
- return response;
811
- }
812
- EnsembleLlm.retrieveUsage = retrieveUsage;
813
- })(EnsembleLlm || (exports.EnsembleLlm = EnsembleLlm = {}));
814
921
  // Ensemble
815
922
  exports.EnsembleBaseSchema = zod_1.default
816
923
  .object({
@@ -866,46 +973,14 @@ var Ensemble;
866
973
  return response;
867
974
  }
868
975
  Ensemble.retrieveUsage = retrieveUsage;
869
- })(Ensemble || (exports.Ensemble = Ensemble = {}));
870
- // Chat Completions
871
- var Chat;
872
- (function (Chat) {
873
- let Completions;
874
- (function (Completions) {
875
- let Request;
876
- (function (Request) {
877
- Request.ProviderSchema = zod_1.default
878
- .object({
879
- data_collection: Provider.DataCollectionSchema.optional().nullable(),
880
- zdr: zod_1.default
881
- .boolean()
882
- .optional()
883
- .nullable()
884
- .describe("Whether to enforce Zero Data Retention (ZDR) policies when selecting providers."),
885
- sort: Provider.SortSchema.optional().nullable(),
886
- max_price: Provider.MaxPriceSchema.optional().nullable(),
887
- preferred_min_throughput: zod_1.default
888
- .number()
889
- .optional()
890
- .nullable()
891
- .describe("Preferred minimum throughput for the provider."),
892
- preferred_max_latency: zod_1.default
893
- .number()
894
- .optional()
895
- .nullable()
896
- .describe("Preferred maximum latency for the provider."),
897
- min_throughput: zod_1.default
898
- .number()
899
- .optional()
900
- .nullable()
901
- .describe("Minimum throughput for the provider."),
902
- max_latency: zod_1.default
903
- .number()
904
- .optional()
905
- .nullable()
906
- .describe("Maximum latency for the provider."),
907
- })
908
- .describe("Options for selecting the upstream provider of this completion.");
976
+ })(Ensemble || (exports.Ensemble = Ensemble = {}));
977
+ // Chat Completions
978
+ var Chat;
979
+ (function (Chat) {
980
+ let Completions;
981
+ (function (Completions) {
982
+ let Request;
983
+ (function (Request) {
909
984
  let Provider;
910
985
  (function (Provider) {
911
986
  Provider.DataCollectionSchema = zod_1.default
@@ -942,36 +1017,55 @@ var Chat;
942
1017
  .describe("Maximum price per request."),
943
1018
  });
944
1019
  })(Provider = Request.Provider || (Request.Provider = {}));
1020
+ Request.ProviderSchema = zod_1.default
1021
+ .object({
1022
+ data_collection: Provider.DataCollectionSchema.optional().nullable(),
1023
+ zdr: zod_1.default
1024
+ .boolean()
1025
+ .optional()
1026
+ .nullable()
1027
+ .describe("Whether to enforce Zero Data Retention (ZDR) policies when selecting providers."),
1028
+ sort: Provider.SortSchema.optional().nullable(),
1029
+ max_price: Provider.MaxPriceSchema.optional().nullable(),
1030
+ preferred_min_throughput: zod_1.default
1031
+ .number()
1032
+ .optional()
1033
+ .nullable()
1034
+ .describe("Preferred minimum throughput for the provider."),
1035
+ preferred_max_latency: zod_1.default
1036
+ .number()
1037
+ .optional()
1038
+ .nullable()
1039
+ .describe("Preferred maximum latency for the provider."),
1040
+ min_throughput: zod_1.default
1041
+ .number()
1042
+ .optional()
1043
+ .nullable()
1044
+ .describe("Minimum throughput for the provider."),
1045
+ max_latency: zod_1.default
1046
+ .number()
1047
+ .optional()
1048
+ .nullable()
1049
+ .describe("Maximum latency for the provider."),
1050
+ })
1051
+ .describe("Options for selecting the upstream provider of this completion.");
945
1052
  Request.ModelSchema = zod_1.default
946
1053
  .union([zod_1.default.string(), exports.EnsembleLlmBaseSchema])
947
1054
  .describe("The Ensemble LLM to use for this completion. May be a unique ID or an inline definition.");
948
- Request.ResponseFormatSchema = zod_1.default
949
- .union([
950
- ResponseFormat.TextSchema,
951
- ResponseFormat.JsonObjectSchema,
952
- ResponseFormat.JsonSchemaSchema,
953
- ResponseFormat.GrammarSchema,
954
- ResponseFormat.PythonSchema,
955
- ])
956
- .describe("The desired format of the model's response.");
957
1055
  let ResponseFormat;
958
1056
  (function (ResponseFormat) {
959
1057
  ResponseFormat.TextSchema = zod_1.default
960
1058
  .object({
961
1059
  type: zod_1.default.literal("text"),
962
1060
  })
963
- .describe("The response will be arbitrary text.");
1061
+ .describe("The response will be arbitrary text.")
1062
+ .meta({ title: "ResponseFormatText" });
964
1063
  ResponseFormat.JsonObjectSchema = zod_1.default
965
1064
  .object({
966
1065
  type: zod_1.default.literal("json_object"),
967
1066
  })
968
- .describe("The response will be a JSON object.");
969
- ResponseFormat.JsonSchemaSchema = zod_1.default
970
- .object({
971
- type: zod_1.default.literal("json_schema"),
972
- json_schema: JsonSchema.JsonSchemaSchema,
973
- })
974
- .describe("The response will conform to the provided JSON schema.");
1067
+ .describe("The response will be a JSON object.")
1068
+ .meta({ title: "ResponseFormatJsonObject" });
975
1069
  let JsonSchema;
976
1070
  (function (JsonSchema) {
977
1071
  JsonSchema.JsonSchemaSchema = zod_1.default
@@ -992,8 +1086,16 @@ var Chat;
992
1086
  .nullable()
993
1087
  .describe("Whether to enforce strict adherence to the JSON schema."),
994
1088
  })
995
- .describe("A JSON schema definition for constraining model output.");
1089
+ .describe("A JSON schema definition for constraining model output.")
1090
+ .meta({ title: "ResponseFormatJsonSchemaJsonSchema" });
996
1091
  })(JsonSchema = ResponseFormat.JsonSchema || (ResponseFormat.JsonSchema = {}));
1092
+ ResponseFormat.JsonSchemaSchema = zod_1.default
1093
+ .object({
1094
+ type: zod_1.default.literal("json_schema"),
1095
+ json_schema: JsonSchema.JsonSchemaSchema,
1096
+ })
1097
+ .describe("The response will conform to the provided JSON schema.")
1098
+ .meta({ title: "ResponseFormatJsonSchema" });
997
1099
  ResponseFormat.GrammarSchema = zod_1.default
998
1100
  .object({
999
1101
  type: zod_1.default.literal("grammar"),
@@ -1001,50 +1103,56 @@ var Chat;
1001
1103
  .string()
1002
1104
  .describe("The grammar definition to constrain the response."),
1003
1105
  })
1004
- .describe("The response will conform to the provided grammar definition.");
1106
+ .describe("The response will conform to the provided grammar definition.")
1107
+ .meta({ title: "ResponseFormatGrammar" });
1005
1108
  ResponseFormat.PythonSchema = zod_1.default
1006
1109
  .object({
1007
1110
  type: zod_1.default.literal("python"),
1008
1111
  })
1009
- .describe("The response will be Python code.");
1112
+ .describe("The response will be Python code.")
1113
+ .meta({ title: "ResponseFormatPython" });
1010
1114
  })(ResponseFormat = Request.ResponseFormat || (Request.ResponseFormat = {}));
1011
- Request.ToolChoiceSchema = zod_1.default
1115
+ Request.ResponseFormatSchema = zod_1.default
1012
1116
  .union([
1013
- zod_1.default.literal("none"),
1014
- zod_1.default.literal("auto"),
1015
- zod_1.default.literal("required"),
1016
- ToolChoice.FunctionSchema,
1117
+ ResponseFormat.TextSchema,
1118
+ ResponseFormat.JsonObjectSchema,
1119
+ ResponseFormat.JsonSchemaSchema,
1120
+ ResponseFormat.GrammarSchema,
1121
+ ResponseFormat.PythonSchema,
1017
1122
  ])
1018
- .describe("Specifies tool call behavior for the assistant.");
1123
+ .describe("The desired format of the model's response.")
1124
+ .meta({ title: "ResponseFormat" });
1019
1125
  let ToolChoice;
1020
1126
  (function (ToolChoice) {
1021
- ToolChoice.FunctionSchema = zod_1.default
1022
- .object({
1023
- type: zod_1.default.literal("function"),
1024
- function: Function.FunctionSchema,
1025
- })
1026
- .describe("Specify a function for the assistant to call.");
1027
1127
  let Function;
1028
1128
  (function (Function) {
1029
- Function.FunctionSchema = zod_1.default.object({
1129
+ Function.FunctionSchema = zod_1.default
1130
+ .object({
1030
1131
  name: zod_1.default
1031
1132
  .string()
1032
1133
  .describe("The name of the function the assistant will call."),
1033
- });
1134
+ })
1135
+ .meta({ title: "ToolChoiceFunctionFunction" });
1034
1136
  })(Function = ToolChoice.Function || (ToolChoice.Function = {}));
1137
+ ToolChoice.FunctionSchema = zod_1.default
1138
+ .object({
1139
+ type: zod_1.default.literal("function"),
1140
+ function: Function.FunctionSchema,
1141
+ })
1142
+ .describe("Specify a function for the assistant to call.")
1143
+ .meta({ title: "ToolChoiceFunction" });
1035
1144
  })(ToolChoice = Request.ToolChoice || (Request.ToolChoice = {}));
1036
- Request.PredictionSchema = zod_1.default
1037
- .object({
1038
- type: zod_1.default.literal("content"),
1039
- content: Prediction.ContentSchema,
1040
- })
1041
- .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.");
1145
+ Request.ToolChoiceSchema = zod_1.default
1146
+ .union([
1147
+ zod_1.default.literal("none"),
1148
+ zod_1.default.literal("auto"),
1149
+ zod_1.default.literal("required"),
1150
+ ToolChoice.FunctionSchema,
1151
+ ])
1152
+ .describe("Specifies tool call behavior for the assistant.")
1153
+ .meta({ title: "ToolChoice" });
1042
1154
  let Prediction;
1043
1155
  (function (Prediction) {
1044
- Prediction.ContentSchema = zod_1.default.union([
1045
- zod_1.default.string(),
1046
- zod_1.default.array(Content.PartSchema),
1047
- ]);
1048
1156
  let Content;
1049
1157
  (function (Content) {
1050
1158
  Content.PartSchema = zod_1.default
@@ -1052,9 +1160,20 @@ var Chat;
1052
1160
  type: zod_1.default.literal("text"),
1053
1161
  text: zod_1.default.string(),
1054
1162
  })
1055
- .describe("A part of the predicted content.");
1163
+ .describe("A part of the predicted content.")
1164
+ .meta({ title: "PredictionContentPart" });
1056
1165
  })(Content = Prediction.Content || (Prediction.Content = {}));
1166
+ Prediction.ContentSchema = zod_1.default.union([
1167
+ zod_1.default.string().meta({ title: "PredictionContentText" }),
1168
+ zod_1.default.array(Content.PartSchema).meta({ title: "PredictionContentParts" }),
1169
+ ]);
1057
1170
  })(Prediction = Request.Prediction || (Request.Prediction = {}));
1171
+ Request.PredictionSchema = zod_1.default
1172
+ .object({
1173
+ type: zod_1.default.literal("content"),
1174
+ content: Prediction.ContentSchema,
1175
+ })
1176
+ .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.");
1058
1177
  Request.SeedSchema = zod_1.default
1059
1178
  .bigint()
1060
1179
  .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.");
@@ -1104,53 +1223,30 @@ var Chat;
1104
1223
  .describe("Whether to stream the response as a series of chunks.");
1105
1224
  Request.ChatCompletionCreateParamsStreamingSchema = Request.ChatCompletionCreateParamsBaseSchema.extend({
1106
1225
  stream: Request.StreamTrueSchema,
1107
- }).describe("Parameters for creating a streaming chat completion.");
1226
+ })
1227
+ .describe("Parameters for creating a streaming chat completion.")
1228
+ .meta({ title: "ChatCompletionCreateParamsStreaming" });
1108
1229
  Request.StreamFalseSchema = zod_1.default
1109
1230
  .literal(false)
1110
1231
  .describe("Whether to stream the response as a series of chunks.");
1111
1232
  Request.ChatCompletionCreateParamsNonStreamingSchema = Request.ChatCompletionCreateParamsBaseSchema.extend({
1112
1233
  stream: Request.StreamFalseSchema.optional().nullable(),
1113
- }).describe("Parameters for creating a unary chat completion.");
1234
+ })
1235
+ .describe("Parameters for creating a unary chat completion.")
1236
+ .meta({ title: "ChatCompletionCreateParamsNonStreaming" });
1114
1237
  Request.ChatCompletionCreateParamsSchema = zod_1.default
1115
1238
  .union([
1116
1239
  Request.ChatCompletionCreateParamsStreamingSchema,
1117
1240
  Request.ChatCompletionCreateParamsNonStreamingSchema,
1118
1241
  ])
1119
- .describe("Parameters for creating a chat completion.");
1242
+ .describe("Parameters for creating a chat completion.")
1243
+ .meta({ title: "ChatCompletionCreateParams" });
1120
1244
  })(Request = Completions.Request || (Completions.Request = {}));
1121
1245
  let Response;
1122
1246
  (function (Response) {
1123
1247
  Response.FinishReasonSchema = zod_1.default
1124
1248
  .enum(["stop", "length", "tool_calls", "content_filter", "error"])
1125
1249
  .describe("The reason why the assistant ceased to generate further tokens.");
1126
- Response.UsageSchema = zod_1.default
1127
- .object({
1128
- completion_tokens: zod_1.default
1129
- .uint32()
1130
- .describe("The number of tokens generated in the completion."),
1131
- prompt_tokens: zod_1.default
1132
- .uint32()
1133
- .describe("The number of tokens in the prompt."),
1134
- total_tokens: zod_1.default
1135
- .uint32()
1136
- .describe("The total number of tokens used in the prompt or generated in the completion."),
1137
- completion_tokens_details: Usage.CompletionTokensDetailsSchema.optional(),
1138
- prompt_tokens_details: Usage.PromptTokensDetailsSchema.optional(),
1139
- cost: zod_1.default
1140
- .number()
1141
- .describe("The cost in credits incurred for this completion."),
1142
- cost_details: Usage.CostDetailsSchema.optional(),
1143
- total_cost: zod_1.default
1144
- .number()
1145
- .describe("The total cost in credits incurred including upstream costs."),
1146
- cost_multiplier: zod_1.default
1147
- .number()
1148
- .describe("The cost multiplier applied to upstream costs for computing ObjectiveAI costs."),
1149
- is_byok: zod_1.default
1150
- .boolean()
1151
- .describe("Whether the completion used a BYOK (Bring Your Own Key) API Key."),
1152
- })
1153
- .describe("Token and cost usage statistics for the completion.");
1154
1250
  let Usage;
1155
1251
  (function (Usage) {
1156
1252
  Usage.CompletionTokensDetailsSchema = zod_1.default
@@ -1206,20 +1302,34 @@ var Chat;
1206
1302
  })
1207
1303
  .describe("Detailed breakdown of upstream costs incurred.");
1208
1304
  })(Usage = Response.Usage || (Response.Usage = {}));
1209
- Response.LogprobsSchema = zod_1.default
1305
+ Response.UsageSchema = zod_1.default
1210
1306
  .object({
1211
- content: zod_1.default
1212
- .array(Logprobs.LogprobSchema)
1213
- .optional()
1214
- .nullable()
1215
- .describe("The log probabilities of the tokens in the content."),
1216
- refusal: zod_1.default
1217
- .array(Logprobs.LogprobSchema)
1218
- .optional()
1219
- .nullable()
1220
- .describe("The log probabilities of the tokens in the refusal."),
1307
+ completion_tokens: zod_1.default
1308
+ .uint32()
1309
+ .describe("The number of tokens generated in the completion."),
1310
+ prompt_tokens: zod_1.default
1311
+ .uint32()
1312
+ .describe("The number of tokens in the prompt."),
1313
+ total_tokens: zod_1.default
1314
+ .uint32()
1315
+ .describe("The total number of tokens used in the prompt or generated in the completion."),
1316
+ completion_tokens_details: Usage.CompletionTokensDetailsSchema.optional(),
1317
+ prompt_tokens_details: Usage.PromptTokensDetailsSchema.optional(),
1318
+ cost: zod_1.default
1319
+ .number()
1320
+ .describe("The cost in credits incurred for this completion."),
1321
+ cost_details: Usage.CostDetailsSchema.optional(),
1322
+ total_cost: zod_1.default
1323
+ .number()
1324
+ .describe("The total cost in credits incurred including upstream costs."),
1325
+ cost_multiplier: zod_1.default
1326
+ .number()
1327
+ .describe("The cost multiplier applied to upstream costs for computing ObjectiveAI costs."),
1328
+ is_byok: zod_1.default
1329
+ .boolean()
1330
+ .describe("Whether the completion used a BYOK (Bring Your Own Key) API Key."),
1221
1331
  })
1222
- .describe("The log probabilities of the tokens generated by the model.");
1332
+ .describe("Token and cost usage statistics for the completion.");
1223
1333
  let Logprobs;
1224
1334
  (function (Logprobs) {
1225
1335
  function merged(a, b) {
@@ -1233,24 +1343,6 @@ var Chat;
1233
1343
  }
1234
1344
  }
1235
1345
  Logprobs.merged = merged;
1236
- Logprobs.LogprobSchema = zod_1.default
1237
- .object({
1238
- token: zod_1.default
1239
- .string()
1240
- .describe("The token string which was selected by the sampler."),
1241
- bytes: zod_1.default
1242
- .array(zod_1.default.uint32())
1243
- .optional()
1244
- .nullable()
1245
- .describe("The byte representation of the token which was selected by the sampler."),
1246
- logprob: zod_1.default
1247
- .number()
1248
- .describe("The log probability of the token which was selected by the sampler."),
1249
- top_logprobs: zod_1.default
1250
- .array(Logprob.TopLogprobSchema)
1251
- .describe("The log probabilities of the top tokens for this position."),
1252
- })
1253
- .describe("The token which was selected by the sampler for this position as well as the logprobabilities of the top options.");
1254
1346
  let Logprob;
1255
1347
  (function (Logprob) {
1256
1348
  function mergedList(a, b) {
@@ -1281,13 +1373,42 @@ var Chat;
1281
1373
  })
1282
1374
  .describe("The log probability of a token in the list of top tokens.");
1283
1375
  })(Logprob = Logprobs.Logprob || (Logprobs.Logprob = {}));
1376
+ Logprobs.LogprobSchema = zod_1.default
1377
+ .object({
1378
+ token: zod_1.default
1379
+ .string()
1380
+ .describe("The token string which was selected by the sampler."),
1381
+ bytes: zod_1.default
1382
+ .array(zod_1.default.uint32())
1383
+ .optional()
1384
+ .nullable()
1385
+ .describe("The byte representation of the token which was selected by the sampler."),
1386
+ logprob: zod_1.default
1387
+ .number()
1388
+ .describe("The log probability of the token which was selected by the sampler."),
1389
+ top_logprobs: zod_1.default
1390
+ .array(Logprob.TopLogprobSchema)
1391
+ .describe("The log probabilities of the top tokens for this position."),
1392
+ })
1393
+ .describe("The token which was selected by the sampler for this position as well as the logprobabilities of the top options.");
1284
1394
  })(Logprobs = Response.Logprobs || (Response.Logprobs = {}));
1395
+ Response.LogprobsSchema = zod_1.default
1396
+ .object({
1397
+ content: zod_1.default
1398
+ .array(Logprobs.LogprobSchema)
1399
+ .optional()
1400
+ .nullable()
1401
+ .describe("The log probabilities of the tokens in the content."),
1402
+ refusal: zod_1.default
1403
+ .array(Logprobs.LogprobSchema)
1404
+ .optional()
1405
+ .nullable()
1406
+ .describe("The log probabilities of the tokens in the refusal."),
1407
+ })
1408
+ .describe("The log probabilities of the tokens generated by the model.");
1285
1409
  Response.RoleSchema = zod_1.default
1286
1410
  .enum(["assistant"])
1287
1411
  .describe("The role of the message author.");
1288
- Response.ImageSchema = zod_1.default
1289
- .union([Image.ImageUrlSchema])
1290
- .describe("An image generated by the model.");
1291
1412
  let Image;
1292
1413
  (function (Image) {
1293
1414
  function mergedList(a, b) {
@@ -1309,11 +1430,11 @@ var Chat;
1309
1430
  }),
1310
1431
  });
1311
1432
  })(Image = Response.Image || (Response.Image = {}));
1433
+ Response.ImageSchema = zod_1.default
1434
+ .union([Image.ImageUrlSchema])
1435
+ .describe("An image generated by the model.");
1312
1436
  let Streaming;
1313
1437
  (function (Streaming) {
1314
- Streaming.ToolCallSchema = zod_1.default
1315
- .union([ToolCall.FunctionSchema])
1316
- .describe("A tool call made by the assistant.");
1317
1438
  let ToolCall;
1318
1439
  (function (ToolCall) {
1319
1440
  function merged(a, b) {
@@ -1345,19 +1466,6 @@ var Chat;
1345
1466
  return merged ? [merged, true] : [a, false];
1346
1467
  }
1347
1468
  ToolCall.mergedList = mergedList;
1348
- ToolCall.FunctionSchema = zod_1.default
1349
- .object({
1350
- index: zod_1.default
1351
- .uint32()
1352
- .describe("The index of the tool call in the sequence of tool calls."),
1353
- type: zod_1.default.literal("function").optional(),
1354
- id: zod_1.default
1355
- .string()
1356
- .optional()
1357
- .describe("The unique identifier of the function tool."),
1358
- function: Function.DefinitionSchema.optional(),
1359
- })
1360
- .describe("A function tool call made by the assistant.");
1361
1469
  let Function;
1362
1470
  (function (Function) {
1363
1471
  function merged(a, b) {
@@ -1376,13 +1484,6 @@ var Chat;
1376
1484
  }
1377
1485
  }
1378
1486
  Function.merged = merged;
1379
- Function.DefinitionSchema = zod_1.default.object({
1380
- name: zod_1.default.string().optional().describe("The name of the function."),
1381
- arguments: zod_1.default
1382
- .string()
1383
- .optional()
1384
- .describe("The arguments passed to the function."),
1385
- });
1386
1487
  let Definition;
1387
1488
  (function (Definition) {
1388
1489
  function merged(a, b) {
@@ -1402,8 +1503,31 @@ var Chat;
1402
1503
  }
1403
1504
  Definition.merged = merged;
1404
1505
  })(Definition = Function.Definition || (Function.Definition = {}));
1506
+ Function.DefinitionSchema = zod_1.default.object({
1507
+ name: zod_1.default.string().optional().describe("The name of the function."),
1508
+ arguments: zod_1.default
1509
+ .string()
1510
+ .optional()
1511
+ .describe("The arguments passed to the function."),
1512
+ });
1405
1513
  })(Function = ToolCall.Function || (ToolCall.Function = {}));
1514
+ ToolCall.FunctionSchema = zod_1.default
1515
+ .object({
1516
+ index: zod_1.default
1517
+ .uint32()
1518
+ .describe("The index of the tool call in the sequence of tool calls."),
1519
+ type: zod_1.default.literal("function").optional(),
1520
+ id: zod_1.default
1521
+ .string()
1522
+ .optional()
1523
+ .describe("The unique identifier of the function tool."),
1524
+ function: Function.DefinitionSchema.optional(),
1525
+ })
1526
+ .describe("A function tool call made by the assistant.");
1406
1527
  })(ToolCall = Streaming.ToolCall || (Streaming.ToolCall = {}));
1528
+ Streaming.ToolCallSchema = zod_1.default
1529
+ .union([ToolCall.FunctionSchema])
1530
+ .describe("A tool call made by the assistant.");
1407
1531
  Streaming.DeltaSchema = zod_1.default
1408
1532
  .object({
1409
1533
  content: zod_1.default
@@ -1582,20 +1706,8 @@ var Chat;
1582
1706
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
1583
1707
  let Unary;
1584
1708
  (function (Unary) {
1585
- Unary.ToolCallSchema = zod_1.default
1586
- .union([ToolCall.FunctionSchema])
1587
- .describe(Streaming.ToolCallSchema.description);
1588
1709
  let ToolCall;
1589
1710
  (function (ToolCall) {
1590
- ToolCall.FunctionSchema = zod_1.default
1591
- .object({
1592
- type: zod_1.default.literal("function"),
1593
- id: zod_1.default
1594
- .string()
1595
- .describe(Streaming.ToolCall.FunctionSchema.shape.id.description),
1596
- function: Function.DefinitionSchema,
1597
- })
1598
- .describe(Streaming.ToolCall.FunctionSchema.description);
1599
1711
  let Function;
1600
1712
  (function (Function) {
1601
1713
  Function.DefinitionSchema = zod_1.default.object({
@@ -1609,7 +1721,19 @@ var Chat;
1609
1721
  .description),
1610
1722
  });
1611
1723
  })(Function = ToolCall.Function || (ToolCall.Function = {}));
1724
+ ToolCall.FunctionSchema = zod_1.default
1725
+ .object({
1726
+ type: zod_1.default.literal("function"),
1727
+ id: zod_1.default
1728
+ .string()
1729
+ .describe(Streaming.ToolCall.FunctionSchema.shape.id.description),
1730
+ function: Function.DefinitionSchema,
1731
+ })
1732
+ .describe(Streaming.ToolCall.FunctionSchema.description);
1612
1733
  })(ToolCall = Unary.ToolCall || (Unary.ToolCall = {}));
1734
+ Unary.ToolCallSchema = zod_1.default
1735
+ .union([ToolCall.FunctionSchema])
1736
+ .describe(Streaming.ToolCallSchema.description);
1613
1737
  Unary.MessageSchema = zod_1.default
1614
1738
  .object({
1615
1739
  content: zod_1.default
@@ -1721,19 +1845,43 @@ var Vector;
1721
1845
  .describe("Base parameters for creating a vector completion.");
1722
1846
  Request.VectorCompletionCreateParamsStreamingSchema = Request.VectorCompletionCreateParamsBaseSchema.extend({
1723
1847
  stream: Chat.Completions.Request.StreamTrueSchema,
1724
- }).describe("Parameters for creating a streaming vector completion.");
1848
+ })
1849
+ .describe("Parameters for creating a streaming vector completion.")
1850
+ .meta({ title: "VectorCompletionCreateParamsStreaming" });
1725
1851
  Request.VectorCompletionCreateParamsNonStreamingSchema = Request.VectorCompletionCreateParamsBaseSchema.extend({
1726
1852
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
1727
- }).describe("Parameters for creating a unary vector completion.");
1853
+ })
1854
+ .describe("Parameters for creating a unary vector completion.")
1855
+ .meta({ title: "VectorCompletionCreateParamsNonStreaming" });
1728
1856
  Request.VectorCompletionCreateParamsSchema = zod_1.default
1729
1857
  .union([
1730
1858
  Request.VectorCompletionCreateParamsStreamingSchema,
1731
1859
  Request.VectorCompletionCreateParamsNonStreamingSchema,
1732
1860
  ])
1733
- .describe("Parameters for creating a vector completion.");
1861
+ .describe("Parameters for creating a vector completion.")
1862
+ .meta({ title: "VectorCompletionCreateParams" });
1734
1863
  })(Request = Completions.Request || (Completions.Request = {}));
1735
1864
  let Response;
1736
1865
  (function (Response) {
1866
+ let Vote;
1867
+ (function (Vote) {
1868
+ function mergedList(a, b) {
1869
+ let merged = undefined;
1870
+ for (const vote of b) {
1871
+ const existingIndex = a.findIndex(({ flat_ensemble_index }) => flat_ensemble_index === vote.flat_ensemble_index);
1872
+ if (existingIndex === -1) {
1873
+ if (merged === undefined) {
1874
+ merged = [...a, vote];
1875
+ }
1876
+ else {
1877
+ merged.push(vote);
1878
+ }
1879
+ }
1880
+ }
1881
+ return merged ? [merged, true] : [a, false];
1882
+ }
1883
+ Vote.mergedList = mergedList;
1884
+ })(Vote = Response.Vote || (Response.Vote = {}));
1737
1885
  Response.VoteSchema = zod_1.default
1738
1886
  .object({
1739
1887
  model: zod_1.default
@@ -1755,25 +1903,42 @@ var Vector;
1755
1903
  .describe("Whether this vote came from a previous Vector Completion which was retried."),
1756
1904
  })
1757
1905
  .describe("A vote from an Ensemble LLM within a Vector Completion.");
1758
- let Vote;
1759
- (function (Vote) {
1760
- function mergedList(a, b) {
1761
- let merged = undefined;
1762
- for (const vote of b) {
1763
- const existingIndex = a.findIndex(({ flat_ensemble_index }) => flat_ensemble_index === vote.flat_ensemble_index);
1764
- if (existingIndex === -1) {
1765
- if (merged === undefined) {
1766
- merged = [...a, vote];
1767
- }
1768
- else {
1769
- merged.push(vote);
1906
+ Response.VotesSchema = zod_1.default
1907
+ .array(Response.VoteSchema)
1908
+ .describe("The list of votes for responses in the request from the Ensemble LLMs within the provided Ensemble.");
1909
+ let Scores;
1910
+ (function (Scores) {
1911
+ function merged(a, b) {
1912
+ if (a.length === b.length) {
1913
+ for (let i = 0; i < a.length; i++) {
1914
+ if (a[i] !== b[i]) {
1915
+ return [b, true];
1770
1916
  }
1771
1917
  }
1918
+ return [a, false];
1919
+ }
1920
+ else {
1921
+ return [b, true];
1772
1922
  }
1773
- return merged ? [merged, true] : [a, false];
1774
1923
  }
1775
- Vote.mergedList = mergedList;
1776
- })(Vote = Response.Vote || (Response.Vote = {}));
1924
+ Scores.merged = merged;
1925
+ })(Scores = Response.Scores || (Response.Scores = {}));
1926
+ Response.ScoresSchema = zod_1.default
1927
+ .array(zod_1.default.number())
1928
+ .describe("The scores for each response in the request, aggregated from the votes of the Ensemble LLMs.");
1929
+ let Weights;
1930
+ (function (Weights) {
1931
+ function merged(a, b) {
1932
+ return Scores.merged(a, b);
1933
+ }
1934
+ Weights.merged = merged;
1935
+ })(Weights = Response.Weights || (Response.Weights = {}));
1936
+ Response.WeightsSchema = zod_1.default
1937
+ .array(zod_1.default.number())
1938
+ .describe("The weights assigned to each response in the request, aggregated from the votes of the Ensemble LLMs.");
1939
+ Response.EnsembleSchema = zod_1.default
1940
+ .string()
1941
+ .describe("The unique identifier of the Ensemble used for this vector completion.");
1777
1942
  Response.UsageSchema = zod_1.default
1778
1943
  .object({
1779
1944
  completion_tokens: zod_1.default
@@ -1796,26 +1961,8 @@ var Vector;
1796
1961
  .describe("The total cost in credits incurred including upstream costs."),
1797
1962
  })
1798
1963
  .describe("Token and cost usage statistics for the completion.");
1799
- Response.VotesSchema = zod_1.default
1800
- .array(Response.VoteSchema)
1801
- .describe("The list of votes for responses in the request from the Ensemble LLMs within the provided Ensemble.");
1802
- Response.ScoresSchema = zod_1.default
1803
- .array(zod_1.default.number())
1804
- .describe("The scores for each response in the request, aggregated from the votes of the Ensemble LLMs.");
1805
- Response.WeightsSchema = zod_1.default
1806
- .array(zod_1.default.number())
1807
- .describe("The weights assigned to each response in the request, aggregated from the votes of the Ensemble LLMs.");
1808
- Response.EnsembleSchema = zod_1.default
1809
- .string()
1810
- .describe("The unique identifier of the Ensemble used for this vector completion.");
1811
1964
  let Streaming;
1812
1965
  (function (Streaming) {
1813
- Streaming.ChatCompletionChunkSchema = Chat.Completions.Response.Streaming.ChatCompletionChunkSchema.extend({
1814
- index: zod_1.default
1815
- .uint32()
1816
- .describe("The index of the completion amongst all chat completions."),
1817
- error: exports.ObjectiveAIErrorSchema.optional().describe("An error encountered during the generation of this chat completion."),
1818
- }).describe("A chat completion chunk generated in the pursuit of a vector completion.");
1819
1966
  let ChatCompletionChunk;
1820
1967
  (function (ChatCompletionChunk) {
1821
1968
  function merged(a, b) {
@@ -1859,25 +2006,12 @@ var Vector;
1859
2006
  }
1860
2007
  ChatCompletionChunk.mergedList = mergedList;
1861
2008
  })(ChatCompletionChunk = Streaming.ChatCompletionChunk || (Streaming.ChatCompletionChunk = {}));
1862
- Streaming.VectorCompletionChunkSchema = zod_1.default
1863
- .object({
1864
- id: zod_1.default
1865
- .string()
1866
- .describe("The unique identifier of the vector completion."),
1867
- completions: zod_1.default
1868
- .array(Streaming.ChatCompletionChunkSchema)
1869
- .describe("The list of chat completion chunks created for this vector completion."),
1870
- votes: Response.VotesSchema,
1871
- scores: Response.ScoresSchema,
1872
- weights: Response.WeightsSchema,
1873
- created: zod_1.default
2009
+ Streaming.ChatCompletionChunkSchema = Chat.Completions.Response.Streaming.ChatCompletionChunkSchema.extend({
2010
+ index: zod_1.default
1874
2011
  .uint32()
1875
- .describe("The Unix timestamp (in seconds) when the vector completion was created."),
1876
- ensemble: Response.EnsembleSchema,
1877
- object: zod_1.default.literal("vector.completion.chunk"),
1878
- usage: Response.UsageSchema.optional(),
1879
- })
1880
- .describe("A chunk in a streaming vector completion response.");
2012
+ .describe("The index of the completion amongst all chat completions."),
2013
+ error: exports.ObjectiveAIErrorSchema.optional().describe("An error encountered during the generation of this chat completion."),
2014
+ }).describe("A chat completion chunk generated in the pursuit of a vector completion.");
1881
2015
  let VectorCompletionChunk;
1882
2016
  (function (VectorCompletionChunk) {
1883
2017
  function merged(a, b) {
@@ -1913,30 +2047,25 @@ var Vector;
1913
2047
  }
1914
2048
  VectorCompletionChunk.merged = merged;
1915
2049
  })(VectorCompletionChunk = Streaming.VectorCompletionChunk || (Streaming.VectorCompletionChunk = {}));
1916
- let Scores;
1917
- (function (Scores) {
1918
- function merged(a, b) {
1919
- if (a.length === b.length) {
1920
- for (let i = 0; i < a.length; i++) {
1921
- if (a[i] !== b[i]) {
1922
- return [b, true];
1923
- }
1924
- }
1925
- return [a, false];
1926
- }
1927
- else {
1928
- return [b, true];
1929
- }
1930
- }
1931
- Scores.merged = merged;
1932
- })(Scores = Streaming.Scores || (Streaming.Scores = {}));
1933
- let Weights;
1934
- (function (Weights) {
1935
- function merged(a, b) {
1936
- return Scores.merged(a, b);
1937
- }
1938
- Weights.merged = merged;
1939
- })(Weights = Streaming.Weights || (Streaming.Weights = {}));
2050
+ Streaming.VectorCompletionChunkSchema = zod_1.default
2051
+ .object({
2052
+ id: zod_1.default
2053
+ .string()
2054
+ .describe("The unique identifier of the vector completion."),
2055
+ completions: zod_1.default
2056
+ .array(Streaming.ChatCompletionChunkSchema)
2057
+ .describe("The list of chat completion chunks created for this vector completion."),
2058
+ votes: Response.VotesSchema,
2059
+ scores: Response.ScoresSchema,
2060
+ weights: Response.WeightsSchema,
2061
+ created: zod_1.default
2062
+ .uint32()
2063
+ .describe("The Unix timestamp (in seconds) when the vector completion was created."),
2064
+ ensemble: Response.EnsembleSchema,
2065
+ object: zod_1.default.literal("vector.completion.chunk"),
2066
+ usage: Response.UsageSchema.optional(),
2067
+ })
2068
+ .describe("A chunk in a streaming vector completion response.");
1940
2069
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
1941
2070
  let Unary;
1942
2071
  (function (Unary) {
@@ -1976,9 +2105,6 @@ var Vector;
1976
2105
  })(Completions = Vector.Completions || (Vector.Completions = {}));
1977
2106
  })(Vector || (exports.Vector = Vector = {}));
1978
2107
  // Function
1979
- exports.FunctionSchema = zod_1.default
1980
- .discriminatedUnion("type", [Function.ScalarSchema, Function.VectorSchema])
1981
- .describe("A function.");
1982
2108
  var Function;
1983
2109
  (function (Function_1) {
1984
2110
  Function_1.VectorCompletionProfileSchema = zod_1.default
@@ -1987,54 +2113,53 @@ var Function;
1987
2113
  profile: Vector.Completions.Request.ProfileSchema,
1988
2114
  })
1989
2115
  .describe("A vector completion profile containing an Ensemble and array of weights.");
1990
- Function_1.FunctionProfileVersionRequiredSchema = zod_1.default
2116
+ Function_1.FunctionProfileCommitRequiredSchema = zod_1.default
1991
2117
  .union([
1992
2118
  zod_1.default.object({
1993
- function_author: zod_1.default
2119
+ owner: zod_1.default
2120
+ .string()
2121
+ .describe("The owner of the GitHub repository containing the profile."),
2122
+ repository: zod_1.default
1994
2123
  .string()
1995
- .describe("The author of the function the profile was published to."),
1996
- function_id: zod_1.default
2124
+ .describe("The name of the GitHub repository containing the profile."),
2125
+ commit: zod_1.default
1997
2126
  .string()
1998
- .describe("The unique identifier of the function the profile was published to."),
1999
- author: zod_1.default.string().describe("The author of the profile."),
2000
- id: zod_1.default.string().describe("The unique identifier of the profile."),
2001
- version: zod_1.default.uint32().describe("The version of the profile."),
2127
+ .describe("The commit SHA of the GitHub repository containing the profile."),
2002
2128
  }),
2003
- zod_1.default.lazy(() => zod_1.default.array(Function_1.ProfileVersionRequiredSchema)),
2129
+ zod_1.default.lazy(() => zod_1.default.array(Function_1.ProfileCommitRequiredSchema).meta({
2130
+ title: "ProfileCommitRequiredArray",
2131
+ recursive: true,
2132
+ })),
2004
2133
  ])
2005
- .describe("A function profile where remote profiles must specify a version.");
2006
- Function_1.FunctionProfileVersionOptionalSchema = zod_1.default
2134
+ .describe("A function profile where remote profiles must specify a commit.");
2135
+ Function_1.FunctionProfileCommitOptionalSchema = zod_1.default
2007
2136
  .union([
2008
2137
  zod_1.default.object({
2009
- function_author: zod_1.default
2138
+ owner: zod_1.default
2010
2139
  .string()
2011
- .describe("The author of the function the profile was published to."),
2012
- function_id: zod_1.default
2140
+ .describe("The owner of the GitHub repository containing the profile."),
2141
+ repository: zod_1.default
2013
2142
  .string()
2014
- .describe("The unique identifier of the function the profile was published to."),
2015
- author: zod_1.default.string().describe("The author of the profile."),
2016
- id: zod_1.default.string().describe("The unique identifier of the profile."),
2017
- version: zod_1.default
2018
- .uint32()
2019
- .optional()
2020
- .nullable()
2021
- .describe("The version of the profile."),
2143
+ .describe("The name of the GitHub repository containing the profile."),
2144
+ commit: zod_1.default
2145
+ .string()
2146
+ .describe("The commit SHA of the GitHub repository containing the profile.")
2147
+ .optional(),
2148
+ }),
2149
+ zod_1.default
2150
+ .lazy(() => zod_1.default.array(Function_1.ProfileCommitOptionalSchema))
2151
+ .meta({
2152
+ title: "ProfileCommitOptionalArray",
2153
+ recursive: true,
2022
2154
  }),
2023
- zod_1.default.lazy(() => zod_1.default.array(Function_1.ProfileVersionOptionalSchema)),
2024
- ])
2025
- .describe("A function profile where remote profiles may omit a version.");
2026
- Function_1.ProfileVersionRequiredSchema = zod_1.default
2027
- .union([
2028
- Function_1.FunctionProfileVersionRequiredSchema,
2029
- Function_1.VectorCompletionProfileSchema,
2030
- ])
2031
- .describe("A profile where remote function profiles must specify a version.");
2032
- Function_1.ProfileVersionOptionalSchema = zod_1.default
2033
- .union([
2034
- Function_1.FunctionProfileVersionOptionalSchema,
2035
- Function_1.VectorCompletionProfileSchema,
2036
2155
  ])
2037
- .describe("A profile where remote function profiles may omit a version.");
2156
+ .describe("A function profile where remote profiles may omit a commit.");
2157
+ Function_1.ProfileCommitRequiredSchema = zod_1.default
2158
+ .union([Function_1.FunctionProfileCommitRequiredSchema, Function_1.VectorCompletionProfileSchema])
2159
+ .describe("A profile where remote function profiles must specify a commit.");
2160
+ Function_1.ProfileCommitOptionalSchema = zod_1.default
2161
+ .union([Function_1.FunctionProfileCommitOptionalSchema, Function_1.VectorCompletionProfileSchema])
2162
+ .describe("A profile where remote function profiles may omit a commit.");
2038
2163
  Function_1.InputSchemaSchema = zod_1.default.lazy(() => zod_1.default
2039
2164
  .union([
2040
2165
  InputSchema.ObjectSchema,
@@ -2060,7 +2185,10 @@ var Function;
2060
2185
  .nullable()
2061
2186
  .describe("The description of the object input."),
2062
2187
  properties: zod_1.default
2063
- .record(zod_1.default.string(), Function_1.InputSchemaSchema)
2188
+ .record(zod_1.default.string(), Function_1.InputSchemaSchema.meta({
2189
+ title: "InputSchema",
2190
+ recursive: true,
2191
+ }))
2064
2192
  .describe("The properties of the object input."),
2065
2193
  required: zod_1.default
2066
2194
  .array(zod_1.default.string())
@@ -2087,7 +2215,10 @@ var Function;
2087
2215
  .optional()
2088
2216
  .nullable()
2089
2217
  .describe("The maximum number of items in the array input."),
2090
- items: Function_1.InputSchemaSchema.describe("The schema of the items in the array input."),
2218
+ items: Function_1.InputSchemaSchema.describe("The schema of the items in the array input.").meta({
2219
+ title: "InputSchema",
2220
+ recursive: true,
2221
+ }),
2091
2222
  })
2092
2223
  .describe("An array input schema.");
2093
2224
  InputSchema.StringSchema = zod_1.default
@@ -2199,8 +2330,14 @@ var Function;
2199
2330
  Function_1.InputSchema_ = zod_1.default
2200
2331
  .lazy(() => zod_1.default.union([
2201
2332
  Message.RichContent.PartSchema,
2202
- zod_1.default.record(zod_1.default.string(), Function_1.InputSchema_),
2203
- zod_1.default.array(Function_1.InputSchema_),
2333
+ zod_1.default.record(zod_1.default.string(), Function_1.InputSchema_.meta({
2334
+ title: "Input",
2335
+ recursive: true,
2336
+ })),
2337
+ zod_1.default.array(Function_1.InputSchema_.meta({
2338
+ title: "Input",
2339
+ recursive: true,
2340
+ })),
2204
2341
  zod_1.default.string(),
2205
2342
  zod_1.default.number(),
2206
2343
  zod_1.default.boolean(),
@@ -2209,8 +2346,14 @@ var Function;
2209
2346
  Function_1.InputExpressionSchema = zod_1.default.lazy(() => zod_1.default
2210
2347
  .union([
2211
2348
  Message.RichContent.PartSchema,
2212
- zod_1.default.record(zod_1.default.string(), Function_1.InputExpressionSchema),
2213
- zod_1.default.array(Function_1.InputExpressionSchema),
2349
+ zod_1.default.record(zod_1.default.string(), Function_1.InputExpressionSchema.meta({
2350
+ title: "InputExpression",
2351
+ recursive: true,
2352
+ })),
2353
+ zod_1.default.array(Function_1.InputExpressionSchema.meta({
2354
+ title: "InputExpression",
2355
+ recursive: true,
2356
+ })),
2214
2357
  zod_1.default.string(),
2215
2358
  zod_1.default.number(),
2216
2359
  zod_1.default.boolean(),
@@ -2225,13 +2368,6 @@ var Function;
2225
2368
  .describe("A list of expressions which each evaluate to a 1D array of Inputs."),
2226
2369
  ])
2227
2370
  .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.");
2228
- Function_1.TaskExpressionSchema = zod_1.default
2229
- .discriminatedUnion("type", [
2230
- TaskExpression.ScalarFunctionSchema,
2231
- TaskExpression.VectorFunctionSchema,
2232
- TaskExpression.VectorCompletionSchema,
2233
- ])
2234
- .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.");
2235
2371
  let TaskExpression;
2236
2372
  (function (TaskExpression) {
2237
2373
  TaskExpression.SkipSchema = exports.ExpressionSchema.describe("An expression which evaluates to a boolean indicating whether to skip this task.");
@@ -2241,15 +2377,15 @@ var Function;
2241
2377
  TaskExpression.ScalarFunctionSchema = zod_1.default
2242
2378
  .object({
2243
2379
  type: zod_1.default.literal("scalar.function"),
2244
- author: zod_1.default
2380
+ owner: zod_1.default
2245
2381
  .string()
2246
- .describe("The author of the remote published scalar function."),
2247
- id: zod_1.default
2382
+ .describe("The owner of the GitHub repository containing the function."),
2383
+ repository: zod_1.default
2248
2384
  .string()
2249
- .describe("The unique identifier of the remote published scalar function."),
2250
- version: zod_1.default
2251
- .uint32()
2252
- .describe("The version of the remote published scalar function."),
2385
+ .describe("The name of the GitHub repository containing the function."),
2386
+ commit: zod_1.default
2387
+ .string()
2388
+ .describe("The commit SHA of the GitHub repository containing the function."),
2253
2389
  skip: TaskExpression.SkipSchema.optional().nullable(),
2254
2390
  map: TaskExpression.MapSchema.optional().nullable(),
2255
2391
  input: Function_1.InputExpressionSchema,
@@ -2258,15 +2394,15 @@ var Function;
2258
2394
  TaskExpression.VectorFunctionSchema = zod_1.default
2259
2395
  .object({
2260
2396
  type: zod_1.default.literal("vector.function"),
2261
- author: zod_1.default
2397
+ owner: zod_1.default
2262
2398
  .string()
2263
- .describe("The author of the remote published vector function."),
2264
- id: zod_1.default
2399
+ .describe("The owner of the GitHub repository containing the function."),
2400
+ repository: zod_1.default
2265
2401
  .string()
2266
- .describe("The unique identifier of the remote published vector function."),
2267
- version: zod_1.default
2268
- .uint32()
2269
- .describe("The version of the remote published vector function."),
2402
+ .describe("The name of the GitHub repository containing the function."),
2403
+ commit: zod_1.default
2404
+ .string()
2405
+ .describe("The commit SHA of the GitHub repository containing the function."),
2270
2406
  skip: TaskExpression.SkipSchema.optional().nullable(),
2271
2407
  map: TaskExpression.MapSchema.optional().nullable(),
2272
2408
  input: Function_1.InputExpressionSchema,
@@ -2285,15 +2421,19 @@ var Function;
2285
2421
  })
2286
2422
  .describe("A vector completion task.");
2287
2423
  })(TaskExpression = Function_1.TaskExpression || (Function_1.TaskExpression = {}));
2424
+ Function_1.TaskExpressionSchema = zod_1.default
2425
+ .discriminatedUnion("type", [
2426
+ TaskExpression.ScalarFunctionSchema,
2427
+ TaskExpression.VectorFunctionSchema,
2428
+ TaskExpression.VectorCompletionSchema,
2429
+ ])
2430
+ .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.");
2288
2431
  Function_1.TaskExpressionsSchema = zod_1.default
2289
2432
  .array(Function_1.TaskExpressionSchema)
2290
2433
  .describe("The list of tasks to be executed as part of the function.");
2291
2434
  Function_1.ScalarSchema = zod_1.default
2292
2435
  .object({
2293
2436
  type: zod_1.default.literal("scalar.function"),
2294
- author: zod_1.default.string().describe("The author of the scalar function."),
2295
- id: zod_1.default.string().describe("The unique identifier of the scalar function."),
2296
- version: zod_1.default.uint32().describe("The version of the scalar function."),
2297
2437
  description: zod_1.default
2298
2438
  .string()
2299
2439
  .describe("The description of the scalar function."),
@@ -2307,13 +2447,11 @@ var Function;
2307
2447
  tasks: Function_1.TaskExpressionsSchema,
2308
2448
  output: exports.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."),
2309
2449
  })
2310
- .describe("A scalar function.");
2450
+ .describe("A scalar function.")
2451
+ .meta({ title: "ScalarFunction" });
2311
2452
  Function_1.VectorSchema = zod_1.default
2312
2453
  .object({
2313
2454
  type: zod_1.default.literal("vector.function"),
2314
- author: zod_1.default.string().describe("The author of the vector function."),
2315
- id: zod_1.default.string().describe("The unique identifier of the vector function."),
2316
- version: zod_1.default.uint32().describe("The version of the vector function."),
2317
2455
  description: zod_1.default
2318
2456
  .string()
2319
2457
  .describe("The description of the vector function."),
@@ -2333,12 +2471,14 @@ var Function;
2333
2471
  ])
2334
2472
  .describe("The length of the output vector."),
2335
2473
  })
2336
- .describe("A vector function.");
2474
+ .describe("A vector function.")
2475
+ .meta({ title: "VectorFunction" });
2337
2476
  let Executions;
2338
2477
  (function (Executions) {
2339
2478
  let Request;
2340
2479
  (function (Request) {
2341
- Request.FunctionExecutionParamsBaseSchema = zod_1.default
2480
+ // Remote Function Remote Profile
2481
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema = zod_1.default
2342
2482
  .object({
2343
2483
  retry_token: zod_1.default
2344
2484
  .string()
@@ -2352,197 +2492,104 @@ var Function;
2352
2492
  first_chunk_timeout: Chat.Completions.Request.FirstChunkTimeoutSchema.optional().nullable(),
2353
2493
  other_chunk_timeout: Chat.Completions.Request.OtherChunkTimeoutSchema.optional().nullable(),
2354
2494
  })
2355
- .describe("Base parameters for executing a function.");
2356
- // Execute Inline Function
2357
- Request.FunctionExecutionParamsExecuteInlineBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2358
- function: exports.FunctionSchema,
2359
- profile: Function_1.FunctionProfileVersionOptionalSchema,
2360
- }).describe("Base parameters for executing an inline function.");
2361
- Request.FunctionExecutionParamsExecuteInlineStreamingSchema = Request.FunctionExecutionParamsExecuteInlineBaseSchema.extend({
2495
+ .describe("Base parameters for executing a remote function with a remote profile.");
2496
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2362
2497
  stream: Chat.Completions.Request.StreamTrueSchema,
2363
- }).describe("Parameters for executing an inline function and streaming the response.");
2364
- Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema = Request.FunctionExecutionParamsExecuteInlineBaseSchema.extend({
2365
- stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2366
- }).describe("Parameters for executing an inline function with a unary response.");
2367
- Request.FunctionExecutionParamsExecuteInlineSchema = zod_1.default
2368
- .union([
2369
- Request.FunctionExecutionParamsExecuteInlineStreamingSchema,
2370
- Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema,
2371
- ])
2372
- .describe("Parameters for executing an inline function.");
2373
- // Execute Published Function
2374
- Request.FunctionExecutionParamsExecuteBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2375
- profile: Function_1.FunctionProfileVersionOptionalSchema.optional().nullable(),
2376
- }).describe("Base parameters for executing a remote published function.");
2377
- Request.FunctionExecutionParamsExecuteStreamingSchema = Request.FunctionExecutionParamsExecuteBaseSchema.extend({
2378
- stream: Chat.Completions.Request.StreamTrueSchema,
2379
- }).describe("Parameters for executing a remote published function and streaming the response.");
2380
- Request.FunctionExecutionParamsExecuteNonStreamingSchema = Request.FunctionExecutionParamsExecuteBaseSchema.extend({
2498
+ })
2499
+ .describe("Parameters for executing a remote function with a remote profile and streaming the response.")
2500
+ .meta({
2501
+ title: "FunctionExecutionParamsRemoteFunctionRemoteProfileStreaming",
2502
+ });
2503
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2381
2504
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2382
- }).describe("Parameters for executing a remote published function with a unary response.");
2383
- Request.FunctionExecutionParamsExecuteSchema = zod_1.default
2505
+ })
2506
+ .describe("Parameters for executing a remote function with a remote profile with a unary response.")
2507
+ .meta({
2508
+ title: "FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreaming",
2509
+ });
2510
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileSchema = zod_1.default
2384
2511
  .union([
2385
- Request.FunctionExecutionParamsExecuteStreamingSchema,
2386
- Request.FunctionExecutionParamsExecuteNonStreamingSchema,
2512
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileStreamingSchema,
2513
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreamingSchema,
2387
2514
  ])
2388
- .describe("Parameters for executing a remote published function.");
2389
- // Publish Scalar Function
2390
- Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2391
- function: Function_1.ScalarSchema,
2392
- publish_function: zod_1.default
2393
- .object({
2394
- description: zod_1.default
2395
- .string()
2396
- .describe("The description of the published scalar function."),
2397
- changelog: zod_1.default
2398
- .string()
2399
- .optional()
2400
- .nullable()
2401
- .describe("When present, describes changes from the previous version or versions."),
2402
- input_schema: Function_1.InputSchemaSchema,
2403
- })
2404
- .describe("Details about the scalar function to be published."),
2405
- profile: Function_1.FunctionProfileVersionRequiredSchema,
2406
- publish_profile: zod_1.default
2407
- .object({
2408
- id: zod_1.default
2409
- .literal("default")
2410
- .describe('The identifier of the profile to publish. Must be "default" when publishing a function.'),
2411
- version: zod_1.default
2412
- .uint32()
2413
- .describe("The version of the profile to publish. Must match the function's version."),
2414
- description: zod_1.default
2415
- .string()
2416
- .describe("The description of the published profile."),
2417
- changelog: zod_1.default
2418
- .string()
2419
- .optional()
2420
- .nullable()
2421
- .describe("When present, describes changes from the previous version or versions."),
2422
- })
2423
- .describe("Details about the profile to be published."),
2424
- }).describe("Base parameters for executing and publishing an inline scalar function.");
2425
- Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema = Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema.extend({
2515
+ .describe("Parameters for executing a remote function with a remote profile.")
2516
+ .meta({ title: "FunctionExecutionParamsRemoteFunctionRemoteProfile" });
2517
+ // Remote Function Inline Profile
2518
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2519
+ profile: Function_1.FunctionProfileCommitOptionalSchema,
2520
+ }).describe("Base parameters for executing a remote function with an inline profile.");
2521
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema.extend({
2426
2522
  stream: Chat.Completions.Request.StreamTrueSchema,
2427
- }).describe("Parameters for executing and publishing an inline scalar function and streaming the response.");
2428
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema.extend({
2523
+ })
2524
+ .describe("Parameters for executing a remote function with an inline profile and streaming the response.")
2525
+ .meta({
2526
+ title: "FunctionExecutionParamsRemoteFunctionInlineProfileStreaming",
2527
+ });
2528
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema.extend({
2429
2529
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2430
- }).describe("Parameters for executing and publishing an inline scalar function with a unary response.");
2431
- Request.FunctionExecutionParamsPublishScalarFunctionSchema = zod_1.default
2530
+ })
2531
+ .describe("Parameters for executing a remote function with an inline profile with a unary response.")
2532
+ .meta({
2533
+ title: "FunctionExecutionParamsRemoteFunctionInlineProfileNonStreaming",
2534
+ });
2535
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileSchema = zod_1.default
2432
2536
  .union([
2433
- Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2434
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema,
2537
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileStreamingSchema,
2538
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema,
2435
2539
  ])
2436
- .describe("Parameters for executing and publishing an inline scalar function.");
2437
- // Publish Vector Function
2438
- Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2439
- function: Function_1.VectorSchema,
2440
- publish_function: zod_1.default
2441
- .object({
2442
- description: zod_1.default
2443
- .string()
2444
- .describe("The description of the published vector function."),
2445
- changelog: zod_1.default
2446
- .string()
2447
- .optional()
2448
- .nullable()
2449
- .describe("When present, describes changes from the previous version or versions."),
2450
- input_schema: Function_1.InputSchemaSchema,
2451
- output_length: zod_1.default
2452
- .union([
2453
- zod_1.default.uint32().describe("The fixed length of the output vector."),
2454
- exports.ExpressionSchema.describe("An expression which evaluates to the length of the output vector. Will only be provided with the function input. The output length must be determinable from the input alone."),
2455
- ])
2456
- .describe("The length of the output vector."),
2457
- })
2458
- .describe("Details about the vector function to be published."),
2459
- profile: Function_1.FunctionProfileVersionRequiredSchema,
2460
- publish_profile: zod_1.default
2461
- .object({
2462
- id: zod_1.default
2463
- .literal("default")
2464
- .describe('The identifier of the profile to publish. Must be "default" when publishing a function.'),
2465
- version: zod_1.default
2466
- .uint32()
2467
- .describe("The version of the profile to publish. Must match the function's version."),
2468
- description: zod_1.default
2469
- .string()
2470
- .describe("The description of the published profile."),
2471
- changelog: zod_1.default
2472
- .string()
2473
- .optional()
2474
- .nullable()
2475
- .describe("When present, describes changes from the previous version or versions."),
2476
- })
2477
- .describe("Details about the profile to be published."),
2478
- }).describe("Base parameters for executing and publishing an inline vector function.");
2479
- Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema = Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema.extend({
2540
+ .describe("Parameters for executing a remote function with an inline profile.")
2541
+ .meta({ title: "FunctionExecutionParamsRemoteFunctionInlineProfile" });
2542
+ // Inline Function Remote Profile
2543
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2544
+ function: zod_1.default.lazy(() => exports.FunctionSchema),
2545
+ }).describe("Base parameters for executing an inline function with a remote profile.");
2546
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileStreamingSchema = Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema.extend({
2480
2547
  stream: Chat.Completions.Request.StreamTrueSchema,
2481
- }).describe("Parameters for executing and publishing an inline vector function and streaming the response.");
2482
- Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema.extend({
2548
+ })
2549
+ .describe("Parameters for executing an inline function with a remote profile and streaming the response.")
2550
+ .meta({
2551
+ title: "FunctionExecutionParamsInlineFunctionRemoteProfileStreaming",
2552
+ });
2553
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema = Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema.extend({
2483
2554
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2484
- }).describe("Parameters for executing and publishing an inline vector function with a unary response.");
2485
- Request.FunctionExecutionParamsPublishVectorFunctionSchema = zod_1.default
2486
- .union([
2487
- Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema,
2488
- Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema,
2489
- ])
2490
- .describe("Parameters for executing and publishing an inline vector function.");
2491
- // Publish Function
2492
- Request.FunctionExecutionParamsPublishFunctionStreamingSchema = zod_1.default
2493
- .union([
2494
- Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2495
- Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema,
2496
- ])
2497
- .describe("Parameters for executing and publishing an inline function and streaming the response.");
2498
- Request.FunctionExecutionParamsPublishFunctionNonStreamingSchema = zod_1.default
2499
- .union([
2500
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema,
2501
- Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema,
2502
- ])
2503
- .describe("Parameters for executing and publishing an inline function with a unary response.");
2504
- Request.FunctionExecutionParamsPublishFunctionSchema = zod_1.default
2555
+ })
2556
+ .describe("Parameters for executing an inline function with a remote profile with a unary response.")
2557
+ .meta({
2558
+ title: "FunctionExecutionParamsInlineFunctionRemoteProfileNonStreaming",
2559
+ });
2560
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileSchema = zod_1.default
2505
2561
  .union([
2506
- Request.FunctionExecutionParamsPublishScalarFunctionSchema,
2507
- Request.FunctionExecutionParamsPublishVectorFunctionSchema,
2508
- ])
2509
- .describe("Parameters for executing and publishing an inline function.");
2510
- // Publish Profile
2511
- Request.FunctionExecutionParamsPublishProfileBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2512
- profile: zod_1.default
2513
- .array(Function_1.ProfileVersionRequiredSchema)
2514
- .describe("The profile to publish."),
2515
- publish_profile: zod_1.default
2516
- .object({
2517
- id: zod_1.default
2518
- .string()
2519
- .describe("The unique identifier of the profile to publish."),
2520
- version: zod_1.default
2521
- .uint32()
2522
- .describe("The version of the profile to publish."),
2523
- description: zod_1.default
2524
- .string()
2525
- .describe("The description of the published profile."),
2526
- changelog: zod_1.default
2527
- .string()
2528
- .optional()
2529
- .nullable()
2530
- .describe("When present, describes changes from the previous version or versions."),
2531
- })
2532
- .describe("Details about the profile to be published."),
2533
- }).describe("Base parameters for executing a remote published function and publishing a profile.");
2534
- Request.FunctionExecutionParamsPublishProfileStreamingSchema = Request.FunctionExecutionParamsPublishProfileBaseSchema.extend({
2562
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileStreamingSchema,
2563
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema,
2564
+ ])
2565
+ .describe("Parameters for executing an inline function with a remote profile.")
2566
+ .meta({ title: "FunctionExecutionParamsInlineFunctionRemoteProfile" });
2567
+ // Inline Function Inline Profile
2568
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2569
+ function: zod_1.default.lazy(() => exports.FunctionSchema),
2570
+ profile: Function_1.FunctionProfileCommitOptionalSchema,
2571
+ }).describe("Base parameters for executing an inline function with an inline profile.");
2572
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileStreamingSchema = Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema.extend({
2535
2573
  stream: Chat.Completions.Request.StreamTrueSchema,
2536
- }).describe("Parameters for executing a remote published function, publishing a profile, and streaming the response.");
2537
- Request.FunctionExecutionParamsPublishProfileNonStreamingSchema = Request.FunctionExecutionParamsPublishProfileBaseSchema.extend({
2574
+ })
2575
+ .describe("Parameters for executing an inline function with an inline profile and streaming the response.")
2576
+ .meta({
2577
+ title: "FunctionExecutionParamsInlineFunctionInlineProfileStreaming",
2578
+ });
2579
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileNonStreamingSchema = Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema.extend({
2538
2580
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2539
- }).describe("Parameters for executing a remote published function and publishing a profile with a unary response.");
2540
- Request.FunctionExecutionParamsPublishProfileSchema = zod_1.default
2581
+ })
2582
+ .describe("Parameters for executing an inline function with an inline profile with a unary response.")
2583
+ .meta({
2584
+ title: "FunctionExecutionParamsInlineFunctionInlineProfileNonStreaming",
2585
+ });
2586
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileSchema = zod_1.default
2541
2587
  .union([
2542
- Request.FunctionExecutionParamsPublishProfileStreamingSchema,
2543
- Request.FunctionExecutionParamsPublishProfileNonStreamingSchema,
2588
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileStreamingSchema,
2589
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileNonStreamingSchema,
2544
2590
  ])
2545
- .describe("Parameters for executing a remote published function and publishing a profile.");
2591
+ .describe("Parameters for executing an inline function with an inline profile.")
2592
+ .meta({ title: "FunctionExecutionParamsInlineFunctionInlineProfile" });
2546
2593
  })(Request = Executions.Request || (Executions.Request = {}));
2547
2594
  let Response;
2548
2595
  (function (Response) {
@@ -2560,9 +2607,6 @@ var Function;
2560
2607
  })(Task = Response.Task || (Response.Task = {}));
2561
2608
  let Streaming;
2562
2609
  (function (Streaming) {
2563
- Streaming.TaskChunkSchema = zod_1.default
2564
- .union([TaskChunk.FunctionSchema, TaskChunk.VectorCompletionSchema])
2565
- .describe("A chunk of a task execution.");
2566
2610
  let TaskChunk;
2567
2611
  (function (TaskChunk) {
2568
2612
  function merged(a, b) {
@@ -2599,13 +2643,6 @@ var Function;
2599
2643
  return merged ? [merged, true] : [a, false];
2600
2644
  }
2601
2645
  TaskChunk.mergedList = mergedList;
2602
- TaskChunk.FunctionSchema = zod_1.default
2603
- .lazy(() => Streaming.FunctionExecutionChunkSchema.extend({
2604
- index: Task.IndexSchema,
2605
- task_index: Task.TaskIndexSchema,
2606
- task_path: Task.TaskPathSchema,
2607
- }))
2608
- .describe("A chunk of a function execution task.");
2609
2646
  let Function;
2610
2647
  (function (Function) {
2611
2648
  function merged(a, b) {
@@ -2627,12 +2664,20 @@ var Function;
2627
2664
  }
2628
2665
  Function.merged = merged;
2629
2666
  })(Function = TaskChunk.Function || (TaskChunk.Function = {}));
2630
- TaskChunk.VectorCompletionSchema = Vector.Completions.Response.Streaming.VectorCompletionChunkSchema.extend({
2667
+ TaskChunk.FunctionSchema = zod_1.default
2668
+ .lazy(() => Streaming.FunctionExecutionChunkSchema.extend({
2631
2669
  index: Task.IndexSchema,
2632
2670
  task_index: Task.TaskIndexSchema,
2633
2671
  task_path: Task.TaskPathSchema,
2634
- error: exports.ObjectiveAIErrorSchema.optional().describe("When present, indicates that an error occurred during the vector completion task."),
2635
- }).describe("A chunk of a vector completion task.");
2672
+ tasks: zod_1.default
2673
+ .array(Streaming.TaskChunkSchema)
2674
+ .meta({
2675
+ title: "TaskChunkArray",
2676
+ recursive: true,
2677
+ })
2678
+ .describe("The tasks executed as part of the function execution."),
2679
+ }))
2680
+ .describe("A chunk of a function execution task.");
2636
2681
  let VectorCompletion;
2637
2682
  (function (VectorCompletion) {
2638
2683
  function merged(a, b) {
@@ -2655,7 +2700,57 @@ var Function;
2655
2700
  }
2656
2701
  VectorCompletion.merged = merged;
2657
2702
  })(VectorCompletion = TaskChunk.VectorCompletion || (TaskChunk.VectorCompletion = {}));
2703
+ TaskChunk.VectorCompletionSchema = Vector.Completions.Response.Streaming.VectorCompletionChunkSchema.extend({
2704
+ index: Task.IndexSchema,
2705
+ task_index: Task.TaskIndexSchema,
2706
+ task_path: Task.TaskPathSchema,
2707
+ error: exports.ObjectiveAIErrorSchema.optional().describe("When present, indicates that an error occurred during the vector completion task."),
2708
+ }).describe("A chunk of a vector completion task.");
2658
2709
  })(TaskChunk = Streaming.TaskChunk || (Streaming.TaskChunk = {}));
2710
+ Streaming.TaskChunkSchema = zod_1.default
2711
+ .union([TaskChunk.FunctionSchema, TaskChunk.VectorCompletionSchema])
2712
+ .describe("A chunk of a task execution.");
2713
+ let FunctionExecutionChunk;
2714
+ (function (FunctionExecutionChunk) {
2715
+ function merged(a, b) {
2716
+ const id = a.id;
2717
+ const [tasks, tasksChanged] = TaskChunk.mergedList(a.tasks, b.tasks);
2718
+ const [tasks_errors, tasks_errorsChanged] = merge(a.tasks_errors, b.tasks_errors);
2719
+ const [output, outputChanged] = merge(a.output, b.output);
2720
+ const [error, errorChanged] = merge(a.error, b.error);
2721
+ const [retry_token, retry_tokenChanged] = merge(a.retry_token, b.retry_token);
2722
+ const [function_published, function_publishedChanged] = merge(a.function_published, b.function_published);
2723
+ const [profile_published, profile_publishedChanged] = merge(a.profile_published, b.profile_published);
2724
+ const created = a.created;
2725
+ const function_ = a.function;
2726
+ const profile = a.profile;
2727
+ const object = a.object;
2728
+ const [usage, usageChanged] = merge(a.usage, b.usage);
2729
+ if (tasksChanged ||
2730
+ tasks_errorsChanged ||
2731
+ outputChanged ||
2732
+ errorChanged ||
2733
+ retry_tokenChanged ||
2734
+ function_publishedChanged ||
2735
+ profile_publishedChanged ||
2736
+ usageChanged) {
2737
+ return [
2738
+ Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
2739
+ tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), (function_published !== undefined
2740
+ ? { function_published }
2741
+ : {})), (profile_published !== undefined
2742
+ ? { profile_published }
2743
+ : {})), { created, function: function_, profile,
2744
+ object }), (usage !== undefined ? { usage } : {})),
2745
+ true,
2746
+ ];
2747
+ }
2748
+ else {
2749
+ return [a, false];
2750
+ }
2751
+ }
2752
+ FunctionExecutionChunk.merged = merged;
2753
+ })(FunctionExecutionChunk = Streaming.FunctionExecutionChunk || (Streaming.FunctionExecutionChunk = {}));
2659
2754
  Streaming.FunctionExecutionChunkSchema = zod_1.default
2660
2755
  .object({
2661
2756
  id: zod_1.default
@@ -2713,53 +2808,9 @@ var Function;
2713
2808
  usage: Vector.Completions.Response.UsageSchema.optional(),
2714
2809
  })
2715
2810
  .describe("A chunk of a function execution.");
2716
- let FunctionExecutionChunk;
2717
- (function (FunctionExecutionChunk) {
2718
- function merged(a, b) {
2719
- const id = a.id;
2720
- const [tasks, tasksChanged] = TaskChunk.mergedList(a.tasks, b.tasks);
2721
- const [tasks_errors, tasks_errorsChanged] = merge(a.tasks_errors, b.tasks_errors);
2722
- const [output, outputChanged] = merge(a.output, b.output);
2723
- const [error, errorChanged] = merge(a.error, b.error);
2724
- const [retry_token, retry_tokenChanged] = merge(a.retry_token, b.retry_token);
2725
- const [function_published, function_publishedChanged] = merge(a.function_published, b.function_published);
2726
- const [profile_published, profile_publishedChanged] = merge(a.profile_published, b.profile_published);
2727
- const created = a.created;
2728
- const function_ = a.function;
2729
- const profile = a.profile;
2730
- const object = a.object;
2731
- const [usage, usageChanged] = merge(a.usage, b.usage);
2732
- if (tasksChanged ||
2733
- tasks_errorsChanged ||
2734
- outputChanged ||
2735
- errorChanged ||
2736
- retry_tokenChanged ||
2737
- function_publishedChanged ||
2738
- profile_publishedChanged ||
2739
- usageChanged) {
2740
- return [
2741
- Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
2742
- tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), (function_published !== undefined
2743
- ? { function_published }
2744
- : {})), (profile_published !== undefined
2745
- ? { profile_published }
2746
- : {})), { created, function: function_, profile,
2747
- object }), (usage !== undefined ? { usage } : {})),
2748
- true,
2749
- ];
2750
- }
2751
- else {
2752
- return [a, false];
2753
- }
2754
- }
2755
- FunctionExecutionChunk.merged = merged;
2756
- })(FunctionExecutionChunk = Streaming.FunctionExecutionChunk || (Streaming.FunctionExecutionChunk = {}));
2757
2811
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
2758
2812
  let Unary;
2759
2813
  (function (Unary) {
2760
- Unary.TaskSchema = zod_1.default
2761
- .union([Task.FunctionSchema, Task.VectorCompletionSchema])
2762
- .describe("A task execution.");
2763
2814
  let Task;
2764
2815
  (function (Task) {
2765
2816
  Task.FunctionSchema = zod_1.default
@@ -2767,8 +2818,15 @@ var Function;
2767
2818
  index: Response.Task.IndexSchema,
2768
2819
  task_index: Response.Task.TaskIndexSchema,
2769
2820
  task_path: Response.Task.TaskPathSchema,
2821
+ tasks: zod_1.default
2822
+ .array(Unary.TaskSchema)
2823
+ .meta({
2824
+ title: "TaskArray",
2825
+ recursive: true,
2826
+ })
2827
+ .describe("The tasks executed as part of the function execution."),
2770
2828
  }))
2771
- .describe("A chunk of a function execution task.");
2829
+ .describe("A function execution task.");
2772
2830
  Task.VectorCompletionSchema = Vector.Completions.Response.Unary.VectorCompletionSchema.extend({
2773
2831
  index: Response.Task.IndexSchema,
2774
2832
  task_index: Response.Task.TaskIndexSchema,
@@ -2776,6 +2834,9 @@ var Function;
2776
2834
  error: exports.ObjectiveAIErrorSchema.nullable().describe("When non-null, indicates that an error occurred during the vector completion task."),
2777
2835
  }).describe("A vector completion task.");
2778
2836
  })(Task = Unary.Task || (Unary.Task = {}));
2837
+ Unary.TaskSchema = zod_1.default
2838
+ .union([Task.FunctionSchema, Task.VectorCompletionSchema])
2839
+ .describe("A task execution.");
2779
2840
  Unary.FunctionExecutionSchema = zod_1.default
2780
2841
  .object({
2781
2842
  id: zod_1.default
@@ -2835,21 +2896,8 @@ var Function;
2835
2896
  (function (ComputeProfile) {
2836
2897
  let Request;
2837
2898
  (function (Request) {
2838
- Request.DatasetItemSchema = zod_1.default
2839
- .object({
2840
- input: Function_1.InputSchema_,
2841
- target: DatasetItem.TargetSchema,
2842
- })
2843
- .describe("A Function input and its corresponding target output.");
2844
2899
  let DatasetItem;
2845
2900
  (function (DatasetItem) {
2846
- DatasetItem.TargetSchema = zod_1.default
2847
- .union([
2848
- Target.ScalarSchema,
2849
- Target.VectorSchema,
2850
- Target.VectorWinnerSchema,
2851
- ])
2852
- .describe("The target output for a given function input.");
2853
2901
  let Target;
2854
2902
  (function (Target) {
2855
2903
  Target.ScalarSchema = zod_1.default
@@ -2871,7 +2919,20 @@ var Function;
2871
2919
  })
2872
2920
  .describe("A vector winner target output. The desired output is a vector where the highest value is at the specified index.");
2873
2921
  })(Target = DatasetItem.Target || (DatasetItem.Target = {}));
2922
+ DatasetItem.TargetSchema = zod_1.default
2923
+ .discriminatedUnion("type", [
2924
+ Target.ScalarSchema,
2925
+ Target.VectorSchema,
2926
+ Target.VectorWinnerSchema,
2927
+ ])
2928
+ .describe("The target output for a given function input.");
2874
2929
  })(DatasetItem = Request.DatasetItem || (Request.DatasetItem = {}));
2930
+ Request.DatasetItemSchema = zod_1.default
2931
+ .object({
2932
+ input: Function_1.InputSchema_,
2933
+ target: DatasetItem.TargetSchema,
2934
+ })
2935
+ .describe("A Function input and its corresponding target output.");
2875
2936
  Request.FunctionComputeProfileParamsBaseSchema = zod_1.default
2876
2937
  .object({
2877
2938
  retry_token: zod_1.default
@@ -2900,16 +2961,21 @@ var Function;
2900
2961
  .describe("Base parameters for computing a function profile.");
2901
2962
  Request.FunctionComputeProfileParamsStreamingSchema = Request.FunctionComputeProfileParamsBaseSchema.extend({
2902
2963
  stream: Chat.Completions.Request.StreamTrueSchema,
2903
- }).describe("Parameters for computing a function profile and streaming the response.");
2964
+ })
2965
+ .describe("Parameters for computing a function profile and streaming the response.")
2966
+ .meta({ title: "FunctionComputeProfileParamsStreaming" });
2904
2967
  Request.FunctionComputeProfileParamsNonStreamingSchema = Request.FunctionComputeProfileParamsBaseSchema.extend({
2905
2968
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2906
- }).describe("Parameters for computing a function profile with a unary response.");
2969
+ })
2970
+ .describe("Parameters for computing a function profile with a unary response.")
2971
+ .meta({ title: "FunctionComputeProfileParamsNonStreaming" });
2907
2972
  Request.FunctionComputeProfileParamsSchema = zod_1.default
2908
2973
  .union([
2909
2974
  Request.FunctionComputeProfileParamsStreamingSchema,
2910
2975
  Request.FunctionComputeProfileParamsNonStreamingSchema,
2911
2976
  ])
2912
- .describe("Parameters for computing a function profile.");
2977
+ .describe("Parameters for computing a function profile.")
2978
+ .meta({ title: "FunctionComputeProfileParams" });
2913
2979
  })(Request = ComputeProfile.Request || (ComputeProfile.Request = {}));
2914
2980
  let Response;
2915
2981
  (function (Response) {
@@ -2934,20 +3000,6 @@ var Function;
2934
3000
  .describe("Statistics about the fitting process used to compute the weights for the profile.");
2935
3001
  let Streaming;
2936
3002
  (function (Streaming) {
2937
- Streaming.FunctionExecutionChunkSchema = Executions.Response.Streaming.FunctionExecutionChunkSchema.extend({
2938
- index: zod_1.default
2939
- .uint32()
2940
- .describe("The index of the function execution chunk in the list of executions."),
2941
- dataset: zod_1.default
2942
- .uint32()
2943
- .describe("The index of the dataset item this function execution chunk corresponds to."),
2944
- n: zod_1.default
2945
- .uint32()
2946
- .describe("The N index for this function execution chunk. There will be N function executions, and N comes from the request parameters."),
2947
- retry: zod_1.default
2948
- .uint32()
2949
- .describe("The retry index for this function execution chunk. There may be multiple retries for a given dataset item and N index."),
2950
- }).describe("A chunk of a function execution ran during profile computation.");
2951
3003
  let FunctionExecutionChunk;
2952
3004
  (function (FunctionExecutionChunk) {
2953
3005
  function merged(a, b) {
@@ -2996,33 +3048,20 @@ var Function;
2996
3048
  }
2997
3049
  FunctionExecutionChunk.mergedList = mergedList;
2998
3050
  })(FunctionExecutionChunk = Streaming.FunctionExecutionChunk || (Streaming.FunctionExecutionChunk = {}));
2999
- Streaming.FunctionComputeProfileChunkSchema = zod_1.default
3000
- .object({
3001
- id: zod_1.default
3002
- .string()
3003
- .describe("The unique identifier of the function profile computation chunk."),
3004
- executions: zod_1.default
3005
- .array(Streaming.FunctionExecutionChunkSchema)
3006
- .describe("The function executions performed as part of computing the profile."),
3007
- executions_errors: zod_1.default
3008
- .boolean()
3009
- .optional()
3010
- .describe("When true, indicates that one or more function executions encountered errors during profile computation."),
3011
- profile: zod_1.default
3012
- .array(Function_1.ProfileVersionRequiredSchema)
3013
- .optional()
3014
- .describe("The computed function profile."),
3015
- fitting_stats: Response.FittingStatsSchema.optional(),
3016
- created: zod_1.default
3051
+ Streaming.FunctionExecutionChunkSchema = Executions.Response.Streaming.FunctionExecutionChunkSchema.extend({
3052
+ index: zod_1.default
3017
3053
  .uint32()
3018
- .describe("The UNIX timestamp (in seconds) when the function profile computation was created."),
3019
- function: zod_1.default
3020
- .string()
3021
- .describe("The unique identifier of the function for which the profile is being computed."),
3022
- object: zod_1.default.literal("function.compute.profile.chunk"),
3023
- usage: Vector.Completions.Response.UsageSchema.optional(),
3024
- })
3025
- .describe("A chunk of a function profile computation.");
3054
+ .describe("The index of the function execution chunk in the list of executions."),
3055
+ dataset: zod_1.default
3056
+ .uint32()
3057
+ .describe("The index of the dataset item this function execution chunk corresponds to."),
3058
+ n: zod_1.default
3059
+ .uint32()
3060
+ .describe("The N index for this function execution chunk. There will be N function executions, and N comes from the request parameters."),
3061
+ retry: zod_1.default
3062
+ .uint32()
3063
+ .describe("The retry index for this function execution chunk. There may be multiple retries for a given dataset item and N index."),
3064
+ }).describe("A chunk of a function execution ran during profile computation.");
3026
3065
  let FunctionComputeProfileChunk;
3027
3066
  (function (FunctionComputeProfileChunk) {
3028
3067
  function merged(a, b) {
@@ -3054,6 +3093,33 @@ var Function;
3054
3093
  }
3055
3094
  FunctionComputeProfileChunk.merged = merged;
3056
3095
  })(FunctionComputeProfileChunk = Streaming.FunctionComputeProfileChunk || (Streaming.FunctionComputeProfileChunk = {}));
3096
+ Streaming.FunctionComputeProfileChunkSchema = zod_1.default
3097
+ .object({
3098
+ id: zod_1.default
3099
+ .string()
3100
+ .describe("The unique identifier of the function profile computation chunk."),
3101
+ executions: zod_1.default
3102
+ .array(Streaming.FunctionExecutionChunkSchema)
3103
+ .describe("The function executions performed as part of computing the profile."),
3104
+ executions_errors: zod_1.default
3105
+ .boolean()
3106
+ .optional()
3107
+ .describe("When true, indicates that one or more function executions encountered errors during profile computation."),
3108
+ profile: zod_1.default
3109
+ .array(Function_1.ProfileCommitRequiredSchema)
3110
+ .optional()
3111
+ .describe("The computed function profile."),
3112
+ fitting_stats: Response.FittingStatsSchema.optional(),
3113
+ created: zod_1.default
3114
+ .uint32()
3115
+ .describe("The UNIX timestamp (in seconds) when the function profile computation was created."),
3116
+ function: zod_1.default
3117
+ .string()
3118
+ .describe("The unique identifier of the function for which the profile is being computed."),
3119
+ object: zod_1.default.literal("function.compute.profile.chunk"),
3120
+ usage: Vector.Completions.Response.UsageSchema.optional(),
3121
+ })
3122
+ .describe("A chunk of a function profile computation.");
3057
3123
  })(Streaming = Response.Streaming || (Response.Streaming = {}));
3058
3124
  let Unary;
3059
3125
  (function (Unary) {
@@ -3083,7 +3149,7 @@ var Function;
3083
3149
  .boolean()
3084
3150
  .describe("When true, indicates that one or more function executions encountered errors during profile computation."),
3085
3151
  profile: zod_1.default
3086
- .array(Function_1.ProfileVersionRequiredSchema)
3152
+ .array(Function_1.ProfileCommitRequiredSchema)
3087
3153
  .describe("The computed function profile."),
3088
3154
  fitting_stats: Response.FittingStatsSchema,
3089
3155
  created: zod_1.default
@@ -3102,48 +3168,21 @@ var Function;
3102
3168
  let Profile;
3103
3169
  (function (Profile) {
3104
3170
  Profile.ListItemSchema = zod_1.default.object({
3105
- function_author: zod_1.default
3171
+ owner: zod_1.default
3172
+ .string()
3173
+ .describe("The owner of the GitHub repository containing the profile."),
3174
+ repository: zod_1.default
3106
3175
  .string()
3107
- .describe("The author of the function the profile was published to."),
3108
- function_id: zod_1.default
3176
+ .describe("The name of the GitHub repository containing the profile."),
3177
+ commit: zod_1.default
3109
3178
  .string()
3110
- .describe("The unique identifier of the function the profile was published to."),
3111
- author: zod_1.default.string().describe("The author of the profile."),
3112
- id: zod_1.default.string().describe("The unique identifier of the profile."),
3113
- version: zod_1.default.uint32().describe("The version of the profile."),
3179
+ .describe("The commit SHA of the GitHub repository containing the profile."),
3114
3180
  });
3115
3181
  async function list(openai, options) {
3116
3182
  const response = await openai.get("/functions/profiles", options);
3117
3183
  return response;
3118
3184
  }
3119
3185
  Profile.list = list;
3120
- Profile.RetrieveItemSchema = zod_1.default.object({
3121
- created: zod_1.default
3122
- .uint32()
3123
- .describe("The UNIX timestamp (in seconds) when the profile was created."),
3124
- shape: zod_1.default
3125
- .string()
3126
- .describe("The shape of the profile. Unless Task Skip expressions work out favorably, profiles only work for functions with the same shape."),
3127
- function_author: zod_1.default
3128
- .string()
3129
- .describe("The author of the function the profile was published to."),
3130
- function_id: zod_1.default
3131
- .string()
3132
- .describe("The unique identifier of the function the profile was published to."),
3133
- author: zod_1.default.string().describe("The author of the profile."),
3134
- id: zod_1.default.string().describe("The unique identifier of the profile."),
3135
- version: zod_1.default.uint32().describe("The version of the profile."),
3136
- profile: zod_1.default
3137
- .array(Function.ProfileVersionRequiredSchema)
3138
- .describe("The function profile."),
3139
- });
3140
- async function retrieve(openai, function_author, function_id, author, id, version, options) {
3141
- const response = await openai.get(version !== null && version !== undefined
3142
- ? `/functions/${function_author}/${function_id}/profiles/${author}/${id}/${version}`
3143
- : `/functions/${function_author}/${function_id}/profiles/${author}/${id}`, options);
3144
- return response;
3145
- }
3146
- Profile.retrieve = retrieve;
3147
3186
  Profile.HistoricalUsageSchema = zod_1.default.object({
3148
3187
  requests: zod_1.default
3149
3188
  .uint32()
@@ -3158,85 +3197,102 @@ var Function;
3158
3197
  .number()
3159
3198
  .describe("The total cost incurred by using this Profile."),
3160
3199
  });
3161
- async function retrieveUsage(openai, function_author, function_id, author, id, version, options) {
3162
- const response = await openai.get(version !== null && version !== undefined
3163
- ? `/functions/${function_author}/${function_id}/profiles/${author}/${id}/${version}/usage`
3164
- : `/functions/${function_author}/${function_id}/profiles/${author}/${id}/usage`, options);
3200
+ async function retrieveUsage(openai, powner, prepository, pcommit, options) {
3201
+ const response = await openai.get(pcommit !== null && pcommit !== undefined
3202
+ ? `/functions/profiles/${powner}/${prepository}/${pcommit}/usage`
3203
+ : `/functions/profiles/${powner}/${prepository}/usage`, options);
3165
3204
  return response;
3166
3205
  }
3167
3206
  Profile.retrieveUsage = retrieveUsage;
3168
3207
  })(Profile = Function_1.Profile || (Function_1.Profile = {}));
3169
- async function executeInline(openai, body, options) {
3208
+ async function executeInlineFunctionInlineProfile(openai, body, options) {
3170
3209
  var _a;
3171
3210
  const response = await openai.post("/functions", Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3172
3211
  return response;
3173
3212
  }
3174
- Function_1.executeInline = executeInline;
3175
- async function execute(openai, author, id, version, body, options) {
3213
+ Function_1.executeInlineFunctionInlineProfile = executeInlineFunctionInlineProfile;
3214
+ async function executeRemoteFunctionInlineProfile(openai, fowner, frepository, fcommit, body, options) {
3176
3215
  var _a;
3177
- const response = await openai.post(version !== null && version !== undefined
3178
- ? `/functions/${author}/${id}/${version}`
3179
- : `/functions/${author}/${id}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3216
+ const response = await openai.post(fcommit !== null && fcommit !== undefined
3217
+ ? `/functions/${fowner}/${frepository}/${fcommit}`
3218
+ : `/functions/${fowner}/${frepository}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3180
3219
  return response;
3181
3220
  }
3182
- Function_1.execute = execute;
3183
- async function publishFunction(openai, author, id, version, body, options) {
3221
+ Function_1.executeRemoteFunctionInlineProfile = executeRemoteFunctionInlineProfile;
3222
+ async function executeInlineFunctionRemoteProfile(openai, powner, prepository, pcommit, body, options) {
3184
3223
  var _a;
3185
- const response = await openai.post(`/functions/${author}/${id}/${version}/publish`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3224
+ const response = await openai.post(pcommit !== null && pcommit !== undefined
3225
+ ? `/functions/profiles/${powner}/${prepository}/${pcommit}`
3226
+ : `/functions/profiles/${powner}/${prepository}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3186
3227
  return response;
3187
3228
  }
3188
- Function_1.publishFunction = publishFunction;
3189
- async function publishProfile(openai, function_author, function_id, body, options) {
3229
+ Function_1.executeInlineFunctionRemoteProfile = executeInlineFunctionRemoteProfile;
3230
+ async function executeRemoteFunctionRemoteProfile(openai, fowner, frepository, fcommit, powner, prepository, pcommit, body, options) {
3190
3231
  var _a;
3191
- const response = await openai.post(`/functions/${function_author}/${function_id}/profiles/publish`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3232
+ let url;
3233
+ if (fcommit !== null && fcommit !== undefined) {
3234
+ if (pcommit !== null && pcommit !== undefined) {
3235
+ url = `/functions/${fowner}/${frepository}/${fcommit}/profiles/${powner}/${prepository}/${pcommit}`;
3236
+ }
3237
+ else {
3238
+ url = `/functions/${fowner}/${frepository}/${fcommit}/profiles/${powner}/${prepository}`;
3239
+ }
3240
+ }
3241
+ else if (pcommit !== null && pcommit !== undefined) {
3242
+ url = `/functions/${fowner}/${frepository}/profiles/${powner}/${prepository}/${pcommit}`;
3243
+ }
3244
+ else {
3245
+ url = `/functions/${fowner}/${frepository}/profiles/${powner}/${prepository}`;
3246
+ }
3247
+ const response = await openai.post(url, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3192
3248
  return response;
3193
3249
  }
3194
- Function_1.publishProfile = publishProfile;
3195
- async function computeProfile(openai, author, id, version, body, options) {
3250
+ Function_1.executeRemoteFunctionRemoteProfile = executeRemoteFunctionRemoteProfile;
3251
+ async function execute(openai, function_, profile, body, options) {
3252
+ if ("owner" in function_ && "repository" in function_) {
3253
+ if ("owner" in profile && "repository" in profile) {
3254
+ const requestBody = body;
3255
+ return executeRemoteFunctionRemoteProfile(openai, function_.owner, function_.repository, function_.commit, profile.owner, profile.repository, profile.commit, requestBody, options);
3256
+ }
3257
+ else {
3258
+ const requestBody = Object.assign(Object.assign({}, body), { profile });
3259
+ return executeRemoteFunctionInlineProfile(openai, function_.owner, function_.repository, function_.commit, requestBody, options);
3260
+ }
3261
+ }
3262
+ else if ("owner" in profile && "repository" in profile) {
3263
+ const requestBody = Object.assign(Object.assign({}, body), { function: function_ });
3264
+ return executeInlineFunctionRemoteProfile(openai, profile.owner, profile.repository, profile.commit, requestBody, options);
3265
+ }
3266
+ else {
3267
+ const requestBody = Object.assign(Object.assign({}, body), { function: function_, profile });
3268
+ return executeInlineFunctionInlineProfile(openai, requestBody, options);
3269
+ }
3270
+ }
3271
+ Function_1.execute = execute;
3272
+ async function computeProfile(openai, fowner, frepository, fcommit, body, options) {
3196
3273
  var _a;
3197
- const response = await openai.post(version !== null && version !== undefined
3198
- ? `/functions/${author}/${id}/${version}/profiles/compute`
3199
- : `/functions/${author}/${id}/profiles/compute`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3274
+ const response = await openai.post(fcommit !== null && fcommit !== undefined
3275
+ ? `/functions/${fowner}/${frepository}/${fcommit}/profiles/compute`
3276
+ : `/functions/${fowner}/${frepository}/profiles/compute`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3200
3277
  return response;
3201
3278
  }
3202
3279
  Function_1.computeProfile = computeProfile;
3203
3280
  Function_1.ListItemSchema = zod_1.default.object({
3204
- author: zod_1.default.string().describe("The author of the function."),
3205
- id: zod_1.default.string().describe("The unique identifier of the function."),
3206
- version: zod_1.default.uint32().describe("The version of the function."),
3281
+ owner: zod_1.default
3282
+ .string()
3283
+ .describe("The owner of the GitHub repository containing the function."),
3284
+ repository: zod_1.default
3285
+ .string()
3286
+ .describe("The name of the GitHub repository containing the function."),
3287
+ commit: zod_1.default
3288
+ .string()
3289
+ .describe("The commit SHA of the GitHub repository containing the function."),
3207
3290
  });
3208
3291
  async function list(openai, options) {
3209
3292
  const response = await openai.get("/functions", options);
3210
3293
  return response;
3211
3294
  }
3212
3295
  Function_1.list = list;
3213
- Function_1.ScalarRetrieveItemSchema = Function_1.ScalarSchema.extend({
3214
- created: zod_1.default
3215
- .uint32()
3216
- .describe("The UNIX timestamp (in seconds) when the function was created."),
3217
- shape: zod_1.default
3218
- .string()
3219
- .describe("The shape of the function. Unless Task Skip expressions work out favorably, functions only work with profiles that have the same shape."),
3220
- });
3221
- Function_1.VectorRetrieveItemSchema = Function_1.VectorSchema.extend({
3222
- created: zod_1.default
3223
- .uint32()
3224
- .describe("The UNIX timestamp (in seconds) when the function was created."),
3225
- shape: zod_1.default
3226
- .string()
3227
- .describe("The shape of the function. Unless Task Skip expressions work out favorably, functions only work with profiles that have the same shape."),
3228
- });
3229
- Function_1.RetrieveItemSchema = zod_1.default.discriminatedUnion("type", [
3230
- Function_1.ScalarRetrieveItemSchema,
3231
- Function_1.VectorRetrieveItemSchema,
3232
- ]);
3233
- async function retrieve(openai, author, id, version, options) {
3234
- const response = await openai.get(version !== null && version !== undefined
3235
- ? `/functions/${author}/${id}/${version}`
3236
- : `/functions/${author}/${id}`, options);
3237
- return response;
3238
- }
3239
- Function_1.retrieve = retrieve;
3240
3296
  Function_1.HistoricalUsageSchema = zod_1.default.object({
3241
3297
  requests: zod_1.default
3242
3298
  .uint32()
@@ -3251,14 +3307,17 @@ var Function;
3251
3307
  .number()
3252
3308
  .describe("The total cost incurred by using this Function."),
3253
3309
  });
3254
- async function retrieveUsage(openai, author, id, version, options) {
3255
- const response = await openai.get(version !== null && version !== undefined
3256
- ? `/functions/${author}/${id}/${version}/usage`
3257
- : `/functions/${author}/${id}/usage`, options);
3310
+ async function retrieveUsage(openai, fowner, frepository, fcommit, options) {
3311
+ const response = await openai.get(fcommit !== null && fcommit !== undefined
3312
+ ? `/functions/${fowner}/${frepository}/${fcommit}/usage`
3313
+ : `/functions/${fowner}/${frepository}/usage`, options);
3258
3314
  return response;
3259
3315
  }
3260
3316
  Function_1.retrieveUsage = retrieveUsage;
3261
3317
  })(Function || (exports.Function = Function = {}));
3318
+ exports.FunctionSchema = zod_1.default
3319
+ .discriminatedUnion("type", [Function.ScalarSchema, Function.VectorSchema])
3320
+ .describe("A function.");
3262
3321
  var Auth;
3263
3322
  (function (Auth) {
3264
3323
  Auth.ApiKeySchema = zod_1.default.object({