kimi-proxy 0.0.3 → 0.1.1

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 (38) hide show
  1. package/README.md +17 -8
  2. package/dist/config.d.ts +11 -3
  3. package/dist/core/clientAdapters.d.ts +18 -0
  4. package/dist/core/ensureToolCall.d.ts +3 -3
  5. package/dist/core/json.d.ts +3 -0
  6. package/dist/core/pipeline.d.ts +30 -15
  7. package/dist/core/pipelineControl.d.ts +1 -1
  8. package/dist/core/providerAdapters.d.ts +4 -0
  9. package/dist/core/providers/anthropic.d.ts +16 -0
  10. package/dist/core/providers/openai.d.ts +2192 -0
  11. package/dist/core/providers/openrouter.d.ts +31 -0
  12. package/dist/core/providers/shared.d.ts +10 -0
  13. package/dist/core/providers/vertex.d.ts +45 -0
  14. package/dist/core/schemas.d.ts +2841 -0
  15. package/dist/core/transforms.d.ts +44 -0
  16. package/dist/core/types.d.ts +2765 -51
  17. package/dist/index.js +5922 -12
  18. package/dist/index.js.map +37 -1
  19. package/dist/livestore/runtime.d.ts +71 -0
  20. package/dist/persistence/hybridLogStore.d.ts +82 -0
  21. package/dist/persistence/migrateLogs.d.ts +1 -0
  22. package/dist/persistence/signatureCache.d.ts +5 -6
  23. package/dist/server.d.ts +1 -1
  24. package/dist/services/blobSearch/ripgrep.d.ts +17 -0
  25. package/dist/services/kimiFixer.d.ts +1 -1
  26. package/dist/services/logSearch.d.ts +15 -0
  27. package/dist/services/streaming.d.ts +4 -4
  28. package/dist/utils/envResolver.d.ts +1 -1
  29. package/dist/utils/httpCapture.d.ts +19 -0
  30. package/frontend/dist/assets/JSONViewer-516863bb.js +3 -0
  31. package/frontend/dist/assets/index-413f3c24.css +1 -0
  32. package/frontend/dist/assets/index-fd87815b.js +300 -0
  33. package/frontend/dist/assets/wa-sqlite-be172f22.wasm +0 -0
  34. package/frontend/dist/index.html +2 -2
  35. package/package.json +30 -16
  36. package/frontend/dist/assets/JSONViewer-2759ef29.js +0 -3
  37. package/frontend/dist/assets/index-0e7c091b.css +0 -1
  38. package/frontend/dist/assets/index-a3cad95b.js +0 -40
