@adaptic/lumic-utils 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/apollo-client.client-BXL45tI8.js +3704 -0
  2. package/dist/apollo-client.client-BXL45tI8.js.map +1 -0
  3. package/dist/apollo-client.client-DU-axkDV.js +3693 -0
  4. package/dist/apollo-client.client-DU-axkDV.js.map +1 -0
  5. package/dist/apollo-client.server-CsF1Ouw2.js +16319 -0
  6. package/dist/apollo-client.server-CsF1Ouw2.js.map +1 -0
  7. package/dist/apollo-client.server-DsMOuLeH.js +16321 -0
  8. package/dist/apollo-client.server-DsMOuLeH.js.map +1 -0
  9. package/dist/index-C01wYFKR.js +81388 -0
  10. package/dist/index-C01wYFKR.js.map +1 -0
  11. package/dist/index-ChYbCXnO.js +12271 -0
  12. package/dist/index-ChYbCXnO.js.map +1 -0
  13. package/dist/{index-CcXQeJz8.js → index-Cstek604.js} +182 -22
  14. package/dist/index-Cstek604.js.map +1 -0
  15. package/dist/{index-CcgbRft2.js → index-DZZCd-1T.js} +182 -22
  16. package/dist/index-DZZCd-1T.js.map +1 -0
  17. package/dist/index-FzTQZ3fX.js +81181 -0
  18. package/dist/index-FzTQZ3fX.js.map +1 -0
  19. package/dist/index-hlhvI_Sn.js +12108 -0
  20. package/dist/index-hlhvI_Sn.js.map +1 -0
  21. package/dist/index.cjs +136 -11417
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.mjs +39 -11399
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/test.cjs +24 -7
  26. package/dist/test.cjs.map +1 -1
  27. package/dist/test.mjs +24 -7
  28. package/dist/test.mjs.map +1 -1
  29. package/dist/types/config/__tests__/secrets.test.d.ts +1 -0
  30. package/dist/types/config/secrets.d.ts +286 -0
  31. package/dist/types/errors/__tests__/errors.test.d.ts +1 -0
  32. package/dist/types/errors/index.d.ts +77 -0
  33. package/dist/types/functions/__tests__/aws-lambda.test.d.ts +1 -0
  34. package/dist/types/functions/__tests__/aws-s3-utils.test.d.ts +1 -0
  35. package/dist/types/functions/__tests__/json-llm-tools.test.d.ts +1 -0
  36. package/dist/types/functions/__tests__/json-tools.test.d.ts +1 -0
  37. package/dist/types/functions/__tests__/slack-utils.test.d.ts +1 -0
  38. package/dist/types/functions/aws-lambda.d.ts +1 -1
  39. package/dist/types/functions/aws-s3-utils.d.ts +2 -2
  40. package/dist/types/functions/google-sheets.d.ts +4 -4
  41. package/dist/types/functions/json-llm-tools.d.ts +25 -3
  42. package/dist/types/functions/llm-anthropic.d.ts +14 -0
  43. package/dist/types/functions/llm-call.d.ts +14 -3
  44. package/dist/types/functions/llm-config.d.ts +13 -8
  45. package/dist/types/functions/llm-deepseek.d.ts +1 -1
  46. package/dist/types/functions/llm-openai-compatible.d.ts +15 -0
  47. package/dist/types/functions/llm-openai.d.ts +3 -2
  48. package/dist/types/functions/llm-utils.d.ts +24 -1
  49. package/dist/types/functions/slack-utils.d.ts +3 -4
  50. package/dist/types/functions/utils.d.ts +2 -14
  51. package/dist/types/functions/zip-utils.d.ts +12 -10
  52. package/dist/types/index.d.ts +33 -0
  53. package/dist/types/schemas/aws-schemas.d.ts +210 -0
  54. package/dist/types/schemas/google-sheets-schemas.d.ts +32 -0
  55. package/dist/types/schemas/index.d.ts +17 -0
  56. package/dist/types/schemas/openai-schemas.d.ts +834 -0
  57. package/dist/types/schemas/perplexity-schemas.d.ts +338 -0
  58. package/dist/types/schemas/validation-helpers.d.ts +33 -0
  59. package/dist/types/types/aws-types.d.ts +1 -1
  60. package/dist/types/types/google-types.d.ts +5 -3
  61. package/dist/types/types/index.d.ts +1 -1
  62. package/dist/types/types/openai-types.d.ts +396 -6
  63. package/dist/types/utils/__tests__/circuit-breaker.test.d.ts +1 -0
  64. package/dist/types/utils/__tests__/correlation.test.d.ts +1 -0
  65. package/dist/types/utils/__tests__/input-validator.test.d.ts +1 -0
  66. package/dist/types/utils/__tests__/llm-cost-tracker.test.d.ts +1 -0
  67. package/dist/types/utils/__tests__/logger.test.d.ts +1 -0
  68. package/dist/types/utils/__tests__/metrics.test.d.ts +1 -0
  69. package/dist/types/utils/__tests__/retry.test.d.ts +1 -0
  70. package/dist/types/utils/__tests__/sanitizer.test.d.ts +1 -0
  71. package/dist/types/utils/__tests__/timeouts.test.d.ts +1 -0
  72. package/dist/types/utils/aws-initialise.d.ts +6 -1
  73. package/dist/types/utils/circuit-breaker.d.ts +99 -0
  74. package/dist/types/utils/config.d.ts +40 -2
  75. package/dist/types/utils/correlation.d.ts +43 -0
  76. package/dist/types/utils/health-check.d.ts +50 -0
  77. package/dist/types/utils/input-validator.d.ts +51 -0
  78. package/dist/types/utils/llm-cost-tracker.d.ts +174 -0
  79. package/dist/types/utils/logger.d.ts +8 -0
  80. package/dist/types/utils/metrics.d.ts +61 -0
  81. package/dist/types/utils/rate-limiter.d.ts +85 -0
  82. package/dist/types/utils/retry.d.ts +58 -0
  83. package/dist/types/utils/sanitizer.d.ts +30 -0
  84. package/dist/types/utils/timeouts.d.ts +44 -0
  85. package/package.json +2 -1
  86. package/dist/index-CcXQeJz8.js.map +0 -1
  87. package/dist/index-CcgbRft2.js.map +0 -1
  88. package/dist/types/aws-types.ts +0 -64
  89. package/dist/types/google-types.ts +0 -48
  90. package/dist/types/index.ts +0 -57
  91. package/dist/types/openai-types.ts +0 -92
