@effect/ai-openai 4.0.0-beta.8 → 4.0.0-beta.80

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 (58) hide show
  1. package/dist/Generated.d.ts +66675 -37672
  2. package/dist/Generated.d.ts.map +1 -1
  3. package/dist/Generated.js +1 -1
  4. package/dist/Generated.js.map +1 -1
  5. package/dist/OpenAiClient.d.ts +170 -29
  6. package/dist/OpenAiClient.d.ts.map +1 -1
  7. package/dist/OpenAiClient.js +321 -46
  8. package/dist/OpenAiClient.js.map +1 -1
  9. package/dist/OpenAiClientGenerated.d.ts +91 -0
  10. package/dist/OpenAiClientGenerated.d.ts.map +1 -0
  11. package/dist/OpenAiClientGenerated.js +84 -0
  12. package/dist/OpenAiClientGenerated.js.map +1 -0
  13. package/dist/OpenAiConfig.d.ts +88 -10
  14. package/dist/OpenAiConfig.d.ts.map +1 -1
  15. package/dist/OpenAiConfig.js +42 -7
  16. package/dist/OpenAiConfig.js.map +1 -1
  17. package/dist/OpenAiEmbeddingModel.d.ts +188 -0
  18. package/dist/OpenAiEmbeddingModel.d.ts.map +1 -0
  19. package/dist/OpenAiEmbeddingModel.js +194 -0
  20. package/dist/OpenAiEmbeddingModel.js.map +1 -0
  21. package/dist/OpenAiError.d.ts +168 -35
  22. package/dist/OpenAiError.d.ts.map +1 -1
  23. package/dist/OpenAiError.js +1 -1
  24. package/dist/OpenAiLanguageModel.d.ts +357 -63
  25. package/dist/OpenAiLanguageModel.d.ts.map +1 -1
  26. package/dist/OpenAiLanguageModel.js +390 -168
  27. package/dist/OpenAiLanguageModel.js.map +1 -1
  28. package/dist/OpenAiSchema.d.ts +2325 -0
  29. package/dist/OpenAiSchema.d.ts.map +1 -0
  30. package/dist/OpenAiSchema.js +811 -0
  31. package/dist/OpenAiSchema.js.map +1 -0
  32. package/dist/OpenAiTelemetry.d.ts +63 -22
  33. package/dist/OpenAiTelemetry.d.ts.map +1 -1
  34. package/dist/OpenAiTelemetry.js +20 -10
  35. package/dist/OpenAiTelemetry.js.map +1 -1
  36. package/dist/OpenAiTool.d.ts +148 -62
  37. package/dist/OpenAiTool.d.ts.map +1 -1
  38. package/dist/OpenAiTool.js +125 -39
  39. package/dist/OpenAiTool.js.map +1 -1
  40. package/dist/index.d.ts +19 -33
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +19 -33
  43. package/dist/index.js.map +1 -1
  44. package/dist/internal/errors.js +4 -4
  45. package/dist/internal/errors.js.map +1 -1
  46. package/package.json +3 -3
  47. package/src/Generated.ts +9717 -4887
  48. package/src/OpenAiClient.ts +499 -98
  49. package/src/OpenAiClientGenerated.ts +202 -0
  50. package/src/OpenAiConfig.ts +89 -11
  51. package/src/OpenAiEmbeddingModel.ts +332 -0
  52. package/src/OpenAiError.ts +170 -35
  53. package/src/OpenAiLanguageModel.ts +776 -169
  54. package/src/OpenAiSchema.ts +1286 -0
  55. package/src/OpenAiTelemetry.ts +69 -28
  56. package/src/OpenAiTool.ts +126 -40
  57. package/src/index.ts +22 -33
  58. package/src/internal/errors.ts +6 -4
