@adaline/openai 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3,497 +3,7 @@ import { z } from 'zod';
3
3
  import { ChatModelSchemaType, ChatModelV1, UrlType, HeadersType, ParamsType, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderV1 } from '@adaline/provider';
4
4
  import { MessageType, ConfigType, ToolType, ChatResponseType, PartialChatResponseType, EmbeddingRequestsType, EmbeddingResponseType } from '@adaline/types';
5
5
 
6
- declare const temperature: {
7
- def: {
8
- type: "range";
9
- param: string;
10
- title: string;
11
- description: string;
12
- max: number;
13
- min: number;
14
- step: number;
15
- default: number;
16
- };
17
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
18
- };
19
- declare const maxTokens: (maxOutputTokens: number) => {
20
- def: {
21
- type: "range";
22
- param: string;
23
- title: string;
24
- description: string;
25
- max: number;
26
- min: number;
27
- step: number;
28
- default: number;
29
- };
30
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
31
- };
32
- declare const stop: (maxSequences: number) => {
33
- def: {
34
- type: "multi-string";
35
- param: string;
36
- title: string;
37
- description: string;
38
- max: number;
39
- };
40
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
41
- };
42
- declare const topP: {
43
- def: {
44
- type: "range";
45
- param: string;
46
- title: string;
47
- description: string;
48
- max: number;
49
- min: number;
50
- step: number;
51
- default: number;
52
- };
53
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
54
- };
55
- declare const frequencyPenalty: {
56
- def: {
57
- type: "range";
58
- param: string;
59
- title: string;
60
- description: string;
61
- max: number;
62
- min: number;
63
- step: number;
64
- default: number;
65
- };
66
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
67
- };
68
- declare const presencePenalty: {
69
- def: {
70
- type: "range";
71
- param: string;
72
- title: string;
73
- description: string;
74
- max: number;
75
- min: number;
76
- step: number;
77
- default: number;
78
- };
79
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
80
- };
81
- declare const seed: {
82
- def: {
83
- type: "range";
84
- param: string;
85
- title: string;
86
- description: string;
87
- max: number;
88
- min: number;
89
- step: number;
90
- default: number;
91
- };
92
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
93
- };
94
- declare const logProbs: {
95
- def: {
96
- type: "select-boolean";
97
- param: string;
98
- title: string;
99
- description: string;
100
- default: boolean | null;
101
- };
102
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
103
- };
104
- declare const topLogProbs: {
105
- def: {
106
- type: "range";
107
- param: string;
108
- title: string;
109
- description: string;
110
- max: number;
111
- min: number;
112
- step: number;
113
- default: number;
114
- };
115
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
116
- };
117
- declare const responseFormat: {
118
- def: {
119
- type: "select-string";
120
- param: string;
121
- title: string;
122
- description: string;
123
- default: string;
124
- choices: string[];
125
- };
126
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
127
- };
128
- declare const toolChoice: {
129
- def: {
130
- type: "select-string";
131
- param: string;
132
- title: string;
133
- description: string;
134
- default: string;
135
- choices: string[];
136
- };
137
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
138
- };
139
-
140
- declare const BaseConfigSchema: (maxOutputTokens: number, maxSequences: number) => z.ZodObject<{
141
- temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
142
- maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
143
- stop: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
144
- topP: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
145
- frequencyPenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
146
- presencePenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
147
- seed: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodNumber>>, number | undefined, number | undefined>;
148
- logProbs: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodBoolean>>>;
149
- topLogProbs: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
150
- responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
151
- toolChoice: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
152
- }, "strip", z.ZodTypeAny, {
153
- temperature?: number | undefined;
154
- seed?: number | undefined;
155
- stop?: string[] | undefined;
156
- maxTokens?: number | undefined;
157
- topP?: number | undefined;
158
- frequencyPenalty?: number | undefined;
159
- presencePenalty?: number | undefined;
160
- logProbs?: boolean | null | undefined;
161
- topLogProbs?: number | undefined;
162
- responseFormat?: string | undefined;
163
- toolChoice?: string | undefined;
164
- }, {
165
- temperature?: number | undefined;
166
- seed?: number | undefined;
167
- stop?: string[] | undefined;
168
- maxTokens?: number | undefined;
169
- topP?: number | undefined;
170
- frequencyPenalty?: number | undefined;
171
- presencePenalty?: number | undefined;
172
- logProbs?: boolean | null | undefined;
173
- topLogProbs?: number | undefined;
174
- responseFormat?: string | undefined;
175
- toolChoice?: string | undefined;
176
- }>;
177
- declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) => {
178
- readonly temperature: {
179
- type: "range";
180
- param: string;
181
- title: string;
182
- description: string;
183
- max: number;
184
- min: number;
185
- step: number;
186
- default: number;
187
- };
188
- readonly maxTokens: {
189
- type: "range";
190
- param: string;
191
- title: string;
192
- description: string;
193
- max: number;
194
- min: number;
195
- step: number;
196
- default: number;
197
- };
198
- readonly stop: {
199
- type: "multi-string";
200
- param: string;
201
- title: string;
202
- description: string;
203
- max: number;
204
- };
205
- readonly topP: {
206
- type: "range";
207
- param: string;
208
- title: string;
209
- description: string;
210
- max: number;
211
- min: number;
212
- step: number;
213
- default: number;
214
- };
215
- readonly frequencyPenalty: {
216
- type: "range";
217
- param: string;
218
- title: string;
219
- description: string;
220
- max: number;
221
- min: number;
222
- step: number;
223
- default: number;
224
- };
225
- readonly presencePenalty: {
226
- type: "range";
227
- param: string;
228
- title: string;
229
- description: string;
230
- max: number;
231
- min: number;
232
- step: number;
233
- default: number;
234
- };
235
- readonly seed: {
236
- type: "range";
237
- param: string;
238
- title: string;
239
- description: string;
240
- max: number;
241
- min: number;
242
- step: number;
243
- default: number;
244
- };
245
- readonly responseFormat: {
246
- type: "select-string";
247
- param: string;
248
- title: string;
249
- description: string;
250
- default: string;
251
- choices: string[];
252
- };
253
- readonly logProbs: {
254
- type: "select-boolean";
255
- param: string;
256
- title: string;
257
- description: string;
258
- default: boolean | null;
259
- };
260
- readonly topLogProbs: {
261
- type: "range";
262
- param: string;
263
- title: string;
264
- description: string;
265
- max: number;
266
- min: number;
267
- step: number;
268
- default: number;
269
- };
270
- readonly toolChoice: {
271
- type: "select-string";
272
- param: string;
273
- title: string;
274
- description: string;
275
- default: string;
276
- choices: string[];
277
- };
278
- };
279
-
280
- declare const ResponseSchemaConfigDef: (maxOutputTokens: number, maxSequences: number) => {
281
- responseFormat: {
282
- type: "select-string";
283
- param: string;
284
- title: string;
285
- description: string;
286
- default: string;
287
- choices: string[];
288
- };
289
- responseSchema: {
290
- type: "object-schema";
291
- param: string;
292
- title: string;
293
- description: string;
294
- objectSchema?: any;
295
- };
296
- temperature: {
297
- type: "range";
298
- param: string;
299
- title: string;
300
- description: string;
301
- max: number;
302
- min: number;
303
- step: number;
304
- default: number;
305
- };
306
- maxTokens: {
307
- type: "range";
308
- param: string;
309
- title: string;
310
- description: string;
311
- max: number;
312
- min: number;
313
- step: number;
314
- default: number;
315
- };
316
- stop: {
317
- type: "multi-string";
318
- param: string;
319
- title: string;
320
- description: string;
321
- max: number;
322
- };
323
- topP: {
324
- type: "range";
325
- param: string;
326
- title: string;
327
- description: string;
328
- max: number;
329
- min: number;
330
- step: number;
331
- default: number;
332
- };
333
- frequencyPenalty: {
334
- type: "range";
335
- param: string;
336
- title: string;
337
- description: string;
338
- max: number;
339
- min: number;
340
- step: number;
341
- default: number;
342
- };
343
- presencePenalty: {
344
- type: "range";
345
- param: string;
346
- title: string;
347
- description: string;
348
- max: number;
349
- min: number;
350
- step: number;
351
- default: number;
352
- };
353
- seed: {
354
- type: "range";
355
- param: string;
356
- title: string;
357
- description: string;
358
- max: number;
359
- min: number;
360
- step: number;
361
- default: number;
362
- };
363
- logProbs: {
364
- type: "select-boolean";
365
- param: string;
366
- title: string;
367
- description: string;
368
- default: boolean | null;
369
- };
370
- topLogProbs: {
371
- type: "range";
372
- param: string;
373
- title: string;
374
- description: string;
375
- max: number;
376
- min: number;
377
- step: number;
378
- default: number;
379
- };
380
- toolChoice: {
381
- type: "select-string";
382
- param: string;
383
- title: string;
384
- description: string;
385
- default: string;
386
- choices: string[];
387
- };
388
- };
389
- declare const ResponseSchemaConfigSchema: (maxOutputTokens: number, maxSequences: number) => z.ZodObject<z.objectUtil.extendShape<{
390
- temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
391
- maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
392
- stop: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
393
- topP: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
394
- frequencyPenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
395
- presencePenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
396
- seed: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodNumber>>, number | undefined, number | undefined>;
397
- logProbs: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodBoolean>>>;
398
- topLogProbs: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
399
- responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
400
- toolChoice: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
401
- }, {
402
- responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
403
- responseSchema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, {
404
- [x: string]: any;
405
- }, {
406
- [x: string]: any;
407
- }>;
408
- }>, "strip", z.ZodTypeAny, {
409
- responseSchema: {
410
- [x: string]: any;
411
- };
412
- temperature?: number | undefined;
413
- seed?: number | undefined;
414
- stop?: string[] | undefined;
415
- maxTokens?: number | undefined;
416
- topP?: number | undefined;
417
- frequencyPenalty?: number | undefined;
418
- presencePenalty?: number | undefined;
419
- logProbs?: boolean | null | undefined;
420
- topLogProbs?: number | undefined;
421
- responseFormat?: string | undefined;
422
- toolChoice?: string | undefined;
423
- }, {
424
- responseSchema: {
425
- [x: string]: any;
426
- };
427
- temperature?: number | undefined;
428
- seed?: number | undefined;
429
- stop?: string[] | undefined;
430
- maxTokens?: number | undefined;
431
- topP?: number | undefined;
432
- frequencyPenalty?: number | undefined;
433
- presencePenalty?: number | undefined;
434
- logProbs?: boolean | null | undefined;
435
- topLogProbs?: number | undefined;
436
- responseFormat?: string | undefined;
437
- toolChoice?: string | undefined;
438
- }>;
439
-
440
- declare const BaseWordEmbeddingConfigSchema: () => z.ZodObject<{
441
- encodingFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
442
- dimensions: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
443
- }, "strip", z.ZodTypeAny, {
444
- dimensions?: number | undefined;
445
- encodingFormat?: string | undefined;
446
- }, {
447
- dimensions?: number | undefined;
448
- encodingFormat?: string | undefined;
449
- }>;
450
- declare const BaseWordEmbeddingConfigDef: () => {
451
- readonly encodingFormat: {
452
- type: "select-string";
453
- param: string;
454
- title: string;
455
- description: string;
456
- default: string;
457
- choices: string[];
458
- };
459
- readonly dimensions: {
460
- type: "range";
461
- param: string;
462
- title: string;
463
- description: string;
464
- max: number;
465
- min: number;
466
- step: number;
467
- default: number;
468
- };
469
- };
470
-
471
- declare const encodingFormat: {
472
- def: {
473
- type: "select-string";
474
- param: string;
475
- title: string;
476
- description: string;
477
- default: string;
478
- choices: string[];
479
- };
480
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
481
- };
482
- declare const dimensions: {
483
- def: {
484
- type: "range";
485
- param: string;
486
- title: string;
487
- description: string;
488
- max: number;
489
- min: number;
490
- step: number;
491
- default: number;
492
- };
493
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
494
- };
495
-
496
- declare const OpenAIConfigs: {
6
+ declare const OpenAIChatModelConfigs: {
497
7
  readonly base: (maxOutputTokens: number, maxSequences: number) => {
498
8
  def: {
499
9
  readonly temperature: {
@@ -783,53 +293,543 @@ declare const OpenAIConfigs: {
783
293
  responseSchema: {
784
294
  [x: string]: any;
785
295
  };
786
- temperature?: number | undefined;
787
- seed?: number | undefined;
788
- stop?: string[] | undefined;
789
- maxTokens?: number | undefined;
790
- topP?: number | undefined;
791
- frequencyPenalty?: number | undefined;
792
- presencePenalty?: number | undefined;
793
- logProbs?: boolean | null | undefined;
794
- topLogProbs?: number | undefined;
795
- responseFormat?: string | undefined;
796
- toolChoice?: string | undefined;
296
+ temperature?: number | undefined;
297
+ seed?: number | undefined;
298
+ stop?: string[] | undefined;
299
+ maxTokens?: number | undefined;
300
+ topP?: number | undefined;
301
+ frequencyPenalty?: number | undefined;
302
+ presencePenalty?: number | undefined;
303
+ logProbs?: boolean | null | undefined;
304
+ topLogProbs?: number | undefined;
305
+ responseFormat?: string | undefined;
306
+ toolChoice?: string | undefined;
307
+ }>;
308
+ };
309
+ };
310
+ declare const OpenAIEmbeddingModelConfigs: {
311
+ readonly base: () => {
312
+ def: {
313
+ readonly encodingFormat: {
314
+ type: "select-string";
315
+ param: string;
316
+ title: string;
317
+ description: string;
318
+ default: string;
319
+ choices: string[];
320
+ };
321
+ readonly dimensions: {
322
+ type: "range";
323
+ param: string;
324
+ title: string;
325
+ description: string;
326
+ max: number;
327
+ min: number;
328
+ step: number;
329
+ default: number;
330
+ };
331
+ };
332
+ schema: zod.ZodObject<{
333
+ encodingFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
334
+ dimensions: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
335
+ }, "strip", zod.ZodTypeAny, {
336
+ dimensions?: number | undefined;
337
+ encodingFormat?: string | undefined;
338
+ }, {
339
+ dimensions?: number | undefined;
340
+ encodingFormat?: string | undefined;
797
341
  }>;
798
342
  };
799
343
  };
800
- declare const OpenAIWordEmbeddingConfigs: {
801
- readonly base: () => {
802
- def: {
803
- readonly encodingFormat: {
804
- type: "select-string";
805
- param: string;
806
- title: string;
807
- description: string;
808
- default: string;
809
- choices: string[];
810
- };
811
- readonly dimensions: {
812
- type: "range";
813
- param: string;
814
- title: string;
815
- description: string;
816
- max: number;
817
- min: number;
818
- step: number;
819
- default: number;
820
- };
821
- };
822
- schema: zod.ZodObject<{
823
- encodingFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
824
- dimensions: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
825
- }, "strip", zod.ZodTypeAny, {
826
- dimensions?: number | undefined;
827
- encodingFormat?: string | undefined;
828
- }, {
829
- dimensions?: number | undefined;
830
- encodingFormat?: string | undefined;
831
- }>;
344
+
345
+ declare const ChatModelBaseConfigSchema: (maxOutputTokens: number, maxSequences: number) => z.ZodObject<{
346
+ temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
347
+ maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
348
+ stop: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
349
+ topP: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
350
+ frequencyPenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
351
+ presencePenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
352
+ seed: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodNumber>>, number | undefined, number | undefined>;
353
+ logProbs: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodBoolean>>>;
354
+ topLogProbs: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
355
+ responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
356
+ toolChoice: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
357
+ }, "strip", z.ZodTypeAny, {
358
+ temperature?: number | undefined;
359
+ seed?: number | undefined;
360
+ stop?: string[] | undefined;
361
+ maxTokens?: number | undefined;
362
+ topP?: number | undefined;
363
+ frequencyPenalty?: number | undefined;
364
+ presencePenalty?: number | undefined;
365
+ logProbs?: boolean | null | undefined;
366
+ topLogProbs?: number | undefined;
367
+ responseFormat?: string | undefined;
368
+ toolChoice?: string | undefined;
369
+ }, {
370
+ temperature?: number | undefined;
371
+ seed?: number | undefined;
372
+ stop?: string[] | undefined;
373
+ maxTokens?: number | undefined;
374
+ topP?: number | undefined;
375
+ frequencyPenalty?: number | undefined;
376
+ presencePenalty?: number | undefined;
377
+ logProbs?: boolean | null | undefined;
378
+ topLogProbs?: number | undefined;
379
+ responseFormat?: string | undefined;
380
+ toolChoice?: string | undefined;
381
+ }>;
382
+ declare const ChatModelBaseConfigDef: (maxOutputTokens: number, maxSequences: number) => {
383
+ readonly temperature: {
384
+ type: "range";
385
+ param: string;
386
+ title: string;
387
+ description: string;
388
+ max: number;
389
+ min: number;
390
+ step: number;
391
+ default: number;
392
+ };
393
+ readonly maxTokens: {
394
+ type: "range";
395
+ param: string;
396
+ title: string;
397
+ description: string;
398
+ max: number;
399
+ min: number;
400
+ step: number;
401
+ default: number;
402
+ };
403
+ readonly stop: {
404
+ type: "multi-string";
405
+ param: string;
406
+ title: string;
407
+ description: string;
408
+ max: number;
409
+ };
410
+ readonly topP: {
411
+ type: "range";
412
+ param: string;
413
+ title: string;
414
+ description: string;
415
+ max: number;
416
+ min: number;
417
+ step: number;
418
+ default: number;
419
+ };
420
+ readonly frequencyPenalty: {
421
+ type: "range";
422
+ param: string;
423
+ title: string;
424
+ description: string;
425
+ max: number;
426
+ min: number;
427
+ step: number;
428
+ default: number;
429
+ };
430
+ readonly presencePenalty: {
431
+ type: "range";
432
+ param: string;
433
+ title: string;
434
+ description: string;
435
+ max: number;
436
+ min: number;
437
+ step: number;
438
+ default: number;
439
+ };
440
+ readonly seed: {
441
+ type: "range";
442
+ param: string;
443
+ title: string;
444
+ description: string;
445
+ max: number;
446
+ min: number;
447
+ step: number;
448
+ default: number;
449
+ };
450
+ readonly responseFormat: {
451
+ type: "select-string";
452
+ param: string;
453
+ title: string;
454
+ description: string;
455
+ default: string;
456
+ choices: string[];
457
+ };
458
+ readonly logProbs: {
459
+ type: "select-boolean";
460
+ param: string;
461
+ title: string;
462
+ description: string;
463
+ default: boolean | null;
464
+ };
465
+ readonly topLogProbs: {
466
+ type: "range";
467
+ param: string;
468
+ title: string;
469
+ description: string;
470
+ max: number;
471
+ min: number;
472
+ step: number;
473
+ default: number;
474
+ };
475
+ readonly toolChoice: {
476
+ type: "select-string";
477
+ param: string;
478
+ title: string;
479
+ description: string;
480
+ default: string;
481
+ choices: string[];
482
+ };
483
+ };
484
+
485
+ declare const temperature: {
486
+ def: {
487
+ type: "range";
488
+ param: string;
489
+ title: string;
490
+ description: string;
491
+ max: number;
492
+ min: number;
493
+ step: number;
494
+ default: number;
495
+ };
496
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
497
+ };
498
+ declare const maxTokens: (maxOutputTokens: number) => {
499
+ def: {
500
+ type: "range";
501
+ param: string;
502
+ title: string;
503
+ description: string;
504
+ max: number;
505
+ min: number;
506
+ step: number;
507
+ default: number;
508
+ };
509
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
510
+ };
511
+ declare const stop: (maxSequences: number) => {
512
+ def: {
513
+ type: "multi-string";
514
+ param: string;
515
+ title: string;
516
+ description: string;
517
+ max: number;
518
+ };
519
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
520
+ };
521
+ declare const topP: {
522
+ def: {
523
+ type: "range";
524
+ param: string;
525
+ title: string;
526
+ description: string;
527
+ max: number;
528
+ min: number;
529
+ step: number;
530
+ default: number;
531
+ };
532
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
533
+ };
534
+ declare const frequencyPenalty: {
535
+ def: {
536
+ type: "range";
537
+ param: string;
538
+ title: string;
539
+ description: string;
540
+ max: number;
541
+ min: number;
542
+ step: number;
543
+ default: number;
544
+ };
545
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
546
+ };
547
+ declare const presencePenalty: {
548
+ def: {
549
+ type: "range";
550
+ param: string;
551
+ title: string;
552
+ description: string;
553
+ max: number;
554
+ min: number;
555
+ step: number;
556
+ default: number;
557
+ };
558
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
559
+ };
560
+ declare const seed: {
561
+ def: {
562
+ type: "range";
563
+ param: string;
564
+ title: string;
565
+ description: string;
566
+ max: number;
567
+ min: number;
568
+ step: number;
569
+ default: number;
570
+ };
571
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
572
+ };
573
+ declare const logProbs: {
574
+ def: {
575
+ type: "select-boolean";
576
+ param: string;
577
+ title: string;
578
+ description: string;
579
+ default: boolean | null;
580
+ };
581
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
582
+ };
583
+ declare const topLogProbs: {
584
+ def: {
585
+ type: "range";
586
+ param: string;
587
+ title: string;
588
+ description: string;
589
+ max: number;
590
+ min: number;
591
+ step: number;
592
+ default: number;
593
+ };
594
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
595
+ };
596
+ declare const responseFormat: {
597
+ def: {
598
+ type: "select-string";
599
+ param: string;
600
+ title: string;
601
+ description: string;
602
+ default: string;
603
+ choices: string[];
604
+ };
605
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
606
+ };
607
+ declare const toolChoice: {
608
+ def: {
609
+ type: "select-string";
610
+ param: string;
611
+ title: string;
612
+ description: string;
613
+ default: string;
614
+ choices: string[];
615
+ };
616
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
617
+ };
618
+
619
+ declare const ChatModelResponseSchemaConfigDef: (maxOutputTokens: number, maxSequences: number) => {
620
+ responseFormat: {
621
+ type: "select-string";
622
+ param: string;
623
+ title: string;
624
+ description: string;
625
+ default: string;
626
+ choices: string[];
627
+ };
628
+ responseSchema: {
629
+ type: "object-schema";
630
+ param: string;
631
+ title: string;
632
+ description: string;
633
+ objectSchema?: any;
634
+ };
635
+ temperature: {
636
+ type: "range";
637
+ param: string;
638
+ title: string;
639
+ description: string;
640
+ max: number;
641
+ min: number;
642
+ step: number;
643
+ default: number;
644
+ };
645
+ maxTokens: {
646
+ type: "range";
647
+ param: string;
648
+ title: string;
649
+ description: string;
650
+ max: number;
651
+ min: number;
652
+ step: number;
653
+ default: number;
654
+ };
655
+ stop: {
656
+ type: "multi-string";
657
+ param: string;
658
+ title: string;
659
+ description: string;
660
+ max: number;
661
+ };
662
+ topP: {
663
+ type: "range";
664
+ param: string;
665
+ title: string;
666
+ description: string;
667
+ max: number;
668
+ min: number;
669
+ step: number;
670
+ default: number;
671
+ };
672
+ frequencyPenalty: {
673
+ type: "range";
674
+ param: string;
675
+ title: string;
676
+ description: string;
677
+ max: number;
678
+ min: number;
679
+ step: number;
680
+ default: number;
681
+ };
682
+ presencePenalty: {
683
+ type: "range";
684
+ param: string;
685
+ title: string;
686
+ description: string;
687
+ max: number;
688
+ min: number;
689
+ step: number;
690
+ default: number;
691
+ };
692
+ seed: {
693
+ type: "range";
694
+ param: string;
695
+ title: string;
696
+ description: string;
697
+ max: number;
698
+ min: number;
699
+ step: number;
700
+ default: number;
701
+ };
702
+ logProbs: {
703
+ type: "select-boolean";
704
+ param: string;
705
+ title: string;
706
+ description: string;
707
+ default: boolean | null;
708
+ };
709
+ topLogProbs: {
710
+ type: "range";
711
+ param: string;
712
+ title: string;
713
+ description: string;
714
+ max: number;
715
+ min: number;
716
+ step: number;
717
+ default: number;
718
+ };
719
+ toolChoice: {
720
+ type: "select-string";
721
+ param: string;
722
+ title: string;
723
+ description: string;
724
+ default: string;
725
+ choices: string[];
726
+ };
727
+ };
728
+ declare const ChatModelResponseSchemaConfigSchema: (maxOutputTokens: number, maxSequences: number) => z.ZodObject<z.objectUtil.extendShape<{
729
+ temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
730
+ maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
731
+ stop: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
732
+ topP: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
733
+ frequencyPenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
734
+ presencePenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
735
+ seed: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodNumber>>, number | undefined, number | undefined>;
736
+ logProbs: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodBoolean>>>;
737
+ topLogProbs: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
738
+ responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
739
+ toolChoice: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
740
+ }, {
741
+ responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
742
+ responseSchema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, {
743
+ [x: string]: any;
744
+ }, {
745
+ [x: string]: any;
746
+ }>;
747
+ }>, "strip", z.ZodTypeAny, {
748
+ responseSchema: {
749
+ [x: string]: any;
750
+ };
751
+ temperature?: number | undefined;
752
+ seed?: number | undefined;
753
+ stop?: string[] | undefined;
754
+ maxTokens?: number | undefined;
755
+ topP?: number | undefined;
756
+ frequencyPenalty?: number | undefined;
757
+ presencePenalty?: number | undefined;
758
+ logProbs?: boolean | null | undefined;
759
+ topLogProbs?: number | undefined;
760
+ responseFormat?: string | undefined;
761
+ toolChoice?: string | undefined;
762
+ }, {
763
+ responseSchema: {
764
+ [x: string]: any;
765
+ };
766
+ temperature?: number | undefined;
767
+ seed?: number | undefined;
768
+ stop?: string[] | undefined;
769
+ maxTokens?: number | undefined;
770
+ topP?: number | undefined;
771
+ frequencyPenalty?: number | undefined;
772
+ presencePenalty?: number | undefined;
773
+ logProbs?: boolean | null | undefined;
774
+ topLogProbs?: number | undefined;
775
+ responseFormat?: string | undefined;
776
+ toolChoice?: string | undefined;
777
+ }>;
778
+
779
+ declare const EmbeddingModelBaseConfigSchema: () => z.ZodObject<{
780
+ encodingFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
781
+ dimensions: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
782
+ }, "strip", z.ZodTypeAny, {
783
+ dimensions?: number | undefined;
784
+ encodingFormat?: string | undefined;
785
+ }, {
786
+ dimensions?: number | undefined;
787
+ encodingFormat?: string | undefined;
788
+ }>;
789
+ declare const EmbeddingModelBaseConfigDef: () => {
790
+ readonly encodingFormat: {
791
+ type: "select-string";
792
+ param: string;
793
+ title: string;
794
+ description: string;
795
+ default: string;
796
+ choices: string[];
797
+ };
798
+ readonly dimensions: {
799
+ type: "range";
800
+ param: string;
801
+ title: string;
802
+ description: string;
803
+ max: number;
804
+ min: number;
805
+ step: number;
806
+ default: number;
807
+ };
808
+ };
809
+
810
+ declare const encodingFormat: {
811
+ def: {
812
+ type: "select-string";
813
+ param: string;
814
+ title: string;
815
+ description: string;
816
+ default: string;
817
+ choices: string[];
818
+ };
819
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
820
+ };
821
+ declare const dimensions: {
822
+ def: {
823
+ type: "range";
824
+ param: string;
825
+ title: string;
826
+ description: string;
827
+ max: number;
828
+ min: number;
829
+ step: number;
830
+ default: number;
832
831
  };
832
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
833
833
  };
834
834
 
835
835
  declare const OpenAIChatModelRoles: z.ZodEnum<["system", "user", "assistant", "tool"]>;
@@ -1546,116 +1546,1276 @@ declare const OpenAIStreamChatResponse: z.ZodObject<{
1546
1546
  completion_tokens: z.ZodNumber;
1547
1547
  total_tokens: z.ZodNumber;
1548
1548
  }, "strip", z.ZodTypeAny, {
1549
- prompt_tokens: number;
1550
- completion_tokens: number;
1551
- total_tokens: number;
1549
+ prompt_tokens: number;
1550
+ completion_tokens: number;
1551
+ total_tokens: number;
1552
+ }, {
1553
+ prompt_tokens: number;
1554
+ completion_tokens: number;
1555
+ total_tokens: number;
1556
+ }>>>;
1557
+ }, "strip", z.ZodTypeAny, {
1558
+ object: string;
1559
+ choices: {
1560
+ logprobs: {
1561
+ content: {
1562
+ top_logprobs: {
1563
+ token: string;
1564
+ logprob: number;
1565
+ bytes: number[] | null;
1566
+ }[];
1567
+ token: string;
1568
+ logprob: number;
1569
+ bytes: number[] | null;
1570
+ }[] | null;
1571
+ refusal: {
1572
+ top_logprobs: {
1573
+ token: string;
1574
+ logprob: number;
1575
+ bytes: number[] | null;
1576
+ }[];
1577
+ token: string;
1578
+ logprob: number;
1579
+ bytes: number[] | null;
1580
+ }[] | null;
1581
+ } | null;
1582
+ index: number;
1583
+ finish_reason: string | null;
1584
+ delta: {
1585
+ content?: string | null | undefined;
1586
+ refusal?: string | null | undefined;
1587
+ tool_calls?: {
1588
+ index: number;
1589
+ function?: {
1590
+ name?: string | undefined;
1591
+ arguments?: string | undefined;
1592
+ } | undefined;
1593
+ type?: "function" | undefined;
1594
+ id?: string | undefined;
1595
+ }[] | undefined;
1596
+ } | {};
1597
+ }[];
1598
+ id: string;
1599
+ created: number;
1600
+ model: string;
1601
+ system_fingerprint: string | null;
1602
+ usage?: {
1603
+ prompt_tokens: number;
1604
+ completion_tokens: number;
1605
+ total_tokens: number;
1606
+ } | null | undefined;
1607
+ }, {
1608
+ object: string;
1609
+ choices: {
1610
+ logprobs: {
1611
+ content: {
1612
+ top_logprobs: {
1613
+ token: string;
1614
+ logprob: number;
1615
+ bytes: number[] | null;
1616
+ }[];
1617
+ token: string;
1618
+ logprob: number;
1619
+ bytes: number[] | null;
1620
+ }[] | null;
1621
+ refusal: {
1622
+ top_logprobs: {
1623
+ token: string;
1624
+ logprob: number;
1625
+ bytes: number[] | null;
1626
+ }[];
1627
+ token: string;
1628
+ logprob: number;
1629
+ bytes: number[] | null;
1630
+ }[] | null;
1631
+ } | null;
1632
+ index: number;
1633
+ finish_reason: string | null;
1634
+ delta: {
1635
+ content?: string | null | undefined;
1636
+ refusal?: string | null | undefined;
1637
+ tool_calls?: {
1638
+ index: number;
1639
+ function?: {
1640
+ name?: string | undefined;
1641
+ arguments?: string | undefined;
1642
+ } | undefined;
1643
+ type?: "function" | undefined;
1644
+ id?: string | undefined;
1645
+ }[] | undefined;
1646
+ } | {};
1647
+ }[];
1648
+ id: string;
1649
+ created: number;
1650
+ model: string;
1651
+ system_fingerprint: string | null;
1652
+ usage?: {
1653
+ prompt_tokens: number;
1654
+ completion_tokens: number;
1655
+ total_tokens: number;
1656
+ } | null | undefined;
1657
+ }>;
1658
+ type OpenAIStreamChatResponseType = z.infer<typeof OpenAIStreamChatResponse>;
1659
+
1660
+ declare const OpenAIChatRequestTool: z.ZodObject<{
1661
+ type: z.ZodLiteral<"function">;
1662
+ function: z.ZodObject<{
1663
+ name: z.ZodString;
1664
+ description: z.ZodOptional<z.ZodString>;
1665
+ strict: z.ZodOptional<z.ZodBoolean>;
1666
+ parameters: z.ZodAny;
1667
+ }, "strip", z.ZodTypeAny, {
1668
+ name: string;
1669
+ description?: string | undefined;
1670
+ strict?: boolean | undefined;
1671
+ parameters?: any;
1672
+ }, {
1673
+ name: string;
1674
+ description?: string | undefined;
1675
+ strict?: boolean | undefined;
1676
+ parameters?: any;
1677
+ }>;
1678
+ }, "strip", z.ZodTypeAny, {
1679
+ function: {
1680
+ name: string;
1681
+ description?: string | undefined;
1682
+ strict?: boolean | undefined;
1683
+ parameters?: any;
1684
+ };
1685
+ type: "function";
1686
+ }, {
1687
+ function: {
1688
+ name: string;
1689
+ description?: string | undefined;
1690
+ strict?: boolean | undefined;
1691
+ parameters?: any;
1692
+ };
1693
+ type: "function";
1694
+ }>;
1695
+ type OpenAIChatRequestToolType = z.infer<typeof OpenAIChatRequestTool>;
1696
+ declare const OpenAIChatRequestToolChoiceEnum: z.ZodEnum<["none", "auto", "required"]>;
1697
+ type OpenAIChatRequestToolChoiceEnumType = z.infer<typeof OpenAIChatRequestToolChoiceEnum>;
1698
+ declare const OpenAIChatRequestToolChoiceFunction: z.ZodObject<{
1699
+ type: z.ZodLiteral<"function">;
1700
+ function: z.ZodObject<{
1701
+ name: z.ZodString;
1702
+ }, "strip", z.ZodTypeAny, {
1703
+ name: string;
1704
+ }, {
1705
+ name: string;
1706
+ }>;
1707
+ }, "strip", z.ZodTypeAny, {
1708
+ function: {
1709
+ name: string;
1710
+ };
1711
+ type: "function";
1712
+ }, {
1713
+ function: {
1714
+ name: string;
1715
+ };
1716
+ type: "function";
1717
+ }>;
1718
+ type OpenAIChatRequestToolChoiceFunctionType = z.infer<typeof OpenAIChatRequestToolChoiceFunction>;
1719
+ declare const OpenAIChatRequestResponseFormat: z.ZodUnion<[z.ZodObject<{
1720
+ type: z.ZodEnum<["text", "json_object"]>;
1721
+ }, "strip", z.ZodTypeAny, {
1722
+ type: "text" | "json_object";
1723
+ }, {
1724
+ type: "text" | "json_object";
1725
+ }>, z.ZodObject<{
1726
+ type: z.ZodLiteral<"json_schema">;
1727
+ json_schema: z.ZodObject<{
1728
+ name: z.ZodString;
1729
+ description: z.ZodOptional<z.ZodString>;
1730
+ strict: z.ZodOptional<z.ZodBoolean>;
1731
+ schema: z.ZodAny;
1732
+ }, "strip", z.ZodTypeAny, {
1733
+ name: string;
1734
+ description?: string | undefined;
1735
+ strict?: boolean | undefined;
1736
+ schema?: any;
1737
+ }, {
1738
+ name: string;
1739
+ description?: string | undefined;
1740
+ strict?: boolean | undefined;
1741
+ schema?: any;
1742
+ }>;
1743
+ }, "strip", z.ZodTypeAny, {
1744
+ type: "json_schema";
1745
+ json_schema: {
1746
+ name: string;
1747
+ description?: string | undefined;
1748
+ strict?: boolean | undefined;
1749
+ schema?: any;
1750
+ };
1751
+ }, {
1752
+ type: "json_schema";
1753
+ json_schema: {
1754
+ name: string;
1755
+ description?: string | undefined;
1756
+ strict?: boolean | undefined;
1757
+ schema?: any;
1758
+ };
1759
+ }>]>;
1760
+ type OpenAIChatRequestResponseFormatType = z.infer<typeof OpenAIChatRequestResponseFormat>;
1761
+ declare const OpenAIChatRequestTextContent: z.ZodObject<{
1762
+ text: z.ZodString;
1763
+ type: z.ZodLiteral<"text">;
1764
+ }, "strip", z.ZodTypeAny, {
1765
+ type: "text";
1766
+ text: string;
1767
+ }, {
1768
+ type: "text";
1769
+ text: string;
1770
+ }>;
1771
+ type OpenAIChatRequestTextContentType = z.infer<typeof OpenAIChatRequestTextContent>;
1772
+ declare const OpenAIChatRequestImageContent: z.ZodObject<{
1773
+ type: z.ZodLiteral<"image_url">;
1774
+ image_url: z.ZodObject<{
1775
+ url: z.ZodString;
1776
+ detail: z.ZodOptional<z.ZodEnum<["low", "high", "auto"]>>;
1777
+ }, "strip", z.ZodTypeAny, {
1778
+ url: string;
1779
+ detail?: "auto" | "low" | "high" | undefined;
1780
+ }, {
1781
+ url: string;
1782
+ detail?: "auto" | "low" | "high" | undefined;
1783
+ }>;
1784
+ }, "strip", z.ZodTypeAny, {
1785
+ type: "image_url";
1786
+ image_url: {
1787
+ url: string;
1788
+ detail?: "auto" | "low" | "high" | undefined;
1789
+ };
1790
+ }, {
1791
+ type: "image_url";
1792
+ image_url: {
1793
+ url: string;
1794
+ detail?: "auto" | "low" | "high" | undefined;
1795
+ };
1796
+ }>;
1797
+ type OpenAIChatRequestImageContentType = z.infer<typeof OpenAIChatRequestImageContent>;
1798
+ declare const OpenAIChatRequestToolCallContent: z.ZodObject<{
1799
+ id: z.ZodString;
1800
+ type: z.ZodLiteral<"function">;
1801
+ function: z.ZodObject<{
1802
+ name: z.ZodString;
1803
+ arguments: z.ZodString;
1804
+ }, "strip", z.ZodTypeAny, {
1805
+ name: string;
1806
+ arguments: string;
1807
+ }, {
1808
+ name: string;
1809
+ arguments: string;
1810
+ }>;
1811
+ }, "strip", z.ZodTypeAny, {
1812
+ function: {
1813
+ name: string;
1814
+ arguments: string;
1815
+ };
1816
+ type: "function";
1817
+ id: string;
1818
+ }, {
1819
+ function: {
1820
+ name: string;
1821
+ arguments: string;
1822
+ };
1823
+ type: "function";
1824
+ id: string;
1825
+ }>;
1826
+ type OpenAIChatRequestToolCallContentType = z.infer<typeof OpenAIChatRequestToolCallContent>;
1827
+ declare const OpenAIChatRequestSystemMessage: z.ZodObject<{
1828
+ role: z.ZodLiteral<"system">;
1829
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
1830
+ text: z.ZodString;
1831
+ type: z.ZodLiteral<"text">;
1832
+ }, "strip", z.ZodTypeAny, {
1833
+ type: "text";
1834
+ text: string;
1835
+ }, {
1836
+ type: "text";
1837
+ text: string;
1838
+ }>, "many">]>;
1839
+ }, "strip", z.ZodTypeAny, {
1840
+ content: string | {
1841
+ type: "text";
1842
+ text: string;
1843
+ }[];
1844
+ role: "system";
1845
+ }, {
1846
+ content: string | {
1847
+ type: "text";
1848
+ text: string;
1849
+ }[];
1850
+ role: "system";
1851
+ }>;
1852
+ type OpenAIChatRequestSystemMessageType = z.infer<typeof OpenAIChatRequestSystemMessage>;
1853
+ declare const OpenAIChatRequestUserMessage: z.ZodObject<{
1854
+ role: z.ZodLiteral<"user">;
1855
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1856
+ text: z.ZodString;
1857
+ type: z.ZodLiteral<"text">;
1858
+ }, "strip", z.ZodTypeAny, {
1859
+ type: "text";
1860
+ text: string;
1861
+ }, {
1862
+ type: "text";
1863
+ text: string;
1864
+ }>, z.ZodObject<{
1865
+ type: z.ZodLiteral<"image_url">;
1866
+ image_url: z.ZodObject<{
1867
+ url: z.ZodString;
1868
+ detail: z.ZodOptional<z.ZodEnum<["low", "high", "auto"]>>;
1869
+ }, "strip", z.ZodTypeAny, {
1870
+ url: string;
1871
+ detail?: "auto" | "low" | "high" | undefined;
1872
+ }, {
1873
+ url: string;
1874
+ detail?: "auto" | "low" | "high" | undefined;
1875
+ }>;
1876
+ }, "strip", z.ZodTypeAny, {
1877
+ type: "image_url";
1878
+ image_url: {
1879
+ url: string;
1880
+ detail?: "auto" | "low" | "high" | undefined;
1881
+ };
1882
+ }, {
1883
+ type: "image_url";
1884
+ image_url: {
1885
+ url: string;
1886
+ detail?: "auto" | "low" | "high" | undefined;
1887
+ };
1888
+ }>]>, "many">]>;
1889
+ }, "strip", z.ZodTypeAny, {
1890
+ content: string | ({
1891
+ type: "text";
1892
+ text: string;
1893
+ } | {
1894
+ type: "image_url";
1895
+ image_url: {
1896
+ url: string;
1897
+ detail?: "auto" | "low" | "high" | undefined;
1898
+ };
1899
+ })[];
1900
+ role: "user";
1901
+ }, {
1902
+ content: string | ({
1903
+ type: "text";
1904
+ text: string;
1905
+ } | {
1906
+ type: "image_url";
1907
+ image_url: {
1908
+ url: string;
1909
+ detail?: "auto" | "low" | "high" | undefined;
1910
+ };
1911
+ })[];
1912
+ role: "user";
1913
+ }>;
1914
+ type OpenAIChatRequestUserMessageType = z.infer<typeof OpenAIChatRequestUserMessage>;
1915
+ declare const OpenAIChatRequestAssistantMessage: z.ZodEffects<z.ZodObject<{
1916
+ role: z.ZodLiteral<"assistant">;
1917
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
1918
+ text: z.ZodString;
1919
+ type: z.ZodLiteral<"text">;
1920
+ }, "strip", z.ZodTypeAny, {
1921
+ type: "text";
1922
+ text: string;
1923
+ }, {
1924
+ type: "text";
1925
+ text: string;
1926
+ }>, "many">]>>;
1927
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1928
+ id: z.ZodString;
1929
+ type: z.ZodLiteral<"function">;
1930
+ function: z.ZodObject<{
1931
+ name: z.ZodString;
1932
+ arguments: z.ZodString;
1933
+ }, "strip", z.ZodTypeAny, {
1934
+ name: string;
1935
+ arguments: string;
1936
+ }, {
1937
+ name: string;
1938
+ arguments: string;
1939
+ }>;
1940
+ }, "strip", z.ZodTypeAny, {
1941
+ function: {
1942
+ name: string;
1943
+ arguments: string;
1944
+ };
1945
+ type: "function";
1946
+ id: string;
1947
+ }, {
1948
+ function: {
1949
+ name: string;
1950
+ arguments: string;
1951
+ };
1952
+ type: "function";
1953
+ id: string;
1954
+ }>, "many">>;
1955
+ }, "strip", z.ZodTypeAny, {
1956
+ role: "assistant";
1957
+ content?: string | {
1958
+ type: "text";
1959
+ text: string;
1960
+ }[] | undefined;
1961
+ tool_calls?: {
1962
+ function: {
1963
+ name: string;
1964
+ arguments: string;
1965
+ };
1966
+ type: "function";
1967
+ id: string;
1968
+ }[] | undefined;
1969
+ }, {
1970
+ role: "assistant";
1971
+ content?: string | {
1972
+ type: "text";
1973
+ text: string;
1974
+ }[] | undefined;
1975
+ tool_calls?: {
1976
+ function: {
1977
+ name: string;
1978
+ arguments: string;
1979
+ };
1980
+ type: "function";
1981
+ id: string;
1982
+ }[] | undefined;
1983
+ }>, {
1984
+ role: "assistant";
1985
+ content?: string | {
1986
+ type: "text";
1987
+ text: string;
1988
+ }[] | undefined;
1989
+ tool_calls?: {
1990
+ function: {
1991
+ name: string;
1992
+ arguments: string;
1993
+ };
1994
+ type: "function";
1995
+ id: string;
1996
+ }[] | undefined;
1997
+ }, {
1998
+ role: "assistant";
1999
+ content?: string | {
2000
+ type: "text";
2001
+ text: string;
2002
+ }[] | undefined;
2003
+ tool_calls?: {
2004
+ function: {
2005
+ name: string;
2006
+ arguments: string;
2007
+ };
2008
+ type: "function";
2009
+ id: string;
2010
+ }[] | undefined;
2011
+ }>;
2012
+ type OpenAIChatRequestAssistantMessageType = z.infer<typeof OpenAIChatRequestAssistantMessage>;
2013
+ declare const OpenAIChatRequestToolMessage: z.ZodObject<{
2014
+ role: z.ZodLiteral<"tool">;
2015
+ tool_call_id: z.ZodString;
2016
+ content: z.ZodString;
2017
+ }, "strip", z.ZodTypeAny, {
2018
+ content: string;
2019
+ role: "tool";
2020
+ tool_call_id: string;
2021
+ }, {
2022
+ content: string;
2023
+ role: "tool";
2024
+ tool_call_id: string;
2025
+ }>;
2026
+ type OpenAIChatRequestToolMessageType = z.infer<typeof OpenAIChatRequestToolMessage>;
2027
+ declare const OpenAIChatRequestMessage: z.ZodUnion<[z.ZodObject<{
2028
+ role: z.ZodLiteral<"system">;
2029
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
2030
+ text: z.ZodString;
2031
+ type: z.ZodLiteral<"text">;
2032
+ }, "strip", z.ZodTypeAny, {
2033
+ type: "text";
2034
+ text: string;
1552
2035
  }, {
1553
- prompt_tokens: number;
1554
- completion_tokens: number;
1555
- total_tokens: number;
1556
- }>>>;
2036
+ type: "text";
2037
+ text: string;
2038
+ }>, "many">]>;
1557
2039
  }, "strip", z.ZodTypeAny, {
1558
- object: string;
1559
- choices: {
1560
- logprobs: {
1561
- content: {
1562
- top_logprobs: {
1563
- token: string;
1564
- logprob: number;
1565
- bytes: number[] | null;
1566
- }[];
1567
- token: string;
1568
- logprob: number;
1569
- bytes: number[] | null;
1570
- }[] | null;
1571
- refusal: {
1572
- top_logprobs: {
1573
- token: string;
1574
- logprob: number;
1575
- bytes: number[] | null;
1576
- }[];
1577
- token: string;
1578
- logprob: number;
1579
- bytes: number[] | null;
1580
- }[] | null;
1581
- } | null;
1582
- index: number;
1583
- finish_reason: string | null;
1584
- delta: {
1585
- content?: string | null | undefined;
1586
- refusal?: string | null | undefined;
1587
- tool_calls?: {
1588
- index: number;
1589
- function?: {
1590
- name?: string | undefined;
1591
- arguments?: string | undefined;
1592
- } | undefined;
1593
- type?: "function" | undefined;
1594
- id?: string | undefined;
1595
- }[] | undefined;
1596
- } | {};
2040
+ content: string | {
2041
+ type: "text";
2042
+ text: string;
1597
2043
  }[];
1598
- id: string;
1599
- created: number;
1600
- model: string;
1601
- system_fingerprint: string | null;
1602
- usage?: {
1603
- prompt_tokens: number;
1604
- completion_tokens: number;
1605
- total_tokens: number;
1606
- } | null | undefined;
2044
+ role: "system";
1607
2045
  }, {
1608
- object: string;
1609
- choices: {
1610
- logprobs: {
1611
- content: {
1612
- top_logprobs: {
1613
- token: string;
1614
- logprob: number;
1615
- bytes: number[] | null;
1616
- }[];
1617
- token: string;
1618
- logprob: number;
1619
- bytes: number[] | null;
1620
- }[] | null;
1621
- refusal: {
1622
- top_logprobs: {
1623
- token: string;
1624
- logprob: number;
1625
- bytes: number[] | null;
1626
- }[];
1627
- token: string;
1628
- logprob: number;
1629
- bytes: number[] | null;
1630
- }[] | null;
1631
- } | null;
1632
- index: number;
1633
- finish_reason: string | null;
1634
- delta: {
1635
- content?: string | null | undefined;
1636
- refusal?: string | null | undefined;
1637
- tool_calls?: {
1638
- index: number;
1639
- function?: {
1640
- name?: string | undefined;
1641
- arguments?: string | undefined;
1642
- } | undefined;
1643
- type?: "function" | undefined;
1644
- id?: string | undefined;
1645
- }[] | undefined;
1646
- } | {};
2046
+ content: string | {
2047
+ type: "text";
2048
+ text: string;
1647
2049
  }[];
1648
- id: string;
1649
- created: number;
1650
- model: string;
1651
- system_fingerprint: string | null;
1652
- usage?: {
1653
- prompt_tokens: number;
1654
- completion_tokens: number;
1655
- total_tokens: number;
1656
- } | null | undefined;
2050
+ role: "system";
2051
+ }>, z.ZodObject<{
2052
+ role: z.ZodLiteral<"user">;
2053
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
2054
+ text: z.ZodString;
2055
+ type: z.ZodLiteral<"text">;
2056
+ }, "strip", z.ZodTypeAny, {
2057
+ type: "text";
2058
+ text: string;
2059
+ }, {
2060
+ type: "text";
2061
+ text: string;
2062
+ }>, z.ZodObject<{
2063
+ type: z.ZodLiteral<"image_url">;
2064
+ image_url: z.ZodObject<{
2065
+ url: z.ZodString;
2066
+ detail: z.ZodOptional<z.ZodEnum<["low", "high", "auto"]>>;
2067
+ }, "strip", z.ZodTypeAny, {
2068
+ url: string;
2069
+ detail?: "auto" | "low" | "high" | undefined;
2070
+ }, {
2071
+ url: string;
2072
+ detail?: "auto" | "low" | "high" | undefined;
2073
+ }>;
2074
+ }, "strip", z.ZodTypeAny, {
2075
+ type: "image_url";
2076
+ image_url: {
2077
+ url: string;
2078
+ detail?: "auto" | "low" | "high" | undefined;
2079
+ };
2080
+ }, {
2081
+ type: "image_url";
2082
+ image_url: {
2083
+ url: string;
2084
+ detail?: "auto" | "low" | "high" | undefined;
2085
+ };
2086
+ }>]>, "many">]>;
2087
+ }, "strip", z.ZodTypeAny, {
2088
+ content: string | ({
2089
+ type: "text";
2090
+ text: string;
2091
+ } | {
2092
+ type: "image_url";
2093
+ image_url: {
2094
+ url: string;
2095
+ detail?: "auto" | "low" | "high" | undefined;
2096
+ };
2097
+ })[];
2098
+ role: "user";
2099
+ }, {
2100
+ content: string | ({
2101
+ type: "text";
2102
+ text: string;
2103
+ } | {
2104
+ type: "image_url";
2105
+ image_url: {
2106
+ url: string;
2107
+ detail?: "auto" | "low" | "high" | undefined;
2108
+ };
2109
+ })[];
2110
+ role: "user";
2111
+ }>, z.ZodEffects<z.ZodObject<{
2112
+ role: z.ZodLiteral<"assistant">;
2113
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
2114
+ text: z.ZodString;
2115
+ type: z.ZodLiteral<"text">;
2116
+ }, "strip", z.ZodTypeAny, {
2117
+ type: "text";
2118
+ text: string;
2119
+ }, {
2120
+ type: "text";
2121
+ text: string;
2122
+ }>, "many">]>>;
2123
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
2124
+ id: z.ZodString;
2125
+ type: z.ZodLiteral<"function">;
2126
+ function: z.ZodObject<{
2127
+ name: z.ZodString;
2128
+ arguments: z.ZodString;
2129
+ }, "strip", z.ZodTypeAny, {
2130
+ name: string;
2131
+ arguments: string;
2132
+ }, {
2133
+ name: string;
2134
+ arguments: string;
2135
+ }>;
2136
+ }, "strip", z.ZodTypeAny, {
2137
+ function: {
2138
+ name: string;
2139
+ arguments: string;
2140
+ };
2141
+ type: "function";
2142
+ id: string;
2143
+ }, {
2144
+ function: {
2145
+ name: string;
2146
+ arguments: string;
2147
+ };
2148
+ type: "function";
2149
+ id: string;
2150
+ }>, "many">>;
2151
+ }, "strip", z.ZodTypeAny, {
2152
+ role: "assistant";
2153
+ content?: string | {
2154
+ type: "text";
2155
+ text: string;
2156
+ }[] | undefined;
2157
+ tool_calls?: {
2158
+ function: {
2159
+ name: string;
2160
+ arguments: string;
2161
+ };
2162
+ type: "function";
2163
+ id: string;
2164
+ }[] | undefined;
2165
+ }, {
2166
+ role: "assistant";
2167
+ content?: string | {
2168
+ type: "text";
2169
+ text: string;
2170
+ }[] | undefined;
2171
+ tool_calls?: {
2172
+ function: {
2173
+ name: string;
2174
+ arguments: string;
2175
+ };
2176
+ type: "function";
2177
+ id: string;
2178
+ }[] | undefined;
2179
+ }>, {
2180
+ role: "assistant";
2181
+ content?: string | {
2182
+ type: "text";
2183
+ text: string;
2184
+ }[] | undefined;
2185
+ tool_calls?: {
2186
+ function: {
2187
+ name: string;
2188
+ arguments: string;
2189
+ };
2190
+ type: "function";
2191
+ id: string;
2192
+ }[] | undefined;
2193
+ }, {
2194
+ role: "assistant";
2195
+ content?: string | {
2196
+ type: "text";
2197
+ text: string;
2198
+ }[] | undefined;
2199
+ tool_calls?: {
2200
+ function: {
2201
+ name: string;
2202
+ arguments: string;
2203
+ };
2204
+ type: "function";
2205
+ id: string;
2206
+ }[] | undefined;
2207
+ }>, z.ZodObject<{
2208
+ role: z.ZodLiteral<"tool">;
2209
+ tool_call_id: z.ZodString;
2210
+ content: z.ZodString;
2211
+ }, "strip", z.ZodTypeAny, {
2212
+ content: string;
2213
+ role: "tool";
2214
+ tool_call_id: string;
2215
+ }, {
2216
+ content: string;
2217
+ role: "tool";
2218
+ tool_call_id: string;
2219
+ }>]>;
2220
+ type OpenAIChatRequestMessageType = z.infer<typeof OpenAIChatRequestMessage>;
2221
+ declare const OpenAIChatRequest: z.ZodEffects<z.ZodObject<{
2222
+ model: z.ZodOptional<z.ZodString>;
2223
+ messages: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
2224
+ role: z.ZodLiteral<"system">;
2225
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
2226
+ text: z.ZodString;
2227
+ type: z.ZodLiteral<"text">;
2228
+ }, "strip", z.ZodTypeAny, {
2229
+ type: "text";
2230
+ text: string;
2231
+ }, {
2232
+ type: "text";
2233
+ text: string;
2234
+ }>, "many">]>;
2235
+ }, "strip", z.ZodTypeAny, {
2236
+ content: string | {
2237
+ type: "text";
2238
+ text: string;
2239
+ }[];
2240
+ role: "system";
2241
+ }, {
2242
+ content: string | {
2243
+ type: "text";
2244
+ text: string;
2245
+ }[];
2246
+ role: "system";
2247
+ }>, z.ZodObject<{
2248
+ role: z.ZodLiteral<"user">;
2249
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
2250
+ text: z.ZodString;
2251
+ type: z.ZodLiteral<"text">;
2252
+ }, "strip", z.ZodTypeAny, {
2253
+ type: "text";
2254
+ text: string;
2255
+ }, {
2256
+ type: "text";
2257
+ text: string;
2258
+ }>, z.ZodObject<{
2259
+ type: z.ZodLiteral<"image_url">;
2260
+ image_url: z.ZodObject<{
2261
+ url: z.ZodString;
2262
+ detail: z.ZodOptional<z.ZodEnum<["low", "high", "auto"]>>;
2263
+ }, "strip", z.ZodTypeAny, {
2264
+ url: string;
2265
+ detail?: "auto" | "low" | "high" | undefined;
2266
+ }, {
2267
+ url: string;
2268
+ detail?: "auto" | "low" | "high" | undefined;
2269
+ }>;
2270
+ }, "strip", z.ZodTypeAny, {
2271
+ type: "image_url";
2272
+ image_url: {
2273
+ url: string;
2274
+ detail?: "auto" | "low" | "high" | undefined;
2275
+ };
2276
+ }, {
2277
+ type: "image_url";
2278
+ image_url: {
2279
+ url: string;
2280
+ detail?: "auto" | "low" | "high" | undefined;
2281
+ };
2282
+ }>]>, "many">]>;
2283
+ }, "strip", z.ZodTypeAny, {
2284
+ content: string | ({
2285
+ type: "text";
2286
+ text: string;
2287
+ } | {
2288
+ type: "image_url";
2289
+ image_url: {
2290
+ url: string;
2291
+ detail?: "auto" | "low" | "high" | undefined;
2292
+ };
2293
+ })[];
2294
+ role: "user";
2295
+ }, {
2296
+ content: string | ({
2297
+ type: "text";
2298
+ text: string;
2299
+ } | {
2300
+ type: "image_url";
2301
+ image_url: {
2302
+ url: string;
2303
+ detail?: "auto" | "low" | "high" | undefined;
2304
+ };
2305
+ })[];
2306
+ role: "user";
2307
+ }>, z.ZodEffects<z.ZodObject<{
2308
+ role: z.ZodLiteral<"assistant">;
2309
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
2310
+ text: z.ZodString;
2311
+ type: z.ZodLiteral<"text">;
2312
+ }, "strip", z.ZodTypeAny, {
2313
+ type: "text";
2314
+ text: string;
2315
+ }, {
2316
+ type: "text";
2317
+ text: string;
2318
+ }>, "many">]>>;
2319
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
2320
+ id: z.ZodString;
2321
+ type: z.ZodLiteral<"function">;
2322
+ function: z.ZodObject<{
2323
+ name: z.ZodString;
2324
+ arguments: z.ZodString;
2325
+ }, "strip", z.ZodTypeAny, {
2326
+ name: string;
2327
+ arguments: string;
2328
+ }, {
2329
+ name: string;
2330
+ arguments: string;
2331
+ }>;
2332
+ }, "strip", z.ZodTypeAny, {
2333
+ function: {
2334
+ name: string;
2335
+ arguments: string;
2336
+ };
2337
+ type: "function";
2338
+ id: string;
2339
+ }, {
2340
+ function: {
2341
+ name: string;
2342
+ arguments: string;
2343
+ };
2344
+ type: "function";
2345
+ id: string;
2346
+ }>, "many">>;
2347
+ }, "strip", z.ZodTypeAny, {
2348
+ role: "assistant";
2349
+ content?: string | {
2350
+ type: "text";
2351
+ text: string;
2352
+ }[] | undefined;
2353
+ tool_calls?: {
2354
+ function: {
2355
+ name: string;
2356
+ arguments: string;
2357
+ };
2358
+ type: "function";
2359
+ id: string;
2360
+ }[] | undefined;
2361
+ }, {
2362
+ role: "assistant";
2363
+ content?: string | {
2364
+ type: "text";
2365
+ text: string;
2366
+ }[] | undefined;
2367
+ tool_calls?: {
2368
+ function: {
2369
+ name: string;
2370
+ arguments: string;
2371
+ };
2372
+ type: "function";
2373
+ id: string;
2374
+ }[] | undefined;
2375
+ }>, {
2376
+ role: "assistant";
2377
+ content?: string | {
2378
+ type: "text";
2379
+ text: string;
2380
+ }[] | undefined;
2381
+ tool_calls?: {
2382
+ function: {
2383
+ name: string;
2384
+ arguments: string;
2385
+ };
2386
+ type: "function";
2387
+ id: string;
2388
+ }[] | undefined;
2389
+ }, {
2390
+ role: "assistant";
2391
+ content?: string | {
2392
+ type: "text";
2393
+ text: string;
2394
+ }[] | undefined;
2395
+ tool_calls?: {
2396
+ function: {
2397
+ name: string;
2398
+ arguments: string;
2399
+ };
2400
+ type: "function";
2401
+ id: string;
2402
+ }[] | undefined;
2403
+ }>, z.ZodObject<{
2404
+ role: z.ZodLiteral<"tool">;
2405
+ tool_call_id: z.ZodString;
2406
+ content: z.ZodString;
2407
+ }, "strip", z.ZodTypeAny, {
2408
+ content: string;
2409
+ role: "tool";
2410
+ tool_call_id: string;
2411
+ }, {
2412
+ content: string;
2413
+ role: "tool";
2414
+ tool_call_id: string;
2415
+ }>]>, "many">>;
2416
+ frequency_penalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2417
+ logprobs: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
2418
+ top_logprobs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2419
+ max_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2420
+ presence_penalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2421
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
2422
+ type: z.ZodEnum<["text", "json_object"]>;
2423
+ }, "strip", z.ZodTypeAny, {
2424
+ type: "text" | "json_object";
2425
+ }, {
2426
+ type: "text" | "json_object";
2427
+ }>, z.ZodObject<{
2428
+ type: z.ZodLiteral<"json_schema">;
2429
+ json_schema: z.ZodObject<{
2430
+ name: z.ZodString;
2431
+ description: z.ZodOptional<z.ZodString>;
2432
+ strict: z.ZodOptional<z.ZodBoolean>;
2433
+ schema: z.ZodAny;
2434
+ }, "strip", z.ZodTypeAny, {
2435
+ name: string;
2436
+ description?: string | undefined;
2437
+ strict?: boolean | undefined;
2438
+ schema?: any;
2439
+ }, {
2440
+ name: string;
2441
+ description?: string | undefined;
2442
+ strict?: boolean | undefined;
2443
+ schema?: any;
2444
+ }>;
2445
+ }, "strip", z.ZodTypeAny, {
2446
+ type: "json_schema";
2447
+ json_schema: {
2448
+ name: string;
2449
+ description?: string | undefined;
2450
+ strict?: boolean | undefined;
2451
+ schema?: any;
2452
+ };
2453
+ }, {
2454
+ type: "json_schema";
2455
+ json_schema: {
2456
+ name: string;
2457
+ description?: string | undefined;
2458
+ strict?: boolean | undefined;
2459
+ schema?: any;
2460
+ };
2461
+ }>]>>;
2462
+ seed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2463
+ stop: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
2464
+ temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2465
+ top_p: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2466
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
2467
+ type: z.ZodLiteral<"function">;
2468
+ function: z.ZodObject<{
2469
+ name: z.ZodString;
2470
+ description: z.ZodOptional<z.ZodString>;
2471
+ strict: z.ZodOptional<z.ZodBoolean>;
2472
+ parameters: z.ZodAny;
2473
+ }, "strip", z.ZodTypeAny, {
2474
+ name: string;
2475
+ description?: string | undefined;
2476
+ strict?: boolean | undefined;
2477
+ parameters?: any;
2478
+ }, {
2479
+ name: string;
2480
+ description?: string | undefined;
2481
+ strict?: boolean | undefined;
2482
+ parameters?: any;
2483
+ }>;
2484
+ }, "strip", z.ZodTypeAny, {
2485
+ function: {
2486
+ name: string;
2487
+ description?: string | undefined;
2488
+ strict?: boolean | undefined;
2489
+ parameters?: any;
2490
+ };
2491
+ type: "function";
2492
+ }, {
2493
+ function: {
2494
+ name: string;
2495
+ description?: string | undefined;
2496
+ strict?: boolean | undefined;
2497
+ parameters?: any;
2498
+ };
2499
+ type: "function";
2500
+ }>, "many">>;
2501
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "auto", "required"]>, z.ZodObject<{
2502
+ type: z.ZodLiteral<"function">;
2503
+ function: z.ZodObject<{
2504
+ name: z.ZodString;
2505
+ }, "strip", z.ZodTypeAny, {
2506
+ name: string;
2507
+ }, {
2508
+ name: string;
2509
+ }>;
2510
+ }, "strip", z.ZodTypeAny, {
2511
+ function: {
2512
+ name: string;
2513
+ };
2514
+ type: "function";
2515
+ }, {
2516
+ function: {
2517
+ name: string;
2518
+ };
2519
+ type: "function";
2520
+ }>]>>;
2521
+ }, "strip", z.ZodTypeAny, {
2522
+ temperature?: number | null | undefined;
2523
+ top_p?: number | null | undefined;
2524
+ frequency_penalty?: number | null | undefined;
2525
+ presence_penalty?: number | null | undefined;
2526
+ seed?: number | null | undefined;
2527
+ logprobs?: boolean | null | undefined;
2528
+ top_logprobs?: number | null | undefined;
2529
+ response_format?: {
2530
+ type: "text" | "json_object";
2531
+ } | {
2532
+ type: "json_schema";
2533
+ json_schema: {
2534
+ name: string;
2535
+ description?: string | undefined;
2536
+ strict?: boolean | undefined;
2537
+ schema?: any;
2538
+ };
2539
+ } | undefined;
2540
+ tool_choice?: "auto" | "required" | "none" | {
2541
+ function: {
2542
+ name: string;
2543
+ };
2544
+ type: "function";
2545
+ } | undefined;
2546
+ max_tokens?: number | null | undefined;
2547
+ stop?: string | string[] | null | undefined;
2548
+ model?: string | undefined;
2549
+ messages?: ({
2550
+ content: string | {
2551
+ type: "text";
2552
+ text: string;
2553
+ }[];
2554
+ role: "system";
2555
+ } | {
2556
+ content: string | ({
2557
+ type: "text";
2558
+ text: string;
2559
+ } | {
2560
+ type: "image_url";
2561
+ image_url: {
2562
+ url: string;
2563
+ detail?: "auto" | "low" | "high" | undefined;
2564
+ };
2565
+ })[];
2566
+ role: "user";
2567
+ } | {
2568
+ role: "assistant";
2569
+ content?: string | {
2570
+ type: "text";
2571
+ text: string;
2572
+ }[] | undefined;
2573
+ tool_calls?: {
2574
+ function: {
2575
+ name: string;
2576
+ arguments: string;
2577
+ };
2578
+ type: "function";
2579
+ id: string;
2580
+ }[] | undefined;
2581
+ } | {
2582
+ content: string;
2583
+ role: "tool";
2584
+ tool_call_id: string;
2585
+ })[] | undefined;
2586
+ tools?: {
2587
+ function: {
2588
+ name: string;
2589
+ description?: string | undefined;
2590
+ strict?: boolean | undefined;
2591
+ parameters?: any;
2592
+ };
2593
+ type: "function";
2594
+ }[] | undefined;
2595
+ }, {
2596
+ temperature?: number | null | undefined;
2597
+ top_p?: number | null | undefined;
2598
+ frequency_penalty?: number | null | undefined;
2599
+ presence_penalty?: number | null | undefined;
2600
+ seed?: number | null | undefined;
2601
+ logprobs?: boolean | null | undefined;
2602
+ top_logprobs?: number | null | undefined;
2603
+ response_format?: {
2604
+ type: "text" | "json_object";
2605
+ } | {
2606
+ type: "json_schema";
2607
+ json_schema: {
2608
+ name: string;
2609
+ description?: string | undefined;
2610
+ strict?: boolean | undefined;
2611
+ schema?: any;
2612
+ };
2613
+ } | undefined;
2614
+ tool_choice?: "auto" | "required" | "none" | {
2615
+ function: {
2616
+ name: string;
2617
+ };
2618
+ type: "function";
2619
+ } | undefined;
2620
+ max_tokens?: number | null | undefined;
2621
+ stop?: string | string[] | null | undefined;
2622
+ model?: string | undefined;
2623
+ messages?: ({
2624
+ content: string | {
2625
+ type: "text";
2626
+ text: string;
2627
+ }[];
2628
+ role: "system";
2629
+ } | {
2630
+ content: string | ({
2631
+ type: "text";
2632
+ text: string;
2633
+ } | {
2634
+ type: "image_url";
2635
+ image_url: {
2636
+ url: string;
2637
+ detail?: "auto" | "low" | "high" | undefined;
2638
+ };
2639
+ })[];
2640
+ role: "user";
2641
+ } | {
2642
+ role: "assistant";
2643
+ content?: string | {
2644
+ type: "text";
2645
+ text: string;
2646
+ }[] | undefined;
2647
+ tool_calls?: {
2648
+ function: {
2649
+ name: string;
2650
+ arguments: string;
2651
+ };
2652
+ type: "function";
2653
+ id: string;
2654
+ }[] | undefined;
2655
+ } | {
2656
+ content: string;
2657
+ role: "tool";
2658
+ tool_call_id: string;
2659
+ })[] | undefined;
2660
+ tools?: {
2661
+ function: {
2662
+ name: string;
2663
+ description?: string | undefined;
2664
+ strict?: boolean | undefined;
2665
+ parameters?: any;
2666
+ };
2667
+ type: "function";
2668
+ }[] | undefined;
2669
+ }>, {
2670
+ temperature?: number | null | undefined;
2671
+ top_p?: number | null | undefined;
2672
+ frequency_penalty?: number | null | undefined;
2673
+ presence_penalty?: number | null | undefined;
2674
+ seed?: number | null | undefined;
2675
+ logprobs?: boolean | null | undefined;
2676
+ top_logprobs?: number | null | undefined;
2677
+ response_format?: {
2678
+ type: "text" | "json_object";
2679
+ } | {
2680
+ type: "json_schema";
2681
+ json_schema: {
2682
+ name: string;
2683
+ description?: string | undefined;
2684
+ strict?: boolean | undefined;
2685
+ schema?: any;
2686
+ };
2687
+ } | undefined;
2688
+ tool_choice?: "auto" | "required" | "none" | {
2689
+ function: {
2690
+ name: string;
2691
+ };
2692
+ type: "function";
2693
+ } | undefined;
2694
+ max_tokens?: number | null | undefined;
2695
+ stop?: string | string[] | null | undefined;
2696
+ model?: string | undefined;
2697
+ messages?: ({
2698
+ content: string | {
2699
+ type: "text";
2700
+ text: string;
2701
+ }[];
2702
+ role: "system";
2703
+ } | {
2704
+ content: string | ({
2705
+ type: "text";
2706
+ text: string;
2707
+ } | {
2708
+ type: "image_url";
2709
+ image_url: {
2710
+ url: string;
2711
+ detail?: "auto" | "low" | "high" | undefined;
2712
+ };
2713
+ })[];
2714
+ role: "user";
2715
+ } | {
2716
+ role: "assistant";
2717
+ content?: string | {
2718
+ type: "text";
2719
+ text: string;
2720
+ }[] | undefined;
2721
+ tool_calls?: {
2722
+ function: {
2723
+ name: string;
2724
+ arguments: string;
2725
+ };
2726
+ type: "function";
2727
+ id: string;
2728
+ }[] | undefined;
2729
+ } | {
2730
+ content: string;
2731
+ role: "tool";
2732
+ tool_call_id: string;
2733
+ })[] | undefined;
2734
+ tools?: {
2735
+ function: {
2736
+ name: string;
2737
+ description?: string | undefined;
2738
+ strict?: boolean | undefined;
2739
+ parameters?: any;
2740
+ };
2741
+ type: "function";
2742
+ }[] | undefined;
2743
+ }, {
2744
+ temperature?: number | null | undefined;
2745
+ top_p?: number | null | undefined;
2746
+ frequency_penalty?: number | null | undefined;
2747
+ presence_penalty?: number | null | undefined;
2748
+ seed?: number | null | undefined;
2749
+ logprobs?: boolean | null | undefined;
2750
+ top_logprobs?: number | null | undefined;
2751
+ response_format?: {
2752
+ type: "text" | "json_object";
2753
+ } | {
2754
+ type: "json_schema";
2755
+ json_schema: {
2756
+ name: string;
2757
+ description?: string | undefined;
2758
+ strict?: boolean | undefined;
2759
+ schema?: any;
2760
+ };
2761
+ } | undefined;
2762
+ tool_choice?: "auto" | "required" | "none" | {
2763
+ function: {
2764
+ name: string;
2765
+ };
2766
+ type: "function";
2767
+ } | undefined;
2768
+ max_tokens?: number | null | undefined;
2769
+ stop?: string | string[] | null | undefined;
2770
+ model?: string | undefined;
2771
+ messages?: ({
2772
+ content: string | {
2773
+ type: "text";
2774
+ text: string;
2775
+ }[];
2776
+ role: "system";
2777
+ } | {
2778
+ content: string | ({
2779
+ type: "text";
2780
+ text: string;
2781
+ } | {
2782
+ type: "image_url";
2783
+ image_url: {
2784
+ url: string;
2785
+ detail?: "auto" | "low" | "high" | undefined;
2786
+ };
2787
+ })[];
2788
+ role: "user";
2789
+ } | {
2790
+ role: "assistant";
2791
+ content?: string | {
2792
+ type: "text";
2793
+ text: string;
2794
+ }[] | undefined;
2795
+ tool_calls?: {
2796
+ function: {
2797
+ name: string;
2798
+ arguments: string;
2799
+ };
2800
+ type: "function";
2801
+ id: string;
2802
+ }[] | undefined;
2803
+ } | {
2804
+ content: string;
2805
+ role: "tool";
2806
+ tool_call_id: string;
2807
+ })[] | undefined;
2808
+ tools?: {
2809
+ function: {
2810
+ name: string;
2811
+ description?: string | undefined;
2812
+ strict?: boolean | undefined;
2813
+ parameters?: any;
2814
+ };
2815
+ type: "function";
2816
+ }[] | undefined;
1657
2817
  }>;
