@hebo-ai/gateway 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +8 -6
  2. package/dist/endpoints/chat-completions/converters.d.ts +3 -1
  3. package/dist/endpoints/chat-completions/converters.js +121 -90
  4. package/dist/endpoints/chat-completions/otel.js +7 -0
  5. package/dist/endpoints/chat-completions/schema.d.ts +400 -76
  6. package/dist/endpoints/chat-completions/schema.js +80 -36
  7. package/dist/endpoints/embeddings/schema.d.ts +1 -1
  8. package/dist/endpoints/embeddings/schema.js +1 -1
  9. package/dist/errors/gateway.js +1 -0
  10. package/dist/logger/default.d.ts +0 -1
  11. package/dist/logger/default.js +30 -6
  12. package/dist/middleware/utils.js +1 -0
  13. package/dist/models/amazon/middleware.js +1 -0
  14. package/dist/models/anthropic/middleware.d.ts +2 -0
  15. package/dist/models/anthropic/middleware.js +77 -16
  16. package/dist/models/google/middleware.js +17 -0
  17. package/dist/models/google/presets.d.ts +387 -0
  18. package/dist/models/google/presets.js +9 -2
  19. package/dist/models/openai/middleware.js +1 -0
  20. package/dist/models/types.d.ts +1 -1
  21. package/dist/models/types.js +1 -0
  22. package/dist/providers/bedrock/index.d.ts +1 -0
  23. package/dist/providers/bedrock/index.js +1 -0
  24. package/dist/providers/bedrock/middleware.d.ts +2 -0
  25. package/dist/providers/bedrock/middleware.js +35 -0
  26. package/package.json +19 -21
  27. package/src/endpoints/chat-completions/converters.test.ts +219 -0
  28. package/src/endpoints/chat-completions/converters.ts +144 -104
  29. package/src/endpoints/chat-completions/handler.test.ts +87 -0
  30. package/src/endpoints/chat-completions/otel.ts +6 -0
  31. package/src/endpoints/chat-completions/schema.ts +85 -43
  32. package/src/endpoints/embeddings/schema.ts +1 -1
  33. package/src/errors/gateway.ts +2 -0
  34. package/src/logger/default.ts +34 -8
  35. package/src/middleware/utils.ts +1 -0
  36. package/src/models/amazon/middleware.ts +1 -0
  37. package/src/models/anthropic/middleware.test.ts +332 -1
  38. package/src/models/anthropic/middleware.ts +83 -19
  39. package/src/models/google/middleware.test.ts +31 -0
  40. package/src/models/google/middleware.ts +18 -0
  41. package/src/models/google/presets.ts +13 -2
  42. package/src/models/openai/middleware.ts +1 -0
  43. package/src/models/types.ts +1 -0
  44. package/src/providers/bedrock/index.ts +1 -0
  45. package/src/providers/bedrock/middleware.test.ts +73 -0
  46. package/src/providers/bedrock/middleware.ts +43 -0
@@ -3,11 +3,16 @@ export declare const ChatCompletionsContentPartTextSchema: z.ZodObject<{
3
3
  type: z.ZodLiteral<"text">;
4
4
  text: z.ZodString;
5
5
  }, z.core.$strip>;
6
+ export type ChatCompletionsContentPartText = z.infer<typeof ChatCompletionsContentPartTextSchema>;
6
7
  export declare const ChatCompletionsContentPartImageSchema: z.ZodObject<{
7
8
  type: z.ZodLiteral<"image_url">;
8
9
  image_url: z.ZodObject<{
9
10
  url: z.ZodString;
10
- detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
11
+ detail: z.ZodOptional<z.ZodEnum<{
12
+ low: "low";
13
+ high: "high";
14
+ auto: "auto";
15
+ }>>;
11
16
  }, z.core.$strip>;
12
17
  }, z.core.$strip>;
13
18
  export declare const ChatCompletionsContentPartFileSchema: z.ZodObject<{
@@ -18,7 +23,65 @@ export declare const ChatCompletionsContentPartFileSchema: z.ZodObject<{
18
23
  filename: z.ZodOptional<z.ZodString>;
19
24
  }, z.core.$strip>;
20
25
  }, z.core.$strip>;
