@adaline/openai 0.5.0 → 0.7.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
@@ -1,10 +1,386 @@
1
1
  import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
3
  import { ChatModelSchemaType, ChatModelV1, UrlType, HeadersType, ParamsType, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderV1 } from '@adaline/provider';
4
- import { MessageType, ConfigType, ToolType, PartialMessageType, EmbeddingRequestsType, EmbeddingsType } from '@adaline/types';
4
+ import { MessageType, ConfigType, ToolType, ChatResponseType, PartialChatResponseType, EmbeddingRequestsType, EmbeddingResponseType } from '@adaline/types';
5
5
 
6
- declare const temperature: {
7
- def: {
6
+ declare const OpenAIChatModelConfigs: {
7
+ readonly base: (maxOutputTokens: number, maxSequences: number) => {
8
+ def: {
9
+ readonly temperature: {
10
+ type: "range";
11
+ param: string;
12
+ title: string;
13
+ description: string;
14
+ max: number;
15
+ min: number;
16
+ step: number;
17
+ default: number;
18
+ };
19
+ readonly maxTokens: {
20
+ type: "range";
21
+ param: string;
22
+ title: string;
23
+ description: string;
24
+ max: number;
25
+ min: number;
26
+ step: number;
27
+ default: number;
28
+ };
29
+ readonly stop: {
30
+ type: "multi-string";
31
+ param: string;
32
+ title: string;
33
+ description: string;
34
+ max: number;
35
+ };
36
+ readonly topP: {
37
+ type: "range";
38
+ param: string;
39
+ title: string;
40
+ description: string;
41
+ max: number;
42
+ min: number;
43
+ step: number;
44
+ default: number;
45
+ };
46
+ readonly frequencyPenalty: {
47
+ type: "range";
48
+ param: string;
49
+ title: string;
50
+ description: string;
51
+ max: number;
52
+ min: number;
53
+ step: number;
54
+ default: number;
55
+ };
56
+ readonly presencePenalty: {
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
+ readonly seed: {
67
+ type: "range";
68
+ param: string;
69
+ title: string;
70
+ description: string;
71
+ max: number;
72
+ min: number;
73
+ step: number;
74
+ default: number;
75
+ };
76
+ readonly responseFormat: {
77
+ type: "select-string";
78
+ param: string;
79
+ title: string;
80
+ description: string;
81
+ default: string;
82
+ choices: string[];
83
+ };
84
+ readonly logProbs: {
85
+ type: "select-boolean";
86
+ param: string;
87
+ title: string;
88
+ description: string;
89
+ default: boolean | null;
90
+ };
91
+ readonly topLogProbs: {
92
+ type: "range";
93
+ param: string;
94
+ title: string;
95
+ description: string;
96
+ max: number;
97
+ min: number;
98
+ step: number;
99
+ default: number;
100
+ };
101
+ readonly toolChoice: {
102
+ type: "select-string";
103
+ param: string;
104
+ title: string;
105
+ description: string;
106
+ default: string;
107
+ choices: string[];
108
+ };
109
+ };
110
+ schema: zod.ZodObject<{
111
+ temperature: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
112
+ maxTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
113
+ stop: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
114
+ topP: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
115
+ frequencyPenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
116
+ presencePenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
117
+ seed: zod.ZodEffects<zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>, number | undefined, number | undefined>;
118
+ logProbs: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
119
+ topLogProbs: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
120
+ responseFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
121
+ toolChoice: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
122
+ }, "strip", zod.ZodTypeAny, {
123
+ temperature?: number | undefined;
124
+ seed?: number | undefined;
125
+ stop?: string[] | undefined;
126
+ maxTokens?: number | undefined;
127
+ topP?: number | undefined;
128
+ frequencyPenalty?: number | undefined;
129
+ presencePenalty?: number | undefined;
130
+ logProbs?: boolean | null | undefined;
131
+ topLogProbs?: number | undefined;
132
+ responseFormat?: string | undefined;
133
+ toolChoice?: string | undefined;
134
+ }, {
135
+ temperature?: number | undefined;
136
+ seed?: number | undefined;
137
+ stop?: string[] | undefined;
138
+ maxTokens?: number | undefined;
139
+ topP?: number | undefined;
140
+ frequencyPenalty?: number | undefined;
141
+ presencePenalty?: number | undefined;
142
+ logProbs?: boolean | null | undefined;
143
+ topLogProbs?: number | undefined;
144
+ responseFormat?: string | undefined;
145
+ toolChoice?: string | undefined;
146
+ }>;
147
+ };
148
+ readonly responseSchema: (maxOutputTokens: number, maxSequences: number) => {
149
+ def: {
150
+ responseFormat: {
151
+ type: "select-string";
152
+ param: string;
153
+ title: string;
154
+ description: string;
155
+ default: string;
156
+ choices: string[];
157
+ };
158
+ responseSchema: {
159
+ type: "object-schema";
160
+ param: string;
161
+ title: string;
162
+ description: string;
163
+ objectSchema?: any;
164
+ };
165
+ temperature: {
166
+ type: "range";
167
+ param: string;
168
+ title: string;
169
+ description: string;
170
+ max: number;
171
+ min: number;
172
+ step: number;
173
+ default: number;
174
+ };
175
+ maxTokens: {
176
+ type: "range";
177
+ param: string;
178
+ title: string;
179
+ description: string;
180
+ max: number;
181
+ min: number;
182
+ step: number;
183
+ default: number;
184
+ };
185
+ stop: {
186
+ type: "multi-string";
187
+ param: string;
188
+ title: string;
189
+ description: string;
190
+ max: number;
191
+ };
192
+ topP: {
193
+ type: "range";
194
+ param: string;
195
+ title: string;
196
+ description: string;
197
+ max: number;
198
+ min: number;
199
+ step: number;
200
+ default: number;
201
+ };
202
+ frequencyPenalty: {
203
+ type: "range";
204
+ param: string;
205
+ title: string;
206
+ description: string;
207
+ max: number;
208
+ min: number;
209
+ step: number;
210
+ default: number;
211
+ };
212
+ presencePenalty: {
213
+ type: "range";
214
+ param: string;
215
+ title: string;
216
+ description: string;
217
+ max: number;
218
+ min: number;
219
+ step: number;
220
+ default: number;
221
+ };
222
+ seed: {
223
+ type: "range";
224
+ param: string;
225
+ title: string;
226
+ description: string;
227
+ max: number;
228
+ min: number;
229
+ step: number;
230
+ default: number;
231
+ };
232
+ logProbs: {
233
+ type: "select-boolean";
234
+ param: string;
235
+ title: string;
236
+ description: string;
237
+ default: boolean | null;
238
+ };
239
+ topLogProbs: {
240
+ type: "range";
241
+ param: string;
242
+ title: string;
243
+ description: string;
244
+ max: number;
245
+ min: number;
246
+ step: number;
247
+ default: number;
248
+ };
249
+ toolChoice: {
250
+ type: "select-string";
251
+ param: string;
252
+ title: string;
253
+ description: string;
254
+ default: string;
255
+ choices: string[];
256
+ };
257
+ };
258
+ schema: zod.ZodObject<zod.objectUtil.extendShape<{
259
+ temperature: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
260
+ maxTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
261
+ stop: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
262
+ topP: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
263
+ frequencyPenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
264
+ presencePenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
265
+ seed: zod.ZodEffects<zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>, number | undefined, number | undefined>;
266
+ logProbs: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
267
+ topLogProbs: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
268
+ responseFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
269
+ toolChoice: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
270
+ }, {
271
+ responseFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
272
+ responseSchema: zod.ZodObject<zod.ZodRawShape, zod.UnknownKeysParam, zod.ZodTypeAny, {
273
+ [x: string]: any;
274
+ }, {
275
+ [x: string]: any;
276
+ }>;
277
+ }>, "strip", zod.ZodTypeAny, {
278
+ responseSchema: {
279
+ [x: string]: any;
280
+ };
281
+ temperature?: number | undefined;
282
+ seed?: number | undefined;
283
+ stop?: string[] | undefined;
284
+ maxTokens?: number | undefined;
285
+ topP?: number | undefined;
286
+ frequencyPenalty?: number | undefined;
287
+ presencePenalty?: number | undefined;
288
+ logProbs?: boolean | null | undefined;
289
+ topLogProbs?: number | undefined;
290
+ responseFormat?: string | undefined;
291
+ toolChoice?: string | undefined;
292
+ }, {
293
+ responseSchema: {
294
+ [x: string]: any;
295
+ };
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;
341
+ }>;
342
+ };
343
+ };
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: {
8
384
  type: "range";
9
385
  param: string;
10
386
  title: string;
@@ -14,10 +390,7 @@ declare const temperature: {
14
390
  step: number;
15
391
  default: number;
16
392
  };
17
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
18
- };
19
- declare const maxTokens: (maxOutputTokens: number) => {
20
- def: {
393
+ readonly maxTokens: {
21
394
  type: "range";
22
395
  param: string;
23
396
  title: string;
@@ -27,20 +400,14 @@ declare const maxTokens: (maxOutputTokens: number) => {
27
400
  step: number;
28
401
  default: number;
29
402
  };
30
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
31
- };
32
- declare const stop: (maxSequences: number) => {
33
- def: {
403
+ readonly stop: {
34
404
  type: "multi-string";
35
405
  param: string;
36
406
  title: string;
37
407
  description: string;
38
408
  max: number;
39
409
  };
40
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
41
- };
42
- declare const topP: {
43
- def: {
410
+ readonly topP: {
44
411
  type: "range";
45
412
  param: string;
46
413
  title: string;
@@ -50,10 +417,7 @@ declare const topP: {
50
417
  step: number;
51
418
  default: number;
52
419
  };
53
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
54
- };
55
- declare const frequencyPenalty: {
56
- def: {
420
+ readonly frequencyPenalty: {
57
421
  type: "range";
58
422
  param: string;
59
423
  title: string;
@@ -63,10 +427,7 @@ declare const frequencyPenalty: {
63
427
  step: number;
64
428
  default: number;
65
429
  };
66
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
67
- };
68
- declare const presencePenalty: {
69
- def: {
430
+ readonly presencePenalty: {
70
431
  type: "range";
71
432
  param: string;
72
433
  title: string;
@@ -76,10 +437,7 @@ declare const presencePenalty: {
76
437
  step: number;
77
438
  default: number;
78
439
  };
79
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
80
- };
81
- declare const seed: {
82
- def: {
440
+ readonly seed: {
83
441
  type: "range";
84
442
  param: string;
85
443
  title: string;
@@ -89,10 +447,7 @@ declare const seed: {
89
447
  step: number;
90
448
  default: number;
91
449
  };
92
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
93
- };
94
- declare const responseFormat: {
95
- def: {
450
+ readonly responseFormat: {
96
451
  type: "select-string";
97
452
  param: string;
98
453
  title: string;
@@ -100,10 +455,24 @@ declare const responseFormat: {
100
455
  default: string;
101
456
  choices: string[];
102
457
  };
103
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
104
- };
105
- declare const toolChoice: {
106
- def: {
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: {
107
476
  type: "select-string";
108
477
  param: string;
109
478
  title: string;
@@ -111,42 +480,10 @@ declare const toolChoice: {
111
480
  default: string;
112
481
  choices: string[];
113
482
  };
114
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
115
483
  };
116
484
 
117
- declare const BaseConfigSchema: (maxOutputTokens: number, maxSequences: number) => z.ZodObject<{
118
- temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
119
- maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
120
- stop: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
121
- topP: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
122
- frequencyPenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
123
- presencePenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
124
- seed: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodNumber>>, number | undefined, number | undefined>;
125
- responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
126
- toolChoice: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
127
- }, "strip", z.ZodTypeAny, {
128
- temperature?: number | undefined;
129
- seed?: number | undefined;
130
- stop?: string[] | undefined;
131
- maxTokens?: number | undefined;
132
- topP?: number | undefined;
133
- frequencyPenalty?: number | undefined;
134
- presencePenalty?: number | undefined;
135
- responseFormat?: string | undefined;
136
- toolChoice?: string | undefined;
137
- }, {
138
- temperature?: number | undefined;
139
- seed?: number | undefined;
140
- stop?: string[] | undefined;
141
- maxTokens?: number | undefined;
142
- topP?: number | undefined;
143
- frequencyPenalty?: number | undefined;
144
- presencePenalty?: number | undefined;
145
- responseFormat?: string | undefined;
146
- toolChoice?: string | undefined;
147
- }>;
148
- declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) => {
149
- readonly temperature: {
485
+ declare const temperature: {
486
+ def: {
150
487
  type: "range";
151
488
  param: string;
152
489
  title: string;
@@ -156,7 +493,10 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
156
493
  step: number;
157
494
  default: number;
158
495
  };
159
- readonly maxTokens: {
496
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
497
+ };
498
+ declare const maxTokens: (maxOutputTokens: number) => {
499
+ def: {
160
500
  type: "range";
161
501
  param: string;
162
502
  title: string;
@@ -166,14 +506,20 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
166
506
  step: number;
167
507
  default: number;
168
508
  };
169
- readonly stop: {
509
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
510
+ };
511
+ declare const stop: (maxSequences: number) => {
512
+ def: {
170
513
  type: "multi-string";
171
514
  param: string;
172
515
  title: string;
173
516
  description: string;
174
517
  max: number;
175
518
  };
176
- readonly topP: {
519
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
520
+ };
521
+ declare const topP: {
522
+ def: {
177
523
  type: "range";
178
524
  param: string;
179
525
  title: string;
@@ -183,7 +529,10 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
183
529
  step: number;
184
530
  default: number;
185
531
  };
186
- readonly frequencyPenalty: {
532
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
533
+ };
534
+ declare const frequencyPenalty: {
535
+ def: {
187
536
  type: "range";
188
537
  param: string;
189
538
  title: string;
@@ -193,7 +542,23 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
193
542
  step: number;
194
543
  default: number;
195
544
  };
196
- readonly presencePenalty: {
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: {
197
562
  type: "range";
198
563
  param: string;
199
564
  title: string;
@@ -203,7 +568,20 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
203
568
  step: number;
204
569
  default: number;
205
570
  };
206
- readonly seed: {
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: {
207
585
  type: "range";
208
586
  param: string;
209
587
  title: string;
@@ -213,7 +591,10 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
213
591
  step: number;
214
592
  default: number;
215
593
  };
216
- readonly responseFormat: {
594
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
595
+ };
596
+ declare const responseFormat: {
597
+ def: {
217
598
  type: "select-string";
218
599
  param: string;
219
600
  title: string;
@@ -221,7 +602,10 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
221
602
  default: string;
222
603
  choices: string[];
223
604
  };
224
- readonly toolChoice: {
605
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
606
+ };
607
+ declare const toolChoice: {
608
+ def: {
225
609
  type: "select-string";
226
610
  param: string;
227
611
  title: string;
@@ -229,9 +613,10 @@ declare const BaseConfigDef: (maxOutputTokens: number, maxSequences: number) =>
229
613
  default: string;
230
614
  choices: string[];
231
615
  };
616
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
232
617
  };
233
618
 
234
- declare const ResponseSchemaConfigDef: (maxOutputTokens: number, maxSequences: number) => {
619
+ declare const ChatModelResponseSchemaConfigDef: (maxOutputTokens: number, maxSequences: number) => {
235
620
  responseFormat: {
236
621
  type: "select-string";
237
622
  param: string;
@@ -296,425 +681,155 @@ declare const ResponseSchemaConfigDef: (maxOutputTokens: number, maxSequences: n
296
681
  };
297
682
  presencePenalty: {
298
683
  type: "range";
299
- param: string;
300
- title: string;
301
- description: string;
302
- max: number;
303
- min: number;
304
- step: number;
305
- default: number;
306
- };
307
- seed: {
308
- type: "range";
309
- param: string;
310
- title: string;
311
- description: string;
312
- max: number;
313
- min: number;
314
- step: number;
315
- default: number;
316
- };
317
- toolChoice: {
318
- type: "select-string";
319
- param: string;
320
- title: string;
321
- description: string;
322
- default: string;
323
- choices: string[];
324
- };
325
- };
326
- declare const ResponseSchemaConfigSchema: (maxOutputTokens: number, maxSequences: number) => z.ZodObject<z.objectUtil.extendShape<{
327
- temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
328
- maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
329
- stop: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
330
- topP: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
331
- frequencyPenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
332
- presencePenalty: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
333
- seed: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodNumber>>, number | undefined, number | undefined>;
334
- responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
335
- toolChoice: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
336
- }, {
337
- responseFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
338
- responseSchema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, {
339
- [x: string]: any;
340
- }, {
341
- [x: string]: any;
342
- }>;
343
- }>, "strip", z.ZodTypeAny, {
344
- responseSchema: {
345
- [x: string]: any;
346
- };
347
- temperature?: number | undefined;
348
- seed?: number | undefined;
349
- stop?: string[] | undefined;
350
- maxTokens?: number | undefined;
351
- topP?: number | undefined;
352
- frequencyPenalty?: number | undefined;
353
- presencePenalty?: number | undefined;
354
- responseFormat?: string | undefined;
355
- toolChoice?: string | undefined;
356
- }, {
357
- responseSchema: {
358
- [x: string]: any;
359
- };
360
- temperature?: number | undefined;
361
- seed?: number | undefined;
362
- stop?: string[] | undefined;
363
- maxTokens?: number | undefined;
364
- topP?: number | undefined;
365
- frequencyPenalty?: number | undefined;
366
- presencePenalty?: number | undefined;
367
- responseFormat?: string | undefined;
368
- toolChoice?: string | undefined;
369
- }>;
370
-
371
- declare const BaseWordEmbeddingConfigSchema: () => z.ZodObject<{
372
- encodingFormat: z.ZodOptional<z.ZodDefault<z.ZodEnum<[string, ...string[]]>>>;
373
- dimensions: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
374
- }, "strip", z.ZodTypeAny, {
375
- dimensions?: number | undefined;
376
- encodingFormat?: string | undefined;
377
- }, {
378
- dimensions?: number | undefined;
379
- encodingFormat?: string | undefined;
380
- }>;
381
- declare const BaseWordEmbeddingConfigDef: () => {
382
- readonly encodingFormat: {
383
- type: "select-string";
384
- param: string;
385
- title: string;
386
- description: string;
387
- default: string;
388
- choices: string[];
389
- };
390
- readonly dimensions: {
391
- type: "range";
392
- param: string;
393
- title: string;
394
- description: string;
395
- max: number;
396
- min: number;
397
- step: number;
398
- default: number;
399
- };
400
- };
401
-
402
- declare const encodingFormat: {
403
- def: {
404
- type: "select-string";
405
- param: string;
406
- title: string;
407
- description: string;
408
- default: string;
409
- choices: string[];
410
- };
411
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
412
- };
413
- declare const dimensions: {
414
- def: {
415
- type: "range";
416
- param: string;
417
- title: string;
418
- description: string;
419
- max: number;
420
- min: number;
421
- step: number;
422
- default: number;
423
- };
424
- schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
425
- };
426
-
427
- declare const OpenAIConfigs: {
428
- readonly base: (maxOutputTokens: number, maxSequences: number) => {
429
- def: {
430
- readonly temperature: {
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 maxTokens: {
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 stop: {
451
- type: "multi-string";
452
- param: string;
453
- title: string;
454
- description: string;
455
- max: number;
456
- };
457
- readonly topP: {
458
- type: "range";
459
- param: string;
460
- title: string;
461
- description: string;
462
- max: number;
463
- min: number;
464
- step: number;
465
- default: number;
466
- };
467
- readonly frequencyPenalty: {
468
- type: "range";
469
- param: string;
470
- title: string;
471
- description: string;
472
- max: number;
473
- min: number;
474
- step: number;
475
- default: number;
476
- };
477
- readonly presencePenalty: {
478
- type: "range";
479
- param: string;
480
- title: string;
481
- description: string;
482
- max: number;
483
- min: number;
484
- step: number;
485
- default: number;
486
- };
487
- readonly seed: {
488
- type: "range";
489
- param: string;
490
- title: string;
491
- description: string;
492
- max: number;
493
- min: number;
494
- step: number;
495
- default: number;
496
- };
497
- readonly responseFormat: {
498
- type: "select-string";
499
- param: string;
500
- title: string;
501
- description: string;
502
- default: string;
503
- choices: string[];
504
- };
505
- readonly toolChoice: {
506
- type: "select-string";
507
- param: string;
508
- title: string;
509
- description: string;
510
- default: string;
511
- choices: string[];
512
- };
513
- };
514
- schema: zod.ZodObject<{
515
- temperature: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
516
- maxTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
517
- stop: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
518
- topP: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
519
- frequencyPenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
520
- presencePenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
521
- seed: zod.ZodEffects<zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>, number | undefined, number | undefined>;
522
- responseFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
523
- toolChoice: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
524
- }, "strip", zod.ZodTypeAny, {
525
- temperature?: number | undefined;
526
- seed?: number | undefined;
527
- stop?: string[] | undefined;
528
- maxTokens?: number | undefined;
529
- topP?: number | undefined;
530
- frequencyPenalty?: number | undefined;
531
- presencePenalty?: number | undefined;
532
- responseFormat?: string | undefined;
533
- toolChoice?: string | undefined;
534
- }, {
535
- temperature?: number | undefined;
536
- seed?: number | undefined;
537
- stop?: string[] | undefined;
538
- maxTokens?: number | undefined;
539
- topP?: number | undefined;
540
- frequencyPenalty?: number | undefined;
541
- presencePenalty?: number | undefined;
542
- responseFormat?: string | undefined;
543
- toolChoice?: string | undefined;
544
- }>;
684
+ param: string;
685
+ title: string;
686
+ description: string;
687
+ max: number;
688
+ min: number;
689
+ step: number;
690
+ default: number;
545
691
  };
546
- readonly responseSchema: (maxOutputTokens: number, maxSequences: number) => {
547
- def: {
548
- responseFormat: {
549
- type: "select-string";
550
- param: string;
551
- title: string;
552
- description: string;
553
- default: string;
554
- choices: string[];
555
- };
556
- responseSchema: {
557
- type: "object-schema";
558
- param: string;
559
- title: string;
560
- description: string;
561
- objectSchema?: any;
562
- };
563
- temperature: {
564
- type: "range";
565
- param: string;
566
- title: string;
567
- description: string;
568
- max: number;
569
- min: number;
570
- step: number;
571
- default: number;
572
- };
573
- maxTokens: {
574
- type: "range";
575
- param: string;
576
- title: string;
577
- description: string;
578
- max: number;
579
- min: number;
580
- step: number;
581
- default: number;
582
- };
583
- stop: {
584
- type: "multi-string";
585
- param: string;
586
- title: string;
587
- description: string;
588
- max: number;
589
- };
590
- topP: {
591
- type: "range";
592
- param: string;
593
- title: string;
594
- description: string;
595
- max: number;
596
- min: number;
597
- step: number;
598
- default: number;
599
- };
600
- frequencyPenalty: {
601
- type: "range";
602
- param: string;
603
- title: string;
604
- description: string;
605
- max: number;
606
- min: number;
607
- step: number;
608
- default: number;
609
- };
610
- presencePenalty: {
611
- type: "range";
612
- param: string;
613
- title: string;
614
- description: string;
615
- max: number;
616
- min: number;
617
- step: number;
618
- default: number;
619
- };
620
- seed: {
621
- type: "range";
622
- param: string;
623
- title: string;
624
- description: string;
625
- max: number;
626
- min: number;
627
- step: number;
628
- default: number;
629
- };
630
- toolChoice: {
631
- type: "select-string";
632
- param: string;
633
- title: string;
634
- description: string;
635
- default: string;
636
- choices: string[];
637
- };
638
- };
639
- schema: zod.ZodObject<zod.objectUtil.extendShape<{
640
- temperature: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
641
- maxTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
642
- stop: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
643
- topP: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
644
- frequencyPenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
645
- presencePenalty: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
646
- seed: zod.ZodEffects<zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>, number | undefined, number | undefined>;
647
- responseFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
648
- toolChoice: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
649
- }, {
650
- responseFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
651
- responseSchema: zod.ZodObject<zod.ZodRawShape, zod.UnknownKeysParam, zod.ZodTypeAny, {
652
- [x: string]: any;
653
- }, {
654
- [x: string]: any;
655
- }>;
656
- }>, "strip", zod.ZodTypeAny, {
657
- responseSchema: {
658
- [x: string]: any;
659
- };
660
- temperature?: number | undefined;
661
- seed?: number | undefined;
662
- stop?: string[] | undefined;
663
- maxTokens?: number | undefined;
664
- topP?: number | undefined;
665
- frequencyPenalty?: number | undefined;
666
- presencePenalty?: number | undefined;
667
- responseFormat?: string | undefined;
668
- toolChoice?: string | undefined;
669
- }, {
670
- responseSchema: {
671
- [x: string]: any;
672
- };
673
- temperature?: number | undefined;
674
- seed?: number | undefined;
675
- stop?: string[] | undefined;
676
- maxTokens?: number | undefined;
677
- topP?: number | undefined;
678
- frequencyPenalty?: number | undefined;
679
- presencePenalty?: number | undefined;
680
- responseFormat?: string | undefined;
681
- toolChoice?: string | undefined;
682
- }>;
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[];
683
818
  };
819
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
684
820
  };
685
- declare const OpenAIWordEmbeddingConfigs: {
686
- readonly base: () => {
687
- def: {
688
- readonly encodingFormat: {
689
- type: "select-string";
690
- param: string;
691
- title: string;
692
- description: string;
693
- default: string;
694
- choices: string[];
695
- };
696
- readonly dimensions: {
697
- type: "range";
698
- param: string;
699
- title: string;
700
- description: string;
701
- max: number;
702
- min: number;
703
- step: number;
704
- default: number;
705
- };
706
- };
707
- schema: zod.ZodObject<{
708
- encodingFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodEnum<[string, ...string[]]>>>;
709
- dimensions: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
710
- }, "strip", zod.ZodTypeAny, {
711
- dimensions?: number | undefined;
712
- encodingFormat?: string | undefined;
713
- }, {
714
- dimensions?: number | undefined;
715
- encodingFormat?: string | undefined;
716
- }>;
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;
717
831
  };
832
+ schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
718
833
  };
719
834
 
720
835
  declare const OpenAIChatModelRoles: z.ZodEnum<["system", "user", "assistant", "tool"]>;
@@ -761,7 +876,7 @@ declare const OpenAICompleteChatResponse: z.ZodObject<{
761
876
  object: z.ZodLiteral<"chat.completion">;
762
877
  created: z.ZodNumber;
763
878
  model: z.ZodString;
764
- system_fingerprint: z.ZodAny;
879
+ system_fingerprint: z.ZodString;
765
880
  choices: z.ZodArray<z.ZodObject<{
766
881
  index: z.ZodNumber;
767
882
  message: z.ZodObject<{
@@ -799,6 +914,7 @@ declare const OpenAICompleteChatResponse: z.ZodObject<{
799
914
  }, "strip", z.ZodTypeAny, {
800
915
  role: string;
801
916
  content?: string | null | undefined;
917
+ refusal?: string | null | undefined;
802
918
  tool_calls?: {
803
919
  function: {
804
920
  name: string;
@@ -807,10 +923,165 @@ declare const OpenAICompleteChatResponse: z.ZodObject<{
807
923
  type: "function";
808
924
  id: string;
809
925
  }[] | undefined;
926
+ }, {
927
+ role: string;
928
+ content?: string | null | undefined;
810
929
  refusal?: string | null | undefined;
930
+ tool_calls?: {
931
+ function: {
932
+ name: string;
933
+ arguments: string;
934
+ };
935
+ type: "function";
936
+ id: string;
937
+ }[] | undefined;
938
+ }>;
939
+ logprobs: z.ZodNullable<z.ZodObject<{
940
+ content: z.ZodNullable<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
941
+ token: z.ZodString;
942
+ logprob: z.ZodNumber;
943
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
944
+ }, {
945
+ top_logprobs: z.ZodArray<z.ZodObject<{
946
+ token: z.ZodString;
947
+ logprob: z.ZodNumber;
948
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
949
+ }, "strip", z.ZodTypeAny, {
950
+ token: string;
951
+ logprob: number;
952
+ bytes: number[] | null;
953
+ }, {
954
+ token: string;
955
+ logprob: number;
956
+ bytes: number[] | null;
957
+ }>, "many">;
958
+ }>, "strip", z.ZodTypeAny, {
959
+ top_logprobs: {
960
+ token: string;
961
+ logprob: number;
962
+ bytes: number[] | null;
963
+ }[];
964
+ token: string;
965
+ logprob: number;
966
+ bytes: number[] | null;
967
+ }, {
968
+ top_logprobs: {
969
+ token: string;
970
+ logprob: number;
971
+ bytes: number[] | null;
972
+ }[];
973
+ token: string;
974
+ logprob: number;
975
+ bytes: number[] | null;
976
+ }>, "many">>;
977
+ refusal: z.ZodNullable<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
978
+ token: z.ZodString;
979
+ logprob: z.ZodNumber;
980
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
981
+ }, {
982
+ top_logprobs: z.ZodArray<z.ZodObject<{
983
+ token: z.ZodString;
984
+ logprob: z.ZodNumber;
985
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
986
+ }, "strip", z.ZodTypeAny, {
987
+ token: string;
988
+ logprob: number;
989
+ bytes: number[] | null;
990
+ }, {
991
+ token: string;
992
+ logprob: number;
993
+ bytes: number[] | null;
994
+ }>, "many">;
995
+ }>, "strip", z.ZodTypeAny, {
996
+ top_logprobs: {
997
+ token: string;
998
+ logprob: number;
999
+ bytes: number[] | null;
1000
+ }[];
1001
+ token: string;
1002
+ logprob: number;
1003
+ bytes: number[] | null;
1004
+ }, {
1005
+ top_logprobs: {
1006
+ token: string;
1007
+ logprob: number;
1008
+ bytes: number[] | null;
1009
+ }[];
1010
+ token: string;
1011
+ logprob: number;
1012
+ bytes: number[] | null;
1013
+ }>, "many">>;
1014
+ }, "strip", z.ZodTypeAny, {
1015
+ content: {
1016
+ top_logprobs: {
1017
+ token: string;
1018
+ logprob: number;
1019
+ bytes: number[] | null;
1020
+ }[];
1021
+ token: string;
1022
+ logprob: number;
1023
+ bytes: number[] | null;
1024
+ }[] | null;
1025
+ refusal: {
1026
+ top_logprobs: {
1027
+ token: string;
1028
+ logprob: number;
1029
+ bytes: number[] | null;
1030
+ }[];
1031
+ token: string;
1032
+ logprob: number;
1033
+ bytes: number[] | null;
1034
+ }[] | null;
811
1035
  }, {
1036
+ content: {
1037
+ top_logprobs: {
1038
+ token: string;
1039
+ logprob: number;
1040
+ bytes: number[] | null;
1041
+ }[];
1042
+ token: string;
1043
+ logprob: number;
1044
+ bytes: number[] | null;
1045
+ }[] | null;
1046
+ refusal: {
1047
+ top_logprobs: {
1048
+ token: string;
1049
+ logprob: number;
1050
+ bytes: number[] | null;
1051
+ }[];
1052
+ token: string;
1053
+ logprob: number;
1054
+ bytes: number[] | null;
1055
+ }[] | null;
1056
+ }>>;
1057
+ finish_reason: z.ZodString;
1058
+ }, "strip", z.ZodTypeAny, {
1059
+ logprobs: {
1060
+ content: {
1061
+ top_logprobs: {
1062
+ token: string;
1063
+ logprob: number;
1064
+ bytes: number[] | null;
1065
+ }[];
1066
+ token: string;
1067
+ logprob: number;
1068
+ bytes: number[] | null;
1069
+ }[] | null;
1070
+ refusal: {
1071
+ top_logprobs: {
1072
+ token: string;
1073
+ logprob: number;
1074
+ bytes: number[] | null;
1075
+ }[];
1076
+ token: string;
1077
+ logprob: number;
1078
+ bytes: number[] | null;
1079
+ }[] | null;
1080
+ } | null;
1081
+ message: {
812
1082
  role: string;
813
1083
  content?: string | null | undefined;
1084
+ refusal?: string | null | undefined;
814
1085
  tool_calls?: {
815
1086
  function: {
816
1087
  name: string;
@@ -819,14 +1090,140 @@ declare const OpenAICompleteChatResponse: z.ZodObject<{
819
1090
  type: "function";
820
1091
  id: string;
821
1092
  }[] | undefined;
1093
+ };
1094
+ index: number;
1095
+ finish_reason: string;
1096
+ }, {
1097
+ logprobs: {
1098
+ content: {
1099
+ top_logprobs: {
1100
+ token: string;
1101
+ logprob: number;
1102
+ bytes: number[] | null;
1103
+ }[];
1104
+ token: string;
1105
+ logprob: number;
1106
+ bytes: number[] | null;
1107
+ }[] | null;
1108
+ refusal: {
1109
+ top_logprobs: {
1110
+ token: string;
1111
+ logprob: number;
1112
+ bytes: number[] | null;
1113
+ }[];
1114
+ token: string;
1115
+ logprob: number;
1116
+ bytes: number[] | null;
1117
+ }[] | null;
1118
+ } | null;
1119
+ message: {
1120
+ role: string;
1121
+ content?: string | null | undefined;
822
1122
  refusal?: string | null | undefined;
823
- }>;
824
- logprobs: z.ZodAny;
825
- finish_reason: z.ZodAny;
1123
+ tool_calls?: {
1124
+ function: {
1125
+ name: string;
1126
+ arguments: string;
1127
+ };
1128
+ type: "function";
1129
+ id: string;
1130
+ }[] | undefined;
1131
+ };
1132
+ index: number;
1133
+ finish_reason: string;
1134
+ }>, "many">;
1135
+ usage: z.ZodObject<{
1136
+ prompt_tokens: z.ZodNumber;
1137
+ completion_tokens: z.ZodNumber;
1138
+ total_tokens: z.ZodNumber;
826
1139
  }, "strip", z.ZodTypeAny, {
1140
+ prompt_tokens: number;
1141
+ completion_tokens: number;
1142
+ total_tokens: number;
1143
+ }, {
1144
+ prompt_tokens: number;
1145
+ completion_tokens: number;
1146
+ total_tokens: number;
1147
+ }>;
1148
+ }, "strip", z.ZodTypeAny, {
1149
+ object: "chat.completion";
1150
+ choices: {
1151
+ logprobs: {
1152
+ content: {
1153
+ top_logprobs: {
1154
+ token: string;
1155
+ logprob: number;
1156
+ bytes: number[] | null;
1157
+ }[];
1158
+ token: string;
1159
+ logprob: number;
1160
+ bytes: number[] | null;
1161
+ }[] | null;
1162
+ refusal: {
1163
+ top_logprobs: {
1164
+ token: string;
1165
+ logprob: number;
1166
+ bytes: number[] | null;
1167
+ }[];
1168
+ token: string;
1169
+ logprob: number;
1170
+ bytes: number[] | null;
1171
+ }[] | null;
1172
+ } | null;
1173
+ message: {
1174
+ role: string;
1175
+ content?: string | null | undefined;
1176
+ refusal?: string | null | undefined;
1177
+ tool_calls?: {
1178
+ function: {
1179
+ name: string;
1180
+ arguments: string;
1181
+ };
1182
+ type: "function";
1183
+ id: string;
1184
+ }[] | undefined;
1185
+ };
1186
+ index: number;
1187
+ finish_reason: string;
1188
+ }[];
1189
+ id: string;
1190
+ created: number;
1191
+ model: string;
1192
+ system_fingerprint: string;
1193
+ usage: {
1194
+ prompt_tokens: number;
1195
+ completion_tokens: number;
1196
+ total_tokens: number;
1197
+ };
1198
+ }, {
1199
+ object: "chat.completion";
1200
+ choices: {
1201
+ logprobs: {
1202
+ content: {
1203
+ top_logprobs: {
1204
+ token: string;
1205
+ logprob: number;
1206
+ bytes: number[] | null;
1207
+ }[];
1208
+ token: string;
1209
+ logprob: number;
1210
+ bytes: number[] | null;
1211
+ }[] | null;
1212
+ refusal: {
1213
+ top_logprobs: {
1214
+ token: string;
1215
+ logprob: number;
1216
+ bytes: number[] | null;
1217
+ }[];
1218
+ token: string;
1219
+ logprob: number;
1220
+ bytes: number[] | null;
1221
+ }[] | null;
1222
+ } | null;
827
1223
  message: {
828
1224
  role: string;
829
1225
  content?: string | null | undefined;
1226
+ refusal?: string | null | undefined;
830
1227
  tool_calls?: {
831
1228
  function: {
832
1229
  name: string;
@@ -835,30 +1232,316 @@ declare const OpenAICompleteChatResponse: z.ZodObject<{
835
1232
  type: "function";
836
1233
  id: string;
837
1234
  }[] | undefined;
1235
+ };
1236
+ index: number;
1237
+ finish_reason: string;
1238
+ }[];
1239
+ id: string;
1240
+ created: number;
1241
+ model: string;
1242
+ system_fingerprint: string;
1243
+ usage: {
1244
+ prompt_tokens: number;
1245
+ completion_tokens: number;
1246
+ total_tokens: number;
1247
+ };
1248
+ }>;
1249
+ type OpenAICompleteChatResponseType = z.infer<typeof OpenAICompleteChatResponse>;
1250
+ declare const OpenAIToolCallsStreamChatResponse: z.ZodArray<z.ZodObject<{
1251
+ index: z.ZodNumber;
1252
+ id: z.ZodOptional<z.ZodString>;
1253
+ type: z.ZodOptional<z.ZodEnum<["function"]>>;
1254
+ function: z.ZodOptional<z.ZodObject<{
1255
+ name: z.ZodOptional<z.ZodString>;
1256
+ arguments: z.ZodOptional<z.ZodString>;
1257
+ }, "strip", z.ZodTypeAny, {
1258
+ name?: string | undefined;
1259
+ arguments?: string | undefined;
1260
+ }, {
1261
+ name?: string | undefined;
1262
+ arguments?: string | undefined;
1263
+ }>>;
1264
+ }, "strip", z.ZodTypeAny, {
1265
+ index: number;
1266
+ function?: {
1267
+ name?: string | undefined;
1268
+ arguments?: string | undefined;
1269
+ } | undefined;
1270
+ type?: "function" | undefined;
1271
+ id?: string | undefined;
1272
+ }, {
1273
+ index: number;
1274
+ function?: {
1275
+ name?: string | undefined;
1276
+ arguments?: string | undefined;
1277
+ } | undefined;
1278
+ type?: "function" | undefined;
1279
+ id?: string | undefined;
1280
+ }>, "many">;
1281
+ declare const OpenAIStreamChatResponse: z.ZodObject<{
1282
+ id: z.ZodString;
1283
+ object: z.ZodString;
1284
+ created: z.ZodNumber;
1285
+ model: z.ZodString;
1286
+ system_fingerprint: z.ZodNullable<z.ZodString>;
1287
+ choices: z.ZodArray<z.ZodObject<{
1288
+ index: z.ZodNumber;
1289
+ delta: z.ZodUnion<[z.ZodObject<{
1290
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1291
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1292
+ index: z.ZodNumber;
1293
+ id: z.ZodOptional<z.ZodString>;
1294
+ type: z.ZodOptional<z.ZodEnum<["function"]>>;
1295
+ function: z.ZodOptional<z.ZodObject<{
1296
+ name: z.ZodOptional<z.ZodString>;
1297
+ arguments: z.ZodOptional<z.ZodString>;
1298
+ }, "strip", z.ZodTypeAny, {
1299
+ name?: string | undefined;
1300
+ arguments?: string | undefined;
1301
+ }, {
1302
+ name?: string | undefined;
1303
+ arguments?: string | undefined;
1304
+ }>>;
1305
+ }, "strip", z.ZodTypeAny, {
1306
+ index: number;
1307
+ function?: {
1308
+ name?: string | undefined;
1309
+ arguments?: string | undefined;
1310
+ } | undefined;
1311
+ type?: "function" | undefined;
1312
+ id?: string | undefined;
1313
+ }, {
1314
+ index: number;
1315
+ function?: {
1316
+ name?: string | undefined;
1317
+ arguments?: string | undefined;
1318
+ } | undefined;
1319
+ type?: "function" | undefined;
1320
+ id?: string | undefined;
1321
+ }>, "many">>;
1322
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1323
+ }, "strip", z.ZodTypeAny, {
1324
+ content?: string | null | undefined;
1325
+ refusal?: string | null | undefined;
1326
+ tool_calls?: {
1327
+ index: number;
1328
+ function?: {
1329
+ name?: string | undefined;
1330
+ arguments?: string | undefined;
1331
+ } | undefined;
1332
+ type?: "function" | undefined;
1333
+ id?: string | undefined;
1334
+ }[] | undefined;
1335
+ }, {
1336
+ content?: string | null | undefined;
1337
+ refusal?: string | null | undefined;
1338
+ tool_calls?: {
1339
+ index: number;
1340
+ function?: {
1341
+ name?: string | undefined;
1342
+ arguments?: string | undefined;
1343
+ } | undefined;
1344
+ type?: "function" | undefined;
1345
+ id?: string | undefined;
1346
+ }[] | undefined;
1347
+ }>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>;
1348
+ logprobs: z.ZodNullable<z.ZodObject<{
1349
+ content: z.ZodNullable<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
1350
+ token: z.ZodString;
1351
+ logprob: z.ZodNumber;
1352
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
1353
+ }, {
1354
+ top_logprobs: z.ZodArray<z.ZodObject<{
1355
+ token: z.ZodString;
1356
+ logprob: z.ZodNumber;
1357
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
1358
+ }, "strip", z.ZodTypeAny, {
1359
+ token: string;
1360
+ logprob: number;
1361
+ bytes: number[] | null;
1362
+ }, {
1363
+ token: string;
1364
+ logprob: number;
1365
+ bytes: number[] | null;
1366
+ }>, "many">;
1367
+ }>, "strip", z.ZodTypeAny, {
1368
+ top_logprobs: {
1369
+ token: string;
1370
+ logprob: number;
1371
+ bytes: number[] | null;
1372
+ }[];
1373
+ token: string;
1374
+ logprob: number;
1375
+ bytes: number[] | null;
1376
+ }, {
1377
+ top_logprobs: {
1378
+ token: string;
1379
+ logprob: number;
1380
+ bytes: number[] | null;
1381
+ }[];
1382
+ token: string;
1383
+ logprob: number;
1384
+ bytes: number[] | null;
1385
+ }>, "many">>;
1386
+ refusal: z.ZodNullable<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
1387
+ token: z.ZodString;
1388
+ logprob: z.ZodNumber;
1389
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
1390
+ }, {
1391
+ top_logprobs: z.ZodArray<z.ZodObject<{
1392
+ token: z.ZodString;
1393
+ logprob: z.ZodNumber;
1394
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
1395
+ }, "strip", z.ZodTypeAny, {
1396
+ token: string;
1397
+ logprob: number;
1398
+ bytes: number[] | null;
1399
+ }, {
1400
+ token: string;
1401
+ logprob: number;
1402
+ bytes: number[] | null;
1403
+ }>, "many">;
1404
+ }>, "strip", z.ZodTypeAny, {
1405
+ top_logprobs: {
1406
+ token: string;
1407
+ logprob: number;
1408
+ bytes: number[] | null;
1409
+ }[];
1410
+ token: string;
1411
+ logprob: number;
1412
+ bytes: number[] | null;
1413
+ }, {
1414
+ top_logprobs: {
1415
+ token: string;
1416
+ logprob: number;
1417
+ bytes: number[] | null;
1418
+ }[];
1419
+ token: string;
1420
+ logprob: number;
1421
+ bytes: number[] | null;
1422
+ }>, "many">>;
1423
+ }, "strip", z.ZodTypeAny, {
1424
+ content: {
1425
+ top_logprobs: {
1426
+ token: string;
1427
+ logprob: number;
1428
+ bytes: number[] | null;
1429
+ }[];
1430
+ token: string;
1431
+ logprob: number;
1432
+ bytes: number[] | null;
1433
+ }[] | null;
1434
+ refusal: {
1435
+ top_logprobs: {
1436
+ token: string;
1437
+ logprob: number;
1438
+ bytes: number[] | null;
1439
+ }[];
1440
+ token: string;
1441
+ logprob: number;
1442
+ bytes: number[] | null;
1443
+ }[] | null;
1444
+ }, {
1445
+ content: {
1446
+ top_logprobs: {
1447
+ token: string;
1448
+ logprob: number;
1449
+ bytes: number[] | null;
1450
+ }[];
1451
+ token: string;
1452
+ logprob: number;
1453
+ bytes: number[] | null;
1454
+ }[] | null;
1455
+ refusal: {
1456
+ top_logprobs: {
1457
+ token: string;
1458
+ logprob: number;
1459
+ bytes: number[] | null;
1460
+ }[];
1461
+ token: string;
1462
+ logprob: number;
1463
+ bytes: number[] | null;
1464
+ }[] | null;
1465
+ }>>;
1466
+ finish_reason: z.ZodNullable<z.ZodString>;
1467
+ }, "strip", z.ZodTypeAny, {
1468
+ logprobs: {
1469
+ content: {
1470
+ top_logprobs: {
1471
+ token: string;
1472
+ logprob: number;
1473
+ bytes: number[] | null;
1474
+ }[];
1475
+ token: string;
1476
+ logprob: number;
1477
+ bytes: number[] | null;
1478
+ }[] | null;
1479
+ refusal: {
1480
+ top_logprobs: {
1481
+ token: string;
1482
+ logprob: number;
1483
+ bytes: number[] | null;
1484
+ }[];
1485
+ token: string;
1486
+ logprob: number;
1487
+ bytes: number[] | null;
1488
+ }[] | null;
1489
+ } | null;
1490
+ index: number;
1491
+ finish_reason: string | null;
1492
+ delta: {
1493
+ content?: string | null | undefined;
838
1494
  refusal?: string | null | undefined;
839
- };
840
- index: number;
841
- logprobs?: any;
842
- finish_reason?: any;
1495
+ tool_calls?: {
1496
+ index: number;
1497
+ function?: {
1498
+ name?: string | undefined;
1499
+ arguments?: string | undefined;
1500
+ } | undefined;
1501
+ type?: "function" | undefined;
1502
+ id?: string | undefined;
1503
+ }[] | undefined;
1504
+ } | {};
843
1505
  }, {
844
- message: {
845
- role: string;
1506
+ logprobs: {
1507
+ content: {
1508
+ top_logprobs: {
1509
+ token: string;
1510
+ logprob: number;
1511
+ bytes: number[] | null;
1512
+ }[];
1513
+ token: string;
1514
+ logprob: number;
1515
+ bytes: number[] | null;
1516
+ }[] | null;
1517
+ refusal: {
1518
+ top_logprobs: {
1519
+ token: string;
1520
+ logprob: number;
1521
+ bytes: number[] | null;
1522
+ }[];
1523
+ token: string;
1524
+ logprob: number;
1525
+ bytes: number[] | null;
1526
+ }[] | null;
1527
+ } | null;
1528
+ index: number;
1529
+ finish_reason: string | null;
1530
+ delta: {
846
1531
  content?: string | null | undefined;
1532
+ refusal?: string | null | undefined;
847
1533
  tool_calls?: {
848
- function: {
849
- name: string;
850
- arguments: string;
851
- };
852
- type: "function";
853
- id: string;
1534
+ index: number;
1535
+ function?: {
1536
+ name?: string | undefined;
1537
+ arguments?: string | undefined;
1538
+ } | undefined;
1539
+ type?: "function" | undefined;
1540
+ id?: string | undefined;
854
1541
  }[] | undefined;
855
- refusal?: string | null | undefined;
856
- };
857
- index: number;
858
- logprobs?: any;
859
- finish_reason?: any;
1542
+ } | {};
860
1543
  }>, "many">;
861
- usage: z.ZodObject<{
1544
+ usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
862
1545
  prompt_tokens: z.ZodNumber;
863
1546
  completion_tokens: z.ZodNumber;
864
1547
  total_tokens: z.ZodNumber;
@@ -870,260 +1553,1288 @@ declare const OpenAICompleteChatResponse: z.ZodObject<{
870
1553
  prompt_tokens: number;
871
1554
  completion_tokens: number;
872
1555
  total_tokens: number;
873
- }>;
1556
+ }>>>;
874
1557
  }, "strip", z.ZodTypeAny, {
875
- object: "chat.completion";
1558
+ object: string;
876
1559
  choices: {
877
- message: {
878
- role: string;
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: {
879
1585
  content?: string | null | undefined;
1586
+ refusal?: string | null | undefined;
880
1587
  tool_calls?: {
881
- function: {
882
- name: string;
883
- arguments: string;
884
- };
885
- type: "function";
886
- id: string;
1588
+ index: number;
1589
+ function?: {
1590
+ name?: string | undefined;
1591
+ arguments?: string | undefined;
1592
+ } | undefined;
1593
+ type?: "function" | undefined;
1594
+ id?: string | undefined;
887
1595
  }[] | undefined;
888
- refusal?: string | null | undefined;
889
- };
890
- index: number;
891
- logprobs?: any;
892
- finish_reason?: any;
1596
+ } | {};
893
1597
  }[];
894
1598
  id: string;
895
1599
  created: number;
896
1600
  model: string;
897
- usage: {
1601
+ system_fingerprint: string | null;
1602
+ usage?: {
898
1603
  prompt_tokens: number;
899
1604
  completion_tokens: number;
900
1605
  total_tokens: number;
901
- };
902
- system_fingerprint?: any;
1606
+ } | null | undefined;
903
1607
  }, {
904
- object: "chat.completion";
1608
+ object: string;
905
1609
  choices: {
906
- message: {
907
- role: string;
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: {
908
1635
  content?: string | null | undefined;
1636
+ refusal?: string | null | undefined;
909
1637
  tool_calls?: {
910
- function: {
911
- name: string;
912
- arguments: string;
913
- };
914
- type: "function";
915
- id: string;
1638
+ index: number;
1639
+ function?: {
1640
+ name?: string | undefined;
1641
+ arguments?: string | undefined;
1642
+ } | undefined;
1643
+ type?: "function" | undefined;
1644
+ id?: string | undefined;
916
1645
  }[] | undefined;
917
- refusal?: string | null | undefined;
918
- };
919
- index: number;
920
- logprobs?: any;
921
- finish_reason?: any;
1646
+ } | {};
922
1647
  }[];
923
1648
  id: string;
924
1649
  created: number;
925
1650
  model: string;
926
- usage: {
1651
+ system_fingerprint: string | null;
1652
+ usage?: {
927
1653
  prompt_tokens: number;
928
1654
  completion_tokens: number;
929
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;
930
1692
  };
931
- system_fingerprint?: any;
1693
+ type: "function";
932
1694
  }>;
933
- declare const OpenAIToolCallsStreamChatResponse: z.ZodArray<z.ZodObject<{
934
- index: z.ZodNumber;
935
- id: z.ZodOptional<z.ZodString>;
936
- type: z.ZodOptional<z.ZodEnum<["function"]>>;
937
- function: z.ZodOptional<z.ZodObject<{
938
- name: z.ZodOptional<z.ZodString>;
939
- arguments: z.ZodOptional<z.ZodString>;
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;
940
1702
  }, "strip", z.ZodTypeAny, {
941
- name?: string | undefined;
942
- arguments?: string | undefined;
1703
+ name: string;
943
1704
  }, {
944
- name?: string | undefined;
945
- arguments?: string | undefined;
946
- }>>;
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;
2035
+ }, {
2036
+ type: "text";
2037
+ text: string;
2038
+ }>, "many">]>;
2039
+ }, "strip", z.ZodTypeAny, {
2040
+ content: string | {
2041
+ type: "text";
2042
+ text: string;
2043
+ }[];
2044
+ role: "system";
2045
+ }, {
2046
+ content: string | {
2047
+ type: "text";
2048
+ text: string;
2049
+ }[];
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;
947
2211
  }, "strip", z.ZodTypeAny, {
948
- index: number;
949
- function?: {
950
- name?: string | undefined;
951
- arguments?: string | undefined;
952
- } | undefined;
953
- type?: "function" | undefined;
954
- id?: string | undefined;
2212
+ content: string;
2213
+ role: "tool";
2214
+ tool_call_id: string;
955
2215
  }, {
956
- index: number;
957
- function?: {
958
- name?: string | undefined;
959
- arguments?: string | undefined;
960
- } | undefined;
961
- type?: "function" | undefined;
962
- id?: string | undefined;
963
- }>, "many">;
964
- declare const OpenAIStreamChatResponse: z.ZodObject<{
965
- id: z.ZodString;
966
- object: z.ZodString;
967
- created: z.ZodNumber;
968
- model: z.ZodString;
969
- system_fingerprint: z.ZodNullable<z.ZodAny>;
970
- choices: z.ZodArray<z.ZodObject<{
971
- index: z.ZodNumber;
972
- delta: z.ZodUnion<[z.ZodObject<{
973
- content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
974
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
975
- index: z.ZodNumber;
976
- id: z.ZodOptional<z.ZodString>;
977
- type: z.ZodOptional<z.ZodEnum<["function"]>>;
978
- function: z.ZodOptional<z.ZodObject<{
979
- name: z.ZodOptional<z.ZodString>;
980
- arguments: z.ZodOptional<z.ZodString>;
981
- }, "strip", z.ZodTypeAny, {
982
- name?: string | undefined;
983
- arguments?: string | undefined;
984
- }, {
985
- name?: string | undefined;
986
- arguments?: string | undefined;
987
- }>>;
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"]>>;
988
2263
  }, "strip", z.ZodTypeAny, {
989
- index: number;
990
- function?: {
991
- name?: string | undefined;
992
- arguments?: string | undefined;
993
- } | undefined;
994
- type?: "function" | undefined;
995
- id?: string | undefined;
2264
+ url: string;
2265
+ detail?: "auto" | "low" | "high" | undefined;
996
2266
  }, {
997
- index: number;
998
- function?: {
999
- name?: string | undefined;
1000
- arguments?: string | undefined;
1001
- } | undefined;
1002
- type?: "function" | undefined;
1003
- id?: string | undefined;
1004
- }>, "many">>;
1005
- refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2267
+ url: string;
2268
+ detail?: "auto" | "low" | "high" | undefined;
2269
+ }>;
1006
2270
  }, "strip", z.ZodTypeAny, {
1007
- content?: string | null | undefined;
1008
- tool_calls?: {
1009
- index: number;
1010
- function?: {
1011
- name?: string | undefined;
1012
- arguments?: string | undefined;
1013
- } | undefined;
1014
- type?: "function" | undefined;
1015
- id?: string | undefined;
1016
- }[] | undefined;
1017
- refusal?: string | null | undefined;
2271
+ type: "image_url";
2272
+ image_url: {
2273
+ url: string;
2274
+ detail?: "auto" | "low" | "high" | undefined;
2275
+ };
1018
2276
  }, {
1019
- content?: string | null | undefined;
1020
- tool_calls?: {
1021
- index: number;
1022
- function?: {
1023
- name?: string | undefined;
1024
- arguments?: string | undefined;
1025
- } | undefined;
1026
- type?: "function" | undefined;
1027
- id?: string | undefined;
1028
- }[] | undefined;
1029
- refusal?: string | null | undefined;
1030
- }>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>;
1031
- finish_reason: z.ZodNullable<z.ZodAny>;
1032
- logprobs: z.ZodNullable<z.ZodAny>;
2277
+ type: "image_url";
2278
+ image_url: {
2279
+ url: string;
2280
+ detail?: "auto" | "low" | "high" | undefined;
2281
+ };
2282
+ }>]>, "many">]>;
1033
2283
  }, "strip", z.ZodTypeAny, {
1034
- index: number;
1035
- delta: {
1036
- content?: string | null | undefined;
1037
- tool_calls?: {
1038
- index: number;
1039
- function?: {
1040
- name?: string | undefined;
1041
- arguments?: string | undefined;
1042
- } | undefined;
1043
- type?: "function" | undefined;
1044
- id?: string | undefined;
1045
- }[] | undefined;
1046
- refusal?: string | null | undefined;
1047
- } | {};
1048
- logprobs?: any;
1049
- finish_reason?: any;
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";
1050
2295
  }, {
1051
- index: number;
1052
- delta: {
1053
- content?: string | null | undefined;
1054
- tool_calls?: {
1055
- index: number;
1056
- function?: {
1057
- name?: string | undefined;
1058
- arguments?: string | undefined;
1059
- } | undefined;
1060
- type?: "function" | undefined;
1061
- id?: string | undefined;
1062
- }[] | undefined;
1063
- refusal?: string | null | undefined;
1064
- } | {};
1065
- logprobs?: any;
1066
- finish_reason?: any;
1067
- }>, "many">;
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
+ }>]>>;
1068
2521
  }, "strip", z.ZodTypeAny, {
1069
- object: string;
1070
- choices: {
1071
- index: number;
1072
- delta: {
1073
- content?: string | null | undefined;
1074
- tool_calls?: {
1075
- index: number;
1076
- function?: {
1077
- name?: string | undefined;
1078
- arguments?: string | undefined;
1079
- } | undefined;
1080
- type?: "function" | undefined;
1081
- id?: string | undefined;
1082
- }[] | undefined;
1083
- refusal?: string | null | undefined;
1084
- } | {};
1085
- logprobs?: any;
1086
- finish_reason?: any;
1087
- }[];
1088
- id: string;
1089
- created: number;
1090
- model: string;
1091
- system_fingerprint?: any;
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;
1092
2595
  }, {
1093
- object: string;
1094
- choices: {
1095
- index: number;
1096
- delta: {
1097
- content?: string | null | undefined;
1098
- tool_calls?: {
1099
- index: number;
1100
- function?: {
1101
- name?: string | undefined;
1102
- arguments?: string | undefined;
1103
- } | undefined;
1104
- type?: "function" | undefined;
1105
- id?: string | undefined;
1106
- }[] | undefined;
1107
- refusal?: string | null | undefined;
1108
- } | {};
1109
- logprobs?: any;
1110
- finish_reason?: any;
1111
- }[];
1112
- id: string;
1113
- created: number;
1114
- model: string;
1115
- system_fingerprint?: any;
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;
1116
2817
  }>;
2818
+ type OpenAIChatRequestType = z.infer<typeof OpenAIChatRequest>;
1117
2819
 
1118
2820
  declare const BaseChatModelOptions: z.ZodObject<{
1119
2821
  apiKey: z.ZodString;
1120
- proxyUrl: z.ZodOptional<z.ZodString>;
2822
+ baseUrl: z.ZodString;
2823
+ completeChatUrl: z.ZodOptional<z.ZodString>;
2824
+ streamChatUrl: z.ZodOptional<z.ZodString>;
2825
+ organization: z.ZodOptional<z.ZodString>;
1121
2826
  }, "strip", z.ZodTypeAny, {
1122
2827
  apiKey: string;
1123
- proxyUrl?: string | undefined;
2828
+ baseUrl: string;
2829
+ completeChatUrl?: string | undefined;
2830
+ streamChatUrl?: string | undefined;
2831
+ organization?: string | undefined;
1124
2832
  }, {
1125
2833
  apiKey: string;
1126
- proxyUrl?: string | undefined;
2834
+ baseUrl: string;
2835
+ completeChatUrl?: string | undefined;
2836
+ streamChatUrl?: string | undefined;
2837
+ organization?: string | undefined;
1127
2838
  }>;
1128
2839
  type BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;
1129
2840
  declare class BaseChatModel implements ChatModelV1<ChatModelSchemaType> {
@@ -1131,23 +2842,36 @@ declare class BaseChatModel implements ChatModelV1<ChatModelSchemaType> {
1131
2842
  modelSchema: ChatModelSchemaType;
1132
2843
  private readonly apiKey;
1133
2844
  private readonly baseUrl;
2845
+ private readonly streamChatUrl;
2846
+ private readonly completeChatUrl;
2847
+ private readonly organization;
1134
2848
  constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType);
1135
- getTokenCount: (messages: MessageType[]) => number;
1136
- getDefaultBaseUrl: () => UrlType;
1137
- getDefaultHeaders: () => HeadersType;
1138
- getDefaultParams: () => ParamsType;
1139
- transformConfig: (config: ConfigType, messages?: MessageType[], tools?: ToolType[]) => ParamsType;
1140
- transformMessages: (messages: MessageType[]) => ParamsType;
1141
- transformTools: (tools: ToolType[]) => ParamsType;
1142
- getCompleteChatUrl: (config: ConfigType, messages: MessageType[], tools?: ToolType[]) => UrlType;
1143
- getCompleteChatHeaders: (config: ConfigType, messages: MessageType[], tools?: ToolType[]) => HeadersType;
1144
- getCompleteChatData: (config: ConfigType, messages: MessageType[], tools?: ToolType[]) => ParamsType;
1145
- transformCompleteChatResponse: (response: any) => MessageType[];
1146
- getStreamChatUrl: (config: ConfigType, messages: MessageType[], tools?: ToolType[]) => UrlType;
1147
- getStreamChatHeaders: (config: ConfigType, messages: MessageType[], tools?: ToolType[]) => HeadersType;
1148
- getStreamChatData: (config: ConfigType, messages: MessageType[], tools?: ToolType[]) => ParamsType;
1149
- transformStreamChatResponseChunk: (chunk: string, buffer: string) => AsyncGenerator<{
1150
- partialMessages: PartialMessageType[];
2849
+ getDefaultBaseUrl(): UrlType;
2850
+ getDefaultHeaders(): HeadersType;
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
+ };
2863
+ transformConfig(config: ConfigType, messages?: MessageType[], tools?: ToolType[]): ParamsType;
2864
+ transformMessages(messages: MessageType[]): ParamsType;
2865
+ transformTools(tools: ToolType[]): ParamsType;
2866
+ getCompleteChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<UrlType>;
2867
+ getCompleteChatHeaders(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<HeadersType>;
2868
+ getCompleteChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): Promise<ParamsType>;
2869
+ transformCompleteChatResponse(response: any): ChatResponseType;
2870
+ getStreamChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<UrlType>;
2871
+ getStreamChatHeaders(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<HeadersType>;
2872
+ getStreamChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): Promise<ParamsType>;
2873
+ transformStreamChatResponseChunk(chunk: string, buffer: string): AsyncGenerator<{
2874
+ partialResponse: PartialChatResponseType;
1151
2875
  buffer: string;
1152
2876
  }>;
1153
2877
  }
@@ -1188,19 +2912,34 @@ declare const GPT4oSchema: {
1188
2912
  title: string;
1189
2913
  description: string;
1190
2914
  objectSchema?: any;
2915
+ } | {
2916
+ type: "select-boolean";
2917
+ param: string;
2918
+ title: string;
2919
+ description: string;
2920
+ default: boolean | null;
1191
2921
  }>;
1192
2922
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
1193
2923
  };
1194
2924
  };
1195
2925
  declare const GPT4oOptions: z.ZodObject<{
1196
2926
  apiKey: z.ZodString;
1197
- proxyUrl: z.ZodOptional<z.ZodString>;
2927
+ baseUrl: z.ZodString;
2928
+ completeChatUrl: z.ZodOptional<z.ZodString>;
2929
+ streamChatUrl: z.ZodOptional<z.ZodString>;
2930
+ organization: z.ZodOptional<z.ZodString>;
1198
2931
  }, "strip", z.ZodTypeAny, {
1199
2932
  apiKey: string;
1200
- proxyUrl?: string | undefined;
2933
+ baseUrl: string;
2934
+ completeChatUrl?: string | undefined;
2935
+ streamChatUrl?: string | undefined;
2936
+ organization?: string | undefined;
1201
2937
  }, {
1202
2938
  apiKey: string;
1203
- proxyUrl?: string | undefined;
2939
+ baseUrl: string;
2940
+ completeChatUrl?: string | undefined;
2941
+ streamChatUrl?: string | undefined;
2942
+ organization?: string | undefined;
1204
2943
  }>;
1205
2944
  type GPT4oOptionsType = z.infer<typeof GPT4oOptions>;
1206
2945
  declare class GPT4o extends BaseChatModel {
@@ -1262,15 +3001,38 @@ declare const OpenAIGetEmbeddingsResponse: z.ZodObject<{
1262
3001
  }[];
1263
3002
  }>;
1264
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
+
1265
3024
  declare const BaseEmbeddingModelOptions: z.ZodObject<{
1266
3025
  apiKey: z.ZodString;
1267
- proxyUrl: z.ZodOptional<z.ZodString>;
3026
+ baseUrl: z.ZodString;
3027
+ getEmbeddingsUrl: z.ZodOptional<z.ZodString>;
1268
3028
  }, "strip", z.ZodTypeAny, {
1269
3029
  apiKey: string;
1270
- proxyUrl?: string | undefined;
3030
+ baseUrl: string;
3031
+ getEmbeddingsUrl?: string | undefined;
1271
3032
  }, {
1272
3033
  apiKey: string;
1273
- proxyUrl?: string | undefined;
3034
+ baseUrl: string;
3035
+ getEmbeddingsUrl?: string | undefined;
1274
3036
  }>;
1275
3037
  type BaseEmbeddingModelOptionsType = z.infer<typeof BaseEmbeddingModelOptions>;
1276
3038
  declare class BaseEmbeddingModel implements EmbeddingModelV1<EmbeddingModelSchemaType> {
@@ -1278,19 +3040,27 @@ declare class BaseEmbeddingModel implements EmbeddingModelV1<EmbeddingModelSchem
1278
3040
  modelSchema: EmbeddingModelSchemaType;
1279
3041
  private readonly apiKey;
1280
3042
  private readonly baseUrl;
3043
+ private readonly getEmbeddingsUrl;
1281
3044
  constructor(modelSchema: EmbeddingModelSchemaType, options: BaseEmbeddingModelOptionsType);
1282
- private validateConfig;
1283
- private validateEmbeddingRequests;
1284
- getDefaultBaseUrl: () => UrlType;
1285
- getDefaultHeaders: () => HeadersType;
1286
- getDefaultParams: () => ParamsType;
1287
- getTokenCount: (requests: EmbeddingRequestsType) => number;
1288
- transformConfig: (config: ConfigType, requests?: EmbeddingRequestsType) => ParamsType;
1289
- transformEmbeddingRequests: (requests: EmbeddingRequestsType) => ParamsType;
1290
- getGetEmbeddingsUrl: (config: ConfigType, requests: EmbeddingRequestsType) => UrlType;
1291
- getGetEmbeddingsHeaders: (config: ConfigType, requests: EmbeddingRequestsType) => HeadersType;
1292
- getGetEmbeddingsData: (config: ConfigType, requests: EmbeddingRequestsType) => ParamsType;
1293
- transformGetEmbeddingsResponse: (response: any) => EmbeddingsType;
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;
1294
3064
  }
1295
3065
 
1296
3066
  declare const TextEmbeddingAda002Schema: {
@@ -1328,19 +3098,28 @@ declare const TextEmbeddingAda002Schema: {
1328
3098
  title: string;
1329
3099
  description: string;
1330
3100
  objectSchema?: any;
3101
+ } | {
3102
+ type: "select-boolean";
3103
+ param: string;
3104
+ title: string;
3105
+ description: string;
3106
+ default: boolean | null;
1331
3107
  }>;
1332
3108
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
1333
3109
  };
1334
3110
  };
1335
3111
  declare const TextEmbeddingAda002Options: z.ZodObject<{
1336
3112
  apiKey: z.ZodString;
1337
- proxyUrl: z.ZodOptional<z.ZodString>;
3113
+ baseUrl: z.ZodString;
3114
+ getEmbeddingsUrl: z.ZodOptional<z.ZodString>;
1338
3115
  }, "strip", z.ZodTypeAny, {
1339
3116
  apiKey: string;
1340
- proxyUrl?: string | undefined;
3117
+ baseUrl: string;
3118
+ getEmbeddingsUrl?: string | undefined;
1341
3119
  }, {
1342
3120
  apiKey: string;
1343
- proxyUrl?: string | undefined;
3121
+ baseUrl: string;
3122
+ getEmbeddingsUrl?: string | undefined;
1344
3123
  }>;
1345
3124
  type TextEmbeddingAda002OptionsType = z.infer<typeof TextEmbeddingAda002Options>;
1346
3125
  declare class TextEmbeddingAda002 extends BaseEmbeddingModel {
@@ -1351,6 +3130,7 @@ declare const ProviderLiteral = "openai";
1351
3130
  declare class OpenAI<O extends Record<string, any> = Record<string, any>> implements ProviderV1<O> {
1352
3131
  readonly version: "v1";
1353
3132
  readonly name = "openai";
3133
+ private readonly baseUrl;
1354
3134
  private readonly chatModelFactories;
1355
3135
  private readonly embeddingModelFactories;
1356
3136
  chatModelLiterals(): string[];
@@ -1363,4 +3143,4 @@ declare class OpenAI<O extends Record<string, any> = Record<string, any>> implem
1363
3143
  embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType>;
1364
3144
  }
1365
3145
 
1366
- export { BaseChatModel, BaseChatModelOptions, type BaseChatModelOptionsType, BaseConfigDef, BaseConfigSchema, BaseEmbeddingModel, BaseEmbeddingModelOptions, type BaseEmbeddingModelOptionsType, BaseWordEmbeddingConfigDef, BaseWordEmbeddingConfigSchema, GPT4o, GPT4oOptions, type GPT4oOptionsType, GPT4oSchema, OpenAI, OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap, OpenAICompleteChatResponse, OpenAIConfigs, OpenAIEmbeddingModelModalities, OpenAIEmbeddingModelModalitiesEnum, OpenAIGetEmbeddingsResponse, OpenAIStreamChatResponse, OpenAIToolCallsCompleteChatResponse, OpenAIToolCallsStreamChatResponse, OpenAIWordEmbeddingConfigs, ProviderLiteral, ResponseSchemaConfigDef, ResponseSchemaConfigSchema, TextEmbeddingAda002, TextEmbeddingAda002Options, type TextEmbeddingAda002OptionsType, TextEmbeddingAda002Schema, dimensions, encodingFormat, frequencyPenalty, maxTokens, presencePenalty, responseFormat, seed, stop, temperature, toolChoice, 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 };