openai 0.78.0 → 0.79.0

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 (175) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +80 -0
  3. data/README.md +241 -8
  4. data/SECURITY.md +6 -22
  5. data/azure.md +110 -0
  6. data/bedrock.md +132 -0
  7. data/examples/mtls_custom_http_client.rb +61 -0
  8. data/lib/openai/auth/workload_identity.rb +13 -2
  9. data/lib/openai/auth/workload_identity_auth.rb +2 -1
  10. data/lib/openai/client.rb +29 -6
  11. data/lib/openai/errors.rb +11 -1
  12. data/lib/openai/helpers/streaming/chat_completion_stream.rb +3 -3
  13. data/lib/openai/helpers/streaming/response_stream.rb +5 -6
  14. data/lib/openai/helpers/structured_output/base_model.rb +20 -19
  15. data/lib/openai/helpers/structured_output/json_schema_converter.rb +12 -5
  16. data/lib/openai/http_client.rb +99 -7
  17. data/lib/openai/internal/conversation_cursor_page.rb +5 -6
  18. data/lib/openai/internal/cursor_page.rb +3 -3
  19. data/lib/openai/internal/logging.rb +419 -0
  20. data/lib/openai/internal/next_cursor_page.rb +5 -6
  21. data/lib/openai/internal/page.rb +2 -2
  22. data/lib/openai/internal/provider.rb +7 -1
  23. data/lib/openai/internal/read_io_adapter.rb +42 -18
  24. data/lib/openai/internal/stream.rb +2 -2
  25. data/lib/openai/internal/transport/base_client.rb +137 -37
  26. data/lib/openai/internal/type/array_of.rb +6 -4
  27. data/lib/openai/internal/type/base_model.rb +39 -1
  28. data/lib/openai/internal/type/base_page.rb +19 -2
  29. data/lib/openai/internal/type/base_stream.rb +39 -7
  30. data/lib/openai/internal/type/hash_of.rb +3 -3
  31. data/lib/openai/internal/util.rb +52 -27
  32. data/lib/openai/models/admin/organization/audit_log_list_params.rb +3 -1
  33. data/lib/openai/models/admin/organization/audit_log_list_response.rb +33 -11
  34. data/lib/openai/models/admin/organization/groups/role_list_response.rb +5 -1
  35. data/lib/openai/models/admin/organization/groups/role_retrieve_response.rb +5 -1
  36. data/lib/openai/models/admin/organization/projects/groups/role_list_response.rb +6 -1
  37. data/lib/openai/models/admin/organization/projects/groups/role_retrieve_response.rb +6 -1
  38. data/lib/openai/models/admin/organization/projects/service_account_create_response.rb +3 -1
  39. data/lib/openai/models/admin/organization/projects/users/role_list_response.rb +6 -1
  40. data/lib/openai/models/admin/organization/projects/users/role_retrieve_response.rb +6 -1
  41. data/lib/openai/models/admin/organization/users/role_list_response.rb +5 -1
  42. data/lib/openai/models/admin/organization/users/role_retrieve_response.rb +5 -1
  43. data/lib/openai/models/all_models.rb +3 -0
  44. data/lib/openai/models/audio/transcription_create_params.rb +7 -1
  45. data/lib/openai/models/audio/translation_create_params.rb +7 -1
  46. data/lib/openai/models/beta/beta_response.rb +9 -0
  47. data/lib/openai/models/beta/beta_response_stream_event.rb +1 -1
  48. data/lib/openai/models/beta/beta_responses_client_event.rb +28 -3
  49. data/lib/openai/models/beta/beta_responses_server_event.rb +1037 -61
  50. data/lib/openai/models/beta/response_compact_params.rb +9 -0
  51. data/lib/openai/models/beta/response_create_params.rb +9 -0
  52. data/lib/openai/models/containers/file_create_params.rb +4 -0
  53. data/lib/openai/models/content_provenance_check_create_params.rb +4 -0
  54. data/lib/openai/models/file_create_params.rb +4 -0
  55. data/lib/openai/models/image_create_variation_params.rb +4 -0
  56. data/lib/openai/models/image_edit_params.rb +8 -0
  57. data/lib/openai/models/responses/response_compact_params.rb +9 -0
  58. data/lib/openai/models/responses/response_stream_event.rb +1 -1
  59. data/lib/openai/models/responses/responses_client_event.rb +13 -1
  60. data/lib/openai/models/responses/responses_server_event.rb +1027 -54
  61. data/lib/openai/models/responses_model.rb +3 -0
  62. data/lib/openai/models/skill_create_params.rb +4 -0
  63. data/lib/openai/models/skills/version_create_params.rb +4 -0
  64. data/lib/openai/models/uploads/part_create_params.rb +4 -0
  65. data/lib/openai/models/vector_store_search_response.rb +3 -1
  66. data/lib/openai/models/video_create_character_params.rb +4 -0
  67. data/lib/openai/models/video_create_params.rb +4 -0
  68. data/lib/openai/models/video_edit_params.rb +4 -0
  69. data/lib/openai/models/video_extend_params.rb +4 -0
  70. data/lib/openai/models.rb +9 -1
  71. data/lib/openai/net_http_client.rb +20 -6
  72. data/lib/openai/providers/azure.rb +216 -0
  73. data/lib/openai/providers/bedrock.rb +3 -1
  74. data/lib/openai/resources/admin/organization/projects/groups/roles.rb +1 -1
  75. data/lib/openai/resources/admin/organization/projects/groups.rb +1 -1
  76. data/lib/openai/resources/admin/organization/projects/users/roles.rb +1 -1
  77. data/lib/openai/resources/admin/organization/projects.rb +4 -2
  78. data/lib/openai/resources/audio/transcriptions.rb +8 -0
  79. data/lib/openai/resources/audio/translations.rb +4 -0
  80. data/lib/openai/resources/beta/responses.rb +1 -1
  81. data/lib/openai/resources/beta/threads/runs/steps.rb +2 -2
  82. data/lib/openai/resources/containers/files.rb +4 -0
  83. data/lib/openai/resources/content_provenance_checks.rb +4 -0
  84. data/lib/openai/resources/conversations/items.rb +1 -1
  85. data/lib/openai/resources/evals/runs/output_items.rb +1 -1
  86. data/lib/openai/resources/files.rb +4 -0
  87. data/lib/openai/resources/images.rb +12 -0
  88. data/lib/openai/resources/responses.rb +3 -2
  89. data/lib/openai/resources/skills/versions.rb +4 -0
  90. data/lib/openai/resources/skills.rb +4 -0
  91. data/lib/openai/resources/uploads/parts.rb +4 -0
  92. data/lib/openai/resources/vector_stores/file_batches.rb +1 -1
  93. data/lib/openai/resources/videos.rb +38 -0
  94. data/lib/openai/resources/webhooks.rb +18 -6
  95. data/lib/openai/version.rb +1 -1
  96. data/lib/openai.rb +111 -107
  97. data/rbi/openai/auth.rbi +4 -4
  98. data/rbi/openai/client.rbi +13 -3
  99. data/rbi/openai/errors.rbi +7 -0
  100. data/rbi/openai/helpers/streaming/events.rbi +12 -0
  101. data/rbi/openai/http_client.rbi +62 -2
  102. data/rbi/openai/internal/logging.rbi +192 -0
  103. data/rbi/openai/internal/provider.rbi +3 -0
  104. data/rbi/openai/internal/read_io_adapter.rbi +6 -1
  105. data/rbi/openai/internal/transport/base_client.rbi +61 -7
  106. data/rbi/openai/internal/type/base_model.rbi +24 -1
  107. data/rbi/openai/internal/type/base_page.rbi +13 -2
  108. data/rbi/openai/internal/type/base_stream.rbi +15 -4
  109. data/rbi/openai/internal/util.rbi +26 -2
  110. data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +5 -0
  111. data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +5 -0
  112. data/rbi/openai/models/all_models.rbi +15 -0
  113. data/rbi/openai/models/audio/transcription_create_params.rbi +14 -2
  114. data/rbi/openai/models/audio/translation_create_params.rbi +14 -2
  115. data/rbi/openai/models/beta/beta_response.rbi +15 -0
  116. data/rbi/openai/models/beta/beta_response_stream_event.rbi +1 -1
  117. data/rbi/openai/models/beta/beta_responses_client_event.rbi +37 -1
  118. data/rbi/openai/models/beta/beta_responses_server_event.rbi +3791 -54
  119. data/rbi/openai/models/beta/response_compact_params.rbi +15 -0
  120. data/rbi/openai/models/beta/response_create_params.rbi +15 -0
  121. data/rbi/openai/models/containers/file_create_params.rbi +8 -0
  122. data/rbi/openai/models/content_provenance_check_create_params.rbi +8 -0
  123. data/rbi/openai/models/file_create_params.rbi +8 -0
  124. data/rbi/openai/models/image_create_variation_params.rbi +8 -0
  125. data/rbi/openai/models/image_edit_params.rbi +16 -0
  126. data/rbi/openai/models/responses/response_compact_params.rbi +15 -0
  127. data/rbi/openai/models/responses/response_stream_event.rbi +1 -1
  128. data/rbi/openai/models/responses/responses_client_event.rbi +19 -0
  129. data/rbi/openai/models/responses/responses_server_event.rbi +3282 -53
  130. data/rbi/openai/models/responses_model.rbi +15 -0
  131. data/rbi/openai/models/skill_create_params.rbi +8 -0
  132. data/rbi/openai/models/skills/version_create_params.rbi +8 -0
  133. data/rbi/openai/models/uploads/part_create_params.rbi +8 -0
  134. data/rbi/openai/models/video_create_character_params.rbi +8 -0
  135. data/rbi/openai/models/video_create_params.rbi +8 -0
  136. data/rbi/openai/models/video_edit_params.rbi +8 -0
  137. data/rbi/openai/models/video_extend_params.rbi +8 -0
  138. data/rbi/openai/net_http_client.rbi +2 -2
  139. data/rbi/openai/providers.rbi +9 -0
  140. data/rbi/openai/resources/audio/transcriptions.rbi +14 -2
  141. data/rbi/openai/resources/audio/translations.rbi +7 -1
  142. data/rbi/openai/resources/containers/files.rbi +4 -0
  143. data/rbi/openai/resources/content_provenance_checks.rbi +4 -0
  144. data/rbi/openai/resources/files.rbi +4 -0
  145. data/rbi/openai/resources/images.rbi +20 -0
  146. data/rbi/openai/resources/skills/versions.rbi +4 -0
  147. data/rbi/openai/resources/skills.rbi +4 -0
  148. data/rbi/openai/resources/uploads/parts.rbi +4 -0
  149. data/rbi/openai/resources/videos.rbi +16 -0
  150. data/sig/openai/client.rbs +6 -2
  151. data/sig/openai/errors.rbs +5 -0
  152. data/sig/openai/http_client.rbs +37 -2
  153. data/sig/openai/internal/logging.rbs +88 -0
  154. data/sig/openai/internal/provider.rbs +3 -1
  155. data/sig/openai/internal/read_io_adapter.rbs +3 -1
  156. data/sig/openai/internal/transport/base_client.rbs +33 -5
  157. data/sig/openai/internal/type/base_model.rbs +13 -0
  158. data/sig/openai/internal/type/base_page.rbs +8 -1
  159. data/sig/openai/internal/type/base_stream.rbs +8 -2
  160. data/sig/openai/internal/util.rbs +12 -0
  161. data/sig/openai/models/admin/organization/audit_log_list_params.rbs +2 -0
  162. data/sig/openai/models/admin/organization/audit_log_list_response.rbs +2 -0
  163. data/sig/openai/models/all_models.rbs +6 -0
  164. data/sig/openai/models/beta/beta_response.rbs +6 -0
  165. data/sig/openai/models/beta/beta_responses_client_event.rbs +13 -0
  166. data/sig/openai/models/beta/beta_responses_server_event.rbs +1946 -54
  167. data/sig/openai/models/beta/response_compact_params.rbs +6 -0
  168. data/sig/openai/models/beta/response_create_params.rbs +6 -0
  169. data/sig/openai/models/responses/response_compact_params.rbs +6 -0
  170. data/sig/openai/models/responses/responses_client_event.rbs +7 -0
  171. data/sig/openai/models/responses/responses_server_event.rbs +1786 -53
  172. data/sig/openai/models/responses_model.rbs +6 -0
  173. data/sig/openai/net_http_client.rbs +2 -2
  174. data/sig/openai/providers.rbs +6 -0
  175. metadata +24 -1
@@ -12,64 +12,3801 @@ module OpenAI
12
12
  Variants =
13
13
  T.type_alias do
14
14
  T.any(
15
- OpenAI::Beta::BetaResponseAudioDeltaEvent,
16
- OpenAI::Beta::BetaResponseAudioDoneEvent,
17
- OpenAI::Beta::BetaResponseAudioTranscriptDeltaEvent,
18
- OpenAI::Beta::BetaResponseAudioTranscriptDoneEvent,
19
- OpenAI::Beta::BetaResponseCodeInterpreterCallCodeDeltaEvent,
20
- OpenAI::Beta::BetaResponseCodeInterpreterCallCodeDoneEvent,
21
- OpenAI::Beta::BetaResponseCodeInterpreterCallCompletedEvent,
22
- OpenAI::Beta::BetaResponseCodeInterpreterCallInProgressEvent,
23
- OpenAI::Beta::BetaResponseCodeInterpreterCallInterpretingEvent,
24
- OpenAI::Beta::BetaResponseCompletedEvent,
25
- OpenAI::Beta::BetaResponseContentPartAddedEvent,
26
- OpenAI::Beta::BetaResponseContentPartDoneEvent,
27
- OpenAI::Beta::BetaResponseCreatedEvent,
28
- OpenAI::Beta::BetaResponseErrorEvent,
29
- OpenAI::Beta::BetaResponseFileSearchCallCompletedEvent,
30
- OpenAI::Beta::BetaResponseFileSearchCallInProgressEvent,
31
- OpenAI::Beta::BetaResponseFileSearchCallSearchingEvent,
32
- OpenAI::Beta::BetaResponseFunctionCallArgumentsDeltaEvent,
33
- OpenAI::Beta::BetaResponseFunctionCallArgumentsDoneEvent,
34
- OpenAI::Beta::BetaResponseInProgressEvent,
35
- OpenAI::Beta::BetaResponseFailedEvent,
36
- OpenAI::Beta::BetaResponseIncompleteEvent,
37
- OpenAI::Beta::BetaResponseOutputItemAddedEvent,
38
- OpenAI::Beta::BetaResponseOutputItemDoneEvent,
39
- OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent,
40
- OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent,
41
- OpenAI::Beta::BetaResponseReasoningSummaryTextDeltaEvent,
42
- OpenAI::Beta::BetaResponseReasoningSummaryTextDoneEvent,
43
- OpenAI::Beta::BetaResponseReasoningTextDeltaEvent,
44
- OpenAI::Beta::BetaResponseReasoningTextDoneEvent,
45
- OpenAI::Beta::BetaResponseRefusalDeltaEvent,
46
- OpenAI::Beta::BetaResponseRefusalDoneEvent,
47
- OpenAI::Beta::BetaResponseTextDeltaEvent,
48
- OpenAI::Beta::BetaResponseTextDoneEvent,
49
- OpenAI::Beta::BetaResponseWebSearchCallCompletedEvent,
50
- OpenAI::Beta::BetaResponseWebSearchCallInProgressEvent,
51
- OpenAI::Beta::BetaResponseWebSearchCallSearchingEvent,
52
- OpenAI::Beta::BetaResponseImageGenCallCompletedEvent,
53
- OpenAI::Beta::BetaResponseImageGenCallGeneratingEvent,
54
- OpenAI::Beta::BetaResponseImageGenCallInProgressEvent,
55
- OpenAI::Beta::BetaResponseImageGenCallPartialImageEvent,
56
- OpenAI::Beta::BetaResponseMcpCallArgumentsDeltaEvent,
57
- OpenAI::Beta::BetaResponseMcpCallArgumentsDoneEvent,
58
- OpenAI::Beta::BetaResponseMcpCallCompletedEvent,
59
- OpenAI::Beta::BetaResponseMcpCallFailedEvent,
60
- OpenAI::Beta::BetaResponseMcpCallInProgressEvent,
61
- OpenAI::Beta::BetaResponseMcpListToolsCompletedEvent,
62
- OpenAI::Beta::BetaResponseMcpListToolsFailedEvent,
63
- OpenAI::Beta::BetaResponseMcpListToolsInProgressEvent,
64
- OpenAI::Beta::BetaResponseOutputTextAnnotationAddedEvent,
65
- OpenAI::Beta::BetaResponseQueuedEvent,
66
- OpenAI::Beta::BetaResponseCustomToolCallInputDeltaEvent,
67
- OpenAI::Beta::BetaResponseCustomToolCallInputDoneEvent,
68
15
  OpenAI::Beta::BetaResponseInjectCreatedEvent,
69
- OpenAI::Beta::BetaResponseInjectFailedEvent
16
+ OpenAI::Beta::BetaResponseInjectFailedEvent,
17
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioWsDelta,
18
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioWsDone,
19
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioTranscriptWsDelta,
20
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioTranscriptWsDone,
21
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallCodeWsDelta,
22
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallCodeWsDone,
23
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallWsCompleted,
24
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallInWsProgress,
25
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallWsInterpreting,
26
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsCompleted,
27
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseContentPartWsAdded,
28
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseContentPartWsDone,
29
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsCreated,
30
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError,
31
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallWsCompleted,
32
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallInWsProgress,
33
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallWsSearching,
34
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFunctionCallArgumentsWsDelta,
35
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFunctionCallArgumentsWsDone,
36
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseInWsProgress,
37
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsFailed,
38
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsIncomplete,
39
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputItemWsAdded,
40
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputItemWsDone,
41
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryPartWsAdded,
42
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryPartWsDone,
43
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryTextWsDelta,
44
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryTextWsDone,
45
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningTextWsDelta,
46
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningTextWsDone,
47
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseRefusalWsDelta,
48
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseRefusalWsDone,
49
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseTextWsDelta,
50
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseTextWsDone,
51
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallWsCompleted,
52
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallInWsProgress,
53
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallWsSearching,
54
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallWsCompleted,
55
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallWsGenerating,
56
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallInWsProgress,
57
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallPartialWsImage,
58
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallArgumentsWsDelta,
59
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallArgumentsWsDone,
60
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallWsCompleted,
61
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallWsFailed,
62
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallInWsProgress,
63
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsWsCompleted,
64
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsWsFailed,
65
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsInWsProgress,
66
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputTextAnnotationWsAdded,
67
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsQueued,
68
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCustomToolCallInputWsDelta,
69
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCustomToolCallInputWsDone
70
70
  )
71
71
  end
72
72
 
