@adaptic/lumic-utils 1.0.8 → 1.0.9

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 (87) hide show
  1. package/dist/{index-Cstek604.js → index-CcXQeJz8.js} +22 -182
  2. package/dist/index-CcXQeJz8.js.map +1 -0
  3. package/dist/{index-DZZCd-1T.js → index-CcgbRft2.js} +22 -182
  4. package/dist/index-CcgbRft2.js.map +1 -0
  5. package/dist/index.cjs +11417 -122
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.mjs +11399 -39
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/test.cjs +7 -24
  10. package/dist/test.cjs.map +1 -1
  11. package/dist/test.mjs +7 -24
  12. package/dist/test.mjs.map +1 -1
  13. package/dist/types/aws-types.ts +1 -1
  14. package/dist/types/functions/aws-lambda.d.ts +1 -1
  15. package/dist/types/functions/aws-s3-utils.d.ts +2 -2
  16. package/dist/types/functions/google-sheets.d.ts +4 -4
  17. package/dist/types/functions/json-llm-tools.d.ts +3 -25
  18. package/dist/types/functions/llm-call.d.ts +2 -2
  19. package/dist/types/functions/llm-deepseek.d.ts +1 -1
  20. package/dist/types/functions/llm-openai.d.ts +2 -3
  21. package/dist/types/functions/llm-utils.d.ts +1 -24
  22. package/dist/types/functions/slack-utils.d.ts +4 -3
  23. package/dist/types/functions/utils.d.ts +14 -2
  24. package/dist/types/functions/zip-utils.d.ts +10 -12
  25. package/dist/types/google-types.ts +3 -6
  26. package/dist/types/index.d.ts +0 -30
  27. package/dist/types/index.ts +1 -1
  28. package/dist/types/openai-types.ts +6 -165
  29. package/dist/types/types/aws-types.d.ts +1 -1
  30. package/dist/types/types/google-types.d.ts +3 -5
  31. package/dist/types/types/index.d.ts +1 -1
  32. package/dist/types/types/openai-types.d.ts +3 -149
  33. package/dist/types/utils/aws-initialise.d.ts +1 -6
  34. package/package.json +3 -2
  35. package/dist/apollo-client.client-DE7JUXjy.js +0 -3693
  36. package/dist/apollo-client.client-DE7JUXjy.js.map +0 -1
  37. package/dist/apollo-client.client-DlG4HsFm.js +0 -3704
  38. package/dist/apollo-client.client-DlG4HsFm.js.map +0 -1
  39. package/dist/apollo-client.server-D1QJea5_.js +0 -16319
  40. package/dist/apollo-client.server-D1QJea5_.js.map +0 -1
  41. package/dist/apollo-client.server-uqalq3yp.js +0 -16321
  42. package/dist/apollo-client.server-uqalq3yp.js.map +0 -1
  43. package/dist/index-Bd84zcTQ.js +0 -74944
  44. package/dist/index-Bd84zcTQ.js.map +0 -1
  45. package/dist/index-CZKOqrJ4.js +0 -75137
  46. package/dist/index-CZKOqrJ4.js.map +0 -1
  47. package/dist/index-CsKfs4nG.js +0 -12108
  48. package/dist/index-CsKfs4nG.js.map +0 -1
  49. package/dist/index-Cstek604.js.map +0 -1
  50. package/dist/index-DZZCd-1T.js.map +0 -1
  51. package/dist/index-aP9ow8_W.js +0 -12271
  52. package/dist/index-aP9ow8_W.js.map +0 -1
  53. package/dist/types/config/__tests__/secrets.test.d.ts +0 -1
  54. package/dist/types/config/secrets.d.ts +0 -186
  55. package/dist/types/errors/__tests__/errors.test.d.ts +0 -1
  56. package/dist/types/errors/index.d.ts +0 -77
  57. package/dist/types/functions/__tests__/aws-lambda.test.d.ts +0 -1
  58. package/dist/types/functions/__tests__/aws-s3-utils.test.d.ts +0 -1
  59. package/dist/types/functions/__tests__/json-llm-tools.test.d.ts +0 -1
  60. package/dist/types/functions/__tests__/json-tools.test.d.ts +0 -1
  61. package/dist/types/functions/__tests__/slack-utils.test.d.ts +0 -1
  62. package/dist/types/schemas/aws-schemas.d.ts +0 -210
  63. package/dist/types/schemas/google-sheets-schemas.d.ts +0 -32
  64. package/dist/types/schemas/index.d.ts +0 -17
  65. package/dist/types/schemas/openai-schemas.d.ts +0 -834
  66. package/dist/types/schemas/perplexity-schemas.d.ts +0 -338
  67. package/dist/types/schemas/validation-helpers.d.ts +0 -33
  68. package/dist/types/utils/__tests__/circuit-breaker.test.d.ts +0 -1
  69. package/dist/types/utils/__tests__/correlation.test.d.ts +0 -1
  70. package/dist/types/utils/__tests__/input-validator.test.d.ts +0 -1
  71. package/dist/types/utils/__tests__/llm-cost-tracker.test.d.ts +0 -1
  72. package/dist/types/utils/__tests__/logger.test.d.ts +0 -1
  73. package/dist/types/utils/__tests__/metrics.test.d.ts +0 -1
  74. package/dist/types/utils/__tests__/retry.test.d.ts +0 -1
  75. package/dist/types/utils/__tests__/sanitizer.test.d.ts +0 -1
  76. package/dist/types/utils/__tests__/timeouts.test.d.ts +0 -1
  77. package/dist/types/utils/circuit-breaker.d.ts +0 -99
  78. package/dist/types/utils/correlation.d.ts +0 -43
  79. package/dist/types/utils/health-check.d.ts +0 -50
  80. package/dist/types/utils/input-validator.d.ts +0 -51
  81. package/dist/types/utils/llm-cost-tracker.d.ts +0 -174
  82. package/dist/types/utils/logger.d.ts +0 -8
  83. package/dist/types/utils/metrics.d.ts +0 -61
  84. package/dist/types/utils/rate-limiter.d.ts +0 -85
  85. package/dist/types/utils/retry.d.ts +0 -58
  86. package/dist/types/utils/sanitizer.d.ts +0 -30
  87. package/dist/types/utils/timeouts.d.ts +0 -44
@@ -1,834 +0,0 @@
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
- role: "function" | "system" | "user" | "assistant" | "tool";
48
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
60
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
75
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
91
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
202
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
214
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
229
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
245
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
356
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
368
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
383
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
399
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
565
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
577
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
592
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
608
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
721
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
733
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
748
- content: string | null;
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
- role: "function" | "system" | "user" | "assistant" | "tool";
764
- content: string | null;
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">>;