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