21
- export type ChatCompletionsContentPart = z.infer<typeof ChatCompletionsContentPartTextSchema> | z.infer<typeof ChatCompletionsContentPartImageSchema> | z.infer<typeof ChatCompletionsContentPartFileSchema>;
26
+ export declare const ChatCompletionsContentPartAudioSchema: z.ZodObject<{
27
+ type: z.ZodLiteral<"input_audio">;
28
+ input_audio: z.ZodObject<{
29
+ data: z.ZodString;
30
+ format: z.ZodEnum<{
31
+ "x-aac": "x-aac";
32
+ flac: "flac";
33
+ mp3: "mp3";
34
+ m4a: "m4a";
35
+ mpeg: "mpeg";
36
+ mpga: "mpga";
37
+ mp4: "mp4";
38
+ ogg: "ogg";
39
+ pcm: "pcm";
40
+ wav: "wav";
41
+ webm: "webm";
42
+ }>;
43
+ }, z.core.$strip>;
44
+ }, z.core.$strip>;
45
+ export declare const ChatCompletionsContentPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
+ type: z.ZodLiteral<"text">;
47
+ text: z.ZodString;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<"image_url">;
50
+ image_url: z.ZodObject<{
51
+ url: z.ZodString;
52
+ detail: z.ZodOptional<z.ZodEnum<{
53
+ low: "low";
54
+ high: "high";
55
+ auto: "auto";
56
+ }>>;
57
+ }, z.core.$strip>;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ type: z.ZodLiteral<"file">;
60
+ file: z.ZodObject<{
61
+ data: z.ZodString;
62
+ media_type: z.ZodString;
63
+ filename: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ type: z.ZodLiteral<"input_audio">;
67
+ input_audio: z.ZodObject<{
68
+ data: z.ZodString;
69
+ format: z.ZodEnum<{
70
+ "x-aac": "x-aac";
71
+ flac: "flac";
72
+ mp3: "mp3";
73
+ m4a: "m4a";
74
+ mpeg: "mpeg";
75
+ mpga: "mpga";
76
+ mp4: "mp4";
77
+ ogg: "ogg";
78
+ pcm: "pcm";
79
+ wav: "wav";
80
+ webm: "webm";
81
+ }>;
82
+ }, z.core.$strip>;
83
+ }, z.core.$strip>], "type">;
84
+ export type ChatCompletionsContentPart = z.infer<typeof ChatCompletionsContentPartSchema>;
22
85
  export declare const ChatCompletionsToolCallSchema: z.ZodObject<{
23
86
  type: z.ZodLiteral<"function">;
24
87
  id: z.ZodString;
@@ -26,7 +89,7 @@ export declare const ChatCompletionsToolCallSchema: z.ZodObject<{
26
89
  arguments: z.ZodString;
27
90
  name: z.ZodString;
28
91
  }, z.core.$strip>;
29
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
92
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
30
93
  }, z.core.$strip>;
31
94
  export type ChatCompletionsToolCall = z.infer<typeof ChatCompletionsToolCallSchema>;
32
95
  export declare const ChatCompletionsSystemMessageSchema: z.ZodObject<{
@@ -37,14 +100,18 @@ export declare const ChatCompletionsSystemMessageSchema: z.ZodObject<{
37
100
  export type ChatCompletionsSystemMessage = z.infer<typeof ChatCompletionsSystemMessageSchema>;
38
101
  export declare const ChatCompletionsUserMessageSchema: z.ZodObject<{
39
102
  role: z.ZodLiteral<"user">;
40
- content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
103
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
41
104
  type: z.ZodLiteral<"text">;
42
105
  text: z.ZodString;
43
106
  }, z.core.$strip>, z.ZodObject<{
44
107
  type: z.ZodLiteral<"image_url">;
45
108
  image_url: z.ZodObject<{
46
109
  url: z.ZodString;
47
- detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
110
+ detail: z.ZodOptional<z.ZodEnum<{
111
+ low: "low";
112
+ high: "high";
113
+ auto: "auto";
114
+ }>>;
48
115
  }, z.core.$strip>;
49
116
  }, z.core.$strip>, z.ZodObject<{
50
117
  type: z.ZodLiteral<"file">;
@@ -53,7 +120,25 @@ export declare const ChatCompletionsUserMessageSchema: z.ZodObject<{
53
120
  media_type: z.ZodString;
54
121
  filename: z.ZodOptional<z.ZodString>;
55
122
  }, z.core.$strip>;
56
- }, z.core.$strip>]>>]>;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ type: z.ZodLiteral<"input_audio">;
125
+ input_audio: z.ZodObject<{
126
+ data: z.ZodString;
127
+ format: z.ZodEnum<{
128
+ "x-aac": "x-aac";
129
+ flac: "flac";
130
+ mp3: "mp3";
131
+ m4a: "m4a";
132
+ mpeg: "mpeg";
133
+ mpga: "mpga";
134
+ mp4: "mp4";
135
+ ogg: "ogg";
136
+ pcm: "pcm";
137
+ wav: "wav";
138
+ webm: "webm";
139
+ }>;
140
+ }, z.core.$strip>;
141
+ }, z.core.$strip>], "type">>]>;
57
142
  name: z.ZodOptional<z.ZodString>;
58
143
  }, z.core.$strip>;
59
144
  export type ChatCompletionsUserMessage = z.infer<typeof ChatCompletionsUserMessageSchema>;
@@ -70,7 +155,10 @@ export declare const ChatCompletionsReasoningDetailSchema: z.ZodObject<{
70
155
  export type ChatCompletionsReasoningDetail = z.infer<typeof ChatCompletionsReasoningDetailSchema>;
71
156
  export declare const ChatCompletionsAssistantMessageSchema: z.ZodObject<{
72
157
  role: z.ZodLiteral<"assistant">;
73
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
158
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
159
+ type: z.ZodLiteral<"text">;
160
+ text: z.ZodString;
161
+ }, z.core.$strip>>]>>;
74
162
  name: z.ZodOptional<z.ZodString>;
75
163
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
164
  type: z.ZodLiteral<"function">;
@@ -79,7 +167,7 @@ export declare const ChatCompletionsAssistantMessageSchema: z.ZodObject<{
79
167
  arguments: z.ZodString;
80
168
  name: z.ZodString;
81
169
  }, z.core.$strip>;
82
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
170
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
83
171
  }, z.core.$strip>>>;
84
172
  reasoning_content: z.ZodOptional<z.ZodString>;
85
173
  reasoning_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -92,29 +180,36 @@ export declare const ChatCompletionsAssistantMessageSchema: z.ZodObject<{
92
180
  summary: z.ZodOptional<z.ZodString>;
93
181
  format: z.ZodOptional<z.ZodString>;
94
182
  }, z.core.$strip>>>;
95
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
183
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
96
184
  }, z.core.$strip>;
