@glueco/plugin-llm-openai 0.1.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.
@@ -0,0 +1,1494 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const ChatMessageSchema: z.ZodObject<{
4
+ role: z.ZodEnum<["system", "user", "assistant", "tool", "function"]>;
5
+ content: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
6
+ type: z.ZodEnum<["text", "image_url"]>;
7
+ text: z.ZodOptional<z.ZodString>;
8
+ image_url: z.ZodOptional<z.ZodObject<{
9
+ url: z.ZodString;
10
+ detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ url: string;
13
+ detail?: "auto" | "low" | "high" | undefined;
14
+ }, {
15
+ url: string;
16
+ detail?: "auto" | "low" | "high" | undefined;
17
+ }>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ type: "text" | "image_url";
20
+ text?: string | undefined;
21
+ image_url?: {
22
+ url: string;
23
+ detail?: "auto" | "low" | "high" | undefined;
24
+ } | undefined;
25
+ }, {
26
+ type: "text" | "image_url";
27
+ text?: string | undefined;
28
+ image_url?: {
29
+ url: string;
30
+ detail?: "auto" | "low" | "high" | undefined;
31
+ } | undefined;
32
+ }>, "many">]>>;
33
+ name: z.ZodOptional<z.ZodString>;
34
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ id: z.ZodString;
36
+ type: z.ZodLiteral<"function">;
37
+ function: z.ZodObject<{
38
+ name: z.ZodString;
39
+ arguments: z.ZodString;
40
+ }, "strip", z.ZodTypeAny, {
41
+ name: string;
42
+ arguments: string;
43
+ }, {
44
+ name: string;
45
+ arguments: string;
46
+ }>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ function: {
49
+ name: string;
50
+ arguments: string;
51
+ };
52
+ type: "function";
53
+ id: string;
54
+ }, {
55
+ function: {
56
+ name: string;
57
+ arguments: string;
58
+ };
59
+ type: "function";
60
+ id: string;
61
+ }>, "many">>;
62
+ tool_call_id: z.ZodOptional<z.ZodString>;
63
+ function_call: z.ZodOptional<z.ZodObject<{
64
+ name: z.ZodString;
65
+ arguments: z.ZodString;
66
+ }, "strip", z.ZodTypeAny, {
67
+ name: string;
68
+ arguments: string;
69
+ }, {
70
+ name: string;
71
+ arguments: string;
72
+ }>>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ role: "function" | "system" | "user" | "assistant" | "tool";
75
+ content: string | {
76
+ type: "text" | "image_url";
77
+ text?: string | undefined;
78
+ image_url?: {
79
+ url: string;
80
+ detail?: "auto" | "low" | "high" | undefined;
81
+ } | undefined;
82
+ }[] | null;
83
+ name?: string | undefined;
84
+ tool_calls?: {
85
+ function: {
86
+ name: string;
87
+ arguments: string;
88
+ };
89
+ type: "function";
90
+ id: string;
91
+ }[] | undefined;
92
+ tool_call_id?: string | undefined;
93
+ function_call?: {
94
+ name: string;
95
+ arguments: string;
96
+ } | undefined;
97
+ }, {
98
+ role: "function" | "system" | "user" | "assistant" | "tool";
99
+ content: string | {
100
+ type: "text" | "image_url";
101
+ text?: string | undefined;
102
+ image_url?: {
103
+ url: string;
104
+ detail?: "auto" | "low" | "high" | undefined;
105
+ } | undefined;
106
+ }[] | null;
107
+ name?: string | undefined;
108
+ tool_calls?: {
109
+ function: {
110
+ name: string;
111
+ arguments: string;
112
+ };
113
+ type: "function";
114
+ id: string;
115
+ }[] | undefined;
116
+ tool_call_id?: string | undefined;
117
+ function_call?: {
118
+ name: string;
119
+ arguments: string;
120
+ } | undefined;
121
+ }>;
122
+ type ChatMessage = z.infer<typeof ChatMessageSchema>;
123
+ declare const ToolSchema: z.ZodObject<{
124
+ type: z.ZodLiteral<"function">;
125
+ function: z.ZodObject<{
126
+ name: z.ZodString;
127
+ description: z.ZodOptional<z.ZodString>;
128
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
+ strict: z.ZodOptional<z.ZodBoolean>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ name: string;
132
+ description?: string | undefined;
133
+ parameters?: Record<string, unknown> | undefined;
134
+ strict?: boolean | undefined;
135
+ }, {
136
+ name: string;
137
+ description?: string | undefined;
138
+ parameters?: Record<string, unknown> | undefined;
139
+ strict?: boolean | undefined;
140
+ }>;
141
+ }, "strip", z.ZodTypeAny, {
142
+ function: {
143
+ name: string;
144
+ description?: string | undefined;
145
+ parameters?: Record<string, unknown> | undefined;
146
+ strict?: boolean | undefined;
147
+ };
148
+ type: "function";
149
+ }, {
150
+ function: {
151
+ name: string;
152
+ description?: string | undefined;
153
+ parameters?: Record<string, unknown> | undefined;
154
+ strict?: boolean | undefined;
155
+ };
156
+ type: "function";
157
+ }>;
158
+ type Tool = z.infer<typeof ToolSchema>;
159
+ declare const ChatCompletionRequestSchema: z.ZodObject<{
160
+ model: z.ZodString;
161
+ messages: z.ZodArray<z.ZodObject<{
162
+ role: z.ZodEnum<["system", "user", "assistant", "tool", "function"]>;
163
+ content: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
164
+ type: z.ZodEnum<["text", "image_url"]>;
165
+ text: z.ZodOptional<z.ZodString>;
166
+ image_url: z.ZodOptional<z.ZodObject<{
167
+ url: z.ZodString;
168
+ detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ url: string;
171
+ detail?: "auto" | "low" | "high" | undefined;
172
+ }, {
173
+ url: string;
174
+ detail?: "auto" | "low" | "high" | undefined;
175
+ }>>;
176
+ }, "strip", z.ZodTypeAny, {
177
+ type: "text" | "image_url";
178
+ text?: string | undefined;
179
+ image_url?: {
180
+ url: string;
181
+ detail?: "auto" | "low" | "high" | undefined;
182
+ } | undefined;
183
+ }, {
184
+ type: "text" | "image_url";
185
+ text?: string | undefined;
186
+ image_url?: {
187
+ url: string;
188
+ detail?: "auto" | "low" | "high" | undefined;
189
+ } | undefined;
190
+ }>, "many">]>>;
191
+ name: z.ZodOptional<z.ZodString>;
192
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
193
+ id: z.ZodString;
194
+ type: z.ZodLiteral<"function">;
195
+ function: z.ZodObject<{
196
+ name: z.ZodString;
197
+ arguments: z.ZodString;
198
+ }, "strip", z.ZodTypeAny, {
199
+ name: string;
200
+ arguments: string;
201
+ }, {
202
+ name: string;
203
+ arguments: string;
204
+ }>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ function: {
207
+ name: string;
208
+ arguments: string;
209
+ };
210
+ type: "function";
211
+ id: string;
212
+ }, {
213
+ function: {
214
+ name: string;
215
+ arguments: string;
216
+ };
217
+ type: "function";
218
+ id: string;
219
+ }>, "many">>;
220
+ tool_call_id: z.ZodOptional<z.ZodString>;
221
+ function_call: z.ZodOptional<z.ZodObject<{
222
+ name: z.ZodString;
223
+ arguments: z.ZodString;
224
+ }, "strip", z.ZodTypeAny, {
225
+ name: string;
226
+ arguments: string;
227
+ }, {
228
+ name: string;
229
+ arguments: string;
230
+ }>>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ role: "function" | "system" | "user" | "assistant" | "tool";
233
+ content: string | {
234
+ type: "text" | "image_url";
235
+ text?: string | undefined;
236
+ image_url?: {
237
+ url: string;
238
+ detail?: "auto" | "low" | "high" | undefined;
239
+ } | undefined;
240
+ }[] | null;
241
+ name?: string | undefined;
242
+ tool_calls?: {
243
+ function: {
244
+ name: string;
245
+ arguments: string;
246
+ };
247
+ type: "function";
248
+ id: string;
249
+ }[] | undefined;
250
+ tool_call_id?: string | undefined;
251
+ function_call?: {
252
+ name: string;
253
+ arguments: string;
254
+ } | undefined;
255
+ }, {
256
+ role: "function" | "system" | "user" | "assistant" | "tool";
257
+ content: string | {
258
+ type: "text" | "image_url";
259
+ text?: string | undefined;
260
+ image_url?: {
261
+ url: string;
262
+ detail?: "auto" | "low" | "high" | undefined;
263
+ } | undefined;
264
+ }[] | null;
265
+ name?: string | undefined;
266
+ tool_calls?: {
267
+ function: {
268
+ name: string;
269
+ arguments: string;
270
+ };
271
+ type: "function";
272
+ id: string;
273
+ }[] | undefined;
274
+ tool_call_id?: string | undefined;
275
+ function_call?: {
276
+ name: string;
277
+ arguments: string;
278
+ } | undefined;
279
+ }>, "many">;
280
+ temperature: z.ZodOptional<z.ZodNumber>;
281
+ top_p: z.ZodOptional<z.ZodNumber>;
282
+ n: z.ZodOptional<z.ZodNumber>;
283
+ stream: z.ZodOptional<z.ZodBoolean>;
284
+ stream_options: z.ZodOptional<z.ZodObject<{
285
+ include_usage: z.ZodOptional<z.ZodBoolean>;
286
+ }, "strip", z.ZodTypeAny, {
287
+ include_usage?: boolean | undefined;
288
+ }, {
289
+ include_usage?: boolean | undefined;
290
+ }>>;
291
+ stop: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
292
+ max_tokens: z.ZodOptional<z.ZodNumber>;
293
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
294
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
295
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
296
+ logit_bias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
297
+ logprobs: z.ZodOptional<z.ZodBoolean>;
298
+ top_logprobs: z.ZodOptional<z.ZodNumber>;
299
+ user: z.ZodOptional<z.ZodString>;
300
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
301
+ type: z.ZodLiteral<"function">;
302
+ function: z.ZodObject<{
303
+ name: z.ZodString;
304
+ description: z.ZodOptional<z.ZodString>;
305
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
306
+ strict: z.ZodOptional<z.ZodBoolean>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ name: string;
309
+ description?: string | undefined;
310
+ parameters?: Record<string, unknown> | undefined;
311
+ strict?: boolean | undefined;
312
+ }, {
313
+ name: string;
314
+ description?: string | undefined;
315
+ parameters?: Record<string, unknown> | undefined;
316
+ strict?: boolean | undefined;
317
+ }>;
318
+ }, "strip", z.ZodTypeAny, {
319
+ function: {
320
+ name: string;
321
+ description?: string | undefined;
322
+ parameters?: Record<string, unknown> | undefined;
323
+ strict?: boolean | undefined;
324
+ };
325
+ type: "function";
326
+ }, {
327
+ function: {
328
+ name: string;
329
+ description?: string | undefined;
330
+ parameters?: Record<string, unknown> | undefined;
331
+ strict?: boolean | undefined;
332
+ };
333
+ type: "function";
334
+ }>, "many">>;
335
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"auto">, z.ZodLiteral<"required">, z.ZodObject<{
336
+ type: z.ZodLiteral<"function">;
337
+ function: z.ZodObject<{
338
+ name: z.ZodString;
339
+ }, "strip", z.ZodTypeAny, {
340
+ name: string;
341
+ }, {
342
+ name: string;
343
+ }>;
344
+ }, "strip", z.ZodTypeAny, {
345
+ function: {
346
+ name: string;
347
+ };
348
+ type: "function";
349
+ }, {
350
+ function: {
351
+ name: string;
352
+ };
353
+ type: "function";
354
+ }>]>>;
355
+ parallel_tool_calls: z.ZodOptional<z.ZodBoolean>;
356
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
357
+ type: z.ZodLiteral<"text">;
358
+ }, "strip", z.ZodTypeAny, {
359
+ type: "text";
360
+ }, {
361
+ type: "text";
362
+ }>, z.ZodObject<{
363
+ type: z.ZodLiteral<"json_object">;
364
+ }, "strip", z.ZodTypeAny, {
365
+ type: "json_object";
366
+ }, {
367
+ type: "json_object";
368
+ }>, z.ZodObject<{
369
+ type: z.ZodLiteral<"json_schema">;
370
+ json_schema: z.ZodObject<{
371
+ name: z.ZodString;
372
+ description: z.ZodOptional<z.ZodString>;
373
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
374
+ strict: z.ZodOptional<z.ZodBoolean>;
375
+ }, "strip", z.ZodTypeAny, {
376
+ name: string;
377
+ schema: Record<string, unknown>;
378
+ description?: string | undefined;
379
+ strict?: boolean | undefined;
380
+ }, {
381
+ name: string;
382
+ schema: Record<string, unknown>;
383
+ description?: string | undefined;
384
+ strict?: boolean | undefined;
385
+ }>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ type: "json_schema";
388
+ json_schema: {
389
+ name: string;
390
+ schema: Record<string, unknown>;
391
+ description?: string | undefined;
392
+ strict?: boolean | undefined;
393
+ };
394
+ }, {
395
+ type: "json_schema";
396
+ json_schema: {
397
+ name: string;
398
+ schema: Record<string, unknown>;
399
+ description?: string | undefined;
400
+ strict?: boolean | undefined;
401
+ };
402
+ }>]>>;
403
+ seed: z.ZodOptional<z.ZodNumber>;
404
+ service_tier: z.ZodOptional<z.ZodEnum<["auto", "default"]>>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ model: string;
407
+ messages: {
408
+ role: "function" | "system" | "user" | "assistant" | "tool";
409
+ content: string | {
410
+ type: "text" | "image_url";
411
+ text?: string | undefined;
412
+ image_url?: {
413
+ url: string;
414
+ detail?: "auto" | "low" | "high" | undefined;
415
+ } | undefined;
416
+ }[] | null;
417
+ name?: string | undefined;
418
+ tool_calls?: {
419
+ function: {
420
+ name: string;
421
+ arguments: string;
422
+ };
423
+ type: "function";
424
+ id: string;
425
+ }[] | undefined;
426
+ tool_call_id?: string | undefined;
427
+ function_call?: {
428
+ name: string;
429
+ arguments: string;
430
+ } | undefined;
431
+ }[];
432
+ max_tokens?: number | undefined;
433
+ user?: string | undefined;
434
+ temperature?: number | undefined;
435
+ top_p?: number | undefined;
436
+ n?: number | undefined;
437
+ stream?: boolean | undefined;
438
+ stream_options?: {
439
+ include_usage?: boolean | undefined;
440
+ } | undefined;
441
+ stop?: string | string[] | undefined;
442
+ max_completion_tokens?: number | undefined;
443
+ presence_penalty?: number | undefined;
444
+ frequency_penalty?: number | undefined;
445
+ logit_bias?: Record<string, number> | undefined;
446
+ logprobs?: boolean | undefined;
447
+ top_logprobs?: number | undefined;
448
+ tools?: {
449
+ function: {
450
+ name: string;
451
+ description?: string | undefined;
452
+ parameters?: Record<string, unknown> | undefined;
453
+ strict?: boolean | undefined;
454
+ };
455
+ type: "function";
456
+ }[] | undefined;
457
+ tool_choice?: "auto" | "none" | "required" | {
458
+ function: {
459
+ name: string;
460
+ };
461
+ type: "function";
462
+ } | undefined;
463
+ parallel_tool_calls?: boolean | undefined;
464
+ response_format?: {
465
+ type: "text";
466
+ } | {
467
+ type: "json_object";
468
+ } | {
469
+ type: "json_schema";
470
+ json_schema: {
471
+ name: string;
472
+ schema: Record<string, unknown>;
473
+ description?: string | undefined;
474
+ strict?: boolean | undefined;
475
+ };
476
+ } | undefined;
477
+ seed?: number | undefined;
478
+ service_tier?: "auto" | "default" | undefined;
479
+ }, {
480
+ model: string;
481
+ messages: {
482
+ role: "function" | "system" | "user" | "assistant" | "tool";
483
+ content: string | {
484
+ type: "text" | "image_url";
485
+ text?: string | undefined;
486
+ image_url?: {
487
+ url: string;
488
+ detail?: "auto" | "low" | "high" | undefined;
489
+ } | undefined;
490
+ }[] | null;
491
+ name?: string | undefined;
492
+ tool_calls?: {
493
+ function: {
494
+ name: string;
495
+ arguments: string;
496
+ };
497
+ type: "function";
498
+ id: string;
499
+ }[] | undefined;
500
+ tool_call_id?: string | undefined;
501
+ function_call?: {
502
+ name: string;
503
+ arguments: string;
504
+ } | undefined;
505
+ }[];
506
+ max_tokens?: number | undefined;
507
+ user?: string | undefined;
508
+ temperature?: number | undefined;
509
+ top_p?: number | undefined;
510
+ n?: number | undefined;
511
+ stream?: boolean | undefined;
512
+ stream_options?: {
513
+ include_usage?: boolean | undefined;
514
+ } | undefined;
515
+ stop?: string | string[] | undefined;
516
+ max_completion_tokens?: number | undefined;
517
+ presence_penalty?: number | undefined;
518
+ frequency_penalty?: number | undefined;
519
+ logit_bias?: Record<string, number> | undefined;
520
+ logprobs?: boolean | undefined;
521
+ top_logprobs?: number | undefined;
522
+ tools?: {
523
+ function: {
524
+ name: string;
525
+ description?: string | undefined;
526
+ parameters?: Record<string, unknown> | undefined;
527
+ strict?: boolean | undefined;
528
+ };
529
+ type: "function";
530
+ }[] | undefined;
531
+ tool_choice?: "auto" | "none" | "required" | {
532
+ function: {
533
+ name: string;
534
+ };
535
+ type: "function";
536
+ } | undefined;
537
+ parallel_tool_calls?: boolean | undefined;
538
+ response_format?: {
539
+ type: "text";
540
+ } | {
541
+ type: "json_object";
542
+ } | {
543
+ type: "json_schema";
544
+ json_schema: {
545
+ name: string;
546
+ schema: Record<string, unknown>;
547
+ description?: string | undefined;
548
+ strict?: boolean | undefined;
549
+ };
550
+ } | undefined;
551
+ seed?: number | undefined;
552
+ service_tier?: "auto" | "default" | undefined;
553
+ }>;
554
+ type ChatCompletionRequest = z.infer<typeof ChatCompletionRequestSchema>;
555
+ declare const ChatCompletionChoiceSchema: z.ZodObject<{
556
+ index: z.ZodNumber;
557
+ message: z.ZodObject<{
558
+ role: z.ZodLiteral<"assistant">;
559
+ content: z.ZodNullable<z.ZodString>;
560
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
561
+ id: z.ZodString;
562
+ type: z.ZodLiteral<"function">;
563
+ function: z.ZodObject<{
564
+ name: z.ZodString;
565
+ arguments: z.ZodString;
566
+ }, "strip", z.ZodTypeAny, {
567
+ name: string;
568
+ arguments: string;
569
+ }, {
570
+ name: string;
571
+ arguments: string;
572
+ }>;
573
+ }, "strip", z.ZodTypeAny, {
574
+ function: {
575
+ name: string;
576
+ arguments: string;
577
+ };
578
+ type: "function";
579
+ id: string;
580
+ }, {
581
+ function: {
582
+ name: string;
583
+ arguments: string;
584
+ };
585
+ type: "function";
586
+ id: string;
587
+ }>, "many">>;
588
+ function_call: z.ZodOptional<z.ZodObject<{
589
+ name: z.ZodString;
590
+ arguments: z.ZodString;
591
+ }, "strip", z.ZodTypeAny, {
592
+ name: string;
593
+ arguments: string;
594
+ }, {
595
+ name: string;
596
+ arguments: string;
597
+ }>>;
598
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
599
+ }, "strip", z.ZodTypeAny, {
600
+ role: "assistant";
601
+ content: string | null;
602
+ tool_calls?: {
603
+ function: {
604
+ name: string;
605
+ arguments: string;
606
+ };
607
+ type: "function";
608
+ id: string;
609
+ }[] | undefined;
610
+ function_call?: {
611
+ name: string;
612
+ arguments: string;
613
+ } | undefined;
614
+ refusal?: string | null | undefined;
615
+ }, {
616
+ role: "assistant";
617
+ content: string | null;
618
+ tool_calls?: {
619
+ function: {
620
+ name: string;
621
+ arguments: string;
622
+ };
623
+ type: "function";
624
+ id: string;
625
+ }[] | undefined;
626
+ function_call?: {
627
+ name: string;
628
+ arguments: string;
629
+ } | undefined;
630
+ refusal?: string | null | undefined;
631
+ }>;
632
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
633
+ logprobs: z.ZodOptional<z.ZodNullable<z.ZodObject<{
634
+ content: z.ZodNullable<z.ZodArray<z.ZodObject<{
635
+ token: z.ZodString;
636
+ logprob: z.ZodNumber;
637
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
638
+ top_logprobs: z.ZodArray<z.ZodObject<{
639
+ token: z.ZodString;
640
+ logprob: z.ZodNumber;
641
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
642
+ }, "strip", z.ZodTypeAny, {
643
+ token: string;
644
+ logprob: number;
645
+ bytes: number[] | null;
646
+ }, {
647
+ token: string;
648
+ logprob: number;
649
+ bytes: number[] | null;
650
+ }>, "many">;
651
+ }, "strip", z.ZodTypeAny, {
652
+ top_logprobs: {
653
+ token: string;
654
+ logprob: number;
655
+ bytes: number[] | null;
656
+ }[];
657
+ token: string;
658
+ logprob: number;
659
+ bytes: number[] | null;
660
+ }, {
661
+ top_logprobs: {
662
+ token: string;
663
+ logprob: number;
664
+ bytes: number[] | null;
665
+ }[];
666
+ token: string;
667
+ logprob: number;
668
+ bytes: number[] | null;
669
+ }>, "many">>;
670
+ }, "strip", z.ZodTypeAny, {
671
+ content: {
672
+ top_logprobs: {
673
+ token: string;
674
+ logprob: number;
675
+ bytes: number[] | null;
676
+ }[];
677
+ token: string;
678
+ logprob: number;
679
+ bytes: number[] | null;
680
+ }[] | null;
681
+ }, {
682
+ content: {
683
+ top_logprobs: {
684
+ token: string;
685
+ logprob: number;
686
+ bytes: number[] | null;
687
+ }[];
688
+ token: string;
689
+ logprob: number;
690
+ bytes: number[] | null;
691
+ }[] | null;
692
+ }>>>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ message: {
695
+ role: "assistant";
696
+ content: string | null;
697
+ tool_calls?: {
698
+ function: {
699
+ name: string;
700
+ arguments: string;
701
+ };
702
+ type: "function";
703
+ id: string;
704
+ }[] | undefined;
705
+ function_call?: {
706
+ name: string;
707
+ arguments: string;
708
+ } | undefined;
709
+ refusal?: string | null | undefined;
710
+ };
711
+ index: number;
712
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
713
+ logprobs?: {
714
+ content: {
715
+ top_logprobs: {
716
+ token: string;
717
+ logprob: number;
718
+ bytes: number[] | null;
719
+ }[];
720
+ token: string;
721
+ logprob: number;
722
+ bytes: number[] | null;
723
+ }[] | null;
724
+ } | null | undefined;
725
+ }, {
726
+ message: {
727
+ role: "assistant";
728
+ content: string | null;
729
+ tool_calls?: {
730
+ function: {
731
+ name: string;
732
+ arguments: string;
733
+ };
734
+ type: "function";
735
+ id: string;
736
+ }[] | undefined;
737
+ function_call?: {
738
+ name: string;
739
+ arguments: string;
740
+ } | undefined;
741
+ refusal?: string | null | undefined;
742
+ };
743
+ index: number;
744
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
745
+ logprobs?: {
746
+ content: {
747
+ top_logprobs: {
748
+ token: string;
749
+ logprob: number;
750
+ bytes: number[] | null;
751
+ }[];
752
+ token: string;
753
+ logprob: number;
754
+ bytes: number[] | null;
755
+ }[] | null;
756
+ } | null | undefined;
757
+ }>;
758
+ type ChatCompletionChoice = z.infer<typeof ChatCompletionChoiceSchema>;
759
+ declare const UsageSchema: z.ZodObject<{
760
+ prompt_tokens: z.ZodNumber;
761
+ completion_tokens: z.ZodNumber;
762
+ total_tokens: z.ZodNumber;
763
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
764
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
765
+ }, "strip", z.ZodTypeAny, {
766
+ cached_tokens?: number | undefined;
767
+ }, {
768
+ cached_tokens?: number | undefined;
769
+ }>>;
770
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
771
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
772
+ }, "strip", z.ZodTypeAny, {
773
+ reasoning_tokens?: number | undefined;
774
+ }, {
775
+ reasoning_tokens?: number | undefined;
776
+ }>>;
777
+ }, "strip", z.ZodTypeAny, {
778
+ prompt_tokens: number;
779
+ completion_tokens: number;
780
+ total_tokens: number;
781
+ prompt_tokens_details?: {
782
+ cached_tokens?: number | undefined;
783
+ } | undefined;
784
+ completion_tokens_details?: {
785
+ reasoning_tokens?: number | undefined;
786
+ } | undefined;
787
+ }, {
788
+ prompt_tokens: number;
789
+ completion_tokens: number;
790
+ total_tokens: number;
791
+ prompt_tokens_details?: {
792
+ cached_tokens?: number | undefined;
793
+ } | undefined;
794
+ completion_tokens_details?: {
795
+ reasoning_tokens?: number | undefined;
796
+ } | undefined;
797
+ }>;
798
+ type Usage = z.infer<typeof UsageSchema>;
799
+ declare const ChatCompletionResponseSchema: z.ZodObject<{
800
+ id: z.ZodString;
801
+ object: z.ZodLiteral<"chat.completion">;
802
+ created: z.ZodNumber;
803
+ model: z.ZodString;
804
+ choices: z.ZodArray<z.ZodObject<{
805
+ index: z.ZodNumber;
806
+ message: z.ZodObject<{
807
+ role: z.ZodLiteral<"assistant">;
808
+ content: z.ZodNullable<z.ZodString>;
809
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
810
+ id: z.ZodString;
811
+ type: z.ZodLiteral<"function">;
812
+ function: z.ZodObject<{
813
+ name: z.ZodString;
814
+ arguments: z.ZodString;
815
+ }, "strip", z.ZodTypeAny, {
816
+ name: string;
817
+ arguments: string;
818
+ }, {
819
+ name: string;
820
+ arguments: string;
821
+ }>;
822
+ }, "strip", z.ZodTypeAny, {
823
+ function: {
824
+ name: string;
825
+ arguments: string;
826
+ };
827
+ type: "function";
828
+ id: string;
829
+ }, {
830
+ function: {
831
+ name: string;
832
+ arguments: string;
833
+ };
834
+ type: "function";
835
+ id: string;
836
+ }>, "many">>;
837
+ function_call: z.ZodOptional<z.ZodObject<{
838
+ name: z.ZodString;
839
+ arguments: z.ZodString;
840
+ }, "strip", z.ZodTypeAny, {
841
+ name: string;
842
+ arguments: string;
843
+ }, {
844
+ name: string;
845
+ arguments: string;
846
+ }>>;
847
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
848
+ }, "strip", z.ZodTypeAny, {
849
+ role: "assistant";
850
+ content: string | null;
851
+ tool_calls?: {
852
+ function: {
853
+ name: string;
854
+ arguments: string;
855
+ };
856
+ type: "function";
857
+ id: string;
858
+ }[] | undefined;
859
+ function_call?: {
860
+ name: string;
861
+ arguments: string;
862
+ } | undefined;
863
+ refusal?: string | null | undefined;
864
+ }, {
865
+ role: "assistant";
866
+ content: string | null;
867
+ tool_calls?: {
868
+ function: {
869
+ name: string;
870
+ arguments: string;
871
+ };
872
+ type: "function";
873
+ id: string;
874
+ }[] | undefined;
875
+ function_call?: {
876
+ name: string;
877
+ arguments: string;
878
+ } | undefined;
879
+ refusal?: string | null | undefined;
880
+ }>;
881
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
882
+ logprobs: z.ZodOptional<z.ZodNullable<z.ZodObject<{
883
+ content: z.ZodNullable<z.ZodArray<z.ZodObject<{
884
+ token: z.ZodString;
885
+ logprob: z.ZodNumber;
886
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
887
+ top_logprobs: z.ZodArray<z.ZodObject<{
888
+ token: z.ZodString;
889
+ logprob: z.ZodNumber;
890
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
891
+ }, "strip", z.ZodTypeAny, {
892
+ token: string;
893
+ logprob: number;
894
+ bytes: number[] | null;
895
+ }, {
896
+ token: string;
897
+ logprob: number;
898
+ bytes: number[] | null;
899
+ }>, "many">;
900
+ }, "strip", z.ZodTypeAny, {
901
+ top_logprobs: {
902
+ token: string;
903
+ logprob: number;
904
+ bytes: number[] | null;
905
+ }[];
906
+ token: string;
907
+ logprob: number;
908
+ bytes: number[] | null;
909
+ }, {
910
+ top_logprobs: {
911
+ token: string;
912
+ logprob: number;
913
+ bytes: number[] | null;
914
+ }[];
915
+ token: string;
916
+ logprob: number;
917
+ bytes: number[] | null;
918
+ }>, "many">>;
919
+ }, "strip", z.ZodTypeAny, {
920
+ content: {
921
+ top_logprobs: {
922
+ token: string;
923
+ logprob: number;
924
+ bytes: number[] | null;
925
+ }[];
926
+ token: string;
927
+ logprob: number;
928
+ bytes: number[] | null;
929
+ }[] | null;
930
+ }, {
931
+ content: {
932
+ top_logprobs: {
933
+ token: string;
934
+ logprob: number;
935
+ bytes: number[] | null;
936
+ }[];
937
+ token: string;
938
+ logprob: number;
939
+ bytes: number[] | null;
940
+ }[] | null;
941
+ }>>>;
942
+ }, "strip", z.ZodTypeAny, {
943
+ message: {
944
+ role: "assistant";
945
+ content: string | null;
946
+ tool_calls?: {
947
+ function: {
948
+ name: string;
949
+ arguments: string;
950
+ };
951
+ type: "function";
952
+ id: string;
953
+ }[] | undefined;
954
+ function_call?: {
955
+ name: string;
956
+ arguments: string;
957
+ } | undefined;
958
+ refusal?: string | null | undefined;
959
+ };
960
+ index: number;
961
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
962
+ logprobs?: {
963
+ content: {
964
+ top_logprobs: {
965
+ token: string;
966
+ logprob: number;
967
+ bytes: number[] | null;
968
+ }[];
969
+ token: string;
970
+ logprob: number;
971
+ bytes: number[] | null;
972
+ }[] | null;
973
+ } | null | undefined;
974
+ }, {
975
+ message: {
976
+ role: "assistant";
977
+ content: string | null;
978
+ tool_calls?: {
979
+ function: {
980
+ name: string;
981
+ arguments: string;
982
+ };
983
+ type: "function";
984
+ id: string;
985
+ }[] | undefined;
986
+ function_call?: {
987
+ name: string;
988
+ arguments: string;
989
+ } | undefined;
990
+ refusal?: string | null | undefined;
991
+ };
992
+ index: number;
993
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
994
+ logprobs?: {
995
+ content: {
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
+ }[] | null;
1005
+ } | null | undefined;
1006
+ }>, "many">;
1007
+ usage: z.ZodOptional<z.ZodObject<{
1008
+ prompt_tokens: z.ZodNumber;
1009
+ completion_tokens: z.ZodNumber;
1010
+ total_tokens: z.ZodNumber;
1011
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
1012
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
1013
+ }, "strip", z.ZodTypeAny, {
1014
+ cached_tokens?: number | undefined;
1015
+ }, {
1016
+ cached_tokens?: number | undefined;
1017
+ }>>;
1018
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
1019
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ reasoning_tokens?: number | undefined;
1022
+ }, {
1023
+ reasoning_tokens?: number | undefined;
1024
+ }>>;
1025
+ }, "strip", z.ZodTypeAny, {
1026
+ prompt_tokens: number;
1027
+ completion_tokens: number;
1028
+ total_tokens: number;
1029
+ prompt_tokens_details?: {
1030
+ cached_tokens?: number | undefined;
1031
+ } | undefined;
1032
+ completion_tokens_details?: {
1033
+ reasoning_tokens?: number | undefined;
1034
+ } | undefined;
1035
+ }, {
1036
+ prompt_tokens: number;
1037
+ completion_tokens: number;
1038
+ total_tokens: number;
1039
+ prompt_tokens_details?: {
1040
+ cached_tokens?: number | undefined;
1041
+ } | undefined;
1042
+ completion_tokens_details?: {
1043
+ reasoning_tokens?: number | undefined;
1044
+ } | undefined;
1045
+ }>>;
1046
+ system_fingerprint: z.ZodOptional<z.ZodString>;
1047
+ service_tier: z.ZodOptional<z.ZodString>;
1048
+ }, "strip", z.ZodTypeAny, {
1049
+ object: "chat.completion";
1050
+ model: string;
1051
+ id: string;
1052
+ created: number;
1053
+ choices: {
1054
+ message: {
1055
+ role: "assistant";
1056
+ content: string | null;
1057
+ tool_calls?: {
1058
+ function: {
1059
+ name: string;
1060
+ arguments: string;
1061
+ };
1062
+ type: "function";
1063
+ id: string;
1064
+ }[] | undefined;
1065
+ function_call?: {
1066
+ name: string;
1067
+ arguments: string;
1068
+ } | undefined;
1069
+ refusal?: string | null | undefined;
1070
+ };
1071
+ index: number;
1072
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
1073
+ logprobs?: {
1074
+ content: {
1075
+ top_logprobs: {
1076
+ token: string;
1077
+ logprob: number;
1078
+ bytes: number[] | null;
1079
+ }[];
1080
+ token: string;
1081
+ logprob: number;
1082
+ bytes: number[] | null;
1083
+ }[] | null;
1084
+ } | null | undefined;
1085
+ }[];
1086
+ service_tier?: string | undefined;
1087
+ usage?: {
1088
+ prompt_tokens: number;
1089
+ completion_tokens: number;
1090
+ total_tokens: number;
1091
+ prompt_tokens_details?: {
1092
+ cached_tokens?: number | undefined;
1093
+ } | undefined;
1094
+ completion_tokens_details?: {
1095
+ reasoning_tokens?: number | undefined;
1096
+ } | undefined;
1097
+ } | undefined;
1098
+ system_fingerprint?: string | undefined;
1099
+ }, {
1100
+ object: "chat.completion";
1101
+ model: string;
1102
+ id: string;
1103
+ created: number;
1104
+ choices: {
1105
+ message: {
1106
+ role: "assistant";
1107
+ content: string | null;
1108
+ tool_calls?: {
1109
+ function: {
1110
+ name: string;
1111
+ arguments: string;
1112
+ };
1113
+ type: "function";
1114
+ id: string;
1115
+ }[] | undefined;
1116
+ function_call?: {
1117
+ name: string;
1118
+ arguments: string;
1119
+ } | undefined;
1120
+ refusal?: string | null | undefined;
1121
+ };
1122
+ index: number;
1123
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
1124
+ logprobs?: {
1125
+ content: {
1126
+ top_logprobs: {
1127
+ token: string;
1128
+ logprob: number;
1129
+ bytes: number[] | null;
1130
+ }[];
1131
+ token: string;
1132
+ logprob: number;
1133
+ bytes: number[] | null;
1134
+ }[] | null;
1135
+ } | null | undefined;
1136
+ }[];
1137
+ service_tier?: string | undefined;
1138
+ usage?: {
1139
+ prompt_tokens: number;
1140
+ completion_tokens: number;
1141
+ total_tokens: number;
1142
+ prompt_tokens_details?: {
1143
+ cached_tokens?: number | undefined;
1144
+ } | undefined;
1145
+ completion_tokens_details?: {
1146
+ reasoning_tokens?: number | undefined;
1147
+ } | undefined;
1148
+ } | undefined;
1149
+ system_fingerprint?: string | undefined;
1150
+ }>;
1151
+ type ChatCompletionResponse = z.infer<typeof ChatCompletionResponseSchema>;
1152
+ declare const ChatCompletionChunkSchema: z.ZodObject<{
1153
+ id: z.ZodString;
1154
+ object: z.ZodLiteral<"chat.completion.chunk">;
1155
+ created: z.ZodNumber;
1156
+ model: z.ZodString;
1157
+ system_fingerprint: z.ZodOptional<z.ZodString>;
1158
+ choices: z.ZodArray<z.ZodObject<{
1159
+ index: z.ZodNumber;
1160
+ delta: z.ZodObject<{
1161
+ role: z.ZodOptional<z.ZodString>;
1162
+ content: z.ZodOptional<z.ZodString>;
1163
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1164
+ index: z.ZodNumber;
1165
+ id: z.ZodOptional<z.ZodString>;
1166
+ type: z.ZodOptional<z.ZodLiteral<"function">>;
1167
+ function: z.ZodOptional<z.ZodObject<{
1168
+ name: z.ZodOptional<z.ZodString>;
1169
+ arguments: z.ZodOptional<z.ZodString>;
1170
+ }, "strip", z.ZodTypeAny, {
1171
+ name?: string | undefined;
1172
+ arguments?: string | undefined;
1173
+ }, {
1174
+ name?: string | undefined;
1175
+ arguments?: string | undefined;
1176
+ }>>;
1177
+ }, "strip", z.ZodTypeAny, {
1178
+ index: number;
1179
+ function?: {
1180
+ name?: string | undefined;
1181
+ arguments?: string | undefined;
1182
+ } | undefined;
1183
+ type?: "function" | undefined;
1184
+ id?: string | undefined;
1185
+ }, {
1186
+ index: number;
1187
+ function?: {
1188
+ name?: string | undefined;
1189
+ arguments?: string | undefined;
1190
+ } | undefined;
1191
+ type?: "function" | undefined;
1192
+ id?: string | undefined;
1193
+ }>, "many">>;
1194
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1195
+ }, "strip", z.ZodTypeAny, {
1196
+ role?: string | undefined;
1197
+ content?: string | undefined;
1198
+ tool_calls?: {
1199
+ index: number;
1200
+ function?: {
1201
+ name?: string | undefined;
1202
+ arguments?: string | undefined;
1203
+ } | undefined;
1204
+ type?: "function" | undefined;
1205
+ id?: string | undefined;
1206
+ }[] | undefined;
1207
+ refusal?: string | null | undefined;
1208
+ }, {
1209
+ role?: string | undefined;
1210
+ content?: string | undefined;
1211
+ tool_calls?: {
1212
+ index: number;
1213
+ function?: {
1214
+ name?: string | undefined;
1215
+ arguments?: string | undefined;
1216
+ } | undefined;
1217
+ type?: "function" | undefined;
1218
+ id?: string | undefined;
1219
+ }[] | undefined;
1220
+ refusal?: string | null | undefined;
1221
+ }>;
1222
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
1223
+ logprobs: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1224
+ content: z.ZodNullable<z.ZodArray<z.ZodObject<{
1225
+ token: z.ZodString;
1226
+ logprob: z.ZodNumber;
1227
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
1228
+ top_logprobs: z.ZodArray<z.ZodObject<{
1229
+ token: z.ZodString;
1230
+ logprob: z.ZodNumber;
1231
+ bytes: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
1232
+ }, "strip", z.ZodTypeAny, {
1233
+ token: string;
1234
+ logprob: number;
1235
+ bytes: number[] | null;
1236
+ }, {
1237
+ token: string;
1238
+ logprob: number;
1239
+ bytes: number[] | null;
1240
+ }>, "many">;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ top_logprobs: {
1243
+ token: string;
1244
+ logprob: number;
1245
+ bytes: number[] | null;
1246
+ }[];
1247
+ token: string;
1248
+ logprob: number;
1249
+ bytes: number[] | null;
1250
+ }, {
1251
+ top_logprobs: {
1252
+ token: string;
1253
+ logprob: number;
1254
+ bytes: number[] | null;
1255
+ }[];
1256
+ token: string;
1257
+ logprob: number;
1258
+ bytes: number[] | null;
1259
+ }>, "many">>;
1260
+ }, "strip", z.ZodTypeAny, {
1261
+ content: {
1262
+ top_logprobs: {
1263
+ token: string;
1264
+ logprob: number;
1265
+ bytes: number[] | null;
1266
+ }[];
1267
+ token: string;
1268
+ logprob: number;
1269
+ bytes: number[] | null;
1270
+ }[] | null;
1271
+ }, {
1272
+ content: {
1273
+ top_logprobs: {
1274
+ token: string;
1275
+ logprob: number;
1276
+ bytes: number[] | null;
1277
+ }[];
1278
+ token: string;
1279
+ logprob: number;
1280
+ bytes: number[] | null;
1281
+ }[] | null;
1282
+ }>>>;
1283
+ }, "strip", z.ZodTypeAny, {
1284
+ index: number;
1285
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
1286
+ delta: {
1287
+ role?: string | undefined;
1288
+ content?: string | undefined;
1289
+ tool_calls?: {
1290
+ index: number;
1291
+ function?: {
1292
+ name?: string | undefined;
1293
+ arguments?: string | undefined;
1294
+ } | undefined;
1295
+ type?: "function" | undefined;
1296
+ id?: string | undefined;
1297
+ }[] | undefined;
1298
+ refusal?: string | null | undefined;
1299
+ };
1300
+ logprobs?: {
1301
+ content: {
1302
+ top_logprobs: {
1303
+ token: string;
1304
+ logprob: number;
1305
+ bytes: number[] | null;
1306
+ }[];
1307
+ token: string;
1308
+ logprob: number;
1309
+ bytes: number[] | null;
1310
+ }[] | null;
1311
+ } | null | undefined;
1312
+ }, {
1313
+ index: number;
1314
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
1315
+ delta: {
1316
+ role?: string | undefined;
1317
+ content?: string | undefined;
1318
+ tool_calls?: {
1319
+ index: number;
1320
+ function?: {
1321
+ name?: string | undefined;
1322
+ arguments?: string | undefined;
1323
+ } | undefined;
1324
+ type?: "function" | undefined;
1325
+ id?: string | undefined;
1326
+ }[] | undefined;
1327
+ refusal?: string | null | undefined;
1328
+ };
1329
+ logprobs?: {
1330
+ content: {
1331
+ top_logprobs: {
1332
+ token: string;
1333
+ logprob: number;
1334
+ bytes: number[] | null;
1335
+ }[];
1336
+ token: string;
1337
+ logprob: number;
1338
+ bytes: number[] | null;
1339
+ }[] | null;
1340
+ } | null | undefined;
1341
+ }>, "many">;
1342
+ usage: z.ZodOptional<z.ZodObject<{
1343
+ prompt_tokens: z.ZodNumber;
1344
+ completion_tokens: z.ZodNumber;
1345
+ total_tokens: z.ZodNumber;
1346
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
1347
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
1348
+ }, "strip", z.ZodTypeAny, {
1349
+ cached_tokens?: number | undefined;
1350
+ }, {
1351
+ cached_tokens?: number | undefined;
1352
+ }>>;
1353
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
1354
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
1355
+ }, "strip", z.ZodTypeAny, {
1356
+ reasoning_tokens?: number | undefined;
1357
+ }, {
1358
+ reasoning_tokens?: number | undefined;
1359
+ }>>;
1360
+ }, "strip", z.ZodTypeAny, {
1361
+ prompt_tokens: number;
1362
+ completion_tokens: number;
1363
+ total_tokens: number;
1364
+ prompt_tokens_details?: {
1365
+ cached_tokens?: number | undefined;
1366
+ } | undefined;
1367
+ completion_tokens_details?: {
1368
+ reasoning_tokens?: number | undefined;
1369
+ } | undefined;
1370
+ }, {
1371
+ prompt_tokens: number;
1372
+ completion_tokens: number;
1373
+ total_tokens: number;
1374
+ prompt_tokens_details?: {
1375
+ cached_tokens?: number | undefined;
1376
+ } | undefined;
1377
+ completion_tokens_details?: {
1378
+ reasoning_tokens?: number | undefined;
1379
+ } | undefined;
1380
+ }>>;
1381
+ service_tier: z.ZodOptional<z.ZodString>;
1382
+ }, "strip", z.ZodTypeAny, {
1383
+ object: "chat.completion.chunk";
1384
+ model: string;
1385
+ id: string;
1386
+ created: number;
1387
+ choices: {
1388
+ index: number;
1389
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
1390
+ delta: {
1391
+ role?: string | undefined;
1392
+ content?: string | undefined;
1393
+ tool_calls?: {
1394
+ index: number;
1395
+ function?: {
1396
+ name?: string | undefined;
1397
+ arguments?: string | undefined;
1398
+ } | undefined;
1399
+ type?: "function" | undefined;
1400
+ id?: string | undefined;
1401
+ }[] | undefined;
1402
+ refusal?: string | null | undefined;
1403
+ };
1404
+ logprobs?: {
1405
+ content: {
1406
+ top_logprobs: {
1407
+ token: string;
1408
+ logprob: number;
1409
+ bytes: number[] | null;
1410
+ }[];
1411
+ token: string;
1412
+ logprob: number;
1413
+ bytes: number[] | null;
1414
+ }[] | null;
1415
+ } | null | undefined;
1416
+ }[];
1417
+ service_tier?: string | undefined;
1418
+ usage?: {
1419
+ prompt_tokens: number;
1420
+ completion_tokens: number;
1421
+ total_tokens: number;
1422
+ prompt_tokens_details?: {
1423
+ cached_tokens?: number | undefined;
1424
+ } | undefined;
1425
+ completion_tokens_details?: {
1426
+ reasoning_tokens?: number | undefined;
1427
+ } | undefined;
1428
+ } | undefined;
1429
+ system_fingerprint?: string | undefined;
1430
+ }, {
1431
+ object: "chat.completion.chunk";
1432
+ model: string;
1433
+ id: string;
1434
+ created: number;
1435
+ choices: {
1436
+ index: number;
1437
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
1438
+ delta: {
1439
+ role?: string | undefined;
1440
+ content?: string | undefined;
1441
+ tool_calls?: {
1442
+ index: number;
1443
+ function?: {
1444
+ name?: string | undefined;
1445
+ arguments?: string | undefined;
1446
+ } | undefined;
1447
+ type?: "function" | undefined;
1448
+ id?: string | undefined;
1449
+ }[] | undefined;
1450
+ refusal?: string | null | undefined;
1451
+ };
1452
+ logprobs?: {
1453
+ content: {
1454
+ top_logprobs: {
1455
+ token: string;
1456
+ logprob: number;
1457
+ bytes: number[] | null;
1458
+ }[];
1459
+ token: string;
1460
+ logprob: number;
1461
+ bytes: number[] | null;
1462
+ }[] | null;
1463
+ } | null | undefined;
1464
+ }[];
1465
+ service_tier?: string | undefined;
1466
+ usage?: {
1467
+ prompt_tokens: number;
1468
+ completion_tokens: number;
1469
+ total_tokens: number;
1470
+ prompt_tokens_details?: {
1471
+ cached_tokens?: number | undefined;
1472
+ } | undefined;
1473
+ completion_tokens_details?: {
1474
+ reasoning_tokens?: number | undefined;
1475
+ } | undefined;
1476
+ } | undefined;
1477
+ system_fingerprint?: string | undefined;
1478
+ }>;
1479
+ type ChatCompletionChunk = z.infer<typeof ChatCompletionChunkSchema>;
1480
+ declare const PLUGIN_ID: "llm:openai";
1481
+ declare const RESOURCE_TYPE: "llm";
1482
+ declare const PROVIDER: "openai";
1483
+ declare const VERSION = "1.0.0";
1484
+ /** Default allowed models */
1485
+ declare const DEFAULT_OPENAI_MODELS: readonly ["gpt-4o", "gpt-4o-2024-11-20", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-0125-preview", "gpt-4-1106-preview", "gpt-4", "gpt-4-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-1106", "o1", "o1-2024-12-17", "o1-preview", "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12"];
1486
+ /** Supported actions */
1487
+ declare const ACTIONS: readonly ["chat.completions"];
1488
+ type OpenAIAction = (typeof ACTIONS)[number];
1489
+ /** Enforcement knobs */
1490
+ declare const ENFORCEMENT_SUPPORT: readonly ["model", "max_tokens", "streaming"];
1491
+ /** Default API URL */
1492
+ declare const DEFAULT_API_URL = "https://api.openai.com/v1";
1493
+
1494
+ export { ACTIONS, type ChatCompletionChoice, ChatCompletionChoiceSchema, type ChatCompletionChunk, ChatCompletionChunkSchema, type ChatCompletionRequest, ChatCompletionRequestSchema, type ChatCompletionResponse, ChatCompletionResponseSchema, type ChatMessage, ChatMessageSchema, DEFAULT_API_URL, DEFAULT_OPENAI_MODELS, ENFORCEMENT_SUPPORT, type OpenAIAction, PLUGIN_ID, PROVIDER, RESOURCE_TYPE, type Tool, ToolSchema, type Usage, UsageSchema, VERSION };