@@ -0,0 +1,2841 @@
1
+ import { z } from "zod";
2
+ export declare const FunctionSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ description: z.ZodOptional<z.ZodString>;
5
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6
+ strict: z.ZodOptional<z.ZodBoolean>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ name: string;
9
+ description?: string | undefined;
10
+ parameters?: Record<string, unknown> | undefined;
11
+ strict?: boolean | undefined;
12
+ }, {
13
+ name: string;
14
+ description?: string | undefined;
15
+ parameters?: Record<string, unknown> | undefined;
16
+ strict?: boolean | undefined;
17
+ }>;
18
+ export declare const ToolSchema: z.ZodObject<{
19
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
20
+ function: z.ZodObject<{
21
+ name: z.ZodString;
22
+ description: z.ZodOptional<z.ZodString>;
23
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
24
+ strict: z.ZodOptional<z.ZodBoolean>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ name: string;
27
+ description?: string | undefined;
28
+ parameters?: Record<string, unknown> | undefined;
29
+ strict?: boolean | undefined;
30
+ }, {
31
+ name: string;
32
+ description?: string | undefined;
33
+ parameters?: Record<string, unknown> | undefined;
34
+ strict?: boolean | undefined;
35
+ }>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ function: {
38
+ name: string;
39
+ description?: string | undefined;
40
+ parameters?: Record<string, unknown> | undefined;
41
+ strict?: boolean | undefined;
42
+ };
43
+ type: "function";
44
+ }, {
45
+ function: {
46
+ name: string;
47
+ description?: string | undefined;
48
+ parameters?: Record<string, unknown> | undefined;
49
+ strict?: boolean | undefined;
50
+ };
51
+ type?: "function" | undefined;
52
+ }>;
53
+ export declare const ToolCallSchema: z.ZodObject<{
54
+ id: z.ZodString;
55
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
56
+ function: z.ZodObject<{
57
+ name: z.ZodString;
58
+ arguments: z.ZodString;
59
+ }, "strip", z.ZodTypeAny, {
60
+ name: string;
61
+ arguments: string;
62
+ }, {
63
+ name: string;
64
+ arguments: string;
65
+ }>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ function: {
68
+ name: string;
69
+ arguments: string;
70
+ };
71
+ type: "function";
72
+ id: string;
73
+ }, {
74
+ function: {
75
+ name: string;
76
+ arguments: string;
77
+ };
78
+ id: string;
79
+ type?: "function" | undefined;
80
+ }>;
81
+ export declare const OpenAIChatMessageSchema: z.ZodObject<{
82
+ role: z.ZodString;
83
+ content: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
84
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
85
+ text: z.ZodString;
86
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
87
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
88
+ text: z.ZodString;
89
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
90
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
91
+ text: z.ZodString;
92
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
93
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
94
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
95
+ url: z.ZodString;
96
+ detail: z.ZodOptional<z.ZodString>;
97
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
98
+ url: z.ZodString;
99
+ detail: z.ZodOptional<z.ZodString>;
100
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
101
+ url: z.ZodString;
102
+ detail: z.ZodOptional<z.ZodString>;
103
+ }, z.ZodTypeAny, "passthrough">>]>;
104
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
105
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
106
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
107
+ url: z.ZodString;
108
+ detail: z.ZodOptional<z.ZodString>;
109
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
110
+ url: z.ZodString;
111
+ detail: z.ZodOptional<z.ZodString>;
112
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
113
+ url: z.ZodString;
114
+ detail: z.ZodOptional<z.ZodString>;
115
+ }, z.ZodTypeAny, "passthrough">>]>;
116
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
117
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
118
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
119
+ url: z.ZodString;
120
+ detail: z.ZodOptional<z.ZodString>;
121
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
122
+ url: z.ZodString;
123
+ detail: z.ZodOptional<z.ZodString>;
124
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
125
+ url: z.ZodString;
126
+ detail: z.ZodOptional<z.ZodString>;
127
+ }, z.ZodTypeAny, "passthrough">>]>;
128
+ }, z.ZodTypeAny, "passthrough">>]>, "many">]>>>;
129
+ name: z.ZodOptional<z.ZodString>;
130
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
131
+ id: z.ZodString;
132
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
133
+ function: z.ZodObject<{
134
+ name: z.ZodString;
135
+ arguments: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ name: string;
138
+ arguments?: string | Record<string, unknown> | undefined;
139
+ }, {
140
+ name: string;
141
+ arguments?: string | Record<string, unknown> | undefined;
142
+ }>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ function: {
145
+ name: string;
146
+ arguments?: string | Record<string, unknown> | undefined;
147
+ };
148
+ type: "function";
149
+ id: string;
150
+ }, {
151
+ function: {
152
+ name: string;
153
+ arguments?: string | Record<string, unknown> | undefined;
154
+ };
155
+ id: string;
156
+ type?: "function" | undefined;
157
+ }>, "many">>;
158
+ function_call: z.ZodOptional<z.ZodNullable<z.ZodObject<{
159
+ name: z.ZodString;
160
+ arguments: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ name: string;
163
+ arguments?: string | Record<string, unknown> | undefined;
164
+ }, {
165
+ name: string;
166
+ arguments?: string | Record<string, unknown> | undefined;
167
+ }>>>;
168
+ tool_call_id: z.ZodOptional<z.ZodString>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ role: string;
171
+ name?: string | undefined;
172
+ content?: string | (z.objectOutputType<{
173
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
174
+ text: z.ZodString;
175
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
176
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
177
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
178
+ url: z.ZodString;
179
+ detail: z.ZodOptional<z.ZodString>;
180
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
181
+ url: z.ZodString;
182
+ detail: z.ZodOptional<z.ZodString>;
183
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
184
+ url: z.ZodString;
185
+ detail: z.ZodOptional<z.ZodString>;
186
+ }, z.ZodTypeAny, "passthrough">>]>;
187
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
188
+ tool_calls?: {
189
+ function: {
190
+ name: string;
191
+ arguments?: string | Record<string, unknown> | undefined;
192
+ };
193
+ type: "function";
194
+ id: string;
195
+ }[] | undefined;
196
+ function_call?: {
197
+ name: string;
198
+ arguments?: string | Record<string, unknown> | undefined;
199
+ } | null | undefined;
200
+ tool_call_id?: string | undefined;
201
+ }, {
202
+ role: string;
203
+ name?: string | undefined;
204
+ content?: string | (z.objectInputType<{
205
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
206
+ text: z.ZodString;
207
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
208
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
209
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
210
+ url: z.ZodString;
211
+ detail: z.ZodOptional<z.ZodString>;
212
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
213
+ url: z.ZodString;
214
+ detail: z.ZodOptional<z.ZodString>;
215
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
216
+ url: z.ZodString;
217
+ detail: z.ZodOptional<z.ZodString>;
218
+ }, z.ZodTypeAny, "passthrough">>]>;
219
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
220
+ tool_calls?: {
221
+ function: {
222
+ name: string;
223
+ arguments?: string | Record<string, unknown> | undefined;
224
+ };
225
+ id: string;
226
+ type?: "function" | undefined;
227
+ }[] | undefined;
228
+ function_call?: {
229
+ name: string;
230
+ arguments?: string | Record<string, unknown> | undefined;
231
+ } | null | undefined;
232
+ tool_call_id?: string | undefined;
233
+ }>;
234
+ export declare const OpenAIChatCompletionRequestSchema: z.ZodObject<{
235
+ model: z.ZodString;
236
+ messages: z.ZodArray<z.ZodObject<{
237
+ role: z.ZodString;
238
+ content: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
239
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
240
+ text: z.ZodString;
241
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
242
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
243
+ text: z.ZodString;
244
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
245
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
246
+ text: z.ZodString;
247
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
248
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
249
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
250
+ url: z.ZodString;
251
+ detail: z.ZodOptional<z.ZodString>;
252
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
253
+ url: z.ZodString;
254
+ detail: z.ZodOptional<z.ZodString>;
255
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
256
+ url: z.ZodString;
257
+ detail: z.ZodOptional<z.ZodString>;
258
+ }, z.ZodTypeAny, "passthrough">>]>;
259
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
260
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
261
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
262
+ url: z.ZodString;
263
+ detail: z.ZodOptional<z.ZodString>;
264
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
265
+ url: z.ZodString;
266
+ detail: z.ZodOptional<z.ZodString>;
267
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
268
+ url: z.ZodString;
269
+ detail: z.ZodOptional<z.ZodString>;
270
+ }, z.ZodTypeAny, "passthrough">>]>;
271
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
272
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
273
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
274
+ url: z.ZodString;
275
+ detail: z.ZodOptional<z.ZodString>;
276
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
277
+ url: z.ZodString;
278
+ detail: z.ZodOptional<z.ZodString>;
279
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
280
+ url: z.ZodString;
281
+ detail: z.ZodOptional<z.ZodString>;
282
+ }, z.ZodTypeAny, "passthrough">>]>;
283
+ }, z.ZodTypeAny, "passthrough">>]>, "many">]>>>;
284
+ name: z.ZodOptional<z.ZodString>;
285
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
286
+ id: z.ZodString;
287
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
288
+ function: z.ZodObject<{
289
+ name: z.ZodString;
290
+ arguments: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
291
+ }, "strip", z.ZodTypeAny, {
292
+ name: string;
293
+ arguments?: string | Record<string, unknown> | undefined;
294
+ }, {
295
+ name: string;
296
+ arguments?: string | Record<string, unknown> | undefined;
297
+ }>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ function: {
300
+ name: string;
301
+ arguments?: string | Record<string, unknown> | undefined;
302
+ };
303
+ type: "function";
304
+ id: string;
305
+ }, {
306
+ function: {
307
+ name: string;
308
+ arguments?: string | Record<string, unknown> | undefined;
309
+ };
310
+ id: string;
311
+ type?: "function" | undefined;
312
+ }>, "many">>;
313
+ function_call: z.ZodOptional<z.ZodNullable<z.ZodObject<{
314
+ name: z.ZodString;
315
+ arguments: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ name: string;
318
+ arguments?: string | Record<string, unknown> | undefined;
319
+ }, {
320
+ name: string;
321
+ arguments?: string | Record<string, unknown> | undefined;
322
+ }>>>;
323
+ tool_call_id: z.ZodOptional<z.ZodString>;
324
+ }, "strip", z.ZodTypeAny, {
325
+ role: string;
326
+ name?: string | undefined;
327
+ content?: string | (z.objectOutputType<{
328
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
329
+ text: z.ZodString;
330
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
331
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
332
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
333
+ url: z.ZodString;
334
+ detail: z.ZodOptional<z.ZodString>;
335
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
336
+ url: z.ZodString;
337
+ detail: z.ZodOptional<z.ZodString>;
338
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
339
+ url: z.ZodString;
340
+ detail: z.ZodOptional<z.ZodString>;
341
+ }, z.ZodTypeAny, "passthrough">>]>;
342
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
343
+ tool_calls?: {
344
+ function: {
345
+ name: string;
346
+ arguments?: string | Record<string, unknown> | undefined;
347
+ };
348
+ type: "function";
349
+ id: string;
350
+ }[] | undefined;
351
+ function_call?: {
352
+ name: string;
353
+ arguments?: string | Record<string, unknown> | undefined;
354
+ } | null | undefined;
355
+ tool_call_id?: string | undefined;
356
+ }, {
357
+ role: string;
358
+ name?: string | undefined;
359
+ content?: string | (z.objectInputType<{
360
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
361
+ text: z.ZodString;
362
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
363
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
364
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
365
+ url: z.ZodString;
366
+ detail: z.ZodOptional<z.ZodString>;
367
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
368
+ url: z.ZodString;
369
+ detail: z.ZodOptional<z.ZodString>;
370
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
371
+ url: z.ZodString;
372
+ detail: z.ZodOptional<z.ZodString>;
373
+ }, z.ZodTypeAny, "passthrough">>]>;
374
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
375
+ tool_calls?: {
376
+ function: {
377
+ name: string;
378
+ arguments?: string | Record<string, unknown> | undefined;
379
+ };
380
+ id: string;
381
+ type?: "function" | undefined;
382
+ }[] | undefined;
383
+ function_call?: {
384
+ name: string;
385
+ arguments?: string | Record<string, unknown> | undefined;
386
+ } | null | undefined;
387
+ tool_call_id?: string | undefined;
388
+ }>, "many">;
389
+ temperature: z.ZodOptional<z.ZodNumber>;
390
+ top_p: z.ZodOptional<z.ZodNumber>;
391
+ n: z.ZodOptional<z.ZodNumber>;
392
+ stream: z.ZodOptional<z.ZodBoolean>;
393
+ stop: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
394
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
395
+ max_tokens: z.ZodOptional<z.ZodNumber>;
396
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
397
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
398
+ logit_bias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
399
+ user: z.ZodOptional<z.ZodString>;
400
+ functions: z.ZodOptional<z.ZodArray<z.ZodObject<{
401
+ name: z.ZodString;
402
+ description: z.ZodOptional<z.ZodString>;
403
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
404
+ strict: z.ZodOptional<z.ZodBoolean>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ name: string;
407
+ description?: string | undefined;
408
+ parameters?: Record<string, unknown> | undefined;
409
+ strict?: boolean | undefined;
410
+ }, {
411
+ name: string;
412
+ description?: string | undefined;
413
+ parameters?: Record<string, unknown> | undefined;
414
+ strict?: boolean | undefined;
415
+ }>, "many">>;
416
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
417
+ name: z.ZodString;
418
+ }, "strip", z.ZodTypeAny, {
419
+ name: string;
420
+ }, {
421
+ name: string;
422
+ }>]>>;
423
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
424
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
425
+ function: z.ZodObject<{
426
+ name: z.ZodString;
427
+ description: z.ZodOptional<z.ZodString>;
428
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
429
+ strict: z.ZodOptional<z.ZodBoolean>;
430
+ }, "strip", z.ZodTypeAny, {
431
+ name: string;
432
+ description?: string | undefined;
433
+ parameters?: Record<string, unknown> | undefined;
434
+ strict?: boolean | undefined;
435
+ }, {
436
+ name: string;
437
+ description?: string | undefined;
438
+ parameters?: Record<string, unknown> | undefined;
439
+ strict?: boolean | undefined;
440
+ }>;
441
+ }, "strip", z.ZodTypeAny, {
442
+ function: {
443
+ name: string;
444
+ description?: string | undefined;
445
+ parameters?: Record<string, unknown> | undefined;
446
+ strict?: boolean | undefined;
447
+ };
448
+ type: "function";
449
+ }, {
450
+ function: {
451
+ name: string;
452
+ description?: string | undefined;
453
+ parameters?: Record<string, unknown> | undefined;
454
+ strict?: boolean | undefined;
455
+ };
456
+ type?: "function" | undefined;
457
+ }>, "many">>;
458
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
459
+ type: z.ZodString;
460
+ function: z.ZodObject<{
461
+ name: z.ZodString;
462
+ }, "strip", z.ZodTypeAny, {
463
+ name: string;
464
+ }, {
465
+ name: string;
466
+ }>;
467
+ }, "strip", z.ZodTypeAny, {
468
+ function: {
469
+ name: string;
470
+ };
471
+ type: string;
472
+ }, {
473
+ function: {
474
+ name: string;
475
+ };
476
+ type: string;
477
+ }>]>>;
478
+ }, "strip", z.ZodTypeAny, {
479
+ model: string;
480
+ messages: {
481
+ role: string;
482
+ name?: string | undefined;
483
+ content?: string | (z.objectOutputType<{
484
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
485
+ text: z.ZodString;
486
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
487
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
488
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
489
+ url: z.ZodString;
490
+ detail: z.ZodOptional<z.ZodString>;
491
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
492
+ url: z.ZodString;
493
+ detail: z.ZodOptional<z.ZodString>;
494
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
495
+ url: z.ZodString;
496
+ detail: z.ZodOptional<z.ZodString>;
497
+ }, z.ZodTypeAny, "passthrough">>]>;
498
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
499
+ tool_calls?: {
500
+ function: {
501
+ name: string;
502
+ arguments?: string | Record<string, unknown> | undefined;
503
+ };
504
+ type: "function";
505
+ id: string;
506
+ }[] | undefined;
507
+ function_call?: {
508
+ name: string;
509
+ arguments?: string | Record<string, unknown> | undefined;
510
+ } | null | undefined;
511
+ tool_call_id?: string | undefined;
512
+ }[];
513
+ function_call?: string | {
514
+ name: string;
515
+ } | undefined;
516
+ temperature?: number | undefined;
517
+ top_p?: number | undefined;
518
+ n?: number | undefined;
519
+ stream?: boolean | undefined;
520
+ stop?: string | string[] | undefined;
521
+ max_completion_tokens?: number | undefined;
522
+ max_tokens?: number | undefined;
523
+ presence_penalty?: number | undefined;
524
+ frequency_penalty?: number | undefined;
525
+ logit_bias?: Record<string, number> | undefined;
526
+ user?: string | undefined;
527
+ functions?: {
528
+ name: string;
529
+ description?: string | undefined;
530
+ parameters?: Record<string, unknown> | undefined;
531
+ strict?: boolean | undefined;
532
+ }[] | undefined;
533
+ tools?: {
534
+ function: {
535
+ name: string;
536
+ description?: string | undefined;
537
+ parameters?: Record<string, unknown> | undefined;
538
+ strict?: boolean | undefined;
539
+ };
540
+ type: "function";
541
+ }[] | undefined;
542
+ tool_choice?: string | {
543
+ function: {
544
+ name: string;
545
+ };
546
+ type: string;
547
+ } | undefined;
548
+ }, {
549
+ model: string;
550
+ messages: {
551
+ role: string;
552
+ name?: string | undefined;
553
+ content?: string | (z.objectInputType<{
554
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
555
+ text: z.ZodString;
556
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
557
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
558
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
559
+ url: z.ZodString;
560
+ detail: z.ZodOptional<z.ZodString>;
561
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
562
+ url: z.ZodString;
563
+ detail: z.ZodOptional<z.ZodString>;
564
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
565
+ url: z.ZodString;
566
+ detail: z.ZodOptional<z.ZodString>;
567
+ }, z.ZodTypeAny, "passthrough">>]>;
568
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
569
+ tool_calls?: {
570
+ function: {
571
+ name: string;
572
+ arguments?: string | Record<string, unknown> | undefined;
573
+ };
574
+ id: string;
575
+ type?: "function" | undefined;
576
+ }[] | undefined;
577
+ function_call?: {
578
+ name: string;
579
+ arguments?: string | Record<string, unknown> | undefined;
580
+ } | null | undefined;
581
+ tool_call_id?: string | undefined;
582
+ }[];
583
+ function_call?: string | {
584
+ name: string;
585
+ } | undefined;
586
+ temperature?: number | undefined;
587
+ top_p?: number | undefined;
588
+ n?: number | undefined;
589
+ stream?: boolean | undefined;
590
+ stop?: string | string[] | undefined;
591
+ max_completion_tokens?: number | undefined;
592
+ max_tokens?: number | undefined;
593
+ presence_penalty?: number | undefined;
594
+ frequency_penalty?: number | undefined;
595
+ logit_bias?: Record<string, number> | undefined;
596
+ user?: string | undefined;
597
+ functions?: {
598
+ name: string;
599
+ description?: string | undefined;
600
+ parameters?: Record<string, unknown> | undefined;
601
+ strict?: boolean | undefined;
602
+ }[] | undefined;
603
+ tools?: {
604
+ function: {
605
+ name: string;
606
+ description?: string | undefined;
607
+ parameters?: Record<string, unknown> | undefined;
608
+ strict?: boolean | undefined;
609
+ };
610
+ type?: "function" | undefined;
611
+ }[] | undefined;
612
+ tool_choice?: string | {
613
+ function: {
614
+ name: string;
615
+ };
616
+ type: string;
617
+ } | undefined;
618
+ }>;
619
+ export type OpenAIChatCompletionRequest = z.infer<typeof OpenAIChatCompletionRequestSchema>;
620
+ export declare const OpenAIChatCompletionResponseSchema: z.ZodObject<{
621
+ id: z.ZodString;
622
+ object: z.ZodLiteral<"chat.completion">;
623
+ created: z.ZodNumber;
624
+ model: z.ZodString;
625
+ system_fingerprint: z.ZodOptional<z.ZodString>;
626
+ choices: z.ZodArray<z.ZodObject<{
627
+ index: z.ZodNumber;
628
+ message: z.ZodObject<{
629
+ role: z.ZodString;
630
+ content: z.ZodNullable<z.ZodString>;
631
+ reasoning_content: z.ZodOptional<z.ZodString>;
632
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
633
+ id: z.ZodString;
634
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
635
+ function: z.ZodObject<{
636
+ name: z.ZodString;
637
+ arguments: z.ZodString;
638
+ }, "strip", z.ZodTypeAny, {
639
+ name: string;
640
+ arguments: string;
641
+ }, {
642
+ name: string;
643
+ arguments: string;
644
+ }>;
645
+ }, "strip", z.ZodTypeAny, {
646
+ function: {
647
+ name: string;
648
+ arguments: string;
649
+ };
650
+ type: "function";
651
+ id: string;
652
+ }, {
653
+ function: {
654
+ name: string;
655
+ arguments: string;
656
+ };
657
+ id: string;
658
+ type?: "function" | undefined;
659
+ }>, "many">>;
660
+ }, "strip", z.ZodTypeAny, {
661
+ role: string;
662
+ content: string | null;
663
+ tool_calls?: {
664
+ function: {
665
+ name: string;
666
+ arguments: string;
667
+ };
668
+ type: "function";
669
+ id: string;
670
+ }[] | undefined;
671
+ reasoning_content?: string | undefined;
672
+ }, {
673
+ role: string;
674
+ content: string | null;
675
+ tool_calls?: {
676
+ function: {
677
+ name: string;
678
+ arguments: string;
679
+ };
680
+ id: string;
681
+ type?: "function" | undefined;
682
+ }[] | undefined;
683
+ reasoning_content?: string | undefined;
684
+ }>;
685
+ finish_reason: z.ZodNullable<z.ZodString>;
686
+ }, "strip", z.ZodTypeAny, {
687
+ message: {
688
+ role: string;
689
+ content: string | null;
690
+ tool_calls?: {
691
+ function: {
692
+ name: string;
693
+ arguments: string;
694
+ };
695
+ type: "function";
696
+ id: string;
697
+ }[] | undefined;
698
+ reasoning_content?: string | undefined;
699
+ };
700
+ index: number;
701
+ finish_reason: string | null;
702
+ }, {
703
+ message: {
704
+ role: string;
705
+ content: string | null;
706
+ tool_calls?: {
707
+ function: {
708
+ name: string;
709
+ arguments: string;
710
+ };
711
+ id: string;
712
+ type?: "function" | undefined;
713
+ }[] | undefined;
714
+ reasoning_content?: string | undefined;
715
+ };
716
+ index: number;
717
+ finish_reason: string | null;
718
+ }>, "many">;
719
+ usage: z.ZodOptional<z.ZodObject<{
720
+ prompt_tokens: z.ZodNumber;
721
+ completion_tokens: z.ZodNumber;
722
+ total_tokens: z.ZodNumber;
723
+ }, "strip", z.ZodTypeAny, {
724
+ prompt_tokens: number;
725
+ completion_tokens: number;
726
+ total_tokens: number;
727
+ }, {
728
+ prompt_tokens: number;
729
+ completion_tokens: number;
730
+ total_tokens: number;
731
+ }>>;
732
+ }, "strip", z.ZodTypeAny, {
733
+ object: "chat.completion";
734
+ id: string;
735
+ model: string;
736
+ created: number;
737
+ choices: {
738
+ message: {
739
+ role: string;
740
+ content: string | null;
741
+ tool_calls?: {
742
+ function: {
743
+ name: string;
744
+ arguments: string;
745
+ };
746
+ type: "function";
747
+ id: string;
748
+ }[] | undefined;
749
+ reasoning_content?: string | undefined;
750
+ };
751
+ index: number;
752
+ finish_reason: string | null;
753
+ }[];
754
+ system_fingerprint?: string | undefined;
755
+ usage?: {
756
+ prompt_tokens: number;
757
+ completion_tokens: number;
758
+ total_tokens: number;
759
+ } | undefined;
760
+ }, {
761
+ object: "chat.completion";
762
+ id: string;
763
+ model: string;
764
+ created: number;
765
+ choices: {
766
+ message: {
767
+ role: string;
768
+ content: string | null;
769
+ tool_calls?: {
770
+ function: {
771
+ name: string;
772
+ arguments: string;
773
+ };
774
+ id: string;
775
+ type?: "function" | undefined;
776
+ }[] | undefined;
777
+ reasoning_content?: string | undefined;
778
+ };
779
+ index: number;
780
+ finish_reason: string | null;
781
+ }[];
782
+ system_fingerprint?: string | undefined;
783
+ usage?: {
784
+ prompt_tokens: number;
785
+ completion_tokens: number;
786
+ total_tokens: number;
787
+ } | undefined;
788
+ }>;
789
+ export type OpenAIChatCompletionResponse = z.infer<typeof OpenAIChatCompletionResponseSchema>;
790
+ export declare const AnthropicContentBlockSchema: z.ZodUnion<[z.ZodObject<{
791
+ type: z.ZodLiteral<"text">;
792
+ text: z.ZodString;
793
+ }, "strip", z.ZodTypeAny, {
794
+ type: "text";
795
+ text: string;
796
+ }, {
797
+ type: "text";
798
+ text: string;
799
+ }>, z.ZodObject<{
800
+ type: z.ZodLiteral<"image">;
801
+ source: z.ZodObject<{
802
+ type: z.ZodLiteral<"base64">;
803
+ media_type: z.ZodString;
804
+ data: z.ZodString;
805
+ }, "strip", z.ZodTypeAny, {
806
+ type: "base64";
807
+ data: string;
808
+ media_type: string;
809
+ }, {
810
+ type: "base64";
811
+ data: string;
812
+ media_type: string;
813
+ }>;
814
+ }, "strip", z.ZodTypeAny, {
815
+ type: "image";
816
+ source: {
817
+ type: "base64";
818
+ data: string;
819
+ media_type: string;
820
+ };
821
+ }, {
822
+ type: "image";
823
+ source: {
824
+ type: "base64";
825
+ data: string;
826
+ media_type: string;
827
+ };
828
+ }>, z.ZodObject<{
829
+ type: z.ZodLiteral<"tool_use">;
830
+ id: z.ZodString;
831
+ name: z.ZodString;
832
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
833
+ }, "strip", z.ZodTypeAny, {
834
+ name: string;
835
+ type: "tool_use";
836
+ id: string;
837
+ input: Record<string, unknown>;
838
+ }, {
839
+ name: string;
840
+ type: "tool_use";
841
+ id: string;
842
+ input: Record<string, unknown>;
843
+ }>, z.ZodObject<{
844
+ type: z.ZodLiteral<"tool_result">;
845
+ tool_use_id: z.ZodString;
846
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodAny, "many">]>>;
847
+ is_error: z.ZodOptional<z.ZodBoolean>;
848
+ }, "strip", z.ZodTypeAny, {
849
+ type: "tool_result";
850
+ tool_use_id: string;
851
+ content?: string | any[] | undefined;
852
+ is_error?: boolean | undefined;
853
+ }, {
854
+ type: "tool_result";
855
+ tool_use_id: string;
856
+ content?: string | any[] | undefined;
857
+ is_error?: boolean | undefined;
858
+ }>, z.ZodObject<{
859
+ type: z.ZodLiteral<"thinking">;
860
+ thinking: z.ZodString;
861
+ signature: z.ZodOptional<z.ZodString>;
862
+ }, "strip", z.ZodTypeAny, {
863
+ type: "thinking";
864
+ thinking: string;
865
+ signature?: string | undefined;
866
+ }, {
867
+ type: "thinking";
868
+ thinking: string;
869
+ signature?: string | undefined;
870
+ }>]>;
871
+ export declare const AnthropicMessageSchema: z.ZodObject<{
872
+ role: z.ZodString;
873
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
874
+ type: z.ZodOptional<z.ZodString>;
875
+ text: z.ZodOptional<z.ZodString>;
876
+ thinking: z.ZodOptional<z.ZodString>;
877
+ signature: z.ZodOptional<z.ZodString>;
878
+ source: z.ZodOptional<z.ZodUnknown>;
879
+ id: z.ZodOptional<z.ZodString>;
880
+ name: z.ZodOptional<z.ZodString>;
881
+ input: z.ZodOptional<z.ZodUnknown>;
882
+ tool_use_id: z.ZodOptional<z.ZodString>;
883
+ content: z.ZodOptional<z.ZodUnknown>;
884
+ is_error: z.ZodOptional<z.ZodBoolean>;
885
+ data: z.ZodOptional<z.ZodUnknown>;
886
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
887
+ type: z.ZodOptional<z.ZodString>;
888
+ text: z.ZodOptional<z.ZodString>;
889
+ thinking: z.ZodOptional<z.ZodString>;
890
+ signature: z.ZodOptional<z.ZodString>;
891
+ source: z.ZodOptional<z.ZodUnknown>;
892
+ id: z.ZodOptional<z.ZodString>;
893
+ name: z.ZodOptional<z.ZodString>;
894
+ input: z.ZodOptional<z.ZodUnknown>;
895
+ tool_use_id: z.ZodOptional<z.ZodString>;
896
+ content: z.ZodOptional<z.ZodUnknown>;
897
+ is_error: z.ZodOptional<z.ZodBoolean>;
898
+ data: z.ZodOptional<z.ZodUnknown>;
899
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
900
+ type: z.ZodOptional<z.ZodString>;
901
+ text: z.ZodOptional<z.ZodString>;
902
+ thinking: z.ZodOptional<z.ZodString>;
903
+ signature: z.ZodOptional<z.ZodString>;
904
+ source: z.ZodOptional<z.ZodUnknown>;
905
+ id: z.ZodOptional<z.ZodString>;
906
+ name: z.ZodOptional<z.ZodString>;
907
+ input: z.ZodOptional<z.ZodUnknown>;
908
+ tool_use_id: z.ZodOptional<z.ZodString>;
909
+ content: z.ZodOptional<z.ZodUnknown>;
910
+ is_error: z.ZodOptional<z.ZodBoolean>;
911
+ data: z.ZodOptional<z.ZodUnknown>;
912
+ }, z.ZodTypeAny, "passthrough">>, "many">]>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ role: string;
915
+ content: string | z.objectOutputType<{
916
+ type: z.ZodOptional<z.ZodString>;
917
+ text: z.ZodOptional<z.ZodString>;
918
+ thinking: z.ZodOptional<z.ZodString>;
919
+ signature: z.ZodOptional<z.ZodString>;
920
+ source: z.ZodOptional<z.ZodUnknown>;
921
+ id: z.ZodOptional<z.ZodString>;
922
+ name: z.ZodOptional<z.ZodString>;
923
+ input: z.ZodOptional<z.ZodUnknown>;
924
+ tool_use_id: z.ZodOptional<z.ZodString>;
925
+ content: z.ZodOptional<z.ZodUnknown>;
926
+ is_error: z.ZodOptional<z.ZodBoolean>;
927
+ data: z.ZodOptional<z.ZodUnknown>;
928
+ }, z.ZodTypeAny, "passthrough">[];
929
+ }, {
930
+ role: string;
931
+ content: string | z.objectInputType<{
932
+ type: z.ZodOptional<z.ZodString>;
933
+ text: z.ZodOptional<z.ZodString>;
934
+ thinking: z.ZodOptional<z.ZodString>;
935
+ signature: z.ZodOptional<z.ZodString>;
936
+ source: z.ZodOptional<z.ZodUnknown>;
937
+ id: z.ZodOptional<z.ZodString>;
938
+ name: z.ZodOptional<z.ZodString>;
939
+ input: z.ZodOptional<z.ZodUnknown>;
940
+ tool_use_id: z.ZodOptional<z.ZodString>;
941
+ content: z.ZodOptional<z.ZodUnknown>;
942
+ is_error: z.ZodOptional<z.ZodBoolean>;
943
+ data: z.ZodOptional<z.ZodUnknown>;
944
+ }, z.ZodTypeAny, "passthrough">[];
945
+ }>;
946
+ export declare const AnthropicMessagesRequestSchema: z.ZodObject<{
947
+ model: z.ZodString;
948
+ messages: z.ZodArray<z.ZodObject<{
949
+ role: z.ZodString;
950
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
951
+ type: z.ZodOptional<z.ZodString>;
952
+ text: z.ZodOptional<z.ZodString>;
953
+ thinking: z.ZodOptional<z.ZodString>;
954
+ signature: z.ZodOptional<z.ZodString>;
955
+ source: z.ZodOptional<z.ZodUnknown>;
956
+ id: z.ZodOptional<z.ZodString>;
957
+ name: z.ZodOptional<z.ZodString>;
958
+ input: z.ZodOptional<z.ZodUnknown>;
959
+ tool_use_id: z.ZodOptional<z.ZodString>;
960
+ content: z.ZodOptional<z.ZodUnknown>;
961
+ is_error: z.ZodOptional<z.ZodBoolean>;
962
+ data: z.ZodOptional<z.ZodUnknown>;
963
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
964
+ type: z.ZodOptional<z.ZodString>;
965
+ text: z.ZodOptional<z.ZodString>;
966
+ thinking: z.ZodOptional<z.ZodString>;
967
+ signature: z.ZodOptional<z.ZodString>;
968
+ source: z.ZodOptional<z.ZodUnknown>;
969
+ id: z.ZodOptional<z.ZodString>;
970
+ name: z.ZodOptional<z.ZodString>;
971
+ input: z.ZodOptional<z.ZodUnknown>;
972
+ tool_use_id: z.ZodOptional<z.ZodString>;
973
+ content: z.ZodOptional<z.ZodUnknown>;
974
+ is_error: z.ZodOptional<z.ZodBoolean>;
975
+ data: z.ZodOptional<z.ZodUnknown>;
976
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
977
+ type: z.ZodOptional<z.ZodString>;
978
+ text: z.ZodOptional<z.ZodString>;
979
+ thinking: z.ZodOptional<z.ZodString>;
980
+ signature: z.ZodOptional<z.ZodString>;
981
+ source: z.ZodOptional<z.ZodUnknown>;
982
+ id: z.ZodOptional<z.ZodString>;
983
+ name: z.ZodOptional<z.ZodString>;
984
+ input: z.ZodOptional<z.ZodUnknown>;
985
+ tool_use_id: z.ZodOptional<z.ZodString>;
986
+ content: z.ZodOptional<z.ZodUnknown>;
987
+ is_error: z.ZodOptional<z.ZodBoolean>;
988
+ data: z.ZodOptional<z.ZodUnknown>;
989
+ }, z.ZodTypeAny, "passthrough">>, "many">]>;
990
+ }, "strip", z.ZodTypeAny, {
991
+ role: string;
992
+ content: string | z.objectOutputType<{
993
+ type: z.ZodOptional<z.ZodString>;
994
+ text: z.ZodOptional<z.ZodString>;
995
+ thinking: z.ZodOptional<z.ZodString>;
996
+ signature: z.ZodOptional<z.ZodString>;
997
+ source: z.ZodOptional<z.ZodUnknown>;
998
+ id: z.ZodOptional<z.ZodString>;
999
+ name: z.ZodOptional<z.ZodString>;
1000
+ input: z.ZodOptional<z.ZodUnknown>;
1001
+ tool_use_id: z.ZodOptional<z.ZodString>;
1002
+ content: z.ZodOptional<z.ZodUnknown>;
1003
+ is_error: z.ZodOptional<z.ZodBoolean>;
1004
+ data: z.ZodOptional<z.ZodUnknown>;
1005
+ }, z.ZodTypeAny, "passthrough">[];
1006
+ }, {
1007
+ role: string;
1008
+ content: string | z.objectInputType<{
1009
+ type: z.ZodOptional<z.ZodString>;
1010
+ text: z.ZodOptional<z.ZodString>;
1011
+ thinking: z.ZodOptional<z.ZodString>;
1012
+ signature: z.ZodOptional<z.ZodString>;
1013
+ source: z.ZodOptional<z.ZodUnknown>;
1014
+ id: z.ZodOptional<z.ZodString>;
1015
+ name: z.ZodOptional<z.ZodString>;
1016
+ input: z.ZodOptional<z.ZodUnknown>;
1017
+ tool_use_id: z.ZodOptional<z.ZodString>;
1018
+ content: z.ZodOptional<z.ZodUnknown>;
1019
+ is_error: z.ZodOptional<z.ZodBoolean>;
1020
+ data: z.ZodOptional<z.ZodUnknown>;
1021
+ }, z.ZodTypeAny, "passthrough">[];
1022
+ }>, "many">;
1023
+ system: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
1024
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1025
+ text: z.ZodString;
1026
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1027
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1028
+ text: z.ZodString;
1029
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1030
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1031
+ text: z.ZodString;
1032
+ }, z.ZodTypeAny, "passthrough">>, "many">]>>;
1033
+ max_tokens: z.ZodOptional<z.ZodNumber>;
1034
+ metadata: z.ZodOptional<z.ZodObject<{
1035
+ user_id: z.ZodOptional<z.ZodString>;
1036
+ }, "strip", z.ZodTypeAny, {
1037
+ user_id?: string | undefined;
1038
+ }, {
1039
+ user_id?: string | undefined;
1040
+ }>>;
1041
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1042
+ stream: z.ZodOptional<z.ZodBoolean>;
1043
+ temperature: z.ZodOptional<z.ZodNumber>;
1044
+ top_p: z.ZodOptional<z.ZodNumber>;
1045
+ top_k: z.ZodOptional<z.ZodNumber>;
1046
+ thinking: z.ZodOptional<z.ZodUnknown>;
1047
+ thinking_config: z.ZodOptional<z.ZodUnknown>;
1048
+ tools: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
1049
+ name: z.ZodString;
1050
+ description: z.ZodOptional<z.ZodString>;
1051
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1052
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1053
+ name: z.ZodString;
1054
+ description: z.ZodOptional<z.ZodString>;
1055
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1056
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1057
+ name: z.ZodString;
1058
+ description: z.ZodOptional<z.ZodString>;
1059
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1060
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1061
+ type: z.ZodString;
1062
+ name: z.ZodString;
1063
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1064
+ type: z.ZodString;
1065
+ name: z.ZodString;
1066
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1067
+ type: z.ZodString;
1068
+ name: z.ZodString;
1069
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
1070
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1071
+ type: z.ZodLiteral<"auto">;
1072
+ }, "strip", z.ZodTypeAny, {
1073
+ type: "auto";
1074
+ }, {
1075
+ type: "auto";
1076
+ }>, z.ZodObject<{
1077
+ type: z.ZodLiteral<"any">;
1078
+ }, "strip", z.ZodTypeAny, {
1079
+ type: "any";
1080
+ }, {
1081
+ type: "any";
1082
+ }>, z.ZodObject<{
1083
+ type: z.ZodLiteral<"tool">;
1084
+ name: z.ZodString;
1085
+ }, "strip", z.ZodTypeAny, {
1086
+ name: string;
1087
+ type: "tool";
1088
+ }, {
1089
+ name: string;
1090
+ type: "tool";
1091
+ }>, z.ZodObject<{
1092
+ type: z.ZodLiteral<"none">;
1093
+ }, "strip", z.ZodTypeAny, {
1094
+ type: "none";
1095
+ }, {
1096
+ type: "none";
1097
+ }>]>>;
1098
+ }, "strip", z.ZodTypeAny, {
1099
+ model: string;
1100
+ messages: {
1101
+ role: string;
1102
+ content: string | z.objectOutputType<{
1103
+ type: z.ZodOptional<z.ZodString>;
1104
+ text: z.ZodOptional<z.ZodString>;
1105
+ thinking: z.ZodOptional<z.ZodString>;
1106
+ signature: z.ZodOptional<z.ZodString>;
1107
+ source: z.ZodOptional<z.ZodUnknown>;
1108
+ id: z.ZodOptional<z.ZodString>;
1109
+ name: z.ZodOptional<z.ZodString>;
1110
+ input: z.ZodOptional<z.ZodUnknown>;
1111
+ tool_use_id: z.ZodOptional<z.ZodString>;
1112
+ content: z.ZodOptional<z.ZodUnknown>;
1113
+ is_error: z.ZodOptional<z.ZodBoolean>;
1114
+ data: z.ZodOptional<z.ZodUnknown>;
1115
+ }, z.ZodTypeAny, "passthrough">[];
1116
+ }[];
1117
+ temperature?: number | undefined;
1118
+ top_p?: number | undefined;
1119
+ stream?: boolean | undefined;
1120
+ max_tokens?: number | undefined;
1121
+ tools?: (z.objectOutputType<{
1122
+ name: z.ZodString;
1123
+ description: z.ZodOptional<z.ZodString>;
1124
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1125
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
1126
+ type: z.ZodString;
1127
+ name: z.ZodString;
1128
+ }, z.ZodTypeAny, "passthrough">)[] | undefined;
1129
+ tool_choice?: {
1130
+ type: "auto";
1131
+ } | {
1132
+ type: "any";
1133
+ } | {
1134
+ name: string;
1135
+ type: "tool";
1136
+ } | {
1137
+ type: "none";
1138
+ } | undefined;
1139
+ thinking?: unknown;
1140
+ system?: string | z.objectOutputType<{
1141
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1142
+ text: z.ZodString;
1143
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
1144
+ metadata?: {
1145
+ user_id?: string | undefined;
1146
+ } | undefined;
1147
+ stop_sequences?: string[] | undefined;
1148
+ top_k?: number | undefined;
1149
+ thinking_config?: unknown;
1150
+ }, {
1151
+ model: string;
1152
+ messages: {
1153
+ role: string;
1154
+ content: string | z.objectInputType<{
1155
+ type: z.ZodOptional<z.ZodString>;
1156
+ text: z.ZodOptional<z.ZodString>;
1157
+ thinking: z.ZodOptional<z.ZodString>;
1158
+ signature: z.ZodOptional<z.ZodString>;
1159
+ source: z.ZodOptional<z.ZodUnknown>;
1160
+ id: z.ZodOptional<z.ZodString>;
1161
+ name: z.ZodOptional<z.ZodString>;
1162
+ input: z.ZodOptional<z.ZodUnknown>;
1163
+ tool_use_id: z.ZodOptional<z.ZodString>;
1164
+ content: z.ZodOptional<z.ZodUnknown>;
1165
+ is_error: z.ZodOptional<z.ZodBoolean>;
1166
+ data: z.ZodOptional<z.ZodUnknown>;
1167
+ }, z.ZodTypeAny, "passthrough">[];
1168
+ }[];
1169
+ temperature?: number | undefined;
1170
+ top_p?: number | undefined;
1171
+ stream?: boolean | undefined;
1172
+ max_tokens?: number | undefined;
1173
+ tools?: (z.objectInputType<{
1174
+ name: z.ZodString;
1175
+ description: z.ZodOptional<z.ZodString>;
1176
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1177
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
1178
+ type: z.ZodString;
1179
+ name: z.ZodString;
1180
+ }, z.ZodTypeAny, "passthrough">)[] | undefined;
1181
+ tool_choice?: {
1182
+ type: "auto";
1183
+ } | {
1184
+ type: "any";
1185
+ } | {
1186
+ name: string;
1187
+ type: "tool";
1188
+ } | {
1189
+ type: "none";
1190
+ } | undefined;
1191
+ thinking?: unknown;
1192
+ system?: string | z.objectInputType<{
1193
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1194
+ text: z.ZodString;
1195
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
1196
+ metadata?: {
1197
+ user_id?: string | undefined;
1198
+ } | undefined;
1199
+ stop_sequences?: string[] | undefined;
1200
+ top_k?: number | undefined;
1201
+ thinking_config?: unknown;
1202
+ }>;
1203
+ export type AnthropicMessagesRequest = z.infer<typeof AnthropicMessagesRequestSchema>;
1204
+ export declare const AnthropicMessagesResponseSchema: z.ZodObject<{
1205
+ id: z.ZodString;
1206
+ type: z.ZodLiteral<"message">;
1207
+ role: z.ZodLiteral<"assistant">;
1208
+ content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1209
+ type: z.ZodLiteral<"text">;
1210
+ text: z.ZodString;
1211
+ }, "strip", z.ZodTypeAny, {
1212
+ type: "text";
1213
+ text: string;
1214
+ }, {
1215
+ type: "text";
1216
+ text: string;
1217
+ }>, z.ZodObject<{
1218
+ type: z.ZodLiteral<"image">;
1219
+ source: z.ZodObject<{
1220
+ type: z.ZodLiteral<"base64">;
1221
+ media_type: z.ZodString;
1222
+ data: z.ZodString;
1223
+ }, "strip", z.ZodTypeAny, {
1224
+ type: "base64";
1225
+ data: string;
1226
+ media_type: string;
1227
+ }, {
1228
+ type: "base64";
1229
+ data: string;
1230
+ media_type: string;
1231
+ }>;
1232
+ }, "strip", z.ZodTypeAny, {
1233
+ type: "image";
1234
+ source: {
1235
+ type: "base64";
1236
+ data: string;
1237
+ media_type: string;
1238
+ };
1239
+ }, {
1240
+ type: "image";
1241
+ source: {
1242
+ type: "base64";
1243
+ data: string;
1244
+ media_type: string;
1245
+ };
1246
+ }>, z.ZodObject<{
1247
+ type: z.ZodLiteral<"tool_use">;
1248
+ id: z.ZodString;
1249
+ name: z.ZodString;
1250
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1251
+ }, "strip", z.ZodTypeAny, {
1252
+ name: string;
1253
+ type: "tool_use";
1254
+ id: string;
1255
+ input: Record<string, unknown>;
1256
+ }, {
1257
+ name: string;
1258
+ type: "tool_use";
1259
+ id: string;
1260
+ input: Record<string, unknown>;
1261
+ }>, z.ZodObject<{
1262
+ type: z.ZodLiteral<"tool_result">;
1263
+ tool_use_id: z.ZodString;
1264
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodAny, "many">]>>;
1265
+ is_error: z.ZodOptional<z.ZodBoolean>;
1266
+ }, "strip", z.ZodTypeAny, {
1267
+ type: "tool_result";
1268
+ tool_use_id: string;
1269
+ content?: string | any[] | undefined;
1270
+ is_error?: boolean | undefined;
1271
+ }, {
1272
+ type: "tool_result";
1273
+ tool_use_id: string;
1274
+ content?: string | any[] | undefined;
1275
+ is_error?: boolean | undefined;
1276
+ }>, z.ZodObject<{
1277
+ type: z.ZodLiteral<"thinking">;
1278
+ thinking: z.ZodString;
1279
+ signature: z.ZodOptional<z.ZodString>;
1280
+ }, "strip", z.ZodTypeAny, {
1281
+ type: "thinking";
1282
+ thinking: string;
1283
+ signature?: string | undefined;
1284
+ }, {
1285
+ type: "thinking";
1286
+ thinking: string;
1287
+ signature?: string | undefined;
1288
+ }>]>, "many">;
1289
+ model: z.ZodString;
1290
+ stop_reason: z.ZodNullable<z.ZodString>;
1291
+ stop_sequence: z.ZodNullable<z.ZodString>;
1292
+ usage: z.ZodObject<{
1293
+ input_tokens: z.ZodNumber;
1294
+ output_tokens: z.ZodNumber;
1295
+ }, "strip", z.ZodTypeAny, {
1296
+ input_tokens: number;
1297
+ output_tokens: number;
1298
+ }, {
1299
+ input_tokens: number;
1300
+ output_tokens: number;
1301
+ }>;
1302
+ }, "strip", z.ZodTypeAny, {
1303
+ type: "message";
1304
+ id: string;
1305
+ role: "assistant";
1306
+ content: ({
1307
+ type: "text";
1308
+ text: string;
1309
+ } | {
1310
+ type: "image";
1311
+ source: {
1312
+ type: "base64";
1313
+ data: string;
1314
+ media_type: string;
1315
+ };
1316
+ } | {
1317
+ name: string;
1318
+ type: "tool_use";
1319
+ id: string;
1320
+ input: Record<string, unknown>;
1321
+ } | {
1322
+ type: "tool_result";
1323
+ tool_use_id: string;
1324
+ content?: string | any[] | undefined;
1325
+ is_error?: boolean | undefined;
1326
+ } | {
1327
+ type: "thinking";
1328
+ thinking: string;
1329
+ signature?: string | undefined;
1330
+ })[];
1331
+ model: string;
1332
+ usage: {
1333
+ input_tokens: number;
1334
+ output_tokens: number;
1335
+ };
1336
+ stop_reason: string | null;
1337
+ stop_sequence: string | null;
1338
+ }, {
1339
+ type: "message";
1340
+ id: string;
1341
+ role: "assistant";
1342
+ content: ({
1343
+ type: "text";
1344
+ text: string;
1345
+ } | {
1346
+ type: "image";
1347
+ source: {
1348
+ type: "base64";
1349
+ data: string;
1350
+ media_type: string;
1351
+ };
1352
+ } | {
1353
+ name: string;
1354
+ type: "tool_use";
1355
+ id: string;
1356
+ input: Record<string, unknown>;
1357
+ } | {
1358
+ type: "tool_result";
1359
+ tool_use_id: string;
1360
+ content?: string | any[] | undefined;
1361
+ is_error?: boolean | undefined;
1362
+ } | {
1363
+ type: "thinking";
1364
+ thinking: string;
1365
+ signature?: string | undefined;
1366
+ })[];
1367
+ model: string;
1368
+ usage: {
1369
+ input_tokens: number;
1370
+ output_tokens: number;
1371
+ };
1372
+ stop_reason: string | null;
1373
+ stop_sequence: string | null;
1374
+ }>;
1375
+ export type AnthropicMessagesResponse = z.infer<typeof AnthropicMessagesResponseSchema>;
1376
+ export declare const OpenAIResponsesRequestSchema: z.ZodObject<{
1377
+ model: z.ZodString;
1378
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
1379
+ role: z.ZodString;
1380
+ content: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1381
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1382
+ text: z.ZodString;
1383
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1384
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1385
+ text: z.ZodString;
1386
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1387
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1388
+ text: z.ZodString;
1389
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1390
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
1391
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
1392
+ url: z.ZodString;
1393
+ detail: z.ZodOptional<z.ZodString>;
1394
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1395
+ url: z.ZodString;
1396
+ detail: z.ZodOptional<z.ZodString>;
1397
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1398
+ url: z.ZodString;
1399
+ detail: z.ZodOptional<z.ZodString>;
1400
+ }, z.ZodTypeAny, "passthrough">>]>;
1401
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1402
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
1403
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
1404
+ url: z.ZodString;
1405
+ detail: z.ZodOptional<z.ZodString>;
1406
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1407
+ url: z.ZodString;
1408
+ detail: z.ZodOptional<z.ZodString>;
1409
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1410
+ url: z.ZodString;
1411
+ detail: z.ZodOptional<z.ZodString>;
1412
+ }, z.ZodTypeAny, "passthrough">>]>;
1413
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1414
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
1415
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
1416
+ url: z.ZodString;
1417
+ detail: z.ZodOptional<z.ZodString>;
1418
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1419
+ url: z.ZodString;
1420
+ detail: z.ZodOptional<z.ZodString>;
1421
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1422
+ url: z.ZodString;
1423
+ detail: z.ZodOptional<z.ZodString>;
1424
+ }, z.ZodTypeAny, "passthrough">>]>;
1425
+ }, z.ZodTypeAny, "passthrough">>]>, "many">]>>>;
1426
+ name: z.ZodOptional<z.ZodString>;
1427
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1428
+ id: z.ZodString;
1429
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
1430
+ function: z.ZodObject<{
1431
+ name: z.ZodString;
1432
+ arguments: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
1433
+ }, "strip", z.ZodTypeAny, {
1434
+ name: string;
1435
+ arguments?: string | Record<string, unknown> | undefined;
1436
+ }, {
1437
+ name: string;
1438
+ arguments?: string | Record<string, unknown> | undefined;
1439
+ }>;
1440
+ }, "strip", z.ZodTypeAny, {
1441
+ function: {
1442
+ name: string;
1443
+ arguments?: string | Record<string, unknown> | undefined;
1444
+ };
1445
+ type: "function";
1446
+ id: string;
1447
+ }, {
1448
+ function: {
1449
+ name: string;
1450
+ arguments?: string | Record<string, unknown> | undefined;
1451
+ };
1452
+ id: string;
1453
+ type?: "function" | undefined;
1454
+ }>, "many">>;
1455
+ function_call: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1456
+ name: z.ZodString;
1457
+ arguments: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
1458
+ }, "strip", z.ZodTypeAny, {
1459
+ name: string;
1460
+ arguments?: string | Record<string, unknown> | undefined;
1461
+ }, {
1462
+ name: string;
1463
+ arguments?: string | Record<string, unknown> | undefined;
1464
+ }>>>;
1465
+ tool_call_id: z.ZodOptional<z.ZodString>;
1466
+ }, "strip", z.ZodTypeAny, {
1467
+ role: string;
1468
+ name?: string | undefined;
1469
+ content?: string | (z.objectOutputType<{
1470
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1471
+ text: z.ZodString;
1472
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
1473
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
1474
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
1475
+ url: z.ZodString;
1476
+ detail: z.ZodOptional<z.ZodString>;
1477
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1478
+ url: z.ZodString;
1479
+ detail: z.ZodOptional<z.ZodString>;
1480
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1481
+ url: z.ZodString;
1482
+ detail: z.ZodOptional<z.ZodString>;
1483
+ }, z.ZodTypeAny, "passthrough">>]>;
1484
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
1485
+ tool_calls?: {
1486
+ function: {
1487
+ name: string;
1488
+ arguments?: string | Record<string, unknown> | undefined;
1489
+ };
1490
+ type: "function";
1491
+ id: string;
1492
+ }[] | undefined;
1493
+ function_call?: {
1494
+ name: string;
1495
+ arguments?: string | Record<string, unknown> | undefined;
1496
+ } | null | undefined;
1497
+ tool_call_id?: string | undefined;
1498
+ }, {
1499
+ role: string;
1500
+ name?: string | undefined;
1501
+ content?: string | (z.objectInputType<{
1502
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1503
+ text: z.ZodString;
1504
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
1505
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
1506
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
1507
+ url: z.ZodString;
1508
+ detail: z.ZodOptional<z.ZodString>;
1509
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1510
+ url: z.ZodString;
1511
+ detail: z.ZodOptional<z.ZodString>;
1512
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1513
+ url: z.ZodString;
1514
+ detail: z.ZodOptional<z.ZodString>;
1515
+ }, z.ZodTypeAny, "passthrough">>]>;
1516
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
1517
+ tool_calls?: {
1518
+ function: {
1519
+ name: string;
1520
+ arguments?: string | Record<string, unknown> | undefined;
1521
+ };
1522
+ id: string;
1523
+ type?: "function" | undefined;
1524
+ }[] | undefined;
1525
+ function_call?: {
1526
+ name: string;
1527
+ arguments?: string | Record<string, unknown> | undefined;
1528
+ } | null | undefined;
1529
+ tool_call_id?: string | undefined;
1530
+ }>, "many">>;
1531
+ input: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodAny, "many">]>>;
1532
+ tools: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
1533
+ type: z.ZodDefault<z.ZodLiteral<"function">>;
1534
+ function: z.ZodObject<{
1535
+ name: z.ZodString;
1536
+ description: z.ZodOptional<z.ZodString>;
1537
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1538
+ strict: z.ZodOptional<z.ZodBoolean>;
1539
+ }, "strip", z.ZodTypeAny, {
1540
+ name: string;
1541
+ description?: string | undefined;
1542
+ parameters?: Record<string, unknown> | undefined;
1543
+ strict?: boolean | undefined;
1544
+ }, {
1545
+ name: string;
1546
+ description?: string | undefined;
1547
+ parameters?: Record<string, unknown> | undefined;
1548
+ strict?: boolean | undefined;
1549
+ }>;
1550
+ }, "strip", z.ZodTypeAny, {
1551
+ function: {
1552
+ name: string;
1553
+ description?: string | undefined;
1554
+ parameters?: Record<string, unknown> | undefined;
1555
+ strict?: boolean | undefined;
1556
+ };
1557
+ type: "function";
1558
+ }, {
1559
+ function: {
1560
+ name: string;
1561
+ description?: string | undefined;
1562
+ parameters?: Record<string, unknown> | undefined;
1563
+ strict?: boolean | undefined;
1564
+ };
1565
+ type?: "function" | undefined;
1566
+ }>, z.ZodObject<{
1567
+ name: z.ZodString;
1568
+ description: z.ZodOptional<z.ZodString>;
1569
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1570
+ strict: z.ZodOptional<z.ZodBoolean>;
1571
+ }, "strip", z.ZodTypeAny, {
1572
+ name: string;
1573
+ description?: string | undefined;
1574
+ parameters?: Record<string, unknown> | undefined;
1575
+ strict?: boolean | undefined;
1576
+ }, {
1577
+ name: string;
1578
+ description?: string | undefined;
1579
+ parameters?: Record<string, unknown> | undefined;
1580
+ strict?: boolean | undefined;
1581
+ }>]>, "many">>;
1582
+ stream: z.ZodOptional<z.ZodBoolean>;
1583
+ temperature: z.ZodOptional<z.ZodNumber>;
1584
+ top_p: z.ZodOptional<z.ZodNumber>;
1585
+ }, "strip", z.ZodTypeAny, {
1586
+ model: string;
1587
+ messages?: {
1588
+ role: string;
1589
+ name?: string | undefined;
1590
+ content?: string | (z.objectOutputType<{
1591
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1592
+ text: z.ZodString;
1593
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
1594
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
1595
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
1596
+ url: z.ZodString;
1597
+ detail: z.ZodOptional<z.ZodString>;
1598
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1599
+ url: z.ZodString;
1600
+ detail: z.ZodOptional<z.ZodString>;
1601
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1602
+ url: z.ZodString;
1603
+ detail: z.ZodOptional<z.ZodString>;
1604
+ }, z.ZodTypeAny, "passthrough">>]>;
1605
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
1606
+ tool_calls?: {
1607
+ function: {
1608
+ name: string;
1609
+ arguments?: string | Record<string, unknown> | undefined;
1610
+ };
1611
+ type: "function";
1612
+ id: string;
1613
+ }[] | undefined;
1614
+ function_call?: {
1615
+ name: string;
1616
+ arguments?: string | Record<string, unknown> | undefined;
1617
+ } | null | undefined;
1618
+ tool_call_id?: string | undefined;
1619
+ }[] | undefined;
1620
+ temperature?: number | undefined;
1621
+ top_p?: number | undefined;
1622
+ stream?: boolean | undefined;
1623
+ tools?: ({
1624
+ name: string;
1625
+ description?: string | undefined;
1626
+ parameters?: Record<string, unknown> | undefined;
1627
+ strict?: boolean | undefined;
1628
+ } | {
1629
+ function: {
1630
+ name: string;
1631
+ description?: string | undefined;
1632
+ parameters?: Record<string, unknown> | undefined;
1633
+ strict?: boolean | undefined;
1634
+ };
1635
+ type: "function";
1636
+ })[] | undefined;
1637
+ input?: string | any[] | undefined;
1638
+ }, {
1639
+ model: string;
1640
+ messages?: {
1641
+ role: string;
1642
+ name?: string | undefined;
1643
+ content?: string | (z.objectInputType<{
1644
+ type: z.ZodOptional<z.ZodLiteral<"text">>;
1645
+ text: z.ZodString;
1646
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
1647
+ type: z.ZodOptional<z.ZodLiteral<"image_url">>;
1648
+ image_url: z.ZodUnion<[z.ZodString, z.ZodObject<{
1649
+ url: z.ZodString;
1650
+ detail: z.ZodOptional<z.ZodString>;
1651
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1652
+ url: z.ZodString;
1653
+ detail: z.ZodOptional<z.ZodString>;
1654
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1655
+ url: z.ZodString;
1656
+ detail: z.ZodOptional<z.ZodString>;
1657
+ }, z.ZodTypeAny, "passthrough">>]>;
1658
+ }, z.ZodTypeAny, "passthrough">)[] | null | undefined;
1659
+ tool_calls?: {
1660
+ function: {
1661
+ name: string;
1662
+ arguments?: string | Record<string, unknown> | undefined;
1663
+ };
1664
+ id: string;
1665
+ type?: "function" | undefined;
1666
+ }[] | undefined;
1667
+ function_call?: {
1668
+ name: string;
1669
+ arguments?: string | Record<string, unknown> | undefined;
1670
+ } | null | undefined;
1671
+ tool_call_id?: string | undefined;
1672
+ }[] | undefined;
1673
+ temperature?: number | undefined;
1674
+ top_p?: number | undefined;
1675
+ stream?: boolean | undefined;
1676
+ tools?: ({
1677
+ name: string;
1678
+ description?: string | undefined;
1679
+ parameters?: Record<string, unknown> | undefined;
1680
+ strict?: boolean | undefined;
1681
+ } | {
1682
+ function: {
1683
+ name: string;
1684
+ description?: string | undefined;
1685
+ parameters?: Record<string, unknown> | undefined;
1686
+ strict?: boolean | undefined;
1687
+ };
1688
+ type?: "function" | undefined;
1689
+ })[] | undefined;
1690
+ input?: string | any[] | undefined;
1691
+ }>;
1692
+ export type OpenAIResponsesRequest = z.infer<typeof OpenAIResponsesRequestSchema>;
1693
+ export declare const OpenAIResponsesResponseSchema: z.ZodObject<{
1694
+ id: z.ZodString;
1695
+ object: z.ZodLiteral<"response">;
1696
+ created_at: z.ZodNumber;
1697
+ model: z.ZodString;
1698
+ status: z.ZodOptional<z.ZodString>;
1699
+ error: z.ZodNullable<z.ZodUnknown>;
1700
+ incomplete_details: z.ZodNullable<z.ZodUnknown>;
1701
+ instructions: z.ZodNullable<z.ZodUnknown>;
1702
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
1703
+ output: z.ZodArray<z.ZodLazy<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1704
+ type: z.ZodLiteral<"message">;
1705
+ id: z.ZodString;
1706
+ role: z.ZodLiteral<"assistant">;
1707
+ content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1708
+ type: z.ZodLiteral<"output_text">;
1709
+ text: z.ZodString;
1710
+ annotations: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
1711
+ }, "strip", z.ZodTypeAny, {
1712
+ type: "output_text";
1713
+ text: string;
1714
+ annotations: unknown[];
1715
+ }, {
1716
+ type: "output_text";
1717
+ text: string;
1718
+ annotations?: unknown[] | undefined;
1719
+ }>, z.ZodObject<{
1720
+ type: z.ZodLiteral<"refusal">;
1721
+ refusal: z.ZodString;
1722
+ }, "strip", z.ZodTypeAny, {
1723
+ type: "refusal";
1724
+ refusal: string;
1725
+ }, {
1726
+ type: "refusal";
1727
+ refusal: string;
1728
+ }>]>, "many">;
1729
+ status: z.ZodString;
1730
+ }, "strip", z.ZodTypeAny, {
1731
+ type: "message";
1732
+ status: string;
1733
+ id: string;
1734
+ role: "assistant";
1735
+ content: ({
1736
+ type: "output_text";
1737
+ text: string;
1738
+ annotations: unknown[];
1739
+ } | {
1740
+ type: "refusal";
1741
+ refusal: string;
1742
+ })[];
1743
+ }, {
1744
+ type: "message";
1745
+ status: string;
1746
+ id: string;
1747
+ role: "assistant";
1748
+ content: ({
1749
+ type: "output_text";
1750
+ text: string;
1751
+ annotations?: unknown[] | undefined;
1752
+ } | {
1753
+ type: "refusal";
1754
+ refusal: string;
1755
+ })[];
1756
+ }>, z.ZodObject<{
1757
+ type: z.ZodLiteral<"function_call">;
1758
+ id: z.ZodString;
1759
+ call_id: z.ZodString;
1760
+ name: z.ZodString;
1761
+ arguments: z.ZodString;
1762
+ status: z.ZodOptional<z.ZodString>;
1763
+ }, "strip", z.ZodTypeAny, {
1764
+ name: string;
1765
+ type: "function_call";
1766
+ id: string;
1767
+ arguments: string;
1768
+ call_id: string;
1769
+ status?: string | undefined;
1770
+ }, {
1771
+ name: string;
1772
+ type: "function_call";
1773
+ id: string;
1774
+ arguments: string;
1775
+ call_id: string;
1776
+ status?: string | undefined;
1777
+ }>, z.ZodObject<{
1778
+ type: z.ZodLiteral<"reasoning">;
1779
+ id: z.ZodString;
1780
+ status: z.ZodOptional<z.ZodString>;
1781
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
1782
+ type: z.ZodLiteral<"reasoning_text">;
1783
+ text: z.ZodString;
1784
+ }, "strip", z.ZodTypeAny, {
1785
+ type: "reasoning_text";
1786
+ text: string;
1787
+ }, {
1788
+ type: "reasoning_text";
1789
+ text: string;
1790
+ }>, "many">>;
1791
+ summary: z.ZodArray<z.ZodObject<{
1792
+ type: z.ZodLiteral<"summary_text">;
1793
+ text: z.ZodString;
1794
+ }, "strip", z.ZodTypeAny, {
1795
+ type: "summary_text";
1796
+ text: string;
1797
+ }, {
1798
+ type: "summary_text";
1799
+ text: string;
1800
+ }>, "many">;
1801
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1802
+ }, "strip", z.ZodTypeAny, {
1803
+ type: "reasoning";
1804
+ id: string;
1805
+ summary: {
1806
+ type: "summary_text";
1807
+ text: string;
1808
+ }[];
1809
+ status?: string | undefined;
1810
+ content?: {
1811
+ type: "reasoning_text";
1812
+ text: string;
1813
+ }[] | undefined;
1814
+ encrypted_content?: string | null | undefined;
1815
+ }, {
1816
+ type: "reasoning";
1817
+ id: string;
1818
+ summary: {
1819
+ type: "summary_text";
1820
+ text: string;
1821
+ }[];
1822
+ status?: string | undefined;
1823
+ content?: {
1824
+ type: "reasoning_text";
1825
+ text: string;
1826
+ }[] | undefined;
1827
+ encrypted_content?: string | null | undefined;
1828
+ }>]>>, "many">;
1829
+ output_text: z.ZodString;
1830
+ parallel_tool_calls: z.ZodBoolean;
1831
+ temperature: z.ZodNullable<z.ZodNumber>;
1832
+ tool_choice: z.ZodUnknown;
1833
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1834
+ type: z.ZodLiteral<"function">;
1835
+ name: z.ZodString;
1836
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1837
+ parameters: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1838
+ strict: z.ZodNullable<z.ZodBoolean>;
1839
+ }, "strip", z.ZodTypeAny, {
1840
+ name: string;
1841
+ type: "function";
1842
+ parameters: Record<string, unknown> | null;
1843
+ strict: boolean | null;
1844
+ description?: string | null | undefined;
1845
+ }, {
1846
+ name: string;
1847
+ type: "function";
1848
+ parameters: Record<string, unknown> | null;
1849
+ strict: boolean | null;
1850
+ description?: string | null | undefined;
1851
+ }>, "many">>;
1852
+ top_p: z.ZodNullable<z.ZodNumber>;
1853
+ truncation: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"disabled">]>>>;
1854
+ usage: z.ZodOptional<z.ZodObject<{
1855
+ input_tokens: z.ZodNumber;
1856
+ input_tokens_details: z.ZodObject<{
1857
+ cached_tokens: z.ZodNumber;
1858
+ }, "strip", z.ZodTypeAny, {
1859
+ cached_tokens: number;
1860
+ }, {
1861
+ cached_tokens: number;
1862
+ }>;
1863
+ output_tokens: z.ZodNumber;
1864
+ output_tokens_details: z.ZodObject<{
1865
+ reasoning_tokens: z.ZodNumber;
1866
+ }, "strip", z.ZodTypeAny, {
1867
+ reasoning_tokens: number;
1868
+ }, {
1869
+ reasoning_tokens: number;
1870
+ }>;
1871
+ total_tokens: z.ZodNumber;
1872
+ }, "strip", z.ZodTypeAny, {
1873
+ total_tokens: number;
1874
+ input_tokens: number;
1875
+ output_tokens: number;
1876
+ input_tokens_details: {
1877
+ cached_tokens: number;
1878
+ };
1879
+ output_tokens_details: {
1880
+ reasoning_tokens: number;
1881
+ };
1882
+ }, {
1883
+ total_tokens: number;
1884
+ input_tokens: number;
1885
+ output_tokens: number;
1886
+ input_tokens_details: {
1887
+ cached_tokens: number;
1888
+ };
1889
+ output_tokens_details: {
1890
+ reasoning_tokens: number;
1891
+ };
1892
+ }>>;
1893
+ }, "strip", z.ZodTypeAny, {
1894
+ object: "response";
1895
+ id: string;
1896
+ model: string;
1897
+ temperature: number | null;
1898
+ top_p: number | null;
1899
+ metadata: Record<string, string> | null;
1900
+ created_at: number;
1901
+ output: ({
1902
+ type: "message";
1903
+ status: string;
1904
+ id: string;
1905
+ role: "assistant";
1906
+ content: ({
1907
+ type: "output_text";
1908
+ text: string;
1909
+ annotations: unknown[];
1910
+ } | {
1911
+ type: "refusal";
1912
+ refusal: string;
1913
+ })[];
1914
+ } | {
1915
+ name: string;
1916
+ type: "function_call";
1917
+ id: string;
1918
+ arguments: string;
1919
+ call_id: string;
1920
+ status?: string | undefined;
1921
+ } | {
1922
+ type: "reasoning";
1923
+ id: string;
1924
+ summary: {
1925
+ type: "summary_text";
1926
+ text: string;
1927
+ }[];
1928
+ status?: string | undefined;
1929
+ content?: {
1930
+ type: "reasoning_text";
1931
+ text: string;
1932
+ }[] | undefined;
1933
+ encrypted_content?: string | null | undefined;
1934
+ })[];
1935
+ output_text: string;
1936
+ parallel_tool_calls: boolean;
1937
+ error?: unknown;
1938
+ status?: string | undefined;
1939
+ tools?: {
1940
+ name: string;
1941
+ type: "function";
1942
+ parameters: Record<string, unknown> | null;
1943
+ strict: boolean | null;
1944
+ description?: string | null | undefined;
1945
+ }[] | undefined;
1946
+ tool_choice?: unknown;
1947
+ usage?: {
1948
+ total_tokens: number;
1949
+ input_tokens: number;
1950
+ output_tokens: number;
1951
+ input_tokens_details: {
1952
+ cached_tokens: number;
1953
+ };
1954
+ output_tokens_details: {
1955
+ reasoning_tokens: number;
1956
+ };
1957
+ } | undefined;
1958
+ incomplete_details?: unknown;
1959
+ instructions?: unknown;
1960
+ truncation?: "auto" | "disabled" | null | undefined;
1961
+ }, {
1962
+ object: "response";
1963
+ id: string;
1964
+ model: string;
1965
+ temperature: number | null;
1966
+ top_p: number | null;
1967
+ metadata: Record<string, string> | null;
1968
+ created_at: number;
1969
+ output: ({
1970
+ type: "message";
1971
+ status: string;
1972
+ id: string;
1973
+ role: "assistant";
1974
+ content: ({
1975
+ type: "output_text";
1976
+ text: string;
1977
+ annotations?: unknown[] | undefined;
1978
+ } | {
1979
+ type: "refusal";
1980
+ refusal: string;
1981
+ })[];
1982
+ } | {
1983
+ name: string;
1984
+ type: "function_call";
1985
+ id: string;
1986
+ arguments: string;
1987
+ call_id: string;
1988
+ status?: string | undefined;
1989
+ } | {
1990
+ type: "reasoning";
1991
+ id: string;
1992
+ summary: {
1993
+ type: "summary_text";
1994
+ text: string;
1995
+ }[];
1996
+ status?: string | undefined;
1997
+ content?: {
1998
+ type: "reasoning_text";
1999
+ text: string;
2000
+ }[] | undefined;
2001
+ encrypted_content?: string | null | undefined;
2002
+ })[];
2003
+ output_text: string;
2004
+ parallel_tool_calls: boolean;
2005
+ error?: unknown;
2006
+ status?: string | undefined;
2007
+ tools?: {
2008
+ name: string;
2009
+ type: "function";
2010
+ parameters: Record<string, unknown> | null;
2011
+ strict: boolean | null;
2012
+ description?: string | null | undefined;
2013
+ }[] | undefined;
2014
+ tool_choice?: unknown;
2015
+ usage?: {
2016
+ total_tokens: number;
2017
+ input_tokens: number;
2018
+ output_tokens: number;
2019
+ input_tokens_details: {
2020
+ cached_tokens: number;
2021
+ };
2022
+ output_tokens_details: {
2023
+ reasoning_tokens: number;
2024
+ };
2025
+ } | undefined;
2026
+ incomplete_details?: unknown;
2027
+ instructions?: unknown;
2028
+ truncation?: "auto" | "disabled" | null | undefined;
2029
+ }>;
2030
+ export type OpenAIResponsesResponse = z.infer<typeof OpenAIResponsesResponseSchema>;
2031
+ export type ClientRequest = OpenAIChatCompletionRequest | AnthropicMessagesRequest | OpenAIResponsesRequest;
2032
+ export declare const OpenAIStreamChunkSchema: z.ZodObject<{
2033
+ id: z.ZodString;
2034
+ object: z.ZodLiteral<"chat.completion.chunk">;
2035
+ created: z.ZodNumber;
2036
+ model: z.ZodString;
2037
+ system_fingerprint: z.ZodOptional<z.ZodString>;
2038
+ choices: z.ZodArray<z.ZodObject<{
2039
+ index: z.ZodNumber;
2040
+ delta: z.ZodObject<{
2041
+ role: z.ZodOptional<z.ZodString>;
2042
+ content: z.ZodOptional<z.ZodString>;
2043
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
2044
+ index: z.ZodNumber;
2045
+ id: z.ZodOptional<z.ZodString>;
2046
+ type: z.ZodOptional<z.ZodLiteral<"function">>;
2047
+ function: z.ZodObject<{
2048
+ name: z.ZodOptional<z.ZodString>;
2049
+ arguments: z.ZodOptional<z.ZodString>;
2050
+ }, "strip", z.ZodTypeAny, {
2051
+ name?: string | undefined;
2052
+ arguments?: string | undefined;
2053
+ }, {
2054
+ name?: string | undefined;
2055
+ arguments?: string | undefined;
2056
+ }>;
2057
+ }, "strip", z.ZodTypeAny, {
2058
+ function: {
2059
+ name?: string | undefined;
2060
+ arguments?: string | undefined;
2061
+ };
2062
+ index: number;
2063
+ type?: "function" | undefined;
2064
+ id?: string | undefined;
2065
+ }, {
2066
+ function: {
2067
+ name?: string | undefined;
2068
+ arguments?: string | undefined;
2069
+ };
2070
+ index: number;
2071
+ type?: "function" | undefined;
2072
+ id?: string | undefined;
2073
+ }>, "many">>;
2074
+ }, "strip", z.ZodTypeAny, {
2075
+ role?: string | undefined;
2076
+ content?: string | undefined;
2077
+ tool_calls?: {
2078
+ function: {
2079
+ name?: string | undefined;
2080
+ arguments?: string | undefined;
2081
+ };
2082
+ index: number;
2083
+ type?: "function" | undefined;
2084
+ id?: string | undefined;
2085
+ }[] | undefined;
2086
+ }, {
2087
+ role?: string | undefined;
2088
+ content?: string | undefined;
2089
+ tool_calls?: {
2090
+ function: {
2091
+ name?: string | undefined;
2092
+ arguments?: string | undefined;
2093
+ };
2094
+ index: number;
2095
+ type?: "function" | undefined;
2096
+ id?: string | undefined;
2097
+ }[] | undefined;
2098
+ }>;
2099
+ finish_reason: z.ZodNullable<z.ZodString>;
2100
+ }, "strip", z.ZodTypeAny, {
2101
+ index: number;
2102
+ finish_reason: string | null;
2103
+ delta: {
2104
+ role?: string | undefined;
2105
+ content?: string | undefined;
2106
+ tool_calls?: {
2107
+ function: {
2108
+ name?: string | undefined;
2109
+ arguments?: string | undefined;
2110
+ };
2111
+ index: number;
2112
+ type?: "function" | undefined;
2113
+ id?: string | undefined;
2114
+ }[] | undefined;
2115
+ };
2116
+ }, {
2117
+ index: number;
2118
+ finish_reason: string | null;
2119
+ delta: {
2120
+ role?: string | undefined;
2121
+ content?: string | undefined;
2122
+ tool_calls?: {
2123
+ function: {
2124
+ name?: string | undefined;
2125
+ arguments?: string | undefined;
2126
+ };
2127
+ index: number;
2128
+ type?: "function" | undefined;
2129
+ id?: string | undefined;
2130
+ }[] | undefined;
2131
+ };
2132
+ }>, "many">;
2133
+ }, "strip", z.ZodTypeAny, {
2134
+ object: "chat.completion.chunk";
2135
+ id: string;
2136
+ model: string;
2137
+ created: number;
2138
+ choices: {
2139
+ index: number;
2140
+ finish_reason: string | null;
2141
+ delta: {
2142
+ role?: string | undefined;
2143
+ content?: string | undefined;
2144
+ tool_calls?: {
2145
+ function: {
2146
+ name?: string | undefined;
2147
+ arguments?: string | undefined;
2148
+ };
2149
+ index: number;
2150
+ type?: "function" | undefined;
2151
+ id?: string | undefined;
2152
+ }[] | undefined;
2153
+ };
2154
+ }[];
2155
+ system_fingerprint?: string | undefined;
2156
+ }, {
2157
+ object: "chat.completion.chunk";
2158
+ id: string;
2159
+ model: string;
2160
+ created: number;
2161
+ choices: {
2162
+ index: number;
2163
+ finish_reason: string | null;
2164
+ delta: {
2165
+ role?: string | undefined;
2166
+ content?: string | undefined;
2167
+ tool_calls?: {
2168
+ function: {
2169
+ name?: string | undefined;
2170
+ arguments?: string | undefined;
2171
+ };
2172
+ index: number;
2173
+ type?: "function" | undefined;
2174
+ id?: string | undefined;
2175
+ }[] | undefined;
2176
+ };
2177
+ }[];
2178
+ system_fingerprint?: string | undefined;
2179
+ }>;
2180
+ export type OpenAIStreamChunk = z.infer<typeof OpenAIStreamChunkSchema>;
2181
+ export declare const AnthropicStreamEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2182
+ type: z.ZodLiteral<"message_start">;
2183
+ message: z.ZodObject<{
2184
+ id: z.ZodString;
2185
+ type: z.ZodLiteral<"message">;
2186
+ role: z.ZodLiteral<"assistant">;
2187
+ content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2188
+ type: z.ZodLiteral<"text">;
2189
+ text: z.ZodString;
2190
+ }, "strip", z.ZodTypeAny, {
2191
+ type: "text";
2192
+ text: string;
2193
+ }, {
2194
+ type: "text";
2195
+ text: string;
2196
+ }>, z.ZodObject<{
2197
+ type: z.ZodLiteral<"image">;
2198
+ source: z.ZodObject<{
2199
+ type: z.ZodLiteral<"base64">;
2200
+ media_type: z.ZodString;
2201
+ data: z.ZodString;
2202
+ }, "strip", z.ZodTypeAny, {
2203
+ type: "base64";
2204
+ data: string;
2205
+ media_type: string;
2206
+ }, {
2207
+ type: "base64";
2208
+ data: string;
2209
+ media_type: string;
2210
+ }>;
2211
+ }, "strip", z.ZodTypeAny, {
2212
+ type: "image";
2213
+ source: {
2214
+ type: "base64";
2215
+ data: string;
2216
+ media_type: string;
2217
+ };
2218
+ }, {
2219
+ type: "image";
2220
+ source: {
2221
+ type: "base64";
2222
+ data: string;
2223
+ media_type: string;
2224
+ };
2225
+ }>, z.ZodObject<{
2226
+ type: z.ZodLiteral<"tool_use">;
2227
+ id: z.ZodString;
2228
+ name: z.ZodString;
2229
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2230
+ }, "strip", z.ZodTypeAny, {
2231
+ name: string;
2232
+ type: "tool_use";
2233
+ id: string;
2234
+ input: Record<string, unknown>;
2235
+ }, {
2236
+ name: string;
2237
+ type: "tool_use";
2238
+ id: string;
2239
+ input: Record<string, unknown>;
2240
+ }>, z.ZodObject<{
2241
+ type: z.ZodLiteral<"tool_result">;
2242
+ tool_use_id: z.ZodString;
2243
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodAny, "many">]>>;
2244
+ is_error: z.ZodOptional<z.ZodBoolean>;
2245
+ }, "strip", z.ZodTypeAny, {
2246
+ type: "tool_result";
2247
+ tool_use_id: string;
2248
+ content?: string | any[] | undefined;
2249
+ is_error?: boolean | undefined;
2250
+ }, {
2251
+ type: "tool_result";
2252
+ tool_use_id: string;
2253
+ content?: string | any[] | undefined;
2254
+ is_error?: boolean | undefined;
2255
+ }>, z.ZodObject<{
2256
+ type: z.ZodLiteral<"thinking">;
2257
+ thinking: z.ZodString;
2258
+ signature: z.ZodOptional<z.ZodString>;
2259
+ }, "strip", z.ZodTypeAny, {
2260
+ type: "thinking";
2261
+ thinking: string;
2262
+ signature?: string | undefined;
2263
+ }, {
2264
+ type: "thinking";
2265
+ thinking: string;
2266
+ signature?: string | undefined;
2267
+ }>]>, "many">;
2268
+ model: z.ZodString;
2269
+ stop_reason: z.ZodNullable<z.ZodString>;
2270
+ stop_sequence: z.ZodNullable<z.ZodString>;
2271
+ usage: z.ZodObject<{
2272
+ input_tokens: z.ZodNumber;
2273
+ output_tokens: z.ZodNumber;
2274
+ }, "strip", z.ZodTypeAny, {
2275
+ input_tokens: number;
2276
+ output_tokens: number;
2277
+ }, {
2278
+ input_tokens: number;
2279
+ output_tokens: number;
2280
+ }>;
2281
+ }, "strip", z.ZodTypeAny, {
2282
+ type: "message";
2283
+ id: string;
2284
+ role: "assistant";
2285
+ content: ({
2286
+ type: "text";
2287
+ text: string;
2288
+ } | {
2289
+ type: "image";
2290
+ source: {
2291
+ type: "base64";
2292
+ data: string;
2293
+ media_type: string;
2294
+ };
2295
+ } | {
2296
+ name: string;
2297
+ type: "tool_use";
2298
+ id: string;
2299
+ input: Record<string, unknown>;
2300
+ } | {
2301
+ type: "tool_result";
2302
+ tool_use_id: string;
2303
+ content?: string | any[] | undefined;
2304
+ is_error?: boolean | undefined;
2305
+ } | {
2306
+ type: "thinking";
2307
+ thinking: string;
2308
+ signature?: string | undefined;
2309
+ })[];
2310
+ model: string;
2311
+ usage: {
2312
+ input_tokens: number;
2313
+ output_tokens: number;
2314
+ };
2315
+ stop_reason: string | null;
2316
+ stop_sequence: string | null;
2317
+ }, {
2318
+ type: "message";
2319
+ id: string;
2320
+ role: "assistant";
2321
+ content: ({
2322
+ type: "text";
2323
+ text: string;
2324
+ } | {
2325
+ type: "image";
2326
+ source: {
2327
+ type: "base64";
2328
+ data: string;
2329
+ media_type: string;
2330
+ };
2331
+ } | {
2332
+ name: string;
2333
+ type: "tool_use";
2334
+ id: string;
2335
+ input: Record<string, unknown>;
2336
+ } | {
2337
+ type: "tool_result";
2338
+ tool_use_id: string;
2339
+ content?: string | any[] | undefined;
2340
+ is_error?: boolean | undefined;
2341
+ } | {
2342
+ type: "thinking";
2343
+ thinking: string;
2344
+ signature?: string | undefined;
2345
+ })[];
2346
+ model: string;
2347
+ usage: {
2348
+ input_tokens: number;
2349
+ output_tokens: number;
2350
+ };
2351
+ stop_reason: string | null;
2352
+ stop_sequence: string | null;
2353
+ }>;
2354
+ }, "strip", z.ZodTypeAny, {
2355
+ message: {
2356
+ type: "message";
2357
+ id: string;
2358
+ role: "assistant";
2359
+ content: ({
2360
+ type: "text";
2361
+ text: string;
2362
+ } | {
2363
+ type: "image";
2364
+ source: {
2365
+ type: "base64";
2366
+ data: string;
2367
+ media_type: string;
2368
+ };
2369
+ } | {
2370
+ name: string;
2371
+ type: "tool_use";
2372
+ id: string;
2373
+ input: Record<string, unknown>;
2374
+ } | {
2375
+ type: "tool_result";
2376
+ tool_use_id: string;
2377
+ content?: string | any[] | undefined;
2378
+ is_error?: boolean | undefined;
2379
+ } | {
2380
+ type: "thinking";
2381
+ thinking: string;
2382
+ signature?: string | undefined;
2383
+ })[];
2384
+ model: string;
2385
+ usage: {
2386
+ input_tokens: number;
2387
+ output_tokens: number;
2388
+ };
2389
+ stop_reason: string | null;
2390
+ stop_sequence: string | null;
2391
+ };
2392
+ type: "message_start";
2393
+ }, {
2394
+ message: {
2395
+ type: "message";
2396
+ id: string;
2397
+ role: "assistant";
2398
+ content: ({
2399
+ type: "text";
2400
+ text: string;
2401
+ } | {
2402
+ type: "image";
2403
+ source: {
2404
+ type: "base64";
2405
+ data: string;
2406
+ media_type: string;
2407
+ };
2408
+ } | {
2409
+ name: string;
2410
+ type: "tool_use";
2411
+ id: string;
2412
+ input: Record<string, unknown>;
2413
+ } | {
2414
+ type: "tool_result";
2415
+ tool_use_id: string;
2416
+ content?: string | any[] | undefined;
2417
+ is_error?: boolean | undefined;
2418
+ } | {
2419
+ type: "thinking";
2420
+ thinking: string;
2421
+ signature?: string | undefined;
2422
+ })[];
2423
+ model: string;
2424
+ usage: {
2425
+ input_tokens: number;
2426
+ output_tokens: number;
2427
+ };
2428
+ stop_reason: string | null;
2429
+ stop_sequence: string | null;
2430
+ };
2431
+ type: "message_start";
2432
+ }>, z.ZodObject<{
2433
+ type: z.ZodLiteral<"content_block_start">;
2434
+ index: z.ZodNumber;
2435
+ content_block: z.ZodUnion<[z.ZodObject<{
2436
+ type: z.ZodLiteral<"text">;
2437
+ text: z.ZodString;
2438
+ }, "strip", z.ZodTypeAny, {
2439
+ type: "text";
2440
+ text: string;
2441
+ }, {
2442
+ type: "text";
2443
+ text: string;
2444
+ }>, z.ZodObject<{
2445
+ type: z.ZodLiteral<"image">;
2446
+ source: z.ZodObject<{
2447
+ type: z.ZodLiteral<"base64">;
2448
+ media_type: z.ZodString;
2449
+ data: z.ZodString;
2450
+ }, "strip", z.ZodTypeAny, {
2451
+ type: "base64";
2452
+ data: string;
2453
+ media_type: string;
2454
+ }, {
2455
+ type: "base64";
2456
+ data: string;
2457
+ media_type: string;
2458
+ }>;
2459
+ }, "strip", z.ZodTypeAny, {
2460
+ type: "image";
2461
+ source: {
2462
+ type: "base64";
2463
+ data: string;
2464
+ media_type: string;
2465
+ };
2466
+ }, {
2467
+ type: "image";
2468
+ source: {
2469
+ type: "base64";
2470
+ data: string;
2471
+ media_type: string;
2472
+ };
2473
+ }>, z.ZodObject<{
2474
+ type: z.ZodLiteral<"tool_use">;
2475
+ id: z.ZodString;
2476
+ name: z.ZodString;
2477
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2478
+ }, "strip", z.ZodTypeAny, {
2479
+ name: string;
2480
+ type: "tool_use";
2481
+ id: string;
2482
+ input: Record<string, unknown>;
2483
+ }, {
2484
+ name: string;
2485
+ type: "tool_use";
2486
+ id: string;
2487
+ input: Record<string, unknown>;
2488
+ }>, z.ZodObject<{
2489
+ type: z.ZodLiteral<"tool_result">;
2490
+ tool_use_id: z.ZodString;
2491
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodAny, "many">]>>;
2492
+ is_error: z.ZodOptional<z.ZodBoolean>;
2493
+ }, "strip", z.ZodTypeAny, {
2494
+ type: "tool_result";
2495
+ tool_use_id: string;
2496
+ content?: string | any[] | undefined;
2497
+ is_error?: boolean | undefined;
2498
+ }, {
2499
+ type: "tool_result";
2500
+ tool_use_id: string;
2501
+ content?: string | any[] | undefined;
2502
+ is_error?: boolean | undefined;
2503
+ }>, z.ZodObject<{
2504
+ type: z.ZodLiteral<"thinking">;
2505
+ thinking: z.ZodString;
2506
+ signature: z.ZodOptional<z.ZodString>;
2507
+ }, "strip", z.ZodTypeAny, {
2508
+ type: "thinking";
2509
+ thinking: string;
2510
+ signature?: string | undefined;
2511
+ }, {
2512
+ type: "thinking";
2513
+ thinking: string;
2514
+ signature?: string | undefined;
2515
+ }>]>;
2516
+ }, "strip", z.ZodTypeAny, {
2517
+ type: "content_block_start";
2518
+ index: number;
2519
+ content_block: {
2520
+ type: "text";
2521
+ text: string;
2522
+ } | {
2523
+ type: "image";
2524
+ source: {
2525
+ type: "base64";
2526
+ data: string;
2527
+ media_type: string;
2528
+ };
2529
+ } | {
2530
+ name: string;
2531
+ type: "tool_use";
2532
+ id: string;
2533
+ input: Record<string, unknown>;
2534
+ } | {
2535
+ type: "tool_result";
2536
+ tool_use_id: string;
2537
+ content?: string | any[] | undefined;
2538
+ is_error?: boolean | undefined;
2539
+ } | {
2540
+ type: "thinking";
2541
+ thinking: string;
2542
+ signature?: string | undefined;
2543
+ };
2544
+ }, {
2545
+ type: "content_block_start";
2546
+ index: number;
2547
+ content_block: {
2548
+ type: "text";
2549
+ text: string;
2550
+ } | {
2551
+ type: "image";
2552
+ source: {
2553
+ type: "base64";
2554
+ data: string;
2555
+ media_type: string;
2556
+ };
2557
+ } | {
2558
+ name: string;
2559
+ type: "tool_use";
2560
+ id: string;
2561
+ input: Record<string, unknown>;
2562
+ } | {
2563
+ type: "tool_result";
2564
+ tool_use_id: string;
2565
+ content?: string | any[] | undefined;
2566
+ is_error?: boolean | undefined;
2567
+ } | {
2568
+ type: "thinking";
2569
+ thinking: string;
2570
+ signature?: string | undefined;
2571
+ };
2572
+ }>, z.ZodObject<{
2573
+ type: z.ZodLiteral<"content_block_delta">;
2574
+ index: z.ZodNumber;
2575
+ delta: z.ZodUnion<[z.ZodObject<{
2576
+ type: z.ZodLiteral<"text_delta">;
2577
+ text: z.ZodString;
2578
+ }, "strip", z.ZodTypeAny, {
2579
+ type: "text_delta";
2580
+ text: string;
2581
+ }, {
2582
+ type: "text_delta";
2583
+ text: string;
2584
+ }>, z.ZodObject<{
2585
+ type: z.ZodLiteral<"input_json_delta">;
2586
+ partial_json: z.ZodString;
2587
+ }, "strip", z.ZodTypeAny, {
2588
+ type: "input_json_delta";
2589
+ partial_json: string;
2590
+ }, {
2591
+ type: "input_json_delta";
2592
+ partial_json: string;
2593
+ }>, z.ZodObject<{
2594
+ type: z.ZodLiteral<"thinking_delta">;
2595
+ thinking: z.ZodString;
2596
+ }, "strip", z.ZodTypeAny, {
2597
+ type: "thinking_delta";
2598
+ thinking: string;
2599
+ }, {
2600
+ type: "thinking_delta";
2601
+ thinking: string;
2602
+ }>]>;
2603
+ }, "strip", z.ZodTypeAny, {
2604
+ type: "content_block_delta";
2605
+ index: number;
2606
+ delta: {
2607
+ type: "text_delta";
2608
+ text: string;
2609
+ } | {
2610
+ type: "input_json_delta";
2611
+ partial_json: string;
2612
+ } | {
2613
+ type: "thinking_delta";
2614
+ thinking: string;
2615
+ };
2616
+ }, {
2617
+ type: "content_block_delta";
2618
+ index: number;
2619
+ delta: {
2620
+ type: "text_delta";
2621
+ text: string;
2622
+ } | {
2623
+ type: "input_json_delta";
2624
+ partial_json: string;
2625
+ } | {
2626
+ type: "thinking_delta";
2627
+ thinking: string;
2628
+ };
2629
+ }>, z.ZodObject<{
2630
+ type: z.ZodLiteral<"content_block_stop">;
2631
+ index: z.ZodNumber;
2632
+ }, "strip", z.ZodTypeAny, {
2633
+ type: "content_block_stop";
2634
+ index: number;
2635
+ }, {
2636
+ type: "content_block_stop";
2637
+ index: number;
2638
+ }>, z.ZodObject<{
2639
+ type: z.ZodLiteral<"message_delta">;
2640
+ delta: z.ZodObject<{
2641
+ stop_reason: z.ZodNullable<z.ZodString>;
2642
+ stop_sequence: z.ZodNullable<z.ZodString>;
2643
+ }, "strip", z.ZodTypeAny, {
2644
+ stop_reason: string | null;
2645
+ stop_sequence: string | null;
2646
+ }, {
2647
+ stop_reason: string | null;
2648
+ stop_sequence: string | null;
2649
+ }>;
2650
+ usage: z.ZodObject<{
2651
+ output_tokens: z.ZodNumber;
2652
+ }, "strip", z.ZodTypeAny, {
2653
+ output_tokens: number;
2654
+ }, {
2655
+ output_tokens: number;
2656
+ }>;
2657
+ }, "strip", z.ZodTypeAny, {
2658
+ type: "message_delta";
2659
+ usage: {
2660
+ output_tokens: number;
2661
+ };
2662
+ delta: {
2663
+ stop_reason: string | null;
2664
+ stop_sequence: string | null;
2665
+ };
2666
+ }, {
2667
+ type: "message_delta";
2668
+ usage: {
2669
+ output_tokens: number;
2670
+ };
2671
+ delta: {
2672
+ stop_reason: string | null;
2673
+ stop_sequence: string | null;
2674
+ };
2675
+ }>, z.ZodObject<{
2676
+ type: z.ZodLiteral<"message_stop">;
2677
+ }, "strip", z.ZodTypeAny, {
2678
+ type: "message_stop";
2679
+ }, {
2680
+ type: "message_stop";
2681
+ }>, z.ZodObject<{
2682
+ type: z.ZodOptional<z.ZodLiteral<"ping">>;
2683
+ }, "strip", z.ZodTypeAny, {
2684
+ type?: "ping" | undefined;
2685
+ }, {
2686
+ type?: "ping" | undefined;
2687
+ }>, z.ZodObject<{
2688
+ type: z.ZodLiteral<"error">;
2689
+ error: z.ZodObject<{
2690
+ type: z.ZodString;
2691
+ message: z.ZodString;
2692
+ }, "strip", z.ZodTypeAny, {
2693
+ message: string;
2694
+ type: string;
2695
+ }, {
2696
+ message: string;
2697
+ type: string;
2698
+ }>;
2699
+ }, "strip", z.ZodTypeAny, {
2700
+ error: {
2701
+ message: string;
2702
+ type: string;
2703
+ };
2704
+ type: "error";
2705
+ }, {
2706
+ error: {
2707
+ message: string;
2708
+ type: string;
2709
+ };
2710
+ type: "error";
2711
+ }>]>;
2712
+ export type AnthropicStreamEvent = z.infer<typeof AnthropicStreamEventSchema>;
2713
+ export type ClientResponse = OpenAIChatCompletionResponse | AnthropicMessagesResponse | OpenAIResponsesResponse;
2714
+ export declare const OpenAIResponsesOutputItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2715
+ type: z.ZodLiteral<"message">;
2716
+ id: z.ZodString;
2717
+ role: z.ZodLiteral<"assistant">;
2718
+ content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2719
+ type: z.ZodLiteral<"output_text">;
2720
+ text: z.ZodString;
2721
+ annotations: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
2722
+ }, "strip", z.ZodTypeAny, {
2723
+ type: "output_text";
2724
+ text: string;
2725
+ annotations: unknown[];
2726
+ }, {
2727
+ type: "output_text";
2728
+ text: string;
2729
+ annotations?: unknown[] | undefined;
2730
+ }>, z.ZodObject<{
2731
+ type: z.ZodLiteral<"refusal">;
2732
+ refusal: z.ZodString;
2733
+ }, "strip", z.ZodTypeAny, {
2734
+ type: "refusal";
2735
+ refusal: string;
2736
+ }, {
2737
+ type: "refusal";
2738
+ refusal: string;
2739
+ }>]>, "many">;
2740
+ status: z.ZodString;
2741
+ }, "strip", z.ZodTypeAny, {
2742
+ type: "message";
2743
+ status: string;
2744
+ id: string;
2745
+ role: "assistant";
2746
+ content: ({
2747
+ type: "output_text";
2748
+ text: string;
2749
+ annotations: unknown[];
2750
+ } | {
2751
+ type: "refusal";
2752
+ refusal: string;
2753
+ })[];
2754
+ }, {
2755
+ type: "message";
2756
+ status: string;
2757
+ id: string;
2758
+ role: "assistant";
2759
+ content: ({
2760
+ type: "output_text";
2761
+ text: string;
2762
+ annotations?: unknown[] | undefined;
2763
+ } | {
2764
+ type: "refusal";
2765
+ refusal: string;
2766
+ })[];
2767
+ }>, z.ZodObject<{
2768
+ type: z.ZodLiteral<"function_call">;
2769
+ id: z.ZodString;
2770
+ call_id: z.ZodString;
2771
+ name: z.ZodString;
2772
+ arguments: z.ZodString;
2773
+ status: z.ZodOptional<z.ZodString>;
2774
+ }, "strip", z.ZodTypeAny, {
2775
+ name: string;
2776
+ type: "function_call";
2777
+ id: string;
2778
+ arguments: string;
2779
+ call_id: string;
2780
+ status?: string | undefined;
2781
+ }, {
2782
+ name: string;
2783
+ type: "function_call";
2784
+ id: string;
2785
+ arguments: string;
2786
+ call_id: string;
2787
+ status?: string | undefined;
2788
+ }>, z.ZodObject<{
2789
+ type: z.ZodLiteral<"reasoning">;
2790
+ id: z.ZodString;
2791
+ status: z.ZodOptional<z.ZodString>;
2792
+ content: z.ZodOptional<z.ZodArray<z.ZodObject<{
2793
+ type: z.ZodLiteral<"reasoning_text">;
2794
+ text: z.ZodString;
2795
+ }, "strip", z.ZodTypeAny, {
2796
+ type: "reasoning_text";
2797
+ text: string;
2798
+ }, {
2799
+ type: "reasoning_text";
2800
+ text: string;
2801
+ }>, "many">>;
2802
+ summary: z.ZodArray<z.ZodObject<{
2803
+ type: z.ZodLiteral<"summary_text">;
2804
+ text: z.ZodString;
2805
+ }, "strip", z.ZodTypeAny, {
2806
+ type: "summary_text";
2807
+ text: string;
2808
+ }, {
2809
+ type: "summary_text";
2810
+ text: string;
2811
+ }>, "many">;
2812
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2813
+ }, "strip", z.ZodTypeAny, {
2814
+ type: "reasoning";
2815
+ id: string;
2816
+ summary: {
2817
+ type: "summary_text";
2818
+ text: string;
2819
+ }[];
2820
+ status?: string | undefined;
2821
+ content?: {
2822
+ type: "reasoning_text";
2823
+ text: string;
2824
+ }[] | undefined;
2825
+ encrypted_content?: string | null | undefined;
2826
+ }, {
2827
+ type: "reasoning";
2828
+ id: string;
2829
+ summary: {
2830
+ type: "summary_text";
2831
+ text: string;
2832
+ }[];
2833
+ status?: string | undefined;
2834
+ content?: {
2835
+ type: "reasoning_text";
2836
+ text: string;
2837
+ }[] | undefined;
2838
+ encrypted_content?: string | null | undefined;
2839
+ }>]>;
2840
+ export type OpenAIResponsesOutputItem = z.infer<typeof OpenAIResponsesOutputItemSchema>;
2841
+ export type AnthropicContentBlock = z.infer<typeof AnthropicContentBlockSchema>;