97
185
  export type ChatCompletionsAssistantMessage = z.infer<typeof ChatCompletionsAssistantMessageSchema>;
98
186
  export declare const ChatCompletionsToolMessageSchema: z.ZodObject<{
99
187
  role: z.ZodLiteral<"tool">;
100
- content: z.ZodString;
188
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
189
+ type: z.ZodLiteral<"text">;
190
+ text: z.ZodString;
191
+ }, z.core.$strip>>]>;
101
192
  tool_call_id: z.ZodString;
102
193
  }, z.core.$strip>;
103
194
  export type ChatCompletionsToolMessage = z.infer<typeof ChatCompletionsToolMessageSchema>;
104
- export declare const ChatCompletionsMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
195
+ export declare const ChatCompletionsMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
105
196
  role: z.ZodLiteral<"system">;
106
197
  content: z.ZodString;
107
198
  name: z.ZodOptional<z.ZodString>;
108
199
  }, z.core.$strip>, z.ZodObject<{
109
200
  role: z.ZodLiteral<"user">;
110
- content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
201
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
111
202
  type: z.ZodLiteral<"text">;
112
203
  text: z.ZodString;
113
204
  }, z.core.$strip>, z.ZodObject<{
114
205
  type: z.ZodLiteral<"image_url">;
115
206
  image_url: z.ZodObject<{
116
207
  url: z.ZodString;
117
- detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
208
+ detail: z.ZodOptional<z.ZodEnum<{
209
+ low: "low";
210
+ high: "high";
211
+ auto: "auto";
212
+ }>>;
118
213
  }, z.core.$strip>;
119
214
  }, z.core.$strip>, z.ZodObject<{
120
215
  type: z.ZodLiteral<"file">;
@@ -123,11 +218,32 @@ export declare const ChatCompletionsMessageSchema: z.ZodUnion<readonly [z.ZodObj
123
218
  media_type: z.ZodString;
124
219
  filename: z.ZodOptional<z.ZodString>;
125
220
  }, z.core.$strip>;
126
- }, z.core.$strip>]>>]>;
221
+ }, z.core.$strip>, z.ZodObject<{
222
+ type: z.ZodLiteral<"input_audio">;
223
+ input_audio: z.ZodObject<{
224
+ data: z.ZodString;
225
+ format: z.ZodEnum<{
226
+ "x-aac": "x-aac";
227
+ flac: "flac";
228
+ mp3: "mp3";
229
+ m4a: "m4a";
230
+ mpeg: "mpeg";
231
+ mpga: "mpga";
232
+ mp4: "mp4";
233
+ ogg: "ogg";
234
+ pcm: "pcm";
235
+ wav: "wav";
236
+ webm: "webm";
237
+ }>;
238
+ }, z.core.$strip>;
239
+ }, z.core.$strip>], "type">>]>;
127
240
  name: z.ZodOptional<z.ZodString>;
128
241
  }, z.core.$strip>, z.ZodObject<{
129
242
  role: z.ZodLiteral<"assistant">;
130
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
243
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
244
+ type: z.ZodLiteral<"text">;
245
+ text: z.ZodString;
246
+ }, z.core.$strip>>]>>;
131
247
  name: z.ZodOptional<z.ZodString>;
132
248
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
133
249
  type: z.ZodLiteral<"function">;
@@ -136,7 +252,7 @@ export declare const ChatCompletionsMessageSchema: z.ZodUnion<readonly [z.ZodObj
136
252
  arguments: z.ZodString;
137
253
  name: z.ZodString;
138
254
  }, z.core.$strip>;
139
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
255
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
140
256
  }, z.core.$strip>>>;
141
257
  reasoning_content: z.ZodOptional<z.ZodString>;
142
258
  reasoning_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -149,53 +265,105 @@ export declare const ChatCompletionsMessageSchema: z.ZodUnion<readonly [z.ZodObj
149
265
  summary: z.ZodOptional<z.ZodString>;
150
266
  format: z.ZodOptional<z.ZodString>;
151
267
  }, z.core.$strip>>>;
152
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
268
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
153
269
  }, z.core.$strip>, z.ZodObject<{
154
270
  role: z.ZodLiteral<"tool">;
155
- content: z.ZodString;
271
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
272
+ type: z.ZodLiteral<"text">;
273
+ text: z.ZodString;
274
+ }, z.core.$strip>>]>;
156
275
  tool_call_id: z.ZodString;
157
- }, z.core.$strip>]>;
276
+ }, z.core.$strip>], "role">;
158
277
  export type ChatCompletionsMessage = z.infer<typeof ChatCompletionsMessageSchema>;
159
278
  export declare const ChatCompletionsToolSchema: z.ZodObject<{
160
279
  type: z.ZodLiteral<"function">;
161
280
  function: z.ZodObject<{
162
281
  name: z.ZodString;
163
282
  description: z.ZodOptional<z.ZodString>;
164
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
283
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
165
284
  }, z.core.$strip>;
166
285
  }, z.core.$strip>;
167
286
  export type ChatCompletionsTool = z.infer<typeof ChatCompletionsToolSchema>;