73
+ class BetaResponseAudioWsDelta < OpenAI::Models::Beta::BetaResponseAudioDeltaEvent
74
+ OrHash =
75
+ T.type_alias do
76
+ T.any(
77
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioWsDelta,
78
+ OpenAI::Internal::AnyHash
79
+ )
80
+ end
81
+
82
+ # The WebSocket lane that emitted this event. This field is present when the
83
+ # originating `response.create` event supplied a `stream_id`.
84
+ sig { returns(T.nilable(String)) }
85
+ attr_reader :stream_id
86
+
87
+ sig { params(stream_id: String).void }
88
+ attr_writer :stream_id
89
+
90
+ # Emitted when there is a partial audio response.
91
+ sig do
92
+ params(
93
+ delta: String,
94
+ sequence_number: Integer,
95
+ agent:
96
+ T.nilable(
97
+ OpenAI::Beta::BetaResponseAudioDeltaEvent::Agent::OrHash
98
+ ),
99
+ type: Symbol,
100
+ stream_id: String
101
+ ).returns(T.attached_class)
102
+ end
103
+ def self.new(
104
+ # A chunk of Base64 encoded response audio bytes.
105
+ delta:,
106
+ # A sequence number for this chunk of the stream response.
107
+ sequence_number:,
108
+ # The agent that owns this multi-agent streaming event.
109
+ agent: nil,
110
+ # The type of the event. Always `response.audio.delta`.
111
+ type: :"response.audio.delta",
112
+ # The WebSocket lane that emitted this event.
113
+ # This field is present when the originating response.create supplied a stream_id.
114
+ stream_id: nil
115
+ )
116
+ end
117
+
118
+ sig do
119
+ override.returns(
120
+ {
121
+ delta: String,
122
+ sequence_number: Integer,
123
+ type: Symbol,
124
+ agent:
125
+ T.nilable(OpenAI::Beta::BetaResponseAudioDeltaEvent::Agent),
126
+ stream_id: String
127
+ }
128
+ )
129
+ end
130
+ def to_hash
131
+ end
132
+ end
133
+
134
+ class BetaResponseAudioWsDone < OpenAI::Models::Beta::BetaResponseAudioDoneEvent
135
+ OrHash =
136
+ T.type_alias do
137
+ T.any(
138
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioWsDone,
139
+ OpenAI::Internal::AnyHash
140
+ )
141
+ end
142
+
143
+ # The WebSocket lane that emitted this event. This field is present when the
144
+ # originating `response.create` event supplied a `stream_id`.
145
+ sig { returns(T.nilable(String)) }
146
+ attr_reader :stream_id
147
+
148
+ sig { params(stream_id: String).void }
149
+ attr_writer :stream_id
150
+
151
+ # Emitted when the audio response is complete.
152
+ sig do
153
+ params(
154
+ sequence_number: Integer,
155
+ agent:
156
+ T.nilable(
157
+ OpenAI::Beta::BetaResponseAudioDoneEvent::Agent::OrHash
158
+ ),
159
+ type: Symbol,
160
+ stream_id: String
161
+ ).returns(T.attached_class)
162
+ end
163
+ def self.new(
164
+ # The sequence number of the delta.
165
+ sequence_number:,
166
+ # The agent that owns this multi-agent streaming event.
167
+ agent: nil,
168
+ # The type of the event. Always `response.audio.done`.
169
+ type: :"response.audio.done",
170
+ # The WebSocket lane that emitted this event.
171
+ # This field is present when the originating response.create supplied a stream_id.
172
+ stream_id: nil
173
+ )
174
+ end
175
+
176
+ sig do
177
+ override.returns(
178
+ {
179
+ sequence_number: Integer,
180
+ type: Symbol,
181
+ agent:
182
+ T.nilable(OpenAI::Beta::BetaResponseAudioDoneEvent::Agent),
183
+ stream_id: String
184
+ }
185
+ )
186
+ end
187
+ def to_hash
188
+ end
189
+ end
190
+
191
+ class BetaResponseAudioTranscriptWsDelta < OpenAI::Models::Beta::BetaResponseAudioTranscriptDeltaEvent
192
+ OrHash =
193
+ T.type_alias do
194
+ T.any(
195
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioTranscriptWsDelta,
196
+ OpenAI::Internal::AnyHash
197
+ )
198
+ end
199
+
200
+ # The WebSocket lane that emitted this event. This field is present when the
201
+ # originating `response.create` event supplied a `stream_id`.
202
+ sig { returns(T.nilable(String)) }
203
+ attr_reader :stream_id
204
+
205
+ sig { params(stream_id: String).void }
206
+ attr_writer :stream_id
207
+
208
+ # Emitted when there is a partial transcript of audio.
209
+ sig do
210
+ params(
211
+ delta: String,
212
+ sequence_number: Integer,
213
+ agent:
214
+ T.nilable(
215
+ OpenAI::Beta::BetaResponseAudioTranscriptDeltaEvent::Agent::OrHash
216
+ ),
217
+ type: Symbol,
218
+ stream_id: String
219
+ ).returns(T.attached_class)
220
+ end
221
+ def self.new(
222
+ # The partial transcript of the audio response.
223
+ delta:,
224
+ # The sequence number of this event.
225
+ sequence_number:,
226
+ # The agent that owns this multi-agent streaming event.
227
+ agent: nil,
228
+ # The type of the event. Always `response.audio.transcript.delta`.
229
+ type: :"response.audio.transcript.delta",
230
+ # The WebSocket lane that emitted this event.
231
+ # This field is present when the originating response.create supplied a stream_id.
232
+ stream_id: nil
233
+ )
234
+ end
235
+
236
+ sig do
237
+ override.returns(
238
+ {
239
+ delta: String,
240
+ sequence_number: Integer,
241
+ type: Symbol,
242
+ agent:
243
+ T.nilable(
244
+ OpenAI::Beta::BetaResponseAudioTranscriptDeltaEvent::Agent
245
+ ),
246
+ stream_id: String
247
+ }
248
+ )
249
+ end
250
+ def to_hash
251
+ end
252
+ end
253
+
254
+ class BetaResponseAudioTranscriptWsDone < OpenAI::Models::Beta::BetaResponseAudioTranscriptDoneEvent
255
+ OrHash =
256
+ T.type_alias do
257
+ T.any(
258
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioTranscriptWsDone,
259
+ OpenAI::Internal::AnyHash
260
+ )
261
+ end
262
+
263
+ # The WebSocket lane that emitted this event. This field is present when the
264
+ # originating `response.create` event supplied a `stream_id`.
265
+ sig { returns(T.nilable(String)) }
266
+ attr_reader :stream_id
267
+
268
+ sig { params(stream_id: String).void }
269
+ attr_writer :stream_id
270
+
271
+ # Emitted when the full audio transcript is completed.
272
+ sig do
273
+ params(
274
+ sequence_number: Integer,
275
+ agent:
276
+ T.nilable(
277
+ OpenAI::Beta::BetaResponseAudioTranscriptDoneEvent::Agent::OrHash
278
+ ),
279
+ type: Symbol,
280
+ stream_id: String
281
+ ).returns(T.attached_class)
282
+ end
283
+ def self.new(
284
+ # The sequence number of this event.
285
+ sequence_number:,
286
+ # The agent that owns this multi-agent streaming event.
287
+ agent: nil,
288
+ # The type of the event. Always `response.audio.transcript.done`.
289
+ type: :"response.audio.transcript.done",
290
+ # The WebSocket lane that emitted this event.
291
+ # This field is present when the originating response.create supplied a stream_id.
292
+ stream_id: nil
293
+ )
294
+ end
295
+
296
+ sig do
297
+ override.returns(
298
+ {
299
+ sequence_number: Integer,
300
+ type: Symbol,
301
+ agent:
302
+ T.nilable(
303
+ OpenAI::Beta::BetaResponseAudioTranscriptDoneEvent::Agent
304
+ ),
305
+ stream_id: String
306
+ }
307
+ )
308
+ end
309
+ def to_hash
310
+ end
311
+ end
312
+
313
+ class BetaResponseCodeInterpreterCallCodeWsDelta < OpenAI::Models::Beta::BetaResponseCodeInterpreterCallCodeDeltaEvent
314
+ OrHash =
315
+ T.type_alias do
316
+ T.any(
317
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallCodeWsDelta,
318
+ OpenAI::Internal::AnyHash
319
+ )
320
+ end
321
+
322
+ # The WebSocket lane that emitted this event. This field is present when the
323
+ # originating `response.create` event supplied a `stream_id`.
324
+ sig { returns(T.nilable(String)) }
325
+ attr_reader :stream_id
326
+
327
+ sig { params(stream_id: String).void }
328
+ attr_writer :stream_id
329
+
330
+ # Emitted when a partial code snippet is streamed by the code interpreter.
331
+ sig do
332
+ params(
333
+ delta: String,
334
+ item_id: String,
335
+ output_index: Integer,
336
+ sequence_number: Integer,
337
+ agent:
338
+ T.nilable(
339
+ OpenAI::Beta::BetaResponseCodeInterpreterCallCodeDeltaEvent::Agent::OrHash
340
+ ),
341
+ type: Symbol,
342
+ stream_id: String
343
+ ).returns(T.attached_class)
344
+ end
345
+ def self.new(
346
+ # The partial code snippet being streamed by the code interpreter.
347
+ delta:,
348
+ # The unique identifier of the code interpreter tool call item.
349
+ item_id:,
350
+ # The index of the output item in the response for which the code is being
351
+ # streamed.
352
+ output_index:,
353
+ # The sequence number of this event, used to order streaming events.
354
+ sequence_number:,
355
+ # The agent that owns this multi-agent streaming event.
356
+ agent: nil,
357
+ # The type of the event. Always `response.code_interpreter_call_code.delta`.
358
+ type: :"response.code_interpreter_call_code.delta",
359
+ # The WebSocket lane that emitted this event.
360
+ # This field is present when the originating response.create supplied a stream_id.
361
+ stream_id: nil
362
+ )
363
+ end
364
+
365
+ sig do
366
+ override.returns(
367
+ {
368
+ delta: String,
369
+ item_id: String,
370
+ output_index: Integer,
371
+ sequence_number: Integer,
372
+ type: Symbol,
373
+ agent:
374
+ T.nilable(
375
+ OpenAI::Beta::BetaResponseCodeInterpreterCallCodeDeltaEvent::Agent
376
+ ),
377
+ stream_id: String
378
+ }
379
+ )
380
+ end
381
+ def to_hash
382
+ end
383
+ end
384
+
385
+ class BetaResponseCodeInterpreterCallCodeWsDone < OpenAI::Models::Beta::BetaResponseCodeInterpreterCallCodeDoneEvent
386
+ OrHash =
387
+ T.type_alias do
388
+ T.any(
389
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallCodeWsDone,
390
+ OpenAI::Internal::AnyHash
391
+ )
392
+ end
393
+
394
+ # The WebSocket lane that emitted this event. This field is present when the
395
+ # originating `response.create` event supplied a `stream_id`.
396
+ sig { returns(T.nilable(String)) }
397
+ attr_reader :stream_id
398
+
399
+ sig { params(stream_id: String).void }
400
+ attr_writer :stream_id
401
+
402
+ # Emitted when the code snippet is finalized by the code interpreter.
403
+ sig do
404
+ params(
405
+ code: String,
406
+ item_id: String,
407
+ output_index: Integer,
408
+ sequence_number: Integer,
409
+ agent:
410
+ T.nilable(
411
+ OpenAI::Beta::BetaResponseCodeInterpreterCallCodeDoneEvent::Agent::OrHash
412
+ ),
413
+ type: Symbol,
414
+ stream_id: String
415
+ ).returns(T.attached_class)
416
+ end
417
+ def self.new(
418
+ # The final code snippet output by the code interpreter.
419
+ code:,
420
+ # The unique identifier of the code interpreter tool call item.
421
+ item_id:,
422
+ # The index of the output item in the response for which the code is finalized.
423
+ output_index:,
424
+ # The sequence number of this event, used to order streaming events.
425
+ sequence_number:,
426
+ # The agent that owns this multi-agent streaming event.
427
+ agent: nil,
428
+ # The type of the event. Always `response.code_interpreter_call_code.done`.
429
+ type: :"response.code_interpreter_call_code.done",
430
+ # The WebSocket lane that emitted this event.
431
+ # This field is present when the originating response.create supplied a stream_id.
432
+ stream_id: nil
433
+ )
434
+ end
435
+
436
+ sig do
437
+ override.returns(
438
+ {
439
+ code: String,
440
+ item_id: String,
441
+ output_index: Integer,
442
+ sequence_number: Integer,
443
+ type: Symbol,
444
+ agent:
445
+ T.nilable(
446
+ OpenAI::Beta::BetaResponseCodeInterpreterCallCodeDoneEvent::Agent
447
+ ),
448
+ stream_id: String
449
+ }
450
+ )
451
+ end
452
+ def to_hash
453
+ end
454
+ end
455
+
456
+ class BetaResponseCodeInterpreterCallWsCompleted < OpenAI::Models::Beta::BetaResponseCodeInterpreterCallCompletedEvent
457
+ OrHash =
458
+ T.type_alias do
459
+ T.any(
460
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallWsCompleted,
461
+ OpenAI::Internal::AnyHash
462
+ )
463
+ end
464
+
465
+ # The WebSocket lane that emitted this event. This field is present when the
466
+ # originating `response.create` event supplied a `stream_id`.
467
+ sig { returns(T.nilable(String)) }
468
+ attr_reader :stream_id
469
+
470
+ sig { params(stream_id: String).void }
471
+ attr_writer :stream_id
472
+
473
+ # Emitted when the code interpreter call is completed.
474
+ sig do
475
+ params(
476
+ item_id: String,
477
+ output_index: Integer,
478
+ sequence_number: Integer,
479
+ agent:
480
+ T.nilable(
481
+ OpenAI::Beta::BetaResponseCodeInterpreterCallCompletedEvent::Agent::OrHash
482
+ ),
483
+ type: Symbol,
484
+ stream_id: String
485
+ ).returns(T.attached_class)
486
+ end
487
+ def self.new(
488
+ # The unique identifier of the code interpreter tool call item.
489
+ item_id:,
490
+ # The index of the output item in the response for which the code interpreter call
491
+ # is completed.
492
+ output_index:,
493
+ # The sequence number of this event, used to order streaming events.
494
+ sequence_number:,
495
+ # The agent that owns this multi-agent streaming event.
496
+ agent: nil,
497
+ # The type of the event. Always `response.code_interpreter_call.completed`.
498
+ type: :"response.code_interpreter_call.completed",
499
+ # The WebSocket lane that emitted this event.
500
+ # This field is present when the originating response.create supplied a stream_id.
501
+ stream_id: nil
502
+ )
503
+ end
504
+
505
+ sig do
506
+ override.returns(
507
+ {
508
+ item_id: String,
509
+ output_index: Integer,
510
+ sequence_number: Integer,
511
+ type: Symbol,
512
+ agent:
513
+ T.nilable(
514
+ OpenAI::Beta::BetaResponseCodeInterpreterCallCompletedEvent::Agent
515
+ ),
516
+ stream_id: String
517
+ }
518
+ )
519
+ end
520
+ def to_hash
521
+ end
522
+ end
523
+
524
+ class BetaResponseCodeInterpreterCallInWsProgress < OpenAI::Models::Beta::BetaResponseCodeInterpreterCallInProgressEvent
525
+ OrHash =
526
+ T.type_alias do
527
+ T.any(
528
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallInWsProgress,
529
+ OpenAI::Internal::AnyHash
530
+ )
531
+ end
532
+
533
+ # The WebSocket lane that emitted this event. This field is present when the
534
+ # originating `response.create` event supplied a `stream_id`.
535
+ sig { returns(T.nilable(String)) }
536
+ attr_reader :stream_id
537
+
538
+ sig { params(stream_id: String).void }
539
+ attr_writer :stream_id
540
+
541
+ # Emitted when a code interpreter call is in progress.
542
+ sig do
543
+ params(
544
+ item_id: String,
545
+ output_index: Integer,
546
+ sequence_number: Integer,
547
+ agent:
548
+ T.nilable(
549
+ OpenAI::Beta::BetaResponseCodeInterpreterCallInProgressEvent::Agent::OrHash
550
+ ),
551
+ type: Symbol,
552
+ stream_id: String
553
+ ).returns(T.attached_class)
554
+ end
555
+ def self.new(
556
+ # The unique identifier of the code interpreter tool call item.
557
+ item_id:,
558
+ # The index of the output item in the response for which the code interpreter call
559
+ # is in progress.
560
+ output_index:,
561
+ # The sequence number of this event, used to order streaming events.
562
+ sequence_number:,
563
+ # The agent that owns this multi-agent streaming event.
564
+ agent: nil,
565
+ # The type of the event. Always `response.code_interpreter_call.in_progress`.
566
+ type: :"response.code_interpreter_call.in_progress",
567
+ # The WebSocket lane that emitted this event.
568
+ # This field is present when the originating response.create supplied a stream_id.
569
+ stream_id: nil
570
+ )
571
+ end
572
+
573
+ sig do
574
+ override.returns(
575
+ {
576
+ item_id: String,
577
+ output_index: Integer,
578
+ sequence_number: Integer,
579
+ type: Symbol,
580
+ agent:
581
+ T.nilable(
582
+ OpenAI::Beta::BetaResponseCodeInterpreterCallInProgressEvent::Agent
583
+ ),
584
+ stream_id: String
585
+ }
586
+ )
587
+ end
588
+ def to_hash
589
+ end
590
+ end
591
+
592
+ class BetaResponseCodeInterpreterCallWsInterpreting < OpenAI::Models::Beta::BetaResponseCodeInterpreterCallInterpretingEvent
593
+ OrHash =
594
+ T.type_alias do
595
+ T.any(
596
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallWsInterpreting,
597
+ OpenAI::Internal::AnyHash
598
+ )
599
+ end
600
+
601
+ # The WebSocket lane that emitted this event. This field is present when the
602
+ # originating `response.create` event supplied a `stream_id`.
603
+ sig { returns(T.nilable(String)) }
604
+ attr_reader :stream_id
605
+
606
+ sig { params(stream_id: String).void }
607
+ attr_writer :stream_id
608
+
609
+ # Emitted when the code interpreter is actively interpreting the code snippet.
610
+ sig do
611
+ params(
612
+ item_id: String,
613
+ output_index: Integer,
614
+ sequence_number: Integer,
615
+ agent:
616
+ T.nilable(
617
+ OpenAI::Beta::BetaResponseCodeInterpreterCallInterpretingEvent::Agent::OrHash
618
+ ),
619
+ type: Symbol,
620
+ stream_id: String
621
+ ).returns(T.attached_class)
622
+ end
623
+ def self.new(
624
+ # The unique identifier of the code interpreter tool call item.
625
+ item_id:,
626
+ # The index of the output item in the response for which the code interpreter is
627
+ # interpreting code.
628
+ output_index:,
629
+ # The sequence number of this event, used to order streaming events.
630
+ sequence_number:,
631
+ # The agent that owns this multi-agent streaming event.
632
+ agent: nil,
633
+ # The type of the event. Always `response.code_interpreter_call.interpreting`.
634
+ type: :"response.code_interpreter_call.interpreting",
635
+ # The WebSocket lane that emitted this event.
636
+ # This field is present when the originating response.create supplied a stream_id.
637
+ stream_id: nil
638
+ )
639
+ end
640
+
641
+ sig do
642
+ override.returns(
643
+ {
644
+ item_id: String,
645
+ output_index: Integer,
646
+ sequence_number: Integer,
647
+ type: Symbol,
648
+ agent:
649
+ T.nilable(
650
+ OpenAI::Beta::BetaResponseCodeInterpreterCallInterpretingEvent::Agent
651
+ ),
652
+ stream_id: String
653
+ }
654
+ )
655
+ end
656
+ def to_hash
657
+ end
658
+ end
659
+
660
+ class BetaResponseWsCompleted < OpenAI::Models::Beta::BetaResponseCompletedEvent
661
+ OrHash =
662
+ T.type_alias do
663
+ T.any(
664
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsCompleted,
665
+ OpenAI::Internal::AnyHash
666
+ )
667
+ end
668
+
669
+ # The WebSocket lane that emitted this event. This field is present when the
670
+ # originating `response.create` event supplied a `stream_id`.
671
+ sig { returns(T.nilable(String)) }
672
+ attr_reader :stream_id
673
+
674
+ sig { params(stream_id: String).void }
675
+ attr_writer :stream_id
676
+
677
+ # Emitted when the model response is complete.
678
+ sig do
679
+ params(
680
+ response: OpenAI::Beta::BetaResponse::OrHash,
681
+ sequence_number: Integer,
682
+ agent:
683
+ T.nilable(
684
+ OpenAI::Beta::BetaResponseCompletedEvent::Agent::OrHash
685
+ ),
686
+ type: Symbol,
687
+ stream_id: String
688
+ ).returns(T.attached_class)
689
+ end
690
+ def self.new(
691
+ # Properties of the completed response.
692
+ response:,
693
+ # The sequence number for this event.
694
+ sequence_number:,
695
+ # The agent that owns this multi-agent streaming event.
696
+ agent: nil,
697
+ # The type of the event. Always `response.completed`.
698
+ type: :"response.completed",
699
+ # The WebSocket lane that emitted this event.
700
+ # This field is present when the originating response.create supplied a stream_id.
701
+ stream_id: nil
702
+ )
703
+ end
704
+
705
+ sig do
706
+ override.returns(
707
+ {
708
+ response: OpenAI::Beta::BetaResponse,
709
+ sequence_number: Integer,
710
+ type: Symbol,
711
+ agent:
712
+ T.nilable(OpenAI::Beta::BetaResponseCompletedEvent::Agent),
713
+ stream_id: String
714
+ }
715
+ )
716
+ end
717
+ def to_hash
718
+ end
719
+ end
720
+
721
+ class BetaResponseContentPartWsAdded < OpenAI::Models::Beta::BetaResponseContentPartAddedEvent
722
+ OrHash =
723
+ T.type_alias do
724
+ T.any(
725
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseContentPartWsAdded,
726
+ OpenAI::Internal::AnyHash
727
+ )
728
+ end
729
+
730
+ # The WebSocket lane that emitted this event. This field is present when the
731
+ # originating `response.create` event supplied a `stream_id`.
732
+ sig { returns(T.nilable(String)) }
733
+ attr_reader :stream_id
734
+
735
+ sig { params(stream_id: String).void }
736
+ attr_writer :stream_id
737
+
738
+ # Emitted when a new content part is added.
739
+ sig do
740
+ params(
741
+ content_index: Integer,
742
+ item_id: String,
743
+ output_index: Integer,
744
+ part:
745
+ T.any(
746
+ OpenAI::Beta::BetaResponseOutputText::OrHash,
747
+ OpenAI::Beta::BetaResponseOutputRefusal::OrHash,
748
+ OpenAI::Beta::BetaResponseContentPartAddedEvent::Part::ReasoningText::OrHash
749
+ ),
750
+ sequence_number: Integer,
751
+ agent:
752
+ T.nilable(
753
+ OpenAI::Beta::BetaResponseContentPartAddedEvent::Agent::OrHash
754
+ ),
755
+ type: Symbol,
756
+ stream_id: String
757
+ ).returns(T.attached_class)
758
+ end
759
+ def self.new(
760
+ # The index of the content part that was added.
761
+ content_index:,
762
+ # The ID of the output item that the content part was added to.
763
+ item_id:,
764
+ # The index of the output item that the content part was added to.
765
+ output_index:,
766
+ # The content part that was added.
767
+ part:,
768
+ # The sequence number of this event.
769
+ sequence_number:,
770
+ # The agent that owns this multi-agent streaming event.
771
+ agent: nil,
772
+ # The type of the event. Always `response.content_part.added`.
773
+ type: :"response.content_part.added",
774
+ # The WebSocket lane that emitted this event.
775
+ # This field is present when the originating response.create supplied a stream_id.
776
+ stream_id: nil
777
+ )
778
+ end
779
+
780
+ sig do
781
+ override.returns(
782
+ {
783
+ content_index: Integer,
784
+ item_id: String,
785
+ output_index: Integer,
786
+ part:
787
+ OpenAI::Beta::BetaResponseContentPartAddedEvent::Part::Variants,
788
+ sequence_number: Integer,
789
+ type: Symbol,
790
+ agent:
791
+ T.nilable(
792
+ OpenAI::Beta::BetaResponseContentPartAddedEvent::Agent
793
+ ),
794
+ stream_id: String
795
+ }
796
+ )
797
+ end
798
+ def to_hash
799
+ end
800
+ end
801
+
802
+ class BetaResponseContentPartWsDone < OpenAI::Models::Beta::BetaResponseContentPartDoneEvent
803
+ OrHash =
804
+ T.type_alias do
805
+ T.any(
806
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseContentPartWsDone,
807
+ OpenAI::Internal::AnyHash
808
+ )
809
+ end
810
+
811
+ # The WebSocket lane that emitted this event. This field is present when the
812
+ # originating `response.create` event supplied a `stream_id`.
813
+ sig { returns(T.nilable(String)) }
814
+ attr_reader :stream_id
815
+
816
+ sig { params(stream_id: String).void }
817
+ attr_writer :stream_id
818
+
819
+ # Emitted when a content part is done.
820
+ sig do
821
+ params(
822
+ content_index: Integer,
823
+ item_id: String,
824
+ output_index: Integer,
825
+ part:
826
+ T.any(
827
+ OpenAI::Beta::BetaResponseOutputText::OrHash,
828
+ OpenAI::Beta::BetaResponseOutputRefusal::OrHash,
829
+ OpenAI::Beta::BetaResponseContentPartDoneEvent::Part::ReasoningText::OrHash
830
+ ),
831
+ sequence_number: Integer,
832
+ agent:
833
+ T.nilable(
834
+ OpenAI::Beta::BetaResponseContentPartDoneEvent::Agent::OrHash
835
+ ),
836
+ type: Symbol,
837
+ stream_id: String
838
+ ).returns(T.attached_class)
839
+ end
840
+ def self.new(
841
+ # The index of the content part that is done.
842
+ content_index:,
843
+ # The ID of the output item that the content part was added to.
844
+ item_id:,
845
+ # The index of the output item that the content part was added to.
846
+ output_index:,
847
+ # The content part that is done.
848
+ part:,
849
+ # The sequence number of this event.
850
+ sequence_number:,
851
+ # The agent that owns this multi-agent streaming event.
852
+ agent: nil,
853
+ # The type of the event. Always `response.content_part.done`.
854
+ type: :"response.content_part.done",
855
+ # The WebSocket lane that emitted this event.
856
+ # This field is present when the originating response.create supplied a stream_id.
857
+ stream_id: nil
858
+ )
859
+ end
860
+
861
+ sig do
862
+ override.returns(
863
+ {
864
+ content_index: Integer,
865
+ item_id: String,
866
+ output_index: Integer,
867
+ part:
868
+ OpenAI::Beta::BetaResponseContentPartDoneEvent::Part::Variants,
869
+ sequence_number: Integer,
870
+ type: Symbol,
871
+ agent:
872
+ T.nilable(
873
+ OpenAI::Beta::BetaResponseContentPartDoneEvent::Agent
874
+ ),
875
+ stream_id: String
876
+ }
877
+ )
878
+ end
879
+ def to_hash
880
+ end
881
+ end
882
+
883
+ class BetaResponseWsCreated < OpenAI::Models::Beta::BetaResponseCreatedEvent
884
+ OrHash =
885
+ T.type_alias do
886
+ T.any(
887
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsCreated,
888
+ OpenAI::Internal::AnyHash
889
+ )
890
+ end
891
+
892
+ # The WebSocket lane that emitted this event. This field is present when the
893
+ # originating `response.create` event supplied a `stream_id`.
894
+ sig { returns(T.nilable(String)) }
895
+ attr_reader :stream_id
896
+
897
+ sig { params(stream_id: String).void }
898
+ attr_writer :stream_id
899
+
900
+ # An event that is emitted when a response is created.
901
+ sig do
902
+ params(
903
+ response: OpenAI::Beta::BetaResponse::OrHash,
904
+ sequence_number: Integer,
905
+ agent:
906
+ T.nilable(
907
+ OpenAI::Beta::BetaResponseCreatedEvent::Agent::OrHash
908
+ ),
909
+ type: Symbol,
910
+ stream_id: String
911
+ ).returns(T.attached_class)
912
+ end
913
+ def self.new(
914
+ # The response that was created.
915
+ response:,
916
+ # The sequence number for this event.
917
+ sequence_number:,
918
+ # The agent that owns this multi-agent streaming event.
919
+ agent: nil,
920
+ # The type of the event. Always `response.created`.
921
+ type: :"response.created",
922
+ # The WebSocket lane that emitted this event.
923
+ # This field is present when the originating response.create supplied a stream_id.
924
+ stream_id: nil
925
+ )
926
+ end
927
+
928
+ sig do
929
+ override.returns(
930
+ {
931
+ response: OpenAI::Beta::BetaResponse,
932
+ sequence_number: Integer,
933
+ type: Symbol,
934
+ agent: T.nilable(OpenAI::Beta::BetaResponseCreatedEvent::Agent),
935
+ stream_id: String
936
+ }
937
+ )
938
+ end
939
+ def to_hash
940
+ end
941
+ end
942
+
943
+ class BetaResponseWsError < OpenAI::Models::Beta::BetaResponseErrorEvent
944
+ OrHash =
945
+ T.type_alias do
946
+ T.any(
947
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError,
948
+ OpenAI::Internal::AnyHash
949
+ )
950
+ end
951
+
952
+ # The WebSocket lane that emitted this event. This field is present when the
953
+ # originating `response.create` event supplied a `stream_id`.
954
+ sig { returns(T.nilable(String)) }
955
+ attr_reader :stream_id
956
+
957
+ sig { params(stream_id: String).void }
958
+ attr_writer :stream_id
959
+
960
+ # Emitted when an error occurs.
961
+ sig do
962
+ params(
963
+ code: T.nilable(String),
964
+ message: String,
965
+ param: T.nilable(String),
966
+ sequence_number: Integer,
967
+ agent:
968
+ T.nilable(OpenAI::Beta::BetaResponseErrorEvent::Agent::OrHash),
969
+ type: Symbol,
970
+ stream_id: String
971
+ ).returns(T.attached_class)
972
+ end
973
+ def self.new(
974
+ # The error code.
975
+ code:,
976
+ # The error message.
977
+ message:,
978
+ # The error parameter.
979
+ param:,
980
+ # The sequence number of this event.
981
+ sequence_number:,
982
+ # The agent that owns this multi-agent streaming event.
983
+ agent: nil,
984
+ # The type of the event. Always `error`.
985
+ type: :error,
986
+ # The WebSocket lane that emitted this event.
987
+ # This field is present when the originating response.create supplied a stream_id.
988
+ stream_id: nil
989
+ )
990
+ end
991
+
992
+ sig do
993
+ override.returns(
994
+ {
995
+ code: T.nilable(String),
996
+ message: String,
997
+ param: T.nilable(String),
998
+ sequence_number: Integer,
999
+ type: Symbol,
1000
+ agent: T.nilable(OpenAI::Beta::BetaResponseErrorEvent::Agent),
1001
+ stream_id: String
1002
+ }
1003
+ )
1004
+ end
1005
+ def to_hash
1006
+ end
1007
+ end
1008
+
1009
+ class BetaResponseFileSearchCallWsCompleted < OpenAI::Models::Beta::BetaResponseFileSearchCallCompletedEvent
1010
+ OrHash =
1011
+ T.type_alias do
1012
+ T.any(
1013
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallWsCompleted,
1014
+ OpenAI::Internal::AnyHash
1015
+ )
1016
+ end
1017
+
1018
+ # The WebSocket lane that emitted this event. This field is present when the
1019
+ # originating `response.create` event supplied a `stream_id`.
1020
+ sig { returns(T.nilable(String)) }
1021
+ attr_reader :stream_id
1022
+
1023
+ sig { params(stream_id: String).void }
1024
+ attr_writer :stream_id
1025
+
1026
+ # Emitted when a file search call is completed (results found).
1027
+ sig do
1028
+ params(
1029
+ item_id: String,
1030
+ output_index: Integer,
1031
+ sequence_number: Integer,
1032
+ agent:
1033
+ T.nilable(
1034
+ OpenAI::Beta::BetaResponseFileSearchCallCompletedEvent::Agent::OrHash
1035
+ ),
1036
+ type: Symbol,
1037
+ stream_id: String
1038
+ ).returns(T.attached_class)
1039
+ end
1040
+ def self.new(
1041
+ # The ID of the output item that the file search call is initiated.
1042
+ item_id:,
1043
+ # The index of the output item that the file search call is initiated.
1044
+ output_index:,
1045
+ # The sequence number of this event.
1046
+ sequence_number:,
1047
+ # The agent that owns this multi-agent streaming event.
1048
+ agent: nil,
1049
+ # The type of the event. Always `response.file_search_call.completed`.
1050
+ type: :"response.file_search_call.completed",
1051
+ # The WebSocket lane that emitted this event.
1052
+ # This field is present when the originating response.create supplied a stream_id.
1053
+ stream_id: nil
1054
+ )
1055
+ end
1056
+
1057
+ sig do
1058
+ override.returns(
1059
+ {
1060
+ item_id: String,
1061
+ output_index: Integer,
1062
+ sequence_number: Integer,
1063
+ type: Symbol,
1064
+ agent:
1065
+ T.nilable(
1066
+ OpenAI::Beta::BetaResponseFileSearchCallCompletedEvent::Agent
1067
+ ),
1068
+ stream_id: String
1069
+ }
1070
+ )
1071
+ end
1072
+ def to_hash
1073
+ end
1074
+ end
1075
+
1076
+ class BetaResponseFileSearchCallInWsProgress < OpenAI::Models::Beta::BetaResponseFileSearchCallInProgressEvent
1077
+ OrHash =
1078
+ T.type_alias do
1079
+ T.any(
1080
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallInWsProgress,
1081
+ OpenAI::Internal::AnyHash
1082
+ )
1083
+ end
1084
+
1085
+ # The WebSocket lane that emitted this event. This field is present when the
1086
+ # originating `response.create` event supplied a `stream_id`.
1087
+ sig { returns(T.nilable(String)) }
1088
+ attr_reader :stream_id
1089
+
1090
+ sig { params(stream_id: String).void }
1091
+ attr_writer :stream_id
1092
+
1093
+ # Emitted when a file search call is initiated.
1094
+ sig do
1095
+ params(
1096
+ item_id: String,
1097
+ output_index: Integer,
1098
+ sequence_number: Integer,
1099
+ agent:
1100
+ T.nilable(
1101
+ OpenAI::Beta::BetaResponseFileSearchCallInProgressEvent::Agent::OrHash
1102
+ ),
1103
+ type: Symbol,
1104
+ stream_id: String
1105
+ ).returns(T.attached_class)
1106
+ end
1107
+ def self.new(
1108
+ # The ID of the output item that the file search call is initiated.
1109
+ item_id:,
1110
+ # The index of the output item that the file search call is initiated.
1111
+ output_index:,
1112
+ # The sequence number of this event.
1113
+ sequence_number:,
1114
+ # The agent that owns this multi-agent streaming event.
1115
+ agent: nil,
1116
+ # The type of the event. Always `response.file_search_call.in_progress`.
1117
+ type: :"response.file_search_call.in_progress",
1118
+ # The WebSocket lane that emitted this event.
1119
+ # This field is present when the originating response.create supplied a stream_id.
1120
+ stream_id: nil
1121
+ )
1122
+ end
1123
+
1124
+ sig do
1125
+ override.returns(
1126
+ {
1127
+ item_id: String,
1128
+ output_index: Integer,
1129
+ sequence_number: Integer,
1130
+ type: Symbol,
1131
+ agent:
1132
+ T.nilable(
1133
+ OpenAI::Beta::BetaResponseFileSearchCallInProgressEvent::Agent
1134
+ ),
1135
+ stream_id: String
1136
+ }
1137
+ )
1138
+ end
1139
+ def to_hash
1140
+ end
1141
+ end
1142
+
1143
+ class BetaResponseFileSearchCallWsSearching < OpenAI::Models::Beta::BetaResponseFileSearchCallSearchingEvent
1144
+ OrHash =
1145
+ T.type_alias do
1146
+ T.any(
1147
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallWsSearching,
1148
+ OpenAI::Internal::AnyHash
1149
+ )
1150
+ end
1151
+
1152
+ # The WebSocket lane that emitted this event. This field is present when the
1153
+ # originating `response.create` event supplied a `stream_id`.
1154
+ sig { returns(T.nilable(String)) }
1155
+ attr_reader :stream_id
1156
+
1157
+ sig { params(stream_id: String).void }
1158
+ attr_writer :stream_id
1159
+
1160
+ # Emitted when a file search is currently searching.
1161
+ sig do
1162
+ params(
1163
+ item_id: String,
1164
+ output_index: Integer,
1165
+ sequence_number: Integer,
1166
+ agent:
1167
+ T.nilable(
1168
+ OpenAI::Beta::BetaResponseFileSearchCallSearchingEvent::Agent::OrHash
1169
+ ),
1170
+ type: Symbol,
1171
+ stream_id: String
1172
+ ).returns(T.attached_class)
1173
+ end
1174
+ def self.new(
1175
+ # The ID of the output item that the file search call is initiated.
1176
+ item_id:,
1177
+ # The index of the output item that the file search call is searching.
1178
+ output_index:,
1179
+ # The sequence number of this event.
1180
+ sequence_number:,
1181
+ # The agent that owns this multi-agent streaming event.
1182
+ agent: nil,
1183
+ # The type of the event. Always `response.file_search_call.searching`.
1184
+ type: :"response.file_search_call.searching",
1185
+ # The WebSocket lane that emitted this event.
1186
+ # This field is present when the originating response.create supplied a stream_id.
1187
+ stream_id: nil
1188
+ )
1189
+ end
1190
+
1191
+ sig do
1192
+ override.returns(
1193
+ {
1194
+ item_id: String,
1195
+ output_index: Integer,
1196
+ sequence_number: Integer,
1197
+ type: Symbol,
1198
+ agent:
1199
+ T.nilable(
1200
+ OpenAI::Beta::BetaResponseFileSearchCallSearchingEvent::Agent
1201
+ ),
1202
+ stream_id: String
1203
+ }
1204
+ )
1205
+ end
1206
+ def to_hash
1207
+ end
1208
+ end
1209
+
1210
+ class BetaResponseFunctionCallArgumentsWsDelta < OpenAI::Models::Beta::BetaResponseFunctionCallArgumentsDeltaEvent
1211
+ OrHash =
1212
+ T.type_alias do
1213
+ T.any(
1214
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFunctionCallArgumentsWsDelta,
1215
+ OpenAI::Internal::AnyHash
1216
+ )
1217
+ end
1218
+
1219
+ # The WebSocket lane that emitted this event. This field is present when the
1220
+ # originating `response.create` event supplied a `stream_id`.
1221
+ sig { returns(T.nilable(String)) }
1222
+ attr_reader :stream_id
1223
+
1224
+ sig { params(stream_id: String).void }
1225
+ attr_writer :stream_id
1226
+
1227
+ # Emitted when there is a partial function-call arguments delta.
1228
+ sig do
1229
+ params(
1230
+ delta: String,
1231
+ item_id: String,
1232
+ output_index: Integer,
1233
+ sequence_number: Integer,
1234
+ agent:
1235
+ T.nilable(
1236
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDeltaEvent::Agent::OrHash
1237
+ ),
1238
+ type: Symbol,
1239
+ stream_id: String
1240
+ ).returns(T.attached_class)
1241
+ end
1242
+ def self.new(
1243
+ # The function-call arguments delta that is added.
1244
+ delta:,
1245
+ # The ID of the output item that the function-call arguments delta is added to.
1246
+ item_id:,
1247
+ # The index of the output item that the function-call arguments delta is added to.
1248
+ output_index:,
1249
+ # The sequence number of this event.
1250
+ sequence_number:,
1251
+ # The agent that owns this multi-agent streaming event.
1252
+ agent: nil,
1253
+ # The type of the event. Always `response.function_call_arguments.delta`.
1254
+ type: :"response.function_call_arguments.delta",
1255
+ # The WebSocket lane that emitted this event.
1256
+ # This field is present when the originating response.create supplied a stream_id.
1257
+ stream_id: nil
1258
+ )
1259
+ end
1260
+
1261
+ sig do
1262
+ override.returns(
1263
+ {
1264
+ delta: String,
1265
+ item_id: String,
1266
+ output_index: Integer,
1267
+ sequence_number: Integer,
1268
+ type: Symbol,
1269
+ agent:
1270
+ T.nilable(
1271
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDeltaEvent::Agent
1272
+ ),
1273
+ stream_id: String
1274
+ }
1275
+ )
1276
+ end
1277
+ def to_hash
1278
+ end
1279
+ end
1280
+
1281
+ class BetaResponseFunctionCallArgumentsWsDone < OpenAI::Models::Beta::BetaResponseFunctionCallArgumentsDoneEvent
1282
+ OrHash =
1283
+ T.type_alias do
1284
+ T.any(
1285
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFunctionCallArgumentsWsDone,
1286
+ OpenAI::Internal::AnyHash
1287
+ )
1288
+ end
1289
+
1290
+ # The WebSocket lane that emitted this event. This field is present when the
1291
+ # originating `response.create` event supplied a `stream_id`.
1292
+ sig { returns(T.nilable(String)) }
1293
+ attr_reader :stream_id
1294
+
1295
+ sig { params(stream_id: String).void }
1296
+ attr_writer :stream_id
1297
+
1298
+ # Emitted when function-call arguments are finalized.
1299
+ sig do
1300
+ params(
1301
+ arguments: String,
1302
+ item_id: String,
1303
+ name: String,
1304
+ output_index: Integer,
1305
+ sequence_number: Integer,
1306
+ agent:
1307
+ T.nilable(
1308
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDoneEvent::Agent::OrHash
1309
+ ),
1310
+ type: Symbol,
1311
+ stream_id: String
1312
+ ).returns(T.attached_class)
1313
+ end
1314
+ def self.new(
1315
+ # The function-call arguments.
1316
+ arguments:,
1317
+ # The ID of the item.
1318
+ item_id:,
1319
+ # The name of the function that was called.
1320
+ name:,
1321
+ # The index of the output item.
1322
+ output_index:,
1323
+ # The sequence number of this event.
1324
+ sequence_number:,
1325
+ # The agent that owns this multi-agent streaming event.
1326
+ agent: nil,
1327
+ type: :"response.function_call_arguments.done",
1328
+ # The WebSocket lane that emitted this event.
1329
+ # This field is present when the originating response.create supplied a stream_id.
1330
+ stream_id: nil
1331
+ )
1332
+ end
1333
+
1334
+ sig do
1335
+ override.returns(
1336
+ {
1337
+ arguments: String,
1338
+ item_id: String,
1339
+ name: String,
1340
+ output_index: Integer,
1341
+ sequence_number: Integer,
1342
+ type: Symbol,
1343
+ agent:
1344
+ T.nilable(
1345
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDoneEvent::Agent
1346
+ ),
1347
+ stream_id: String
1348
+ }
1349
+ )
1350
+ end
1351
+ def to_hash
1352
+ end
1353
+ end
1354
+
1355
+ class BetaResponseInWsProgress < OpenAI::Models::Beta::BetaResponseInProgressEvent
1356
+ OrHash =
1357
+ T.type_alias do
1358
+ T.any(
1359
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseInWsProgress,
1360
+ OpenAI::Internal::AnyHash
1361
+ )
1362
+ end
1363
+
1364
+ # The WebSocket lane that emitted this event. This field is present when the
1365
+ # originating `response.create` event supplied a `stream_id`.
1366
+ sig { returns(T.nilable(String)) }
1367
+ attr_reader :stream_id
1368
+
1369
+ sig { params(stream_id: String).void }
1370
+ attr_writer :stream_id
1371
+
1372
+ # Emitted when the response is in progress.
1373
+ sig do
1374
+ params(
1375
+ response: OpenAI::Beta::BetaResponse::OrHash,
1376
+ sequence_number: Integer,
1377
+ agent:
1378
+ T.nilable(
1379
+ OpenAI::Beta::BetaResponseInProgressEvent::Agent::OrHash
1380
+ ),
1381
+ type: Symbol,
1382
+ stream_id: String
1383
+ ).returns(T.attached_class)
1384
+ end
1385
+ def self.new(
1386
+ # The response that is in progress.
1387
+ response:,
1388
+ # The sequence number of this event.
1389
+ sequence_number:,
1390
+ # The agent that owns this multi-agent streaming event.
1391
+ agent: nil,
1392
+ # The type of the event. Always `response.in_progress`.
1393
+ type: :"response.in_progress",
1394
+ # The WebSocket lane that emitted this event.
1395
+ # This field is present when the originating response.create supplied a stream_id.
1396
+ stream_id: nil
1397
+ )
1398
+ end
1399
+
1400
+ sig do
1401
+ override.returns(
1402
+ {
1403
+ response: OpenAI::Beta::BetaResponse,
1404
+ sequence_number: Integer,
1405
+ type: Symbol,
1406
+ agent:
1407
+ T.nilable(OpenAI::Beta::BetaResponseInProgressEvent::Agent),
1408
+ stream_id: String
1409
+ }
1410
+ )
1411
+ end
1412
+ def to_hash
1413
+ end
1414
+ end
1415
+
1416
+ class BetaResponseWsFailed < OpenAI::Models::Beta::BetaResponseFailedEvent
1417
+ OrHash =
1418
+ T.type_alias do
1419
+ T.any(
1420
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsFailed,
1421
+ OpenAI::Internal::AnyHash
1422
+ )
1423
+ end
1424
+
1425
+ # The WebSocket lane that emitted this event. This field is present when the
1426
+ # originating `response.create` event supplied a `stream_id`.
1427
+ sig { returns(T.nilable(String)) }
1428
+ attr_reader :stream_id
1429
+
1430
+ sig { params(stream_id: String).void }
1431
+ attr_writer :stream_id
1432
+
1433
+ # An event that is emitted when a response fails.
1434
+ sig do
1435
+ params(
1436
+ response: OpenAI::Beta::BetaResponse::OrHash,
1437
+ sequence_number: Integer,
1438
+ agent:
1439
+ T.nilable(OpenAI::Beta::BetaResponseFailedEvent::Agent::OrHash),
1440
+ type: Symbol,
1441
+ stream_id: String
1442
+ ).returns(T.attached_class)
1443
+ end
1444
+ def self.new(
1445
+ # The response that failed.
1446
+ response:,
1447
+ # The sequence number of this event.
1448
+ sequence_number:,
1449
+ # The agent that owns this multi-agent streaming event.
1450
+ agent: nil,
1451
+ # The type of the event. Always `response.failed`.
1452
+ type: :"response.failed",
1453
+ # The WebSocket lane that emitted this event.
1454
+ # This field is present when the originating response.create supplied a stream_id.
1455
+ stream_id: nil
1456
+ )
1457
+ end
1458
+
1459
+ sig do
1460
+ override.returns(
1461
+ {
1462
+ response: OpenAI::Beta::BetaResponse,
1463
+ sequence_number: Integer,
1464
+ type: Symbol,
1465
+ agent: T.nilable(OpenAI::Beta::BetaResponseFailedEvent::Agent),
1466
+ stream_id: String
1467
+ }
1468
+ )
1469
+ end
1470
+ def to_hash
1471
+ end
1472
+ end
1473
+
1474
+ class BetaResponseWsIncomplete < OpenAI::Models::Beta::BetaResponseIncompleteEvent
1475
+ OrHash =
1476
+ T.type_alias do
1477
+ T.any(
1478
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsIncomplete,
1479
+ OpenAI::Internal::AnyHash
1480
+ )
1481
+ end
1482
+
1483
+ # The WebSocket lane that emitted this event. This field is present when the
1484
+ # originating `response.create` event supplied a `stream_id`.
1485
+ sig { returns(T.nilable(String)) }
1486
+ attr_reader :stream_id
1487
+
1488
+ sig { params(stream_id: String).void }
1489
+ attr_writer :stream_id
1490
+
1491
+ # An event that is emitted when a response finishes as incomplete.
1492
+ sig do
1493
+ params(
1494
+ response: OpenAI::Beta::BetaResponse::OrHash,
1495
+ sequence_number: Integer,
1496
+ agent:
1497
+ T.nilable(
1498
+ OpenAI::Beta::BetaResponseIncompleteEvent::Agent::OrHash
1499
+ ),
1500
+ type: Symbol,
1501
+ stream_id: String
1502
+ ).returns(T.attached_class)
1503
+ end
1504
+ def self.new(
1505
+ # The response that was incomplete.
1506
+ response:,
1507
+ # The sequence number of this event.
1508
+ sequence_number:,
1509
+ # The agent that owns this multi-agent streaming event.
1510
+ agent: nil,
1511
+ # The type of the event. Always `response.incomplete`.
1512
+ type: :"response.incomplete",
1513
+ # The WebSocket lane that emitted this event.
1514
+ # This field is present when the originating response.create supplied a stream_id.
1515
+ stream_id: nil
1516
+ )
1517
+ end
1518
+
1519
+ sig do
1520
+ override.returns(
1521
+ {
1522
+ response: OpenAI::Beta::BetaResponse,
1523
+ sequence_number: Integer,
1524
+ type: Symbol,
1525
+ agent:
1526
+ T.nilable(OpenAI::Beta::BetaResponseIncompleteEvent::Agent),
1527
+ stream_id: String
1528
+ }
1529
+ )
1530
+ end
1531
+ def to_hash
1532
+ end
1533
+ end
1534
+
1535
+ class BetaResponseOutputItemWsAdded < OpenAI::Models::Beta::BetaResponseOutputItemAddedEvent
1536
+ OrHash =
1537
+ T.type_alias do
1538
+ T.any(
1539
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputItemWsAdded,
1540
+ OpenAI::Internal::AnyHash
1541
+ )
1542
+ end
1543
+
1544
+ # The WebSocket lane that emitted this event. This field is present when the
1545
+ # originating `response.create` event supplied a `stream_id`.
1546
+ sig { returns(T.nilable(String)) }
1547
+ attr_reader :stream_id
1548
+
1549
+ sig { params(stream_id: String).void }
1550
+ attr_writer :stream_id
1551
+
1552
+ # Emitted when a new output item is added.
1553
+ sig do
1554
+ params(
1555
+ item:
1556
+ T.any(
1557
+ OpenAI::Beta::BetaResponseOutputMessage::OrHash,
1558
+ OpenAI::Beta::BetaResponseFileSearchToolCall::OrHash,
1559
+ OpenAI::Beta::BetaResponseFunctionToolCall::OrHash,
1560
+ OpenAI::Beta::BetaResponseFunctionToolCallOutputItem::OrHash,
1561
+ OpenAI::Beta::BetaResponseOutputItem::AgentMessage::OrHash,
1562
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCall::OrHash,
1563
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCallOutput::OrHash,
1564
+ OpenAI::Beta::BetaResponseFunctionWebSearch::OrHash,
1565
+ OpenAI::Beta::BetaResponseComputerToolCall::OrHash,
1566
+ OpenAI::Beta::BetaResponseComputerToolCallOutputItem::OrHash,
1567
+ OpenAI::Beta::BetaResponseReasoningItem::OrHash,
1568
+ OpenAI::Beta::BetaResponseOutputItem::Program::OrHash,
1569
+ OpenAI::Beta::BetaResponseOutputItem::ProgramOutput::OrHash,
1570
+ OpenAI::Beta::BetaResponseToolSearchCall::OrHash,
1571
+ OpenAI::Beta::BetaResponseToolSearchOutputItem::OrHash,
1572
+ OpenAI::Beta::BetaResponseOutputItem::AdditionalTools::OrHash,
1573
+ OpenAI::Beta::BetaResponseCompactionItem::OrHash,
1574
+ OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::OrHash,
1575
+ OpenAI::Beta::BetaResponseCodeInterpreterToolCall::OrHash,
1576
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCall::OrHash,
1577
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCallOutput::OrHash,
1578
+ OpenAI::Beta::BetaResponseFunctionShellToolCall::OrHash,
1579
+ OpenAI::Beta::BetaResponseFunctionShellToolCallOutput::OrHash,
1580
+ OpenAI::Beta::BetaResponseApplyPatchToolCall::OrHash,
1581
+ OpenAI::Beta::BetaResponseApplyPatchToolCallOutput::OrHash,
1582
+ OpenAI::Beta::BetaResponseOutputItem::McpCall::OrHash,
1583
+ OpenAI::Beta::BetaResponseOutputItem::McpListTools::OrHash,
1584
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalRequest::OrHash,
1585
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalResponse::OrHash,
1586
+ OpenAI::Beta::BetaResponseCustomToolCall::OrHash,
1587
+ OpenAI::Beta::BetaResponseCustomToolCallOutputItem::OrHash
1588
+ ),
1589
+ output_index: Integer,
1590
+ sequence_number: Integer,
1591
+ agent:
1592
+ T.nilable(
1593
+ OpenAI::Beta::BetaResponseOutputItemAddedEvent::Agent::OrHash
1594
+ ),
1595
+ type: Symbol,
1596
+ stream_id: String
1597
+ ).returns(T.attached_class)
1598
+ end
1599
+ def self.new(
1600
+ # The output item that was added.
1601
+ item:,
1602
+ # The index of the output item that was added.
1603
+ output_index:,
1604
+ # The sequence number of this event.
1605
+ sequence_number:,
1606
+ # The agent that owns this multi-agent streaming event.
1607
+ agent: nil,
1608
+ # The type of the event. Always `response.output_item.added`.
1609
+ type: :"response.output_item.added",
1610
+ # The WebSocket lane that emitted this event.
1611
+ # This field is present when the originating response.create supplied a stream_id.
1612
+ stream_id: nil
1613
+ )
1614
+ end
1615
+
1616
+ sig do
1617
+ override.returns(
1618
+ {
1619
+ item: OpenAI::Beta::BetaResponseOutputItem::Variants,
1620
+ output_index: Integer,
1621
+ sequence_number: Integer,
1622
+ type: Symbol,
1623
+ agent:
1624
+ T.nilable(
1625
+ OpenAI::Beta::BetaResponseOutputItemAddedEvent::Agent
1626
+ ),
1627
+ stream_id: String
1628
+ }
1629
+ )
1630
+ end
1631
+ def to_hash
1632
+ end
1633
+ end
1634
+
1635
+ class BetaResponseOutputItemWsDone < OpenAI::Models::Beta::BetaResponseOutputItemDoneEvent
1636
+ OrHash =
1637
+ T.type_alias do
1638
+ T.any(
1639
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputItemWsDone,
1640
+ OpenAI::Internal::AnyHash
1641
+ )
1642
+ end
1643
+
1644
+ # The WebSocket lane that emitted this event. This field is present when the
1645
+ # originating `response.create` event supplied a `stream_id`.
1646
+ sig { returns(T.nilable(String)) }
1647
+ attr_reader :stream_id
1648
+
1649
+ sig { params(stream_id: String).void }
1650
+ attr_writer :stream_id
1651
+
1652
+ # Emitted when an output item is marked done.
1653
+ sig do
1654
+ params(
1655
+ item:
1656
+ T.any(
1657
+ OpenAI::Beta::BetaResponseOutputMessage::OrHash,
1658
+ OpenAI::Beta::BetaResponseFileSearchToolCall::OrHash,
1659
+ OpenAI::Beta::BetaResponseFunctionToolCall::OrHash,
1660
+ OpenAI::Beta::BetaResponseFunctionToolCallOutputItem::OrHash,
1661
+ OpenAI::Beta::BetaResponseOutputItem::AgentMessage::OrHash,
1662
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCall::OrHash,
1663
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCallOutput::OrHash,
1664
+ OpenAI::Beta::BetaResponseFunctionWebSearch::OrHash,
1665
+ OpenAI::Beta::BetaResponseComputerToolCall::OrHash,
1666
+ OpenAI::Beta::BetaResponseComputerToolCallOutputItem::OrHash,
1667
+ OpenAI::Beta::BetaResponseReasoningItem::OrHash,
1668
+ OpenAI::Beta::BetaResponseOutputItem::Program::OrHash,
1669
+ OpenAI::Beta::BetaResponseOutputItem::ProgramOutput::OrHash,
1670
+ OpenAI::Beta::BetaResponseToolSearchCall::OrHash,
1671
+ OpenAI::Beta::BetaResponseToolSearchOutputItem::OrHash,
1672
+ OpenAI::Beta::BetaResponseOutputItem::AdditionalTools::OrHash,
1673
+ OpenAI::Beta::BetaResponseCompactionItem::OrHash,
1674
+ OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::OrHash,
1675
+ OpenAI::Beta::BetaResponseCodeInterpreterToolCall::OrHash,
1676
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCall::OrHash,
1677
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCallOutput::OrHash,
1678
+ OpenAI::Beta::BetaResponseFunctionShellToolCall::OrHash,
1679
+ OpenAI::Beta::BetaResponseFunctionShellToolCallOutput::OrHash,
1680
+ OpenAI::Beta::BetaResponseApplyPatchToolCall::OrHash,
1681
+ OpenAI::Beta::BetaResponseApplyPatchToolCallOutput::OrHash,
1682
+ OpenAI::Beta::BetaResponseOutputItem::McpCall::OrHash,
1683
+ OpenAI::Beta::BetaResponseOutputItem::McpListTools::OrHash,
1684
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalRequest::OrHash,
1685
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalResponse::OrHash,
1686
+ OpenAI::Beta::BetaResponseCustomToolCall::OrHash,
1687
+ OpenAI::Beta::BetaResponseCustomToolCallOutputItem::OrHash
1688
+ ),
1689
+ output_index: Integer,
1690
+ sequence_number: Integer,
1691
+ agent:
1692
+ T.nilable(
1693
+ OpenAI::Beta::BetaResponseOutputItemDoneEvent::Agent::OrHash
1694
+ ),
1695
+ type: Symbol,
1696
+ stream_id: String
1697
+ ).returns(T.attached_class)
1698
+ end
1699
+ def self.new(
1700
+ # The output item that was marked done.
1701
+ item:,
1702
+ # The index of the output item that was marked done.
1703
+ output_index:,
1704
+ # The sequence number of this event.
1705
+ sequence_number:,
1706
+ # The agent that owns this multi-agent streaming event.
1707
+ agent: nil,
1708
+ # The type of the event. Always `response.output_item.done`.
1709
+ type: :"response.output_item.done",
1710
+ # The WebSocket lane that emitted this event.
1711
+ # This field is present when the originating response.create supplied a stream_id.
1712
+ stream_id: nil
1713
+ )
1714
+ end
1715
+
1716
+ sig do
1717
+ override.returns(
1718
+ {
1719
+ item: OpenAI::Beta::BetaResponseOutputItem::Variants,
1720
+ output_index: Integer,
1721
+ sequence_number: Integer,
1722
+ type: Symbol,
1723
+ agent:
1724
+ T.nilable(
1725
+ OpenAI::Beta::BetaResponseOutputItemDoneEvent::Agent
1726
+ ),
1727
+ stream_id: String
1728
+ }
1729
+ )
1730
+ end
1731
+ def to_hash
1732
+ end
1733
+ end
1734
+
1735
+ class BetaResponseReasoningSummaryPartWsAdded < OpenAI::Models::Beta::BetaResponseReasoningSummaryPartAddedEvent
1736
+ OrHash =
1737
+ T.type_alias do
1738
+ T.any(
1739
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryPartWsAdded,
1740
+ OpenAI::Internal::AnyHash
1741
+ )
1742
+ end
1743
+
1744
+ # The WebSocket lane that emitted this event. This field is present when the
1745
+ # originating `response.create` event supplied a `stream_id`.
1746
+ sig { returns(T.nilable(String)) }
1747
+ attr_reader :stream_id
1748
+
1749
+ sig { params(stream_id: String).void }
1750
+ attr_writer :stream_id
1751
+
1752
+ # Emitted when a new reasoning summary part is added.
1753
+ sig do
1754
+ params(
1755
+ item_id: String,
1756
+ output_index: Integer,
1757
+ part:
1758
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Part::OrHash,
1759
+ sequence_number: Integer,
1760
+ summary_index: Integer,
1761
+ agent:
1762
+ T.nilable(
1763
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Agent::OrHash
1764
+ ),
1765
+ type: Symbol,
1766
+ stream_id: String
1767
+ ).returns(T.attached_class)
1768
+ end
1769
+ def self.new(
1770
+ # The ID of the item this summary part is associated with.
1771
+ item_id:,
1772
+ # The index of the output item this summary part is associated with.
1773
+ output_index:,
1774
+ # The summary part that was added.
1775
+ part:,
1776
+ # The sequence number of this event.
1777
+ sequence_number:,
1778
+ # The index of the summary part within the reasoning summary.
1779
+ summary_index:,
1780
+ # The agent that owns this multi-agent streaming event.
1781
+ agent: nil,
1782
+ # The type of the event. Always `response.reasoning_summary_part.added`.
1783
+ type: :"response.reasoning_summary_part.added",
1784
+ # The WebSocket lane that emitted this event.
1785
+ # This field is present when the originating response.create supplied a stream_id.
1786
+ stream_id: nil
1787
+ )
1788
+ end
1789
+
1790
+ sig do
1791
+ override.returns(
1792
+ {
1793
+ item_id: String,
1794
+ output_index: Integer,
1795
+ part:
1796
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Part,
1797
+ sequence_number: Integer,
1798
+ summary_index: Integer,
1799
+ type: Symbol,
1800
+ agent:
1801
+ T.nilable(
1802
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Agent
1803
+ ),
1804
+ stream_id: String
1805
+ }
1806
+ )
1807
+ end
1808
+ def to_hash
1809
+ end
1810
+ end
1811
+
1812
+ class BetaResponseReasoningSummaryPartWsDone < OpenAI::Models::Beta::BetaResponseReasoningSummaryPartDoneEvent
1813
+ OrHash =
1814
+ T.type_alias do
1815
+ T.any(
1816
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryPartWsDone,
1817
+ OpenAI::Internal::AnyHash
1818
+ )
1819
+ end
1820
+
1821
+ # The WebSocket lane that emitted this event. This field is present when the
1822
+ # originating `response.create` event supplied a `stream_id`.
1823
+ sig { returns(T.nilable(String)) }
1824
+ attr_reader :stream_id
1825
+
1826
+ sig { params(stream_id: String).void }
1827
+ attr_writer :stream_id
1828
+
1829
+ # Emitted when a reasoning summary part is completed.
1830
+ sig do
1831
+ params(
1832
+ item_id: String,
1833
+ output_index: Integer,
1834
+ part:
1835
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Part::OrHash,
1836
+ sequence_number: Integer,
1837
+ summary_index: Integer,
1838
+ agent:
1839
+ T.nilable(
1840
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Agent::OrHash
1841
+ ),
1842
+ status:
1843
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Status::OrSymbol,
1844
+ type: Symbol,
1845
+ stream_id: String
1846
+ ).returns(T.attached_class)
1847
+ end
1848
+ def self.new(
1849
+ # The ID of the item this summary part is associated with.
1850
+ item_id:,
1851
+ # The index of the output item this summary part is associated with.
1852
+ output_index:,
1853
+ # The completed summary part.
1854
+ part:,
1855
+ # The sequence number of this event.
1856
+ sequence_number:,
1857
+ # The index of the summary part within the reasoning summary.
1858
+ summary_index:,
1859
+ # The agent that owns this multi-agent streaming event.
1860
+ agent: nil,
1861
+ # The completion status of the summary part. Omitted when the part completed
1862
+ # normally and set to `incomplete` when generation was interrupted.
1863
+ status: nil,
1864
+ # The type of the event. Always `response.reasoning_summary_part.done`.
1865
+ type: :"response.reasoning_summary_part.done",
1866
+ # The WebSocket lane that emitted this event.
1867
+ # This field is present when the originating response.create supplied a stream_id.
1868
+ stream_id: nil
1869
+ )
1870
+ end
1871
+
1872
+ sig do
1873
+ override.returns(
1874
+ {
1875
+ item_id: String,
1876
+ output_index: Integer,
1877
+ part:
1878
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Part,
1879
+ sequence_number: Integer,
1880
+ summary_index: Integer,
1881
+ type: Symbol,
1882
+ agent:
1883
+ T.nilable(
1884
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Agent
1885
+ ),
1886
+ status:
1887
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Status::TaggedSymbol,
1888
+ stream_id: String
1889
+ }
1890
+ )
1891
+ end
1892
+ def to_hash
1893
+ end
1894
+ end
1895
+
1896
+ class BetaResponseReasoningSummaryTextWsDelta < OpenAI::Models::Beta::BetaResponseReasoningSummaryTextDeltaEvent
1897
+ OrHash =
1898
+ T.type_alias do
1899
+ T.any(
1900
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryTextWsDelta,
1901
+ OpenAI::Internal::AnyHash
1902
+ )
1903
+ end
1904
+
1905
+ # The WebSocket lane that emitted this event. This field is present when the
1906
+ # originating `response.create` event supplied a `stream_id`.
1907
+ sig { returns(T.nilable(String)) }
1908
+ attr_reader :stream_id
1909
+
1910
+ sig { params(stream_id: String).void }
1911
+ attr_writer :stream_id
1912
+
1913
+ # Emitted when a delta is added to a reasoning summary text.
1914
+ sig do
1915
+ params(
1916
+ delta: String,
1917
+ item_id: String,
1918
+ output_index: Integer,
1919
+ sequence_number: Integer,
1920
+ summary_index: Integer,
1921
+ agent:
1922
+ T.nilable(
1923
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDeltaEvent::Agent::OrHash
1924
+ ),
1925
+ type: Symbol,
1926
+ stream_id: String
1927
+ ).returns(T.attached_class)
1928
+ end
1929
+ def self.new(
1930
+ # The text delta that was added to the summary.
1931
+ delta:,
1932
+ # The ID of the item this summary text delta is associated with.
1933
+ item_id:,
1934
+ # The index of the output item this summary text delta is associated with.
1935
+ output_index:,
1936
+ # The sequence number of this event.
1937
+ sequence_number:,
1938
+ # The index of the summary part within the reasoning summary.
1939
+ summary_index:,
1940
+ # The agent that owns this multi-agent streaming event.
1941
+ agent: nil,
1942
+ # The type of the event. Always `response.reasoning_summary_text.delta`.
1943
+ type: :"response.reasoning_summary_text.delta",
1944
+ # The WebSocket lane that emitted this event.
1945
+ # This field is present when the originating response.create supplied a stream_id.
1946
+ stream_id: nil
1947
+ )
1948
+ end
1949
+
1950
+ sig do
1951
+ override.returns(
1952
+ {
1953
+ delta: String,
1954
+ item_id: String,
1955
+ output_index: Integer,
1956
+ sequence_number: Integer,
1957
+ summary_index: Integer,
1958
+ type: Symbol,
1959
+ agent:
1960
+ T.nilable(
1961
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDeltaEvent::Agent
1962
+ ),
1963
+ stream_id: String
1964
+ }
1965
+ )
1966
+ end
1967
+ def to_hash
1968
+ end
1969
+ end
1970
+
1971
+ class BetaResponseReasoningSummaryTextWsDone < OpenAI::Models::Beta::BetaResponseReasoningSummaryTextDoneEvent
1972
+ OrHash =
1973
+ T.type_alias do
1974
+ T.any(
1975
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryTextWsDone,
1976
+ OpenAI::Internal::AnyHash
1977
+ )
1978
+ end
1979
+
1980
+ # The WebSocket lane that emitted this event. This field is present when the
1981
+ # originating `response.create` event supplied a `stream_id`.
1982
+ sig { returns(T.nilable(String)) }
1983
+ attr_reader :stream_id
1984
+
1985
+ sig { params(stream_id: String).void }
1986
+ attr_writer :stream_id
1987
+
1988
+ # Emitted when a reasoning summary text is completed.
1989
+ sig do
1990
+ params(
1991
+ item_id: String,
1992
+ output_index: Integer,
1993
+ sequence_number: Integer,
1994
+ summary_index: Integer,
1995
+ text: String,
1996
+ agent:
1997
+ T.nilable(
1998
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDoneEvent::Agent::OrHash
1999
+ ),
2000
+ type: Symbol,
2001
+ stream_id: String
2002
+ ).returns(T.attached_class)
2003
+ end
2004
+ def self.new(
2005
+ # The ID of the item this summary text is associated with.
2006
+ item_id:,
2007
+ # The index of the output item this summary text is associated with.
2008
+ output_index:,
2009
+ # The sequence number of this event.
2010
+ sequence_number:,
2011
+ # The index of the summary part within the reasoning summary.
2012
+ summary_index:,
2013
+ # The full text of the completed reasoning summary.
2014
+ text:,
2015
+ # The agent that owns this multi-agent streaming event.
2016
+ agent: nil,
2017
+ # The type of the event. Always `response.reasoning_summary_text.done`.
2018
+ type: :"response.reasoning_summary_text.done",
2019
+ # The WebSocket lane that emitted this event.
2020
+ # This field is present when the originating response.create supplied a stream_id.
2021
+ stream_id: nil
2022
+ )
2023
+ end
2024
+
2025
+ sig do
2026
+ override.returns(
2027
+ {
2028
+ item_id: String,
2029
+ output_index: Integer,
2030
+ sequence_number: Integer,
2031
+ summary_index: Integer,
2032
+ text: String,
2033
+ type: Symbol,
2034
+ agent:
2035
+ T.nilable(
2036
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDoneEvent::Agent
2037
+ ),
2038
+ stream_id: String
2039
+ }
2040
+ )
2041
+ end
2042
+ def to_hash
2043
+ end
2044
+ end
2045
+
2046
+ class BetaResponseReasoningTextWsDelta < OpenAI::Models::Beta::BetaResponseReasoningTextDeltaEvent
2047
+ OrHash =
2048
+ T.type_alias do
2049
+ T.any(
2050
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningTextWsDelta,
2051
+ OpenAI::Internal::AnyHash
2052
+ )
2053
+ end
2054
+
2055
+ # The WebSocket lane that emitted this event. This field is present when the
2056
+ # originating `response.create` event supplied a `stream_id`.
2057
+ sig { returns(T.nilable(String)) }
2058
+ attr_reader :stream_id
2059
+
2060
+ sig { params(stream_id: String).void }
2061
+ attr_writer :stream_id
2062
+
2063
+ # Emitted when a delta is added to a reasoning text.
2064
+ sig do
2065
+ params(
2066
+ content_index: Integer,
2067
+ delta: String,
2068
+ item_id: String,
2069
+ output_index: Integer,
2070
+ sequence_number: Integer,
2071
+ agent:
2072
+ T.nilable(
2073
+ OpenAI::Beta::BetaResponseReasoningTextDeltaEvent::Agent::OrHash
2074
+ ),
2075
+ type: Symbol,
2076
+ stream_id: String
2077
+ ).returns(T.attached_class)
2078
+ end
2079
+ def self.new(
2080
+ # The index of the reasoning content part this delta is associated with.
2081
+ content_index:,
2082
+ # The text delta that was added to the reasoning content.
2083
+ delta:,
2084
+ # The ID of the item this reasoning text delta is associated with.
2085
+ item_id:,
2086
+ # The index of the output item this reasoning text delta is associated with.
2087
+ output_index:,
2088
+ # The sequence number of this event.
2089
+ sequence_number:,
2090
+ # The agent that owns this multi-agent streaming event.
2091
+ agent: nil,
2092
+ # The type of the event. Always `response.reasoning_text.delta`.
2093
+ type: :"response.reasoning_text.delta",
2094
+ # The WebSocket lane that emitted this event.
2095
+ # This field is present when the originating response.create supplied a stream_id.
2096
+ stream_id: nil
2097
+ )
2098
+ end
2099
+
2100
+ sig do
2101
+ override.returns(
2102
+ {
2103
+ content_index: Integer,
2104
+ delta: String,
2105
+ item_id: String,
2106
+ output_index: Integer,
2107
+ sequence_number: Integer,
2108
+ type: Symbol,
2109
+ agent:
2110
+ T.nilable(
2111
+ OpenAI::Beta::BetaResponseReasoningTextDeltaEvent::Agent
2112
+ ),
2113
+ stream_id: String
2114
+ }
2115
+ )
2116
+ end
2117
+ def to_hash
2118
+ end
2119
+ end
2120
+
2121
+ class BetaResponseReasoningTextWsDone < OpenAI::Models::Beta::BetaResponseReasoningTextDoneEvent
2122
+ OrHash =
2123
+ T.type_alias do
2124
+ T.any(
2125
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningTextWsDone,
2126
+ OpenAI::Internal::AnyHash
2127
+ )
2128
+ end
2129
+
2130
+ # The WebSocket lane that emitted this event. This field is present when the
2131
+ # originating `response.create` event supplied a `stream_id`.
2132
+ sig { returns(T.nilable(String)) }
2133
+ attr_reader :stream_id
2134
+
2135
+ sig { params(stream_id: String).void }
2136
+ attr_writer :stream_id
2137
+
2138
+ # Emitted when a reasoning text is completed.
2139
+ sig do
2140
+ params(
2141
+ content_index: Integer,
2142
+ item_id: String,
2143
+ output_index: Integer,
2144
+ sequence_number: Integer,
2145
+ text: String,
2146
+ agent:
2147
+ T.nilable(
2148
+ OpenAI::Beta::BetaResponseReasoningTextDoneEvent::Agent::OrHash
2149
+ ),
2150
+ type: Symbol,
2151
+ stream_id: String
2152
+ ).returns(T.attached_class)
2153
+ end
2154
+ def self.new(
2155
+ # The index of the reasoning content part.
2156
+ content_index:,
2157
+ # The ID of the item this reasoning text is associated with.
2158
+ item_id:,
2159
+ # The index of the output item this reasoning text is associated with.
2160
+ output_index:,
2161
+ # The sequence number of this event.
2162
+ sequence_number:,
2163
+ # The full text of the completed reasoning content.
2164
+ text:,
2165
+ # The agent that owns this multi-agent streaming event.
2166
+ agent: nil,
2167
+ # The type of the event. Always `response.reasoning_text.done`.
2168
+ type: :"response.reasoning_text.done",
2169
+ # The WebSocket lane that emitted this event.
2170
+ # This field is present when the originating response.create supplied a stream_id.
2171
+ stream_id: nil
2172
+ )
2173
+ end
2174
+
2175
+ sig do
2176
+ override.returns(
2177
+ {
2178
+ content_index: Integer,
2179
+ item_id: String,
2180
+ output_index: Integer,
2181
+ sequence_number: Integer,
2182
+ text: String,
2183
+ type: Symbol,
2184
+ agent:
2185
+ T.nilable(
2186
+ OpenAI::Beta::BetaResponseReasoningTextDoneEvent::Agent
2187
+ ),
2188
+ stream_id: String
2189
+ }
2190
+ )
2191
+ end
2192
+ def to_hash
2193
+ end
2194
+ end
2195
+
2196
+ class BetaResponseRefusalWsDelta < OpenAI::Models::Beta::BetaResponseRefusalDeltaEvent
2197
+ OrHash =
2198
+ T.type_alias do
2199
+ T.any(
2200
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseRefusalWsDelta,
2201
+ OpenAI::Internal::AnyHash
2202
+ )
2203
+ end
2204
+
2205
+ # The WebSocket lane that emitted this event. This field is present when the
2206
+ # originating `response.create` event supplied a `stream_id`.
2207
+ sig { returns(T.nilable(String)) }
2208
+ attr_reader :stream_id
2209
+
2210
+ sig { params(stream_id: String).void }
2211
+ attr_writer :stream_id
2212
+
2213
+ # Emitted when there is a partial refusal text.
2214
+ sig do
2215
+ params(
2216
+ content_index: Integer,
2217
+ delta: String,
2218
+ item_id: String,
2219
+ output_index: Integer,
2220
+ sequence_number: Integer,
2221
+ agent:
2222
+ T.nilable(
2223
+ OpenAI::Beta::BetaResponseRefusalDeltaEvent::Agent::OrHash
2224
+ ),
2225
+ type: Symbol,
2226
+ stream_id: String
2227
+ ).returns(T.attached_class)
2228
+ end
2229
+ def self.new(
2230
+ # The index of the content part that the refusal text is added to.
2231
+ content_index:,
2232
+ # The refusal text that is added.
2233
+ delta:,
2234
+ # The ID of the output item that the refusal text is added to.
2235
+ item_id:,
2236
+ # The index of the output item that the refusal text is added to.
2237
+ output_index:,
2238
+ # The sequence number of this event.
2239
+ sequence_number:,
2240
+ # The agent that owns this multi-agent streaming event.
2241
+ agent: nil,
2242
+ # The type of the event. Always `response.refusal.delta`.
2243
+ type: :"response.refusal.delta",
2244
+ # The WebSocket lane that emitted this event.
2245
+ # This field is present when the originating response.create supplied a stream_id.
2246
+ stream_id: nil
2247
+ )
2248
+ end
2249
+
2250
+ sig do
2251
+ override.returns(
2252
+ {
2253
+ content_index: Integer,
2254
+ delta: String,
2255
+ item_id: String,
2256
+ output_index: Integer,
2257
+ sequence_number: Integer,
2258
+ type: Symbol,
2259
+ agent:
2260
+ T.nilable(OpenAI::Beta::BetaResponseRefusalDeltaEvent::Agent),
2261
+ stream_id: String
2262
+ }
2263
+ )
2264
+ end
2265
+ def to_hash
2266
+ end
2267
+ end
2268
+
2269
+ class BetaResponseRefusalWsDone < OpenAI::Models::Beta::BetaResponseRefusalDoneEvent
2270
+ OrHash =
2271
+ T.type_alias do
2272
+ T.any(
2273
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseRefusalWsDone,
2274
+ OpenAI::Internal::AnyHash
2275
+ )
2276
+ end
2277
+
2278
+ # The WebSocket lane that emitted this event. This field is present when the
2279
+ # originating `response.create` event supplied a `stream_id`.
2280
+ sig { returns(T.nilable(String)) }
2281
+ attr_reader :stream_id
2282
+
2283
+ sig { params(stream_id: String).void }
2284
+ attr_writer :stream_id
2285
+
2286
+ # Emitted when refusal text is finalized.
2287
+ sig do
2288
+ params(
2289
+ content_index: Integer,
2290
+ item_id: String,
2291
+ output_index: Integer,
2292
+ refusal: String,
2293
+ sequence_number: Integer,
2294
+ agent:
2295
+ T.nilable(
2296
+ OpenAI::Beta::BetaResponseRefusalDoneEvent::Agent::OrHash
2297
+ ),
2298
+ type: Symbol,
2299
+ stream_id: String
2300
+ ).returns(T.attached_class)
2301
+ end
2302
+ def self.new(
2303
+ # The index of the content part that the refusal text is finalized.
2304
+ content_index:,
2305
+ # The ID of the output item that the refusal text is finalized.
2306
+ item_id:,
2307
+ # The index of the output item that the refusal text is finalized.
2308
+ output_index:,
2309
+ # The refusal text that is finalized.
2310
+ refusal:,
2311
+ # The sequence number of this event.
2312
+ sequence_number:,
2313
+ # The agent that owns this multi-agent streaming event.
2314
+ agent: nil,
2315
+ # The type of the event. Always `response.refusal.done`.
2316
+ type: :"response.refusal.done",
2317
+ # The WebSocket lane that emitted this event.
2318
+ # This field is present when the originating response.create supplied a stream_id.
2319
+ stream_id: nil
2320
+ )
2321
+ end
2322
+
2323
+ sig do
2324
+ override.returns(
2325
+ {
2326
+ content_index: Integer,
2327
+ item_id: String,
2328
+ output_index: Integer,
2329
+ refusal: String,
2330
+ sequence_number: Integer,
2331
+ type: Symbol,
2332
+ agent:
2333
+ T.nilable(OpenAI::Beta::BetaResponseRefusalDoneEvent::Agent),
2334
+ stream_id: String
2335
+ }
2336
+ )
2337
+ end
2338
+ def to_hash
2339
+ end
2340
+ end
2341
+
2342
+ class BetaResponseTextWsDelta < OpenAI::Models::Beta::BetaResponseTextDeltaEvent
2343
+ OrHash =
2344
+ T.type_alias do
2345
+ T.any(
2346
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseTextWsDelta,
2347
+ OpenAI::Internal::AnyHash
2348
+ )
2349
+ end
2350
+
2351
+ # The WebSocket lane that emitted this event. This field is present when the
2352
+ # originating `response.create` event supplied a `stream_id`.
2353
+ sig { returns(T.nilable(String)) }
2354
+ attr_reader :stream_id
2355
+
2356
+ sig { params(stream_id: String).void }
2357
+ attr_writer :stream_id
2358
+
2359
+ # Emitted when there is an additional text delta.
2360
+ sig do
2361
+ params(
2362
+ content_index: Integer,
2363
+ delta: String,
2364
+ item_id: String,
2365
+ logprobs:
2366
+ T::Array[
2367
+ OpenAI::Beta::BetaResponseTextDeltaEvent::Logprob::OrHash
2368
+ ],
2369
+ output_index: Integer,
2370
+ sequence_number: Integer,
2371
+ agent:
2372
+ T.nilable(
2373
+ OpenAI::Beta::BetaResponseTextDeltaEvent::Agent::OrHash
2374
+ ),
2375
+ type: Symbol,
2376
+ stream_id: String
2377
+ ).returns(T.attached_class)
2378
+ end
2379
+ def self.new(
2380
+ # The index of the content part that the text delta was added to.
2381
+ content_index:,
2382
+ # The text delta that was added.
2383
+ delta:,
2384
+ # The ID of the output item that the text delta was added to.
2385
+ item_id:,
2386
+ # The log probabilities of the tokens in the delta.
2387
+ logprobs:,
2388
+ # The index of the output item that the text delta was added to.
2389
+ output_index:,
2390
+ # The sequence number for this event.
2391
+ sequence_number:,
2392
+ # The agent that owns this multi-agent streaming event.
2393
+ agent: nil,
2394
+ # The type of the event. Always `response.output_text.delta`.
2395
+ type: :"response.output_text.delta",
2396
+ # The WebSocket lane that emitted this event.
2397
+ # This field is present when the originating response.create supplied a stream_id.
2398
+ stream_id: nil
2399
+ )
2400
+ end
2401
+
2402
+ sig do
2403
+ override.returns(
2404
+ {
2405
+ content_index: Integer,
2406
+ delta: String,
2407
+ item_id: String,
2408
+ logprobs:
2409
+ T::Array[OpenAI::Beta::BetaResponseTextDeltaEvent::Logprob],
2410
+ output_index: Integer,
2411
+ sequence_number: Integer,
2412
+ type: Symbol,
2413
+ agent:
2414
+ T.nilable(OpenAI::Beta::BetaResponseTextDeltaEvent::Agent),
2415
+ stream_id: String
2416
+ }
2417
+ )
2418
+ end
2419
+ def to_hash
2420
+ end
2421
+ end
2422
+
2423
+ class BetaResponseTextWsDone < OpenAI::Models::Beta::BetaResponseTextDoneEvent
2424
+ OrHash =
2425
+ T.type_alias do
2426
+ T.any(
2427
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseTextWsDone,
2428
+ OpenAI::Internal::AnyHash
2429
+ )
2430
+ end
2431
+
2432
+ # The WebSocket lane that emitted this event. This field is present when the
2433
+ # originating `response.create` event supplied a `stream_id`.
2434
+ sig { returns(T.nilable(String)) }
2435
+ attr_reader :stream_id
2436
+
2437
+ sig { params(stream_id: String).void }
2438
+ attr_writer :stream_id
2439
+
2440
+ # Emitted when text content is finalized.
2441
+ sig do
2442
+ params(
2443
+ content_index: Integer,
2444
+ item_id: String,
2445
+ logprobs:
2446
+ T::Array[
2447
+ OpenAI::Beta::BetaResponseTextDoneEvent::Logprob::OrHash
2448
+ ],
2449
+ output_index: Integer,
2450
+ sequence_number: Integer,
2451
+ text: String,
2452
+ agent:
2453
+ T.nilable(
2454
+ OpenAI::Beta::BetaResponseTextDoneEvent::Agent::OrHash
2455
+ ),
2456
+ type: Symbol,
2457
+ stream_id: String
2458
+ ).returns(T.attached_class)
2459
+ end
2460
+ def self.new(
2461
+ # The index of the content part that the text content is finalized.
2462
+ content_index:,
2463
+ # The ID of the output item that the text content is finalized.
2464
+ item_id:,
2465
+ # The log probabilities of the tokens in the delta.
2466
+ logprobs:,
2467
+ # The index of the output item that the text content is finalized.
2468
+ output_index:,
2469
+ # The sequence number for this event.
2470
+ sequence_number:,
2471
+ # The text content that is finalized.
2472
+ text:,
2473
+ # The agent that owns this multi-agent streaming event.
2474
+ agent: nil,
2475
+ # The type of the event. Always `response.output_text.done`.
2476
+ type: :"response.output_text.done",
2477
+ # The WebSocket lane that emitted this event.
2478
+ # This field is present when the originating response.create supplied a stream_id.
2479
+ stream_id: nil
2480
+ )
2481
+ end
2482
+
2483
+ sig do
2484
+ override.returns(
2485
+ {
2486
+ content_index: Integer,
2487
+ item_id: String,
2488
+ logprobs:
2489
+ T::Array[OpenAI::Beta::BetaResponseTextDoneEvent::Logprob],
2490
+ output_index: Integer,
2491
+ sequence_number: Integer,
2492
+ text: String,
2493
+ type: Symbol,
2494
+ agent:
2495
+ T.nilable(OpenAI::Beta::BetaResponseTextDoneEvent::Agent),
2496
+ stream_id: String
2497
+ }
2498
+ )
2499
+ end
2500
+ def to_hash
2501
+ end
2502
+ end
2503
+
2504
+ class BetaResponseWebSearchCallWsCompleted < OpenAI::Models::Beta::BetaResponseWebSearchCallCompletedEvent
2505
+ OrHash =
2506
+ T.type_alias do
2507
+ T.any(
2508
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallWsCompleted,
2509
+ OpenAI::Internal::AnyHash
2510
+ )
2511
+ end
2512
+
2513
+ # The WebSocket lane that emitted this event. This field is present when the
2514
+ # originating `response.create` event supplied a `stream_id`.
2515
+ sig { returns(T.nilable(String)) }
2516
+ attr_reader :stream_id
2517
+
2518
+ sig { params(stream_id: String).void }
2519
+ attr_writer :stream_id
2520
+
2521
+ # Emitted when a web search call is completed.
2522
+ sig do
2523
+ params(
2524
+ item_id: String,
2525
+ output_index: Integer,
2526
+ sequence_number: Integer,
2527
+ agent:
2528
+ T.nilable(
2529
+ OpenAI::Beta::BetaResponseWebSearchCallCompletedEvent::Agent::OrHash
2530
+ ),
2531
+ type: Symbol,
2532
+ stream_id: String
2533
+ ).returns(T.attached_class)
2534
+ end
2535
+ def self.new(
2536
+ # Unique ID for the output item associated with the web search call.
2537
+ item_id:,
2538
+ # The index of the output item that the web search call is associated with.
2539
+ output_index:,
2540
+ # The sequence number of the web search call being processed.
2541
+ sequence_number:,
2542
+ # The agent that owns this multi-agent streaming event.
2543
+ agent: nil,
2544
+ # The type of the event. Always `response.web_search_call.completed`.
2545
+ type: :"response.web_search_call.completed",
2546
+ # The WebSocket lane that emitted this event.
2547
+ # This field is present when the originating response.create supplied a stream_id.
2548
+ stream_id: nil
2549
+ )
2550
+ end
2551
+
2552
+ sig do
2553
+ override.returns(
2554
+ {
2555
+ item_id: String,
2556
+ output_index: Integer,
2557
+ sequence_number: Integer,
2558
+ type: Symbol,
2559
+ agent:
2560
+ T.nilable(
2561
+ OpenAI::Beta::BetaResponseWebSearchCallCompletedEvent::Agent
2562
+ ),
2563
+ stream_id: String
2564
+ }
2565
+ )
2566
+ end
2567
+ def to_hash
2568
+ end
2569
+ end
2570
+
2571
+ class BetaResponseWebSearchCallInWsProgress < OpenAI::Models::Beta::BetaResponseWebSearchCallInProgressEvent
2572
+ OrHash =
2573
+ T.type_alias do
2574
+ T.any(
2575
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallInWsProgress,
2576
+ OpenAI::Internal::AnyHash
2577
+ )
2578
+ end
2579
+
2580
+ # The WebSocket lane that emitted this event. This field is present when the
2581
+ # originating `response.create` event supplied a `stream_id`.
2582
+ sig { returns(T.nilable(String)) }
2583
+ attr_reader :stream_id
2584
+
2585
+ sig { params(stream_id: String).void }
2586
+ attr_writer :stream_id
2587
+
2588
+ # Emitted when a web search call is initiated.
2589
+ sig do
2590
+ params(
2591
+ item_id: String,
2592
+ output_index: Integer,
2593
+ sequence_number: Integer,
2594
+ agent:
2595
+ T.nilable(
2596
+ OpenAI::Beta::BetaResponseWebSearchCallInProgressEvent::Agent::OrHash
2597
+ ),
2598
+ type: Symbol,
2599
+ stream_id: String
2600
+ ).returns(T.attached_class)
2601
+ end
2602
+ def self.new(
2603
+ # Unique ID for the output item associated with the web search call.
2604
+ item_id:,
2605
+ # The index of the output item that the web search call is associated with.
2606
+ output_index:,
2607
+ # The sequence number of the web search call being processed.
2608
+ sequence_number:,
2609
+ # The agent that owns this multi-agent streaming event.
2610
+ agent: nil,
2611
+ # The type of the event. Always `response.web_search_call.in_progress`.
2612
+ type: :"response.web_search_call.in_progress",
2613
+ # The WebSocket lane that emitted this event.
2614
+ # This field is present when the originating response.create supplied a stream_id.
2615
+ stream_id: nil
2616
+ )
2617
+ end
2618
+
2619
+ sig do
2620
+ override.returns(
2621
+ {
2622
+ item_id: String,
2623
+ output_index: Integer,
2624
+ sequence_number: Integer,
2625
+ type: Symbol,
2626
+ agent:
2627
+ T.nilable(
2628
+ OpenAI::Beta::BetaResponseWebSearchCallInProgressEvent::Agent
2629
+ ),
2630
+ stream_id: String
2631
+ }
2632
+ )
2633
+ end
2634
+ def to_hash
2635
+ end
2636
+ end
2637
+
2638
+ class BetaResponseWebSearchCallWsSearching < OpenAI::Models::Beta::BetaResponseWebSearchCallSearchingEvent
2639
+ OrHash =
2640
+ T.type_alias do
2641
+ T.any(
2642
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallWsSearching,
2643
+ OpenAI::Internal::AnyHash
2644
+ )
2645
+ end
2646
+
2647
+ # The WebSocket lane that emitted this event. This field is present when the
2648
+ # originating `response.create` event supplied a `stream_id`.
2649
+ sig { returns(T.nilable(String)) }
2650
+ attr_reader :stream_id
2651
+
2652
+ sig { params(stream_id: String).void }
2653
+ attr_writer :stream_id
2654
+
2655
+ # Emitted when a web search call is executing.
2656
+ sig do
2657
+ params(
2658
+ item_id: String,
2659
+ output_index: Integer,
2660
+ sequence_number: Integer,
2661
+ agent:
2662
+ T.nilable(
2663
+ OpenAI::Beta::BetaResponseWebSearchCallSearchingEvent::Agent::OrHash
2664
+ ),
2665
+ type: Symbol,
2666
+ stream_id: String
2667
+ ).returns(T.attached_class)
2668
+ end
2669
+ def self.new(
2670
+ # Unique ID for the output item associated with the web search call.
2671
+ item_id:,
2672
+ # The index of the output item that the web search call is associated with.
2673
+ output_index:,
2674
+ # The sequence number of the web search call being processed.
2675
+ sequence_number:,
2676
+ # The agent that owns this multi-agent streaming event.
2677
+ agent: nil,
2678
+ # The type of the event. Always `response.web_search_call.searching`.
2679
+ type: :"response.web_search_call.searching",
2680
+ # The WebSocket lane that emitted this event.
2681
+ # This field is present when the originating response.create supplied a stream_id.
2682
+ stream_id: nil
2683
+ )
2684
+ end
2685
+
2686
+ sig do
2687
+ override.returns(
2688
+ {
2689
+ item_id: String,
2690
+ output_index: Integer,
2691
+ sequence_number: Integer,
2692
+ type: Symbol,
2693
+ agent:
2694
+ T.nilable(
2695
+ OpenAI::Beta::BetaResponseWebSearchCallSearchingEvent::Agent
2696
+ ),
2697
+ stream_id: String
2698
+ }
2699
+ )
2700
+ end
2701
+ def to_hash
2702
+ end
2703
+ end
2704
+
2705
+ class BetaResponseImageGenCallWsCompleted < OpenAI::Models::Beta::BetaResponseImageGenCallCompletedEvent
2706
+ OrHash =
2707
+ T.type_alias do
2708
+ T.any(
2709
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallWsCompleted,
2710
+ OpenAI::Internal::AnyHash
2711
+ )
2712
+ end
2713
+
2714
+ # The WebSocket lane that emitted this event. This field is present when the
2715
+ # originating `response.create` event supplied a `stream_id`.
2716
+ sig { returns(T.nilable(String)) }
2717
+ attr_reader :stream_id
2718
+
2719
+ sig { params(stream_id: String).void }
2720
+ attr_writer :stream_id
2721
+
2722
+ # Emitted when an image generation tool call has completed and the final image is
2723
+ # available.
2724
+ sig do
2725
+ params(
2726
+ item_id: String,
2727
+ output_index: Integer,
2728
+ sequence_number: Integer,
2729
+ agent:
2730
+ T.nilable(
2731
+ OpenAI::Beta::BetaResponseImageGenCallCompletedEvent::Agent::OrHash
2732
+ ),
2733
+ type: Symbol,
2734
+ stream_id: String
2735
+ ).returns(T.attached_class)
2736
+ end
2737
+ def self.new(
2738
+ # The unique identifier of the image generation item being processed.
2739
+ item_id:,
2740
+ # The index of the output item in the response's output array.
2741
+ output_index:,
2742
+ # The sequence number of this event.
2743
+ sequence_number:,
2744
+ # The agent that owns this multi-agent streaming event.
2745
+ agent: nil,
2746
+ # The type of the event. Always 'response.image_generation_call.completed'.
2747
+ type: :"response.image_generation_call.completed",
2748
+ # The WebSocket lane that emitted this event.
2749
+ # This field is present when the originating response.create supplied a stream_id.
2750
+ stream_id: nil
2751
+ )
2752
+ end
2753
+
2754
+ sig do
2755
+ override.returns(
2756
+ {
2757
+ item_id: String,
2758
+ output_index: Integer,
2759
+ sequence_number: Integer,
2760
+ type: Symbol,
2761
+ agent:
2762
+ T.nilable(
2763
+ OpenAI::Beta::BetaResponseImageGenCallCompletedEvent::Agent
2764
+ ),
2765
+ stream_id: String
2766
+ }
2767
+ )
2768
+ end
2769
+ def to_hash
2770
+ end
2771
+ end
2772
+
2773
+ class BetaResponseImageGenCallWsGenerating < OpenAI::Models::Beta::BetaResponseImageGenCallGeneratingEvent
2774
+ OrHash =
2775
+ T.type_alias do
2776
+ T.any(
2777
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallWsGenerating,
2778
+ OpenAI::Internal::AnyHash
2779
+ )
2780
+ end
2781
+
2782
+ # The WebSocket lane that emitted this event. This field is present when the
2783
+ # originating `response.create` event supplied a `stream_id`.
2784
+ sig { returns(T.nilable(String)) }
2785
+ attr_reader :stream_id
2786
+
2787
+ sig { params(stream_id: String).void }
2788
+ attr_writer :stream_id
2789
+
2790
+ # Emitted when an image generation tool call is actively generating an image
2791
+ # (intermediate state).
2792
+ sig do
2793
+ params(
2794
+ item_id: String,
2795
+ output_index: Integer,
2796
+ sequence_number: Integer,
2797
+ agent:
2798
+ T.nilable(
2799
+ OpenAI::Beta::BetaResponseImageGenCallGeneratingEvent::Agent::OrHash
2800
+ ),
2801
+ type: Symbol,
2802
+ stream_id: String
2803
+ ).returns(T.attached_class)
2804
+ end
2805
+ def self.new(
2806
+ # The unique identifier of the image generation item being processed.
2807
+ item_id:,
2808
+ # The index of the output item in the response's output array.
2809
+ output_index:,
2810
+ # The sequence number of the image generation item being processed.
2811
+ sequence_number:,
2812
+ # The agent that owns this multi-agent streaming event.
2813
+ agent: nil,
2814
+ # The type of the event. Always 'response.image_generation_call.generating'.
2815
+ type: :"response.image_generation_call.generating",
2816
+ # The WebSocket lane that emitted this event.
2817
+ # This field is present when the originating response.create supplied a stream_id.
2818
+ stream_id: nil
2819
+ )
2820
+ end
2821
+
2822
+ sig do
2823
+ override.returns(
2824
+ {
2825
+ item_id: String,
2826
+ output_index: Integer,
2827
+ sequence_number: Integer,
2828
+ type: Symbol,
2829
+ agent:
2830
+ T.nilable(
2831
+ OpenAI::Beta::BetaResponseImageGenCallGeneratingEvent::Agent
2832
+ ),
2833
+ stream_id: String
2834
+ }
2835
+ )
2836
+ end
2837
+ def to_hash
2838
+ end
2839
+ end
2840
+
2841
+ class BetaResponseImageGenCallInWsProgress < OpenAI::Models::Beta::BetaResponseImageGenCallInProgressEvent
2842
+ OrHash =
2843
+ T.type_alias do
2844
+ T.any(
2845
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallInWsProgress,
2846
+ OpenAI::Internal::AnyHash
2847
+ )
2848
+ end
2849
+
2850
+ # The WebSocket lane that emitted this event. This field is present when the
2851
+ # originating `response.create` event supplied a `stream_id`.
2852
+ sig { returns(T.nilable(String)) }
2853
+ attr_reader :stream_id
2854
+
2855
+ sig { params(stream_id: String).void }
2856
+ attr_writer :stream_id
2857
+
2858
+ # Emitted when an image generation tool call is in progress.
2859
+ sig do
2860
+ params(
2861
+ item_id: String,
2862
+ output_index: Integer,
2863
+ sequence_number: Integer,
2864
+ agent:
2865
+ T.nilable(
2866
+ OpenAI::Beta::BetaResponseImageGenCallInProgressEvent::Agent::OrHash
2867
+ ),
2868
+ type: Symbol,
2869
+ stream_id: String
2870
+ ).returns(T.attached_class)
2871
+ end
2872
+ def self.new(
2873
+ # The unique identifier of the image generation item being processed.
2874
+ item_id:,
2875
+ # The index of the output item in the response's output array.
2876
+ output_index:,
2877
+ # The sequence number of the image generation item being processed.
2878
+ sequence_number:,
2879
+ # The agent that owns this multi-agent streaming event.
2880
+ agent: nil,
2881
+ # The type of the event. Always 'response.image_generation_call.in_progress'.
2882
+ type: :"response.image_generation_call.in_progress",
2883
+ # The WebSocket lane that emitted this event.
2884
+ # This field is present when the originating response.create supplied a stream_id.
2885
+ stream_id: nil
2886
+ )
2887
+ end
2888
+
2889
+ sig do
2890
+ override.returns(
2891
+ {
2892
+ item_id: String,
2893
+ output_index: Integer,
2894
+ sequence_number: Integer,
2895
+ type: Symbol,
2896
+ agent:
2897
+ T.nilable(
2898
+ OpenAI::Beta::BetaResponseImageGenCallInProgressEvent::Agent
2899
+ ),
2900
+ stream_id: String
2901
+ }
2902
+ )
2903
+ end
2904
+ def to_hash
2905
+ end
2906
+ end
2907
+
2908
+ class BetaResponseImageGenCallPartialWsImage < OpenAI::Models::Beta::BetaResponseImageGenCallPartialImageEvent
2909
+ OrHash =
2910
+ T.type_alias do
2911
+ T.any(
2912
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallPartialWsImage,
2913
+ OpenAI::Internal::AnyHash
2914
+ )
2915
+ end
2916
+
2917
+ # The WebSocket lane that emitted this event. This field is present when the
2918
+ # originating `response.create` event supplied a `stream_id`.
2919
+ sig { returns(T.nilable(String)) }
2920
+ attr_reader :stream_id
2921
+
2922
+ sig { params(stream_id: String).void }
2923
+ attr_writer :stream_id
2924
+
2925
+ # Emitted when a partial image is available during image generation streaming.
2926
+ sig do
2927
+ params(
2928
+ item_id: String,
2929
+ output_index: Integer,
2930
+ partial_image_b64: String,
2931
+ partial_image_index: Integer,
2932
+ sequence_number: Integer,
2933
+ agent:
2934
+ T.nilable(
2935
+ OpenAI::Beta::BetaResponseImageGenCallPartialImageEvent::Agent::OrHash
2936
+ ),
2937
+ type: Symbol,
2938
+ stream_id: String
2939
+ ).returns(T.attached_class)
2940
+ end
2941
+ def self.new(
2942
+ # The unique identifier of the image generation item being processed.
2943
+ item_id:,
2944
+ # The index of the output item in the response's output array.
2945
+ output_index:,
2946
+ # Base64-encoded partial image data, suitable for rendering as an image.
2947
+ partial_image_b64:,
2948
+ # 0-based index for the partial image (backend is 1-based, but this is 0-based for
2949
+ # the user).
2950
+ partial_image_index:,
2951
+ # The sequence number of the image generation item being processed.
2952
+ sequence_number:,
2953
+ # The agent that owns this multi-agent streaming event.
2954
+ agent: nil,
2955
+ # The type of the event. Always 'response.image_generation_call.partial_image'.
2956
+ type: :"response.image_generation_call.partial_image",
2957
+ # The WebSocket lane that emitted this event.
2958
+ # This field is present when the originating response.create supplied a stream_id.
2959
+ stream_id: nil
2960
+ )
2961
+ end
2962
+
2963
+ sig do
2964
+ override.returns(
2965
+ {
2966
+ item_id: String,
2967
+ output_index: Integer,
2968
+ partial_image_b64: String,
2969
+ partial_image_index: Integer,
2970
+ sequence_number: Integer,
2971
+ type: Symbol,
2972
+ agent:
2973
+ T.nilable(
2974
+ OpenAI::Beta::BetaResponseImageGenCallPartialImageEvent::Agent
2975
+ ),
2976
+ stream_id: String
2977
+ }
2978
+ )
2979
+ end
2980
+ def to_hash
2981
+ end
2982
+ end
2983
+
2984
+ class BetaResponseMcpCallArgumentsWsDelta < OpenAI::Models::Beta::BetaResponseMcpCallArgumentsDeltaEvent
2985
+ OrHash =
2986
+ T.type_alias do
2987
+ T.any(
2988
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallArgumentsWsDelta,
2989
+ OpenAI::Internal::AnyHash
2990
+ )
2991
+ end
2992
+
2993
+ # The WebSocket lane that emitted this event. This field is present when the
2994
+ # originating `response.create` event supplied a `stream_id`.
2995
+ sig { returns(T.nilable(String)) }
2996
+ attr_reader :stream_id
2997
+
2998
+ sig { params(stream_id: String).void }
2999
+ attr_writer :stream_id
3000
+
3001
+ # Emitted when there is a delta (partial update) to the arguments of an MCP tool
3002
+ # call.
3003
+ sig do
3004
+ params(
3005
+ delta: String,
3006
+ item_id: String,
3007
+ output_index: Integer,
3008
+ sequence_number: Integer,
3009
+ agent:
3010
+ T.nilable(
3011
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDeltaEvent::Agent::OrHash
3012
+ ),
3013
+ type: Symbol,
3014
+ stream_id: String
3015
+ ).returns(T.attached_class)
3016
+ end
3017
+ def self.new(
3018
+ # A JSON string containing the partial update to the arguments for the MCP tool
3019
+ # call.
3020
+ delta:,
3021
+ # The unique identifier of the MCP tool call item being processed.
3022
+ item_id:,
3023
+ # The index of the output item in the response's output array.
3024
+ output_index:,
3025
+ # The sequence number of this event.
3026
+ sequence_number:,
3027
+ # The agent that owns this multi-agent streaming event.
3028
+ agent: nil,
3029
+ # The type of the event. Always 'response.mcp_call_arguments.delta'.
3030
+ type: :"response.mcp_call_arguments.delta",
3031
+ # The WebSocket lane that emitted this event.
3032
+ # This field is present when the originating response.create supplied a stream_id.
3033
+ stream_id: nil
3034
+ )
3035
+ end
3036
+
3037
+ sig do
3038
+ override.returns(
3039
+ {
3040
+ delta: String,
3041
+ item_id: String,
3042
+ output_index: Integer,
3043
+ sequence_number: Integer,
3044
+ type: Symbol,
3045
+ agent:
3046
+ T.nilable(
3047
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDeltaEvent::Agent
3048
+ ),
3049
+ stream_id: String
3050
+ }
3051
+ )
3052
+ end
3053
+ def to_hash
3054
+ end
3055
+ end
3056
+
3057
+ class BetaResponseMcpCallArgumentsWsDone < OpenAI::Models::Beta::BetaResponseMcpCallArgumentsDoneEvent
3058
+ OrHash =
3059
+ T.type_alias do
3060
+ T.any(
3061
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallArgumentsWsDone,
3062
+ OpenAI::Internal::AnyHash
3063
+ )
3064
+ end
3065
+
3066
+ # The WebSocket lane that emitted this event. This field is present when the
3067
+ # originating `response.create` event supplied a `stream_id`.
3068
+ sig { returns(T.nilable(String)) }
3069
+ attr_reader :stream_id
3070
+
3071
+ sig { params(stream_id: String).void }
3072
+ attr_writer :stream_id
3073
+
3074
+ # Emitted when the arguments for an MCP tool call are finalized.
3075
+ sig do
3076
+ params(
3077
+ arguments: String,
3078
+ item_id: String,
3079
+ output_index: Integer,
3080
+ sequence_number: Integer,
3081
+ agent:
3082
+ T.nilable(
3083
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDoneEvent::Agent::OrHash
3084
+ ),
3085
+ type: Symbol,
3086
+ stream_id: String
3087
+ ).returns(T.attached_class)
3088
+ end
3089
+ def self.new(
3090
+ # A JSON string containing the finalized arguments for the MCP tool call.
3091
+ arguments:,
3092
+ # The unique identifier of the MCP tool call item being processed.
3093
+ item_id:,
3094
+ # The index of the output item in the response's output array.
3095
+ output_index:,
3096
+ # The sequence number of this event.
3097
+ sequence_number:,
3098
+ # The agent that owns this multi-agent streaming event.
3099
+ agent: nil,
3100
+ # The type of the event. Always 'response.mcp_call_arguments.done'.
3101
+ type: :"response.mcp_call_arguments.done",
3102
+ # The WebSocket lane that emitted this event.
3103
+ # This field is present when the originating response.create supplied a stream_id.
3104
+ stream_id: nil
3105
+ )
3106
+ end
3107
+
3108
+ sig do
3109
+ override.returns(
3110
+ {
3111
+ arguments: String,
3112
+ item_id: String,
3113
+ output_index: Integer,
3114
+ sequence_number: Integer,
3115
+ type: Symbol,
3116
+ agent:
3117
+ T.nilable(
3118
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDoneEvent::Agent
3119
+ ),
3120
+ stream_id: String
3121
+ }
3122
+ )
3123
+ end
3124
+ def to_hash
3125
+ end
3126
+ end
3127
+
3128
+ class BetaResponseMcpCallWsCompleted < OpenAI::Models::Beta::BetaResponseMcpCallCompletedEvent
3129
+ OrHash =
3130
+ T.type_alias do
3131
+ T.any(
3132
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallWsCompleted,
3133
+ OpenAI::Internal::AnyHash
3134
+ )
3135
+ end
3136
+
3137
+ # The WebSocket lane that emitted this event. This field is present when the
3138
+ # originating `response.create` event supplied a `stream_id`.
3139
+ sig { returns(T.nilable(String)) }
3140
+ attr_reader :stream_id
3141
+
3142
+ sig { params(stream_id: String).void }
3143
+ attr_writer :stream_id
3144
+
3145
+ # Emitted when an MCP tool call has completed successfully.
3146
+ sig do
3147
+ params(
3148
+ item_id: String,
3149
+ output_index: Integer,
3150
+ sequence_number: Integer,
3151
+ agent:
3152
+ T.nilable(
3153
+ OpenAI::Beta::BetaResponseMcpCallCompletedEvent::Agent::OrHash
3154
+ ),
3155
+ type: Symbol,
3156
+ stream_id: String
3157
+ ).returns(T.attached_class)
3158
+ end
3159
+ def self.new(
3160
+ # The ID of the MCP tool call item that completed.
3161
+ item_id:,
3162
+ # The index of the output item that completed.
3163
+ output_index:,
3164
+ # The sequence number of this event.
3165
+ sequence_number:,
3166
+ # The agent that owns this multi-agent streaming event.
3167
+ agent: nil,
3168
+ # The type of the event. Always 'response.mcp_call.completed'.
3169
+ type: :"response.mcp_call.completed",
3170
+ # The WebSocket lane that emitted this event.
3171
+ # This field is present when the originating response.create supplied a stream_id.
3172
+ stream_id: nil
3173
+ )
3174
+ end
3175
+
3176
+ sig do
3177
+ override.returns(
3178
+ {
3179
+ item_id: String,
3180
+ output_index: Integer,
3181
+ sequence_number: Integer,
3182
+ type: Symbol,
3183
+ agent:
3184
+ T.nilable(
3185
+ OpenAI::Beta::BetaResponseMcpCallCompletedEvent::Agent
3186
+ ),
3187
+ stream_id: String
3188
+ }
3189
+ )
3190
+ end
3191
+ def to_hash
3192
+ end
3193
+ end
3194
+
3195
+ class BetaResponseMcpCallWsFailed < OpenAI::Models::Beta::BetaResponseMcpCallFailedEvent
3196
+ OrHash =
3197
+ T.type_alias do
3198
+ T.any(
3199
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallWsFailed,
3200
+ OpenAI::Internal::AnyHash
3201
+ )
3202
+ end
3203
+
3204
+ # The WebSocket lane that emitted this event. This field is present when the
3205
+ # originating `response.create` event supplied a `stream_id`.
3206
+ sig { returns(T.nilable(String)) }
3207
+ attr_reader :stream_id
3208
+
3209
+ sig { params(stream_id: String).void }
3210
+ attr_writer :stream_id
3211
+
3212
+ # Emitted when an MCP tool call has failed.
3213
+ sig do
3214
+ params(
3215
+ item_id: String,
3216
+ output_index: Integer,
3217
+ sequence_number: Integer,
3218
+ agent:
3219
+ T.nilable(
3220
+ OpenAI::Beta::BetaResponseMcpCallFailedEvent::Agent::OrHash
3221
+ ),
3222
+ type: Symbol,
3223
+ stream_id: String
3224
+ ).returns(T.attached_class)
3225
+ end
3226
+ def self.new(
3227
+ # The ID of the MCP tool call item that failed.
3228
+ item_id:,
3229
+ # The index of the output item that failed.
3230
+ output_index:,
3231
+ # The sequence number of this event.
3232
+ sequence_number:,
3233
+ # The agent that owns this multi-agent streaming event.
3234
+ agent: nil,
3235
+ # The type of the event. Always 'response.mcp_call.failed'.
3236
+ type: :"response.mcp_call.failed",
3237
+ # The WebSocket lane that emitted this event.
3238
+ # This field is present when the originating response.create supplied a stream_id.
3239
+ stream_id: nil
3240
+ )
3241
+ end
3242
+
3243
+ sig do
3244
+ override.returns(
3245
+ {
3246
+ item_id: String,
3247
+ output_index: Integer,
3248
+ sequence_number: Integer,
3249
+ type: Symbol,
3250
+ agent:
3251
+ T.nilable(
3252
+ OpenAI::Beta::BetaResponseMcpCallFailedEvent::Agent
3253
+ ),
3254
+ stream_id: String
3255
+ }
3256
+ )
3257
+ end
3258
+ def to_hash
3259
+ end
3260
+ end
3261
+
3262
+ class BetaResponseMcpCallInWsProgress < OpenAI::Models::Beta::BetaResponseMcpCallInProgressEvent
3263
+ OrHash =
3264
+ T.type_alias do
3265
+ T.any(
3266
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallInWsProgress,
3267
+ OpenAI::Internal::AnyHash
3268
+ )
3269
+ end
3270
+
3271
+ # The WebSocket lane that emitted this event. This field is present when the
3272
+ # originating `response.create` event supplied a `stream_id`.
3273
+ sig { returns(T.nilable(String)) }
3274
+ attr_reader :stream_id
3275
+
3276
+ sig { params(stream_id: String).void }
3277
+ attr_writer :stream_id
3278
+
3279
+ # Emitted when an MCP tool call is in progress.
3280
+ sig do
3281
+ params(
3282
+ item_id: String,
3283
+ output_index: Integer,
3284
+ sequence_number: Integer,
3285
+ agent:
3286
+ T.nilable(
3287
+ OpenAI::Beta::BetaResponseMcpCallInProgressEvent::Agent::OrHash
3288
+ ),
3289
+ type: Symbol,
3290
+ stream_id: String
3291
+ ).returns(T.attached_class)
3292
+ end
3293
+ def self.new(
3294
+ # The unique identifier of the MCP tool call item being processed.
3295
+ item_id:,
3296
+ # The index of the output item in the response's output array.
3297
+ output_index:,
3298
+ # The sequence number of this event.
3299
+ sequence_number:,
3300
+ # The agent that owns this multi-agent streaming event.
3301
+ agent: nil,
3302
+ # The type of the event. Always 'response.mcp_call.in_progress'.
3303
+ type: :"response.mcp_call.in_progress",
3304
+ # The WebSocket lane that emitted this event.
3305
+ # This field is present when the originating response.create supplied a stream_id.
3306
+ stream_id: nil
3307
+ )
3308
+ end
3309
+
3310
+ sig do
3311
+ override.returns(
3312
+ {
3313
+ item_id: String,
3314
+ output_index: Integer,
3315
+ sequence_number: Integer,
3316
+ type: Symbol,
3317
+ agent:
3318
+ T.nilable(
3319
+ OpenAI::Beta::BetaResponseMcpCallInProgressEvent::Agent
3320
+ ),
3321
+ stream_id: String
3322
+ }
3323
+ )
3324
+ end
3325
+ def to_hash
3326
+ end
3327
+ end
3328
+
3329
+ class BetaResponseMcpListToolsWsCompleted < OpenAI::Models::Beta::BetaResponseMcpListToolsCompletedEvent
3330
+ OrHash =
3331
+ T.type_alias do
3332
+ T.any(
3333
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsWsCompleted,
3334
+ OpenAI::Internal::AnyHash
3335
+ )
3336
+ end
3337
+
3338
+ # The WebSocket lane that emitted this event. This field is present when the
3339
+ # originating `response.create` event supplied a `stream_id`.
3340
+ sig { returns(T.nilable(String)) }
3341
+ attr_reader :stream_id
3342
+
3343
+ sig { params(stream_id: String).void }
3344
+ attr_writer :stream_id
3345
+
3346
+ # Emitted when the list of available MCP tools has been successfully retrieved.
3347
+ sig do
3348
+ params(
3349
+ item_id: String,
3350
+ output_index: Integer,
3351
+ sequence_number: Integer,
3352
+ agent:
3353
+ T.nilable(
3354
+ OpenAI::Beta::BetaResponseMcpListToolsCompletedEvent::Agent::OrHash
3355
+ ),
3356
+ type: Symbol,
3357
+ stream_id: String
3358
+ ).returns(T.attached_class)
3359
+ end
3360
+ def self.new(
3361
+ # The ID of the MCP tool call item that produced this output.
3362
+ item_id:,
3363
+ # The index of the output item that was processed.
3364
+ output_index:,
3365
+ # The sequence number of this event.
3366
+ sequence_number:,
3367
+ # The agent that owns this multi-agent streaming event.
3368
+ agent: nil,
3369
+ # The type of the event. Always 'response.mcp_list_tools.completed'.
3370
+ type: :"response.mcp_list_tools.completed",
3371
+ # The WebSocket lane that emitted this event.
3372
+ # This field is present when the originating response.create supplied a stream_id.
3373
+ stream_id: nil
3374
+ )
3375
+ end
3376
+
3377
+ sig do
3378
+ override.returns(
3379
+ {
3380
+ item_id: String,
3381
+ output_index: Integer,
3382
+ sequence_number: Integer,
3383
+ type: Symbol,
3384
+ agent:
3385
+ T.nilable(
3386
+ OpenAI::Beta::BetaResponseMcpListToolsCompletedEvent::Agent
3387
+ ),
3388
+ stream_id: String
3389
+ }
3390
+ )
3391
+ end
3392
+ def to_hash
3393
+ end
3394
+ end
3395
+
3396
+ class BetaResponseMcpListToolsWsFailed < OpenAI::Models::Beta::BetaResponseMcpListToolsFailedEvent
3397
+ OrHash =
3398
+ T.type_alias do
3399
+ T.any(
3400
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsWsFailed,
3401
+ OpenAI::Internal::AnyHash
3402
+ )
3403
+ end
3404
+
3405
+ # The WebSocket lane that emitted this event. This field is present when the
3406
+ # originating `response.create` event supplied a `stream_id`.
3407
+ sig { returns(T.nilable(String)) }
3408
+ attr_reader :stream_id
3409
+
3410
+ sig { params(stream_id: String).void }
3411
+ attr_writer :stream_id
3412
+
3413
+ # Emitted when the attempt to list available MCP tools has failed.
3414
+ sig do
3415
+ params(
3416
+ item_id: String,
3417
+ output_index: Integer,
3418
+ sequence_number: Integer,
3419
+ agent:
3420
+ T.nilable(
3421
+ OpenAI::Beta::BetaResponseMcpListToolsFailedEvent::Agent::OrHash
3422
+ ),
3423
+ type: Symbol,
3424
+ stream_id: String
3425
+ ).returns(T.attached_class)
3426
+ end
3427
+ def self.new(
3428
+ # The ID of the MCP tool call item that failed.
3429
+ item_id:,
3430
+ # The index of the output item that failed.
3431
+ output_index:,
3432
+ # The sequence number of this event.
3433
+ sequence_number:,
3434
+ # The agent that owns this multi-agent streaming event.
3435
+ agent: nil,
3436
+ # The type of the event. Always 'response.mcp_list_tools.failed'.
3437
+ type: :"response.mcp_list_tools.failed",
3438
+ # The WebSocket lane that emitted this event.
3439
+ # This field is present when the originating response.create supplied a stream_id.
3440
+ stream_id: nil
3441
+ )
3442
+ end
3443
+
3444
+ sig do
3445
+ override.returns(
3446
+ {
3447
+ item_id: String,
3448
+ output_index: Integer,
3449
+ sequence_number: Integer,
3450
+ type: Symbol,
3451
+ agent:
3452
+ T.nilable(
3453
+ OpenAI::Beta::BetaResponseMcpListToolsFailedEvent::Agent
3454
+ ),
3455
+ stream_id: String
3456
+ }
3457
+ )
3458
+ end
3459
+ def to_hash
3460
+ end
3461
+ end
3462
+
3463
+ class BetaResponseMcpListToolsInWsProgress < OpenAI::Models::Beta::BetaResponseMcpListToolsInProgressEvent
3464
+ OrHash =
3465
+ T.type_alias do
3466
+ T.any(
3467
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsInWsProgress,
3468
+ OpenAI::Internal::AnyHash
3469
+ )
3470
+ end
3471
+
3472
+ # The WebSocket lane that emitted this event. This field is present when the
3473
+ # originating `response.create` event supplied a `stream_id`.
3474
+ sig { returns(T.nilable(String)) }
3475
+ attr_reader :stream_id
3476
+
3477
+ sig { params(stream_id: String).void }
3478
+ attr_writer :stream_id
3479
+
3480
+ # Emitted when the system is in the process of retrieving the list of available
3481
+ # MCP tools.
3482
+ sig do
3483
+ params(
3484
+ item_id: String,
3485
+ output_index: Integer,
3486
+ sequence_number: Integer,
3487
+ agent:
3488
+ T.nilable(
3489
+ OpenAI::Beta::BetaResponseMcpListToolsInProgressEvent::Agent::OrHash
3490
+ ),
3491
+ type: Symbol,
3492
+ stream_id: String
3493
+ ).returns(T.attached_class)
3494
+ end
3495
+ def self.new(
3496
+ # The ID of the MCP tool call item that is being processed.
3497
+ item_id:,
3498
+ # The index of the output item that is being processed.
3499
+ output_index:,
3500
+ # The sequence number of this event.
3501
+ sequence_number:,
3502
+ # The agent that owns this multi-agent streaming event.
3503
+ agent: nil,
3504
+ # The type of the event. Always 'response.mcp_list_tools.in_progress'.
3505
+ type: :"response.mcp_list_tools.in_progress",
3506
+ # The WebSocket lane that emitted this event.
3507
+ # This field is present when the originating response.create supplied a stream_id.
3508
+ stream_id: nil
3509
+ )
3510
+ end
3511
+
3512
+ sig do
3513
+ override.returns(
3514
+ {
3515
+ item_id: String,
3516
+ output_index: Integer,
3517
+ sequence_number: Integer,
3518
+ type: Symbol,
3519
+ agent:
3520
+ T.nilable(
3521
+ OpenAI::Beta::BetaResponseMcpListToolsInProgressEvent::Agent
3522
+ ),
3523
+ stream_id: String
3524
+ }
3525
+ )
3526
+ end
3527
+ def to_hash
3528
+ end
3529
+ end
3530
+
3531
+ class BetaResponseOutputTextAnnotationWsAdded < OpenAI::Models::Beta::BetaResponseOutputTextAnnotationAddedEvent
3532
+ OrHash =
3533
+ T.type_alias do
3534
+ T.any(
3535
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputTextAnnotationWsAdded,
3536
+ OpenAI::Internal::AnyHash
3537
+ )
3538
+ end
3539
+
3540
+ # The WebSocket lane that emitted this event. This field is present when the
3541
+ # originating `response.create` event supplied a `stream_id`.
3542
+ sig { returns(T.nilable(String)) }
3543
+ attr_reader :stream_id
3544
+
3545
+ sig { params(stream_id: String).void }
3546
+ attr_writer :stream_id
3547
+
3548
+ # Emitted when an annotation is added to output text content.
3549
+ sig do
3550
+ params(
3551
+ annotation: T.anything,
3552
+ annotation_index: Integer,
3553
+ content_index: Integer,
3554
+ item_id: String,
3555
+ output_index: Integer,
3556
+ sequence_number: Integer,
3557
+ agent:
3558
+ T.nilable(
3559
+ OpenAI::Beta::BetaResponseOutputTextAnnotationAddedEvent::Agent::OrHash
3560
+ ),
3561
+ type: Symbol,
3562
+ stream_id: String
3563
+ ).returns(T.attached_class)
3564
+ end
3565
+ def self.new(
3566
+ # The annotation object being added. (See annotation schema for details.)
3567
+ annotation:,
3568
+ # The index of the annotation within the content part.
3569
+ annotation_index:,
3570
+ # The index of the content part within the output item.
3571
+ content_index:,
3572
+ # The unique identifier of the item to which the annotation is being added.
3573
+ item_id:,
3574
+ # The index of the output item in the response's output array.
3575
+ output_index:,
3576
+ # The sequence number of this event.
3577
+ sequence_number:,
3578
+ # The agent that owns this multi-agent streaming event.
3579
+ agent: nil,
3580
+ # The type of the event. Always 'response.output_text.annotation.added'.
3581
+ type: :"response.output_text.annotation.added",
3582
+ # The WebSocket lane that emitted this event.
3583
+ # This field is present when the originating response.create supplied a stream_id.
3584
+ stream_id: nil
3585
+ )
3586
+ end
3587
+
3588
+ sig do
3589
+ override.returns(
3590
+ {
3591
+ annotation: T.anything,
3592
+ annotation_index: Integer,
3593
+ content_index: Integer,
3594
+ item_id: String,
3595
+ output_index: Integer,
3596
+ sequence_number: Integer,
3597
+ type: Symbol,
3598
+ agent:
3599
+ T.nilable(
3600
+ OpenAI::Beta::BetaResponseOutputTextAnnotationAddedEvent::Agent
3601
+ ),
3602
+ stream_id: String
3603
+ }
3604
+ )
3605
+ end
3606
+ def to_hash
3607
+ end
3608
+ end
3609
+
3610
+ class BetaResponseWsQueued < OpenAI::Models::Beta::BetaResponseQueuedEvent
3611
+ OrHash =
3612
+ T.type_alias do
3613
+ T.any(
3614
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsQueued,
3615
+ OpenAI::Internal::AnyHash
3616
+ )
3617
+ end
3618
+
3619
+ # The WebSocket lane that emitted this event. This field is present when the
3620
+ # originating `response.create` event supplied a `stream_id`.
3621
+ sig { returns(T.nilable(String)) }
3622
+ attr_reader :stream_id
3623
+
3624
+ sig { params(stream_id: String).void }
3625
+ attr_writer :stream_id
3626
+
3627
+ # Emitted when a response is queued and waiting to be processed.
3628
+ sig do
3629
+ params(
3630
+ response: OpenAI::Beta::BetaResponse::OrHash,
3631
+ sequence_number: Integer,
3632
+ agent:
3633
+ T.nilable(OpenAI::Beta::BetaResponseQueuedEvent::Agent::OrHash),
3634
+ type: Symbol,
3635
+ stream_id: String
3636
+ ).returns(T.attached_class)
3637
+ end
3638
+ def self.new(
3639
+ # The full response object that is queued.
3640
+ response:,
3641
+ # The sequence number for this event.
3642
+ sequence_number:,
3643
+ # The agent that owns this multi-agent streaming event.
3644
+ agent: nil,
3645
+ # The type of the event. Always 'response.queued'.
3646
+ type: :"response.queued",
3647
+ # The WebSocket lane that emitted this event.
3648
+ # This field is present when the originating response.create supplied a stream_id.
3649
+ stream_id: nil
3650
+ )
3651
+ end
3652
+
3653
+ sig do
3654
+ override.returns(
3655
+ {
3656
+ response: OpenAI::Beta::BetaResponse,
3657
+ sequence_number: Integer,
3658
+ type: Symbol,
3659
+ agent: T.nilable(OpenAI::Beta::BetaResponseQueuedEvent::Agent),
3660
+ stream_id: String
3661
+ }
3662
+ )
3663
+ end
3664
+ def to_hash
3665
+ end
3666
+ end
3667
+
3668
+ class BetaResponseCustomToolCallInputWsDelta < OpenAI::Models::Beta::BetaResponseCustomToolCallInputDeltaEvent
3669
+ OrHash =
3670
+ T.type_alias do
3671
+ T.any(
3672
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCustomToolCallInputWsDelta,
3673
+ OpenAI::Internal::AnyHash
3674
+ )
3675
+ end
3676
+
3677
+ # The WebSocket lane that emitted this event. This field is present when the
3678
+ # originating `response.create` event supplied a `stream_id`.
3679
+ sig { returns(T.nilable(String)) }
3680
+ attr_reader :stream_id
3681
+
3682
+ sig { params(stream_id: String).void }
3683
+ attr_writer :stream_id
3684
+
3685
+ # Event representing a delta (partial update) to the input of a custom tool call.
3686
+ sig do
3687
+ params(
3688
+ delta: String,
3689
+ item_id: String,
3690
+ output_index: Integer,
3691
+ sequence_number: Integer,
3692
+ agent:
3693
+ T.nilable(
3694
+ OpenAI::Beta::BetaResponseCustomToolCallInputDeltaEvent::Agent::OrHash
3695
+ ),
3696
+ type: Symbol,
3697
+ stream_id: String
3698
+ ).returns(T.attached_class)
3699
+ end
3700
+ def self.new(
3701
+ # The incremental input data (delta) for the custom tool call.
3702
+ delta:,
3703
+ # Unique identifier for the API item associated with this event.
3704
+ item_id:,
3705
+ # The index of the output this delta applies to.
3706
+ output_index:,
3707
+ # The sequence number of this event.
3708
+ sequence_number:,
3709
+ # The agent that owns this multi-agent streaming event.
3710
+ agent: nil,
3711
+ # The event type identifier.
3712
+ type: :"response.custom_tool_call_input.delta",
3713
+ # The WebSocket lane that emitted this event.
3714
+ # This field is present when the originating response.create supplied a stream_id.
3715
+ stream_id: nil
3716
+ )
3717
+ end
3718
+
3719
+ sig do
3720
+ override.returns(
3721
+ {
3722
+ delta: String,
3723
+ item_id: String,
3724
+ output_index: Integer,
3725
+ sequence_number: Integer,
3726
+ type: Symbol,
3727
+ agent:
3728
+ T.nilable(
3729
+ OpenAI::Beta::BetaResponseCustomToolCallInputDeltaEvent::Agent
3730
+ ),
3731
+ stream_id: String
3732
+ }
3733
+ )
3734
+ end
3735
+ def to_hash
3736
+ end
3737
+ end
3738
+
3739
+ class BetaResponseCustomToolCallInputWsDone < OpenAI::Models::Beta::BetaResponseCustomToolCallInputDoneEvent
3740
+ OrHash =
3741
+ T.type_alias do
3742
+ T.any(
3743
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCustomToolCallInputWsDone,
3744
+ OpenAI::Internal::AnyHash
3745
+ )
3746
+ end
3747
+
3748
+ # The WebSocket lane that emitted this event. This field is present when the
3749
+ # originating `response.create` event supplied a `stream_id`.
3750
+ sig { returns(T.nilable(String)) }
3751
+ attr_reader :stream_id
3752
+
3753
+ sig { params(stream_id: String).void }
3754
+ attr_writer :stream_id
3755
+
3756
+ # Event indicating that input for a custom tool call is complete.
3757
+ sig do
3758
+ params(
3759
+ input: String,
3760
+ item_id: String,
3761
+ output_index: Integer,
3762
+ sequence_number: Integer,
3763
+ agent:
3764
+ T.nilable(
3765
+ OpenAI::Beta::BetaResponseCustomToolCallInputDoneEvent::Agent::OrHash
3766
+ ),
3767
+ type: Symbol,
3768
+ stream_id: String
3769
+ ).returns(T.attached_class)
3770
+ end
3771
+ def self.new(
3772
+ # The complete input data for the custom tool call.
3773
+ input:,
3774
+ # Unique identifier for the API item associated with this event.
3775
+ item_id:,
3776
+ # The index of the output this event applies to.
3777
+ output_index:,
3778
+ # The sequence number of this event.
3779
+ sequence_number:,
3780
+ # The agent that owns this multi-agent streaming event.
3781
+ agent: nil,
3782
+ # The event type identifier.
3783
+ type: :"response.custom_tool_call_input.done",
3784
+ # The WebSocket lane that emitted this event.
3785
+ # This field is present when the originating response.create supplied a stream_id.
3786
+ stream_id: nil
3787
+ )
3788
+ end
3789
+
3790
+ sig do
3791
+ override.returns(
3792
+ {
3793
+ input: String,
3794
+ item_id: String,
3795
+ output_index: Integer,
3796
+ sequence_number: Integer,
3797
+ type: Symbol,
3798
+ agent:
3799
+ T.nilable(
3800
+ OpenAI::Beta::BetaResponseCustomToolCallInputDoneEvent::Agent
3801
+ ),
3802
+ stream_id: String
3803
+ }
3804
+ )
3805
+ end
3806
+ def to_hash
3807
+ end
3808
+ end
3809
+
73
3810
  sig do
74
3811
  override.returns(
75
3812
  T::Array[OpenAI::Beta::BetaResponsesServerEvent::Variants]