1658
- type OpenAIStreamChatResponseType = z.infer<typeof OpenAIStreamChatResponse>;
2818
+ type OpenAIChatRequestType = z.infer<typeof OpenAIChatRequest>;
1659
2819
 
1660
2820
  declare const BaseChatModelOptions: z.ZodObject<{
1661
2821
  apiKey: z.ZodString;
@@ -1686,20 +2846,30 @@ declare class BaseChatModel implements ChatModelV1<ChatModelSchemaType> {
1686
2846
  private readonly completeChatUrl;
1687
2847
  private readonly organization;
1688
2848
  constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType);
1689
- getTokenCount(messages: MessageType[]): number;
1690
2849
  getDefaultBaseUrl(): UrlType;
1691
2850
  getDefaultHeaders(): HeadersType;
1692
2851
  getDefaultParams(): ParamsType;
2852
+ getRetryDelay(responseHeaders: HeadersType): {
2853
+ shouldRetry: boolean;
2854
+ delayMs: number;
2855
+ };
2856
+ getTokenCount(messages: MessageType[]): number;
2857
+ transformModelRequest(request: OpenAIChatRequestType): {
2858
+ modelName: string | undefined;
2859
+ config: ConfigType | undefined;
2860
+ messages: MessageType[] | undefined;
2861
+ tools: ToolType[] | undefined;
2862
+ };
1693
2863
  transformConfig(config: ConfigType, messages?: MessageType[], tools?: ToolType[]): ParamsType;
1694
2864
  transformMessages(messages: MessageType[]): ParamsType;
1695
2865
  transformTools(tools: ToolType[]): ParamsType;
1696
- getCompleteChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): UrlType;
2866
+ getCompleteChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<UrlType>;
1697
2867
  getCompleteChatHeaders(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<HeadersType>;
1698
- getCompleteChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): ParamsType;
2868
+ getCompleteChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): Promise<ParamsType>;
1699
2869
  transformCompleteChatResponse(response: any): ChatResponseType;