168
- export declare const ChatCompletionsToolChoiceSchema: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"auto">, z.ZodLiteral<"required">, z.ZodObject<{
287
+ export declare const ChatCompletionsToolChoiceSchema: z.ZodUnion<readonly [z.ZodEnum<{
288
+ auto: "auto";
289
+ none: "none";
290
+ required: "required";
291
+ validated: "validated";
292
+ }>, z.ZodObject<{
169
293
  type: z.ZodLiteral<"function">;
170
294
  function: z.ZodObject<{
171
295
  name: z.ZodString;
172
296
  }, z.core.$strip>;
173
297
  }, z.core.$strip>]>;
174
298
  export type ChatCompletionsToolChoice = z.infer<typeof ChatCompletionsToolChoiceSchema>;
175
- export declare const ChatCompletionsReasoningEffortSchema: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>;
299
+ export declare const ChatCompletionsReasoningEffortSchema: z.ZodEnum<{
300
+ low: "low";
301
+ high: "high";
302
+ none: "none";
303
+ minimal: "minimal";
304
+ medium: "medium";
305
+ xhigh: "xhigh";
306
+ max: "max";
307
+ }>;
176
308
  export type ChatCompletionsReasoningEffort = z.infer<typeof ChatCompletionsReasoningEffortSchema>;
177
309
  export declare const ChatCompletionsReasoningConfigSchema: z.ZodObject<{
178
310
  enabled: z.ZodOptional<z.ZodBoolean>;
179
- effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
311
+ effort: z.ZodOptional<z.ZodEnum<{
312
+ low: "low";
313
+ high: "high";
314
+ none: "none";
315
+ minimal: "minimal";
316
+ medium: "medium";
317
+ xhigh: "xhigh";
318
+ max: "max";
319
+ }>>;
180
320
  max_tokens: z.ZodOptional<z.ZodNumber>;
181
321
  exclude: z.ZodOptional<z.ZodBoolean>;
182
322
  }, z.core.$strip>;
183
323
  export type ChatCompletionsReasoningConfig = z.infer<typeof ChatCompletionsReasoningConfigSchema>;
324
+ export declare const ChatCompletionsResponseFormatJsonSchema: z.ZodObject<{
325
+ type: z.ZodLiteral<"json_schema">;
326
+ json_schema: z.ZodObject<{
327
+ name: z.ZodString;
328
+ description: z.ZodOptional<z.ZodString>;
329
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
330
+ strict: z.ZodOptional<z.ZodBoolean>;
331
+ }, z.core.$strip>;
332
+ }, z.core.$strip>;
333
+ export declare const ChatCompletionsResponseFormatTextSchema: z.ZodObject<{
334
+ type: z.ZodLiteral<"text">;
335
+ }, z.core.$strip>;
336
+ export declare const ChatCompletionsResponseFormatSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
337
+ type: z.ZodLiteral<"json_schema">;
338
+ json_schema: z.ZodObject<{
339
+ name: z.ZodString;
340
+ description: z.ZodOptional<z.ZodString>;
341
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
342
+ strict: z.ZodOptional<z.ZodBoolean>;
343
+ }, z.core.$strip>;
344
+ }, z.core.$strip>, z.ZodObject<{
345
+ type: z.ZodLiteral<"text">;
346
+ }, z.core.$strip>], "type">;
347
+ export type ChatCompletionsResponseFormat = z.infer<typeof ChatCompletionsResponseFormatSchema>;
184
348
  declare const ChatCompletionsInputsSchema: z.ZodObject<{
185
- messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
349
+ messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
186
350
  role: z.ZodLiteral<"system">;
187
351
  content: z.ZodString;
188
352
  name: z.ZodOptional<z.ZodString>;
189
353
  }, z.core.$strip>, z.ZodObject<{
190
354
  role: z.ZodLiteral<"user">;
191
- content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
355
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
192
356
  type: z.ZodLiteral<"text">;
193
357
  text: z.ZodString;
194
358
  }, z.core.$strip>, z.ZodObject<{
195
359
  type: z.ZodLiteral<"image_url">;
196
360
  image_url: z.ZodObject<{
197
361
  url: z.ZodString;
198
- detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
362
+ detail: z.ZodOptional<z.ZodEnum<{
363
+ low: "low";
364
+ high: "high";
365
+ auto: "auto";
366
+ }>>;
199
367
  }, z.core.$strip>;
200
368
  }, z.core.$strip>, z.ZodObject<{
201
369
  type: z.ZodLiteral<"file">;
@@ -204,11 +372,32 @@ declare const ChatCompletionsInputsSchema: z.ZodObject<{
204
372
  media_type: z.ZodString;
205
373
  filename: z.ZodOptional<z.ZodString>;
206
374
  }, z.core.$strip>;
207
- }, z.core.$strip>]>>]>;
375
+ }, z.core.$strip>, z.ZodObject<{
376
+ type: z.ZodLiteral<"input_audio">;
377
+ input_audio: z.ZodObject<{
378
+ data: z.ZodString;
379
+ format: z.ZodEnum<{
380
+ "x-aac": "x-aac";
381
+ flac: "flac";
382
+ mp3: "mp3";
383
+ m4a: "m4a";
384
+ mpeg: "mpeg";
385
+ mpga: "mpga";
386
+ mp4: "mp4";
387
+ ogg: "ogg";
388
+ pcm: "pcm";
389
+ wav: "wav";
390
+ webm: "webm";
391
+ }>;
392
+ }, z.core.$strip>;
393
+ }, z.core.$strip>], "type">>]>;
208
394
  name: z.ZodOptional<z.ZodString>;
209
395
  }, z.core.$strip>, z.ZodObject<{
210
396
  role: z.ZodLiteral<"assistant">;
211
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
397
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
398
+ type: z.ZodLiteral<"text">;
399
+ text: z.ZodString;
400
+ }, z.core.$strip>>]>>;
212
401
  name: z.ZodOptional<z.ZodString>;