@@ -0,0 +1,2325 @@
1
+ import * as Schema from "effect/Schema";
2
+ /**
3
+ * Schema for optional `include` values supported by the local handwritten
4
+ * Responses client schema.
5
+ *
6
+ * **Details**
7
+ *
8
+ * These values request additional response fields such as image URLs, encrypted
9
+ * reasoning content, output logprobs, code interpreter outputs, or web search
10
+ * sources. This schema enumerates the include values supported by this client
11
+ * path.
12
+ *
13
+ * @category schemas
14
+ * @since 4.0.0
15
+ */
16
+ export declare const IncludeEnum: Schema.Literals<readonly ["message.input_image.image_url", "reasoning.encrypted_content", "message.output_text.logprobs", "code_interpreter_call.outputs", "web_search_call.action.sources"]>;
17
+ /**
18
+ * Type of optional `include` values accepted by OpenAI Responses requests.
19
+ *
20
+ * @category models
21
+ * @since 4.0.0
22
+ */
23
+ export type IncludeEnum = typeof IncludeEnum.Type;
24
+ /**
25
+ * Schema for lifecycle statuses shared by messages, reasoning items, and tool calls.
26
+ *
27
+ * **Details**
28
+ *
29
+ * Accepted values are `"in_progress"`, `"completed"`, and `"incomplete"`.
30
+ * This item-level status is used by message, reasoning, and tool-call shapes.
31
+ *
32
+ * @category schemas
33
+ * @since 4.0.0
34
+ */
35
+ export declare const MessageStatus: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
36
+ /**
37
+ * Lifecycle status shared by messages, reasoning items, and tool calls.
38
+ *
39
+ * **Details**
40
+ *
41
+ * Accepted values are `"in_progress"`, `"completed"`, and `"incomplete"`.
42
+ *
43
+ * @category models
44
+ * @since 4.0.0
45
+ */
46
+ export type MessageStatus = typeof MessageStatus.Type;
47
+ /**
48
+ * Schema for content blocks accepted in OpenAI Responses input messages.
49
+ *
50
+ * **Details**
51
+ *
52
+ * Accepted block variants are `input_text`, `input_image`, and `input_file`.
53
+ *
54
+ * @see {@link InputItem} for request input item shapes that can contain these content blocks
55
+ *
56
+ * @category schemas
57
+ * @since 4.0.0
58
+ */
59
+ export declare const InputContent: Schema.Union<readonly [Schema.Struct<{
60
+ readonly type: Schema.Literal<"input_text">;
61
+ readonly text: Schema.String;
62
+ }>, Schema.Struct<{
63
+ readonly type: Schema.Literal<"input_image">;
64
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
65
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
66
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
67
+ }>, Schema.Struct<{
68
+ readonly type: Schema.Literal<"input_file">;
69
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
70
+ readonly filename: Schema.optionalKey<Schema.String>;
71
+ readonly file_url: Schema.optionalKey<Schema.String>;
72
+ readonly file_data: Schema.optionalKey<Schema.String>;
73
+ }>]>;
74
+ /**
75
+ * Content block accepted in OpenAI Responses input messages.
76
+ *
77
+ * **Details**
78
+ *
79
+ * Accepted block variants are `input_text`, `input_image`, and `input_file`.
80
+ *
81
+ * @category models
82
+ * @since 4.0.0
83
+ */
84
+ export type InputContent = typeof InputContent.Type;
85
+ /**
86
+ * Schema for a text block containing a model-provided reasoning summary.
87
+ *
88
+ * **Details**
89
+ *
90
+ * The decoded shape is `type: "summary_text"` plus `text` containing the
91
+ * reasoning summary text.
92
+ *
93
+ * @see {@link ReasoningItem} for reasoning output items that contain summary text blocks
94
+ *
95
+ * @category schemas
96
+ * @since 4.0.0
97
+ */
98
+ export declare const SummaryTextContent: Schema.Struct<{
99
+ readonly type: Schema.Literal<"summary_text">;
100
+ readonly text: Schema.String;
101
+ }>;
102
+ /**
103
+ * Text content block used for model-provided reasoning summaries.
104
+ *
105
+ * @category models
106
+ * @since 4.0.0
107
+ */
108
+ export type SummaryTextContent = typeof SummaryTextContent.Type;
109
+ /**
110
+ * Schema for citation and file-path annotations attached to output text content.
111
+ *
112
+ * **Details**
113
+ *
114
+ * Accepts annotation objects discriminated by `type`: `file_citation`,
115
+ * `url_citation`, `container_file_citation`, or `file_path`.
116
+ *
117
+ * @category schemas
118
+ * @since 4.0.0
119
+ */
120
+ export declare const Annotation: Schema.Union<readonly [Schema.Struct<{
121
+ readonly type: Schema.Literal<"file_citation">;
122
+ readonly file_id: Schema.String;
123
+ readonly index: Schema.Number;
124
+ readonly filename: Schema.String;
125
+ }>, Schema.Struct<{
126
+ readonly type: Schema.Literal<"url_citation">;
127
+ readonly url: Schema.String;
128
+ readonly start_index: Schema.Number;
129
+ readonly end_index: Schema.Number;
130
+ readonly title: Schema.String;
131
+ }>, Schema.Struct<{
132
+ readonly type: Schema.Literal<"container_file_citation">;
133
+ readonly container_id: Schema.String;
134
+ readonly file_id: Schema.String;
135
+ readonly start_index: Schema.Number;
136
+ readonly end_index: Schema.Number;
137
+ readonly filename: Schema.String;
138
+ }>, Schema.Struct<{
139
+ readonly type: Schema.Literal<"file_path">;
140
+ readonly file_id: Schema.String;
141
+ readonly index: Schema.Number;
142
+ }>]>;
143
+ /**
144
+ * Citation or file-path annotation attached to output text content.
145
+ *
146
+ * **Details**
147
+ *
148
+ * Accepted annotation variants are `file_citation`, `url_citation`,
149
+ * `container_file_citation`, and `file_path`.
150
+ *
151
+ * @category models
152
+ * @since 4.0.0
153
+ */
154
+ export type Annotation = typeof Annotation.Type;
155
+ /**
156
+ * Schema for a reasoning output item containing encrypted content, summaries, and optional reasoning text.
157
+ *
158
+ * **When to use**
159
+ *
160
+ * Use when decoding or encoding OpenAI Responses reasoning items that may be
161
+ * carried into later request input.
162
+ *
163
+ * **Details**
164
+ *
165
+ * Reasoning items represent model reasoning content. `summary` is required,
166
+ * while `content` and `status` are optional.
167
+ *
168
+ * **Gotchas**
169
+ *
170
+ * `encrypted_content` is populated only when `reasoning.encrypted_content` is
171
+ * requested through `include`.
172
+ *
173
+ * @see {@link InputItem} for request input items that can carry reasoning items
174
+ * @see {@link IncludeEnum} for requesting encrypted reasoning content
175
+ *
176
+ * @category schemas
177
+ * @since 4.0.0
178
+ */
179
+ export declare const ReasoningItem: Schema.Struct<{
180
+ readonly type: Schema.Literal<"reasoning">;
181
+ readonly id: Schema.String;
182
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
183
+ readonly summary: Schema.$Array<Schema.Struct<{
184
+ readonly type: Schema.Literal<"summary_text">;
185
+ readonly text: Schema.String;
186
+ }>>;
187
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
188
+ readonly type: Schema.Literal<"reasoning_text">;
189
+ readonly text: Schema.String;
190
+ }>>>;
191
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
192
+ }>;
193
+ /**
194
+ * Reasoning output item containing encrypted content, summaries, and optional reasoning text.
195
+ *
196
+ * **When to use**
197
+ *
198
+ * Use when typing OpenAI Responses reasoning items that may be carried into
199
+ * later request input.
200
+ *
201
+ * **Details**
202
+ *
203
+ * Reasoning items represent model reasoning content. `summary` is required,
204
+ * while `content` and `status` are optional.
205
+ *
206
+ * **Gotchas**
207
+ *
208
+ * `encrypted_content` is populated only when `reasoning.encrypted_content` is
209
+ * requested through `include`.
210
+ *
211
+ * @category models
212
+ * @since 4.0.0
213
+ */
214
+ export type ReasoningItem = typeof ReasoningItem.Type;
215
+ /**
216
+ * Schema for item shapes accepted by an OpenAI Responses request `input` field.
217
+ *
218
+ * **When to use**
219
+ *
220
+ * Use when validating structured `CreateResponse.input` array items.
221
+ *
222
+ * **Details**
223
+ *
224
+ * Accepted item families include request/output messages, function call and
225
+ * function call output, reasoning items, item references, shell and local shell
226
+ * calls and outputs, apply-patch output, and MCP approval responses.
227
+ *
228
+ * @see {@link CreateResponse} for the request schema that consumes input items
229
+ * @see {@link InputContent} for content blocks inside message items
230
+ *
231
+ * @category schemas
232
+ * @since 4.0.0
233
+ */
234
+ export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
235
+ readonly type: Schema.optionalKey<Schema.Literal<"message">>;
236
+ readonly role: Schema.Literals<readonly ["system", "developer", "user", "assistant"]>;
237
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
238
+ readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
239
+ readonly type: Schema.Literal<"input_text">;
240
+ readonly text: Schema.String;
241
+ }>, Schema.Struct<{
242
+ readonly type: Schema.Literal<"input_image">;
243
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
244
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
245
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
246
+ }>, Schema.Struct<{
247
+ readonly type: Schema.Literal<"input_file">;
248
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
249
+ readonly filename: Schema.optionalKey<Schema.String>;
250
+ readonly file_url: Schema.optionalKey<Schema.String>;
251
+ readonly file_data: Schema.optionalKey<Schema.String>;
252
+ }>]>>]>;
253
+ }>, Schema.Struct<{
254
+ readonly id: Schema.String;
255
+ readonly type: Schema.Literal<"message">;
256
+ readonly role: Schema.Literal<"assistant">;
257
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
258
+ readonly type: Schema.Literal<"input_text">;
259
+ readonly text: Schema.String;
260
+ }>, Schema.Struct<{
261
+ readonly type: Schema.Literal<"output_text">;
262
+ readonly text: Schema.String;
263
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
264
+ readonly type: Schema.Literal<"file_citation">;
265
+ readonly file_id: Schema.String;
266
+ readonly index: Schema.Number;
267
+ readonly filename: Schema.String;
268
+ }>, Schema.Struct<{
269
+ readonly type: Schema.Literal<"url_citation">;
270
+ readonly url: Schema.String;
271
+ readonly start_index: Schema.Number;
272
+ readonly end_index: Schema.Number;
273
+ readonly title: Schema.String;
274
+ }>, Schema.Struct<{
275
+ readonly type: Schema.Literal<"container_file_citation">;
276
+ readonly container_id: Schema.String;
277
+ readonly file_id: Schema.String;
278
+ readonly start_index: Schema.Number;
279
+ readonly end_index: Schema.Number;
280
+ readonly filename: Schema.String;
281
+ }>, Schema.Struct<{
282
+ readonly type: Schema.Literal<"file_path">;
283
+ readonly file_id: Schema.String;
284
+ readonly index: Schema.Number;
285
+ }>]>>;
286
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
287
+ }>, Schema.Struct<{
288
+ readonly type: Schema.Literal<"text">;
289
+ readonly text: Schema.String;
290
+ }>, Schema.Struct<{
291
+ readonly type: Schema.Literal<"summary_text">;
292
+ readonly text: Schema.String;
293
+ }>, Schema.Struct<{
294
+ readonly type: Schema.Literal<"reasoning_text">;
295
+ readonly text: Schema.String;
296
+ }>, Schema.Struct<{
297
+ readonly type: Schema.Literal<"refusal">;
298
+ readonly refusal: Schema.String;
299
+ }>, Schema.Struct<{
300
+ readonly type: Schema.Literal<"input_image">;
301
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
302
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
303
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
304
+ }>, Schema.Struct<{
305
+ readonly type: Schema.Literal<"computer_screenshot">;
306
+ readonly image_url: Schema.NullOr<Schema.String>;
307
+ readonly file_id: Schema.NullOr<Schema.String>;
308
+ }>, Schema.Struct<{
309
+ readonly type: Schema.Literal<"input_file">;
310
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
311
+ readonly filename: Schema.optionalKey<Schema.String>;
312
+ readonly file_url: Schema.optionalKey<Schema.String>;
313
+ readonly file_data: Schema.optionalKey<Schema.String>;
314
+ }>]>>;
315
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
316
+ }>, Schema.Struct<{
317
+ readonly id: Schema.optionalKey<Schema.String>;
318
+ readonly type: Schema.Literal<"function_call">;
319
+ readonly call_id: Schema.String;
320
+ readonly name: Schema.String;
321
+ readonly arguments: Schema.String;
322
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
323
+ }>, Schema.Struct<{
324
+ readonly id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
325
+ readonly type: Schema.Literal<"function_call_output">;
326
+ readonly call_id: Schema.String;
327
+ readonly output: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
328
+ readonly type: Schema.Literal<"input_text">;
329
+ readonly text: Schema.String;
330
+ }>, Schema.Struct<{
331
+ readonly type: Schema.Literal<"input_image">;
332
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
333
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
334
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
335
+ }>, Schema.Struct<{
336
+ readonly type: Schema.Literal<"input_file">;
337
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
338
+ readonly filename: Schema.optionalKey<Schema.String>;
339
+ readonly file_url: Schema.optionalKey<Schema.String>;
340
+ readonly file_data: Schema.optionalKey<Schema.String>;
341
+ }>]>>]>;
342
+ readonly status: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>>;
343
+ }>, Schema.Struct<{
344
+ readonly type: Schema.Literal<"reasoning">;
345
+ readonly id: Schema.String;
346
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
347
+ readonly summary: Schema.$Array<Schema.Struct<{
348
+ readonly type: Schema.Literal<"summary_text">;
349
+ readonly text: Schema.String;
350
+ }>>;
351
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
352
+ readonly type: Schema.Literal<"reasoning_text">;
353
+ readonly text: Schema.String;
354
+ }>>>;
355
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
356
+ }>, Schema.Struct<{
357
+ readonly type: Schema.Literal<"item_reference">;
358
+ readonly id: Schema.String;
359
+ }>, Schema.Struct<{
360
+ readonly id: Schema.optionalKey<Schema.String>;
361
+ readonly type: Schema.Literal<"local_shell_call">;
362
+ readonly call_id: Schema.String;
363
+ readonly action: Schema.Unknown;
364
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
365
+ }>, Schema.Struct<{
366
+ readonly id: Schema.optionalKey<Schema.String>;
367
+ readonly type: Schema.Literal<"local_shell_call_output">;
368
+ readonly call_id: Schema.String;
369
+ readonly output: Schema.Unknown;
370
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
371
+ }>, Schema.Struct<{
372
+ readonly id: Schema.optionalKey<Schema.String>;
373
+ readonly type: Schema.Literal<"shell_call">;
374
+ readonly call_id: Schema.String;
375
+ readonly action: Schema.Unknown;
376
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
377
+ }>, Schema.Struct<{
378
+ readonly id: Schema.optionalKey<Schema.String>;
379
+ readonly type: Schema.Literal<"shell_call_output">;
380
+ readonly call_id: Schema.String;
381
+ readonly output: Schema.Unknown;
382
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
383
+ }>, Schema.Struct<{
384
+ readonly id: Schema.optionalKey<Schema.String>;
385
+ readonly type: Schema.Literal<"apply_patch_call_output">;
386
+ readonly call_id: Schema.String;
387
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
388
+ readonly output: Schema.optionalKey<Schema.Unknown>;
389
+ }>, Schema.Struct<{
390
+ readonly type: Schema.Literal<"mcp_approval_response">;
391
+ readonly approval_request_id: Schema.String;
392
+ readonly approve: Schema.Boolean;
393
+ }>]>;
394
+ /**
395
+ * Item shape accepted by an OpenAI Responses request `input` field.
396
+ *
397
+ * **When to use**
398
+ *
399
+ * Use when typing structured `CreateResponse.input` array items.
400
+ *
401
+ * **Details**
402
+ *
403
+ * Accepted item families include request/output messages, function call and
404
+ * function call output, reasoning items, item references, shell and local shell
405
+ * calls and outputs, apply-patch output, and MCP approval responses.
406
+ *
407
+ * @category models
408
+ * @since 4.0.0
409
+ */
410
+ export type InputItem = typeof InputItem.Type;
411
+ /**
412
+ * Schema for tool definitions that can be supplied to an OpenAI Responses request.
413
+ *
414
+ * **When to use**
415
+ *
416
+ * Use when validating or encoding the `tools` array for a Responses request,
417
+ * including provider-defined tool records with provider-specific fields.
418
+ *
419
+ * **Details**
420
+ *
421
+ * Accepted variants are function tools, custom tools, and provider-defined
422
+ * OpenAI tools. Provider-defined `type` literals include `apply_patch`,
423
+ * `code_interpreter`, `file_search`, `image_generation`, `local_shell`, `mcp`,
424
+ * `shell`, `web_search`, and `web_search_preview`.
425
+ *
426
+ * **Gotchas**
427
+ *
428
+ * Provider-defined tools use `Schema.StructWithRest`, so this schema checks the
429
+ * provider tool `type` and permits additional provider fields rather than fully
430
+ * validating every provider-specific tool payload.
431
+ *
432
+ * @see {@link ToolChoice} for selecting whether and which tools the model may call
433
+ * @see {@link CreateResponse} for the request schema that consumes tools
434
+ *
435
+ * @category schemas
436
+ * @since 4.0.0
437
+ */
438
+ export declare const Tool: Schema.Union<readonly [Schema.Struct<{
439
+ readonly type: Schema.Literal<"function">;
440
+ readonly name: Schema.String;
441
+ readonly description: Schema.optionalKey<Schema.NullOr<Schema.String>>;
442
+ readonly parameters: Schema.optionalKey<Schema.NullOr<Schema.$Record<Schema.String, Schema.Unknown>>>;
443
+ readonly strict: Schema.optionalKey<Schema.NullOr<Schema.Boolean>>;
444
+ }>, Schema.Struct<{
445
+ readonly type: Schema.Literal<"custom">;
446
+ readonly name: Schema.String;
447
+ readonly description: Schema.optionalKey<Schema.String>;
448
+ readonly format: Schema.optionalKey<Schema.Unknown>;
449
+ }>, Schema.StructWithRest<Schema.Struct<{
450
+ readonly type: Schema.Literals<readonly ["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"]>;
451
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>;
452
+ /**
453
+ * Tool definition that can be supplied to an OpenAI Responses request.
454
+ *
455
+ * @category models
456
+ * @since 4.0.0
457
+ */
458
+ export type Tool = typeof Tool.Type;
459
+ /**
460
+ * Schema for selecting whether and which tools the model may call in a Responses request.
461
+ *
462
+ * **When to use**
463
+ *
464
+ * Use when validating or encoding the `tool_choice` field that constrains model
465
+ * tool use separately from the tool definitions themselves.
466
+ *
467
+ * **Details**
468
+ *
469
+ * Accepted forms are `"none"`, `"auto"`, `"required"`, an allowed-tools set,
470
+ * a named function or custom tool, or a provider-defined tool choice.
471
+ *
472
+ * @see {@link Tool} for tool definitions referenced by tool choices
473
+ * @see {@link CreateResponse} for the request schema that consumes `tool_choice`
474
+ *
475
+ * @category schemas
476
+ * @since 4.0.0
477
+ */
478
+ export declare const ToolChoice: Schema.Union<readonly [Schema.Literals<readonly ["none", "auto", "required"]>, Schema.Struct<{
479
+ readonly type: Schema.Literal<"allowed_tools">;
480
+ readonly mode: Schema.Literals<readonly ["auto", "required"]>;
481
+ readonly tools: Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>;
482
+ }>, Schema.Struct<{
483
+ readonly type: Schema.Literal<"function">;
484
+ readonly name: Schema.String;
485
+ }>, Schema.Struct<{
486
+ readonly type: Schema.Literal<"custom">;
487
+ readonly name: Schema.String;
488
+ }>, Schema.StructWithRest<Schema.Struct<{
489
+ readonly type: Schema.Literals<readonly ["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"]>;
490
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>;
491
+ /**
492
+ * Tool selection mode or named tool choice for a Responses request.
493
+ *
494
+ * **Details**
495
+ *
496
+ * Accepted forms are `"none"`, `"auto"`, `"required"`, an allowed-tools set,
497
+ * a named function or custom tool, or a provider-defined tool choice.
498
+ *
499
+ * @category models
500
+ * @since 4.0.0
501
+ */
502
+ export type ToolChoice = typeof ToolChoice.Type;
503
+ /**
504
+ * Schema for text output format configuration, including plain text, JSON object, and JSON Schema responses.
505
+ *
506
+ * **When to use**
507
+ *
508
+ * Use when validating or encoding the `text.format` setting for a Responses
509
+ * request, especially when choosing structured JSON Schema output.
510
+ *
511
+ * **Details**
512
+ *
513
+ * Accepted variants are `text`, `json_schema`, and `json_object`.
514
+ *
515
+ * **Gotchas**
516
+ *
517
+ * `json_object` is the older JSON mode. Prefer `json_schema` for models that
518
+ * support it.
519
+ *
520
+ * @see {@link CreateResponse} for the request schema that consumes text format configuration
521
+ *
522
+ * @category schemas
523
+ * @since 4.0.0
524
+ */
525
+ export declare const TextResponseFormatConfiguration: Schema.Union<readonly [Schema.Struct<{
526
+ readonly type: Schema.Literal<"text">;
527
+ }>, Schema.Struct<{
528
+ readonly type: Schema.Literal<"json_schema">;
529
+ readonly description: Schema.optionalKey<Schema.String>;
530
+ readonly name: Schema.String;
531
+ readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
532
+ readonly strict: Schema.optionalKey<Schema.NullOr<Schema.Boolean>>;
533
+ }>, Schema.Struct<{
534
+ readonly type: Schema.Literal<"json_object">;
535
+ }>]>;
536
+ /**
537
+ * Text output format configuration for plain text, JSON object, or JSON Schema responses.
538
+ *
539
+ * @category models
540
+ * @since 4.0.0
541
+ */
542
+ export type TextResponseFormatConfiguration = typeof TextResponseFormatConfiguration.Type;
543
+ /**
544
+ * Schema for request options used to create an OpenAI Responses API response.
545
+ *
546
+ * **When to use**
547
+ *
548
+ * Use to validate or encode payloads sent to the OpenAI Responses API.
549
+ *
550
+ * **Details**
551
+ *
552
+ * Validates the Responses API request payload, including input content, model
553
+ * selection, instructions, reasoning options, text output format, tools,
554
+ * `tool_choice`, streaming, storage, response continuation, sampling options,
555
+ * and optional response fields requested through `include`.
556
+ *
557
+ * **Gotchas**
558
+ *
559
+ * When `stream` is `true`, the API returns stream events instead of a single
560
+ * response object.
561
+ *
562
+ * @see {@link Response} for decoded non-streaming response objects
563
+ * @see {@link ResponseStreamEvent} for decoded streaming event objects
564
+ *
565
+ * @category schemas
566
+ * @since 4.0.0
567
+ */
568
+ export declare const CreateResponse: Schema.Struct<{
569
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
570
+ readonly top_logprobs: Schema.optional<Schema.Number>;
571
+ readonly temperature: Schema.optional<Schema.Number>;
572
+ readonly top_p: Schema.optional<Schema.Number>;
573
+ readonly user: Schema.optional<Schema.String>;
574
+ readonly service_tier: Schema.optional<Schema.String>;
575
+ readonly previous_response_id: Schema.optional<Schema.String>;
576
+ readonly model: Schema.optional<Schema.String>;
577
+ readonly reasoning: Schema.optional<Schema.Struct<{
578
+ readonly effort: Schema.optional<Schema.Literals<readonly ["none", "minimal", "low", "medium", "high", "xhigh"]>>;
579
+ readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
580
+ readonly generate_summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
581
+ }>>;
582
+ readonly background: Schema.optional<Schema.Boolean>;
583
+ readonly max_output_tokens: Schema.optional<Schema.Number>;
584
+ readonly max_tool_calls: Schema.optional<Schema.Number>;
585
+ readonly text: Schema.optional<Schema.Struct<{
586
+ readonly format: Schema.optional<Schema.Union<readonly [Schema.Struct<{
587
+ readonly type: Schema.Literal<"text">;
588
+ }>, Schema.Struct<{
589
+ readonly type: Schema.Literal<"json_schema">;
590
+ readonly description: Schema.optionalKey<Schema.String>;
591
+ readonly name: Schema.String;
592
+ readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
593
+ readonly strict: Schema.optionalKey<Schema.NullOr<Schema.Boolean>>;
594
+ }>, Schema.Struct<{
595
+ readonly type: Schema.Literal<"json_object">;
596
+ }>]>>;
597
+ readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
598
+ }>>;
599
+ readonly tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
600
+ readonly type: Schema.Literal<"function">;
601
+ readonly name: Schema.String;
602
+ readonly description: Schema.optionalKey<Schema.NullOr<Schema.String>>;
603
+ readonly parameters: Schema.optionalKey<Schema.NullOr<Schema.$Record<Schema.String, Schema.Unknown>>>;
604
+ readonly strict: Schema.optionalKey<Schema.NullOr<Schema.Boolean>>;
605
+ }>, Schema.Struct<{
606
+ readonly type: Schema.Literal<"custom">;
607
+ readonly name: Schema.String;
608
+ readonly description: Schema.optionalKey<Schema.String>;
609
+ readonly format: Schema.optionalKey<Schema.Unknown>;
610
+ }>, Schema.StructWithRest<Schema.Struct<{
611
+ readonly type: Schema.Literals<readonly ["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"]>;
612
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>>;
613
+ readonly tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["none", "auto", "required"]>, Schema.Struct<{
614
+ readonly type: Schema.Literal<"allowed_tools">;
615
+ readonly mode: Schema.Literals<readonly ["auto", "required"]>;
616
+ readonly tools: Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>;
617
+ }>, Schema.Struct<{
618
+ readonly type: Schema.Literal<"function">;
619
+ readonly name: Schema.String;
620
+ }>, Schema.Struct<{
621
+ readonly type: Schema.Literal<"custom">;
622
+ readonly name: Schema.String;
623
+ }>, Schema.StructWithRest<Schema.Struct<{
624
+ readonly type: Schema.Literals<readonly ["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"]>;
625
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
626
+ readonly truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
627
+ readonly input: Schema.optional<Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
628
+ readonly type: Schema.optionalKey<Schema.Literal<"message">>;
629
+ readonly role: Schema.Literals<readonly ["system", "developer", "user", "assistant"]>;
630
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
631
+ readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
632
+ readonly type: Schema.Literal<"input_text">;
633
+ readonly text: Schema.String;
634
+ }>, Schema.Struct<{
635
+ readonly type: Schema.Literal<"input_image">;
636
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
637
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
638
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
639
+ }>, Schema.Struct<{
640
+ readonly type: Schema.Literal<"input_file">;
641
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
642
+ readonly filename: Schema.optionalKey<Schema.String>;
643
+ readonly file_url: Schema.optionalKey<Schema.String>;
644
+ readonly file_data: Schema.optionalKey<Schema.String>;
645
+ }>]>>]>;
646
+ }>, Schema.Struct<{
647
+ readonly id: Schema.String;
648
+ readonly type: Schema.Literal<"message">;
649
+ readonly role: Schema.Literal<"assistant">;
650
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
651
+ readonly type: Schema.Literal<"input_text">;
652
+ readonly text: Schema.String;
653
+ }>, Schema.Struct<{
654
+ readonly type: Schema.Literal<"output_text">;
655
+ readonly text: Schema.String;
656
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
657
+ readonly type: Schema.Literal<"file_citation">;
658
+ readonly file_id: Schema.String;
659
+ readonly index: Schema.Number;
660
+ readonly filename: Schema.String;
661
+ }>, Schema.Struct<{
662
+ readonly type: Schema.Literal<"url_citation">;
663
+ readonly url: Schema.String;
664
+ readonly start_index: Schema.Number;
665
+ readonly end_index: Schema.Number;
666
+ readonly title: Schema.String;
667
+ }>, Schema.Struct<{
668
+ readonly type: Schema.Literal<"container_file_citation">;
669
+ readonly container_id: Schema.String;
670
+ readonly file_id: Schema.String;
671
+ readonly start_index: Schema.Number;
672
+ readonly end_index: Schema.Number;
673
+ readonly filename: Schema.String;
674
+ }>, Schema.Struct<{
675
+ readonly type: Schema.Literal<"file_path">;
676
+ readonly file_id: Schema.String;
677
+ readonly index: Schema.Number;
678
+ }>]>>;
679
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
680
+ }>, Schema.Struct<{
681
+ readonly type: Schema.Literal<"text">;
682
+ readonly text: Schema.String;
683
+ }>, Schema.Struct<{
684
+ readonly type: Schema.Literal<"summary_text">;
685
+ readonly text: Schema.String;
686
+ }>, Schema.Struct<{
687
+ readonly type: Schema.Literal<"reasoning_text">;
688
+ readonly text: Schema.String;
689
+ }>, Schema.Struct<{
690
+ readonly type: Schema.Literal<"refusal">;
691
+ readonly refusal: Schema.String;
692
+ }>, Schema.Struct<{
693
+ readonly type: Schema.Literal<"input_image">;
694
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
695
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
696
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
697
+ }>, Schema.Struct<{
698
+ readonly type: Schema.Literal<"computer_screenshot">;
699
+ readonly image_url: Schema.NullOr<Schema.String>;
700
+ readonly file_id: Schema.NullOr<Schema.String>;
701
+ }>, Schema.Struct<{
702
+ readonly type: Schema.Literal<"input_file">;
703
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
704
+ readonly filename: Schema.optionalKey<Schema.String>;
705
+ readonly file_url: Schema.optionalKey<Schema.String>;
706
+ readonly file_data: Schema.optionalKey<Schema.String>;
707
+ }>]>>;
708
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
709
+ }>, Schema.Struct<{
710
+ readonly id: Schema.optionalKey<Schema.String>;
711
+ readonly type: Schema.Literal<"function_call">;
712
+ readonly call_id: Schema.String;
713
+ readonly name: Schema.String;
714
+ readonly arguments: Schema.String;
715
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
716
+ }>, Schema.Struct<{
717
+ readonly id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
718
+ readonly type: Schema.Literal<"function_call_output">;
719
+ readonly call_id: Schema.String;
720
+ readonly output: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
721
+ readonly type: Schema.Literal<"input_text">;
722
+ readonly text: Schema.String;
723
+ }>, Schema.Struct<{
724
+ readonly type: Schema.Literal<"input_image">;
725
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
726
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
727
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
728
+ }>, Schema.Struct<{
729
+ readonly type: Schema.Literal<"input_file">;
730
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
731
+ readonly filename: Schema.optionalKey<Schema.String>;
732
+ readonly file_url: Schema.optionalKey<Schema.String>;
733
+ readonly file_data: Schema.optionalKey<Schema.String>;
734
+ }>]>>]>;
735
+ readonly status: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>>;
736
+ }>, Schema.Struct<{
737
+ readonly type: Schema.Literal<"reasoning">;
738
+ readonly id: Schema.String;
739
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
740
+ readonly summary: Schema.$Array<Schema.Struct<{
741
+ readonly type: Schema.Literal<"summary_text">;
742
+ readonly text: Schema.String;
743
+ }>>;
744
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
745
+ readonly type: Schema.Literal<"reasoning_text">;
746
+ readonly text: Schema.String;
747
+ }>>>;
748
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
749
+ }>, Schema.Struct<{
750
+ readonly type: Schema.Literal<"item_reference">;
751
+ readonly id: Schema.String;
752
+ }>, Schema.Struct<{
753
+ readonly id: Schema.optionalKey<Schema.String>;
754
+ readonly type: Schema.Literal<"local_shell_call">;
755
+ readonly call_id: Schema.String;
756
+ readonly action: Schema.Unknown;
757
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
758
+ }>, Schema.Struct<{
759
+ readonly id: Schema.optionalKey<Schema.String>;
760
+ readonly type: Schema.Literal<"local_shell_call_output">;
761
+ readonly call_id: Schema.String;
762
+ readonly output: Schema.Unknown;
763
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
764
+ }>, Schema.Struct<{
765
+ readonly id: Schema.optionalKey<Schema.String>;
766
+ readonly type: Schema.Literal<"shell_call">;
767
+ readonly call_id: Schema.String;
768
+ readonly action: Schema.Unknown;
769
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
770
+ }>, Schema.Struct<{
771
+ readonly id: Schema.optionalKey<Schema.String>;
772
+ readonly type: Schema.Literal<"shell_call_output">;
773
+ readonly call_id: Schema.String;
774
+ readonly output: Schema.Unknown;
775
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
776
+ }>, Schema.Struct<{
777
+ readonly id: Schema.optionalKey<Schema.String>;
778
+ readonly type: Schema.Literal<"apply_patch_call_output">;
779
+ readonly call_id: Schema.String;
780
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
781
+ readonly output: Schema.optionalKey<Schema.Unknown>;
782
+ }>, Schema.Struct<{
783
+ readonly type: Schema.Literal<"mcp_approval_response">;
784
+ readonly approval_request_id: Schema.String;
785
+ readonly approve: Schema.Boolean;
786
+ }>]>>]>>;
787
+ readonly include: Schema.optional<Schema.$Array<Schema.Literals<readonly ["message.input_image.image_url", "reasoning.encrypted_content", "message.output_text.logprobs", "code_interpreter_call.outputs", "web_search_call.action.sources"]>>>;
788
+ readonly store: Schema.optional<Schema.Boolean>;
789
+ readonly instructions: Schema.optional<Schema.String>;
790
+ readonly stream: Schema.optional<Schema.Boolean>;
791
+ readonly conversation: Schema.optional<Schema.String>;
792
+ readonly modalities: Schema.optional<Schema.$Array<Schema.Literals<readonly ["text", "audio"]>>>;
793
+ readonly seed: Schema.optional<Schema.Number>;
794
+ }>;
795
+ /**
796
+ * Request options used to create an OpenAI Responses API response.
797
+ *
798
+ * @category options
799
+ * @since 4.0.0
800
+ */
801
+ export type CreateResponse = typeof CreateResponse.Type;
802
+ /**
803
+ * Schema for token accounting reported on OpenAI Responses API response objects.
804
+ *
805
+ * **Details**
806
+ *
807
+ * The required counters are `input_tokens`, `output_tokens`, and
808
+ * `total_tokens`. Provider-specific token detail objects are preserved through
809
+ * `input_tokens_details`, `output_tokens_details`, and additional fields.
810
+ *
811
+ * @category schemas
812
+ * @since 4.0.0
813
+ */
814
+ export declare const ResponseUsage: Schema.StructWithRest<Schema.Struct<{
815
+ readonly input_tokens: Schema.Number;
816
+ readonly output_tokens: Schema.Number;
817
+ readonly total_tokens: Schema.Number;
818
+ readonly input_tokens_details: Schema.optionalKey<Schema.Unknown>;
819
+ readonly output_tokens_details: Schema.optionalKey<Schema.Unknown>;
820
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
821
+ /**
822
+ * Token accounting reported on OpenAI Responses API response objects.
823
+ *
824
+ * **Details**
825
+ *
826
+ * Includes total input, output, and combined token counts, with provider-specific
827
+ * token detail fields preserved when present.
828
+ *
829
+ * @category models
830
+ * @since 4.0.0
831
+ */
832
+ export type ResponseUsage = typeof ResponseUsage.Type;
833
+ /**
834
+ * Schema for an OpenAI Responses API response object.
835
+ *
836
+ * **When to use**
837
+ *
838
+ * Use to decode non-streaming OpenAI Responses API responses.
839
+ *
840
+ * **Details**
841
+ *
842
+ * Response objects include the response id, model, creation time, output items,
843
+ * optional token usage, optional incomplete details, and optional service tier.
844
+ *
845
+ * @see {@link CreateResponse} for the request schema that creates responses
846
+ * @see {@link ResponseUsage} for token accounting on responses
847
+ * @see {@link ResponseStreamEvent} for streaming response events
848
+ *
849
+ * @category schemas
850
+ * @since 4.0.0
851
+ */
852
+ export declare const Response: Schema.Struct<{
853
+ readonly id: Schema.String;
854
+ readonly object: Schema.optionalKey<Schema.Literal<"response">>;
855
+ readonly model: Schema.String;
856
+ readonly created_at: Schema.Number;
857
+ readonly output: Schema.withDecodingDefault<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
858
+ readonly id: Schema.String;
859
+ readonly type: Schema.Literal<"apply_patch_call">;
860
+ readonly call_id: Schema.String;
861
+ readonly operation: Schema.Struct<{
862
+ readonly type: Schema.String;
863
+ readonly path: Schema.String;
864
+ readonly diff: Schema.optionalKey<Schema.String>;
865
+ }>;
866
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
867
+ }>, Schema.Struct<{
868
+ readonly id: Schema.String;
869
+ readonly type: Schema.Literal<"code_interpreter_call">;
870
+ readonly code: Schema.optionalKey<Schema.String>;
871
+ readonly container_id: Schema.String;
872
+ readonly outputs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
873
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
874
+ }>, Schema.Struct<{
875
+ readonly id: Schema.String;
876
+ readonly type: Schema.Literal<"computer_call">;
877
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
878
+ }>, Schema.Struct<{
879
+ readonly id: Schema.String;
880
+ readonly type: Schema.Literal<"file_search_call">;
881
+ readonly status: Schema.optionalKey<Schema.String>;
882
+ readonly queries: Schema.optionalKey<Schema.$Array<Schema.String>>;
883
+ readonly results: Schema.optionalKey<Schema.NullOr<Schema.Unknown>>;
884
+ }>, Schema.Struct<{
885
+ readonly id: Schema.optionalKey<Schema.String>;
886
+ readonly type: Schema.Literal<"function_call">;
887
+ readonly call_id: Schema.String;
888
+ readonly name: Schema.String;
889
+ readonly arguments: Schema.String;
890
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
891
+ }>, Schema.Struct<{
892
+ readonly id: Schema.String;
893
+ readonly type: Schema.Literal<"image_generation_call">;
894
+ readonly result: Schema.optionalKey<Schema.String>;
895
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
896
+ }>, Schema.Struct<{
897
+ readonly id: Schema.optionalKey<Schema.String>;
898
+ readonly type: Schema.Literal<"local_shell_call">;
899
+ readonly call_id: Schema.String;
900
+ readonly action: Schema.Unknown;
901
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
902
+ }>, Schema.Struct<{
903
+ readonly id: Schema.String;
904
+ readonly type: Schema.Literal<"mcp_call">;
905
+ readonly approval_request_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
906
+ readonly name: Schema.String;
907
+ readonly arguments: Schema.Unknown;
908
+ readonly output: Schema.optionalKey<Schema.Unknown>;
909
+ readonly error: Schema.optionalKey<Schema.Unknown>;
910
+ readonly server_label: Schema.optionalKey<Schema.NullOr<Schema.String>>;
911
+ }>, Schema.Struct<{
912
+ readonly id: Schema.String;
913
+ readonly type: Schema.Literal<"mcp_list_tools">;
914
+ }>, Schema.Struct<{
915
+ readonly id: Schema.String;
916
+ readonly type: Schema.Literal<"mcp_approval_request">;
917
+ readonly approval_request_id: Schema.optionalKey<Schema.String>;
918
+ readonly name: Schema.String;
919
+ readonly arguments: Schema.Unknown;
920
+ }>, Schema.Struct<{
921
+ readonly id: Schema.String;
922
+ readonly type: Schema.Literal<"message">;
923
+ readonly role: Schema.Literal<"assistant">;
924
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
925
+ readonly type: Schema.Literal<"input_text">;
926
+ readonly text: Schema.String;
927
+ }>, Schema.Struct<{
928
+ readonly type: Schema.Literal<"output_text">;
929
+ readonly text: Schema.String;
930
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
931
+ readonly type: Schema.Literal<"file_citation">;
932
+ readonly file_id: Schema.String;
933
+ readonly index: Schema.Number;
934
+ readonly filename: Schema.String;
935
+ }>, Schema.Struct<{
936
+ readonly type: Schema.Literal<"url_citation">;
937
+ readonly url: Schema.String;
938
+ readonly start_index: Schema.Number;
939
+ readonly end_index: Schema.Number;
940
+ readonly title: Schema.String;
941
+ }>, Schema.Struct<{
942
+ readonly type: Schema.Literal<"container_file_citation">;
943
+ readonly container_id: Schema.String;
944
+ readonly file_id: Schema.String;
945
+ readonly start_index: Schema.Number;
946
+ readonly end_index: Schema.Number;
947
+ readonly filename: Schema.String;
948
+ }>, Schema.Struct<{
949
+ readonly type: Schema.Literal<"file_path">;
950
+ readonly file_id: Schema.String;
951
+ readonly index: Schema.Number;
952
+ }>]>>;
953
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
954
+ }>, Schema.Struct<{
955
+ readonly type: Schema.Literal<"text">;
956
+ readonly text: Schema.String;
957
+ }>, Schema.Struct<{
958
+ readonly type: Schema.Literal<"summary_text">;
959
+ readonly text: Schema.String;
960
+ }>, Schema.Struct<{
961
+ readonly type: Schema.Literal<"reasoning_text">;
962
+ readonly text: Schema.String;
963
+ }>, Schema.Struct<{
964
+ readonly type: Schema.Literal<"refusal">;
965
+ readonly refusal: Schema.String;
966
+ }>, Schema.Struct<{
967
+ readonly type: Schema.Literal<"input_image">;
968
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
969
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
970
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
971
+ }>, Schema.Struct<{
972
+ readonly type: Schema.Literal<"computer_screenshot">;
973
+ readonly image_url: Schema.NullOr<Schema.String>;
974
+ readonly file_id: Schema.NullOr<Schema.String>;
975
+ }>, Schema.Struct<{
976
+ readonly type: Schema.Literal<"input_file">;
977
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
978
+ readonly filename: Schema.optionalKey<Schema.String>;
979
+ readonly file_url: Schema.optionalKey<Schema.String>;
980
+ readonly file_data: Schema.optionalKey<Schema.String>;
981
+ }>]>>;
982
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
983
+ }>, Schema.Struct<{
984
+ readonly type: Schema.Literal<"reasoning">;
985
+ readonly id: Schema.String;
986
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
987
+ readonly summary: Schema.$Array<Schema.Struct<{
988
+ readonly type: Schema.Literal<"summary_text">;
989
+ readonly text: Schema.String;
990
+ }>>;
991
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
992
+ readonly type: Schema.Literal<"reasoning_text">;
993
+ readonly text: Schema.String;
994
+ }>>>;
995
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
996
+ }>, Schema.Struct<{
997
+ readonly id: Schema.optionalKey<Schema.String>;
998
+ readonly type: Schema.Literal<"shell_call">;
999
+ readonly call_id: Schema.String;
1000
+ readonly action: Schema.Unknown;
1001
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1002
+ }>, Schema.Struct<{
1003
+ readonly id: Schema.String;
1004
+ readonly type: Schema.Literal<"web_search_call">;
1005
+ readonly action: Schema.optionalKey<Schema.Unknown>;
1006
+ readonly status: Schema.optionalKey<Schema.String>;
1007
+ }>]>>, never>;
1008
+ readonly usage: Schema.optionalKey<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
1009
+ readonly input_tokens: Schema.Number;
1010
+ readonly output_tokens: Schema.Number;
1011
+ readonly total_tokens: Schema.Number;
1012
+ readonly input_tokens_details: Schema.optionalKey<Schema.Unknown>;
1013
+ readonly output_tokens_details: Schema.optionalKey<Schema.Unknown>;
1014
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
1015
+ readonly incomplete_details: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
1016
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["max_output_tokens", "content_filter"]>>;
1017
+ }>>>;
1018
+ readonly service_tier: Schema.optionalKey<Schema.String>;
1019
+ }>;
1020
+ /**
1021
+ * OpenAI Responses API response object.
1022
+ *
1023
+ * **When to use**
1024
+ *
1025
+ * Use when typing non-streaming OpenAI Responses API responses.
1026
+ *
1027
+ * **Details**
1028
+ *
1029
+ * Response objects include metadata, output items, optional token usage, and
1030
+ * optional incomplete details.
1031
+ *
1032
+ * @category models
1033
+ * @since 4.0.0
1034
+ */
1035
+ export type Response = typeof Response.Type;
1036
+ /**
1037
+ * Fallback event shape for future or provider-specific response stream events.
1038
+ *
1039
+ * @category models
1040
+ * @since 4.0.0
1041
+ */
1042
+ export type UnknownResponseStreamEvent = {
1043
+ readonly type: string;
1044
+ readonly [key: string]: unknown;
1045
+ };
1046
+ /**
1047
+ * Schema for server-sent event shapes emitted by OpenAI Responses API streams.
1048
+ *
1049
+ * **When to use**
1050
+ *
1051
+ * Use to decode events from a streaming OpenAI Responses API request.
1052
+ *
1053
+ * **Details**
1054
+ *
1055
+ * Known event variants include response lifecycle events, output item events,
1056
+ * text and reasoning deltas, tool-call deltas, partial image events, and error
1057
+ * events.
1058
+ *
1059
+ * **Gotchas**
1060
+ *
1061
+ * Future event types decode through the fallback only when their `type` is not
1062
+ * one of the known event types. Malformed known events still fail to decode.
1063
+ *
1064
+ * @see {@link Response} for complete response objects carried by lifecycle events
1065
+ * @see {@link UnknownResponseStreamEvent} for the fallback shape for future event types
1066
+ *
1067
+ * @category schemas
1068
+ * @since 4.0.0
1069
+ */
1070
+ export declare const ResponseStreamEvent: Schema.Union<readonly [Schema.Struct<{
1071
+ readonly type: Schema.Literal<"response.created">;
1072
+ readonly response: Schema.Struct<{
1073
+ readonly id: Schema.String;
1074
+ readonly object: Schema.optionalKey<Schema.Literal<"response">>;
1075
+ readonly model: Schema.String;
1076
+ readonly created_at: Schema.Number;
1077
+ readonly output: Schema.withDecodingDefault<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1078
+ readonly id: Schema.String;
1079
+ readonly type: Schema.Literal<"apply_patch_call">;
1080
+ readonly call_id: Schema.String;
1081
+ readonly operation: Schema.Struct<{
1082
+ readonly type: Schema.String;
1083
+ readonly path: Schema.String;
1084
+ readonly diff: Schema.optionalKey<Schema.String>;
1085
+ }>;
1086
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1087
+ }>, Schema.Struct<{
1088
+ readonly id: Schema.String;
1089
+ readonly type: Schema.Literal<"code_interpreter_call">;
1090
+ readonly code: Schema.optionalKey<Schema.String>;
1091
+ readonly container_id: Schema.String;
1092
+ readonly outputs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1093
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1094
+ }>, Schema.Struct<{
1095
+ readonly id: Schema.String;
1096
+ readonly type: Schema.Literal<"computer_call">;
1097
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1098
+ }>, Schema.Struct<{
1099
+ readonly id: Schema.String;
1100
+ readonly type: Schema.Literal<"file_search_call">;
1101
+ readonly status: Schema.optionalKey<Schema.String>;
1102
+ readonly queries: Schema.optionalKey<Schema.$Array<Schema.String>>;
1103
+ readonly results: Schema.optionalKey<Schema.NullOr<Schema.Unknown>>;
1104
+ }>, Schema.Struct<{
1105
+ readonly id: Schema.optionalKey<Schema.String>;
1106
+ readonly type: Schema.Literal<"function_call">;
1107
+ readonly call_id: Schema.String;
1108
+ readonly name: Schema.String;
1109
+ readonly arguments: Schema.String;
1110
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1111
+ }>, Schema.Struct<{
1112
+ readonly id: Schema.String;
1113
+ readonly type: Schema.Literal<"image_generation_call">;
1114
+ readonly result: Schema.optionalKey<Schema.String>;
1115
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1116
+ }>, Schema.Struct<{
1117
+ readonly id: Schema.optionalKey<Schema.String>;
1118
+ readonly type: Schema.Literal<"local_shell_call">;
1119
+ readonly call_id: Schema.String;
1120
+ readonly action: Schema.Unknown;
1121
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1122
+ }>, Schema.Struct<{
1123
+ readonly id: Schema.String;
1124
+ readonly type: Schema.Literal<"mcp_call">;
1125
+ readonly approval_request_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1126
+ readonly name: Schema.String;
1127
+ readonly arguments: Schema.Unknown;
1128
+ readonly output: Schema.optionalKey<Schema.Unknown>;
1129
+ readonly error: Schema.optionalKey<Schema.Unknown>;
1130
+ readonly server_label: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1131
+ }>, Schema.Struct<{
1132
+ readonly id: Schema.String;
1133
+ readonly type: Schema.Literal<"mcp_list_tools">;
1134
+ }>, Schema.Struct<{
1135
+ readonly id: Schema.String;
1136
+ readonly type: Schema.Literal<"mcp_approval_request">;
1137
+ readonly approval_request_id: Schema.optionalKey<Schema.String>;
1138
+ readonly name: Schema.String;
1139
+ readonly arguments: Schema.Unknown;
1140
+ }>, Schema.Struct<{
1141
+ readonly id: Schema.String;
1142
+ readonly type: Schema.Literal<"message">;
1143
+ readonly role: Schema.Literal<"assistant">;
1144
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1145
+ readonly type: Schema.Literal<"input_text">;
1146
+ readonly text: Schema.String;
1147
+ }>, Schema.Struct<{
1148
+ readonly type: Schema.Literal<"output_text">;
1149
+ readonly text: Schema.String;
1150
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1151
+ readonly type: Schema.Literal<"file_citation">;
1152
+ readonly file_id: Schema.String;
1153
+ readonly index: Schema.Number;
1154
+ readonly filename: Schema.String;
1155
+ }>, Schema.Struct<{
1156
+ readonly type: Schema.Literal<"url_citation">;
1157
+ readonly url: Schema.String;
1158
+ readonly start_index: Schema.Number;
1159
+ readonly end_index: Schema.Number;
1160
+ readonly title: Schema.String;
1161
+ }>, Schema.Struct<{
1162
+ readonly type: Schema.Literal<"container_file_citation">;
1163
+ readonly container_id: Schema.String;
1164
+ readonly file_id: Schema.String;
1165
+ readonly start_index: Schema.Number;
1166
+ readonly end_index: Schema.Number;
1167
+ readonly filename: Schema.String;
1168
+ }>, Schema.Struct<{
1169
+ readonly type: Schema.Literal<"file_path">;
1170
+ readonly file_id: Schema.String;
1171
+ readonly index: Schema.Number;
1172
+ }>]>>;
1173
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1174
+ }>, Schema.Struct<{
1175
+ readonly type: Schema.Literal<"text">;
1176
+ readonly text: Schema.String;
1177
+ }>, Schema.Struct<{
1178
+ readonly type: Schema.Literal<"summary_text">;
1179
+ readonly text: Schema.String;
1180
+ }>, Schema.Struct<{
1181
+ readonly type: Schema.Literal<"reasoning_text">;
1182
+ readonly text: Schema.String;
1183
+ }>, Schema.Struct<{
1184
+ readonly type: Schema.Literal<"refusal">;
1185
+ readonly refusal: Schema.String;
1186
+ }>, Schema.Struct<{
1187
+ readonly type: Schema.Literal<"input_image">;
1188
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1189
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1190
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
1191
+ }>, Schema.Struct<{
1192
+ readonly type: Schema.Literal<"computer_screenshot">;
1193
+ readonly image_url: Schema.NullOr<Schema.String>;
1194
+ readonly file_id: Schema.NullOr<Schema.String>;
1195
+ }>, Schema.Struct<{
1196
+ readonly type: Schema.Literal<"input_file">;
1197
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1198
+ readonly filename: Schema.optionalKey<Schema.String>;
1199
+ readonly file_url: Schema.optionalKey<Schema.String>;
1200
+ readonly file_data: Schema.optionalKey<Schema.String>;
1201
+ }>]>>;
1202
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
1203
+ }>, Schema.Struct<{
1204
+ readonly type: Schema.Literal<"reasoning">;
1205
+ readonly id: Schema.String;
1206
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1207
+ readonly summary: Schema.$Array<Schema.Struct<{
1208
+ readonly type: Schema.Literal<"summary_text">;
1209
+ readonly text: Schema.String;
1210
+ }>>;
1211
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1212
+ readonly type: Schema.Literal<"reasoning_text">;
1213
+ readonly text: Schema.String;
1214
+ }>>>;
1215
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1216
+ }>, Schema.Struct<{
1217
+ readonly id: Schema.optionalKey<Schema.String>;
1218
+ readonly type: Schema.Literal<"shell_call">;
1219
+ readonly call_id: Schema.String;
1220
+ readonly action: Schema.Unknown;
1221
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1222
+ }>, Schema.Struct<{
1223
+ readonly id: Schema.String;
1224
+ readonly type: Schema.Literal<"web_search_call">;
1225
+ readonly action: Schema.optionalKey<Schema.Unknown>;
1226
+ readonly status: Schema.optionalKey<Schema.String>;
1227
+ }>]>>, never>;
1228
+ readonly usage: Schema.optionalKey<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
1229
+ readonly input_tokens: Schema.Number;
1230
+ readonly output_tokens: Schema.Number;
1231
+ readonly total_tokens: Schema.Number;
1232
+ readonly input_tokens_details: Schema.optionalKey<Schema.Unknown>;
1233
+ readonly output_tokens_details: Schema.optionalKey<Schema.Unknown>;
1234
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
1235
+ readonly incomplete_details: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
1236
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["max_output_tokens", "content_filter"]>>;
1237
+ }>>>;
1238
+ readonly service_tier: Schema.optionalKey<Schema.String>;
1239
+ }>;
1240
+ readonly sequence_number: Schema.Number;
1241
+ }>, Schema.Struct<{
1242
+ readonly type: Schema.Literal<"response.completed">;
1243
+ readonly response: Schema.Struct<{
1244
+ readonly id: Schema.String;
1245
+ readonly object: Schema.optionalKey<Schema.Literal<"response">>;
1246
+ readonly model: Schema.String;
1247
+ readonly created_at: Schema.Number;
1248
+ readonly output: Schema.withDecodingDefault<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1249
+ readonly id: Schema.String;
1250
+ readonly type: Schema.Literal<"apply_patch_call">;
1251
+ readonly call_id: Schema.String;
1252
+ readonly operation: Schema.Struct<{
1253
+ readonly type: Schema.String;
1254
+ readonly path: Schema.String;
1255
+ readonly diff: Schema.optionalKey<Schema.String>;
1256
+ }>;
1257
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1258
+ }>, Schema.Struct<{
1259
+ readonly id: Schema.String;
1260
+ readonly type: Schema.Literal<"code_interpreter_call">;
1261
+ readonly code: Schema.optionalKey<Schema.String>;
1262
+ readonly container_id: Schema.String;
1263
+ readonly outputs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1264
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1265
+ }>, Schema.Struct<{
1266
+ readonly id: Schema.String;
1267
+ readonly type: Schema.Literal<"computer_call">;
1268
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1269
+ }>, Schema.Struct<{
1270
+ readonly id: Schema.String;
1271
+ readonly type: Schema.Literal<"file_search_call">;
1272
+ readonly status: Schema.optionalKey<Schema.String>;
1273
+ readonly queries: Schema.optionalKey<Schema.$Array<Schema.String>>;
1274
+ readonly results: Schema.optionalKey<Schema.NullOr<Schema.Unknown>>;
1275
+ }>, Schema.Struct<{
1276
+ readonly id: Schema.optionalKey<Schema.String>;
1277
+ readonly type: Schema.Literal<"function_call">;
1278
+ readonly call_id: Schema.String;
1279
+ readonly name: Schema.String;
1280
+ readonly arguments: Schema.String;
1281
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1282
+ }>, Schema.Struct<{
1283
+ readonly id: Schema.String;
1284
+ readonly type: Schema.Literal<"image_generation_call">;
1285
+ readonly result: Schema.optionalKey<Schema.String>;
1286
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1287
+ }>, Schema.Struct<{
1288
+ readonly id: Schema.optionalKey<Schema.String>;
1289
+ readonly type: Schema.Literal<"local_shell_call">;
1290
+ readonly call_id: Schema.String;
1291
+ readonly action: Schema.Unknown;
1292
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1293
+ }>, Schema.Struct<{
1294
+ readonly id: Schema.String;
1295
+ readonly type: Schema.Literal<"mcp_call">;
1296
+ readonly approval_request_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1297
+ readonly name: Schema.String;
1298
+ readonly arguments: Schema.Unknown;
1299
+ readonly output: Schema.optionalKey<Schema.Unknown>;
1300
+ readonly error: Schema.optionalKey<Schema.Unknown>;
1301
+ readonly server_label: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1302
+ }>, Schema.Struct<{
1303
+ readonly id: Schema.String;
1304
+ readonly type: Schema.Literal<"mcp_list_tools">;
1305
+ }>, Schema.Struct<{
1306
+ readonly id: Schema.String;
1307
+ readonly type: Schema.Literal<"mcp_approval_request">;
1308
+ readonly approval_request_id: Schema.optionalKey<Schema.String>;
1309
+ readonly name: Schema.String;
1310
+ readonly arguments: Schema.Unknown;
1311
+ }>, Schema.Struct<{
1312
+ readonly id: Schema.String;
1313
+ readonly type: Schema.Literal<"message">;
1314
+ readonly role: Schema.Literal<"assistant">;
1315
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1316
+ readonly type: Schema.Literal<"input_text">;
1317
+ readonly text: Schema.String;
1318
+ }>, Schema.Struct<{
1319
+ readonly type: Schema.Literal<"output_text">;
1320
+ readonly text: Schema.String;
1321
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1322
+ readonly type: Schema.Literal<"file_citation">;
1323
+ readonly file_id: Schema.String;
1324
+ readonly index: Schema.Number;
1325
+ readonly filename: Schema.String;
1326
+ }>, Schema.Struct<{
1327
+ readonly type: Schema.Literal<"url_citation">;
1328
+ readonly url: Schema.String;
1329
+ readonly start_index: Schema.Number;
1330
+ readonly end_index: Schema.Number;
1331
+ readonly title: Schema.String;
1332
+ }>, Schema.Struct<{
1333
+ readonly type: Schema.Literal<"container_file_citation">;
1334
+ readonly container_id: Schema.String;
1335
+ readonly file_id: Schema.String;
1336
+ readonly start_index: Schema.Number;
1337
+ readonly end_index: Schema.Number;
1338
+ readonly filename: Schema.String;
1339
+ }>, Schema.Struct<{
1340
+ readonly type: Schema.Literal<"file_path">;
1341
+ readonly file_id: Schema.String;
1342
+ readonly index: Schema.Number;
1343
+ }>]>>;
1344
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1345
+ }>, Schema.Struct<{
1346
+ readonly type: Schema.Literal<"text">;
1347
+ readonly text: Schema.String;
1348
+ }>, Schema.Struct<{
1349
+ readonly type: Schema.Literal<"summary_text">;
1350
+ readonly text: Schema.String;
1351
+ }>, Schema.Struct<{
1352
+ readonly type: Schema.Literal<"reasoning_text">;
1353
+ readonly text: Schema.String;
1354
+ }>, Schema.Struct<{
1355
+ readonly type: Schema.Literal<"refusal">;
1356
+ readonly refusal: Schema.String;
1357
+ }>, Schema.Struct<{
1358
+ readonly type: Schema.Literal<"input_image">;
1359
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1360
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1361
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
1362
+ }>, Schema.Struct<{
1363
+ readonly type: Schema.Literal<"computer_screenshot">;
1364
+ readonly image_url: Schema.NullOr<Schema.String>;
1365
+ readonly file_id: Schema.NullOr<Schema.String>;
1366
+ }>, Schema.Struct<{
1367
+ readonly type: Schema.Literal<"input_file">;
1368
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1369
+ readonly filename: Schema.optionalKey<Schema.String>;
1370
+ readonly file_url: Schema.optionalKey<Schema.String>;
1371
+ readonly file_data: Schema.optionalKey<Schema.String>;
1372
+ }>]>>;
1373
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
1374
+ }>, Schema.Struct<{
1375
+ readonly type: Schema.Literal<"reasoning">;
1376
+ readonly id: Schema.String;
1377
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1378
+ readonly summary: Schema.$Array<Schema.Struct<{
1379
+ readonly type: Schema.Literal<"summary_text">;
1380
+ readonly text: Schema.String;
1381
+ }>>;
1382
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1383
+ readonly type: Schema.Literal<"reasoning_text">;
1384
+ readonly text: Schema.String;
1385
+ }>>>;
1386
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1387
+ }>, Schema.Struct<{
1388
+ readonly id: Schema.optionalKey<Schema.String>;
1389
+ readonly type: Schema.Literal<"shell_call">;
1390
+ readonly call_id: Schema.String;
1391
+ readonly action: Schema.Unknown;
1392
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1393
+ }>, Schema.Struct<{
1394
+ readonly id: Schema.String;
1395
+ readonly type: Schema.Literal<"web_search_call">;
1396
+ readonly action: Schema.optionalKey<Schema.Unknown>;
1397
+ readonly status: Schema.optionalKey<Schema.String>;
1398
+ }>]>>, never>;
1399
+ readonly usage: Schema.optionalKey<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
1400
+ readonly input_tokens: Schema.Number;
1401
+ readonly output_tokens: Schema.Number;
1402
+ readonly total_tokens: Schema.Number;
1403
+ readonly input_tokens_details: Schema.optionalKey<Schema.Unknown>;
1404
+ readonly output_tokens_details: Schema.optionalKey<Schema.Unknown>;
1405
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
1406
+ readonly incomplete_details: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
1407
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["max_output_tokens", "content_filter"]>>;
1408
+ }>>>;
1409
+ readonly service_tier: Schema.optionalKey<Schema.String>;
1410
+ }>;
1411
+ readonly sequence_number: Schema.Number;
1412
+ }>, Schema.Struct<{
1413
+ readonly type: Schema.Literal<"response.incomplete">;
1414
+ readonly response: Schema.Struct<{
1415
+ readonly id: Schema.String;
1416
+ readonly object: Schema.optionalKey<Schema.Literal<"response">>;
1417
+ readonly model: Schema.String;
1418
+ readonly created_at: Schema.Number;
1419
+ readonly output: Schema.withDecodingDefault<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1420
+ readonly id: Schema.String;
1421
+ readonly type: Schema.Literal<"apply_patch_call">;
1422
+ readonly call_id: Schema.String;
1423
+ readonly operation: Schema.Struct<{
1424
+ readonly type: Schema.String;
1425
+ readonly path: Schema.String;
1426
+ readonly diff: Schema.optionalKey<Schema.String>;
1427
+ }>;
1428
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1429
+ }>, Schema.Struct<{
1430
+ readonly id: Schema.String;
1431
+ readonly type: Schema.Literal<"code_interpreter_call">;
1432
+ readonly code: Schema.optionalKey<Schema.String>;
1433
+ readonly container_id: Schema.String;
1434
+ readonly outputs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1435
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1436
+ }>, Schema.Struct<{
1437
+ readonly id: Schema.String;
1438
+ readonly type: Schema.Literal<"computer_call">;
1439
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1440
+ }>, Schema.Struct<{
1441
+ readonly id: Schema.String;
1442
+ readonly type: Schema.Literal<"file_search_call">;
1443
+ readonly status: Schema.optionalKey<Schema.String>;
1444
+ readonly queries: Schema.optionalKey<Schema.$Array<Schema.String>>;
1445
+ readonly results: Schema.optionalKey<Schema.NullOr<Schema.Unknown>>;
1446
+ }>, Schema.Struct<{
1447
+ readonly id: Schema.optionalKey<Schema.String>;
1448
+ readonly type: Schema.Literal<"function_call">;
1449
+ readonly call_id: Schema.String;
1450
+ readonly name: Schema.String;
1451
+ readonly arguments: Schema.String;
1452
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1453
+ }>, Schema.Struct<{
1454
+ readonly id: Schema.String;
1455
+ readonly type: Schema.Literal<"image_generation_call">;
1456
+ readonly result: Schema.optionalKey<Schema.String>;
1457
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1458
+ }>, Schema.Struct<{
1459
+ readonly id: Schema.optionalKey<Schema.String>;
1460
+ readonly type: Schema.Literal<"local_shell_call">;
1461
+ readonly call_id: Schema.String;
1462
+ readonly action: Schema.Unknown;
1463
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1464
+ }>, Schema.Struct<{
1465
+ readonly id: Schema.String;
1466
+ readonly type: Schema.Literal<"mcp_call">;
1467
+ readonly approval_request_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1468
+ readonly name: Schema.String;
1469
+ readonly arguments: Schema.Unknown;
1470
+ readonly output: Schema.optionalKey<Schema.Unknown>;
1471
+ readonly error: Schema.optionalKey<Schema.Unknown>;
1472
+ readonly server_label: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1473
+ }>, Schema.Struct<{
1474
+ readonly id: Schema.String;
1475
+ readonly type: Schema.Literal<"mcp_list_tools">;
1476
+ }>, Schema.Struct<{
1477
+ readonly id: Schema.String;
1478
+ readonly type: Schema.Literal<"mcp_approval_request">;
1479
+ readonly approval_request_id: Schema.optionalKey<Schema.String>;
1480
+ readonly name: Schema.String;
1481
+ readonly arguments: Schema.Unknown;
1482
+ }>, Schema.Struct<{
1483
+ readonly id: Schema.String;
1484
+ readonly type: Schema.Literal<"message">;
1485
+ readonly role: Schema.Literal<"assistant">;
1486
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1487
+ readonly type: Schema.Literal<"input_text">;
1488
+ readonly text: Schema.String;
1489
+ }>, Schema.Struct<{
1490
+ readonly type: Schema.Literal<"output_text">;
1491
+ readonly text: Schema.String;
1492
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1493
+ readonly type: Schema.Literal<"file_citation">;
1494
+ readonly file_id: Schema.String;
1495
+ readonly index: Schema.Number;
1496
+ readonly filename: Schema.String;
1497
+ }>, Schema.Struct<{
1498
+ readonly type: Schema.Literal<"url_citation">;
1499
+ readonly url: Schema.String;
1500
+ readonly start_index: Schema.Number;
1501
+ readonly end_index: Schema.Number;
1502
+ readonly title: Schema.String;
1503
+ }>, Schema.Struct<{
1504
+ readonly type: Schema.Literal<"container_file_citation">;
1505
+ readonly container_id: Schema.String;
1506
+ readonly file_id: Schema.String;
1507
+ readonly start_index: Schema.Number;
1508
+ readonly end_index: Schema.Number;
1509
+ readonly filename: Schema.String;
1510
+ }>, Schema.Struct<{
1511
+ readonly type: Schema.Literal<"file_path">;
1512
+ readonly file_id: Schema.String;
1513
+ readonly index: Schema.Number;
1514
+ }>]>>;
1515
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1516
+ }>, Schema.Struct<{
1517
+ readonly type: Schema.Literal<"text">;
1518
+ readonly text: Schema.String;
1519
+ }>, Schema.Struct<{
1520
+ readonly type: Schema.Literal<"summary_text">;
1521
+ readonly text: Schema.String;
1522
+ }>, Schema.Struct<{
1523
+ readonly type: Schema.Literal<"reasoning_text">;
1524
+ readonly text: Schema.String;
1525
+ }>, Schema.Struct<{
1526
+ readonly type: Schema.Literal<"refusal">;
1527
+ readonly refusal: Schema.String;
1528
+ }>, Schema.Struct<{
1529
+ readonly type: Schema.Literal<"input_image">;
1530
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1531
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1532
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
1533
+ }>, Schema.Struct<{
1534
+ readonly type: Schema.Literal<"computer_screenshot">;
1535
+ readonly image_url: Schema.NullOr<Schema.String>;
1536
+ readonly file_id: Schema.NullOr<Schema.String>;
1537
+ }>, Schema.Struct<{
1538
+ readonly type: Schema.Literal<"input_file">;
1539
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1540
+ readonly filename: Schema.optionalKey<Schema.String>;
1541
+ readonly file_url: Schema.optionalKey<Schema.String>;
1542
+ readonly file_data: Schema.optionalKey<Schema.String>;
1543
+ }>]>>;
1544
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
1545
+ }>, Schema.Struct<{
1546
+ readonly type: Schema.Literal<"reasoning">;
1547
+ readonly id: Schema.String;
1548
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1549
+ readonly summary: Schema.$Array<Schema.Struct<{
1550
+ readonly type: Schema.Literal<"summary_text">;
1551
+ readonly text: Schema.String;
1552
+ }>>;
1553
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1554
+ readonly type: Schema.Literal<"reasoning_text">;
1555
+ readonly text: Schema.String;
1556
+ }>>>;
1557
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1558
+ }>, Schema.Struct<{
1559
+ readonly id: Schema.optionalKey<Schema.String>;
1560
+ readonly type: Schema.Literal<"shell_call">;
1561
+ readonly call_id: Schema.String;
1562
+ readonly action: Schema.Unknown;
1563
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1564
+ }>, Schema.Struct<{
1565
+ readonly id: Schema.String;
1566
+ readonly type: Schema.Literal<"web_search_call">;
1567
+ readonly action: Schema.optionalKey<Schema.Unknown>;
1568
+ readonly status: Schema.optionalKey<Schema.String>;
1569
+ }>]>>, never>;
1570
+ readonly usage: Schema.optionalKey<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
1571
+ readonly input_tokens: Schema.Number;
1572
+ readonly output_tokens: Schema.Number;
1573
+ readonly total_tokens: Schema.Number;
1574
+ readonly input_tokens_details: Schema.optionalKey<Schema.Unknown>;
1575
+ readonly output_tokens_details: Schema.optionalKey<Schema.Unknown>;
1576
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
1577
+ readonly incomplete_details: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
1578
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["max_output_tokens", "content_filter"]>>;
1579
+ }>>>;
1580
+ readonly service_tier: Schema.optionalKey<Schema.String>;
1581
+ }>;
1582
+ readonly sequence_number: Schema.Number;
1583
+ }>, Schema.Struct<{
1584
+ readonly type: Schema.Literal<"response.failed">;
1585
+ readonly response: Schema.Struct<{
1586
+ readonly id: Schema.String;
1587
+ readonly object: Schema.optionalKey<Schema.Literal<"response">>;
1588
+ readonly model: Schema.String;
1589
+ readonly created_at: Schema.Number;
1590
+ readonly output: Schema.withDecodingDefault<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1591
+ readonly id: Schema.String;
1592
+ readonly type: Schema.Literal<"apply_patch_call">;
1593
+ readonly call_id: Schema.String;
1594
+ readonly operation: Schema.Struct<{
1595
+ readonly type: Schema.String;
1596
+ readonly path: Schema.String;
1597
+ readonly diff: Schema.optionalKey<Schema.String>;
1598
+ }>;
1599
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1600
+ }>, Schema.Struct<{
1601
+ readonly id: Schema.String;
1602
+ readonly type: Schema.Literal<"code_interpreter_call">;
1603
+ readonly code: Schema.optionalKey<Schema.String>;
1604
+ readonly container_id: Schema.String;
1605
+ readonly outputs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1606
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1607
+ }>, Schema.Struct<{
1608
+ readonly id: Schema.String;
1609
+ readonly type: Schema.Literal<"computer_call">;
1610
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1611
+ }>, Schema.Struct<{
1612
+ readonly id: Schema.String;
1613
+ readonly type: Schema.Literal<"file_search_call">;
1614
+ readonly status: Schema.optionalKey<Schema.String>;
1615
+ readonly queries: Schema.optionalKey<Schema.$Array<Schema.String>>;
1616
+ readonly results: Schema.optionalKey<Schema.NullOr<Schema.Unknown>>;
1617
+ }>, Schema.Struct<{
1618
+ readonly id: Schema.optionalKey<Schema.String>;
1619
+ readonly type: Schema.Literal<"function_call">;
1620
+ readonly call_id: Schema.String;
1621
+ readonly name: Schema.String;
1622
+ readonly arguments: Schema.String;
1623
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1624
+ }>, Schema.Struct<{
1625
+ readonly id: Schema.String;
1626
+ readonly type: Schema.Literal<"image_generation_call">;
1627
+ readonly result: Schema.optionalKey<Schema.String>;
1628
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1629
+ }>, Schema.Struct<{
1630
+ readonly id: Schema.optionalKey<Schema.String>;
1631
+ readonly type: Schema.Literal<"local_shell_call">;
1632
+ readonly call_id: Schema.String;
1633
+ readonly action: Schema.Unknown;
1634
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1635
+ }>, Schema.Struct<{
1636
+ readonly id: Schema.String;
1637
+ readonly type: Schema.Literal<"mcp_call">;
1638
+ readonly approval_request_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1639
+ readonly name: Schema.String;
1640
+ readonly arguments: Schema.Unknown;
1641
+ readonly output: Schema.optionalKey<Schema.Unknown>;
1642
+ readonly error: Schema.optionalKey<Schema.Unknown>;
1643
+ readonly server_label: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1644
+ }>, Schema.Struct<{
1645
+ readonly id: Schema.String;
1646
+ readonly type: Schema.Literal<"mcp_list_tools">;
1647
+ }>, Schema.Struct<{
1648
+ readonly id: Schema.String;
1649
+ readonly type: Schema.Literal<"mcp_approval_request">;
1650
+ readonly approval_request_id: Schema.optionalKey<Schema.String>;
1651
+ readonly name: Schema.String;
1652
+ readonly arguments: Schema.Unknown;
1653
+ }>, Schema.Struct<{
1654
+ readonly id: Schema.String;
1655
+ readonly type: Schema.Literal<"message">;
1656
+ readonly role: Schema.Literal<"assistant">;
1657
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1658
+ readonly type: Schema.Literal<"input_text">;
1659
+ readonly text: Schema.String;
1660
+ }>, Schema.Struct<{
1661
+ readonly type: Schema.Literal<"output_text">;
1662
+ readonly text: Schema.String;
1663
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1664
+ readonly type: Schema.Literal<"file_citation">;
1665
+ readonly file_id: Schema.String;
1666
+ readonly index: Schema.Number;
1667
+ readonly filename: Schema.String;
1668
+ }>, Schema.Struct<{
1669
+ readonly type: Schema.Literal<"url_citation">;
1670
+ readonly url: Schema.String;
1671
+ readonly start_index: Schema.Number;
1672
+ readonly end_index: Schema.Number;
1673
+ readonly title: Schema.String;
1674
+ }>, Schema.Struct<{
1675
+ readonly type: Schema.Literal<"container_file_citation">;
1676
+ readonly container_id: Schema.String;
1677
+ readonly file_id: Schema.String;
1678
+ readonly start_index: Schema.Number;
1679
+ readonly end_index: Schema.Number;
1680
+ readonly filename: Schema.String;
1681
+ }>, Schema.Struct<{
1682
+ readonly type: Schema.Literal<"file_path">;
1683
+ readonly file_id: Schema.String;
1684
+ readonly index: Schema.Number;
1685
+ }>]>>;
1686
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1687
+ }>, Schema.Struct<{
1688
+ readonly type: Schema.Literal<"text">;
1689
+ readonly text: Schema.String;
1690
+ }>, Schema.Struct<{
1691
+ readonly type: Schema.Literal<"summary_text">;
1692
+ readonly text: Schema.String;
1693
+ }>, Schema.Struct<{
1694
+ readonly type: Schema.Literal<"reasoning_text">;
1695
+ readonly text: Schema.String;
1696
+ }>, Schema.Struct<{
1697
+ readonly type: Schema.Literal<"refusal">;
1698
+ readonly refusal: Schema.String;
1699
+ }>, Schema.Struct<{
1700
+ readonly type: Schema.Literal<"input_image">;
1701
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1702
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1703
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
1704
+ }>, Schema.Struct<{
1705
+ readonly type: Schema.Literal<"computer_screenshot">;
1706
+ readonly image_url: Schema.NullOr<Schema.String>;
1707
+ readonly file_id: Schema.NullOr<Schema.String>;
1708
+ }>, Schema.Struct<{
1709
+ readonly type: Schema.Literal<"input_file">;
1710
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1711
+ readonly filename: Schema.optionalKey<Schema.String>;
1712
+ readonly file_url: Schema.optionalKey<Schema.String>;
1713
+ readonly file_data: Schema.optionalKey<Schema.String>;
1714
+ }>]>>;
1715
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
1716
+ }>, Schema.Struct<{
1717
+ readonly type: Schema.Literal<"reasoning">;
1718
+ readonly id: Schema.String;
1719
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1720
+ readonly summary: Schema.$Array<Schema.Struct<{
1721
+ readonly type: Schema.Literal<"summary_text">;
1722
+ readonly text: Schema.String;
1723
+ }>>;
1724
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1725
+ readonly type: Schema.Literal<"reasoning_text">;
1726
+ readonly text: Schema.String;
1727
+ }>>>;
1728
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1729
+ }>, Schema.Struct<{
1730
+ readonly id: Schema.optionalKey<Schema.String>;
1731
+ readonly type: Schema.Literal<"shell_call">;
1732
+ readonly call_id: Schema.String;
1733
+ readonly action: Schema.Unknown;
1734
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1735
+ }>, Schema.Struct<{
1736
+ readonly id: Schema.String;
1737
+ readonly type: Schema.Literal<"web_search_call">;
1738
+ readonly action: Schema.optionalKey<Schema.Unknown>;
1739
+ readonly status: Schema.optionalKey<Schema.String>;
1740
+ }>]>>, never>;
1741
+ readonly usage: Schema.optionalKey<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
1742
+ readonly input_tokens: Schema.Number;
1743
+ readonly output_tokens: Schema.Number;
1744
+ readonly total_tokens: Schema.Number;
1745
+ readonly input_tokens_details: Schema.optionalKey<Schema.Unknown>;
1746
+ readonly output_tokens_details: Schema.optionalKey<Schema.Unknown>;
1747
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
1748
+ readonly incomplete_details: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
1749
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["max_output_tokens", "content_filter"]>>;
1750
+ }>>>;
1751
+ readonly service_tier: Schema.optionalKey<Schema.String>;
1752
+ }>;
1753
+ readonly sequence_number: Schema.Number;
1754
+ }>, Schema.Struct<{
1755
+ readonly type: Schema.Literal<"response.output_item.added">;
1756
+ readonly output_index: Schema.Number;
1757
+ readonly sequence_number: Schema.Number;
1758
+ readonly item: Schema.Union<readonly [Schema.Struct<{
1759
+ readonly id: Schema.String;
1760
+ readonly type: Schema.Literal<"apply_patch_call">;
1761
+ readonly call_id: Schema.String;
1762
+ readonly operation: Schema.Struct<{
1763
+ readonly type: Schema.String;
1764
+ readonly path: Schema.String;
1765
+ readonly diff: Schema.optionalKey<Schema.String>;
1766
+ }>;
1767
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1768
+ }>, Schema.Struct<{
1769
+ readonly id: Schema.String;
1770
+ readonly type: Schema.Literal<"code_interpreter_call">;
1771
+ readonly code: Schema.optionalKey<Schema.String>;
1772
+ readonly container_id: Schema.String;
1773
+ readonly outputs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1774
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1775
+ }>, Schema.Struct<{
1776
+ readonly id: Schema.String;
1777
+ readonly type: Schema.Literal<"computer_call">;
1778
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1779
+ }>, Schema.Struct<{
1780
+ readonly id: Schema.String;
1781
+ readonly type: Schema.Literal<"file_search_call">;
1782
+ readonly status: Schema.optionalKey<Schema.String>;
1783
+ readonly queries: Schema.optionalKey<Schema.$Array<Schema.String>>;
1784
+ readonly results: Schema.optionalKey<Schema.NullOr<Schema.Unknown>>;
1785
+ }>, Schema.Struct<{
1786
+ readonly id: Schema.optionalKey<Schema.String>;
1787
+ readonly type: Schema.Literal<"function_call">;
1788
+ readonly call_id: Schema.String;
1789
+ readonly name: Schema.String;
1790
+ readonly arguments: Schema.String;
1791
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1792
+ }>, Schema.Struct<{
1793
+ readonly id: Schema.String;
1794
+ readonly type: Schema.Literal<"image_generation_call">;
1795
+ readonly result: Schema.optionalKey<Schema.String>;
1796
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1797
+ }>, Schema.Struct<{
1798
+ readonly id: Schema.optionalKey<Schema.String>;
1799
+ readonly type: Schema.Literal<"local_shell_call">;
1800
+ readonly call_id: Schema.String;
1801
+ readonly action: Schema.Unknown;
1802
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1803
+ }>, Schema.Struct<{
1804
+ readonly id: Schema.String;
1805
+ readonly type: Schema.Literal<"mcp_call">;
1806
+ readonly approval_request_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1807
+ readonly name: Schema.String;
1808
+ readonly arguments: Schema.Unknown;
1809
+ readonly output: Schema.optionalKey<Schema.Unknown>;
1810
+ readonly error: Schema.optionalKey<Schema.Unknown>;
1811
+ readonly server_label: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1812
+ }>, Schema.Struct<{
1813
+ readonly id: Schema.String;
1814
+ readonly type: Schema.Literal<"mcp_list_tools">;
1815
+ }>, Schema.Struct<{
1816
+ readonly id: Schema.String;
1817
+ readonly type: Schema.Literal<"mcp_approval_request">;
1818
+ readonly approval_request_id: Schema.optionalKey<Schema.String>;
1819
+ readonly name: Schema.String;
1820
+ readonly arguments: Schema.Unknown;
1821
+ }>, Schema.Struct<{
1822
+ readonly id: Schema.String;
1823
+ readonly type: Schema.Literal<"message">;
1824
+ readonly role: Schema.Literal<"assistant">;
1825
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1826
+ readonly type: Schema.Literal<"input_text">;
1827
+ readonly text: Schema.String;
1828
+ }>, Schema.Struct<{
1829
+ readonly type: Schema.Literal<"output_text">;
1830
+ readonly text: Schema.String;
1831
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1832
+ readonly type: Schema.Literal<"file_citation">;
1833
+ readonly file_id: Schema.String;
1834
+ readonly index: Schema.Number;
1835
+ readonly filename: Schema.String;
1836
+ }>, Schema.Struct<{
1837
+ readonly type: Schema.Literal<"url_citation">;
1838
+ readonly url: Schema.String;
1839
+ readonly start_index: Schema.Number;
1840
+ readonly end_index: Schema.Number;
1841
+ readonly title: Schema.String;
1842
+ }>, Schema.Struct<{
1843
+ readonly type: Schema.Literal<"container_file_citation">;
1844
+ readonly container_id: Schema.String;
1845
+ readonly file_id: Schema.String;
1846
+ readonly start_index: Schema.Number;
1847
+ readonly end_index: Schema.Number;
1848
+ readonly filename: Schema.String;
1849
+ }>, Schema.Struct<{
1850
+ readonly type: Schema.Literal<"file_path">;
1851
+ readonly file_id: Schema.String;
1852
+ readonly index: Schema.Number;
1853
+ }>]>>;
1854
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1855
+ }>, Schema.Struct<{
1856
+ readonly type: Schema.Literal<"text">;
1857
+ readonly text: Schema.String;
1858
+ }>, Schema.Struct<{
1859
+ readonly type: Schema.Literal<"summary_text">;
1860
+ readonly text: Schema.String;
1861
+ }>, Schema.Struct<{
1862
+ readonly type: Schema.Literal<"reasoning_text">;
1863
+ readonly text: Schema.String;
1864
+ }>, Schema.Struct<{
1865
+ readonly type: Schema.Literal<"refusal">;
1866
+ readonly refusal: Schema.String;
1867
+ }>, Schema.Struct<{
1868
+ readonly type: Schema.Literal<"input_image">;
1869
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1870
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1871
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
1872
+ }>, Schema.Struct<{
1873
+ readonly type: Schema.Literal<"computer_screenshot">;
1874
+ readonly image_url: Schema.NullOr<Schema.String>;
1875
+ readonly file_id: Schema.NullOr<Schema.String>;
1876
+ }>, Schema.Struct<{
1877
+ readonly type: Schema.Literal<"input_file">;
1878
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1879
+ readonly filename: Schema.optionalKey<Schema.String>;
1880
+ readonly file_url: Schema.optionalKey<Schema.String>;
1881
+ readonly file_data: Schema.optionalKey<Schema.String>;
1882
+ }>]>>;
1883
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
1884
+ }>, Schema.Struct<{
1885
+ readonly type: Schema.Literal<"reasoning">;
1886
+ readonly id: Schema.String;
1887
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1888
+ readonly summary: Schema.$Array<Schema.Struct<{
1889
+ readonly type: Schema.Literal<"summary_text">;
1890
+ readonly text: Schema.String;
1891
+ }>>;
1892
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1893
+ readonly type: Schema.Literal<"reasoning_text">;
1894
+ readonly text: Schema.String;
1895
+ }>>>;
1896
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1897
+ }>, Schema.Struct<{
1898
+ readonly id: Schema.optionalKey<Schema.String>;
1899
+ readonly type: Schema.Literal<"shell_call">;
1900
+ readonly call_id: Schema.String;
1901
+ readonly action: Schema.Unknown;
1902
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1903
+ }>, Schema.Struct<{
1904
+ readonly id: Schema.String;
1905
+ readonly type: Schema.Literal<"web_search_call">;
1906
+ readonly action: Schema.optionalKey<Schema.Unknown>;
1907
+ readonly status: Schema.optionalKey<Schema.String>;
1908
+ }>]>;
1909
+ }>, Schema.Struct<{
1910
+ readonly type: Schema.Literal<"response.output_item.done">;
1911
+ readonly output_index: Schema.Number;
1912
+ readonly sequence_number: Schema.Number;
1913
+ readonly item: Schema.Union<readonly [Schema.Struct<{
1914
+ readonly id: Schema.String;
1915
+ readonly type: Schema.Literal<"apply_patch_call">;
1916
+ readonly call_id: Schema.String;
1917
+ readonly operation: Schema.Struct<{
1918
+ readonly type: Schema.String;
1919
+ readonly path: Schema.String;
1920
+ readonly diff: Schema.optionalKey<Schema.String>;
1921
+ }>;
1922
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1923
+ }>, Schema.Struct<{
1924
+ readonly id: Schema.String;
1925
+ readonly type: Schema.Literal<"code_interpreter_call">;
1926
+ readonly code: Schema.optionalKey<Schema.String>;
1927
+ readonly container_id: Schema.String;
1928
+ readonly outputs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
1929
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1930
+ }>, Schema.Struct<{
1931
+ readonly id: Schema.String;
1932
+ readonly type: Schema.Literal<"computer_call">;
1933
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1934
+ }>, Schema.Struct<{
1935
+ readonly id: Schema.String;
1936
+ readonly type: Schema.Literal<"file_search_call">;
1937
+ readonly status: Schema.optionalKey<Schema.String>;
1938
+ readonly queries: Schema.optionalKey<Schema.$Array<Schema.String>>;
1939
+ readonly results: Schema.optionalKey<Schema.NullOr<Schema.Unknown>>;
1940
+ }>, Schema.Struct<{
1941
+ readonly id: Schema.optionalKey<Schema.String>;
1942
+ readonly type: Schema.Literal<"function_call">;
1943
+ readonly call_id: Schema.String;
1944
+ readonly name: Schema.String;
1945
+ readonly arguments: Schema.String;
1946
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1947
+ }>, Schema.Struct<{
1948
+ readonly id: Schema.String;
1949
+ readonly type: Schema.Literal<"image_generation_call">;
1950
+ readonly result: Schema.optionalKey<Schema.String>;
1951
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1952
+ }>, Schema.Struct<{
1953
+ readonly id: Schema.optionalKey<Schema.String>;
1954
+ readonly type: Schema.Literal<"local_shell_call">;
1955
+ readonly call_id: Schema.String;
1956
+ readonly action: Schema.Unknown;
1957
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
1958
+ }>, Schema.Struct<{
1959
+ readonly id: Schema.String;
1960
+ readonly type: Schema.Literal<"mcp_call">;
1961
+ readonly approval_request_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1962
+ readonly name: Schema.String;
1963
+ readonly arguments: Schema.Unknown;
1964
+ readonly output: Schema.optionalKey<Schema.Unknown>;
1965
+ readonly error: Schema.optionalKey<Schema.Unknown>;
1966
+ readonly server_label: Schema.optionalKey<Schema.NullOr<Schema.String>>;
1967
+ }>, Schema.Struct<{
1968
+ readonly id: Schema.String;
1969
+ readonly type: Schema.Literal<"mcp_list_tools">;
1970
+ }>, Schema.Struct<{
1971
+ readonly id: Schema.String;
1972
+ readonly type: Schema.Literal<"mcp_approval_request">;
1973
+ readonly approval_request_id: Schema.optionalKey<Schema.String>;
1974
+ readonly name: Schema.String;
1975
+ readonly arguments: Schema.Unknown;
1976
+ }>, Schema.Struct<{
1977
+ readonly id: Schema.String;
1978
+ readonly type: Schema.Literal<"message">;
1979
+ readonly role: Schema.Literal<"assistant">;
1980
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1981
+ readonly type: Schema.Literal<"input_text">;
1982
+ readonly text: Schema.String;
1983
+ }>, Schema.Struct<{
1984
+ readonly type: Schema.Literal<"output_text">;
1985
+ readonly text: Schema.String;
1986
+ readonly annotations: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1987
+ readonly type: Schema.Literal<"file_citation">;
1988
+ readonly file_id: Schema.String;
1989
+ readonly index: Schema.Number;
1990
+ readonly filename: Schema.String;
1991
+ }>, Schema.Struct<{
1992
+ readonly type: Schema.Literal<"url_citation">;
1993
+ readonly url: Schema.String;
1994
+ readonly start_index: Schema.Number;
1995
+ readonly end_index: Schema.Number;
1996
+ readonly title: Schema.String;
1997
+ }>, Schema.Struct<{
1998
+ readonly type: Schema.Literal<"container_file_citation">;
1999
+ readonly container_id: Schema.String;
2000
+ readonly file_id: Schema.String;
2001
+ readonly start_index: Schema.Number;
2002
+ readonly end_index: Schema.Number;
2003
+ readonly filename: Schema.String;
2004
+ }>, Schema.Struct<{
2005
+ readonly type: Schema.Literal<"file_path">;
2006
+ readonly file_id: Schema.String;
2007
+ readonly index: Schema.Number;
2008
+ }>]>>;
2009
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
2010
+ }>, Schema.Struct<{
2011
+ readonly type: Schema.Literal<"text">;
2012
+ readonly text: Schema.String;
2013
+ }>, Schema.Struct<{
2014
+ readonly type: Schema.Literal<"summary_text">;
2015
+ readonly text: Schema.String;
2016
+ }>, Schema.Struct<{
2017
+ readonly type: Schema.Literal<"reasoning_text">;
2018
+ readonly text: Schema.String;
2019
+ }>, Schema.Struct<{
2020
+ readonly type: Schema.Literal<"refusal">;
2021
+ readonly refusal: Schema.String;
2022
+ }>, Schema.Struct<{
2023
+ readonly type: Schema.Literal<"input_image">;
2024
+ readonly image_url: Schema.optionalKey<Schema.NullOr<Schema.String>>;
2025
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
2026
+ readonly detail: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["low", "high", "auto"]>>>;
2027
+ }>, Schema.Struct<{
2028
+ readonly type: Schema.Literal<"computer_screenshot">;
2029
+ readonly image_url: Schema.NullOr<Schema.String>;
2030
+ readonly file_id: Schema.NullOr<Schema.String>;
2031
+ }>, Schema.Struct<{
2032
+ readonly type: Schema.Literal<"input_file">;
2033
+ readonly file_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
2034
+ readonly filename: Schema.optionalKey<Schema.String>;
2035
+ readonly file_url: Schema.optionalKey<Schema.String>;
2036
+ readonly file_data: Schema.optionalKey<Schema.String>;
2037
+ }>]>>;
2038
+ readonly status: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
2039
+ }>, Schema.Struct<{
2040
+ readonly type: Schema.Literal<"reasoning">;
2041
+ readonly id: Schema.String;
2042
+ readonly encrypted_content: Schema.optionalKey<Schema.NullOr<Schema.String>>;
2043
+ readonly summary: Schema.$Array<Schema.Struct<{
2044
+ readonly type: Schema.Literal<"summary_text">;
2045
+ readonly text: Schema.String;
2046
+ }>>;
2047
+ readonly content: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2048
+ readonly type: Schema.Literal<"reasoning_text">;
2049
+ readonly text: Schema.String;
2050
+ }>>>;
2051
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
2052
+ }>, Schema.Struct<{
2053
+ readonly id: Schema.optionalKey<Schema.String>;
2054
+ readonly type: Schema.Literal<"shell_call">;
2055
+ readonly call_id: Schema.String;
2056
+ readonly action: Schema.Unknown;
2057
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
2058
+ }>, Schema.Struct<{
2059
+ readonly id: Schema.String;
2060
+ readonly type: Schema.Literal<"web_search_call">;
2061
+ readonly action: Schema.optionalKey<Schema.Unknown>;
2062
+ readonly status: Schema.optionalKey<Schema.String>;
2063
+ }>]>;
2064
+ }>, Schema.Struct<{
2065
+ readonly type: Schema.Literal<"response.output_text.delta">;
2066
+ readonly item_id: Schema.String;
2067
+ readonly output_index: Schema.Number;
2068
+ readonly content_index: Schema.Number;
2069
+ readonly delta: Schema.String;
2070
+ readonly sequence_number: Schema.Number;
2071
+ readonly logprobs: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
2072
+ }>, Schema.Struct<{
2073
+ readonly type: Schema.Literal<"response.output_text.annotation.added">;
2074
+ readonly item_id: Schema.String;
2075
+ readonly output_index: Schema.Number;
2076
+ readonly content_index: Schema.Number;
2077
+ readonly annotation_index: Schema.Number;
2078
+ readonly sequence_number: Schema.Number;
2079
+ readonly annotation: Schema.Union<readonly [Schema.Struct<{
2080
+ readonly type: Schema.Literal<"file_citation">;
2081
+ readonly file_id: Schema.String;
2082
+ readonly index: Schema.Number;
2083
+ readonly filename: Schema.String;
2084
+ }>, Schema.Struct<{
2085
+ readonly type: Schema.Literal<"url_citation">;
2086
+ readonly url: Schema.String;
2087
+ readonly start_index: Schema.Number;
2088
+ readonly end_index: Schema.Number;
2089
+ readonly title: Schema.String;
2090
+ }>, Schema.Struct<{
2091
+ readonly type: Schema.Literal<"container_file_citation">;
2092
+ readonly container_id: Schema.String;
2093
+ readonly file_id: Schema.String;
2094
+ readonly start_index: Schema.Number;
2095
+ readonly end_index: Schema.Number;
2096
+ readonly filename: Schema.String;
2097
+ }>, Schema.Struct<{
2098
+ readonly type: Schema.Literal<"file_path">;
2099
+ readonly file_id: Schema.String;
2100
+ readonly index: Schema.Number;
2101
+ }>]>;
2102
+ }>, Schema.Struct<{
2103
+ readonly type: Schema.Literal<"response.reasoning_summary_part.added">;
2104
+ readonly item_id: Schema.String;
2105
+ readonly output_index: Schema.Number;
2106
+ readonly summary_index: Schema.Number;
2107
+ readonly sequence_number: Schema.Number;
2108
+ readonly part: Schema.Struct<{
2109
+ readonly type: Schema.Literal<"summary_text">;
2110
+ readonly text: Schema.String;
2111
+ }>;
2112
+ }>, Schema.Struct<{
2113
+ readonly type: Schema.Literal<"response.reasoning_summary_part.done">;
2114
+ readonly item_id: Schema.String;
2115
+ readonly output_index: Schema.Number;
2116
+ readonly summary_index: Schema.Number;
2117
+ readonly sequence_number: Schema.Number;
2118
+ readonly part: Schema.Struct<{
2119
+ readonly type: Schema.Literal<"summary_text">;
2120
+ readonly text: Schema.String;
2121
+ }>;
2122
+ }>, Schema.Struct<{
2123
+ readonly type: Schema.Literal<"response.reasoning_summary_text.delta">;
2124
+ readonly item_id: Schema.String;
2125
+ readonly output_index: Schema.Number;
2126
+ readonly summary_index: Schema.Number;
2127
+ readonly delta: Schema.String;
2128
+ readonly sequence_number: Schema.Number;
2129
+ }>, Schema.Struct<{
2130
+ readonly type: Schema.Literal<"response.function_call_arguments.delta">;
2131
+ readonly item_id: Schema.String;
2132
+ readonly output_index: Schema.Number;
2133
+ readonly sequence_number: Schema.Number;
2134
+ readonly delta: Schema.String;
2135
+ }>, Schema.Struct<{
2136
+ readonly type: Schema.Literal<"response.function_call_arguments.done">;
2137
+ readonly item_id: Schema.String;
2138
+ readonly output_index: Schema.Number;
2139
+ readonly sequence_number: Schema.Number;
2140
+ readonly arguments: Schema.String;
2141
+ }>, Schema.Struct<{
2142
+ readonly type: Schema.Literal<"response.code_interpreter_call_code.delta">;
2143
+ readonly item_id: Schema.String;
2144
+ readonly output_index: Schema.Number;
2145
+ readonly sequence_number: Schema.Number;
2146
+ readonly delta: Schema.String;
2147
+ }>, Schema.Struct<{
2148
+ readonly type: Schema.Literal<"response.code_interpreter_call_code.done">;
2149
+ readonly item_id: Schema.String;
2150
+ readonly output_index: Schema.Number;
2151
+ readonly sequence_number: Schema.Number;
2152
+ readonly code: Schema.String;
2153
+ }>, Schema.Struct<{
2154
+ readonly type: Schema.Literal<"response.apply_patch_call_operation_diff.delta">;
2155
+ readonly item_id: Schema.String;
2156
+ readonly output_index: Schema.Number;
2157
+ readonly sequence_number: Schema.Number;
2158
+ readonly delta: Schema.String;
2159
+ }>, Schema.Struct<{
2160
+ readonly type: Schema.Literal<"response.apply_patch_call_operation_diff.done">;
2161
+ readonly item_id: Schema.String;
2162
+ readonly output_index: Schema.Number;
2163
+ readonly sequence_number: Schema.Number;
2164
+ readonly delta: Schema.optionalKey<Schema.String>;
2165
+ }>, Schema.Struct<{
2166
+ readonly type: Schema.Literal<"response.image_generation_call.partial_image">;
2167
+ readonly item_id: Schema.String;
2168
+ readonly output_index: Schema.Number;
2169
+ readonly sequence_number: Schema.Number;
2170
+ readonly partial_image_b64: Schema.String;
2171
+ }>, Schema.Struct<{
2172
+ readonly type: Schema.Literal<"error">;
2173
+ readonly code: Schema.NullOr<Schema.String>;
2174
+ readonly message: Schema.String;
2175
+ readonly param: Schema.NullOr<Schema.String>;
2176
+ readonly sequence_number: Schema.Number;
2177
+ readonly status: Schema.optionalKey<Schema.Number>;
2178
+ }>, Schema.declare<UnknownResponseStreamEvent, UnknownResponseStreamEvent>]>;
2179
+ /**
2180
+ * Server-sent event shape emitted by OpenAI Responses API streams.
2181
+ *
2182
+ * **When to use**
2183
+ *
2184
+ * Use when typing events from a streaming OpenAI Responses API request.
2185
+ *
2186
+ * **Details**
2187
+ *
2188
+ * Includes known response stream events plus a fallback shape for unknown future
2189
+ * event types.
2190
+ *
2191
+ * @category models
2192
+ * @since 4.0.0
2193
+ */
2194
+ export type ResponseStreamEvent = typeof ResponseStreamEvent.Type;
2195
+ /**
2196
+ * Schema for one embedding item returned by the OpenAI embeddings API.
2197
+ *
2198
+ * **When to use**
2199
+ *
2200
+ * Use when validating individual embedding entries at the OpenAI client boundary
2201
+ * before assuming the embedding payload is a numeric vector.
2202
+ *
2203
+ * **Details**
2204
+ *
2205
+ * An embedding item contains its `index`, optional `object` marker, and an
2206
+ * `embedding` represented either as a numeric vector or as a string.
2207
+ *
2208
+ * **Gotchas**
2209
+ *
2210
+ * Callers that need numeric vectors must account for string embeddings, such as
2211
+ * base64-encoded embeddings returned for string encoding formats.
2212
+ *
2213
+ * @category schemas
2214
+ * @since 4.0.0
2215
+ */
2216
+ export declare const Embedding: Schema.Struct<{
2217
+ readonly embedding: Schema.Union<readonly [Schema.$Array<Schema.Number>, Schema.String]>;
2218
+ readonly index: Schema.Number;
2219
+ readonly object: Schema.optionalKey<Schema.String>;
2220
+ }>;
2221
+ /**
2222
+ * One embedding item returned by the OpenAI embeddings API.
2223
+ *
2224
+ * **Details**
2225
+ *
2226
+ * Contains the item index and embedding payload. The embedding payload may be a
2227
+ * numeric vector or a string.
2228
+ *
2229
+ * @category models
2230
+ * @since 4.0.0
2231
+ */
2232
+ export type Embedding = typeof Embedding.Type;
2233
+ /**
2234
+ * Schema for the request payload sent to the OpenAI embeddings endpoint.
2235
+ *
2236
+ * **When to use**
2237
+ *
2238
+ * Use when validating or encoding embeddings requests before sending them to
2239
+ * OpenAI, while leaving model-specific limits to the provider.
2240
+ *
2241
+ * **Details**
2242
+ *
2243
+ * Requires `input` and `model`. `input` may be a string, an array of strings,
2244
+ * a token array, or an array of token arrays. Optional fields configure the
2245
+ * embedding encoding format, requested dimensions, and user identifier.
2246
+ *
2247
+ * **Gotchas**
2248
+ *
2249
+ * This schema validates the transport shape, but OpenAI still enforces
2250
+ * provider-side constraints such as non-empty input, integer token ids, input
2251
+ * size limits, positive dimensions, and model-specific dimension support.
2252
+ *
2253
+ * @category schemas
2254
+ * @since 4.0.0
2255
+ */
2256
+ export declare const CreateEmbeddingRequest: Schema.Struct<{
2257
+ readonly input: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.String>, Schema.$Array<Schema.Number>, Schema.$Array<Schema.$Array<Schema.Number>>]>;
2258
+ readonly model: Schema.String;
2259
+ readonly encoding_format: Schema.optionalKey<Schema.Literals<readonly ["float", "base64"]>>;
2260
+ readonly dimensions: Schema.optionalKey<Schema.Number>;
2261
+ readonly user: Schema.optionalKey<Schema.String>;
2262
+ }>;
2263
+ /**
2264
+ * Request payload sent to the OpenAI embeddings endpoint.
2265
+ *
2266
+ * @category models
2267
+ * @since 4.0.0
2268
+ */
2269
+ export type CreateEmbeddingRequest = typeof CreateEmbeddingRequest.Type;
2270
+ /**
2271
+ * Schema for a successful response payload returned by the OpenAI embeddings endpoint.
2272
+ *
2273
+ * **When to use**
2274
+ *
2275
+ * Use when you need to validate embeddings responses at an OpenAI client
2276
+ * boundary before trusting item shapes, especially when numeric and string
2277
+ * embeddings are both allowed.
2278
+ *
2279
+ * **Details**
2280
+ *
2281
+ * The response contains an array of `Embedding` items, the model name, an
2282
+ * optional `object: "list"` marker, and optional token usage counts for prompt
2283
+ * and total tokens.
2284
+ *
2285
+ * **Gotchas**
2286
+ *
2287
+ * Each `Embedding` may contain either a numeric vector or a string embedding.
2288
+ * Callers that require numeric vectors must account for string embeddings.
2289
+ *
2290
+ * @see {@link CreateEmbeddingRequest} for the request schema sent to the embeddings endpoint
2291
+ * @see {@link Embedding} for individual embedding items in the response
2292
+ *
2293
+ * @category schemas
2294
+ * @since 4.0.0
2295
+ */
2296
+ export declare const CreateEmbeddingResponse: Schema.Struct<{
2297
+ readonly data: Schema.$Array<Schema.Struct<{
2298
+ readonly embedding: Schema.Union<readonly [Schema.$Array<Schema.Number>, Schema.String]>;
2299
+ readonly index: Schema.Number;
2300
+ readonly object: Schema.optionalKey<Schema.String>;
2301
+ }>>;
2302
+ readonly model: Schema.String;
2303
+ readonly object: Schema.optionalKey<Schema.Literal<"list">>;
2304
+ readonly usage: Schema.optionalKey<Schema.Struct<{
2305
+ readonly prompt_tokens: Schema.Number;
2306
+ readonly total_tokens: Schema.Number;
2307
+ }>>;
2308
+ }>;
2309
+ /**
2310
+ * Successful response payload returned by the OpenAI embeddings endpoint.
2311
+ *
2312
+ * **When to use**
2313
+ *
2314
+ * Use when typing successful OpenAI embeddings responses.
2315
+ *
2316
+ * **Details**
2317
+ *
2318
+ * Contains embedding items, the model name, optional list marker, and optional
2319
+ * token usage counts.
2320
+ *
2321
+ * @category models
2322
+ * @since 4.0.0
2323
+ */
2324
+ export type CreateEmbeddingResponse = typeof CreateEmbeddingResponse.Type;
2325
+ //# sourceMappingURL=OpenAiSchema.d.ts.map