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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/Generated.d.ts +66675 -37672
  2. package/dist/Generated.d.ts.map +1 -1
  3. package/dist/Generated.js +1 -1
  4. package/dist/Generated.js.map +1 -1
  5. package/dist/OpenAiClient.d.ts +170 -29
  6. package/dist/OpenAiClient.d.ts.map +1 -1
  7. package/dist/OpenAiClient.js +321 -46
  8. package/dist/OpenAiClient.js.map +1 -1
  9. package/dist/OpenAiClientGenerated.d.ts +91 -0
  10. package/dist/OpenAiClientGenerated.d.ts.map +1 -0
  11. package/dist/OpenAiClientGenerated.js +84 -0
  12. package/dist/OpenAiClientGenerated.js.map +1 -0
  13. package/dist/OpenAiConfig.d.ts +88 -10
  14. package/dist/OpenAiConfig.d.ts.map +1 -1
  15. package/dist/OpenAiConfig.js +42 -7
  16. package/dist/OpenAiConfig.js.map +1 -1
  17. package/dist/OpenAiEmbeddingModel.d.ts +188 -0
  18. package/dist/OpenAiEmbeddingModel.d.ts.map +1 -0
  19. package/dist/OpenAiEmbeddingModel.js +194 -0
  20. package/dist/OpenAiEmbeddingModel.js.map +1 -0
  21. package/dist/OpenAiError.d.ts +168 -35
  22. package/dist/OpenAiError.d.ts.map +1 -1
  23. package/dist/OpenAiError.js +1 -1
  24. package/dist/OpenAiLanguageModel.d.ts +357 -63
  25. package/dist/OpenAiLanguageModel.d.ts.map +1 -1
  26. package/dist/OpenAiLanguageModel.js +390 -168
  27. package/dist/OpenAiLanguageModel.js.map +1 -1
  28. package/dist/OpenAiSchema.d.ts +2325 -0
  29. package/dist/OpenAiSchema.d.ts.map +1 -0
  30. package/dist/OpenAiSchema.js +811 -0
  31. package/dist/OpenAiSchema.js.map +1 -0
  32. package/dist/OpenAiTelemetry.d.ts +63 -22
  33. package/dist/OpenAiTelemetry.d.ts.map +1 -1
  34. package/dist/OpenAiTelemetry.js +20 -10
  35. package/dist/OpenAiTelemetry.js.map +1 -1
  36. package/dist/OpenAiTool.d.ts +148 -62
  37. package/dist/OpenAiTool.d.ts.map +1 -1
  38. package/dist/OpenAiTool.js +125 -39
  39. package/dist/OpenAiTool.js.map +1 -1
  40. package/dist/index.d.ts +19 -33
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +19 -33
  43. package/dist/index.js.map +1 -1
  44. package/dist/internal/errors.js +4 -4
  45. package/dist/internal/errors.js.map +1 -1
  46. package/package.json +3 -3
  47. package/src/Generated.ts +9717 -4887
  48. package/src/OpenAiClient.ts +499 -98
  49. package/src/OpenAiClientGenerated.ts +202 -0
  50. package/src/OpenAiConfig.ts +89 -11
  51. package/src/OpenAiEmbeddingModel.ts +332 -0
  52. package/src/OpenAiError.ts +170 -35
  53. package/src/OpenAiLanguageModel.ts +776 -169
  54. package/src/OpenAiSchema.ts +1286 -0
  55. package/src/OpenAiTelemetry.ts +69 -28
  56. package/src/OpenAiTool.ts +126 -40
  57. package/src/index.ts +22 -33
  58. package/src/internal/errors.ts +6 -4