213
402
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
214
403
  type: z.ZodLiteral<"function">;
@@ -217,7 +406,7 @@ declare const ChatCompletionsInputsSchema: z.ZodObject<{
217
406
  arguments: z.ZodString;
218
407
  name: z.ZodString;
219
408
  }, z.core.$strip>;
220
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
409
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
221
410
  }, z.core.$strip>>>;
222
411
  reasoning_content: z.ZodOptional<z.ZodString>;
223
412
  reasoning_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -230,21 +419,29 @@ declare const ChatCompletionsInputsSchema: z.ZodObject<{
230
419
  summary: z.ZodOptional<z.ZodString>;
231
420
  format: z.ZodOptional<z.ZodString>;
232
421
  }, z.core.$strip>>>;
233
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
422
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
234
423
  }, z.core.$strip>, z.ZodObject<{
235
424
  role: z.ZodLiteral<"tool">;
236
- content: z.ZodString;
425
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
426
+ type: z.ZodLiteral<"text">;
427
+ text: z.ZodString;
428
+ }, z.core.$strip>>]>;
237
429
  tool_call_id: z.ZodString;
238
- }, z.core.$strip>]>>;
430
+ }, z.core.$strip>], "role">>;
239
431
  tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
240
432
  type: z.ZodLiteral<"function">;
241
433
  function: z.ZodObject<{
242
434
  name: z.ZodString;
243
435
  description: z.ZodOptional<z.ZodString>;
244
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
436
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
245
437
  }, z.core.$strip>;
246
438
  }, z.core.$strip>>>;
247
- tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"auto">, z.ZodLiteral<"required">, z.ZodObject<{
439
+ tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
440
+ auto: "auto";
441
+ none: "none";
442
+ required: "required";
443
+ validated: "validated";
444
+ }>, z.ZodObject<{
248
445
  type: z.ZodLiteral<"function">;
249
446
  function: z.ZodObject<{
250
447
  name: z.ZodString;
@@ -258,30 +455,61 @@ declare const ChatCompletionsInputsSchema: z.ZodObject<{
258
455
  seed: z.ZodOptional<z.ZodInt>;
259
456
  stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
260
457
  top_p: z.ZodOptional<z.ZodNumber>;
261
- reasoning_effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
458
+ response_format: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
459
+ type: z.ZodLiteral<"json_schema">;
460
+ json_schema: z.ZodObject<{
461
+ name: z.ZodString;
462
+ description: z.ZodOptional<z.ZodString>;
463
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
464
+ strict: z.ZodOptional<z.ZodBoolean>;
465
+ }, z.core.$strip>;
466
+ }, z.core.$strip>, z.ZodObject<{
467
+ type: z.ZodLiteral<"text">;
468
+ }, z.core.$strip>], "type">>;
469
+ reasoning_effort: z.ZodOptional<z.ZodEnum<{
470
+ low: "low";
471
+ high: "high";
472
+ none: "none";
473
+ minimal: "minimal";
474
+ medium: "medium";
475
+ xhigh: "xhigh";
476
+ max: "max";
477
+ }>>;
262
478
  reasoning: z.ZodOptional<z.ZodObject<{
263
479
  enabled: z.ZodOptional<z.ZodBoolean>;
264
- effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
480
+ effort: z.ZodOptional<z.ZodEnum<{
481
+ low: "low";
482
+ high: "high";
483
+ none: "none";
484
+ minimal: "minimal";
485
+ medium: "medium";
486
+ xhigh: "xhigh";
487
+ max: "max";
488
+ }>>;
265
489
  max_tokens: z.ZodOptional<z.ZodNumber>;
266
490
  exclude: z.ZodOptional<z.ZodBoolean>;
267
491
  }, z.core.$strip>>;
268
492
  }, z.core.$strip>;
269
493
  export type ChatCompletionsInputs = z.infer<typeof ChatCompletionsInputsSchema>;
270
494
  export declare const ChatCompletionsBodySchema: z.ZodObject<{
271
- messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
495
+ messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
272
496
  role: z.ZodLiteral<"system">;
273
497
  content: z.ZodString;
274
498
  name: z.ZodOptional<z.ZodString>;
275
499
  }, z.core.$strip>, z.ZodObject<{
276
500
  role: z.ZodLiteral<"user">;
277
- content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
501
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
278
502
  type: z.ZodLiteral<"text">;
279
503
  text: z.ZodString;
280
504
  }, z.core.$strip>, z.ZodObject<{
281
505
  type: z.ZodLiteral<"image_url">;
282
506
  image_url: z.ZodObject<{
283
507
  url: z.ZodString;
284
- detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
508
+ detail: z.ZodOptional<z.ZodEnum<{
509
+ low: "low";
510
+ high: "high";
511
+ auto: "auto";
512
+ }>>;
285
513
  }, z.core.$strip>;
286
514
  }, z.core.$strip>, z.ZodObject<{
287
515
  type: z.ZodLiteral<"file">;
@@ -290,11 +518,32 @@ export declare const ChatCompletionsBodySchema: z.ZodObject<{
290
518
  media_type: z.ZodString;
291
519
  filename: z.ZodOptional<z.ZodString>;
292
520
  }, z.core.$strip>;
293
- }, z.core.$strip>]>>]>;
521
+ }, z.core.$strip>, z.ZodObject<{
522
+ type: z.ZodLiteral<"input_audio">;
523
+ input_audio: z.ZodObject<{
524
+ data: z.ZodString;
525
+ format: z.ZodEnum<{
526
+ "x-aac": "x-aac";
527
+ flac: "flac";
528
+ mp3: "mp3";
529
+ m4a: "m4a";
530
+ mpeg: "mpeg";
531
+ mpga: "mpga";
532
+ mp4: "mp4";
533
+ ogg: "ogg";
534
+ pcm: "pcm";
535
+ wav: "wav";
536
+ webm: "webm";
537
+ }>;
538
+ }, z.core.$strip>;
539
+ }, z.core.$strip>], "type">>]>;
294
540
  name: z.ZodOptional<z.ZodString>;