1700
- getStreamChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): UrlType;
2870
+ getStreamChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<UrlType>;
1701
2871
  getStreamChatHeaders(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<HeadersType>;
1702
- getStreamChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): ParamsType;
2872
+ getStreamChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): Promise<ParamsType>;
1703
2873
  transformStreamChatResponseChunk(chunk: string, buffer: string): AsyncGenerator<{
1704
2874
  partialResponse: PartialChatResponseType;
1705
2875
  buffer: string;
@@ -1831,6 +3001,26 @@ declare const OpenAIGetEmbeddingsResponse: z.ZodObject<{
1831
3001
  }[];
1832
3002
  }>;
1833
3003
 
3004
+ declare const OpenAIEmbeddingRequestInput: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodArray<z.ZodNumber, "many">]>, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>;
3005
+ type OpenAIEmbeddingRequestInputType = z.infer<typeof OpenAIEmbeddingRequestInput>;
3006
+ declare const OpenAIEmbeddingRequest: z.ZodObject<{
3007
+ model: z.ZodOptional<z.ZodString>;
3008
+ input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodArray<z.ZodNumber, "many">]>, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>>;
3009
+ encoding_format: z.ZodOptional<z.ZodEnum<["float", "base64"]>>;
3010
+ dimensions: z.ZodOptional<z.ZodNumber>;
3011
+ }, "strip", z.ZodTypeAny, {
3012
+ encoding_format?: "float" | "base64" | undefined;
3013
+ dimensions?: number | undefined;
3014
+ model?: string | undefined;
3015
+ input?: string | string[] | number[] | number[][] | undefined;
3016
+ }, {
3017
+ encoding_format?: "float" | "base64" | undefined;
3018
+ dimensions?: number | undefined;
3019
+ model?: string | undefined;
3020
+ input?: string | string[] | number[] | number[][] | undefined;
3021
+ }>;
3022
+ type OpenAIEmbeddingRequestType = z.infer<typeof OpenAIEmbeddingRequest>;
3023
+
1834
3024
  declare const BaseEmbeddingModelOptions: z.ZodObject<{
1835
3025
  apiKey: z.ZodString;
1836
3026
  baseUrl: z.ZodString;
@@ -1852,16 +3042,25 @@ declare class BaseEmbeddingModel implements EmbeddingModelV1<EmbeddingModelSchem
1852
3042
  private readonly baseUrl;
1853
3043
  private readonly getEmbeddingsUrl;
1854
3044
  constructor(modelSchema: EmbeddingModelSchemaType, options: BaseEmbeddingModelOptionsType);
1855
- getDefaultBaseUrl: () => UrlType;
1856
- getDefaultHeaders: () => HeadersType;
1857
- getDefaultParams: () => ParamsType;
1858
- getTokenCount: (requests: EmbeddingRequestsType) => number;
1859
- transformConfig: (config: ConfigType, requests?: EmbeddingRequestsType) => ParamsType;
1860
- transformEmbeddingRequests: (requests: EmbeddingRequestsType) => ParamsType;
1861
- getGetEmbeddingsUrl: (config?: ConfigType, requests?: EmbeddingRequestsType) => UrlType;
1862
- getGetEmbeddingsHeaders: (config?: ConfigType, requests?: EmbeddingRequestsType) => HeadersType;
1863
- getGetEmbeddingsData: (config: ConfigType, requests: EmbeddingRequestsType) => ParamsType;
1864
- transformGetEmbeddingsResponse: (response: any) => EmbeddingResponseType;
3045
+ getDefaultBaseUrl(): UrlType;
3046
+ getDefaultHeaders(): HeadersType;
3047
+ getDefaultParams(): ParamsType;
3048
+ getRetryDelay(responseHeaders: HeadersType): {
3049
+ shouldRetry: boolean;
3050
+ delayMs: number;
3051
+ };
3052
+ getTokenCount(requests: EmbeddingRequestsType): number;
3053
+ transformModelRequest(request: any): {
3054
+ modelName: string | undefined;
3055
+ config: ConfigType | undefined;
3056
+ embeddingRequests: EmbeddingRequestsType | undefined;
3057
+ };
3058
+ transformConfig(config: ConfigType, requests?: EmbeddingRequestsType): ParamsType;
3059
+ transformEmbeddingRequests(requests: EmbeddingRequestsType): ParamsType;
3060
+ getGetEmbeddingsUrl(config?: ConfigType, requests?: EmbeddingRequestsType): Promise<UrlType>;
3061
+ getGetEmbeddingsHeaders(config?: ConfigType, requests?: EmbeddingRequestsType): Promise<HeadersType>;
3062
+ getGetEmbeddingsData(config: ConfigType, requests: EmbeddingRequestsType): Promise<ParamsType>;
3063
+ transformGetEmbeddingsResponse(response: any): EmbeddingResponseType;
1865
3064
  }