@@ -0,0 +1,811 @@
1
+ /**
2
+ * The `OpenAiSchema` module defines the request, response, streaming, and
3
+ * embedding schemas used by the handwritten OpenAI client. These schemas are
4
+ * the transport boundary for JSON sent to and decoded from the Responses and
5
+ * embeddings endpoints.
6
+ *
7
+ * @since 4.0.0
8
+ */
9
+ import * as Effect from "effect/Effect";
10
+ import * as Predicate from "effect/Predicate";
11
+ import * as Schema from "effect/Schema";
12
+ const UnknownRecord = /*#__PURE__*/Schema.Record(Schema.String, Schema.Unknown);
13
+ const JsonObject = /*#__PURE__*/Schema.Record(Schema.String, Schema.Unknown);
14
+ const MessageRole = /*#__PURE__*/Schema.Literals(["system", "developer", "user", "assistant"]);
15
+ const ImageDetail = /*#__PURE__*/Schema.Literals(["low", "high", "auto"]);
16
+ /**
17
+ * Schema for optional `include` values supported by the local handwritten
18
+ * Responses client schema.
19
+ *
20
+ * **Details**
21
+ *
22
+ * These values request additional response fields such as image URLs, encrypted
23
+ * reasoning content, output logprobs, code interpreter outputs, or web search
24
+ * sources. This schema enumerates the include values supported by this client
25
+ * path.
26
+ *
27
+ * @category schemas
28
+ * @since 4.0.0
29
+ */
30
+ export const IncludeEnum = /*#__PURE__*/Schema.Literals(["message.input_image.image_url", "reasoning.encrypted_content", "message.output_text.logprobs", "code_interpreter_call.outputs", "web_search_call.action.sources"]);
31
+ /**
32
+ * Schema for lifecycle statuses shared by messages, reasoning items, and tool calls.
33
+ *
34
+ * **Details**
35
+ *
36
+ * Accepted values are `"in_progress"`, `"completed"`, and `"incomplete"`.
37
+ * This item-level status is used by message, reasoning, and tool-call shapes.
38
+ *
39
+ * @category schemas
40
+ * @since 4.0.0
41
+ */
42
+ export const MessageStatus = /*#__PURE__*/Schema.Literals(["in_progress", "completed", "incomplete"]);
43
+ const InputTextContent = /*#__PURE__*/Schema.Struct({
44
+ type: /*#__PURE__*/Schema.Literal("input_text"),
45
+ text: Schema.String
46
+ });
47
+ const InputImageContent = /*#__PURE__*/Schema.Struct({
48
+ type: /*#__PURE__*/Schema.Literal("input_image"),
49
+ image_url: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String)),
50
+ file_id: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String)),
51
+ detail: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(ImageDetail))
52
+ });
53
+ const InputFileContent = /*#__PURE__*/Schema.Struct({
54
+ type: /*#__PURE__*/Schema.Literal("input_file"),
55
+ file_id: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String)),
56
+ filename: /*#__PURE__*/Schema.optionalKey(Schema.String),
57
+ file_url: /*#__PURE__*/Schema.optionalKey(Schema.String),
58
+ file_data: /*#__PURE__*/Schema.optionalKey(Schema.String)
59
+ });
60
+ /**
61
+ * Schema for content blocks accepted in OpenAI Responses input messages.
62
+ *
63
+ * **Details**
64
+ *
65
+ * Accepted block variants are `input_text`, `input_image`, and `input_file`.
66
+ *
67
+ * @see {@link InputItem} for request input item shapes that can contain these content blocks
68
+ *
69
+ * @category schemas
70
+ * @since 4.0.0
71
+ */
72
+ export const InputContent = /*#__PURE__*/Schema.Union([InputTextContent, InputImageContent, InputFileContent]);
73
+ /**
74
+ * Schema for a text block containing a model-provided reasoning summary.
75
+ *
76
+ * **Details**
77
+ *
78
+ * The decoded shape is `type: "summary_text"` plus `text` containing the
79
+ * reasoning summary text.
80
+ *
81
+ * @see {@link ReasoningItem} for reasoning output items that contain summary text blocks
82
+ *
83
+ * @category schemas
84
+ * @since 4.0.0
85
+ */
86
+ export const SummaryTextContent = /*#__PURE__*/Schema.Struct({
87
+ type: /*#__PURE__*/Schema.Literal("summary_text"),
88
+ text: Schema.String
89
+ });
90
+ const ReasoningTextContent = /*#__PURE__*/Schema.Struct({
91
+ type: /*#__PURE__*/Schema.Literal("reasoning_text"),
92
+ text: Schema.String
93
+ });
94
+ const RefusalContent = /*#__PURE__*/Schema.Struct({
95
+ type: /*#__PURE__*/Schema.Literal("refusal"),
96
+ refusal: Schema.String
97
+ });
98
+ const TextContent = /*#__PURE__*/Schema.Struct({
99
+ type: /*#__PURE__*/Schema.Literal("text"),
100
+ text: Schema.String
101
+ });
102
+ const ComputerScreenshotContent = /*#__PURE__*/Schema.Struct({
103
+ type: /*#__PURE__*/Schema.Literal("computer_screenshot"),
104
+ image_url: /*#__PURE__*/Schema.NullOr(Schema.String),
105
+ file_id: /*#__PURE__*/Schema.NullOr(Schema.String)
106
+ });
107
+ const FileCitationAnnotation = /*#__PURE__*/Schema.Struct({
108
+ type: /*#__PURE__*/Schema.Literal("file_citation"),
109
+ file_id: Schema.String,
110
+ index: Schema.Number,
111
+ filename: Schema.String
112
+ });
113
+ const UrlCitationAnnotation = /*#__PURE__*/Schema.Struct({
114
+ type: /*#__PURE__*/Schema.Literal("url_citation"),
115
+ url: Schema.String,
116
+ start_index: Schema.Number,
117
+ end_index: Schema.Number,
118
+ title: Schema.String
119
+ });
120
+ const ContainerFileCitationAnnotation = /*#__PURE__*/Schema.Struct({
121
+ type: /*#__PURE__*/Schema.Literal("container_file_citation"),
122
+ container_id: Schema.String,
123
+ file_id: Schema.String,
124
+ start_index: Schema.Number,
125
+ end_index: Schema.Number,
126
+ filename: Schema.String
127
+ });
128
+ const FilePathAnnotation = /*#__PURE__*/Schema.Struct({
129
+ type: /*#__PURE__*/Schema.Literal("file_path"),
130
+ file_id: Schema.String,
131
+ index: Schema.Number
132
+ });
133
+ /**
134
+ * Schema for citation and file-path annotations attached to output text content.
135
+ *
136
+ * **Details**
137
+ *
138
+ * Accepts annotation objects discriminated by `type`: `file_citation`,
139
+ * `url_citation`, `container_file_citation`, or `file_path`.
140
+ *
141
+ * @category schemas
142
+ * @since 4.0.0
143
+ */
144
+ export const Annotation = /*#__PURE__*/Schema.Union([FileCitationAnnotation, UrlCitationAnnotation, ContainerFileCitationAnnotation, FilePathAnnotation]);
145
+ const OutputTextContent = /*#__PURE__*/Schema.Struct({
146
+ type: /*#__PURE__*/Schema.Literal("output_text"),
147
+ text: Schema.String,
148
+ annotations: /*#__PURE__*/Schema.Array(Annotation),
149
+ logprobs: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Array(Schema.Unknown))
150
+ });
151
+ const OutputMessageContent = /*#__PURE__*/Schema.Union([InputTextContent, OutputTextContent, TextContent, SummaryTextContent, ReasoningTextContent, RefusalContent, InputImageContent, ComputerScreenshotContent, InputFileContent]);
152
+ const OutputMessage = /*#__PURE__*/Schema.Struct({
153
+ id: Schema.String,
154
+ type: /*#__PURE__*/Schema.Literal("message"),
155
+ role: /*#__PURE__*/Schema.Literal("assistant"),
156
+ content: /*#__PURE__*/Schema.Array(OutputMessageContent),
157
+ status: MessageStatus
158
+ });
159
+ /**
160
+ * Schema for a reasoning output item containing encrypted content, summaries, and optional reasoning text.
161
+ *
162
+ * **When to use**
163
+ *
164
+ * Use when decoding or encoding OpenAI Responses reasoning items that may be
165
+ * carried into later request input.
166
+ *
167
+ * **Details**
168
+ *
169
+ * Reasoning items represent model reasoning content. `summary` is required,
170
+ * while `content` and `status` are optional.
171
+ *
172
+ * **Gotchas**
173
+ *
174
+ * `encrypted_content` is populated only when `reasoning.encrypted_content` is
175
+ * requested through `include`.
176
+ *
177
+ * @see {@link InputItem} for request input items that can carry reasoning items
178
+ * @see {@link IncludeEnum} for requesting encrypted reasoning content
179
+ *
180
+ * @category schemas
181
+ * @since 4.0.0
182
+ */
183
+ export const ReasoningItem = /*#__PURE__*/Schema.Struct({
184
+ type: /*#__PURE__*/Schema.Literal("reasoning"),
185
+ id: Schema.String,
186
+ encrypted_content: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String)),
187
+ summary: /*#__PURE__*/Schema.Array(SummaryTextContent),
188
+ content: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Array(ReasoningTextContent)),
189
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
190
+ });
191
+ const FunctionCall = /*#__PURE__*/Schema.Struct({
192
+ id: /*#__PURE__*/Schema.optionalKey(Schema.String),
193
+ type: /*#__PURE__*/Schema.Literal("function_call"),
194
+ call_id: Schema.String,
195
+ name: Schema.String,
196
+ arguments: Schema.String,
197
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
198
+ });
199
+ const FunctionCallOutput = /*#__PURE__*/Schema.Struct({
200
+ id: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String)),
201
+ type: /*#__PURE__*/Schema.Literal("function_call_output"),
202
+ call_id: Schema.String,
203
+ output: /*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Array(InputContent)]),
204
+ status: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(MessageStatus))
205
+ });
206
+ const ItemReference = /*#__PURE__*/Schema.Struct({
207
+ type: /*#__PURE__*/Schema.Literal("item_reference"),
208
+ id: Schema.String
209
+ });
210
+ const LocalShellCall = /*#__PURE__*/Schema.Struct({
211
+ id: /*#__PURE__*/Schema.optionalKey(Schema.String),
212
+ type: /*#__PURE__*/Schema.Literal("local_shell_call"),
213
+ call_id: Schema.String,
214
+ action: Schema.Unknown,
215
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
216
+ });
217
+ const LocalShellCallOutput = /*#__PURE__*/Schema.Struct({
218
+ id: /*#__PURE__*/Schema.optionalKey(Schema.String),
219
+ type: /*#__PURE__*/Schema.Literal("local_shell_call_output"),
220
+ call_id: Schema.String,
221
+ output: Schema.Unknown,
222
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
223
+ });
224
+ const ShellCall = /*#__PURE__*/Schema.Struct({
225
+ id: /*#__PURE__*/Schema.optionalKey(Schema.String),
226
+ type: /*#__PURE__*/Schema.Literal("shell_call"),
227
+ call_id: Schema.String,
228
+ action: Schema.Unknown,
229
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
230
+ });
231
+ const ShellCallOutput = /*#__PURE__*/Schema.Struct({
232
+ id: /*#__PURE__*/Schema.optionalKey(Schema.String),
233
+ type: /*#__PURE__*/Schema.Literal("shell_call_output"),
234
+ call_id: Schema.String,
235
+ output: Schema.Unknown,
236
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
237
+ });
238
+ const ApplyPatchCallOutput = /*#__PURE__*/Schema.Struct({
239
+ id: /*#__PURE__*/Schema.optionalKey(Schema.String),
240
+ type: /*#__PURE__*/Schema.Literal("apply_patch_call_output"),
241
+ call_id: Schema.String,
242
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus),
243
+ output: /*#__PURE__*/Schema.optionalKey(Schema.Unknown)
244
+ });
245
+ const McpApprovalResponse = /*#__PURE__*/Schema.Struct({
246
+ type: /*#__PURE__*/Schema.Literal("mcp_approval_response"),
247
+ approval_request_id: Schema.String,
248
+ approve: Schema.Boolean
249
+ });
250
+ const RequestMessageItem = /*#__PURE__*/Schema.Struct({
251
+ type: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Literal("message")),
252
+ role: MessageRole,
253
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus),
254
+ content: /*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Array(InputContent)])
255
+ });
256
+ /**
257
+ * Schema for item shapes accepted by an OpenAI Responses request `input` field.
258
+ *
259
+ * **When to use**
260
+ *
261
+ * Use when validating structured `CreateResponse.input` array items.
262
+ *
263
+ * **Details**
264
+ *
265
+ * Accepted item families include request/output messages, function call and
266
+ * function call output, reasoning items, item references, shell and local shell
267
+ * calls and outputs, apply-patch output, and MCP approval responses.
268
+ *
269
+ * @see {@link CreateResponse} for the request schema that consumes input items
270
+ * @see {@link InputContent} for content blocks inside message items
271
+ *
272
+ * @category schemas
273
+ * @since 4.0.0
274
+ */
275
+ export const InputItem = /*#__PURE__*/Schema.Union([RequestMessageItem, OutputMessage, FunctionCall, FunctionCallOutput, ReasoningItem, ItemReference, LocalShellCall, LocalShellCallOutput, ShellCall, ShellCallOutput, ApplyPatchCallOutput, McpApprovalResponse]);
276
+ const FunctionTool = /*#__PURE__*/Schema.Struct({
277
+ type: /*#__PURE__*/Schema.Literal("function"),
278
+ name: Schema.String,
279
+ description: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String)),
280
+ parameters: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(JsonObject)),
281
+ strict: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.Boolean))
282
+ });
283
+ const CustomTool = /*#__PURE__*/Schema.Struct({
284
+ type: /*#__PURE__*/Schema.Literal("custom"),
285
+ name: Schema.String,
286
+ description: /*#__PURE__*/Schema.optionalKey(Schema.String),
287
+ format: /*#__PURE__*/Schema.optionalKey(Schema.Unknown)
288
+ });
289
+ const ProviderDefinedTool = /*#__PURE__*/Schema.StructWithRest(/*#__PURE__*/Schema.Struct({
290
+ type: /*#__PURE__*/Schema.Literals(["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"])
291
+ }), [UnknownRecord]);
292
+ /**
293
+ * Schema for tool definitions that can be supplied to an OpenAI Responses request.
294
+ *
295
+ * **When to use**
296
+ *
297
+ * Use when validating or encoding the `tools` array for a Responses request,
298
+ * including provider-defined tool records with provider-specific fields.
299
+ *
300
+ * **Details**
301
+ *
302
+ * Accepted variants are function tools, custom tools, and provider-defined
303
+ * OpenAI tools. Provider-defined `type` literals include `apply_patch`,
304
+ * `code_interpreter`, `file_search`, `image_generation`, `local_shell`, `mcp`,
305
+ * `shell`, `web_search`, and `web_search_preview`.
306
+ *
307
+ * **Gotchas**
308
+ *
309
+ * Provider-defined tools use `Schema.StructWithRest`, so this schema checks the
310
+ * provider tool `type` and permits additional provider fields rather than fully
311
+ * validating every provider-specific tool payload.
312
+ *
313
+ * @see {@link ToolChoice} for selecting whether and which tools the model may call
314
+ * @see {@link CreateResponse} for the request schema that consumes tools
315
+ *
316
+ * @category schemas
317
+ * @since 4.0.0
318
+ */
319
+ export const Tool = /*#__PURE__*/Schema.Union([FunctionTool, CustomTool, ProviderDefinedTool]);
320
+ /**
321
+ * Schema for selecting whether and which tools the model may call in a Responses request.
322
+ *
323
+ * **When to use**
324
+ *
325
+ * Use when validating or encoding the `tool_choice` field that constrains model
326
+ * tool use separately from the tool definitions themselves.
327
+ *
328
+ * **Details**
329
+ *
330
+ * Accepted forms are `"none"`, `"auto"`, `"required"`, an allowed-tools set,
331
+ * a named function or custom tool, or a provider-defined tool choice.
332
+ *
333
+ * @see {@link Tool} for tool definitions referenced by tool choices
334
+ * @see {@link CreateResponse} for the request schema that consumes `tool_choice`
335
+ *
336
+ * @category schemas
337
+ * @since 4.0.0
338
+ */
339
+ export const ToolChoice = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Literals(["none", "auto", "required"]), /*#__PURE__*/Schema.Struct({
340
+ type: /*#__PURE__*/Schema.Literal("allowed_tools"),
341
+ mode: /*#__PURE__*/Schema.Literals(["auto", "required"]),
342
+ tools: /*#__PURE__*/Schema.Array(JsonObject)
343
+ }), /*#__PURE__*/Schema.Struct({
344
+ type: /*#__PURE__*/Schema.Literal("function"),
345
+ name: Schema.String
346
+ }), /*#__PURE__*/Schema.Struct({
347
+ type: /*#__PURE__*/Schema.Literal("custom"),
348
+ name: Schema.String
349
+ }), /*#__PURE__*/Schema.StructWithRest(/*#__PURE__*/Schema.Struct({
350
+ type: /*#__PURE__*/Schema.Literals(["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"])
351
+ }), [UnknownRecord])]);
352
+ /**
353
+ * Schema for text output format configuration, including plain text, JSON object, and JSON Schema responses.
354
+ *
355
+ * **When to use**
356
+ *
357
+ * Use when validating or encoding the `text.format` setting for a Responses
358
+ * request, especially when choosing structured JSON Schema output.
359
+ *
360
+ * **Details**
361
+ *
362
+ * Accepted variants are `text`, `json_schema`, and `json_object`.
363
+ *
364
+ * **Gotchas**
365
+ *
366
+ * `json_object` is the older JSON mode. Prefer `json_schema` for models that
367
+ * support it.
368
+ *
369
+ * @see {@link CreateResponse} for the request schema that consumes text format configuration
370
+ *
371
+ * @category schemas
372
+ * @since 4.0.0
373
+ */
374
+ export const TextResponseFormatConfiguration = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Struct({
375
+ type: /*#__PURE__*/Schema.Literal("text")
376
+ }), /*#__PURE__*/Schema.Struct({
377
+ type: /*#__PURE__*/Schema.Literal("json_schema"),
378
+ description: /*#__PURE__*/Schema.optionalKey(Schema.String),
379
+ name: Schema.String,
380
+ schema: JsonObject,
381
+ strict: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.Boolean))
382
+ }), /*#__PURE__*/Schema.Struct({
383
+ type: /*#__PURE__*/Schema.Literal("json_object")
384
+ })]);
385
+ /**
386
+ * Schema for request options used to create an OpenAI Responses API response.
387
+ *
388
+ * **When to use**
389
+ *
390
+ * Use to validate or encode payloads sent to the OpenAI Responses API.
391
+ *
392
+ * **Details**
393
+ *
394
+ * Validates the Responses API request payload, including input content, model
395
+ * selection, instructions, reasoning options, text output format, tools,
396
+ * `tool_choice`, streaming, storage, response continuation, sampling options,
397
+ * and optional response fields requested through `include`.
398
+ *
399
+ * **Gotchas**
400
+ *
401
+ * When `stream` is `true`, the API returns stream events instead of a single
402
+ * response object.
403
+ *
404
+ * @see {@link Response} for decoded non-streaming response objects
405
+ * @see {@link ResponseStreamEvent} for decoded streaming event objects
406
+ *
407
+ * @category schemas
408
+ * @since 4.0.0
409
+ */
410
+ export const CreateResponse = /*#__PURE__*/Schema.Struct({
411
+ metadata: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.String)),
412
+ top_logprobs: /*#__PURE__*/Schema.optional(Schema.Number),
413
+ temperature: /*#__PURE__*/Schema.optional(Schema.Number),
414
+ top_p: /*#__PURE__*/Schema.optional(Schema.Number),
415
+ user: /*#__PURE__*/Schema.optional(Schema.String),
416
+ service_tier: /*#__PURE__*/Schema.optional(Schema.String),
417
+ previous_response_id: /*#__PURE__*/Schema.optional(Schema.String),
418
+ model: /*#__PURE__*/Schema.optional(Schema.String),
419
+ reasoning: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
420
+ effort: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literals(["none", "minimal", "low", "medium", "high", "xhigh"])),
421
+ summary: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literals(["auto", "concise", "detailed"])),
422
+ generate_summary: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literals(["auto", "concise", "detailed"]))
423
+ })),
424
+ background: /*#__PURE__*/Schema.optional(Schema.Boolean),
425
+ max_output_tokens: /*#__PURE__*/Schema.optional(Schema.Number),
426
+ max_tool_calls: /*#__PURE__*/Schema.optional(Schema.Number),
427
+ text: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
428
+ format: /*#__PURE__*/Schema.optional(TextResponseFormatConfiguration),
429
+ verbosity: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literals(["low", "medium", "high"]))
430
+ })),
431
+ tools: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Tool)),
432
+ tool_choice: /*#__PURE__*/Schema.optional(ToolChoice),
433
+ truncation: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literals(["auto", "disabled"])),
434
+ input: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Array(InputItem)])),
435
+ include: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(IncludeEnum)),
436
+ store: /*#__PURE__*/Schema.optional(Schema.Boolean),
437
+ instructions: /*#__PURE__*/Schema.optional(Schema.String),
438
+ stream: /*#__PURE__*/Schema.optional(Schema.Boolean),
439
+ conversation: /*#__PURE__*/Schema.optional(Schema.String),
440
+ modalities: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Literals(["text", "audio"]))),
441
+ seed: /*#__PURE__*/Schema.optional(Schema.Number)
442
+ });
443
+ /**
444
+ * Schema for token accounting reported on OpenAI Responses API response objects.
445
+ *
446
+ * **Details**
447
+ *
448
+ * The required counters are `input_tokens`, `output_tokens`, and
449
+ * `total_tokens`. Provider-specific token detail objects are preserved through
450
+ * `input_tokens_details`, `output_tokens_details`, and additional fields.
451
+ *
452
+ * @category schemas
453
+ * @since 4.0.0
454
+ */
455
+ export const ResponseUsage = /*#__PURE__*/Schema.StructWithRest(/*#__PURE__*/Schema.Struct({
456
+ input_tokens: Schema.Number,
457
+ output_tokens: Schema.Number,
458
+ total_tokens: Schema.Number,
459
+ input_tokens_details: /*#__PURE__*/Schema.optionalKey(Schema.Unknown),
460
+ output_tokens_details: /*#__PURE__*/Schema.optionalKey(Schema.Unknown)
461
+ }), [UnknownRecord]);
462
+ const ApplyPatchOperation = /*#__PURE__*/Schema.Struct({
463
+ type: Schema.String,
464
+ path: Schema.String,
465
+ diff: /*#__PURE__*/Schema.optionalKey(Schema.String)
466
+ });
467
+ const ApplyPatchCall = /*#__PURE__*/Schema.Struct({
468
+ id: Schema.String,
469
+ type: /*#__PURE__*/Schema.Literal("apply_patch_call"),
470
+ call_id: Schema.String,
471
+ operation: ApplyPatchOperation,
472
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
473
+ });
474
+ const CodeInterpreterCall = /*#__PURE__*/Schema.Struct({
475
+ id: Schema.String,
476
+ type: /*#__PURE__*/Schema.Literal("code_interpreter_call"),
477
+ code: /*#__PURE__*/Schema.optionalKey(Schema.String),
478
+ container_id: Schema.String,
479
+ outputs: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Array(Schema.Unknown)),
480
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
481
+ });
482
+ const ComputerCall = /*#__PURE__*/Schema.Struct({
483
+ id: Schema.String,
484
+ type: /*#__PURE__*/Schema.Literal("computer_call"),
485
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
486
+ });
487
+ const FileSearchCall = /*#__PURE__*/Schema.Struct({
488
+ id: Schema.String,
489
+ type: /*#__PURE__*/Schema.Literal("file_search_call"),
490
+ status: /*#__PURE__*/Schema.optionalKey(Schema.String),
491
+ queries: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Array(Schema.String)),
492
+ results: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.Unknown))
493
+ });
494
+ const ImageGenerationCall = /*#__PURE__*/Schema.Struct({
495
+ id: Schema.String,
496
+ type: /*#__PURE__*/Schema.Literal("image_generation_call"),
497
+ result: /*#__PURE__*/Schema.optionalKey(Schema.String),
498
+ status: /*#__PURE__*/Schema.optionalKey(MessageStatus)
499
+ });
500
+ const McpCall = /*#__PURE__*/Schema.Struct({
501
+ id: Schema.String,
502
+ type: /*#__PURE__*/Schema.Literal("mcp_call"),
503
+ approval_request_id: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String)),
504
+ name: Schema.String,
505
+ arguments: Schema.Unknown,
506
+ output: /*#__PURE__*/Schema.optionalKey(Schema.Unknown),
507
+ error: /*#__PURE__*/Schema.optionalKey(Schema.Unknown),
508
+ server_label: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(Schema.String))
509
+ });
510
+ const McpListTools = /*#__PURE__*/Schema.Struct({
511
+ id: Schema.String,
512
+ type: /*#__PURE__*/Schema.Literal("mcp_list_tools")
513
+ });
514
+ const McpApprovalRequest = /*#__PURE__*/Schema.Struct({
515
+ id: Schema.String,
516
+ type: /*#__PURE__*/Schema.Literal("mcp_approval_request"),
517
+ approval_request_id: /*#__PURE__*/Schema.optionalKey(Schema.String),
518
+ name: Schema.String,
519
+ arguments: Schema.Unknown
520
+ });
521
+ const WebSearchCall = /*#__PURE__*/Schema.Struct({
522
+ id: Schema.String,
523
+ type: /*#__PURE__*/Schema.Literal("web_search_call"),
524
+ action: /*#__PURE__*/Schema.optionalKey(Schema.Unknown),
525
+ status: /*#__PURE__*/Schema.optionalKey(Schema.String)
526
+ });
527
+ const OutputItem = /*#__PURE__*/Schema.Union([ApplyPatchCall, CodeInterpreterCall, ComputerCall, FileSearchCall, FunctionCall, ImageGenerationCall, LocalShellCall, McpCall, McpListTools, McpApprovalRequest, OutputMessage, ReasoningItem, ShellCall, WebSearchCall]);
528
+ /**
529
+ * Schema for an OpenAI Responses API response object.
530
+ *
531
+ * **When to use**
532
+ *
533
+ * Use to decode non-streaming OpenAI Responses API responses.
534
+ *
535
+ * **Details**
536
+ *
537
+ * Response objects include the response id, model, creation time, output items,
538
+ * optional token usage, optional incomplete details, and optional service tier.
539
+ *
540
+ * @see {@link CreateResponse} for the request schema that creates responses
541
+ * @see {@link ResponseUsage} for token accounting on responses
542
+ * @see {@link ResponseStreamEvent} for streaming response events
543
+ *
544
+ * @category schemas
545
+ * @since 4.0.0
546
+ */
547
+ export const Response = /*#__PURE__*/Schema.Struct({
548
+ id: Schema.String,
549
+ object: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Literal("response")),
550
+ model: Schema.String,
551
+ created_at: Schema.Number,
552
+ output: /*#__PURE__*/Schema.Array(OutputItem).pipe(/*#__PURE__*/Schema.withDecodingDefault(/*#__PURE__*/Effect.succeed([]))),
553
+ usage: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(ResponseUsage)),
554
+ incomplete_details: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Struct({
555
+ reason: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Literals(["max_output_tokens", "content_filter"]))
556
+ }))),
557
+ service_tier: /*#__PURE__*/Schema.optionalKey(Schema.String)
558
+ });
559
+ const ResponseCreatedEvent = /*#__PURE__*/Schema.Struct({
560
+ type: /*#__PURE__*/Schema.Literal("response.created"),
561
+ response: Response,
562
+ sequence_number: Schema.Number
563
+ });
564
+ const ResponseCompletedEvent = /*#__PURE__*/Schema.Struct({
565
+ type: /*#__PURE__*/Schema.Literal("response.completed"),
566
+ response: Response,
567
+ sequence_number: Schema.Number
568
+ });
569
+ const ResponseIncompleteEvent = /*#__PURE__*/Schema.Struct({
570
+ type: /*#__PURE__*/Schema.Literal("response.incomplete"),
571
+ response: Response,
572
+ sequence_number: Schema.Number
573
+ });
574
+ const ResponseFailedEvent = /*#__PURE__*/Schema.Struct({
575
+ type: /*#__PURE__*/Schema.Literal("response.failed"),
576
+ response: Response,
577
+ sequence_number: Schema.Number
578
+ });
579
+ const ResponseOutputItemAddedEvent = /*#__PURE__*/Schema.Struct({
580
+ type: /*#__PURE__*/Schema.Literal("response.output_item.added"),
581
+ output_index: Schema.Number,
582
+ sequence_number: Schema.Number,
583
+ item: OutputItem
584
+ });
585
+ const ResponseOutputItemDoneEvent = /*#__PURE__*/Schema.Struct({
586
+ type: /*#__PURE__*/Schema.Literal("response.output_item.done"),
587
+ output_index: Schema.Number,
588
+ sequence_number: Schema.Number,
589
+ item: OutputItem
590
+ });
591
+ const ResponseOutputTextDeltaEvent = /*#__PURE__*/Schema.Struct({
592
+ type: /*#__PURE__*/Schema.Literal("response.output_text.delta"),
593
+ item_id: Schema.String,
594
+ output_index: Schema.Number,
595
+ content_index: Schema.Number,
596
+ delta: Schema.String,
597
+ sequence_number: Schema.Number,
598
+ logprobs: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Array(Schema.Unknown))
599
+ });
600
+ const ResponseOutputTextAnnotationAddedEvent = /*#__PURE__*/Schema.Struct({
601
+ type: /*#__PURE__*/Schema.Literal("response.output_text.annotation.added"),
602
+ item_id: Schema.String,
603
+ output_index: Schema.Number,
604
+ content_index: Schema.Number,
605
+ annotation_index: Schema.Number,
606
+ sequence_number: Schema.Number,
607
+ annotation: Annotation
608
+ });
609
+ const ResponseReasoningSummaryPartAddedEvent = /*#__PURE__*/Schema.Struct({
610
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_summary_part.added"),
611
+ item_id: Schema.String,
612
+ output_index: Schema.Number,
613
+ summary_index: Schema.Number,
614
+ sequence_number: Schema.Number,
615
+ part: SummaryTextContent
616
+ });
617
+ const ResponseReasoningSummaryPartDoneEvent = /*#__PURE__*/Schema.Struct({
618
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_summary_part.done"),
619
+ item_id: Schema.String,
620
+ output_index: Schema.Number,
621
+ summary_index: Schema.Number,
622
+ sequence_number: Schema.Number,
623
+ part: SummaryTextContent
624
+ });
625
+ const ResponseReasoningSummaryTextDeltaEvent = /*#__PURE__*/Schema.Struct({
626
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_summary_text.delta"),
627
+ item_id: Schema.String,
628
+ output_index: Schema.Number,
629
+ summary_index: Schema.Number,
630
+ delta: Schema.String,
631
+ sequence_number: Schema.Number
632
+ });
633
+ const ResponseFunctionCallArgumentsDeltaEvent = /*#__PURE__*/Schema.Struct({
634
+ type: /*#__PURE__*/Schema.Literal("response.function_call_arguments.delta"),
635
+ item_id: Schema.String,
636
+ output_index: Schema.Number,
637
+ sequence_number: Schema.Number,
638
+ delta: Schema.String
639
+ });
640
+ const ResponseFunctionCallArgumentsDoneEvent = /*#__PURE__*/Schema.Struct({
641
+ type: /*#__PURE__*/Schema.Literal("response.function_call_arguments.done"),
642
+ item_id: Schema.String,
643
+ output_index: Schema.Number,
644
+ sequence_number: Schema.Number,
645
+ arguments: Schema.String
646
+ });
647
+ const ResponseCodeInterpreterCallCodeDeltaEvent = /*#__PURE__*/Schema.Struct({
648
+ type: /*#__PURE__*/Schema.Literal("response.code_interpreter_call_code.delta"),
649
+ item_id: Schema.String,
650
+ output_index: Schema.Number,
651
+ sequence_number: Schema.Number,
652
+ delta: Schema.String
653
+ });
654
+ const ResponseCodeInterpreterCallCodeDoneEvent = /*#__PURE__*/Schema.Struct({
655
+ type: /*#__PURE__*/Schema.Literal("response.code_interpreter_call_code.done"),
656
+ item_id: Schema.String,
657
+ output_index: Schema.Number,
658
+ sequence_number: Schema.Number,
659
+ code: Schema.String
660
+ });
661
+ const ResponseApplyPatchCallOperationDiffDeltaEvent = /*#__PURE__*/Schema.Struct({
662
+ type: /*#__PURE__*/Schema.Literal("response.apply_patch_call_operation_diff.delta"),
663
+ item_id: Schema.String,
664
+ output_index: Schema.Number,
665
+ sequence_number: Schema.Number,
666
+ delta: Schema.String
667
+ });
668
+ const ResponseApplyPatchCallOperationDiffDoneEvent = /*#__PURE__*/Schema.Struct({
669
+ type: /*#__PURE__*/Schema.Literal("response.apply_patch_call_operation_diff.done"),
670
+ item_id: Schema.String,
671
+ output_index: Schema.Number,
672
+ sequence_number: Schema.Number,
673
+ delta: /*#__PURE__*/Schema.optionalKey(Schema.String)
674
+ });
675
+ const ResponseImageGenerationCallPartialImageEvent = /*#__PURE__*/Schema.Struct({
676
+ type: /*#__PURE__*/Schema.Literal("response.image_generation_call.partial_image"),
677
+ item_id: Schema.String,
678
+ output_index: Schema.Number,
679
+ sequence_number: Schema.Number,
680
+ partial_image_b64: Schema.String
681
+ });
682
+ const ResponseErrorEvent = /*#__PURE__*/Schema.Struct({
683
+ type: /*#__PURE__*/Schema.Literal("error"),
684
+ code: /*#__PURE__*/Schema.NullOr(Schema.String),
685
+ message: Schema.String,
686
+ param: /*#__PURE__*/Schema.NullOr(Schema.String),
687
+ sequence_number: Schema.Number,
688
+ status: /*#__PURE__*/Schema.optionalKey(Schema.Number)
689
+ });
690
+ const knownResponseStreamEventTypes = /*#__PURE__*/new Set(["response.created", "response.completed", "response.incomplete", "response.failed", "response.output_item.added", "response.output_item.done", "response.output_text.delta", "response.output_text.annotation.added", "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", "response.apply_patch_call_operation_diff.delta", "response.apply_patch_call_operation_diff.done", "response.image_generation_call.partial_image", "error"]);
691
+ const UnknownResponseStreamEvent = /*#__PURE__*/Schema.declare(value => Predicate.hasProperty(value, "type") && typeof value.type === "string" && !knownResponseStreamEventTypes.has(value.type), {
692
+ identifier: "UnknownResponseStreamEvent",
693
+ description: "Fallback for unknown future stream events"
694
+ });
695
+ /**
696
+ * Schema for server-sent event shapes emitted by OpenAI Responses API streams.
697
+ *
698
+ * **When to use**
699
+ *
700
+ * Use to decode events from a streaming OpenAI Responses API request.
701
+ *
702
+ * **Details**
703
+ *
704
+ * Known event variants include response lifecycle events, output item events,
705
+ * text and reasoning deltas, tool-call deltas, partial image events, and error
706
+ * events.
707
+ *
708
+ * **Gotchas**
709
+ *
710
+ * Future event types decode through the fallback only when their `type` is not
711
+ * one of the known event types. Malformed known events still fail to decode.
712
+ *
713
+ * @see {@link Response} for complete response objects carried by lifecycle events
714
+ * @see {@link UnknownResponseStreamEvent} for the fallback shape for future event types
715
+ *
716
+ * @category schemas
717
+ * @since 4.0.0
718
+ */
719
+ export const ResponseStreamEvent = /*#__PURE__*/Schema.Union([ResponseCreatedEvent, ResponseCompletedEvent, ResponseIncompleteEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextAnnotationAddedEvent, ResponseReasoningSummaryPartAddedEvent, ResponseReasoningSummaryPartDoneEvent, ResponseReasoningSummaryTextDeltaEvent, ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, ResponseCodeInterpreterCallCodeDeltaEvent, ResponseCodeInterpreterCallCodeDoneEvent, ResponseApplyPatchCallOperationDiffDeltaEvent, ResponseApplyPatchCallOperationDiffDoneEvent, ResponseImageGenerationCallPartialImageEvent, ResponseErrorEvent, UnknownResponseStreamEvent]);
720
+ /**
721
+ * Schema for one embedding item returned by the OpenAI embeddings API.
722
+ *
723
+ * **When to use**
724
+ *
725
+ * Use when validating individual embedding entries at the OpenAI client boundary
726
+ * before assuming the embedding payload is a numeric vector.
727
+ *
728
+ * **Details**
729
+ *
730
+ * An embedding item contains its `index`, optional `object` marker, and an
731
+ * `embedding` represented either as a numeric vector or as a string.
732
+ *
733
+ * **Gotchas**
734
+ *
735
+ * Callers that need numeric vectors must account for string embeddings, such as
736
+ * base64-encoded embeddings returned for string encoding formats.
737
+ *
738
+ * @category schemas
739
+ * @since 4.0.0
740
+ */
741
+ export const Embedding = /*#__PURE__*/Schema.Struct({
742
+ embedding: /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Array(Schema.Number), Schema.String]),
743
+ index: Schema.Number,
744
+ object: /*#__PURE__*/Schema.optionalKey(Schema.String)
745
+ });
746
+ /**
747
+ * Schema for the request payload sent to the OpenAI embeddings endpoint.
748
+ *
749
+ * **When to use**
750
+ *
751
+ * Use when validating or encoding embeddings requests before sending them to
752
+ * OpenAI, while leaving model-specific limits to the provider.
753
+ *
754
+ * **Details**
755
+ *
756
+ * Requires `input` and `model`. `input` may be a string, an array of strings,
757
+ * a token array, or an array of token arrays. Optional fields configure the
758
+ * embedding encoding format, requested dimensions, and user identifier.
759
+ *
760
+ * **Gotchas**
761
+ *
762
+ * This schema validates the transport shape, but OpenAI still enforces
763
+ * provider-side constraints such as non-empty input, integer token ids, input
764
+ * size limits, positive dimensions, and model-specific dimension support.
765
+ *
766
+ * @category schemas
767
+ * @since 4.0.0
768
+ */
769
+ export const CreateEmbeddingRequest = /*#__PURE__*/Schema.Struct({
770
+ input: /*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Array(Schema.String), /*#__PURE__*/Schema.Array(Schema.Number), /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Array(Schema.Number))]),
771
+ model: Schema.String,
772
+ encoding_format: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Literals(["float", "base64"])),
773
+ dimensions: /*#__PURE__*/Schema.optionalKey(Schema.Number),
774
+ user: /*#__PURE__*/Schema.optionalKey(Schema.String)
775
+ });
776
+ /**
777
+ * Schema for a successful response payload returned by the OpenAI embeddings endpoint.
778
+ *
779
+ * **When to use**
780
+ *
781
+ * Use when you need to validate embeddings responses at an OpenAI client
782
+ * boundary before trusting item shapes, especially when numeric and string
783
+ * embeddings are both allowed.
784
+ *
785
+ * **Details**
786
+ *
787
+ * The response contains an array of `Embedding` items, the model name, an
788
+ * optional `object: "list"` marker, and optional token usage counts for prompt
789
+ * and total tokens.
790
+ *
791
+ * **Gotchas**
792
+ *
793
+ * Each `Embedding` may contain either a numeric vector or a string embedding.
794
+ * Callers that require numeric vectors must account for string embeddings.
795
+ *
796
+ * @see {@link CreateEmbeddingRequest} for the request schema sent to the embeddings endpoint
797
+ * @see {@link Embedding} for individual embedding items in the response
798
+ *
799
+ * @category schemas
800
+ * @since 4.0.0
801
+ */
802
+ export const CreateEmbeddingResponse = /*#__PURE__*/Schema.Struct({
803
+ data: /*#__PURE__*/Schema.Array(Embedding),
804
+ model: Schema.String,
805
+ object: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Literal("list")),
806
+ usage: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Struct({
807
+ prompt_tokens: Schema.Number,
808
+ total_tokens: Schema.Number
809
+ }))
810
+ });
811
+ //# sourceMappingURL=OpenAiSchema.js.map