295
541
  }, z.core.$strip>, z.ZodObject<{
296
542
  role: z.ZodLiteral<"assistant">;
297
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
543
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
544
+ type: z.ZodLiteral<"text">;
545
+ text: z.ZodString;
546
+ }, z.core.$strip>>]>>;
298
547
  name: z.ZodOptional<z.ZodString>;
299
548
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
300
549
  type: z.ZodLiteral<"function">;
@@ -303,7 +552,7 @@ export declare const ChatCompletionsBodySchema: z.ZodObject<{
303
552
  arguments: z.ZodString;
304
553
  name: z.ZodString;
305
554
  }, z.core.$strip>;
306
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
555
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
307
556
  }, z.core.$strip>>>;
308
557
  reasoning_content: z.ZodOptional<z.ZodString>;
309
558
  reasoning_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -316,21 +565,29 @@ export declare const ChatCompletionsBodySchema: z.ZodObject<{
316
565
  summary: z.ZodOptional<z.ZodString>;
317
566
  format: z.ZodOptional<z.ZodString>;
318
567
  }, z.core.$strip>>>;
319
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
568
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
320
569
  }, z.core.$strip>, z.ZodObject<{
321
570
  role: z.ZodLiteral<"tool">;
322
- content: z.ZodString;
571
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
572
+ type: z.ZodLiteral<"text">;
573
+ text: z.ZodString;
574
+ }, z.core.$strip>>]>;
323
575
  tool_call_id: z.ZodString;
324
- }, z.core.$strip>]>>;
576
+ }, z.core.$strip>], "role">>;
325
577
  tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
326
578
  type: z.ZodLiteral<"function">;
327
579
  function: z.ZodObject<{
328
580
  name: z.ZodString;
329
581
  description: z.ZodOptional<z.ZodString>;
330
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
582
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
331
583
  }, z.core.$strip>;
332
584
  }, z.core.$strip>>>;
333
- tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"auto">, z.ZodLiteral<"required">, z.ZodObject<{
585
+ tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
586
+ auto: "auto";
587
+ none: "none";
588
+ required: "required";
589
+ validated: "validated";
590
+ }>, z.ZodObject<{
334
591
  type: z.ZodLiteral<"function">;
335
592
  function: z.ZodObject<{
336
593
  name: z.ZodString;
@@ -344,10 +601,37 @@ export declare const ChatCompletionsBodySchema: z.ZodObject<{
344
601
  seed: z.ZodOptional<z.ZodInt>;
345
602
  stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
346
603
  top_p: z.ZodOptional<z.ZodNumber>;
347
- reasoning_effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
604
+ response_format: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
605
+ type: z.ZodLiteral<"json_schema">;
606
+ json_schema: z.ZodObject<{
607
+ name: z.ZodString;
608
+ description: z.ZodOptional<z.ZodString>;
609
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
610
+ strict: z.ZodOptional<z.ZodBoolean>;
611
+ }, z.core.$strip>;
612
+ }, z.core.$strip>, z.ZodObject<{
613
+ type: z.ZodLiteral<"text">;
614
+ }, z.core.$strip>], "type">>;
615
+ reasoning_effort: z.ZodOptional<z.ZodEnum<{
616
+ low: "low";
617
+ high: "high";
618
+ none: "none";
619
+ minimal: "minimal";
620
+ medium: "medium";
621
+ xhigh: "xhigh";
622
+ max: "max";
623
+ }>>;
348
624
  reasoning: z.ZodOptional<z.ZodObject<{
349
625
  enabled: z.ZodOptional<z.ZodBoolean>;
350
- effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
626
+ effort: z.ZodOptional<z.ZodEnum<{
627
+ low: "low";
628
+ high: "high";
629
+ none: "none";
630
+ minimal: "minimal";
631
+ medium: "medium";
632
+ xhigh: "xhigh";
633
+ max: "max";
634
+ }>>;
351
635
  max_tokens: z.ZodOptional<z.ZodNumber>;
352
636
  exclude: z.ZodOptional<z.ZodBoolean>;
353
637
  }, z.core.$strip>>;
@@ -355,13 +639,21 @@ export declare const ChatCompletionsBodySchema: z.ZodObject<{
355
639
  stream: z.ZodOptional<z.ZodBoolean>;
356
640
  }, z.core.$loose>;
357
641
  export type ChatCompletionsBody = z.infer<typeof ChatCompletionsBodySchema>;
358
- export declare const ChatCompletionsFinishReasonSchema: z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>;
642
+ export declare const ChatCompletionsFinishReasonSchema: z.ZodEnum<{
643
+ tool_calls: "tool_calls";
644
+ stop: "stop";
645
+ length: "length";
646
+ content_filter: "content_filter";
647
+ }>;
359
648
  export type ChatCompletionsFinishReason = z.infer<typeof ChatCompletionsFinishReasonSchema>;
360
649
  export declare const ChatCompletionsChoiceSchema: z.ZodObject<{
361
650
  index: z.ZodInt;
362
651
  message: z.ZodObject<{
363
652
  role: z.ZodLiteral<"assistant">;
364
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
653
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
654
+ type: z.ZodLiteral<"text">;
655
+ text: z.ZodString;
656
+ }, z.core.$strip>>]>>;
365
657
  name: z.ZodOptional<z.ZodString>;
366
658
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
367
659
  type: z.ZodLiteral<"function">;
@@ -370,7 +662,7 @@ export declare const ChatCompletionsChoiceSchema: z.ZodObject<{
370
662
  arguments: z.ZodString;
371
663
  name: z.ZodString;
372
664
  }, z.core.$strip>;
373
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
665
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
374
666
  }, z.core.$strip>>>;