1866
3065
 
1867
3066
  declare const TextEmbeddingAda002Schema: {
@@ -1944,4 +3143,4 @@ declare class OpenAI<O extends Record<string, any> = Record<string, any>> implem
1944
3143
  embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType>;
1945
3144
  }
1946
3145
 
1947
- export { BaseChatModel, BaseChatModelOptions, type BaseChatModelOptionsType, BaseConfigDef, BaseConfigSchema, BaseEmbeddingModel, BaseEmbeddingModelOptions, type BaseEmbeddingModelOptionsType, BaseWordEmbeddingConfigDef, BaseWordEmbeddingConfigSchema, GPT4o, GPT4oOptions, type GPT4oOptionsType, GPT4oSchema, OpenAI, OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap, OpenAICompleteChatResponse, type OpenAICompleteChatResponseType, OpenAIConfigs, OpenAIEmbeddingModelModalities, OpenAIEmbeddingModelModalitiesEnum, OpenAIGetEmbeddingsResponse, OpenAIStreamChatResponse, type OpenAIStreamChatResponseType, OpenAIToolCallsCompleteChatResponse, OpenAIToolCallsStreamChatResponse, OpenAIWordEmbeddingConfigs, ProviderLiteral, ResponseSchemaConfigDef, ResponseSchemaConfigSchema, TextEmbeddingAda002, TextEmbeddingAda002Options, type TextEmbeddingAda002OptionsType, TextEmbeddingAda002Schema, dimensions, encodingFormat, frequencyPenalty, logProbs, maxTokens, presencePenalty, responseFormat, seed, stop, temperature, toolChoice, topLogProbs, topP };
3146
+ export { BaseChatModel, BaseChatModelOptions, type BaseChatModelOptionsType, BaseEmbeddingModel, BaseEmbeddingModelOptions, type BaseEmbeddingModelOptionsType, ChatModelBaseConfigDef, ChatModelBaseConfigSchema, ChatModelResponseSchemaConfigDef, ChatModelResponseSchemaConfigSchema, EmbeddingModelBaseConfigDef, EmbeddingModelBaseConfigSchema, GPT4o, GPT4oOptions, type GPT4oOptionsType, GPT4oSchema, OpenAI, OpenAIChatModelConfigs, OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap, OpenAIChatRequest, OpenAIChatRequestAssistantMessage, type OpenAIChatRequestAssistantMessageType, OpenAIChatRequestImageContent, type OpenAIChatRequestImageContentType, OpenAIChatRequestMessage, type OpenAIChatRequestMessageType, OpenAIChatRequestResponseFormat, type OpenAIChatRequestResponseFormatType, OpenAIChatRequestSystemMessage, type OpenAIChatRequestSystemMessageType, OpenAIChatRequestTextContent, type OpenAIChatRequestTextContentType, OpenAIChatRequestTool, OpenAIChatRequestToolCallContent, type OpenAIChatRequestToolCallContentType, OpenAIChatRequestToolChoiceEnum, type OpenAIChatRequestToolChoiceEnumType, OpenAIChatRequestToolChoiceFunction, type OpenAIChatRequestToolChoiceFunctionType, OpenAIChatRequestToolMessage, type OpenAIChatRequestToolMessageType, type OpenAIChatRequestToolType, type OpenAIChatRequestType, OpenAIChatRequestUserMessage, type OpenAIChatRequestUserMessageType, OpenAICompleteChatResponse, type OpenAICompleteChatResponseType, OpenAIEmbeddingModelConfigs, OpenAIEmbeddingModelModalities, OpenAIEmbeddingModelModalitiesEnum, OpenAIEmbeddingRequest, OpenAIEmbeddingRequestInput, type OpenAIEmbeddingRequestInputType, type OpenAIEmbeddingRequestType, OpenAIGetEmbeddingsResponse, OpenAIStreamChatResponse, type OpenAIStreamChatResponseType, OpenAIToolCallsCompleteChatResponse, OpenAIToolCallsStreamChatResponse, ProviderLiteral, TextEmbeddingAda002, TextEmbeddingAda002Options, type TextEmbeddingAda002OptionsType, TextEmbeddingAda002Schema, dimensions, encodingFormat, frequencyPenalty, logProbs, maxTokens, presencePenalty, responseFormat, seed, stop, temperature, toolChoice, topLogProbs, topP };