@effect/ai-openai 0.29.1 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/OpenAiTool/package.json +6 -0
  2. package/dist/cjs/Generated.js +5845 -4262
  3. package/dist/cjs/Generated.js.map +1 -1
  4. package/dist/cjs/OpenAiClient.js +1493 -129
  5. package/dist/cjs/OpenAiClient.js.map +1 -1
  6. package/dist/cjs/OpenAiEmbeddingModel.js +61 -50
  7. package/dist/cjs/OpenAiEmbeddingModel.js.map +1 -1
  8. package/dist/cjs/OpenAiLanguageModel.js +973 -333
  9. package/dist/cjs/OpenAiLanguageModel.js.map +1 -1
  10. package/dist/cjs/OpenAiTelemetry.js +4 -4
  11. package/dist/cjs/OpenAiTelemetry.js.map +1 -1
  12. package/dist/cjs/OpenAiTokenizer.js +46 -14
  13. package/dist/cjs/OpenAiTokenizer.js.map +1 -1
  14. package/dist/cjs/OpenAiTool.js +93 -0
  15. package/dist/cjs/OpenAiTool.js.map +1 -0
  16. package/dist/cjs/index.js +3 -1
  17. package/dist/cjs/internal/utilities.js +11 -3
  18. package/dist/cjs/internal/utilities.js.map +1 -1
  19. package/dist/dts/Generated.d.ts +19662 -11761
  20. package/dist/dts/Generated.d.ts.map +1 -1
  21. package/dist/dts/OpenAiClient.d.ts +3022 -14
  22. package/dist/dts/OpenAiClient.d.ts.map +1 -1
  23. package/dist/dts/OpenAiEmbeddingModel.d.ts +8 -8
  24. package/dist/dts/OpenAiEmbeddingModel.d.ts.map +1 -1
  25. package/dist/dts/OpenAiLanguageModel.d.ts +146 -49
  26. package/dist/dts/OpenAiLanguageModel.d.ts.map +1 -1
  27. package/dist/dts/OpenAiTelemetry.d.ts +4 -4
  28. package/dist/dts/OpenAiTelemetry.d.ts.map +1 -1
  29. package/dist/dts/OpenAiTokenizer.d.ts +1 -1
  30. package/dist/dts/OpenAiTokenizer.d.ts.map +1 -1
  31. package/dist/dts/OpenAiTool.d.ts +176 -0
  32. package/dist/dts/OpenAiTool.d.ts.map +1 -0
  33. package/dist/dts/index.d.ts +4 -0
  34. package/dist/dts/index.d.ts.map +1 -1
  35. package/dist/esm/Generated.js +5846 -12846
  36. package/dist/esm/Generated.js.map +1 -1
  37. package/dist/esm/OpenAiClient.js +1440 -128
  38. package/dist/esm/OpenAiClient.js.map +1 -1
  39. package/dist/esm/OpenAiEmbeddingModel.js +60 -49
  40. package/dist/esm/OpenAiEmbeddingModel.js.map +1 -1
  41. package/dist/esm/OpenAiLanguageModel.js +971 -330
  42. package/dist/esm/OpenAiLanguageModel.js.map +1 -1
  43. package/dist/esm/OpenAiTelemetry.js +4 -4
  44. package/dist/esm/OpenAiTelemetry.js.map +1 -1
  45. package/dist/esm/OpenAiTokenizer.js +46 -14
  46. package/dist/esm/OpenAiTokenizer.js.map +1 -1
  47. package/dist/esm/OpenAiTool.js +84 -0
  48. package/dist/esm/OpenAiTool.js.map +1 -0
  49. package/dist/esm/index.js +4 -0
  50. package/dist/esm/index.js.map +1 -1
  51. package/dist/esm/internal/utilities.js +10 -2
  52. package/dist/esm/internal/utilities.js.map +1 -1
  53. package/package.json +12 -4
  54. package/src/Generated.ts +9691 -5598
  55. package/src/OpenAiClient.ts +1761 -224
  56. package/src/OpenAiEmbeddingModel.ts +70 -62
  57. package/src/OpenAiLanguageModel.ts +1193 -377
  58. package/src/OpenAiTelemetry.ts +9 -9
  59. package/src/OpenAiTokenizer.ts +38 -39
  60. package/src/OpenAiTool.ts +110 -0
  61. package/src/index.ts +5 -0
  62. package/src/internal/utilities.ts +16 -4
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.make = exports.layerConfig = exports.layer = exports.OpenAiClient = void 0;
7
- var AiResponse = _interopRequireWildcard(require("@effect/ai/AiResponse"));
6
+ exports.make = exports.layerConfig = exports.layer = exports.SummaryPart = exports.ResponseWebSearchCallSearchingEvent = exports.ResponseWebSearchCallInProgressEvent = exports.ResponseWebSearchCallCompletedEvent = exports.ResponseStreamEvent = exports.ResponseRefusalDoneEvent = exports.ResponseRefusalDeltaEvent = exports.ResponseReasoningTextDoneEvent = exports.ResponseReasoningTextDeltaEvent = exports.ResponseReasoningSummaryTextDoneEvent = exports.ResponseReasoningSummaryTextDeltaEvent = exports.ResponseReasoningSummaryPartDoneEvent = exports.ResponseReasoningSummaryPartAddedEvent = exports.ResponseQueuedEvent = exports.ResponseOutputTextDoneEvent = exports.ResponseOutputTextDeltaEvent = exports.ResponseOutputTextAnnotationAddedEvent = exports.ResponseOutputItemDoneEvent = exports.ResponseOutputItemAddedEvent = exports.ResponseMcpListToolsInProgressEvent = exports.ResponseMcpListToolsFailedEvent = exports.ResponseMcpListToolsCompletedEvent = exports.ResponseMcpCallInProgressEvent = exports.ResponseMcpCallFailedEvent = exports.ResponseMcpCallCompletedEvent = exports.ResponseMcpCallArgumentsDoneEvent = exports.ResponseMcpCallArgumentsDeltaEvent = exports.ResponseIncompleteEvent = exports.ResponseInProgressEvent = exports.ResponseImageGenerationCallPartialImageEvent = exports.ResponseImageGenerationCallInProgressEvent = exports.ResponseImageGenerationCallGeneratingEvent = exports.ResponseImageGenerationCallCompletedEvent = exports.ResponseFunctionCallArgumentsDoneEvent = exports.ResponseFunctionCallArgumentsDeltaEvent = exports.ResponseFileSearchCallSearchingEvent = exports.ResponseFileSearchCallInProgressEvent = exports.ResponseFileSearchCallCompletedEvent = exports.ResponseFailedEvent = exports.ResponseErrorEvent = exports.ResponseCustomToolCallInputDoneEvent = exports.ResponseCustomToolCallInputDeltaEvent = exports.ResponseCreatedEvent = exports.ResponseContentPartDoneEvent = exports.ResponseContentPartAddedEvent = exports.ResponseCompletedEvent = exports.ResponseCodeInterpreterCallInterpretingEvent = exports.ResponseCodeInterpreterCallInProgressEvent = exports.ResponseCodeInterpreterCallCompletedEvent = exports.ResponseCodeInterpreterCallCodeDoneEvent = exports.ResponseCodeInterpreterCallCodeDeltaEvent = exports.OpenAiClient = exports.LogProbs = void 0;
7
+ var AiError = _interopRequireWildcard(require("@effect/ai/AiError"));
8
8
  var Sse = _interopRequireWildcard(require("@effect/experimental/Sse"));
9
9
  var HttpBody = _interopRequireWildcard(require("@effect/platform/HttpBody"));
10
10
  var HttpClient = _interopRequireWildcard(require("@effect/platform/HttpClient"));
@@ -14,17 +14,16 @@ var Context = _interopRequireWildcard(require("effect/Context"));
14
14
  var Effect = _interopRequireWildcard(require("effect/Effect"));
15
15
  var _Function = require("effect/Function");
16
16
  var Layer = _interopRequireWildcard(require("effect/Layer"));
17
- var Option = _interopRequireWildcard(require("effect/Option"));
18
- var Predicate = _interopRequireWildcard(require("effect/Predicate"));
19
17
  var Redacted = _interopRequireWildcard(require("effect/Redacted"));
18
+ var Schema = _interopRequireWildcard(require("effect/Schema"));
20
19
  var Stream = _interopRequireWildcard(require("effect/Stream"));
21
20
  var Generated = _interopRequireWildcard(require("./Generated.js"));
22
- var InternalUtilities = _interopRequireWildcard(require("./internal/utilities.js"));
23
21
  var _OpenAiConfig = require("./OpenAiConfig.js");