375
667
  reasoning_content: z.ZodOptional<z.ZodString>;
376
668
  reasoning_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -383,10 +675,15 @@ export declare const ChatCompletionsChoiceSchema: z.ZodObject<{
383
675
  summary: z.ZodOptional<z.ZodString>;
384
676
  format: z.ZodOptional<z.ZodString>;
385
677
  }, z.core.$strip>>>;
386
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
678
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
387
679
  }, z.core.$strip>;
388
- finish_reason: z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>;
389
- logprobs: z.ZodOptional<z.ZodAny>;
680
+ finish_reason: z.ZodEnum<{
681
+ tool_calls: "tool_calls";
682
+ stop: "stop";
683
+ length: "length";
684
+ content_filter: "content_filter";
685
+ }>;
686
+ logprobs: z.ZodOptional<z.ZodUnknown>;
390
687
  }, z.core.$strip>;
391
688
  export type ChatCompletionsChoice = z.infer<typeof ChatCompletionsChoiceSchema>;
392
689
  export declare const ChatCompletionsUsageSchema: z.ZodObject<{
@@ -410,7 +707,10 @@ export declare const ChatCompletionsSchema: z.ZodObject<{
410
707
  index: z.ZodInt;
411
708
  message: z.ZodObject<{
412
709
  role: z.ZodLiteral<"assistant">;
413
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
710
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
711
+ type: z.ZodLiteral<"text">;
712
+ text: z.ZodString;
713
+ }, z.core.$strip>>]>>;
414
714
  name: z.ZodOptional<z.ZodString>;
415
715
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
416
716
  type: z.ZodLiteral<"function">;
@@ -419,7 +719,7 @@ export declare const ChatCompletionsSchema: z.ZodObject<{
419
719
  arguments: z.ZodString;
420
720
  name: z.ZodString;
421
721
  }, z.core.$strip>;
422
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
722
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
423
723
  }, z.core.$strip>>>;
424
724
  reasoning_content: z.ZodOptional<z.ZodString>;
425
725
  reasoning_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -432,10 +732,15 @@ export declare const ChatCompletionsSchema: z.ZodObject<{
432
732
  summary: z.ZodOptional<z.ZodString>;
433
733
  format: z.ZodOptional<z.ZodString>;
434
734
  }, z.core.$strip>>>;
435
- extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
735
+ extra_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
436
736
  }, z.core.$strip>;
437
- finish_reason: z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>;
438
- logprobs: z.ZodOptional<z.ZodAny>;
737
+ finish_reason: z.ZodEnum<{
738
+ tool_calls: "tool_calls";
739
+ stop: "stop";
740
+ length: "length";
741
+ content_filter: "content_filter";
742
+ }>;
743
+ logprobs: z.ZodOptional<z.ZodUnknown>;
439
744
  }, z.core.$strip>>;
440
745
  usage: z.ZodNullable<z.ZodObject<{
441
746
  prompt_tokens: z.ZodOptional<z.ZodInt>;
@@ -448,7 +753,7 @@ export declare const ChatCompletionsSchema: z.ZodObject<{
448
753
  cached_tokens: z.ZodOptional<z.ZodInt>;
449
754
  }, z.core.$strip>>;
450
755
  }, z.core.$strip>>;
451
- provider_metadata: z.ZodOptional<z.ZodAny>;
756
+ provider_metadata: z.ZodOptional<z.ZodUnknown>;
452
757
  }, z.core.$strip>;
453
758
  export type ChatCompletions = z.infer<typeof ChatCompletionsSchema>;
454
759
  export declare const ChatCompletionsToolCallDeltaSchema: z.ZodObject<{
@@ -458,13 +763,16 @@ export declare const ChatCompletionsToolCallDeltaSchema: z.ZodObject<{
458
763
  arguments: z.ZodString;
459
764
  name: z.ZodString;
460
765
  }, z.core.$strip>>;
461
- extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
766
+ extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
462
767
  index: z.ZodInt;
463
768
  }, z.core.$strip>;
464
769
  export type ChatCompletionsToolCallDelta = z.infer<typeof ChatCompletionsToolCallDeltaSchema>;
465
770
  export declare const ChatCompletionsAssistantMessageDeltaSchema: z.ZodObject<{
466
771
  role: z.ZodOptional<z.ZodLiteral<"assistant">>;
467
- content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>>;
772
+ content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
773
+ type: z.ZodLiteral<"text">;
774
+ text: z.ZodString;
775
+ }, z.core.$strip>>]>>>;
468
776
  name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
469
777
  reasoning_content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
470
778
  reasoning_details: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -477,7 +785,7 @@ export declare const ChatCompletionsAssistantMessageDeltaSchema: z.ZodObject<{
477
785
  summary: z.ZodOptional<z.ZodString>;
478
786
  format: z.ZodOptional<z.ZodString>;
479
787
  }, z.core.$strip>>>>;
