1use super::stream::{
2 ResponseAudioDeltaEvent, ResponseAudioDoneEvent, ResponseAudioTranscriptDeltaEvent,
3 ResponseAudioTranscriptDoneEvent, ResponseCodeInterpreterCallCodeDeltaEvent,
4 ResponseCodeInterpreterCallCodeDoneEvent, ResponseCodeInterpreterCallCompletedEvent,
5 ResponseCodeInterpreterCallInProgressEvent, ResponseCodeInterpreterCallInterpretingEvent,
6 ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent,
7 ResponseCreatedEvent, ResponseCustomToolCallInputDeltaEvent,
8 ResponseCustomToolCallInputDoneEvent, ResponseFailedEvent,
9 ResponseFileSearchCallCompletedEvent, ResponseFileSearchCallInProgressEvent,
10 ResponseFileSearchCallSearchingEvent, ResponseFunctionCallArgumentsDeltaEvent,
11 ResponseFunctionCallArgumentsDoneEvent, ResponseImageGenCallCompletedEvent,
12 ResponseImageGenCallGeneratingEvent, ResponseImageGenCallInProgressEvent,
13 ResponseImageGenCallPartialImageEvent, ResponseInProgressEvent, ResponseIncompleteEvent,
14 ResponseMCPCallArgumentsDeltaEvent, ResponseMCPCallArgumentsDoneEvent,
15 ResponseMCPCallCompletedEvent, ResponseMCPCallFailedEvent, ResponseMCPCallInProgressEvent,
16 ResponseMCPListToolsCompletedEvent, ResponseMCPListToolsFailedEvent,
17 ResponseMCPListToolsInProgressEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent,
18 ResponseOutputTextAnnotationAddedEvent, ResponseQueuedEvent,
19 ResponseReasoningSummaryPartAddedEvent, ResponseReasoningSummaryPartDoneEvent,
20 ResponseReasoningSummaryTextDeltaEvent, ResponseReasoningSummaryTextDoneEvent,
21 ResponseReasoningTextDeltaEvent, ResponseReasoningTextDoneEvent, ResponseRefusalDeltaEvent,
22 ResponseRefusalDoneEvent, ResponseShellCallCommandAddedStreamingEvent,
23 ResponseShellCallCommandDeltaStreamingEvent, ResponseShellCallCommandDoneStreamingEvent,
24 ResponseShellCallOutputContentDeltaStreamingEvent,
25 ResponseShellCallOutputContentDoneStreamingEvent, ResponseTextDeltaEvent,
26 ResponseTextDoneEvent, ResponseWebSearchCallCompletedEvent,
27 ResponseWebSearchCallInProgressEvent, ResponseWebSearchCallSearchingEvent,
28};
29use super::{CreateResponse, FunctionCallOutputItemParam, MisalignmentErrorDetailsResource};
30use serde::{Deserialize, Serialize};
31
32#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
34#[serde(tag = "type")]
35pub enum ResponsesClientEvent {
36 #[serde(rename = "response.create")]
37 Create(Box<ResponsesClientEventResponseCreate>),
38 #[serde(rename = "response.steer")]
39 Steer(ResponseSteerEvent),
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
50pub struct ResponsesClientEventResponseCreate {
51 #[serde(skip_serializing_if = "Option::is_none")]
58 pub stream_id: Option<String>,
59 #[serde(flatten)]
60 pub response: CreateResponse,
61}
62
63#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
65#[serde(tag = "type")]
66pub enum ResponsesServerEvent {
67 #[serde(rename = "response.audio.delta")]
69 ResponseAudioDelta(ResponseAudioWsDelta),
70 #[serde(rename = "response.audio.done")]
72 ResponseAudioDone(ResponseAudioWsDone),
73 #[serde(rename = "response.audio.transcript.delta")]
75 ResponseAudioTranscriptDelta(ResponseAudioTranscriptWsDelta),
76 #[serde(rename = "response.audio.transcript.done")]
78 ResponseAudioTranscriptDone(ResponseAudioTranscriptWsDone),
79 #[serde(rename = "response.code_interpreter_call_code.delta")]
81 ResponseCodeInterpreterCallCodeDelta(ResponseCodeInterpreterCallCodeWsDelta),
82 #[serde(rename = "response.code_interpreter_call_code.done")]
84 ResponseCodeInterpreterCallCodeDone(ResponseCodeInterpreterCallCodeWsDone),
85 #[serde(rename = "response.code_interpreter_call.completed")]
87 ResponseCodeInterpreterCallCompleted(ResponseCodeInterpreterCallWsCompleted),
88 #[serde(rename = "response.code_interpreter_call.in_progress")]
90 ResponseCodeInterpreterCallInProgress(ResponseCodeInterpreterCallInWsProgress),
91 #[serde(rename = "response.code_interpreter_call.interpreting")]
93 ResponseCodeInterpreterCallInterpreting(ResponseCodeInterpreterCallWsInterpreting),
94 #[serde(rename = "response.completed")]
96 ResponseCompleted(ResponseWsCompleted),
97 #[serde(rename = "response.content_part.added")]
99 ResponseContentPartAdded(ResponseContentPartWsAdded),
100 #[serde(rename = "response.content_part.done")]
102 ResponseContentPartDone(ResponseContentPartWsDone),
103 #[serde(rename = "response.created")]
105 ResponseCreated(ResponseWsCreated),
106 #[serde(rename = "response.file_search_call.completed")]
108 ResponseFileSearchCallCompleted(ResponseFileSearchCallWsCompleted),
109 #[serde(rename = "response.file_search_call.in_progress")]
111 ResponseFileSearchCallInProgress(ResponseFileSearchCallInWsProgress),
112 #[serde(rename = "response.file_search_call.searching")]
114 ResponseFileSearchCallSearching(ResponseFileSearchCallWsSearching),
115 #[serde(rename = "response.function_call_arguments.delta")]
117 ResponseFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsWsDelta),
118 #[serde(rename = "response.function_call_arguments.done")]
120 ResponseFunctionCallArgumentsDone(ResponseFunctionCallArgumentsWsDone),
121 #[serde(rename = "response.shell_call_command.added")]
123 ResponseShellCallCommandAdded(ResponseShellCallCommandWsAdded),
124 #[serde(rename = "response.shell_call_command.delta")]
126 ResponseShellCallCommandDelta(ResponseShellCallCommandWsDelta),
127 #[serde(rename = "response.shell_call_command.done")]
129 ResponseShellCallCommandDone(ResponseShellCallCommandWsDone),
130 #[serde(rename = "response.shell_call_output_content.delta")]
132 ResponseShellCallOutputContentDelta(ResponseShellCallOutputContentWsDelta),
133 #[serde(rename = "response.shell_call_output_content.done")]
135 ResponseShellCallOutputContentDone(ResponseShellCallOutputContentWsDone),
136 #[serde(rename = "response.in_progress")]
138 ResponseInProgress(ResponseInWsProgress),
139 #[serde(rename = "response.failed")]
141 ResponseFailed(ResponseWsFailed),
142 #[serde(rename = "response.incomplete")]
148 ResponseIncomplete(ResponseWsIncomplete),
149 #[serde(rename = "response.output_item.added")]
151 ResponseOutputItemAdded(ResponseOutputItemWsAdded),
152 #[serde(rename = "response.output_item.done")]
154 ResponseOutputItemDone(ResponseOutputItemWsDone),
155 #[serde(rename = "response.reasoning_summary_part.added")]
157 ResponseReasoningSummaryPartAdded(ResponseReasoningSummaryPartWsAdded),
158 #[serde(rename = "response.reasoning_summary_part.done")]
160 ResponseReasoningSummaryPartDone(ResponseReasoningSummaryPartWsDone),
161 #[serde(rename = "response.reasoning_summary_text.delta")]
163 ResponseReasoningSummaryTextDelta(ResponseReasoningSummaryTextWsDelta),
164 #[serde(rename = "response.reasoning_summary_text.done")]
166 ResponseReasoningSummaryTextDone(ResponseReasoningSummaryTextWsDone),
167 #[serde(rename = "response.reasoning_text.delta")]
169 ResponseReasoningTextDelta(ResponseReasoningTextWsDelta),
170 #[serde(rename = "response.reasoning_text.done")]
172 ResponseReasoningTextDone(ResponseReasoningTextWsDone),
173 #[serde(rename = "response.refusal.delta")]
175 ResponseRefusalDelta(ResponseRefusalWsDelta),
176 #[serde(rename = "response.refusal.done")]
178 ResponseRefusalDone(ResponseRefusalWsDone),
179 #[serde(rename = "response.output_text.delta")]
181 ResponseOutputTextDelta(ResponseTextWsDelta),
182 #[serde(rename = "response.output_text.done")]
184 ResponseOutputTextDone(ResponseTextWsDone),
185 #[serde(rename = "response.web_search_call.completed")]
187 ResponseWebSearchCallCompleted(ResponseWebSearchCallWsCompleted),
188 #[serde(rename = "response.web_search_call.in_progress")]
190 ResponseWebSearchCallInProgress(ResponseWebSearchCallInWsProgress),
191 #[serde(rename = "response.web_search_call.searching")]
193 ResponseWebSearchCallSearching(ResponseWebSearchCallWsSearching),
194 #[serde(rename = "response.image_generation_call.completed")]
196 ResponseImageGenerationCallCompleted(ResponseImageGenCallWsCompleted),
197 #[serde(rename = "response.image_generation_call.generating")]
200 ResponseImageGenerationCallGenerating(ResponseImageGenCallWsGenerating),
201 #[serde(rename = "response.image_generation_call.in_progress")]
203 ResponseImageGenerationCallInProgress(ResponseImageGenCallInWsProgress),
204 #[serde(rename = "response.image_generation_call.partial_image")]
206 ResponseImageGenerationCallPartialImage(ResponseImageGenCallPartialWsImage),
207 #[serde(rename = "response.mcp_call_arguments.delta")]
209 ResponseMCPCallArgumentsDelta(ResponseMcpCallArgumentsWsDelta),
210 #[serde(rename = "response.mcp_call_arguments.done")]
212 ResponseMCPCallArgumentsDone(ResponseMcpCallArgumentsWsDone),
213 #[serde(rename = "response.mcp_call.completed")]
215 ResponseMCPCallCompleted(ResponseMcpCallWsCompleted),
216 #[serde(rename = "response.mcp_call.failed")]
218 ResponseMCPCallFailed(ResponseMcpCallWsFailed),
219 #[serde(rename = "response.mcp_call.in_progress")]
221 ResponseMCPCallInProgress(ResponseMcpCallInWsProgress),
222 #[serde(rename = "response.mcp_list_tools.completed")]
224 ResponseMCPListToolsCompleted(ResponseMcpListToolsWsCompleted),
225 #[serde(rename = "response.mcp_list_tools.failed")]
227 ResponseMCPListToolsFailed(ResponseMcpListToolsWsFailed),
228 #[serde(rename = "response.mcp_list_tools.in_progress")]
230 ResponseMCPListToolsInProgress(ResponseMcpListToolsInWsProgress),
231 #[serde(rename = "response.output_text.annotation.added")]
233 ResponseOutputTextAnnotationAdded(ResponseOutputTextAnnotationWsAdded),
234 #[serde(rename = "response.queued")]
236 ResponseQueued(ResponseWsQueued),
237 #[serde(rename = "response.custom_tool_call_input.delta")]
239 ResponseCustomToolCallInputDelta(ResponseCustomToolCallInputWsDelta),
240 #[serde(rename = "response.custom_tool_call_input.done")]
242 ResponseCustomToolCallInputDone(ResponseCustomToolCallInputWsDone),
243 #[serde(rename = "error")]
244 Error(ResponseWsError),
245 #[serde(rename = "response.steer.accepted")]
246 SteerAccepted(ResponseSteerAcceptedEvent),
247 #[serde(rename = "response.steer.pending")]
248 SteerPending(ResponseSteerPendingEvent),
249 #[serde(rename = "response.steer.failed")]
250 SteerFailed(ResponseSteerFailedEvent),
251}
252
253#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
255pub struct ResponseAudioWsDelta {
256 #[serde(flatten)]
257 pub event: ResponseAudioDeltaEvent,
258 #[serde(skip_serializing_if = "Option::is_none")]
261 pub stream_id: Option<String>,
262}
263
264#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
266pub struct ResponseAudioWsDone {
267 #[serde(flatten)]
268 pub event: ResponseAudioDoneEvent,
269 #[serde(skip_serializing_if = "Option::is_none")]
272 pub stream_id: Option<String>,
273}
274
275#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
277pub struct ResponseAudioTranscriptWsDelta {
278 #[serde(flatten)]
279 pub event: ResponseAudioTranscriptDeltaEvent,
280 #[serde(skip_serializing_if = "Option::is_none")]
283 pub stream_id: Option<String>,
284}
285
286#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
288pub struct ResponseAudioTranscriptWsDone {
289 #[serde(flatten)]
290 pub event: ResponseAudioTranscriptDoneEvent,
291 #[serde(skip_serializing_if = "Option::is_none")]
294 pub stream_id: Option<String>,
295}
296
297#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
299pub struct ResponseCodeInterpreterCallCodeWsDelta {
300 #[serde(flatten)]
301 pub event: ResponseCodeInterpreterCallCodeDeltaEvent,
302 #[serde(skip_serializing_if = "Option::is_none")]
305 pub stream_id: Option<String>,
306}
307
308#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
310pub struct ResponseCodeInterpreterCallCodeWsDone {
311 #[serde(flatten)]
312 pub event: ResponseCodeInterpreterCallCodeDoneEvent,
313 #[serde(skip_serializing_if = "Option::is_none")]
316 pub stream_id: Option<String>,
317}
318
319#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
321pub struct ResponseCodeInterpreterCallWsCompleted {
322 #[serde(flatten)]
323 pub event: ResponseCodeInterpreterCallCompletedEvent,
324 #[serde(skip_serializing_if = "Option::is_none")]
327 pub stream_id: Option<String>,
328}
329
330#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
332pub struct ResponseCodeInterpreterCallInWsProgress {
333 #[serde(flatten)]
334 pub event: ResponseCodeInterpreterCallInProgressEvent,
335 #[serde(skip_serializing_if = "Option::is_none")]
338 pub stream_id: Option<String>,
339}
340
341#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
343pub struct ResponseCodeInterpreterCallWsInterpreting {
344 #[serde(flatten)]
345 pub event: ResponseCodeInterpreterCallInterpretingEvent,
346 #[serde(skip_serializing_if = "Option::is_none")]
349 pub stream_id: Option<String>,
350}
351
352#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
354pub struct ResponseWsCompleted {
355 #[serde(flatten)]
356 pub event: ResponseCompletedEvent,
357 #[serde(skip_serializing_if = "Option::is_none")]
360 pub stream_id: Option<String>,
361}
362
363#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
365pub struct ResponseContentPartWsAdded {
366 #[serde(flatten)]
367 pub event: ResponseContentPartAddedEvent,
368 #[serde(skip_serializing_if = "Option::is_none")]
371 pub stream_id: Option<String>,
372}
373
374#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
376pub struct ResponseContentPartWsDone {
377 #[serde(flatten)]
378 pub event: ResponseContentPartDoneEvent,
379 #[serde(skip_serializing_if = "Option::is_none")]
382 pub stream_id: Option<String>,
383}
384
385#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
387pub struct ResponseWsCreated {
388 #[serde(flatten)]
389 pub event: ResponseCreatedEvent,
390 #[serde(skip_serializing_if = "Option::is_none")]
393 pub stream_id: Option<String>,
394}
395
396#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
398pub struct ResponseFileSearchCallWsCompleted {
399 #[serde(flatten)]
400 pub event: ResponseFileSearchCallCompletedEvent,
401 #[serde(skip_serializing_if = "Option::is_none")]
404 pub stream_id: Option<String>,
405}
406
407#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
409pub struct ResponseFileSearchCallInWsProgress {
410 #[serde(flatten)]
411 pub event: ResponseFileSearchCallInProgressEvent,
412 #[serde(skip_serializing_if = "Option::is_none")]
415 pub stream_id: Option<String>,
416}
417
418#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
420pub struct ResponseFileSearchCallWsSearching {
421 #[serde(flatten)]
422 pub event: ResponseFileSearchCallSearchingEvent,
423 #[serde(skip_serializing_if = "Option::is_none")]
426 pub stream_id: Option<String>,
427}
428
429#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
431pub struct ResponseFunctionCallArgumentsWsDelta {
432 #[serde(flatten)]
433 pub event: ResponseFunctionCallArgumentsDeltaEvent,
434 #[serde(skip_serializing_if = "Option::is_none")]
437 pub stream_id: Option<String>,
438}
439
440#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
442pub struct ResponseFunctionCallArgumentsWsDone {
443 #[serde(flatten)]
444 pub event: ResponseFunctionCallArgumentsDoneEvent,
445 #[serde(skip_serializing_if = "Option::is_none")]
448 pub stream_id: Option<String>,
449}
450
451#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
453pub struct ResponseShellCallCommandWsAdded {
454 #[serde(flatten)]
455 pub event: ResponseShellCallCommandAddedStreamingEvent,
456 #[serde(skip_serializing_if = "Option::is_none")]
459 pub stream_id: Option<String>,
460}
461
462#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
464pub struct ResponseShellCallCommandWsDelta {
465 #[serde(flatten)]
466 pub event: ResponseShellCallCommandDeltaStreamingEvent,
467 #[serde(skip_serializing_if = "Option::is_none")]
470 pub stream_id: Option<String>,
471}
472
473#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
475pub struct ResponseShellCallCommandWsDone {
476 #[serde(flatten)]
477 pub event: ResponseShellCallCommandDoneStreamingEvent,
478 #[serde(skip_serializing_if = "Option::is_none")]
481 pub stream_id: Option<String>,
482}
483
484#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
486pub struct ResponseShellCallOutputContentWsDelta {
487 #[serde(flatten)]
488 pub event: ResponseShellCallOutputContentDeltaStreamingEvent,
489 #[serde(skip_serializing_if = "Option::is_none")]
492 pub stream_id: Option<String>,
493}
494
495#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
497pub struct ResponseShellCallOutputContentWsDone {
498 #[serde(flatten)]
499 pub event: ResponseShellCallOutputContentDoneStreamingEvent,
500 #[serde(skip_serializing_if = "Option::is_none")]
503 pub stream_id: Option<String>,
504}
505
506#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
508pub struct ResponseInWsProgress {
509 #[serde(flatten)]
510 pub event: ResponseInProgressEvent,
511 #[serde(skip_serializing_if = "Option::is_none")]
514 pub stream_id: Option<String>,
515}
516
517#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
519pub struct ResponseWsFailed {
520 #[serde(flatten)]
521 pub event: ResponseFailedEvent,
522 #[serde(skip_serializing_if = "Option::is_none")]
525 pub stream_id: Option<String>,
526}
527
528#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
534pub struct ResponseWsIncomplete {
535 #[serde(flatten)]
536 pub event: ResponseIncompleteEvent,
537 #[serde(skip_serializing_if = "Option::is_none")]
540 pub stream_id: Option<String>,
541}
542
543#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
545pub struct ResponseOutputItemWsAdded {
546 #[serde(flatten)]
547 pub event: ResponseOutputItemAddedEvent,
548 #[serde(skip_serializing_if = "Option::is_none")]
551 pub stream_id: Option<String>,
552}
553
554#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
556pub struct ResponseOutputItemWsDone {
557 #[serde(flatten)]
558 pub event: ResponseOutputItemDoneEvent,
559 #[serde(skip_serializing_if = "Option::is_none")]
562 pub stream_id: Option<String>,
563}
564
565#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
567pub struct ResponseReasoningSummaryPartWsAdded {
568 #[serde(flatten)]
569 pub event: ResponseReasoningSummaryPartAddedEvent,
570 #[serde(skip_serializing_if = "Option::is_none")]
573 pub stream_id: Option<String>,
574}
575
576#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
578pub struct ResponseReasoningSummaryPartWsDone {
579 #[serde(flatten)]
580 pub event: ResponseReasoningSummaryPartDoneEvent,
581 #[serde(skip_serializing_if = "Option::is_none")]
584 pub stream_id: Option<String>,
585}
586
587#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
589pub struct ResponseReasoningSummaryTextWsDelta {
590 #[serde(flatten)]
591 pub event: ResponseReasoningSummaryTextDeltaEvent,
592 #[serde(skip_serializing_if = "Option::is_none")]
595 pub stream_id: Option<String>,
596}
597
598#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
600pub struct ResponseReasoningSummaryTextWsDone {
601 #[serde(flatten)]
602 pub event: ResponseReasoningSummaryTextDoneEvent,
603 #[serde(skip_serializing_if = "Option::is_none")]
606 pub stream_id: Option<String>,
607}
608
609#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
611pub struct ResponseReasoningTextWsDelta {
612 #[serde(flatten)]
613 pub event: ResponseReasoningTextDeltaEvent,
614 #[serde(skip_serializing_if = "Option::is_none")]
617 pub stream_id: Option<String>,
618}
619
620#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
622pub struct ResponseReasoningTextWsDone {
623 #[serde(flatten)]
624 pub event: ResponseReasoningTextDoneEvent,
625 #[serde(skip_serializing_if = "Option::is_none")]
628 pub stream_id: Option<String>,
629}
630
631#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
633pub struct ResponseRefusalWsDelta {
634 #[serde(flatten)]
635 pub event: ResponseRefusalDeltaEvent,
636 #[serde(skip_serializing_if = "Option::is_none")]
639 pub stream_id: Option<String>,
640}
641
642#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
644pub struct ResponseRefusalWsDone {
645 #[serde(flatten)]
646 pub event: ResponseRefusalDoneEvent,
647 #[serde(skip_serializing_if = "Option::is_none")]
650 pub stream_id: Option<String>,
651}
652
653#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
655pub struct ResponseTextWsDelta {
656 #[serde(flatten)]
657 pub event: ResponseTextDeltaEvent,
658 #[serde(skip_serializing_if = "Option::is_none")]
661 pub stream_id: Option<String>,
662}
663
664#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
666pub struct ResponseTextWsDone {
667 #[serde(flatten)]
668 pub event: ResponseTextDoneEvent,
669 #[serde(skip_serializing_if = "Option::is_none")]
672 pub stream_id: Option<String>,
673}
674
675#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
677pub struct ResponseWebSearchCallWsCompleted {
678 #[serde(flatten)]
679 pub event: ResponseWebSearchCallCompletedEvent,
680 #[serde(skip_serializing_if = "Option::is_none")]
683 pub stream_id: Option<String>,
684}
685
686#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
688pub struct ResponseWebSearchCallInWsProgress {
689 #[serde(flatten)]
690 pub event: ResponseWebSearchCallInProgressEvent,
691 #[serde(skip_serializing_if = "Option::is_none")]
694 pub stream_id: Option<String>,
695}
696
697#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
699pub struct ResponseWebSearchCallWsSearching {
700 #[serde(flatten)]
701 pub event: ResponseWebSearchCallSearchingEvent,
702 #[serde(skip_serializing_if = "Option::is_none")]
705 pub stream_id: Option<String>,
706}
707
708#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
710pub struct ResponseImageGenCallWsCompleted {
711 #[serde(flatten)]
712 pub event: ResponseImageGenCallCompletedEvent,
713 #[serde(skip_serializing_if = "Option::is_none")]
716 pub stream_id: Option<String>,
717}
718
719#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
722pub struct ResponseImageGenCallWsGenerating {
723 #[serde(flatten)]
724 pub event: ResponseImageGenCallGeneratingEvent,
725 #[serde(skip_serializing_if = "Option::is_none")]
728 pub stream_id: Option<String>,
729}
730
731#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
733pub struct ResponseImageGenCallInWsProgress {
734 #[serde(flatten)]
735 pub event: ResponseImageGenCallInProgressEvent,
736 #[serde(skip_serializing_if = "Option::is_none")]
739 pub stream_id: Option<String>,
740}
741
742#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
744pub struct ResponseImageGenCallPartialWsImage {
745 #[serde(flatten)]
746 pub event: ResponseImageGenCallPartialImageEvent,
747 #[serde(skip_serializing_if = "Option::is_none")]
750 pub stream_id: Option<String>,
751}
752
753#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
755pub struct ResponseMcpCallArgumentsWsDelta {
756 #[serde(flatten)]
757 pub event: ResponseMCPCallArgumentsDeltaEvent,
758 #[serde(skip_serializing_if = "Option::is_none")]
761 pub stream_id: Option<String>,
762}
763
764#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
766pub struct ResponseMcpCallArgumentsWsDone {
767 #[serde(flatten)]
768 pub event: ResponseMCPCallArgumentsDoneEvent,
769 #[serde(skip_serializing_if = "Option::is_none")]
772 pub stream_id: Option<String>,
773}
774
775#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
777pub struct ResponseMcpCallWsCompleted {
778 #[serde(flatten)]
779 pub event: ResponseMCPCallCompletedEvent,
780 #[serde(skip_serializing_if = "Option::is_none")]
783 pub stream_id: Option<String>,
784}
785
786#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
788pub struct ResponseMcpCallWsFailed {
789 #[serde(flatten)]
790 pub event: ResponseMCPCallFailedEvent,
791 #[serde(skip_serializing_if = "Option::is_none")]
794 pub stream_id: Option<String>,
795}
796
797#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
799pub struct ResponseMcpCallInWsProgress {
800 #[serde(flatten)]
801 pub event: ResponseMCPCallInProgressEvent,
802 #[serde(skip_serializing_if = "Option::is_none")]
805 pub stream_id: Option<String>,
806}
807
808#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
810pub struct ResponseMcpListToolsWsCompleted {
811 #[serde(flatten)]
812 pub event: ResponseMCPListToolsCompletedEvent,
813 #[serde(skip_serializing_if = "Option::is_none")]
816 pub stream_id: Option<String>,
817}
818
819#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
821pub struct ResponseMcpListToolsWsFailed {
822 #[serde(flatten)]
823 pub event: ResponseMCPListToolsFailedEvent,
824 #[serde(skip_serializing_if = "Option::is_none")]
827 pub stream_id: Option<String>,
828}
829
830#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
832pub struct ResponseMcpListToolsInWsProgress {
833 #[serde(flatten)]
834 pub event: ResponseMCPListToolsInProgressEvent,
835 #[serde(skip_serializing_if = "Option::is_none")]
838 pub stream_id: Option<String>,
839}
840
841#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
843pub struct ResponseOutputTextAnnotationWsAdded {
844 #[serde(flatten)]
845 pub event: ResponseOutputTextAnnotationAddedEvent,
846 #[serde(skip_serializing_if = "Option::is_none")]
849 pub stream_id: Option<String>,
850}
851
852#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
854pub struct ResponseWsQueued {
855 #[serde(flatten)]
856 pub event: ResponseQueuedEvent,
857 #[serde(skip_serializing_if = "Option::is_none")]
860 pub stream_id: Option<String>,
861}
862
863#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
865pub struct ResponseCustomToolCallInputWsDelta {
866 #[serde(flatten)]
867 pub event: ResponseCustomToolCallInputDeltaEvent,
868 #[serde(skip_serializing_if = "Option::is_none")]
871 pub stream_id: Option<String>,
872}
873
874#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
876pub struct ResponseCustomToolCallInputWsDone {
877 #[serde(flatten)]
878 pub event: ResponseCustomToolCallInputDoneEvent,
879 #[serde(skip_serializing_if = "Option::is_none")]
882 pub stream_id: Option<String>,
883}
884
885#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
887pub struct ErrorPayload {
888 pub r#type: String,
890 #[serde(skip_serializing_if = "Option::is_none")]
891 pub code: Option<String>,
892 pub message: String,
894 #[serde(skip_serializing_if = "Option::is_none")]
895 pub param: Option<String>,
896 #[serde(skip_serializing_if = "Option::is_none")]
898 pub headers: Option<std::collections::HashMap<String, String>>,
899 #[serde(skip_serializing_if = "Option::is_none")]
900 pub misalignment: Option<MisalignmentErrorDetailsResource>,
901}
902
903#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
914pub struct ResponseSteerAcceptedEvent {
915 pub sequence_number: u64,
917 pub steer: ResponseSteerAcceptedEventSteer,
919 #[serde(skip_serializing_if = "Option::is_none")]
922 pub stream_id: Option<String>,
923}
924
925#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
927pub struct ResponseSteerAcceptedEventSteer {
928 pub id: String,
930 pub previous_response_id: String,
932}
933
934pub type ResponseSteerErrorCode = String;
944
945#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
974pub struct ResponseSteerEvent {
975 pub previous_response_id: String,
977 pub input: ResponseSteerInput,
978}
979
980#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
989pub struct ResponseSteerFailedEvent {
990 pub sequence_number: i64,
992 pub steer: ResponseSteerFailedEventSteer,
994 pub error: ResponseSteerFailedEventError,
996 #[serde(skip_serializing_if = "Option::is_none")]
999 pub stream_id: Option<String>,
1000}
1001
1002#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1004pub struct ResponseSteerFailedEventError {
1005 pub r#type: ResponseSteerFailedEventErrorType,
1007 pub code: ResponseSteerErrorCode,
1008 pub message: String,
1010}
1011
1012#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1014pub enum ResponseSteerFailedEventErrorType {
1015 #[serde(rename = "invalid_request_error")]
1016 InvalidRequestError,
1017}
1018
1019#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1021pub struct ResponseSteerFailedEventSteer {
1022 #[serde(skip_serializing_if = "Option::is_none")]
1024 pub id: Option<String>,
1025 pub previous_response_id: String,
1027 pub input: ResponseSteerInput,
1028}
1029
1030#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1049#[serde(untagged)]
1050pub enum ResponseSteerInput {
1051 Text(String),
1052 List(Vec<ResponseSteerInputItem>),
1053}
1054
1055#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1056#[serde(tag = "type", rename_all = "snake_case")]
1057pub enum ResponseSteerInputItem {
1058 Message(UserMessageItemParam),
1059 FunctionCallOutput(FunctionCallOutputItemParam),
1060}
1061
1062#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1079pub struct ResponseSteerPendingEvent {
1080 pub sequence_number: u64,
1082 pub steer: ResponseSteerPendingEventSteer,
1084 pub reason: ResponseSteerPendingReason,
1085 pub required_input: Vec<ResponseSteerRequiredInput>,
1089 #[serde(skip_serializing_if = "Option::is_none")]
1092 pub stream_id: Option<String>,
1093}
1094
1095#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1097pub struct ResponseSteerPendingEventSteer {
1098 pub id: String,
1100 pub previous_response_id: String,
1102}
1103
1104#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1110#[serde(rename_all = "snake_case")]
1111pub enum ResponseSteerPendingReason {
1112 WaitingForRequiredInput,
1113 #[serde(untagged)]
1114 Other(String),
1115}
1116
1117#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1123#[serde(tag = "type")]
1124pub enum ResponseSteerRequiredInput {
1125 #[serde(rename = "function_call_output")]
1127 FunctionCallOutput(ResponseSteerRequiredInputFunctionCallOutput),
1128 #[serde(rename = "custom_tool_call_output")]
1131 CustomToolCallOutput(ResponseSteerRequiredInputCustomToolCallOutput),
1132 #[serde(rename = "computer_call_output")]
1135 ComputerCallOutput(ResponseSteerRequiredInputComputerCallOutput),
1136 #[serde(rename = "shell_call_output")]
1139 ShellCallOutput(ResponseSteerRequiredInputShellCallOutput),
1140 #[serde(rename = "apply_patch_call_output")]
1143 ApplyPatchCallOutput(ResponseSteerRequiredInputApplyPatchCallOutput),
1144 #[serde(rename = "tool_search_output")]
1147 ToolSearchOutput(ResponseSteerRequiredInputToolSearchOutput),
1148 #[serde(rename = "mcp_approval_response")]
1152 McpApprovalResponse(ResponseSteerRequiredInputMcpApprovalResponse),
1153}
1154
1155#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1157pub struct ResponseSteerRequiredInputFunctionCallOutput {
1158 pub call_id: String,
1159 pub name: String,
1160}
1161
1162#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1165pub struct ResponseSteerRequiredInputCustomToolCallOutput {
1166 pub call_id: String,
1167}
1168
1169#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1172pub struct ResponseSteerRequiredInputComputerCallOutput {
1173 pub call_id: String,
1174}
1175
1176#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1179pub struct ResponseSteerRequiredInputShellCallOutput {
1180 pub call_id: String,
1181}
1182
1183#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1186pub struct ResponseSteerRequiredInputApplyPatchCallOutput {
1187 pub call_id: String,
1188}
1189
1190#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1193pub struct ResponseSteerRequiredInputToolSearchOutput {
1194 pub call_id: String,
1195 pub execution: ResponseSteerRequiredInputToolSearchOutputExecution,
1196}
1197
1198#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1199pub enum ResponseSteerRequiredInputToolSearchOutputExecution {
1200 #[serde(rename = "client")]
1201 Client,
1202}
1203
1204#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1208pub struct ResponseSteerRequiredInputMcpApprovalResponse {
1209 pub approval_request_id: String,
1210}
1211
1212#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1214pub struct ResponseWsError {
1215 #[serde(skip_serializing_if = "Option::is_none")]
1217 pub status: Option<u32>,
1218 #[serde(skip_serializing_if = "Option::is_none")]
1220 pub sequence_number: Option<u64>,
1221 pub error: ErrorPayload,
1223 #[serde(skip_serializing_if = "Option::is_none")]
1226 pub stream_id: Option<String>,
1227}
1228
1229#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1230pub struct ResponsesWebSocketStreamEvent {
1231 #[serde(skip_serializing_if = "Option::is_none")]
1235 pub stream_id: Option<String>,
1236}
1237
1238#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1239pub struct UserMessageItemParam {
1240 #[serde(skip_serializing_if = "Option::is_none")]
1241 pub id: Option<String>,
1242 pub role: UserMessageItemParamRole,
1244 pub content: crate::types::responses::EasyInputContent,
1246 #[serde(skip_serializing_if = "Option::is_none")]
1247 pub status: Option<String>,
1248}
1249
1250#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1252#[serde(rename_all = "lowercase")]
1253pub enum UserMessageItemParamRole {
1254 User,
1255}