@@ -0,0 +1,834 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for a complete OpenAI Chat Completion response.
4
+ * Validates the core fields that lumic-utils depends on.
5
+ * Uses .passthrough() to allow additional fields from newer API versions.
6
+ */
7
+ export declare const openAIChatCompletionSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ object: z.ZodLiteral<"chat.completion">;
10
+ created: z.ZodNumber;
11
+ model: z.ZodString;
12
+ choices: z.ZodArray<z.ZodObject<{
13
+ index: z.ZodNumber;
14
+ message: z.ZodObject<{
15
+ role: z.ZodEnum<["assistant", "system", "user", "tool", "function"]>;
16
+ content: z.ZodNullable<z.ZodString>;
17
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
18
+ id: z.ZodString;
19
+ type: z.ZodLiteral<"function">;
20
+ function: z.ZodObject<{
21
+ name: z.ZodString;
22
+ arguments: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ name: string;
25
+ arguments: string;
26
+ }, {
27
+ name: string;
28
+ arguments: string;
29
+ }>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ function: {
32
+ name: string;
33
+ arguments: string;
34
+ };
35
+ type: "function";
36
+ id: string;
37
+ }, {
38
+ function: {
39
+ name: string;
40
+ arguments: string;
41
+ };
42
+ type: "function";
43
+ id: string;
44
+ }>, "many">>;
45
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ content: string | null;
48
+ role: "function" | "system" | "user" | "assistant" | "tool";
49
+ tool_calls?: {
50
+ function: {
51
+ name: string;
52
+ arguments: string;
53
+ };
54
+ type: "function";
55
+ id: string;
56
+ }[] | undefined;
57
+ refusal?: string | null | undefined;
58
+ }, {
59
+ content: string | null;
60
+ role: "function" | "system" | "user" | "assistant" | "tool";
61
+ tool_calls?: {
62
+ function: {
63
+ name: string;
64
+ arguments: string;
65
+ };
66
+ type: "function";
67
+ id: string;
68
+ }[] | undefined;
69
+ refusal?: string | null | undefined;
70
+ }>;
71
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ message: {
74
+ content: string | null;
75
+ role: "function" | "system" | "user" | "assistant" | "tool";
76
+ tool_calls?: {
77
+ function: {
78
+ name: string;
79
+ arguments: string;
80
+ };
81
+ type: "function";
82
+ id: string;
83
+ }[] | undefined;
84
+ refusal?: string | null | undefined;
85
+ };
86
+ index: number;
87
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
88
+ }, {
89
+ message: {
90
+ content: string | null;
91
+ role: "function" | "system" | "user" | "assistant" | "tool";
92
+ tool_calls?: {
93
+ function: {
94
+ name: string;
95
+ arguments: string;
96
+ };
97
+ type: "function";
98
+ id: string;
99
+ }[] | undefined;
100
+ refusal?: string | null | undefined;
101
+ };
102
+ index: number;
103
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
104
+ }>, "many">;
105
+ usage: z.ZodOptional<z.ZodObject<{
106
+ prompt_tokens: z.ZodNumber;
107
+ completion_tokens: z.ZodNumber;
108
+ total_tokens: z.ZodNumber;
109
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
110
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ cached_tokens?: number | undefined;
113
+ }, {
114
+ cached_tokens?: number | undefined;
115
+ }>>;
116
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
117
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ reasoning_tokens?: number | undefined;
120
+ }, {
121
+ reasoning_tokens?: number | undefined;
122
+ }>>;
123
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
124
+ prompt_tokens: z.ZodNumber;
125
+ completion_tokens: z.ZodNumber;
126
+ total_tokens: z.ZodNumber;
127
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
128
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ cached_tokens?: number | undefined;
131
+ }, {
132
+ cached_tokens?: number | undefined;
133
+ }>>;
134
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
135
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ reasoning_tokens?: number | undefined;
138
+ }, {
139
+ reasoning_tokens?: number | undefined;
140
+ }>>;
141
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
142
+ prompt_tokens: z.ZodNumber;
143
+ completion_tokens: z.ZodNumber;
144
+ total_tokens: z.ZodNumber;
145
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
146
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ cached_tokens?: number | undefined;
149
+ }, {
150
+ cached_tokens?: number | undefined;
151
+ }>>;
152
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
153
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
154
+ }, "strip", z.ZodTypeAny, {
155
+ reasoning_tokens?: number | undefined;
156
+ }, {
157
+ reasoning_tokens?: number | undefined;
158
+ }>>;
159
+ }, z.ZodTypeAny, "passthrough">>>;
160
+ system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
162
+ id: z.ZodString;
163
+ object: z.ZodLiteral<"chat.completion">;
164
+ created: z.ZodNumber;
165
+ model: z.ZodString;
166
+ choices: z.ZodArray<z.ZodObject<{
167
+ index: z.ZodNumber;
168
+ message: z.ZodObject<{
169
+ role: z.ZodEnum<["assistant", "system", "user", "tool", "function"]>;
170
+ content: z.ZodNullable<z.ZodString>;
171
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
172
+ id: z.ZodString;
173
+ type: z.ZodLiteral<"function">;
174
+ function: z.ZodObject<{
175
+ name: z.ZodString;
176
+ arguments: z.ZodString;
177
+ }, "strip", z.ZodTypeAny, {
178
+ name: string;
179
+ arguments: string;
180
+ }, {
181
+ name: string;
182
+ arguments: string;
183
+ }>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ function: {
186
+ name: string;
187
+ arguments: string;
188
+ };
189
+ type: "function";
190
+ id: string;
191
+ }, {
192
+ function: {
193
+ name: string;
194
+ arguments: string;
195
+ };
196
+ type: "function";
197
+ id: string;
198
+ }>, "many">>;
199
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ content: string | null;
202
+ role: "function" | "system" | "user" | "assistant" | "tool";
203
+ tool_calls?: {
204
+ function: {
205
+ name: string;
206
+ arguments: string;
207
+ };
208
+ type: "function";
209
+ id: string;
210
+ }[] | undefined;
211
+ refusal?: string | null | undefined;
212
+ }, {
213
+ content: string | null;
214
+ role: "function" | "system" | "user" | "assistant" | "tool";
215
+ tool_calls?: {
216
+ function: {
217
+ name: string;
218
+ arguments: string;
219
+ };
220
+ type: "function";
221
+ id: string;
222
+ }[] | undefined;
223
+ refusal?: string | null | undefined;
224
+ }>;
225
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
226
+ }, "strip", z.ZodTypeAny, {
227
+ message: {
228
+ content: string | null;
229
+ role: "function" | "system" | "user" | "assistant" | "tool";
230
+ tool_calls?: {
231
+ function: {
232
+ name: string;
233
+ arguments: string;
234
+ };
235
+ type: "function";
236
+ id: string;
237
+ }[] | undefined;
238
+ refusal?: string | null | undefined;
239
+ };
240
+ index: number;
241
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
242
+ }, {
243
+ message: {
244
+ content: string | null;
245
+ role: "function" | "system" | "user" | "assistant" | "tool";
246
+ tool_calls?: {
247
+ function: {
248
+ name: string;
249
+ arguments: string;
250
+ };
251
+ type: "function";
252
+ id: string;
253
+ }[] | undefined;
254
+ refusal?: string | null | undefined;
255
+ };
256
+ index: number;
257
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
258
+ }>, "many">;
259
+ usage: z.ZodOptional<z.ZodObject<{
260
+ prompt_tokens: z.ZodNumber;
261
+ completion_tokens: z.ZodNumber;
262
+ total_tokens: z.ZodNumber;
263
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
264
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ cached_tokens?: number | undefined;
267
+ }, {
268
+ cached_tokens?: number | undefined;
269
+ }>>;
270
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
271
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ reasoning_tokens?: number | undefined;
274
+ }, {
275
+ reasoning_tokens?: number | undefined;
276
+ }>>;
277
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
278
+ prompt_tokens: z.ZodNumber;
279
+ completion_tokens: z.ZodNumber;
280
+ total_tokens: z.ZodNumber;
281
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
282
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
283
+ }, "strip", z.ZodTypeAny, {
284
+ cached_tokens?: number | undefined;
285
+ }, {
286
+ cached_tokens?: number | undefined;
287
+ }>>;
288
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
289
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ reasoning_tokens?: number | undefined;
292
+ }, {
293
+ reasoning_tokens?: number | undefined;
294
+ }>>;
295
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
296
+ prompt_tokens: z.ZodNumber;
297
+ completion_tokens: z.ZodNumber;
298
+ total_tokens: z.ZodNumber;
299
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
300
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ cached_tokens?: number | undefined;
303
+ }, {
304
+ cached_tokens?: number | undefined;
305
+ }>>;
306
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
307
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
308
+ }, "strip", z.ZodTypeAny, {
309
+ reasoning_tokens?: number | undefined;
310
+ }, {
311
+ reasoning_tokens?: number | undefined;
312
+ }>>;
313
+ }, z.ZodTypeAny, "passthrough">>>;
314
+ system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
316
+ id: z.ZodString;
317
+ object: z.ZodLiteral<"chat.completion">;
318
+ created: z.ZodNumber;
319
+ model: z.ZodString;
320
+ choices: z.ZodArray<z.ZodObject<{
321
+ index: z.ZodNumber;
322
+ message: z.ZodObject<{
323
+ role: z.ZodEnum<["assistant", "system", "user", "tool", "function"]>;
324
+ content: z.ZodNullable<z.ZodString>;
325
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
326
+ id: z.ZodString;
327
+ type: z.ZodLiteral<"function">;
328
+ function: z.ZodObject<{
329
+ name: z.ZodString;
330
+ arguments: z.ZodString;
331
+ }, "strip", z.ZodTypeAny, {
332
+ name: string;
333
+ arguments: string;
334
+ }, {
335
+ name: string;
336
+ arguments: string;
337
+ }>;
338
+ }, "strip", z.ZodTypeAny, {
339
+ function: {
340
+ name: string;
341
+ arguments: string;
342
+ };
343
+ type: "function";
344
+ id: string;
345
+ }, {
346
+ function: {
347
+ name: string;
348
+ arguments: string;
349
+ };
350
+ type: "function";
351
+ id: string;
352
+ }>, "many">>;
353
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
354
+ }, "strip", z.ZodTypeAny, {
355
+ content: string | null;
356
+ role: "function" | "system" | "user" | "assistant" | "tool";
357
+ tool_calls?: {
358
+ function: {
359
+ name: string;
360
+ arguments: string;
361
+ };
362
+ type: "function";
363
+ id: string;
364
+ }[] | undefined;
365
+ refusal?: string | null | undefined;
366
+ }, {
367
+ content: string | null;
368
+ role: "function" | "system" | "user" | "assistant" | "tool";
369
+ tool_calls?: {
370
+ function: {
371
+ name: string;
372
+ arguments: string;
373
+ };
374
+ type: "function";
375
+ id: string;
376
+ }[] | undefined;
377
+ refusal?: string | null | undefined;
378
+ }>;
379
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ message: {
382
+ content: string | null;
383
+ role: "function" | "system" | "user" | "assistant" | "tool";
384
+ tool_calls?: {
385
+ function: {
386
+ name: string;
387
+ arguments: string;
388
+ };
389
+ type: "function";
390
+ id: string;
391
+ }[] | undefined;
392
+ refusal?: string | null | undefined;
393
+ };
394
+ index: number;
395
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
396
+ }, {
397
+ message: {
398
+ content: string | null;
399
+ role: "function" | "system" | "user" | "assistant" | "tool";
400
+ tool_calls?: {
401
+ function: {
402
+ name: string;
403
+ arguments: string;
404
+ };
405
+ type: "function";
406
+ id: string;
407
+ }[] | undefined;
408
+ refusal?: string | null | undefined;
409
+ };
410
+ index: number;
411
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
412
+ }>, "many">;
413
+ usage: z.ZodOptional<z.ZodObject<{
414
+ prompt_tokens: z.ZodNumber;
415
+ completion_tokens: z.ZodNumber;
416
+ total_tokens: z.ZodNumber;
417
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
418
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
419
+ }, "strip", z.ZodTypeAny, {
420
+ cached_tokens?: number | undefined;
421
+ }, {
422
+ cached_tokens?: number | undefined;
423
+ }>>;
424
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
425
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
426
+ }, "strip", z.ZodTypeAny, {
427
+ reasoning_tokens?: number | undefined;
428
+ }, {
429
+ reasoning_tokens?: number | undefined;
430
+ }>>;
431
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
432
+ prompt_tokens: z.ZodNumber;
433
+ completion_tokens: z.ZodNumber;
434
+ total_tokens: z.ZodNumber;
435
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
436
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
437
+ }, "strip", z.ZodTypeAny, {
438
+ cached_tokens?: number | undefined;
439
+ }, {
440
+ cached_tokens?: number | undefined;
441
+ }>>;
442
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
443
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
444
+ }, "strip", z.ZodTypeAny, {
445
+ reasoning_tokens?: number | undefined;
446
+ }, {
447
+ reasoning_tokens?: number | undefined;
448
+ }>>;
449
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
450
+ prompt_tokens: z.ZodNumber;
451
+ completion_tokens: z.ZodNumber;
452
+ total_tokens: z.ZodNumber;
453
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
454
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ cached_tokens?: number | undefined;
457
+ }, {
458
+ cached_tokens?: number | undefined;
459
+ }>>;
460
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
461
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
462
+ }, "strip", z.ZodTypeAny, {
463
+ reasoning_tokens?: number | undefined;
464
+ }, {
465
+ reasoning_tokens?: number | undefined;
466
+ }>>;
467
+ }, z.ZodTypeAny, "passthrough">>>;
468
+ system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
469
+ }, z.ZodTypeAny, "passthrough">>;
470
+ /**
471
+ * Zod schema for an OpenAI Image Generation response.
472
+ */
473
+ export declare const openAIImageResponseSchema: z.ZodObject<{
474
+ created: z.ZodNumber;
475
+ data: z.ZodArray<z.ZodObject<{
476
+ url: z.ZodOptional<z.ZodString>;
477
+ b64_json: z.ZodOptional<z.ZodString>;
478
+ revised_prompt: z.ZodOptional<z.ZodString>;
479
+ }, "strip", z.ZodTypeAny, {
480
+ url?: string | undefined;
481
+ b64_json?: string | undefined;
482
+ revised_prompt?: string | undefined;
483
+ }, {
484
+ url?: string | undefined;
485
+ b64_json?: string | undefined;
486
+ revised_prompt?: string | undefined;
487
+ }>, "many">;
488
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
489
+ created: z.ZodNumber;
490
+ data: z.ZodArray<z.ZodObject<{
491
+ url: z.ZodOptional<z.ZodString>;
492
+ b64_json: z.ZodOptional<z.ZodString>;
493
+ revised_prompt: z.ZodOptional<z.ZodString>;
494
+ }, "strip", z.ZodTypeAny, {
495
+ url?: string | undefined;
496
+ b64_json?: string | undefined;
497
+ revised_prompt?: string | undefined;
498
+ }, {
499
+ url?: string | undefined;
500
+ b64_json?: string | undefined;
501
+ revised_prompt?: string | undefined;
502
+ }>, "many">;
503
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
504
+ created: z.ZodNumber;
505
+ data: z.ZodArray<z.ZodObject<{
506
+ url: z.ZodOptional<z.ZodString>;
507
+ b64_json: z.ZodOptional<z.ZodString>;
508
+ revised_prompt: z.ZodOptional<z.ZodString>;
509
+ }, "strip", z.ZodTypeAny, {
510
+ url?: string | undefined;
511
+ b64_json?: string | undefined;
512
+ revised_prompt?: string | undefined;
513
+ }, {
514
+ url?: string | undefined;
515
+ b64_json?: string | undefined;
516
+ revised_prompt?: string | undefined;
517
+ }>, "many">;
518
+ }, z.ZodTypeAny, "passthrough">>;
519
+ /** Type inferred from the Chat Completion schema */
520
+ export type OpenAIChatCompletion = z.infer<typeof openAIChatCompletionSchema>;
521
+ /** Type inferred from the Image Response schema */
522
+ export type OpenAIImageResponse = z.infer<typeof openAIImageResponseSchema>;
523
+ /** Strict validator for OpenAI Chat Completion responses. Throws on failure. */
524
+ export declare const validateOpenAIChatCompletion: (data: unknown) => z.objectInputType<{
525
+ id: z.ZodString;
526
+ object: z.ZodLiteral<"chat.completion">;
527
+ created: z.ZodNumber;
528
+ model: z.ZodString;
529
+ choices: z.ZodArray<z.ZodObject<{
530
+ index: z.ZodNumber;
531
+ message: z.ZodObject<{
532
+ role: z.ZodEnum<["assistant", "system", "user", "tool", "function"]>;
533
+ content: z.ZodNullable<z.ZodString>;
534
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
535
+ id: z.ZodString;
536
+ type: z.ZodLiteral<"function">;
537
+ function: z.ZodObject<{
538
+ name: z.ZodString;
539
+ arguments: z.ZodString;
540
+ }, "strip", z.ZodTypeAny, {
541
+ name: string;
542
+ arguments: string;
543
+ }, {
544
+ name: string;
545
+ arguments: string;
546
+ }>;
547
+ }, "strip", z.ZodTypeAny, {
548
+ function: {
549
+ name: string;
550
+ arguments: string;
551
+ };
552
+ type: "function";
553
+ id: string;
554
+ }, {
555
+ function: {
556
+ name: string;
557
+ arguments: string;
558
+ };
559
+ type: "function";
560
+ id: string;
561
+ }>, "many">>;
562
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
563
+ }, "strip", z.ZodTypeAny, {
564
+ content: string | null;
565
+ role: "function" | "system" | "user" | "assistant" | "tool";
566
+ tool_calls?: {
567
+ function: {
568
+ name: string;
569
+ arguments: string;
570
+ };
571
+ type: "function";
572
+ id: string;
573
+ }[] | undefined;
574
+ refusal?: string | null | undefined;
575
+ }, {
576
+ content: string | null;
577
+ role: "function" | "system" | "user" | "assistant" | "tool";
578
+ tool_calls?: {
579
+ function: {
580
+ name: string;
581
+ arguments: string;
582
+ };
583
+ type: "function";
584
+ id: string;
585
+ }[] | undefined;
586
+ refusal?: string | null | undefined;
587
+ }>;
588
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
589
+ }, "strip", z.ZodTypeAny, {
590
+ message: {
591
+ content: string | null;
592
+ role: "function" | "system" | "user" | "assistant" | "tool";
593
+ tool_calls?: {
594
+ function: {
595
+ name: string;
596
+ arguments: string;
597
+ };
598
+ type: "function";
599
+ id: string;
600
+ }[] | undefined;
601
+ refusal?: string | null | undefined;
602
+ };
603
+ index: number;
604
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
605
+ }, {
606
+ message: {
607
+ content: string | null;
608
+ role: "function" | "system" | "user" | "assistant" | "tool";
609
+ tool_calls?: {
610
+ function: {
611
+ name: string;
612
+ arguments: string;
613
+ };
614
+ type: "function";
615
+ id: string;
616
+ }[] | undefined;
617
+ refusal?: string | null | undefined;
618
+ };
619
+ index: number;
620
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
621
+ }>, "many">;
622
+ usage: z.ZodOptional<z.ZodObject<{
623
+ prompt_tokens: z.ZodNumber;
624
+ completion_tokens: z.ZodNumber;
625
+ total_tokens: z.ZodNumber;
626
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
627
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
628
+ }, "strip", z.ZodTypeAny, {
629
+ cached_tokens?: number | undefined;
630
+ }, {
631
+ cached_tokens?: number | undefined;
632
+ }>>;
633
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
634
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
635
+ }, "strip", z.ZodTypeAny, {
636
+ reasoning_tokens?: number | undefined;
637
+ }, {
638
+ reasoning_tokens?: number | undefined;
639
+ }>>;
640
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
641
+ prompt_tokens: z.ZodNumber;
642
+ completion_tokens: z.ZodNumber;
643
+ total_tokens: z.ZodNumber;
644
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
645
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
646
+ }, "strip", z.ZodTypeAny, {
647
+ cached_tokens?: number | undefined;
648
+ }, {
649
+ cached_tokens?: number | undefined;
650
+ }>>;
651
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
652
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
653
+ }, "strip", z.ZodTypeAny, {
654
+ reasoning_tokens?: number | undefined;
655
+ }, {
656
+ reasoning_tokens?: number | undefined;
657
+ }>>;
658
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
659
+ prompt_tokens: z.ZodNumber;
660
+ completion_tokens: z.ZodNumber;
661
+ total_tokens: z.ZodNumber;
662
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
663
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
664
+ }, "strip", z.ZodTypeAny, {
665
+ cached_tokens?: number | undefined;
666
+ }, {
667
+ cached_tokens?: number | undefined;
668
+ }>>;
669
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
670
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ reasoning_tokens?: number | undefined;
673
+ }, {
674
+ reasoning_tokens?: number | undefined;
675
+ }>>;
676
+ }, z.ZodTypeAny, "passthrough">>>;
677
+ system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
678
+ }, z.ZodTypeAny, "passthrough">;
679
+ /** Safe validator for OpenAI Chat Completion responses. Never throws. */
680
+ export declare const safeValidateOpenAIChatCompletion: (data: unknown) => import("./validation-helpers").ValidationResult<z.objectInputType<{
681
+ id: z.ZodString;
682
+ object: z.ZodLiteral<"chat.completion">;
683
+ created: z.ZodNumber;
684
+ model: z.ZodString;
685
+ choices: z.ZodArray<z.ZodObject<{
686
+ index: z.ZodNumber;
687
+ message: z.ZodObject<{
688
+ role: z.ZodEnum<["assistant", "system", "user", "tool", "function"]>;
689
+ content: z.ZodNullable<z.ZodString>;
690
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
691
+ id: z.ZodString;
692
+ type: z.ZodLiteral<"function">;
693
+ function: z.ZodObject<{
694
+ name: z.ZodString;
695
+ arguments: z.ZodString;
696
+ }, "strip", z.ZodTypeAny, {
697
+ name: string;
698
+ arguments: string;
699
+ }, {
700
+ name: string;
701
+ arguments: string;
702
+ }>;
703
+ }, "strip", z.ZodTypeAny, {
704
+ function: {
705
+ name: string;
706
+ arguments: string;
707
+ };
708
+ type: "function";
709
+ id: string;
710
+ }, {
711
+ function: {
712
+ name: string;
713
+ arguments: string;
714
+ };
715
+ type: "function";
716
+ id: string;
717
+ }>, "many">>;
718
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
719
+ }, "strip", z.ZodTypeAny, {
720
+ content: string | null;
721
+ role: "function" | "system" | "user" | "assistant" | "tool";
722
+ tool_calls?: {
723
+ function: {
724
+ name: string;
725
+ arguments: string;
726
+ };
727
+ type: "function";
728
+ id: string;
729
+ }[] | undefined;
730
+ refusal?: string | null | undefined;
731
+ }, {
732
+ content: string | null;
733
+ role: "function" | "system" | "user" | "assistant" | "tool";
734
+ tool_calls?: {
735
+ function: {
736
+ name: string;
737
+ arguments: string;
738
+ };
739
+ type: "function";
740
+ id: string;
741
+ }[] | undefined;
742
+ refusal?: string | null | undefined;
743
+ }>;
744
+ finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter", "function_call"]>>;
745
+ }, "strip", z.ZodTypeAny, {
746
+ message: {
747
+ content: string | null;
748
+ role: "function" | "system" | "user" | "assistant" | "tool";
749
+ tool_calls?: {
750
+ function: {
751
+ name: string;
752
+ arguments: string;
753
+ };
754
+ type: "function";
755
+ id: string;
756
+ }[] | undefined;
757
+ refusal?: string | null | undefined;
758
+ };
759
+ index: number;
760
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
761
+ }, {
762
+ message: {
763
+ content: string | null;
764
+ role: "function" | "system" | "user" | "assistant" | "tool";
765
+ tool_calls?: {
766
+ function: {
767
+ name: string;
768
+ arguments: string;
769
+ };
770
+ type: "function";
771
+ id: string;
772
+ }[] | undefined;
773
+ refusal?: string | null | undefined;
774
+ };
775
+ index: number;
776
+ finish_reason: "length" | "tool_calls" | "function_call" | "stop" | "content_filter" | null;
777
+ }>, "many">;
778
+ usage: z.ZodOptional<z.ZodObject<{
779
+ prompt_tokens: z.ZodNumber;
780
+ completion_tokens: z.ZodNumber;
781
+ total_tokens: z.ZodNumber;
782
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
783
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
784
+ }, "strip", z.ZodTypeAny, {
785
+ cached_tokens?: number | undefined;
786
+ }, {
787
+ cached_tokens?: number | undefined;
788
+ }>>;
789
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
790
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
791
+ }, "strip", z.ZodTypeAny, {
792
+ reasoning_tokens?: number | undefined;
793
+ }, {
794
+ reasoning_tokens?: number | undefined;
795
+ }>>;
796
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
797
+ prompt_tokens: z.ZodNumber;
798
+ completion_tokens: z.ZodNumber;
799
+ total_tokens: z.ZodNumber;
800
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
801
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
802
+ }, "strip", z.ZodTypeAny, {
803
+ cached_tokens?: number | undefined;
804
+ }, {
805
+ cached_tokens?: number | undefined;
806
+ }>>;
807
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
808
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
809
+ }, "strip", z.ZodTypeAny, {
810
+ reasoning_tokens?: number | undefined;
811
+ }, {
812
+ reasoning_tokens?: number | undefined;
813
+ }>>;
814
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
815
+ prompt_tokens: z.ZodNumber;
816
+ completion_tokens: z.ZodNumber;
817
+ total_tokens: z.ZodNumber;
818
+ prompt_tokens_details: z.ZodOptional<z.ZodObject<{
819
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
820
+ }, "strip", z.ZodTypeAny, {
821
+ cached_tokens?: number | undefined;
822
+ }, {
823
+ cached_tokens?: number | undefined;
824
+ }>>;
825
+ completion_tokens_details: z.ZodOptional<z.ZodObject<{
826
+ reasoning_tokens: z.ZodOptional<z.ZodNumber>;
827
+ }, "strip", z.ZodTypeAny, {
828
+ reasoning_tokens?: number | undefined;
829
+ }, {
830
+ reasoning_tokens?: number | undefined;
831
+ }>>;
832
+ }, z.ZodTypeAny, "passthrough">>>;
833
+ system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
834
+ }, z.ZodTypeAny, "passthrough">>;