480
- extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
788
+ extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
481
789
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
482
790
  type: z.ZodOptional<z.ZodLiteral<"function">>;
483
791
  id: z.ZodOptional<z.ZodString>;
@@ -485,7 +793,7 @@ export declare const ChatCompletionsAssistantMessageDeltaSchema: z.ZodObject<{
485
793
  arguments: z.ZodString;
486
794
  name: z.ZodString;
487
795
  }, z.core.$strip>>;
488
- extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
796
+ extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
489
797
  index: z.ZodInt;
490
798
  }, z.core.$strip>>>;
491
799
  }, z.core.$strip>;
@@ -494,7 +802,10 @@ export declare const ChatCompletionsChoiceDeltaSchema: z.ZodObject<{
494
802
  index: z.ZodInt;
495
803
  delta: z.ZodObject<{
496
804
  role: z.ZodOptional<z.ZodLiteral<"assistant">>;
497
- content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>>;
805
+ content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
806
+ type: z.ZodLiteral<"text">;
807
+ text: z.ZodString;
808
+ }, z.core.$strip>>]>>>;
498
809
  name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
499
810
  reasoning_content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
500
811
  reasoning_details: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -507,7 +818,7 @@ export declare const ChatCompletionsChoiceDeltaSchema: z.ZodObject<{
507
818
  summary: z.ZodOptional<z.ZodString>;
508
819
  format: z.ZodOptional<z.ZodString>;
509
820
  }, z.core.$strip>>>>;
510
- extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
821
+ extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
511
822
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
512
823
  type: z.ZodOptional<z.ZodLiteral<"function">>;
513
824
  id: z.ZodOptional<z.ZodString>;
@@ -515,12 +826,17 @@ export declare const ChatCompletionsChoiceDeltaSchema: z.ZodObject<{
515
826
  arguments: z.ZodString;
516
827
  name: z.ZodString;
517
828
  }, z.core.$strip>>;
518
- extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
829
+ extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
519
830
  index: z.ZodInt;
520
831
  }, z.core.$strip>>>;
521
832
  }, z.core.$strip>;
522
- finish_reason: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>>;
523
- logprobs: z.ZodOptional<z.ZodAny>;
833
+ finish_reason: z.ZodNullable<z.ZodEnum<{
834
+ tool_calls: "tool_calls";
835
+ stop: "stop";
836
+ length: "length";
837
+ content_filter: "content_filter";
838
+ }>>;
839
+ logprobs: z.ZodOptional<z.ZodUnknown>;
524
840
  }, z.core.$strip>;
525
841
  export type ChatCompletionsChoiceDelta = z.infer<typeof ChatCompletionsChoiceDeltaSchema>;
526
842
  export declare const ChatCompletionsChunkSchema: z.ZodObject<{
@@ -532,7 +848,10 @@ export declare const ChatCompletionsChunkSchema: z.ZodObject<{
532
848
  index: z.ZodInt;
533
849
  delta: z.ZodObject<{
534
850
  role: z.ZodOptional<z.ZodLiteral<"assistant">>;
535
- content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>>;
851
+ content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
852
+ type: z.ZodLiteral<"text">;
853
+ text: z.ZodString;
854
+ }, z.core.$strip>>]>>>;
536
855
  name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
537
856
  reasoning_content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
538
857
  reasoning_details: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -545,7 +864,7 @@ export declare const ChatCompletionsChunkSchema: z.ZodObject<{
545
864
  summary: z.ZodOptional<z.ZodString>;
546
865
  format: z.ZodOptional<z.ZodString>;
547
866
  }, z.core.$strip>>>>;
548
- extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
867
+ extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
549
868
  tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
550
869
  type: z.ZodOptional<z.ZodLiteral<"function">>;
551
870
  id: z.ZodOptional<z.ZodString>;
@@ -553,12 +872,17 @@ export declare const ChatCompletionsChunkSchema: z.ZodObject<{
553
872
  arguments: z.ZodString;
554
873
  name: z.ZodString;
555
874
  }, z.core.$strip>>;
556
- extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
875
+ extra_content: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
557
876
  index: z.ZodInt;
558
877
  }, z.core.$strip>>>;
559
878
  }, z.core.$strip>;
560
- finish_reason: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>>;
561
- logprobs: z.ZodOptional<z.ZodAny>;
879
+ finish_reason: z.ZodNullable<z.ZodEnum<{
880
+ tool_calls: "tool_calls";
881
+ stop: "stop";
882
+ length: "length";
883
+ content_filter: "content_filter";
884
+ }>>;
885
+ logprobs: z.ZodOptional<z.ZodUnknown>;
562
886
  }, z.core.$strip>>;
563
887
  usage: z.ZodNullable<z.ZodObject<{
564
888
  prompt_tokens: z.ZodOptional<z.ZodInt>;
@@ -571,7 +895,7 @@ export declare const ChatCompletionsChunkSchema: z.ZodObject<{
571
895
  cached_tokens: z.ZodOptional<z.ZodInt>;
572
896
  }, z.core.$strip>>;
573
897
  }, z.core.$strip>>;
574
- provider_metadata: z.ZodOptional<z.ZodAny>;
898
+ provider_metadata: z.ZodOptional<z.ZodUnknown>;
575
899
  }, z.core.$strip>;
576
900
  export type ChatCompletionsChunk = z.infer<typeof ChatCompletionsChunkSchema>;
577
901
  export {};