24
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
25
- const constDisableValidation = {
26
- disableValidation: true
27
- };
23
+ /**
24
+ * @since 1.0.0
25
+ */
26
+
28
27
  /**
29
28
  * @since 1.0.0
30
29
  * @category Context
@@ -37,117 +36,78 @@ class OpenAiClient extends /*#__PURE__*/Context.Tag("@effect/ai-openai/OpenAiCli
37
36
  exports.OpenAiClient = OpenAiClient;
38
37
  const make = options => Effect.gen(function* () {
39
38
  const httpClient = (yield* HttpClient.HttpClient).pipe(HttpClient.mapRequest(request => request.pipe(HttpClientRequest.prependUrl(options.apiUrl ?? "https://api.openai.com/v1"), options.apiKey ? HttpClientRequest.bearerToken(options.apiKey) : _Function.identity, options.organizationId !== undefined ? HttpClientRequest.setHeader("OpenAI-Organization", Redacted.value(options.organizationId)) : _Function.identity, options.projectId !== undefined ? HttpClientRequest.setHeader("OpenAI-Project", Redacted.value(options.projectId)) : _Function.identity, HttpClientRequest.acceptJson)), options.transformClient ? options.transformClient : _Function.identity);
40
- const httpClientOk = HttpClient.filterStatusOk(httpClient);
41
39
  const client = Generated.make(httpClient, {
42
40
  transformClient: client => _OpenAiConfig.OpenAiConfig.getOrUndefined.pipe(Effect.map(config => config?.transformClient ? config.transformClient(client) : client))
43
41
  });
44
- const streamRequest = request => httpClientOk.execute(request).pipe(Effect.map(r => r.stream), Stream.unwrapScoped, Stream.decodeText(), Stream.pipeThroughChannel(Sse.makeChannel()), Stream.takeWhile(event => event.data !== "[DONE]"), Stream.map(event => JSON.parse(event.data)));
45
- const stream = request => Stream.suspend(() => {
46
- const toolCalls = {};
47
- let isFirstChunk = false;
48
- let toolCallIndex = undefined;
49
- let finishReason = "unknown";
50
- let usage = {
51
- inputTokens: 0,
52
- outputTokens: 0,
53
- totalTokens: 0,
54
- reasoningTokens: 0,
55
- cacheReadInputTokens: 0,
56
- cacheWriteInputTokens: 0
57
- };
58
- let metadata = {};
59
- return streamRequest(HttpClientRequest.post("/chat/completions", {
60
- body: HttpBody.unsafeJson({
61
- ...request,
62
- stream: true,
63
- stream_options: {
64
- include_usage: true
65
- }
42
+ const streamRequest = (request, schema) => {
43
+ const decodeEvent = Schema.decode(Schema.parseJson(schema));
44
+ return httpClient.execute(request).pipe(Effect.map(r => r.stream), Stream.unwrapScoped, Stream.decodeText(), Stream.pipeThroughChannel(Sse.makeChannel()), Stream.mapEffect(event => decodeEvent(event.data)), Stream.catchTags({
45
+ RequestError: error => AiError.HttpRequestError.fromRequestError({
46
+ module: "OpenAiClient",
47
+ method: "streamRequest",
48
+ error
49
+ }),
50
+ ResponseError: error => AiError.HttpResponseError.fromResponseError({
51
+ module: "OpenAiClient",
52
+ method: "streamRequest",
53
+ error
54
+ }),
55
+ ParseError: error => AiError.MalformedOutput.fromParseError({
56
+ module: "OpenAiClient",
57
+ method: "streamRequest",
58
+ error
66
59
  })
67
- })).pipe(Stream.filterMap(chunk => {
68
- const parts = [];
69
- // Add response metadata immediately once available
70
- if (isFirstChunk) {
71
- isFirstChunk = false;
72
- parts.push(new AiResponse.MetadataPart({
73
- id: chunk.id,
74
- model: chunk.model,
75
- timestamp: new Date(chunk.created * 1000)
76
- }, constDisableValidation));
77
- }
78
- // Track usage information
79
- if (Predicate.isNotNullable(chunk.usage)) {
80
- usage = {
81
- inputTokens: chunk.usage.prompt_tokens,
82
- outputTokens: chunk.usage.completion_tokens,
83
- totalTokens: chunk.usage.prompt_tokens + chunk.usage.completion_tokens,
84
- reasoningTokens: chunk.usage.completion_tokens_details?.reasoning_tokens ?? 0,
85
- cacheReadInputTokens: chunk.usage.prompt_tokens_details?.cached_tokens ?? 0,
86
- cacheWriteInputTokens: usage.cacheWriteInputTokens
87
- };
88
- metadata = {
89
- ...metadata,
90
- serviceTier: chunk.service_tier,
91
- systemFingerprint: chunk.system_fingerprint,
92
- acceptedPredictionTokens: chunk.usage.completion_tokens_details?.accepted_prediction_tokens ?? 0,
93
- rejectedPredictionTokens: chunk.usage.completion_tokens_details?.rejected_prediction_tokens ?? 0,
94
- inputAudioTokens: chunk.usage.prompt_tokens_details?.audio_tokens ?? 0,
95
- outputAudioTokens: chunk.usage.completion_tokens_details?.audio_tokens ?? 0
96
- };
97
- }
98
- for (let i = 0; i < chunk.choices.length; i++) {
99
- const choice = chunk.choices[i];
100
- // Track the finish reason for the response
101
- if (Predicate.isNotNullable(choice.finish_reason)) {
102
- finishReason = InternalUtilities.resolveFinishReason(choice.finish_reason);
103
- if (finishReason === "tool-calls" && Predicate.isNotUndefined(toolCallIndex)) {
104
- finishToolCall(toolCalls[toolCallIndex], parts);
105
- }
106
- parts.push(new AiResponse.FinishPart({
107
- usage,
108
- reason: finishReason,
109
- providerMetadata: {
110
- [InternalUtilities.ProviderMetadataKey]: metadata
111
- }
112
- }, constDisableValidation));
113
- }
114
- // Handle text deltas
115
- if (Predicate.isNotNullable(choice.delta.content)) {
116
- parts.push(new AiResponse.TextPart({
117
- text: choice.delta.content
118
- }, constDisableValidation));
119
- }
120
- // Handle tool call deltas
121
- if (Predicate.hasProperty(choice.delta, "tool_calls") && Array.isArray(choice.delta.tool_calls)) {
122
- for (const delta of choice.delta.tool_calls) {
123
- // Make sure to emit any previous tool calls before starting a new one
124
- if (Predicate.isNotUndefined(toolCallIndex) && toolCallIndex !== delta.index) {
125
- finishToolCall(toolCalls[toolCallIndex], parts);
126
- toolCallIndex = undefined;
127
- }
128
- if (Predicate.isUndefined(toolCallIndex)) {
129
- const toolCall = delta;
130
- // All information except arguments are returned with the first tool call delta
131
- toolCalls[delta.index] = {
132
- ...toolCall,
133
- isFinished: false
134
- };
135
- toolCallIndex = delta.index;
136
- } else {
137
- toolCalls[delta.index].function.arguments += delta.function.arguments;
138
- }
139
- }
140
- }
141
- }
142
- return parts.length === 0 ? Option.none() : Option.some(AiResponse.AiResponse.make({
143
- parts
144
- }, constDisableValidation));
145
60
  }));
146
- });
61
+ };
62
+ const createResponse = options => client.createResponse(options).pipe(Effect.catchTags({
63
+ RequestError: error => AiError.HttpRequestError.fromRequestError({
64
+ module: "OpenAiClient",
65
+ method: "createResponse",
66
+ error
67
+ }),
68
+ ResponseError: error => AiError.HttpResponseError.fromResponseError({
69
+ module: "OpenAiClient",
70
+ method: "createResponse",
71
+ error
72
+ }),
73
+ ParseError: error => AiError.MalformedOutput.fromParseError({
74
+ module: "OpenAiClient",
75
+ method: "createResponse",
76
+ error
77
+ })
78
+ }));
79
+ const createResponseStream = options => {
80
+ const request = HttpClientRequest.post("/responses", {
81
+ body: HttpBody.unsafeJson({
82
+ ...options,
83
+ stream: true
84
+ })
85
+ });
86
+ return streamRequest(request, ResponseStreamEvent).pipe(Stream.takeUntil(event => event.type === "response.completed" || event.type === "response.incomplete"));
87
+ };
88
+ const createEmbedding = options => client.createEmbedding(options).pipe(Effect.catchTags({
89
+ RequestError: error => AiError.HttpRequestError.fromRequestError({
90
+ module: "OpenAiClient",
91
+ method: "createResponse",
92
+ error
93
+ }),
94
+ ResponseError: error => AiError.HttpResponseError.fromResponseError({
95
+ module: "OpenAiClient",
96
+ method: "createResponse",
97
+ error
98
+ }),
99
+ ParseError: error => AiError.MalformedOutput.fromParseError({
100
+ module: "OpenAiClient",
101
+ method: "createResponse",
102
+ error
103
+ })
104
+ }));
147
105
  return OpenAiClient.of({
148
106
  client,
149
107
  streamRequest,
150
- stream
108
+ createResponse,
109
+ createResponseStream,
110
+ createEmbedding
151
111
  });
152
112
  });
153
113
  /**
@@ -172,24 +132,1428 @@ const layerConfig = options => {
172
132
  })), Layer.effect(OpenAiClient));
173
133
  };
174
134
  // =============================================================================
175
- // Utilities
135
+ // Response Stream Schema
176
136
  // =============================================================================
137
+ /**
138
+ * An event that is emitted when a response is created.
139
+ *
140
+ * @since 1.0.0
141
+ * @category Schemas
142
+ */
177
143
  exports.layerConfig = layerConfig;
178
- const finishToolCall = (toolCall, parts) => {
179
- // Don't emit the tool call if it's already been emitted
180
- if (toolCall.isFinished) {
181
- return;
182
- }
183
- try {
184
- const params = JSON.parse(toolCall.function.arguments);
185
- parts.push(new AiResponse.ToolCallPart({
186
- id: toolCall.id,
187
- name: toolCall.function.name,
188
- params
189
- }));
190
- toolCall.isFinished = true;
191
- // TODO:
192
- // eslint-disable-next-line no-empty
193
- } catch {}
194
- };
144
+ class ResponseCreatedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCreatedEvent")({
145
+ /**
146
+ * The type of the event. Always `"response.created"`.
147
+ */
148
+ type: /*#__PURE__*/Schema.Literal("response.created"),
149
+ /**
150
+ * The sequence number for this event.
151
+ */
152
+ sequence_number: Schema.Int,
153
+ /**
154
+ * The response that was created.
155
+ */
156
+ response: Generated.Response
157
+ }) {}
158
+ /**
159
+ * Emitted when a response is queued and waiting to be processed.
160
+ *
161
+ * @since 1.0.0
162
+ * @category Schemas
163
+ */
164
+ exports.ResponseCreatedEvent = ResponseCreatedEvent;
165
+ class ResponseQueuedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseQueuedEvent")({
166
+ /**
167
+ * The type of the event. Always `"response.queued"`.
168
+ */
169
+ type: /*#__PURE__*/Schema.Literal("response.queued"),
170
+ /**
171
+ * The sequence number for this event.
172
+ */
173
+ sequence_number: Schema.Int,
174
+ /**
175
+ * The full response object that is queued.
176
+ */
177
+ response: Generated.Response
178
+ }) {}
179
+ /**
180
+ * Emitted when the response is in progress.
181
+ *
182
+ * @since 1.0.0
183
+ * @category Schemas
184
+ */
185
+ exports.ResponseQueuedEvent = ResponseQueuedEvent;
186
+ class ResponseInProgressEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseInProgressEvent")({
187
+ /**
188
+ * The type of the event. Always `"response.in_progress"`.
189
+ */
190
+ type: /*#__PURE__*/Schema.Literal("response.in_progress"),
191
+ /**
192
+ * The sequence number for this event.
193
+ */
194
+ sequence_number: Schema.Int,
195
+ /**
196
+ * The response that is in progress.
197
+ */
198
+ response: Generated.Response
199
+ }) {}
200
+ /**
201
+ * Emitted when the model response is complete.
202
+ *
203
+ * @since 1.0.0
204
+ * @category Schemas
205
+ */
206
+ exports.ResponseInProgressEvent = ResponseInProgressEvent;
207
+ class ResponseCompletedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCompletedEvent")({
208
+ /**
209
+ * The type of the event. Always `"response.completed"`.
210
+ */
211
+ type: /*#__PURE__*/Schema.Literal("response.completed"),
212
+ /**
213
+ * The sequence number for this event.
214
+ */
215
+ sequence_number: Schema.Int,
216
+ /**
217
+ * Properties of the completed response.
218
+ */
219
+ response: Generated.Response
220
+ }) {}
221
+ /**
222
+ * An event that is emitted when a response finishes as incomplete.
223
+ *
224
+ * @since 1.0.0
225
+ * @category Schemas
226
+ */
227
+ exports.ResponseCompletedEvent = ResponseCompletedEvent;
228
+ class ResponseIncompleteEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseIncompleteEvent")({
229
+ /**
230
+ * The type of the event. Always `"response.incomplete"`.
231
+ */
232
+ type: /*#__PURE__*/Schema.Literal("response.incomplete"),
233
+ /**
234
+ * The sequence number for this event.
235
+ */
236
+ sequence_number: Schema.Int,
237
+ /**
238
+ * The response that was incomplete.
239
+ */
240
+ response: Generated.Response
241
+ }) {}
242
+ /**
243
+ * An event that is emitted when a response fails.
244
+ *
245
+ * @since 1.0.0
246
+ * @category Schemas
247
+ */
248
+ exports.ResponseIncompleteEvent = ResponseIncompleteEvent;
249
+ class ResponseFailedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseFailedEvent")({
250
+ /**
251
+ * The type of the event. Always `"response.failed"`.
252
+ */
253
+ type: /*#__PURE__*/Schema.Literal("response.failed"),
254
+ /**
255
+ * The sequence number for this event.
256
+ */
257
+ sequence_number: Schema.Int,
258
+ /**
259
+ * The response that failed.
260
+ */
261
+ response: Generated.Response
262
+ }) {}
263
+ /**
264
+ * Emitted when a new output item is added.
265
+ *
266
+ * @since 1.0.0
267
+ * @category Schemas
268
+ */
269
+ exports.ResponseFailedEvent = ResponseFailedEvent;
270
+ class ResponseOutputItemAddedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseOutputItemAddedEvent")({
271
+ /**
272
+ * The type of the event. Always `"response.output_item.added"`.
273
+ */
274
+ type: /*#__PURE__*/Schema.Literal("response.output_item.added"),
275
+ /**
276
+ * The sequence number for this event.
277
+ */
278
+ sequence_number: Schema.Int,
279
+ /**
280
+ * The index of the output item that was added.
281
+ */
282
+ output_index: Schema.Int,
283
+ /**
284
+ * The output item that was added.
285
+ */
286
+ item: Generated.OutputItem
287
+ }) {}
288
+ /**
289
+ * Emitted when an output item is marked done.
290
+ *
291
+ * @since 1.0.0
292
+ * @category Schemas
293
+ */
294
+ exports.ResponseOutputItemAddedEvent = ResponseOutputItemAddedEvent;
295
+ class ResponseOutputItemDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseOutputItemDoneEvent")({
296
+ /**
297
+ * The type of the event. Always `"response.output_item.done"`.
298
+ */
299
+ type: /*#__PURE__*/Schema.Literal("response.output_item.done"),
300
+ /**
301
+ * The sequence number for this event.
302
+ */
303
+ sequence_number: Schema.Int,
304
+ /**
305
+ * The index of the output item that was marked done.
306
+ */
307
+ output_index: Schema.Int,
308
+ /**
309
+ * The output item that was marked done.
310
+ */
311
+ item: Generated.OutputItem
312
+ }) {}
313
+ /**
314
+ * Emitted when a new content part is added.
315
+ *
316
+ * @since 1.0.0
317
+ * @category Schemas
318
+ */
319
+ exports.ResponseOutputItemDoneEvent = ResponseOutputItemDoneEvent;
320
+ class ResponseContentPartAddedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseContentPartAddedEvent")({
321
+ /**
322
+ * The type of the event. Always `"response.content_part.added"`.
323
+ */
324
+ type: /*#__PURE__*/Schema.Literal("response.content_part.added"),
325
+ /**
326
+ * The sequence number for this event.
327
+ */
328
+ sequence_number: Schema.Int,
329
+ /**
330
+ * The index of the output item that the content part was added to.
331
+ */
332
+ output_index: Schema.Int,
333
+ /**
334
+ * The index of the content part that was added.
335
+ */
336
+ content_index: Schema.Int,
337
+ /**
338
+ * The ID of the output item that the content part was added to.
339
+ */
340
+ item_id: Schema.String,
341
+ /**
342
+ * The content part that was added.
343
+ */
344
+ part: Generated.OutputContent
345
+ }) {}
346
+ /**
347
+ * Emitted when a content part is done.
348
+ *
349
+ * @since 1.0.0
350
+ * @category Schemas
351
+ */
352
+ exports.ResponseContentPartAddedEvent = ResponseContentPartAddedEvent;
353
+ class ResponseContentPartDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseContentPartDoneEvent")({
354
+ /**
355
+ * The type of the event. Always `"response.content_part.done"`.
356
+ */
357
+ type: /*#__PURE__*/Schema.Literal("response.content_part.done"),
358
+ /**
359
+ * The sequence number for this event.
360
+ */
361
+ sequence_number: Schema.Int,
362
+ /**
363
+ * The index of the output item that the content part was added to.
364
+ */
365
+ output_index: Schema.Int,
366
+ /**
367
+ * The index of the content part that is done.
368
+ */
369
+ content_index: Schema.Int,
370
+ /**
371
+ * The ID of the output item that the content part was added to.
372
+ */
373
+ item_id: Schema.String,
374
+ /**
375
+ * The content part that was added.
376
+ */
377
+ part: Generated.OutputContent
378
+ }) {}
379
+ /**
380
+ * @since 1.0.0
381
+ * @category Schemas
382
+ */
383
+ exports.ResponseContentPartDoneEvent = ResponseContentPartDoneEvent;
384
+ class LogProbs extends /*#__PURE__*/Schema.Class("@effect/ai-openai/LogProbs")({
385
+ /**
386
+ * The log probability of this token.
387
+ */
388
+ logprob: Schema.Number,
389
+ /**
390
+ * A possible text token.
391
+ */
392
+ token: Schema.String,
393
+ /**
394
+ * The log probability of the top 20 most likely tokens.
395
+ */
396
+ top_logprobs: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Struct({
397
+ /**
398
+ * The log probability of this token.
399
+ */
400
+ logprob: Schema.Number,
401
+ /**
402
+ * A possible text token.
403
+ */
404
+ token: Schema.String
405
+ }))
406
+ }) {}
407
+ /**
408
+ * Emitted when there is an additional text delta.
409
+ *
410
+ * @since 1.0.0
411
+ * @category Schemas
412
+ */
413
+ exports.LogProbs = LogProbs;
414
+ class ResponseOutputTextDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseOutputTextDeltaEvent")({
415
+ /**
416
+ * The type of the event. Always `"response.output_text.delta"`.
417
+ */
418
+ type: /*#__PURE__*/Schema.Literal("response.output_text.delta"),
419
+ /**
420
+ * The sequence number for this event.
421
+ */
422
+ sequence_number: Schema.Int,
423
+ /**
424
+ * The index of the output item that the text delta was added to.
425
+ */
426
+ output_index: Schema.Int,
427
+ /**
428
+ * The index of the content part that the text delta was added to.
429
+ */
430
+ content_index: Schema.Int,
431
+ /**
432
+ * The ID of the output item that the text delta was added to.
433
+ */
434
+ item_id: Schema.String,
435
+ /**
436
+ * The text delta that was added.
437
+ */
438
+ delta: Schema.String,
439
+ /**
440
+ * The log probabilities of the tokens in the delta.
441
+ */
442
+ logprobs: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(LogProbs)))
443
+ }) {}
444
+ /**
445
+ * Emitted when text content is finalized.
446
+ *
447
+ * @since 1.0.0
448
+ * @category Schemas
449
+ */
450
+ exports.ResponseOutputTextDeltaEvent = ResponseOutputTextDeltaEvent;
451
+ class ResponseOutputTextDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseOutputTextDoneEvent")({
452
+ /**
453
+ * The type of the event. Always `"response.output_text.done"`.
454
+ */
455
+ type: /*#__PURE__*/Schema.Literal("response.output_text.done"),
456
+ /**
457
+ * The sequence number for this event.
458
+ */
459
+ sequence_number: Schema.Int,
460
+ /**
461
+ * The index of the output item that the text content is finalized.
462
+ */
463
+ output_index: Schema.Int,
464
+ /**
465
+ * The index of the content part that the text content is finalized.
466
+ */
467
+ content_index: Schema.Int,
468
+ /**
469
+ * The ID of the output item that the text content is finalized.
470
+ */
471
+ item_id: Schema.String,
472
+ /**
473
+ * The text content that is finalized.
474
+ */
475
+ text: Schema.String,
476
+ /**
477
+ * The log probabilities of the tokens in the delta.
478
+ */
479
+ logprobs: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(LogProbs)))
480
+ }) {}
481
+ /**
482
+ * Emitted when an annotation is added to output text content.
483
+ *
484
+ * @since 1.0.0
485
+ * @category Schemas
486
+ */
487
+ exports.ResponseOutputTextDoneEvent = ResponseOutputTextDoneEvent;
488
+ class ResponseOutputTextAnnotationAddedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseOutputTextAnnotationAddedEvent")({
489
+ /**
490
+ * The type of the event. Always `"response.output_text.annotation.added"`.
491
+ */
492
+ type: /*#__PURE__*/Schema.Literal("response.output_text.annotation.added"),
493
+ /**
494
+ * The sequence number for this event.
495
+ */
496
+ sequence_number: Schema.Int,
497
+ /**
498
+ * The index of the output item in the response's output array.
499
+ */
500
+ output_index: Schema.Int,
501
+ /**
502
+ * The index of the content part within the output item.
503
+ */
504
+ content_index: Schema.Int,
505
+ /**
506
+ * The index of the annotation within the content part.
507
+ */
508
+ annotation_index: Schema.Int,
509
+ /**
510
+ * The unique identifier of the item to which the annotation is being added.
511
+ */
512
+ item_id: Schema.String,
513
+ /**
514
+ * The annotation object being added. (See annotation schema for details.)
515
+ */
516
+ annotation: Generated.Annotation
517
+ }) {}
518
+ /**
519
+ * Emitted when there is a partial refusal text.
520
+ *
521
+ * @since 1.0.0
522
+ * @category Schemas
523
+ */
524
+ exports.ResponseOutputTextAnnotationAddedEvent = ResponseOutputTextAnnotationAddedEvent;
525
+ class ResponseRefusalDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseRefusalDeltaEvent")({
526
+ /**
527
+ * The type of the event. Always `"response.refusal.delta"`.
528
+ */
529
+ type: /*#__PURE__*/Schema.Literal("response.refusal.delta"),
530
+ /**
531
+ * The sequence number for this event.
532
+ */
533
+ sequence_number: Schema.Int,
534
+ /**
535
+ * The index of the output item that the refusal text is added to.
536
+ */
537
+ output_index: Schema.Int,
538
+ /**
539
+ * The index of the content part that the refusal text is added to.
540
+ */
541
+ content_index: Schema.Int,
542
+ /**
543
+ * The ID of the output item that the refusal text is added to.
544
+ */
545
+ item_id: Schema.String,
546
+ /**
547
+ * The refusal text that is added.
548
+ */
549
+ delta: Schema.String
550
+ }) {}
551
+ /**
552
+ * Emitted when refusal text is finalized.
553
+ *
554
+ * @since 1.0.0
555
+ * @category Schemas
556
+ */
557
+ exports.ResponseRefusalDeltaEvent = ResponseRefusalDeltaEvent;
558
+ class ResponseRefusalDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseRefusalDoneEvent")({
559
+ /**
560
+ * The type of the event. Always `"response.refusal.done"`.
561
+ */
562
+ type: /*#__PURE__*/Schema.Literal("response.refusal.done"),
563
+ /**
564
+ * The sequence number for this event.
565
+ */
566
+ sequence_number: Schema.Int,
567
+ /**
568
+ * The index of the output item that the refusal text is finalized.
569
+ */
570
+ output_index: Schema.Int,
571
+ /**
572
+ * The index of the content part that the refusal text is finalized.
573
+ */
574
+ content_index: Schema.Int,
575
+ /**
576
+ * The index of the output item that the refusal text is added to.
577
+ */
578
+ item_id: Schema.String,
579
+ /**
580
+ * The refusal text that is finalized.
581
+ */
582
+ refusal: Schema.String
583
+ }) {}
584
+ /**
585
+ * Emitted when there is a partial function-call arguments delta.
586
+ *
587
+ * @since 1.0.0
588
+ * @category Schemas
589
+ */
590
+ exports.ResponseRefusalDoneEvent = ResponseRefusalDoneEvent;
591
+ class ResponseFunctionCallArgumentsDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseFunctionCallArgumentsDeltaEvent")({
592
+ /**
593
+ * The type of the event. Always `"response.function_call_arguments.delta"`.
594
+ */
595
+ type: /*#__PURE__*/Schema.Literal("response.function_call_arguments.delta"),
596
+ /**
597
+ * The sequence number for this event.
598
+ */
599
+ sequence_number: Schema.Int,
600
+ /**
601
+ * The index of the output item that the function-call arguments delta is added to.
602
+ */
603
+ output_index: Schema.Int,
604
+ /**
605
+ * The ID of the output item that the function-call arguments delta is added to.
606
+ */
607
+ item_id: Schema.String,
608
+ /**
609
+ * The function-call arguments delta that is added.
610
+ */
611
+ delta: Schema.String
612
+ }) {}
613
+ /**
614
+ * Emitted when function-call arguments are finalized.
615
+ *
616
+ * @since 1.0.0
617
+ * @category Schemas
618
+ */
619
+ exports.ResponseFunctionCallArgumentsDeltaEvent = ResponseFunctionCallArgumentsDeltaEvent;
620
+ class ResponseFunctionCallArgumentsDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseFunctionCallArgumentsDoneEvent")({
621
+ /**
622
+ * The type of the event. Always `"response.function_call_arguments.done"`.
623
+ */
624
+ type: /*#__PURE__*/Schema.Literal("response.function_call_arguments.done"),
625
+ /**
626
+ * The sequence number for this event.
627
+ */
628
+ sequence_number: Schema.Int,
629
+ /**
630
+ * The index of the output item.
631
+ */
632
+ output_index: Schema.Int,
633
+ /**
634
+ * The ID of the item.
635
+ */
636
+ item_id: Schema.String,
637
+ /**
638
+ * The function-call arguments.
639
+ */
640
+ arguments: Schema.String
641
+ }) {}
642
+ /**
643
+ * Emitted when a file search call is initiated.
644
+ *
645
+ * @since 1.0.0
646
+ * @category Schemas
647
+ */
648
+ exports.ResponseFunctionCallArgumentsDoneEvent = ResponseFunctionCallArgumentsDoneEvent;
649
+ class ResponseFileSearchCallInProgressEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseFileSearchCallInProgressEvent")({
650
+ /**
651
+ * The type of the event. Always `"response.file_search_call.in_progress"`.
652
+ */
653
+ type: /*#__PURE__*/Schema.Literal("response.file_search_call.in_progress"),
654
+ /**
655
+ * The sequence number for this event.
656
+ */
657
+ sequence_number: Schema.Int,
658
+ /**
659
+ * The index of the output item that the file search call is initiated.
660
+ */
661
+ output_index: Schema.Int,
662
+ /**
663
+ * The ID of the output item that the file search call is initiated.
664
+ */
665
+ item_id: Schema.String
666
+ }) {}
667
+ /**
668
+ * Emitted when a file search is currently searching.
669
+ *
670
+ * @since 1.0.0
671
+ * @category Schemas
672
+ */
673
+ exports.ResponseFileSearchCallInProgressEvent = ResponseFileSearchCallInProgressEvent;
674
+ class ResponseFileSearchCallSearchingEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseFileSearchCallSearchingEvent")({
675
+ /**
676
+ * The type of the event. Always `"response.file_search_call.searching"`.
677
+ */
678
+ type: /*#__PURE__*/Schema.Literal("response.file_search_call.searching"),
679
+ /**
680
+ * The sequence number for this event.
681
+ */
682
+ sequence_number: Schema.Int,
683
+ /**
684
+ * The index of the output item that the file search call is searching.
685
+ */
686
+ output_index: Schema.Int,
687
+ /**
688
+ * The ID of the output item that the file search call is initiated.
689
+ */
690
+ item_id: Schema.String
691
+ }) {}
692
+ /**
693
+ * Emitted when a file search call is completed (results found).
694
+ *
695
+ * @since 1.0.0
696
+ * @category Schemas
697
+ */
698
+ exports.ResponseFileSearchCallSearchingEvent = ResponseFileSearchCallSearchingEvent;
699
+ class ResponseFileSearchCallCompletedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseFileSearchCallCompletedEvent")({
700
+ /**
701
+ * The type of the event. Always `"response.file_search_call.completed"`.
702
+ */
703
+ type: /*#__PURE__*/Schema.Literal("response.file_search_call.completed"),
704
+ /**
705
+ * The sequence number for this event.
706
+ */
707
+ sequence_number: Schema.Int,
708
+ /**
709
+ * The index of the output item that the file search call is initiated.
710
+ */
711
+ output_index: Schema.Int,
712
+ /**
713
+ * The ID of the output item that the file search call is initiated.
714
+ */
715
+ item_id: Schema.String
716
+ }) {}
717
+ /**
718
+ * Emitted when a web search call is initiated.
719
+ *
720
+ * @since 1.0.0
721
+ * @category Schemas
722
+ */
723
+ exports.ResponseFileSearchCallCompletedEvent = ResponseFileSearchCallCompletedEvent;
724
+ class ResponseWebSearchCallInProgressEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseWebSearchCallInProgressEvent")({
725
+ /**
726
+ * The type of the event. Always `"response.web_search_call.in_progress"`.
727
+ */
728
+ type: /*#__PURE__*/Schema.Literal("response.web_search_call.in_progress"),
729
+ /**
730
+ * The sequence number for this event.
731
+ */
732
+ sequence_number: Schema.Int,
733
+ /**
734
+ * The index of the output item that the web search call is associated with.
735
+ */
736
+ output_index: Schema.Int,
737
+ /**
738
+ * Unique ID for the output item associated with the web search call.
739
+ */
740
+ item_id: Schema.String
741
+ }) {}
742
+ /**
743
+ * Emitted when a web search call is executing.
744
+ *
745
+ * @since 1.0.0
746
+ * @category Schemas
747
+ */
748
+ exports.ResponseWebSearchCallInProgressEvent = ResponseWebSearchCallInProgressEvent;
749
+ class ResponseWebSearchCallSearchingEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseWebSearchCallSearchingEvent")({
750
+ /**
751
+ * The type of the event. Always `"response.web_search_call.searching"`.
752
+ */
753
+ type: /*#__PURE__*/Schema.Literal("response.web_search_call.searching"),
754
+ /**
755
+ * The sequence number for this event.
756
+ */
757
+ sequence_number: Schema.Int,
758
+ /**
759
+ * The index of the output item that the web search call is associated with.
760
+ */
761
+ output_index: Schema.Int,
762
+ /**
763
+ * Unique ID for the output item associated with the web search call.
764
+ */
765
+ item_id: Schema.String
766
+ }) {}
767
+ /**
768
+ * Emitted when a web search call is completed.
769
+ *
770
+ * @since 1.0.0
771
+ * @category Schemas
772
+ */
773
+ exports.ResponseWebSearchCallSearchingEvent = ResponseWebSearchCallSearchingEvent;
774
+ class ResponseWebSearchCallCompletedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseWebSearchCallCompletedEvent")({
775
+ /**
776
+ * The type of the event. Always `"response.web_search_call.completed"`.
777
+ */
778
+ type: /*#__PURE__*/Schema.Literal("response.web_search_call.completed"),
779
+ /**
780
+ * The sequence number for this event.
781
+ */
782
+ sequence_number: Schema.Int,
783
+ /**
784
+ * The index of the output item that the web search call is associated with.
785
+ */
786
+ output_index: Schema.Int,
787
+ /**
788
+ * Unique ID for the output item associated with the web search call.
789
+ */
790
+ item_id: Schema.String
791
+ }) {}
792
+ /**
793
+ * @since 1.0.0
794
+ * @category Schemas
795
+ */
796
+ exports.ResponseWebSearchCallCompletedEvent = ResponseWebSearchCallCompletedEvent;
797
+ class SummaryPart extends /*#__PURE__*/Schema.Class("@effect/ai-openai/SummaryPart")({
798
+ /**
799
+ * The type of the summary part. Always `"summary_text"`.
800
+ */
801
+ type: /*#__PURE__*/Schema.Literal("summary_text"),
802
+ /**
803
+ * The text of the summary part.
804
+ */
805
+ text: Schema.String
806
+ }) {}
807
+ /**
808
+ * Emitted when a reasoning summary part is completed.
809
+ *
810
+ * @since 1.0.0
811
+ * @category Schemas
812
+ */
813
+ exports.SummaryPart = SummaryPart;
814
+ class ResponseReasoningSummaryPartAddedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseReasoningSummaryPartAddedEvent")({
815
+ /**
816
+ * The type of the event. Always `"response.reasoning_summary_part.added"`.
817
+ */
818
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_summary_part.added"),
819
+ /**
820
+ * The sequence number for this event.
821
+ */
822
+ sequence_number: Schema.Int,
823
+ /**
824
+ * The index of the summary part within the reasoning summary.
825
+ */
826
+ summary_index: Schema.Int,
827
+ /**
828
+ * The index of the output item this summary part is associated with.
829
+ */
830
+ output_index: Schema.Int,
831
+ /**
832
+ * The ID of the item this summary part is associated with.
833
+ */
834
+ item_id: Schema.String,
835
+ /**
836
+ * The summary part that was added.
837
+ */
838
+ part: SummaryPart
839
+ }) {}
840
+ /**
841
+ * Emitted when a new reasoning summary part is added.
842
+ *
843
+ * @since 1.0.0
844
+ * @category Schemas
845
+ */
846
+ exports.ResponseReasoningSummaryPartAddedEvent = ResponseReasoningSummaryPartAddedEvent;
847
+ class ResponseReasoningSummaryPartDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseReasoningSummaryPartDoneEvent")({
848
+ /**
849
+ * The type of the event. Always `"response.reasoning_summary_part.done"`.
850
+ */
851
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_summary_part.done"),
852
+ /**
853
+ * The sequence number for this event.
854
+ */
855
+ sequence_number: Schema.Int,
856
+ /**
857
+ * The index of the summary part within the reasoning summary.
858
+ */
859
+ summary_index: Schema.Int,
860
+ /**
861
+ * The index of the output item this summary part is associated with.
862
+ */
863
+ output_index: Schema.Int,
864
+ /**
865
+ * The ID of the item this summary part is associated with.
866
+ */
867
+ item_id: Schema.String,
868
+ /**
869
+ * The completed summary part.
870
+ */
871
+ part: SummaryPart
872
+ }) {}
873
+ /**
874
+ * Emitted when a delta is added to a reasoning summary text.
875
+ *
876
+ * @since 1.0.0
877
+ * @category Schemas
878
+ */
879
+ exports.ResponseReasoningSummaryPartDoneEvent = ResponseReasoningSummaryPartDoneEvent;
880
+ class ResponseReasoningSummaryTextDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseReasoningSummaryTextDeltaEvent")({
881
+ /**
882
+ * The type of the event. Always `"response.reasoning_summary_text.delta"`.
883
+ */
884
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_summary_text.delta"),
885
+ /**
886
+ * The sequence number for this event.
887
+ */
888
+ sequence_number: Schema.Int,
889
+ /**
890
+ * The index of the summary part within the reasoning summary.
891
+ */
892
+ summary_index: Schema.Int,
893
+ /**
894
+ * The index of the output item this summary text delta is associated with.
895
+ */
896
+ output_index: Schema.Int,
897
+ /**
898
+ * The ID of the item this summary text delta is associated with.
899
+ */
900
+ item_id: Schema.String,
901
+ /**
902
+ * The text delta that was added to the summary.
903
+ */
904
+ delta: Schema.String
905
+ }) {}
906
+ /**
907
+ * Emitted when a reasoning summary text is completed.
908
+ *
909
+ * @since 1.0.0
910
+ * @category Schemas
911
+ */
912
+ exports.ResponseReasoningSummaryTextDeltaEvent = ResponseReasoningSummaryTextDeltaEvent;
913
+ class ResponseReasoningSummaryTextDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseReasoningSummaryTextDoneEvent")({
914
+ /**
915
+ * The type of the event. Always `"response.reasoning_summary_text.done"`.
916
+ */
917
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_summary_text.done"),
918
+ /**
919
+ * The sequence number for this event.
920
+ */
921
+ sequence_number: Schema.Int,
922
+ /**
923
+ * The index of the summary part within the reasoning summary.
924
+ */
925
+ summary_index: Schema.Int,
926
+ /**
927
+ * The index of the output item this summary text is associated with.
928
+ */
929
+ output_index: Schema.Int,
930
+ /**
931
+ * The ID of the item this summary text is associated with.
932
+ */
933
+ item_id: Schema.String,
934
+ /**
935
+ * The full text of the completed reasoning summary.
936
+ */
937
+ text: Schema.String
938
+ }) {}
939
+ /**
940
+ * Emitted when a delta is added to a reasoning text.
941
+ *
942
+ * @since 1.0.0
943
+ * @category Schemas
944
+ */
945
+ exports.ResponseReasoningSummaryTextDoneEvent = ResponseReasoningSummaryTextDoneEvent;
946
+ class ResponseReasoningTextDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseReasoningTextDeltaEvent")({
947
+ /**
948
+ * The type of the event. Always `"response.reasoning_text.delta"`.
949
+ */
950
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_text.delta"),
951
+ /**
952
+ * The sequence number for this event.
953
+ */
954
+ sequence_number: Schema.Int,
955
+ /**
956
+ * The index of the reasoning content part this delta is associated with.
957
+ */
958
+ content_index: Schema.Int,
959
+ /**
960
+ * The index of the output item this reasoning text delta is associated with.
961
+ */
962
+ output_index: Schema.Int,
963
+ /**
964
+ * The ID of the item this reasoning text delta is associated with.
965
+ */
966
+ item_id: Schema.String,
967
+ /**
968
+ * The text delta that was added to the reasoning content.
969
+ */
970
+ delta: Schema.String
971
+ }) {}
972
+ /**
973
+ * Emitted when a reasoning text is completed.
974
+ *
975
+ * @since 1.0.0
976
+ * @category Schemas
977
+ */
978
+ exports.ResponseReasoningTextDeltaEvent = ResponseReasoningTextDeltaEvent;
979
+ class ResponseReasoningTextDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseReasoningPartDoneEvent")({
980
+ /**
981
+ * The type of the event. Always `"response.reasoning_text.done"`.
982
+ */
983
+ type: /*#__PURE__*/Schema.Literal("response.reasoning_text.done"),
984
+ /**
985
+ * The sequence number for this event.
986
+ */
987
+ sequence_number: Schema.Int,
988
+ /**
989
+ * The index of the reasoning content part.
990
+ */
991
+ content_index: Schema.Int,
992
+ /**
993
+ * The index of the output item this reasoning text is associated with.
994
+ */
995
+ output_index: Schema.Int,
996
+ /**
997
+ * The ID of the item this reasoning text is associated with.
998
+ */
999
+ item_id: Schema.String,
1000
+ /**
1001
+ * The full text of the completed reasoning content.
1002
+ */
1003
+ text: Schema.String
1004
+ }) {}
1005
+ /**
1006
+ * Emitted when an image generation tool call is in progress.
1007
+ *
1008
+ * @since 1.0.0
1009
+ * @category Schemas
1010
+ */
1011
+ exports.ResponseReasoningTextDoneEvent = ResponseReasoningTextDoneEvent;
1012
+ class ResponseImageGenerationCallInProgressEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseImageGenerationCallInProgressEvent")({
1013
+ /**
1014
+ * The type of the event. Always `"response.image_generation_call.in_progress"`.
1015
+ */
1016
+ type: /*#__PURE__*/Schema.Literal("response.image_generation_call.in_progress"),
1017
+ /**
1018
+ * The sequence number for this event.
1019
+ */
1020
+ sequence_number: Schema.Int,
1021
+ /**
1022
+ * The index of the output item in the response's output array.
1023
+ */
1024
+ output_index: Schema.Int,
1025
+ /**
1026
+ * The unique identifier of the image generation item being processed.
1027
+ */
1028
+ item_id: Schema.String
1029
+ }) {}
1030
+ /**
1031
+ * Emitted when an image generation tool call is actively generating an image
1032
+ * (intermediate state).
1033
+ *
1034
+ * @since 1.0.0
1035
+ * @category Schemas
1036
+ */
1037
+ exports.ResponseImageGenerationCallInProgressEvent = ResponseImageGenerationCallInProgressEvent;
1038
+ class ResponseImageGenerationCallGeneratingEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseImageGenerationCallGeneratingEvent")({
1039
+ /**
1040
+ * The type of the event. Always `"response.image_generation_call.generating"`.
1041
+ */
1042
+ type: /*#__PURE__*/Schema.Literal("response.image_generation_call.generating"),
1043
+ /**
1044
+ * The sequence number for this event.
1045
+ */
1046
+ sequence_number: Schema.Int,
1047
+ /**
1048
+ * The index of the output item in the response's output array.
1049
+ */
1050
+ output_index: Schema.Int,
1051
+ /**
1052
+ * The unique identifier of the image generation item being processed.
1053
+ */
1054
+ item_id: Schema.String
1055
+ }) {}
1056
+ /**
1057
+ * Emitted when a partial image is available during image generation streaming.
1058
+ *
1059
+ * @since 1.0.0
1060
+ * @category Schemas
1061
+ */
1062
+ exports.ResponseImageGenerationCallGeneratingEvent = ResponseImageGenerationCallGeneratingEvent;
1063
+ class ResponseImageGenerationCallPartialImageEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseImageGenerationCallPartialImageEvent")({
1064
+ /**
1065
+ * The type of the event. Always `"response.image_generation_call.partial_image"`.
1066
+ */
1067
+ type: /*#__PURE__*/Schema.Literal("response.image_generation_call.partial_image"),
1068
+ /**
1069
+ * The sequence number for this event.
1070
+ */
1071
+ sequence_number: Schema.Int,
1072
+ /**
1073
+ * The index of the output item in the response's output array.
1074
+ */
1075
+ output_index: Schema.Int,
1076
+ /**
1077
+ * The unique identifier of the image generation item being processed.
1078
+ */
1079
+ item_id: Schema.String,
1080
+ /**
1081
+ * `0`-based index for the partial image (backend is `1`-based, but this is
1082
+ * `0`-based for the user).
1083
+ */
1084
+ partial_image_index: Schema.Int,
1085
+ /**
1086
+ * Base64-encoded partial image data, suitable for rendering as an image.
1087
+ */
1088
+ partial_image_b64: Schema.String
1089
+ }) {}
1090
+ /**
1091
+ * Emitted when an image generation tool call has completed and the final image
1092
+ * is available.
1093
+ *
1094
+ * @since 1.0.0
1095
+ * @category Schemas
1096
+ */
1097
+ exports.ResponseImageGenerationCallPartialImageEvent = ResponseImageGenerationCallPartialImageEvent;
1098
+ class ResponseImageGenerationCallCompletedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseImageGenerationCallCompletedEvent")({
1099
+ /**
1100
+ * The type of the event. Always `"response.image_generation_call.completed"`.
1101
+ */
1102
+ type: /*#__PURE__*/Schema.Literal("response.image_generation_call.completed"),
1103
+ /**
1104
+ * The sequence number for this event.
1105
+ */
1106
+ sequence_number: Schema.Int,
1107
+ /**
1108
+ * The index of the output item in the response's output array.
1109
+ */
1110
+ output_index: Schema.Int,
1111
+ /**
1112
+ * The unique identifier of the image generation item being processed.
1113
+ */
1114
+ item_id: Schema.String
1115
+ }) {}
1116
+ /**
1117
+ * Emitted when there is a delta (partial update) to the arguments of an MCP
1118
+ * tool call.
1119
+ *
1120
+ * @since 1.0.0
1121
+ * @category Schemas
1122
+ */
1123
+ exports.ResponseImageGenerationCallCompletedEvent = ResponseImageGenerationCallCompletedEvent;
1124
+ class ResponseMcpCallArgumentsDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpCallArgumentsDeltaEvent")({
1125
+ /**
1126
+ * The type of the event. Always `"response.mcp_call_arguments.delta"`.
1127
+ */
1128
+ type: /*#__PURE__*/Schema.Literal("response.mcp_call_arguments.delta"),
1129
+ /**
1130
+ * The sequence number for this event.
1131
+ */
1132
+ sequence_number: Schema.Int,
1133
+ /**
1134
+ * The index of the output item in the response's output array.
1135
+ */
1136
+ output_index: Schema.Int,
1137
+ /**
1138
+ * The unique identifier of the MCP tool call item being processed.
1139
+ */
1140
+ item_id: Schema.String,
1141
+ /**
1142
+ * A JSON string containing the partial update to the arguments for the MCP
1143
+ * tool call.
1144
+ */
1145
+ delta: Schema.String
1146
+ }) {}
1147
+ /**
1148
+ * Emitted when the arguments for an MCP tool call are finalized.
1149
+ *
1150
+ * @since 1.0.0
1151
+ * @category Schemas
1152
+ */
1153
+ exports.ResponseMcpCallArgumentsDeltaEvent = ResponseMcpCallArgumentsDeltaEvent;
1154
+ class ResponseMcpCallArgumentsDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpCallArgumentsDoneEvent")({
1155
+ /**
1156
+ * The type of the event. Always `"response.mcp_call_arguments.done"`.
1157
+ */
1158
+ type: /*#__PURE__*/Schema.Literal("response.mcp_call_arguments.done"),
1159
+ /**
1160
+ * The sequence number for this event.
1161
+ */
1162
+ sequence_number: Schema.Int,
1163
+ /**
1164
+ * The index of the output item in the response's output array.
1165
+ */
1166
+ output_index: Schema.Int,
1167
+ /**
1168
+ * The unique identifier of the MCP tool call item being processed.
1169
+ */
1170
+ item_id: Schema.String,
1171
+ /**
1172
+ * A JSON string containing the finalized arguments for the MCP tool call.
1173
+ */
1174
+ arguments: Schema.String
1175
+ }) {}
1176
+ /**
1177
+ * Emitted when an MCP tool call is in progress.
1178
+ *
1179
+ * @since 1.0.0
1180
+ * @category Schemas
1181
+ */
1182
+ exports.ResponseMcpCallArgumentsDoneEvent = ResponseMcpCallArgumentsDoneEvent;
1183
+ class ResponseMcpCallInProgressEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpCallInProgressEvent")({
1184
+ /**
1185
+ * The type of the event. Always `"response.mcp_call.in_progress"`.
1186
+ */
1187
+ type: /*#__PURE__*/Schema.Literal("response.mcp_call.in_progress"),
1188
+ /**
1189
+ * The sequence number for this event.
1190
+ */
1191
+ sequence_number: Schema.Int,
1192
+ /**
1193
+ * The index of the output item in the response's output array.
1194
+ */
1195
+ output_index: Schema.Int,
1196
+ /**
1197
+ * The unique identifier of the MCP tool call item being processed.
1198
+ */
1199
+ item_id: Schema.String
1200
+ }) {}
1201
+ /**
1202
+ * Emitted when an MCP tool call has completed successfully.
1203
+ *
1204
+ * @since 1.0.0
1205
+ * @category Schemas
1206
+ */
1207
+ exports.ResponseMcpCallInProgressEvent = ResponseMcpCallInProgressEvent;
1208
+ class ResponseMcpCallCompletedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpCallCompletedEvent")({
1209
+ /**
1210
+ * The type of the event. Always `"response.mcp_call.completed"`.
1211
+ */
1212
+ type: /*#__PURE__*/Schema.Literal("response.mcp_call.completed"),
1213
+ /**
1214
+ * The sequence number for this event.
1215
+ */
1216
+ sequence_number: Schema.Int,
1217
+ /**
1218
+ * The index of the output item that completed.
1219
+ */
1220
+ output_index: Schema.Int,
1221
+ /**
1222
+ * The ID of the MCP tool call item that completed.
1223
+ */
1224
+ item_id: Schema.String
1225
+ }) {}
1226
+ /**
1227
+ * Emitted when an MCP tool call has failed.
1228
+ *
1229
+ * @since 1.0.0
1230
+ * @category Schemas
1231
+ */
1232
+ exports.ResponseMcpCallCompletedEvent = ResponseMcpCallCompletedEvent;
1233
+ class ResponseMcpCallFailedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpCallFailedEvent")({
1234
+ /**
1235
+ * The type of the event. Always `"response.mcp_call.failed"`.
1236
+ */
1237
+ type: /*#__PURE__*/Schema.Literal("response.mcp_call.failed"),
1238
+ /**
1239
+ * The sequence number for this event.
1240
+ */
1241
+ sequence_number: Schema.Int,
1242
+ /**
1243
+ * The index of the output item that failed.
1244
+ */
1245
+ output_index: Schema.Int,
1246
+ /**
1247
+ * The ID of the MCP tool call item that failed.
1248
+ */
1249
+ item_id: Schema.String
1250
+ }) {}
1251
+ /**
1252
+ * Emitted when the system is in the process of retrieving the list of available
1253
+ * MCP tools.
1254
+ *
1255
+ * @since 1.0.0
1256
+ * @category Schemas
1257
+ */
1258
+ exports.ResponseMcpCallFailedEvent = ResponseMcpCallFailedEvent;
1259
+ class ResponseMcpListToolsInProgressEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpListToolsInProgressEvent")({
1260
+ /**
1261
+ * The type of the event. Always `"response.mcp_list_tools.in_progress"`.
1262
+ */
1263
+ type: /*#__PURE__*/Schema.Literal("response.mcp_list_tools.in_progress"),
1264
+ /**
1265
+ * The sequence number for this event.
1266
+ */
1267
+ sequence_number: Schema.Int,
1268
+ /**
1269
+ * The index of the output item that is being processed.
1270
+ */
1271
+ output_index: Schema.Int,
1272
+ /**
1273
+ * The ID of the MCP tool call item that is being processed.
1274
+ */
1275
+ item_id: Schema.String
1276
+ }) {}
1277
+ /**
1278
+ * Emitted when the list of available MCP tools has been successfully retrieved.
1279
+ *
1280
+ * @since 1.0.0
1281
+ * @category Schemas
1282
+ */
1283
+ exports.ResponseMcpListToolsInProgressEvent = ResponseMcpListToolsInProgressEvent;
1284
+ class ResponseMcpListToolsCompletedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpListToolsCompletedEvent")({
1285
+ /**
1286
+ * The type of the event. Always `"response.mcp_list_tools.completed"`.
1287
+ */
1288
+ type: /*#__PURE__*/Schema.Literal("response.mcp_list_tools.completed"),
1289
+ /**
1290
+ * The sequence number for this event.
1291
+ */
1292
+ sequence_number: Schema.Int,
1293
+ /**
1294
+ * The index of the output item that was processed.
1295
+ */
1296
+ output_index: Schema.Int,
1297
+ /**
1298
+ * The ID of the MCP tool call item that produced this output.
1299
+ */
1300
+ item_id: Schema.String
1301
+ }) {}
1302
+ /**
1303
+ * Emitted when the attempt to list available MCP tools has failed.
1304
+ *
1305
+ * @since 1.0.0
1306
+ * @category Schemas
1307
+ */
1308
+ exports.ResponseMcpListToolsCompletedEvent = ResponseMcpListToolsCompletedEvent;
1309
+ class ResponseMcpListToolsFailedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseMcpListToolsFailedEvent")({
1310
+ /**
1311
+ * The type of the event. Always `"response.mcp_list_tools.failed"`.
1312
+ */
1313
+ type: /*#__PURE__*/Schema.Literal("response.mcp_list_tools.failed"),
1314
+ /**
1315
+ * The sequence number for this event.
1316
+ */
1317
+ sequence_number: Schema.Int,
1318
+ /**
1319
+ * The index of the output item that failed.
1320
+ */
1321
+ output_index: Schema.Int,
1322
+ /**
1323
+ * The ID of the MCP tool call item that failed.
1324
+ */
1325
+ item_id: Schema.String
1326
+ }) {}
1327
+ /**
1328
+ * Emitted when a code interpreter call is in progress.
1329
+ *
1330
+ * @since 1.0.0
1331
+ * @category Schemas
1332
+ */
1333
+ exports.ResponseMcpListToolsFailedEvent = ResponseMcpListToolsFailedEvent;
1334
+ class ResponseCodeInterpreterCallInProgressEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCodeInterpreterCallInProgressEvent")({
1335
+ /**
1336
+ * The type of the event. Always `"response.code_interpreter_call.in_progress"`.
1337
+ */
1338
+ type: /*#__PURE__*/Schema.Literal("response.code_interpreter_call.in_progress"),
1339
+ /**
1340
+ * The sequence number for this event.
1341
+ */
1342
+ sequence_number: Schema.Int,
1343
+ /**
1344
+ * The index of the output item in the response for which the code interpreter
1345
+ * call is in progress.
1346
+ */
1347
+ output_index: Schema.Int,
1348
+ /**
1349
+ * The unique identifier of the code interpreter tool call item.
1350
+ */
1351
+ item_id: Schema.String
1352
+ }) {}
1353
+ /**
1354
+ * Emitted when the code interpreter is actively interpreting the code snippet.
1355
+ *
1356
+ * @since 1.0.0
1357
+ * @category Schemas
1358
+ */
1359
+ exports.ResponseCodeInterpreterCallInProgressEvent = ResponseCodeInterpreterCallInProgressEvent;
1360
+ class ResponseCodeInterpreterCallInterpretingEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCodeInterpreterCallInterpretingEvent")({
1361
+ /**
1362
+ * The type of the event. Always `"response.code_interpreter_call.interpreting"`.
1363
+ */
1364
+ type: /*#__PURE__*/Schema.Literal("response.code_interpreter_call.interpreting"),
1365
+ /**
1366
+ * The sequence number for this event.
1367
+ */
1368
+ sequence_number: Schema.Int,
1369
+ /**
1370
+ * The index of the output item in the response for which the code
1371
+ * interpreter is interpreting code.
1372
+ */
1373
+ output_index: Schema.Int,
1374
+ /**
1375
+ * The unique identifier of the code interpreter tool call item.
1376
+ */
1377
+ item_id: Schema.String
1378
+ }) {}
1379
+ /**
1380
+ * Emitted when the code interpreter call is completed.
1381
+ *
1382
+ * @since 1.0.0
1383
+ * @category Schemas
1384
+ */
1385
+ exports.ResponseCodeInterpreterCallInterpretingEvent = ResponseCodeInterpreterCallInterpretingEvent;
1386
+ class ResponseCodeInterpreterCallCompletedEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCodeInterpreterCallCompletedEvent")({
1387
+ /**
1388
+ * The type of the event. Always `"response.code_interpreter_call.completed"`.
1389
+ */
1390
+ type: /*#__PURE__*/Schema.Literal("response.code_interpreter_call.completed"),
1391
+ /**
1392
+ * The sequence number for this event.
1393
+ */
1394
+ sequence_number: Schema.Int,
1395
+ /**
1396
+ * The index of the output item in the response for which the code interpreter
1397
+ * call is completed.
1398
+ */
1399
+ output_index: Schema.Int,
1400
+ /**
1401
+ * The unique identifier of the code interpreter tool call item.
1402
+ */
1403
+ item_id: Schema.String
1404
+ }) {}
1405
+ /**
1406
+ * Emitted when a partial code snippet is streamed by the code interpreter.
1407
+ *
1408
+ * @since 1.0.0
1409
+ * @category Schemas
1410
+ */
1411
+ exports.ResponseCodeInterpreterCallCompletedEvent = ResponseCodeInterpreterCallCompletedEvent;
1412
+ class ResponseCodeInterpreterCallCodeDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCodeInterpreterCallCodeDeltaEvent")({
1413
+ /**
1414
+ * The type of the event. Always `"response.code_interpreter_call_code.delta"`.
1415
+ */
1416
+ type: /*#__PURE__*/Schema.Literal("response.code_interpreter_call_code.delta"),
1417
+ /**
1418
+ * The sequence number for this event.
1419
+ */
1420
+ sequence_number: Schema.Int,
1421
+ /**
1422
+ * The index of the output item in the response for which the code is being
1423
+ * streamed.
1424
+ */
1425
+ output_index: Schema.Int,
1426
+ /**
1427
+ * The unique identifier of the code interpreter tool call item.
1428
+ */
1429
+ item_id: Schema.String,
1430
+ /**
1431
+ * The partial code snippet being streamed by the code interpreter.
1432
+ */
1433
+ delta: Schema.String
1434
+ }) {}
1435
+ /**
1436
+ * Emitted when the code snippet is finalized by the code interpreter.
1437
+ *
1438
+ * @since 1.0.0
1439
+ * @category Schemas
1440
+ */
1441
+ exports.ResponseCodeInterpreterCallCodeDeltaEvent = ResponseCodeInterpreterCallCodeDeltaEvent;
1442
+ class ResponseCodeInterpreterCallCodeDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCodeInterpreterCallCodeDoneEvent")({
1443
+ /**
1444
+ * The type of the event. Always `"response.code_interpreter_call_code.done"`.
1445
+ */
1446
+ type: /*#__PURE__*/Schema.Literal("response.code_interpreter_call_code.done"),
1447
+ /**
1448
+ * The sequence number for this event.
1449
+ */
1450
+ sequence_number: Schema.Int,
1451
+ /**
1452
+ * The index of the output item in the response for which the code is finalized.
1453
+ */
1454
+ output_index: Schema.Int,
1455
+ /**
1456
+ * The unique identifier of the code interpreter tool call item.
1457
+ */
1458
+ item_id: Schema.String,
1459
+ /**
1460
+ * The final code snippet output by the code interpreter.
1461
+ */
1462
+ code: Schema.String
1463
+ }) {}
1464
+ /**
1465
+ * Event representing a delta (partial update) to the input of a custom tool call.
1466
+ *
1467
+ * @since 1.0.0
1468
+ * @category Schemas
1469
+ */
1470
+ exports.ResponseCodeInterpreterCallCodeDoneEvent = ResponseCodeInterpreterCallCodeDoneEvent;
1471
+ class ResponseCustomToolCallInputDeltaEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCustomToolCallInputDeltaEvent")({
1472
+ /**
1473
+ * The type of the event. Always `"response.custom_tool_call_input.delta"`.
1474
+ */
1475
+ type: /*#__PURE__*/Schema.Literal("response.custom_tool_call_input.delta"),
1476
+ /**
1477
+ * The sequence number for this event.
1478
+ */
1479
+ sequence_number: Schema.Int,
1480
+ /**
1481
+ * The index of the output this delta applies to.
1482
+ */
1483
+ output_index: Schema.Int,
1484
+ /**
1485
+ * Unique identifier for the API item associated with this event.
1486
+ */
1487
+ item_id: Schema.String,
1488
+ /**
1489
+ * The incremental input data (delta) for the custom tool call.
1490
+ */
1491
+ delta: Schema.String
1492
+ }) {}
1493
+ /**
1494
+ * Event indicating that input for a custom tool call is complete.
1495
+ *
1496
+ * @since 1.0.0
1497
+ * @category Schemas
1498
+ */
1499
+ exports.ResponseCustomToolCallInputDeltaEvent = ResponseCustomToolCallInputDeltaEvent;
1500
+ class ResponseCustomToolCallInputDoneEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseCustomToolCallInputDoneEvent")({
1501
+ /**
1502
+ * The type of the event. Always `"response.custom_tool_call_input.done"`.
1503
+ */
1504
+ type: /*#__PURE__*/Schema.Literal("response.custom_tool_call_input.done"),
1505
+ /**
1506
+ * The sequence number for this event.
1507
+ */
1508
+ sequence_number: Schema.Int,
1509
+ /**
1510
+ * The index of the output this event applies to.
1511
+ */
1512
+ output_index: Schema.Int,
1513
+ /**
1514
+ * Unique identifier for the API item associated with this event.
1515
+ */
1516
+ item_id: Schema.String,
1517
+ /**
1518
+ * The complete input data for the custom tool call.
1519
+ */
1520
+ input: Schema.String
1521
+ }) {}
1522
+ /**
1523
+ * Emitted when an error occurs.
1524
+ *
1525
+ * @since 1.0.0
1526
+ * @category Schemas
1527
+ */
1528
+ exports.ResponseCustomToolCallInputDoneEvent = ResponseCustomToolCallInputDoneEvent;
1529
+ class ResponseErrorEvent extends /*#__PURE__*/Schema.Class("@effect/ai-openai/ResponseErrorEvent")({
1530
+ /**
1531
+ * The type of the event. Always `"error"`.
1532
+ */
1533
+ type: /*#__PURE__*/Schema.Literal("error"),
1534
+ /**
1535
+ * The sequence number for this event.
1536
+ */
1537
+ sequence_number: Schema.Int,
1538
+ /**
1539
+ * The error code.
1540
+ */
1541
+ code: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.NullOr(Schema.String)),
1542
+ /**
1543
+ * The error message.
1544
+ */
1545
+ message: Schema.String,
1546
+ /**
1547
+ * The error parameter.
1548
+ */
1549
+ param: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.NullOr(Schema.String))
1550
+ }) {}
1551
+ /**
1552
+ * Represents the events that can be emitted during a streaming response.
1553
+ *
1554
+ * @since 1.0.0
1555
+ * @category Schemas
1556
+ */
1557
+ exports.ResponseErrorEvent = ResponseErrorEvent;
1558
+ const ResponseStreamEvent = exports.ResponseStreamEvent = /*#__PURE__*/Schema.Union(ResponseCreatedEvent, ResponseQueuedEvent, ResponseInProgressEvent, ResponseCompletedEvent, ResponseIncompleteEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseOutputTextAnnotationAddedEvent, ResponseRefusalDeltaEvent, ResponseRefusalDoneEvent, ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, ResponseFileSearchCallInProgressEvent, ResponseFileSearchCallSearchingEvent, ResponseFileSearchCallCompletedEvent, ResponseWebSearchCallInProgressEvent, ResponseWebSearchCallSearchingEvent, ResponseWebSearchCallCompletedEvent, ResponseReasoningSummaryPartAddedEvent, ResponseReasoningSummaryPartDoneEvent, ResponseReasoningSummaryTextDeltaEvent, ResponseReasoningSummaryTextDoneEvent, ResponseReasoningTextDeltaEvent, ResponseReasoningTextDoneEvent, ResponseImageGenerationCallInProgressEvent, ResponseImageGenerationCallGeneratingEvent, ResponseImageGenerationCallPartialImageEvent, ResponseImageGenerationCallCompletedEvent, ResponseMcpCallArgumentsDeltaEvent, ResponseMcpCallArgumentsDoneEvent, ResponseMcpCallInProgressEvent, ResponseMcpCallCompletedEvent, ResponseMcpCallFailedEvent, ResponseMcpListToolsInProgressEvent, ResponseMcpListToolsCompletedEvent, ResponseMcpListToolsFailedEvent, ResponseCodeInterpreterCallInProgressEvent, ResponseCodeInterpreterCallInterpretingEvent, ResponseCodeInterpreterCallCompletedEvent, ResponseCodeInterpreterCallCodeDeltaEvent, ResponseCodeInterpreterCallCodeDoneEvent, ResponseCustomToolCallInputDeltaEvent, ResponseCustomToolCallInputDoneEvent, ResponseErrorEvent);
195
1559
  //# sourceMappingURL=OpenAiClient.js.map