openai 0.78.0 → 0.80.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 (239) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +99 -0
  3. data/README.md +241 -8
  4. data/SECURITY.md +6 -22
  5. data/azure.md +110 -0
  6. data/bedrock.md +197 -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 +5 -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_mcp_tool_call_error.rb +84 -0
  47. data/lib/openai/models/beta/beta_response.rb +27 -0
  48. data/lib/openai/models/beta/beta_response_input_item.rb +3 -3
  49. data/lib/openai/models/beta/beta_response_item.rb +3 -3
  50. data/lib/openai/models/beta/beta_response_output_item.rb +3 -3
  51. data/lib/openai/models/beta/beta_response_output_item_added_event.rb +5 -2
  52. data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +201 -4
  53. data/lib/openai/models/beta/beta_response_reasoning_item.rb +5 -0
  54. data/lib/openai/models/beta/beta_response_stream_event.rb +1 -1
  55. data/lib/openai/models/beta/beta_responses_client_event.rb +46 -3
  56. data/lib/openai/models/beta/beta_responses_server_event.rb +1143 -63
  57. data/lib/openai/models/beta/beta_web_search_tool.rb +11 -1
  58. data/lib/openai/models/beta/response_compact_params.rb +18 -0
  59. data/lib/openai/models/beta/response_create_params.rb +27 -0
  60. data/lib/openai/models/chat_model.rb +1 -0
  61. data/lib/openai/models/completion_usage.rb +26 -2
  62. data/lib/openai/models/containers/file_create_params.rb +4 -0
  63. data/lib/openai/models/content_provenance_check_create_params.rb +4 -0
  64. data/lib/openai/models/conversations/conversation_item.rb +3 -3
  65. data/lib/openai/models/file_create_params.rb +4 -0
  66. data/lib/openai/models/image_create_variation_params.rb +4 -0
  67. data/lib/openai/models/image_edit_params.rb +8 -0
  68. data/lib/openai/models/model.rb +9 -1
  69. data/lib/openai/models/responses/mcp_tool_call_error.rb +82 -0
  70. data/lib/openai/models/responses/response.rb +9 -0
  71. data/lib/openai/models/responses/response_compact_params.rb +18 -0
  72. data/lib/openai/models/responses/response_create_params.rb +9 -0
  73. data/lib/openai/models/responses/response_input_item.rb +3 -3
  74. data/lib/openai/models/responses/response_item.rb +3 -3
  75. data/lib/openai/models/responses/response_output_item.rb +3 -3
  76. data/lib/openai/models/responses/response_output_item_added_event.rb +5 -2
  77. data/lib/openai/models/responses/response_output_text_annotation_added_event.rb +201 -4
  78. data/lib/openai/models/responses/response_reasoning_item.rb +5 -0
  79. data/lib/openai/models/responses/response_stream_event.rb +1 -1
  80. data/lib/openai/models/responses/responses_client_event.rb +22 -1
  81. data/lib/openai/models/responses/responses_server_event.rb +1107 -56
  82. data/lib/openai/models/responses/web_search_tool.rb +11 -1
  83. data/lib/openai/models/responses_model.rb +5 -0
  84. data/lib/openai/models/skill_create_params.rb +4 -0
  85. data/lib/openai/models/skills/version_create_params.rb +4 -0
  86. data/lib/openai/models/uploads/part_create_params.rb +4 -0
  87. data/lib/openai/models/vector_store_search_response.rb +3 -1
  88. data/lib/openai/models/video_create_character_params.rb +4 -0
  89. data/lib/openai/models/video_create_params.rb +4 -0
  90. data/lib/openai/models/video_edit_params.rb +4 -0
  91. data/lib/openai/models/video_extend_params.rb +4 -0
  92. data/lib/openai/models.rb +9 -1
  93. data/lib/openai/net_http_client.rb +20 -6
  94. data/lib/openai/providers/azure.rb +216 -0
  95. data/lib/openai/providers/bedrock.rb +130 -17
  96. data/lib/openai/resources/admin/organization/projects/groups/roles.rb +1 -1
  97. data/lib/openai/resources/admin/organization/projects/groups.rb +1 -1
  98. data/lib/openai/resources/admin/organization/projects/users/roles.rb +1 -1
  99. data/lib/openai/resources/admin/organization/projects.rb +4 -2
  100. data/lib/openai/resources/audio/transcriptions.rb +8 -0
  101. data/lib/openai/resources/audio/translations.rb +4 -0
  102. data/lib/openai/resources/beta/responses.rb +1 -1
  103. data/lib/openai/resources/beta/threads/runs/steps.rb +2 -2
  104. data/lib/openai/resources/containers/files.rb +4 -0
  105. data/lib/openai/resources/content_provenance_checks.rb +4 -0
  106. data/lib/openai/resources/conversations/items.rb +1 -1
  107. data/lib/openai/resources/evals/runs/output_items.rb +1 -1
  108. data/lib/openai/resources/files.rb +5 -1
  109. data/lib/openai/resources/images.rb +12 -0
  110. data/lib/openai/resources/responses.rb +3 -2
  111. data/lib/openai/resources/skills/versions.rb +4 -0
  112. data/lib/openai/resources/skills.rb +4 -0
  113. data/lib/openai/resources/uploads/parts.rb +4 -0
  114. data/lib/openai/resources/vector_stores/file_batches.rb +1 -1
  115. data/lib/openai/resources/videos.rb +38 -0
  116. data/lib/openai/resources/webhooks.rb +18 -6
  117. data/lib/openai/version.rb +1 -1
  118. data/lib/openai.rb +111 -105
  119. data/rbi/openai/auth.rbi +4 -4
  120. data/rbi/openai/client.rbi +13 -3
  121. data/rbi/openai/errors.rbi +7 -0
  122. data/rbi/openai/helpers/streaming/events.rbi +12 -0
  123. data/rbi/openai/http_client.rbi +62 -2
  124. data/rbi/openai/internal/logging.rbi +192 -0
  125. data/rbi/openai/internal/provider.rbi +3 -0
  126. data/rbi/openai/internal/read_io_adapter.rbi +6 -1
  127. data/rbi/openai/internal/transport/base_client.rbi +61 -7
  128. data/rbi/openai/internal/type/base_model.rbi +24 -1
  129. data/rbi/openai/internal/type/base_page.rbi +13 -2
  130. data/rbi/openai/internal/type/base_stream.rbi +15 -4
  131. data/rbi/openai/internal/util.rbi +26 -2
  132. data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +5 -0
  133. data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +5 -0
  134. data/rbi/openai/models/all_models.rbi +25 -0
  135. data/rbi/openai/models/audio/transcription_create_params.rbi +14 -2
  136. data/rbi/openai/models/audio/translation_create_params.rbi +14 -2
  137. data/rbi/openai/models/beta/beta_mcp_tool_call_error.rbi +122 -0
  138. data/rbi/openai/models/beta/beta_response.rbi +47 -0
  139. data/rbi/openai/models/beta/beta_response_input_item.rbi +27 -3
  140. data/rbi/openai/models/beta/beta_response_item.rbi +27 -3
  141. data/rbi/openai/models/beta/beta_response_output_item.rbi +27 -3
  142. data/rbi/openai/models/beta/beta_response_output_item_added_event.rbi +8 -2
  143. data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +297 -5
  144. data/rbi/openai/models/beta/beta_response_reasoning_item.rbi +10 -0
  145. data/rbi/openai/models/beta/beta_response_stream_event.rbi +1 -1
  146. data/rbi/openai/models/beta/beta_responses_client_event.rbi +69 -1
  147. data/rbi/openai/models/beta/beta_responses_server_event.rbi +3945 -54
  148. data/rbi/openai/models/beta/beta_web_search_tool.rbi +15 -0
  149. data/rbi/openai/models/beta/response_compact_params.rbi +30 -0
  150. data/rbi/openai/models/beta/response_create_params.rbi +47 -0
  151. data/rbi/openai/models/chat_model.rbi +2 -0
  152. data/rbi/openai/models/completion_usage.rbi +39 -6
  153. data/rbi/openai/models/containers/file_create_params.rbi +8 -0
  154. data/rbi/openai/models/content_provenance_check_create_params.rbi +8 -0
  155. data/rbi/openai/models/conversations/conversation_item.rbi +12 -3
  156. data/rbi/openai/models/file_create_params.rbi +8 -0
  157. data/rbi/openai/models/image_create_variation_params.rbi +8 -0
  158. data/rbi/openai/models/image_edit_params.rbi +16 -0
  159. data/rbi/openai/models/model.rbi +14 -1
  160. data/rbi/openai/models/responses/mcp_tool_call_error.rbi +120 -0
  161. data/rbi/openai/models/responses/response.rbi +17 -0
  162. data/rbi/openai/models/responses/response_compact_params.rbi +30 -0
  163. data/rbi/openai/models/responses/response_create_params.rbi +17 -0
  164. data/rbi/openai/models/responses/response_input_item.rbi +27 -3
  165. data/rbi/openai/models/responses/response_item.rbi +27 -3
  166. data/rbi/openai/models/responses/response_output_item.rbi +27 -3
  167. data/rbi/openai/models/responses/response_output_item_added_event.rbi +8 -2
  168. data/rbi/openai/models/responses/response_output_text_annotation_added_event.rbi +297 -5
  169. data/rbi/openai/models/responses/response_reasoning_item.rbi +10 -0
  170. data/rbi/openai/models/responses/response_stream_event.rbi +1 -1
  171. data/rbi/openai/models/responses/responses_client_event.rbi +36 -0
  172. data/rbi/openai/models/responses/responses_server_event.rbi +3385 -53
  173. data/rbi/openai/models/responses/web_search_tool.rbi +15 -0
  174. data/rbi/openai/models/responses_model.rbi +25 -0
  175. data/rbi/openai/models/skill_create_params.rbi +8 -0
  176. data/rbi/openai/models/skills/version_create_params.rbi +8 -0
  177. data/rbi/openai/models/uploads/part_create_params.rbi +8 -0
  178. data/rbi/openai/models/video_create_character_params.rbi +8 -0
  179. data/rbi/openai/models/video_create_params.rbi +8 -0
  180. data/rbi/openai/models/video_edit_params.rbi +8 -0
  181. data/rbi/openai/models/video_extend_params.rbi +8 -0
  182. data/rbi/openai/net_http_client.rbi +2 -2
  183. data/rbi/openai/providers.rbi +11 -0
  184. data/rbi/openai/resources/audio/transcriptions.rbi +14 -2
  185. data/rbi/openai/resources/audio/translations.rbi +7 -1
  186. data/rbi/openai/resources/beta/responses.rbi +8 -0
  187. data/rbi/openai/resources/containers/files.rbi +4 -0
  188. data/rbi/openai/resources/content_provenance_checks.rbi +4 -0
  189. data/rbi/openai/resources/files.rbi +5 -1
  190. data/rbi/openai/resources/images.rbi +20 -0
  191. data/rbi/openai/resources/responses.rbi +8 -0
  192. data/rbi/openai/resources/skills/versions.rbi +4 -0
  193. data/rbi/openai/resources/skills.rbi +4 -0
  194. data/rbi/openai/resources/uploads/parts.rbi +4 -0
  195. data/rbi/openai/resources/videos.rbi +16 -0
  196. data/sig/openai/client.rbs +6 -2
  197. data/sig/openai/errors.rbs +5 -0
  198. data/sig/openai/http_client.rbs +37 -2
  199. data/sig/openai/internal/logging.rbs +88 -0
  200. data/sig/openai/internal/provider.rbs +3 -1
  201. data/sig/openai/internal/read_io_adapter.rbs +3 -1
  202. data/sig/openai/internal/transport/base_client.rbs +33 -5
  203. data/sig/openai/internal/type/base_model.rbs +13 -0
  204. data/sig/openai/internal/type/base_page.rbs +8 -1
  205. data/sig/openai/internal/type/base_stream.rbs +8 -2
  206. data/sig/openai/internal/util.rbs +12 -0
  207. data/sig/openai/models/admin/organization/audit_log_list_params.rbs +2 -0
  208. data/sig/openai/models/admin/organization/audit_log_list_response.rbs +2 -0
  209. data/sig/openai/models/all_models.rbs +10 -0
  210. data/sig/openai/models/beta/beta_mcp_tool_call_error.rbs +75 -0
  211. data/sig/openai/models/beta/beta_response.rbs +14 -1
  212. data/sig/openai/models/beta/beta_response_input_item.rbs +4 -4
  213. data/sig/openai/models/beta/beta_response_item.rbs +4 -4
  214. data/sig/openai/models/beta/beta_response_output_item.rbs +4 -4
  215. data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +149 -4
  216. data/sig/openai/models/beta/beta_responses_client_event.rbs +21 -1
  217. data/sig/openai/models/beta/beta_responses_server_event.rbs +2005 -53
  218. data/sig/openai/models/beta/beta_web_search_tool.rbs +7 -0
  219. data/sig/openai/models/beta/response_compact_params.rbs +12 -0
  220. data/sig/openai/models/beta/response_create_params.rbs +14 -1
  221. data/sig/openai/models/chat_model.rbs +2 -0
  222. data/sig/openai/models/completion_usage.rbs +27 -6
  223. data/sig/openai/models/conversations/conversation_item.rbs +4 -4
  224. data/sig/openai/models/model.rbs +12 -2
  225. data/sig/openai/models/responses/mcp_tool_call_error.rbs +73 -0
  226. data/sig/openai/models/responses/response.rbs +2 -1
  227. data/sig/openai/models/responses/response_compact_params.rbs +12 -0
  228. data/sig/openai/models/responses/response_create_params.rbs +2 -1
  229. data/sig/openai/models/responses/response_input_item.rbs +4 -4
  230. data/sig/openai/models/responses/response_item.rbs +4 -4
  231. data/sig/openai/models/responses/response_output_item.rbs +4 -4
  232. data/sig/openai/models/responses/response_output_text_annotation_added_event.rbs +149 -4
  233. data/sig/openai/models/responses/responses_client_event.rbs +9 -1
  234. data/sig/openai/models/responses/responses_server_event.rbs +1834 -53
  235. data/sig/openai/models/responses/web_search_tool.rbs +7 -0
  236. data/sig/openai/models/responses_model.rbs +10 -0
  237. data/sig/openai/net_http_client.rbs +2 -2
  238. data/sig/openai/providers.rbs +7 -0
  239. metadata +30 -1
@@ -12,64 +12,3955 @@ 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,
15
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError,
68
16
  OpenAI::Beta::BetaResponseInjectCreatedEvent,
69
- OpenAI::Beta::BetaResponseInjectFailedEvent
17
+ OpenAI::Beta::BetaResponseInjectFailedEvent,
18
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioWsDelta,
19
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioWsDone,
20
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioTranscriptWsDelta,
21
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseAudioTranscriptWsDone,
22
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallCodeWsDelta,
23
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallCodeWsDone,
24
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallWsCompleted,
25
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallInWsProgress,
26
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCodeInterpreterCallWsInterpreting,
27
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsCompleted,
28
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseContentPartWsAdded,
29
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseContentPartWsDone,
30
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsCreated,
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 BetaResponseFileSearchCallWsCompleted < OpenAI::Models::Beta::BetaResponseFileSearchCallCompletedEvent
944
+ OrHash =
945
+ T.type_alias do
946
+ T.any(
947
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallWsCompleted,
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 a file search call is completed (results found).
961
+ sig do
962
+ params(
963
+ item_id: String,
964
+ output_index: Integer,
965
+ sequence_number: Integer,
966
+ agent:
967
+ T.nilable(
968
+ OpenAI::Beta::BetaResponseFileSearchCallCompletedEvent::Agent::OrHash
969
+ ),
970
+ type: Symbol,
971
+ stream_id: String
972
+ ).returns(T.attached_class)
973
+ end
974
+ def self.new(
975
+ # The ID of the output item that the file search call is initiated.
976
+ item_id:,
977
+ # The index of the output item that the file search call is initiated.
978
+ output_index:,
979
+ # The sequence number of this event.
980
+ sequence_number:,
981
+ # The agent that owns this multi-agent streaming event.
982
+ agent: nil,
983
+ # The type of the event. Always `response.file_search_call.completed`.
984
+ type: :"response.file_search_call.completed",
985
+ # The WebSocket lane that emitted this event.
986
+ # This field is present when the originating response.create supplied a stream_id.
987
+ stream_id: nil
988
+ )
989
+ end
990
+
991
+ sig do
992
+ override.returns(
993
+ {
994
+ item_id: String,
995
+ output_index: Integer,
996
+ sequence_number: Integer,
997
+ type: Symbol,
998
+ agent:
999
+ T.nilable(
1000
+ OpenAI::Beta::BetaResponseFileSearchCallCompletedEvent::Agent
1001
+ ),
1002
+ stream_id: String
1003
+ }
1004
+ )
1005
+ end
1006
+ def to_hash
1007
+ end
1008
+ end
1009
+
1010
+ class BetaResponseFileSearchCallInWsProgress < OpenAI::Models::Beta::BetaResponseFileSearchCallInProgressEvent
1011
+ OrHash =
1012
+ T.type_alias do
1013
+ T.any(
1014
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallInWsProgress,
1015
+ OpenAI::Internal::AnyHash
1016
+ )
1017
+ end
1018
+
1019
+ # The WebSocket lane that emitted this event. This field is present when the
1020
+ # originating `response.create` event supplied a `stream_id`.
1021
+ sig { returns(T.nilable(String)) }
1022
+ attr_reader :stream_id
1023
+
1024
+ sig { params(stream_id: String).void }
1025
+ attr_writer :stream_id
1026
+
1027
+ # Emitted when a file search call is initiated.
1028
+ sig do
1029
+ params(
1030
+ item_id: String,
1031
+ output_index: Integer,
1032
+ sequence_number: Integer,
1033
+ agent:
1034
+ T.nilable(
1035
+ OpenAI::Beta::BetaResponseFileSearchCallInProgressEvent::Agent::OrHash
1036
+ ),
1037
+ type: Symbol,
1038
+ stream_id: String
1039
+ ).returns(T.attached_class)
1040
+ end
1041
+ def self.new(
1042
+ # The ID of the output item that the file search call is initiated.
1043
+ item_id:,
1044
+ # The index of the output item that the file search call is initiated.
1045
+ output_index:,
1046
+ # The sequence number of this event.
1047
+ sequence_number:,
1048
+ # The agent that owns this multi-agent streaming event.
1049
+ agent: nil,
1050
+ # The type of the event. Always `response.file_search_call.in_progress`.
1051
+ type: :"response.file_search_call.in_progress",
1052
+ # The WebSocket lane that emitted this event.
1053
+ # This field is present when the originating response.create supplied a stream_id.
1054
+ stream_id: nil
1055
+ )
1056
+ end
1057
+
1058
+ sig do
1059
+ override.returns(
1060
+ {
1061
+ item_id: String,
1062
+ output_index: Integer,
1063
+ sequence_number: Integer,
1064
+ type: Symbol,
1065
+ agent:
1066
+ T.nilable(
1067
+ OpenAI::Beta::BetaResponseFileSearchCallInProgressEvent::Agent
1068
+ ),
1069
+ stream_id: String
1070
+ }
1071
+ )
1072
+ end
1073
+ def to_hash
1074
+ end
1075
+ end
1076
+
1077
+ class BetaResponseFileSearchCallWsSearching < OpenAI::Models::Beta::BetaResponseFileSearchCallSearchingEvent
1078
+ OrHash =
1079
+ T.type_alias do
1080
+ T.any(
1081
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFileSearchCallWsSearching,
1082
+ OpenAI::Internal::AnyHash
1083
+ )
1084
+ end
1085
+
1086
+ # The WebSocket lane that emitted this event. This field is present when the
1087
+ # originating `response.create` event supplied a `stream_id`.
1088
+ sig { returns(T.nilable(String)) }
1089
+ attr_reader :stream_id
1090
+
1091
+ sig { params(stream_id: String).void }
1092
+ attr_writer :stream_id
1093
+
1094
+ # Emitted when a file search is currently searching.
1095
+ sig do
1096
+ params(
1097
+ item_id: String,
1098
+ output_index: Integer,
1099
+ sequence_number: Integer,
1100
+ agent:
1101
+ T.nilable(
1102
+ OpenAI::Beta::BetaResponseFileSearchCallSearchingEvent::Agent::OrHash
1103
+ ),
1104
+ type: Symbol,
1105
+ stream_id: String
1106
+ ).returns(T.attached_class)
1107
+ end
1108
+ def self.new(
1109
+ # The ID of the output item that the file search call is initiated.
1110
+ item_id:,
1111
+ # The index of the output item that the file search call is searching.
1112
+ output_index:,
1113
+ # The sequence number of this event.
1114
+ sequence_number:,
1115
+ # The agent that owns this multi-agent streaming event.
1116
+ agent: nil,
1117
+ # The type of the event. Always `response.file_search_call.searching`.
1118
+ type: :"response.file_search_call.searching",
1119
+ # The WebSocket lane that emitted this event.
1120
+ # This field is present when the originating response.create supplied a stream_id.
1121
+ stream_id: nil
1122
+ )
1123
+ end
1124
+
1125
+ sig do
1126
+ override.returns(
1127
+ {
1128
+ item_id: String,
1129
+ output_index: Integer,
1130
+ sequence_number: Integer,
1131
+ type: Symbol,
1132
+ agent:
1133
+ T.nilable(
1134
+ OpenAI::Beta::BetaResponseFileSearchCallSearchingEvent::Agent
1135
+ ),
1136
+ stream_id: String
1137
+ }
1138
+ )
1139
+ end
1140
+ def to_hash
1141
+ end
1142
+ end
1143
+
1144
+ class BetaResponseFunctionCallArgumentsWsDelta < OpenAI::Models::Beta::BetaResponseFunctionCallArgumentsDeltaEvent
1145
+ OrHash =
1146
+ T.type_alias do
1147
+ T.any(
1148
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFunctionCallArgumentsWsDelta,
1149
+ OpenAI::Internal::AnyHash
1150
+ )
1151
+ end
1152
+
1153
+ # The WebSocket lane that emitted this event. This field is present when the
1154
+ # originating `response.create` event supplied a `stream_id`.
1155
+ sig { returns(T.nilable(String)) }
1156
+ attr_reader :stream_id
1157
+
1158
+ sig { params(stream_id: String).void }
1159
+ attr_writer :stream_id
1160
+
1161
+ # Emitted when there is a partial function-call arguments delta.
1162
+ sig do
1163
+ params(
1164
+ delta: String,
1165
+ item_id: String,
1166
+ output_index: Integer,
1167
+ sequence_number: Integer,
1168
+ agent:
1169
+ T.nilable(
1170
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDeltaEvent::Agent::OrHash
1171
+ ),
1172
+ type: Symbol,
1173
+ stream_id: String
1174
+ ).returns(T.attached_class)
1175
+ end
1176
+ def self.new(
1177
+ # The function-call arguments delta that is added.
1178
+ delta:,
1179
+ # The ID of the output item that the function-call arguments delta is added to.
1180
+ item_id:,
1181
+ # The index of the output item that the function-call arguments delta is added to.
1182
+ output_index:,
1183
+ # The sequence number of this event.
1184
+ sequence_number:,
1185
+ # The agent that owns this multi-agent streaming event.
1186
+ agent: nil,
1187
+ # The type of the event. Always `response.function_call_arguments.delta`.
1188
+ type: :"response.function_call_arguments.delta",
1189
+ # The WebSocket lane that emitted this event.
1190
+ # This field is present when the originating response.create supplied a stream_id.
1191
+ stream_id: nil
1192
+ )
1193
+ end
1194
+
1195
+ sig do
1196
+ override.returns(
1197
+ {
1198
+ delta: String,
1199
+ item_id: String,
1200
+ output_index: Integer,
1201
+ sequence_number: Integer,
1202
+ type: Symbol,
1203
+ agent:
1204
+ T.nilable(
1205
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDeltaEvent::Agent
1206
+ ),
1207
+ stream_id: String
1208
+ }
1209
+ )
1210
+ end
1211
+ def to_hash
1212
+ end
1213
+ end
1214
+
1215
+ class BetaResponseFunctionCallArgumentsWsDone < OpenAI::Models::Beta::BetaResponseFunctionCallArgumentsDoneEvent
1216
+ OrHash =
1217
+ T.type_alias do
1218
+ T.any(
1219
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseFunctionCallArgumentsWsDone,
1220
+ OpenAI::Internal::AnyHash
1221
+ )
1222
+ end
1223
+
1224
+ # The WebSocket lane that emitted this event. This field is present when the
1225
+ # originating `response.create` event supplied a `stream_id`.
1226
+ sig { returns(T.nilable(String)) }
1227
+ attr_reader :stream_id
1228
+
1229
+ sig { params(stream_id: String).void }
1230
+ attr_writer :stream_id
1231
+
1232
+ # Emitted when function-call arguments are finalized.
1233
+ sig do
1234
+ params(
1235
+ arguments: String,
1236
+ item_id: String,
1237
+ name: String,
1238
+ output_index: Integer,
1239
+ sequence_number: Integer,
1240
+ agent:
1241
+ T.nilable(
1242
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDoneEvent::Agent::OrHash
1243
+ ),
1244
+ type: Symbol,
1245
+ stream_id: String
1246
+ ).returns(T.attached_class)
1247
+ end
1248
+ def self.new(
1249
+ # The function-call arguments.
1250
+ arguments:,
1251
+ # The ID of the item.
1252
+ item_id:,
1253
+ # The name of the function that was called.
1254
+ name:,
1255
+ # The index of the output item.
1256
+ output_index:,
1257
+ # The sequence number of this event.
1258
+ sequence_number:,
1259
+ # The agent that owns this multi-agent streaming event.
1260
+ agent: nil,
1261
+ type: :"response.function_call_arguments.done",
1262
+ # The WebSocket lane that emitted this event.
1263
+ # This field is present when the originating response.create supplied a stream_id.
1264
+ stream_id: nil
1265
+ )
1266
+ end
1267
+
1268
+ sig do
1269
+ override.returns(
1270
+ {
1271
+ arguments: String,
1272
+ item_id: String,
1273
+ name: String,
1274
+ output_index: Integer,
1275
+ sequence_number: Integer,
1276
+ type: Symbol,
1277
+ agent:
1278
+ T.nilable(
1279
+ OpenAI::Beta::BetaResponseFunctionCallArgumentsDoneEvent::Agent
1280
+ ),
1281
+ stream_id: String
1282
+ }
1283
+ )
1284
+ end
1285
+ def to_hash
1286
+ end
1287
+ end
1288
+
1289
+ class BetaResponseInWsProgress < OpenAI::Models::Beta::BetaResponseInProgressEvent
1290
+ OrHash =
1291
+ T.type_alias do
1292
+ T.any(
1293
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseInWsProgress,
1294
+ OpenAI::Internal::AnyHash
1295
+ )
1296
+ end
1297
+
1298
+ # The WebSocket lane that emitted this event. This field is present when the
1299
+ # originating `response.create` event supplied a `stream_id`.
1300
+ sig { returns(T.nilable(String)) }
1301
+ attr_reader :stream_id
1302
+
1303
+ sig { params(stream_id: String).void }
1304
+ attr_writer :stream_id
1305
+
1306
+ # Emitted when the response is in progress.
1307
+ sig do
1308
+ params(
1309
+ response: OpenAI::Beta::BetaResponse::OrHash,
1310
+ sequence_number: Integer,
1311
+ agent:
1312
+ T.nilable(
1313
+ OpenAI::Beta::BetaResponseInProgressEvent::Agent::OrHash
1314
+ ),
1315
+ type: Symbol,
1316
+ stream_id: String
1317
+ ).returns(T.attached_class)
1318
+ end
1319
+ def self.new(
1320
+ # The response that is in progress.
1321
+ response:,
1322
+ # The sequence number of this event.
1323
+ sequence_number:,
1324
+ # The agent that owns this multi-agent streaming event.
1325
+ agent: nil,
1326
+ # The type of the event. Always `response.in_progress`.
1327
+ type: :"response.in_progress",
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
+ response: OpenAI::Beta::BetaResponse,
1338
+ sequence_number: Integer,
1339
+ type: Symbol,
1340
+ agent:
1341
+ T.nilable(OpenAI::Beta::BetaResponseInProgressEvent::Agent),
1342
+ stream_id: String
1343
+ }
1344
+ )
1345
+ end
1346
+ def to_hash
1347
+ end
1348
+ end
1349
+
1350
+ class BetaResponseWsFailed < OpenAI::Models::Beta::BetaResponseFailedEvent
1351
+ OrHash =
1352
+ T.type_alias do
1353
+ T.any(
1354
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsFailed,
1355
+ OpenAI::Internal::AnyHash
1356
+ )
1357
+ end
1358
+
1359
+ # The WebSocket lane that emitted this event. This field is present when the
1360
+ # originating `response.create` event supplied a `stream_id`.
1361
+ sig { returns(T.nilable(String)) }
1362
+ attr_reader :stream_id
1363
+
1364
+ sig { params(stream_id: String).void }
1365
+ attr_writer :stream_id
1366
+
1367
+ # An event that is emitted when a response fails.
1368
+ sig do
1369
+ params(
1370
+ response: OpenAI::Beta::BetaResponse::OrHash,
1371
+ sequence_number: Integer,
1372
+ agent:
1373
+ T.nilable(OpenAI::Beta::BetaResponseFailedEvent::Agent::OrHash),
1374
+ type: Symbol,
1375
+ stream_id: String
1376
+ ).returns(T.attached_class)
1377
+ end
1378
+ def self.new(
1379
+ # The response that failed.
1380
+ response:,
1381
+ # The sequence number of this event.
1382
+ sequence_number:,
1383
+ # The agent that owns this multi-agent streaming event.
1384
+ agent: nil,
1385
+ # The type of the event. Always `response.failed`.
1386
+ type: :"response.failed",
1387
+ # The WebSocket lane that emitted this event.
1388
+ # This field is present when the originating response.create supplied a stream_id.
1389
+ stream_id: nil
1390
+ )
1391
+ end
1392
+
1393
+ sig do
1394
+ override.returns(
1395
+ {
1396
+ response: OpenAI::Beta::BetaResponse,
1397
+ sequence_number: Integer,
1398
+ type: Symbol,
1399
+ agent: T.nilable(OpenAI::Beta::BetaResponseFailedEvent::Agent),
1400
+ stream_id: String
1401
+ }
1402
+ )
1403
+ end
1404
+ def to_hash
1405
+ end
1406
+ end
1407
+
1408
+ class BetaResponseWsIncomplete < OpenAI::Models::Beta::BetaResponseIncompleteEvent
1409
+ OrHash =
1410
+ T.type_alias do
1411
+ T.any(
1412
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsIncomplete,
1413
+ OpenAI::Internal::AnyHash
1414
+ )
1415
+ end
1416
+
1417
+ # The WebSocket lane that emitted this event. This field is present when the
1418
+ # originating `response.create` event supplied a `stream_id`.
1419
+ sig { returns(T.nilable(String)) }
1420
+ attr_reader :stream_id
1421
+
1422
+ sig { params(stream_id: String).void }
1423
+ attr_writer :stream_id
1424
+
1425
+ # An event that is emitted when a response finishes as incomplete.
1426
+ sig do
1427
+ params(
1428
+ response: OpenAI::Beta::BetaResponse::OrHash,
1429
+ sequence_number: Integer,
1430
+ agent:
1431
+ T.nilable(
1432
+ OpenAI::Beta::BetaResponseIncompleteEvent::Agent::OrHash
1433
+ ),
1434
+ type: Symbol,
1435
+ stream_id: String
1436
+ ).returns(T.attached_class)
1437
+ end
1438
+ def self.new(
1439
+ # The response that was incomplete.
1440
+ response:,
1441
+ # The sequence number of this event.
1442
+ sequence_number:,
1443
+ # The agent that owns this multi-agent streaming event.
1444
+ agent: nil,
1445
+ # The type of the event. Always `response.incomplete`.
1446
+ type: :"response.incomplete",
1447
+ # The WebSocket lane that emitted this event.
1448
+ # This field is present when the originating response.create supplied a stream_id.
1449
+ stream_id: nil
1450
+ )
1451
+ end
1452
+
1453
+ sig do
1454
+ override.returns(
1455
+ {
1456
+ response: OpenAI::Beta::BetaResponse,
1457
+ sequence_number: Integer,
1458
+ type: Symbol,
1459
+ agent:
1460
+ T.nilable(OpenAI::Beta::BetaResponseIncompleteEvent::Agent),
1461
+ stream_id: String
1462
+ }
1463
+ )
1464
+ end
1465
+ def to_hash
1466
+ end
1467
+ end
1468
+
1469
+ class BetaResponseOutputItemWsAdded < OpenAI::Models::Beta::BetaResponseOutputItemAddedEvent
1470
+ OrHash =
1471
+ T.type_alias do
1472
+ T.any(
1473
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputItemWsAdded,
1474
+ OpenAI::Internal::AnyHash
1475
+ )
1476
+ end
1477
+
1478
+ # The WebSocket lane that emitted this event. This field is present when the
1479
+ # originating `response.create` event supplied a `stream_id`.
1480
+ sig { returns(T.nilable(String)) }
1481
+ attr_reader :stream_id
1482
+
1483
+ sig { params(stream_id: String).void }
1484
+ attr_writer :stream_id
1485
+
1486
+ # Emitted when a new output item is added.
1487
+ sig do
1488
+ params(
1489
+ item:
1490
+ T.any(
1491
+ OpenAI::Beta::BetaResponseOutputMessage::OrHash,
1492
+ OpenAI::Beta::BetaResponseFileSearchToolCall::OrHash,
1493
+ OpenAI::Beta::BetaResponseFunctionToolCall::OrHash,
1494
+ OpenAI::Beta::BetaResponseFunctionToolCallOutputItem::OrHash,
1495
+ OpenAI::Beta::BetaResponseOutputItem::AgentMessage::OrHash,
1496
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCall::OrHash,
1497
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCallOutput::OrHash,
1498
+ OpenAI::Beta::BetaResponseFunctionWebSearch::OrHash,
1499
+ OpenAI::Beta::BetaResponseComputerToolCall::OrHash,
1500
+ OpenAI::Beta::BetaResponseComputerToolCallOutputItem::OrHash,
1501
+ OpenAI::Beta::BetaResponseReasoningItem::OrHash,
1502
+ OpenAI::Beta::BetaResponseOutputItem::Program::OrHash,
1503
+ OpenAI::Beta::BetaResponseOutputItem::ProgramOutput::OrHash,
1504
+ OpenAI::Beta::BetaResponseToolSearchCall::OrHash,
1505
+ OpenAI::Beta::BetaResponseToolSearchOutputItem::OrHash,
1506
+ OpenAI::Beta::BetaResponseOutputItem::AdditionalTools::OrHash,
1507
+ OpenAI::Beta::BetaResponseCompactionItem::OrHash,
1508
+ OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::OrHash,
1509
+ OpenAI::Beta::BetaResponseCodeInterpreterToolCall::OrHash,
1510
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCall::OrHash,
1511
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCallOutput::OrHash,
1512
+ OpenAI::Beta::BetaResponseFunctionShellToolCall::OrHash,
1513
+ OpenAI::Beta::BetaResponseFunctionShellToolCallOutput::OrHash,
1514
+ OpenAI::Beta::BetaResponseApplyPatchToolCall::OrHash,
1515
+ OpenAI::Beta::BetaResponseApplyPatchToolCallOutput::OrHash,
1516
+ OpenAI::Beta::BetaResponseOutputItem::McpCall::OrHash,
1517
+ OpenAI::Beta::BetaResponseOutputItem::McpListTools::OrHash,
1518
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalRequest::OrHash,
1519
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalResponse::OrHash,
1520
+ OpenAI::Beta::BetaResponseCustomToolCall::OrHash,
1521
+ OpenAI::Beta::BetaResponseCustomToolCallOutputItem::OrHash
1522
+ ),
1523
+ output_index: Integer,
1524
+ sequence_number: Integer,
1525
+ agent:
1526
+ T.nilable(
1527
+ OpenAI::Beta::BetaResponseOutputItemAddedEvent::Agent::OrHash
1528
+ ),
1529
+ type: Symbol,
1530
+ stream_id: String
1531
+ ).returns(T.attached_class)
1532
+ end
1533
+ def self.new(
1534
+ # The output item that was added.
1535
+ item:,
1536
+ # The index of the output item that was added.
1537
+ output_index:,
1538
+ # The sequence number of this event.
1539
+ sequence_number:,
1540
+ # The agent that owns this multi-agent streaming event.
1541
+ agent: nil,
1542
+ # The type of the event. Always `response.output_item.added`.
1543
+ type: :"response.output_item.added",
1544
+ # The WebSocket lane that emitted this event.
1545
+ # This field is present when the originating response.create supplied a stream_id.
1546
+ stream_id: nil
1547
+ )
1548
+ end
1549
+
1550
+ sig do
1551
+ override.returns(
1552
+ {
1553
+ item: OpenAI::Beta::BetaResponseOutputItem::Variants,
1554
+ output_index: Integer,
1555
+ sequence_number: Integer,
1556
+ type: Symbol,
1557
+ agent:
1558
+ T.nilable(
1559
+ OpenAI::Beta::BetaResponseOutputItemAddedEvent::Agent
1560
+ ),
1561
+ stream_id: String
1562
+ }
1563
+ )
1564
+ end
1565
+ def to_hash
1566
+ end
1567
+ end
1568
+
1569
+ class BetaResponseOutputItemWsDone < OpenAI::Models::Beta::BetaResponseOutputItemDoneEvent
1570
+ OrHash =
1571
+ T.type_alias do
1572
+ T.any(
1573
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputItemWsDone,
1574
+ OpenAI::Internal::AnyHash
1575
+ )
1576
+ end
1577
+
1578
+ # The WebSocket lane that emitted this event. This field is present when the
1579
+ # originating `response.create` event supplied a `stream_id`.
1580
+ sig { returns(T.nilable(String)) }
1581
+ attr_reader :stream_id
1582
+
1583
+ sig { params(stream_id: String).void }
1584
+ attr_writer :stream_id
1585
+
1586
+ # Emitted when an output item is marked done.
1587
+ sig do
1588
+ params(
1589
+ item:
1590
+ T.any(
1591
+ OpenAI::Beta::BetaResponseOutputMessage::OrHash,
1592
+ OpenAI::Beta::BetaResponseFileSearchToolCall::OrHash,
1593
+ OpenAI::Beta::BetaResponseFunctionToolCall::OrHash,
1594
+ OpenAI::Beta::BetaResponseFunctionToolCallOutputItem::OrHash,
1595
+ OpenAI::Beta::BetaResponseOutputItem::AgentMessage::OrHash,
1596
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCall::OrHash,
1597
+ OpenAI::Beta::BetaResponseOutputItem::MultiAgentCallOutput::OrHash,
1598
+ OpenAI::Beta::BetaResponseFunctionWebSearch::OrHash,
1599
+ OpenAI::Beta::BetaResponseComputerToolCall::OrHash,
1600
+ OpenAI::Beta::BetaResponseComputerToolCallOutputItem::OrHash,
1601
+ OpenAI::Beta::BetaResponseReasoningItem::OrHash,
1602
+ OpenAI::Beta::BetaResponseOutputItem::Program::OrHash,
1603
+ OpenAI::Beta::BetaResponseOutputItem::ProgramOutput::OrHash,
1604
+ OpenAI::Beta::BetaResponseToolSearchCall::OrHash,
1605
+ OpenAI::Beta::BetaResponseToolSearchOutputItem::OrHash,
1606
+ OpenAI::Beta::BetaResponseOutputItem::AdditionalTools::OrHash,
1607
+ OpenAI::Beta::BetaResponseCompactionItem::OrHash,
1608
+ OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::OrHash,
1609
+ OpenAI::Beta::BetaResponseCodeInterpreterToolCall::OrHash,
1610
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCall::OrHash,
1611
+ OpenAI::Beta::BetaResponseOutputItem::LocalShellCallOutput::OrHash,
1612
+ OpenAI::Beta::BetaResponseFunctionShellToolCall::OrHash,
1613
+ OpenAI::Beta::BetaResponseFunctionShellToolCallOutput::OrHash,
1614
+ OpenAI::Beta::BetaResponseApplyPatchToolCall::OrHash,
1615
+ OpenAI::Beta::BetaResponseApplyPatchToolCallOutput::OrHash,
1616
+ OpenAI::Beta::BetaResponseOutputItem::McpCall::OrHash,
1617
+ OpenAI::Beta::BetaResponseOutputItem::McpListTools::OrHash,
1618
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalRequest::OrHash,
1619
+ OpenAI::Beta::BetaResponseOutputItem::McpApprovalResponse::OrHash,
1620
+ OpenAI::Beta::BetaResponseCustomToolCall::OrHash,
1621
+ OpenAI::Beta::BetaResponseCustomToolCallOutputItem::OrHash
1622
+ ),
1623
+ output_index: Integer,
1624
+ sequence_number: Integer,
1625
+ agent:
1626
+ T.nilable(
1627
+ OpenAI::Beta::BetaResponseOutputItemDoneEvent::Agent::OrHash
1628
+ ),
1629
+ type: Symbol,
1630
+ stream_id: String
1631
+ ).returns(T.attached_class)
1632
+ end
1633
+ def self.new(
1634
+ # The output item that was marked done.
1635
+ item:,
1636
+ # The index of the output item that was marked done.
1637
+ output_index:,
1638
+ # The sequence number of this event.
1639
+ sequence_number:,
1640
+ # The agent that owns this multi-agent streaming event.
1641
+ agent: nil,
1642
+ # The type of the event. Always `response.output_item.done`.
1643
+ type: :"response.output_item.done",
1644
+ # The WebSocket lane that emitted this event.
1645
+ # This field is present when the originating response.create supplied a stream_id.
1646
+ stream_id: nil
1647
+ )
1648
+ end
1649
+
1650
+ sig do
1651
+ override.returns(
1652
+ {
1653
+ item: OpenAI::Beta::BetaResponseOutputItem::Variants,
1654
+ output_index: Integer,
1655
+ sequence_number: Integer,
1656
+ type: Symbol,
1657
+ agent:
1658
+ T.nilable(
1659
+ OpenAI::Beta::BetaResponseOutputItemDoneEvent::Agent
1660
+ ),
1661
+ stream_id: String
1662
+ }
1663
+ )
1664
+ end
1665
+ def to_hash
1666
+ end
1667
+ end
1668
+
1669
+ class BetaResponseReasoningSummaryPartWsAdded < OpenAI::Models::Beta::BetaResponseReasoningSummaryPartAddedEvent
1670
+ OrHash =
1671
+ T.type_alias do
1672
+ T.any(
1673
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryPartWsAdded,
1674
+ OpenAI::Internal::AnyHash
1675
+ )
1676
+ end
1677
+
1678
+ # The WebSocket lane that emitted this event. This field is present when the
1679
+ # originating `response.create` event supplied a `stream_id`.
1680
+ sig { returns(T.nilable(String)) }
1681
+ attr_reader :stream_id
1682
+
1683
+ sig { params(stream_id: String).void }
1684
+ attr_writer :stream_id
1685
+
1686
+ # Emitted when a new reasoning summary part is added.
1687
+ sig do
1688
+ params(
1689
+ item_id: String,
1690
+ output_index: Integer,
1691
+ part:
1692
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Part::OrHash,
1693
+ sequence_number: Integer,
1694
+ summary_index: Integer,
1695
+ agent:
1696
+ T.nilable(
1697
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Agent::OrHash
1698
+ ),
1699
+ type: Symbol,
1700
+ stream_id: String
1701
+ ).returns(T.attached_class)
1702
+ end
1703
+ def self.new(
1704
+ # The ID of the item this summary part is associated with.
1705
+ item_id:,
1706
+ # The index of the output item this summary part is associated with.
1707
+ output_index:,
1708
+ # The summary part that was added.
1709
+ part:,
1710
+ # The sequence number of this event.
1711
+ sequence_number:,
1712
+ # The index of the summary part within the reasoning summary.
1713
+ summary_index:,
1714
+ # The agent that owns this multi-agent streaming event.
1715
+ agent: nil,
1716
+ # The type of the event. Always `response.reasoning_summary_part.added`.
1717
+ type: :"response.reasoning_summary_part.added",
1718
+ # The WebSocket lane that emitted this event.
1719
+ # This field is present when the originating response.create supplied a stream_id.
1720
+ stream_id: nil
1721
+ )
1722
+ end
1723
+
1724
+ sig do
1725
+ override.returns(
1726
+ {
1727
+ item_id: String,
1728
+ output_index: Integer,
1729
+ part:
1730
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Part,
1731
+ sequence_number: Integer,
1732
+ summary_index: Integer,
1733
+ type: Symbol,
1734
+ agent:
1735
+ T.nilable(
1736
+ OpenAI::Beta::BetaResponseReasoningSummaryPartAddedEvent::Agent
1737
+ ),
1738
+ stream_id: String
1739
+ }
1740
+ )
1741
+ end
1742
+ def to_hash
1743
+ end
1744
+ end
1745
+
1746
+ class BetaResponseReasoningSummaryPartWsDone < OpenAI::Models::Beta::BetaResponseReasoningSummaryPartDoneEvent
1747
+ OrHash =
1748
+ T.type_alias do
1749
+ T.any(
1750
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryPartWsDone,
1751
+ OpenAI::Internal::AnyHash
1752
+ )
1753
+ end
1754
+
1755
+ # The WebSocket lane that emitted this event. This field is present when the
1756
+ # originating `response.create` event supplied a `stream_id`.
1757
+ sig { returns(T.nilable(String)) }
1758
+ attr_reader :stream_id
1759
+
1760
+ sig { params(stream_id: String).void }
1761
+ attr_writer :stream_id
1762
+
1763
+ # Emitted when a reasoning summary part is completed.
1764
+ sig do
1765
+ params(
1766
+ item_id: String,
1767
+ output_index: Integer,
1768
+ part:
1769
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Part::OrHash,
1770
+ sequence_number: Integer,
1771
+ summary_index: Integer,
1772
+ agent:
1773
+ T.nilable(
1774
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Agent::OrHash
1775
+ ),
1776
+ status:
1777
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Status::OrSymbol,
1778
+ type: Symbol,
1779
+ stream_id: String
1780
+ ).returns(T.attached_class)
1781
+ end
1782
+ def self.new(
1783
+ # The ID of the item this summary part is associated with.
1784
+ item_id:,
1785
+ # The index of the output item this summary part is associated with.
1786
+ output_index:,
1787
+ # The completed summary part.
1788
+ part:,
1789
+ # The sequence number of this event.
1790
+ sequence_number:,
1791
+ # The index of the summary part within the reasoning summary.
1792
+ summary_index:,
1793
+ # The agent that owns this multi-agent streaming event.
1794
+ agent: nil,
1795
+ # The completion status of the summary part. Omitted when the part completed
1796
+ # normally and set to `incomplete` when generation was interrupted.
1797
+ status: nil,
1798
+ # The type of the event. Always `response.reasoning_summary_part.done`.
1799
+ type: :"response.reasoning_summary_part.done",
1800
+ # The WebSocket lane that emitted this event.
1801
+ # This field is present when the originating response.create supplied a stream_id.
1802
+ stream_id: nil
1803
+ )
1804
+ end
1805
+
1806
+ sig do
1807
+ override.returns(
1808
+ {
1809
+ item_id: String,
1810
+ output_index: Integer,
1811
+ part:
1812
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Part,
1813
+ sequence_number: Integer,
1814
+ summary_index: Integer,
1815
+ type: Symbol,
1816
+ agent:
1817
+ T.nilable(
1818
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Agent
1819
+ ),
1820
+ status:
1821
+ OpenAI::Beta::BetaResponseReasoningSummaryPartDoneEvent::Status::TaggedSymbol,
1822
+ stream_id: String
1823
+ }
1824
+ )
1825
+ end
1826
+ def to_hash
1827
+ end
1828
+ end
1829
+
1830
+ class BetaResponseReasoningSummaryTextWsDelta < OpenAI::Models::Beta::BetaResponseReasoningSummaryTextDeltaEvent
1831
+ OrHash =
1832
+ T.type_alias do
1833
+ T.any(
1834
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryTextWsDelta,
1835
+ OpenAI::Internal::AnyHash
1836
+ )
1837
+ end
1838
+
1839
+ # The WebSocket lane that emitted this event. This field is present when the
1840
+ # originating `response.create` event supplied a `stream_id`.
1841
+ sig { returns(T.nilable(String)) }
1842
+ attr_reader :stream_id
1843
+
1844
+ sig { params(stream_id: String).void }
1845
+ attr_writer :stream_id
1846
+
1847
+ # Emitted when a delta is added to a reasoning summary text.
1848
+ sig do
1849
+ params(
1850
+ delta: String,
1851
+ item_id: String,
1852
+ output_index: Integer,
1853
+ sequence_number: Integer,
1854
+ summary_index: Integer,
1855
+ agent:
1856
+ T.nilable(
1857
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDeltaEvent::Agent::OrHash
1858
+ ),
1859
+ type: Symbol,
1860
+ stream_id: String
1861
+ ).returns(T.attached_class)
1862
+ end
1863
+ def self.new(
1864
+ # The text delta that was added to the summary.
1865
+ delta:,
1866
+ # The ID of the item this summary text delta is associated with.
1867
+ item_id:,
1868
+ # The index of the output item this summary text delta is associated with.
1869
+ output_index:,
1870
+ # The sequence number of this event.
1871
+ sequence_number:,
1872
+ # The index of the summary part within the reasoning summary.
1873
+ summary_index:,
1874
+ # The agent that owns this multi-agent streaming event.
1875
+ agent: nil,
1876
+ # The type of the event. Always `response.reasoning_summary_text.delta`.
1877
+ type: :"response.reasoning_summary_text.delta",
1878
+ # The WebSocket lane that emitted this event.
1879
+ # This field is present when the originating response.create supplied a stream_id.
1880
+ stream_id: nil
1881
+ )
1882
+ end
1883
+
1884
+ sig do
1885
+ override.returns(
1886
+ {
1887
+ delta: String,
1888
+ item_id: String,
1889
+ output_index: Integer,
1890
+ sequence_number: Integer,
1891
+ summary_index: Integer,
1892
+ type: Symbol,
1893
+ agent:
1894
+ T.nilable(
1895
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDeltaEvent::Agent
1896
+ ),
1897
+ stream_id: String
1898
+ }
1899
+ )
1900
+ end
1901
+ def to_hash
1902
+ end
1903
+ end
1904
+
1905
+ class BetaResponseReasoningSummaryTextWsDone < OpenAI::Models::Beta::BetaResponseReasoningSummaryTextDoneEvent
1906
+ OrHash =
1907
+ T.type_alias do
1908
+ T.any(
1909
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningSummaryTextWsDone,
1910
+ OpenAI::Internal::AnyHash
1911
+ )
1912
+ end
1913
+
1914
+ # The WebSocket lane that emitted this event. This field is present when the
1915
+ # originating `response.create` event supplied a `stream_id`.
1916
+ sig { returns(T.nilable(String)) }
1917
+ attr_reader :stream_id
1918
+
1919
+ sig { params(stream_id: String).void }
1920
+ attr_writer :stream_id
1921
+
1922
+ # Emitted when a reasoning summary text is completed.
1923
+ sig do
1924
+ params(
1925
+ item_id: String,
1926
+ output_index: Integer,
1927
+ sequence_number: Integer,
1928
+ summary_index: Integer,
1929
+ text: String,
1930
+ agent:
1931
+ T.nilable(
1932
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDoneEvent::Agent::OrHash
1933
+ ),
1934
+ type: Symbol,
1935
+ stream_id: String
1936
+ ).returns(T.attached_class)
1937
+ end
1938
+ def self.new(
1939
+ # The ID of the item this summary text is associated with.
1940
+ item_id:,
1941
+ # The index of the output item this summary text is associated with.
1942
+ output_index:,
1943
+ # The sequence number of this event.
1944
+ sequence_number:,
1945
+ # The index of the summary part within the reasoning summary.
1946
+ summary_index:,
1947
+ # The full text of the completed reasoning summary.
1948
+ text:,
1949
+ # The agent that owns this multi-agent streaming event.
1950
+ agent: nil,
1951
+ # The type of the event. Always `response.reasoning_summary_text.done`.
1952
+ type: :"response.reasoning_summary_text.done",
1953
+ # The WebSocket lane that emitted this event.
1954
+ # This field is present when the originating response.create supplied a stream_id.
1955
+ stream_id: nil
1956
+ )
1957
+ end
1958
+
1959
+ sig do
1960
+ override.returns(
1961
+ {
1962
+ item_id: String,
1963
+ output_index: Integer,
1964
+ sequence_number: Integer,
1965
+ summary_index: Integer,
1966
+ text: String,
1967
+ type: Symbol,
1968
+ agent:
1969
+ T.nilable(
1970
+ OpenAI::Beta::BetaResponseReasoningSummaryTextDoneEvent::Agent
1971
+ ),
1972
+ stream_id: String
1973
+ }
1974
+ )
1975
+ end
1976
+ def to_hash
1977
+ end
1978
+ end
1979
+
1980
+ class BetaResponseReasoningTextWsDelta < OpenAI::Models::Beta::BetaResponseReasoningTextDeltaEvent
1981
+ OrHash =
1982
+ T.type_alias do
1983
+ T.any(
1984
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningTextWsDelta,
1985
+ OpenAI::Internal::AnyHash
1986
+ )
1987
+ end
1988
+
1989
+ # The WebSocket lane that emitted this event. This field is present when the
1990
+ # originating `response.create` event supplied a `stream_id`.
1991
+ sig { returns(T.nilable(String)) }
1992
+ attr_reader :stream_id
1993
+
1994
+ sig { params(stream_id: String).void }
1995
+ attr_writer :stream_id
1996
+
1997
+ # Emitted when a delta is added to a reasoning text.
1998
+ sig do
1999
+ params(
2000
+ content_index: Integer,
2001
+ delta: String,
2002
+ item_id: String,
2003
+ output_index: Integer,
2004
+ sequence_number: Integer,
2005
+ agent:
2006
+ T.nilable(
2007
+ OpenAI::Beta::BetaResponseReasoningTextDeltaEvent::Agent::OrHash
2008
+ ),
2009
+ type: Symbol,
2010
+ stream_id: String
2011
+ ).returns(T.attached_class)
2012
+ end
2013
+ def self.new(
2014
+ # The index of the reasoning content part this delta is associated with.
2015
+ content_index:,
2016
+ # The text delta that was added to the reasoning content.
2017
+ delta:,
2018
+ # The ID of the item this reasoning text delta is associated with.
2019
+ item_id:,
2020
+ # The index of the output item this reasoning text delta is associated with.
2021
+ output_index:,
2022
+ # The sequence number of this event.
2023
+ sequence_number:,
2024
+ # The agent that owns this multi-agent streaming event.
2025
+ agent: nil,
2026
+ # The type of the event. Always `response.reasoning_text.delta`.
2027
+ type: :"response.reasoning_text.delta",
2028
+ # The WebSocket lane that emitted this event.
2029
+ # This field is present when the originating response.create supplied a stream_id.
2030
+ stream_id: nil
2031
+ )
2032
+ end
2033
+
2034
+ sig do
2035
+ override.returns(
2036
+ {
2037
+ content_index: Integer,
2038
+ delta: String,
2039
+ item_id: String,
2040
+ output_index: Integer,
2041
+ sequence_number: Integer,
2042
+ type: Symbol,
2043
+ agent:
2044
+ T.nilable(
2045
+ OpenAI::Beta::BetaResponseReasoningTextDeltaEvent::Agent
2046
+ ),
2047
+ stream_id: String
2048
+ }
2049
+ )
2050
+ end
2051
+ def to_hash
2052
+ end
2053
+ end
2054
+
2055
+ class BetaResponseReasoningTextWsDone < OpenAI::Models::Beta::BetaResponseReasoningTextDoneEvent
2056
+ OrHash =
2057
+ T.type_alias do
2058
+ T.any(
2059
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseReasoningTextWsDone,
2060
+ OpenAI::Internal::AnyHash
2061
+ )
2062
+ end
2063
+
2064
+ # The WebSocket lane that emitted this event. This field is present when the
2065
+ # originating `response.create` event supplied a `stream_id`.
2066
+ sig { returns(T.nilable(String)) }
2067
+ attr_reader :stream_id
2068
+
2069
+ sig { params(stream_id: String).void }
2070
+ attr_writer :stream_id
2071
+
2072
+ # Emitted when a reasoning text is completed.
2073
+ sig do
2074
+ params(
2075
+ content_index: Integer,
2076
+ item_id: String,
2077
+ output_index: Integer,
2078
+ sequence_number: Integer,
2079
+ text: String,
2080
+ agent:
2081
+ T.nilable(
2082
+ OpenAI::Beta::BetaResponseReasoningTextDoneEvent::Agent::OrHash
2083
+ ),
2084
+ type: Symbol,
2085
+ stream_id: String
2086
+ ).returns(T.attached_class)
2087
+ end
2088
+ def self.new(
2089
+ # The index of the reasoning content part.
2090
+ content_index:,
2091
+ # The ID of the item this reasoning text is associated with.
2092
+ item_id:,
2093
+ # The index of the output item this reasoning text is associated with.
2094
+ output_index:,
2095
+ # The sequence number of this event.
2096
+ sequence_number:,
2097
+ # The full text of the completed reasoning content.
2098
+ text:,
2099
+ # The agent that owns this multi-agent streaming event.
2100
+ agent: nil,
2101
+ # The type of the event. Always `response.reasoning_text.done`.
2102
+ type: :"response.reasoning_text.done",
2103
+ # The WebSocket lane that emitted this event.
2104
+ # This field is present when the originating response.create supplied a stream_id.
2105
+ stream_id: nil
2106
+ )
2107
+ end
2108
+
2109
+ sig do
2110
+ override.returns(
2111
+ {
2112
+ content_index: Integer,
2113
+ item_id: String,
2114
+ output_index: Integer,
2115
+ sequence_number: Integer,
2116
+ text: String,
2117
+ type: Symbol,
2118
+ agent:
2119
+ T.nilable(
2120
+ OpenAI::Beta::BetaResponseReasoningTextDoneEvent::Agent
2121
+ ),
2122
+ stream_id: String
2123
+ }
2124
+ )
2125
+ end
2126
+ def to_hash
2127
+ end
2128
+ end
2129
+
2130
+ class BetaResponseRefusalWsDelta < OpenAI::Models::Beta::BetaResponseRefusalDeltaEvent
2131
+ OrHash =
2132
+ T.type_alias do
2133
+ T.any(
2134
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseRefusalWsDelta,
2135
+ OpenAI::Internal::AnyHash
2136
+ )
2137
+ end
2138
+
2139
+ # The WebSocket lane that emitted this event. This field is present when the
2140
+ # originating `response.create` event supplied a `stream_id`.
2141
+ sig { returns(T.nilable(String)) }
2142
+ attr_reader :stream_id
2143
+
2144
+ sig { params(stream_id: String).void }
2145
+ attr_writer :stream_id
2146
+
2147
+ # Emitted when there is a partial refusal text.
2148
+ sig do
2149
+ params(
2150
+ content_index: Integer,
2151
+ delta: String,
2152
+ item_id: String,
2153
+ output_index: Integer,
2154
+ sequence_number: Integer,
2155
+ agent:
2156
+ T.nilable(
2157
+ OpenAI::Beta::BetaResponseRefusalDeltaEvent::Agent::OrHash
2158
+ ),
2159
+ type: Symbol,
2160
+ stream_id: String
2161
+ ).returns(T.attached_class)
2162
+ end
2163
+ def self.new(
2164
+ # The index of the content part that the refusal text is added to.
2165
+ content_index:,
2166
+ # The refusal text that is added.
2167
+ delta:,
2168
+ # The ID of the output item that the refusal text is added to.
2169
+ item_id:,
2170
+ # The index of the output item that the refusal text is added to.
2171
+ output_index:,
2172
+ # The sequence number of this event.
2173
+ sequence_number:,
2174
+ # The agent that owns this multi-agent streaming event.
2175
+ agent: nil,
2176
+ # The type of the event. Always `response.refusal.delta`.
2177
+ type: :"response.refusal.delta",
2178
+ # The WebSocket lane that emitted this event.
2179
+ # This field is present when the originating response.create supplied a stream_id.
2180
+ stream_id: nil
2181
+ )
2182
+ end
2183
+
2184
+ sig do
2185
+ override.returns(
2186
+ {
2187
+ content_index: Integer,
2188
+ delta: String,
2189
+ item_id: String,
2190
+ output_index: Integer,
2191
+ sequence_number: Integer,
2192
+ type: Symbol,
2193
+ agent:
2194
+ T.nilable(OpenAI::Beta::BetaResponseRefusalDeltaEvent::Agent),
2195
+ stream_id: String
2196
+ }
2197
+ )
2198
+ end
2199
+ def to_hash
2200
+ end
2201
+ end
2202
+
2203
+ class BetaResponseRefusalWsDone < OpenAI::Models::Beta::BetaResponseRefusalDoneEvent
2204
+ OrHash =
2205
+ T.type_alias do
2206
+ T.any(
2207
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseRefusalWsDone,
2208
+ OpenAI::Internal::AnyHash
2209
+ )
2210
+ end
2211
+
2212
+ # The WebSocket lane that emitted this event. This field is present when the
2213
+ # originating `response.create` event supplied a `stream_id`.
2214
+ sig { returns(T.nilable(String)) }
2215
+ attr_reader :stream_id
2216
+
2217
+ sig { params(stream_id: String).void }
2218
+ attr_writer :stream_id
2219
+
2220
+ # Emitted when refusal text is finalized.
2221
+ sig do
2222
+ params(
2223
+ content_index: Integer,
2224
+ item_id: String,
2225
+ output_index: Integer,
2226
+ refusal: String,
2227
+ sequence_number: Integer,
2228
+ agent:
2229
+ T.nilable(
2230
+ OpenAI::Beta::BetaResponseRefusalDoneEvent::Agent::OrHash
2231
+ ),
2232
+ type: Symbol,
2233
+ stream_id: String
2234
+ ).returns(T.attached_class)
2235
+ end
2236
+ def self.new(
2237
+ # The index of the content part that the refusal text is finalized.
2238
+ content_index:,
2239
+ # The ID of the output item that the refusal text is finalized.
2240
+ item_id:,
2241
+ # The index of the output item that the refusal text is finalized.
2242
+ output_index:,
2243
+ # The refusal text that is finalized.
2244
+ refusal:,
2245
+ # The sequence number of this event.
2246
+ sequence_number:,
2247
+ # The agent that owns this multi-agent streaming event.
2248
+ agent: nil,
2249
+ # The type of the event. Always `response.refusal.done`.
2250
+ type: :"response.refusal.done",
2251
+ # The WebSocket lane that emitted this event.
2252
+ # This field is present when the originating response.create supplied a stream_id.
2253
+ stream_id: nil
2254
+ )
2255
+ end
2256
+
2257
+ sig do
2258
+ override.returns(
2259
+ {
2260
+ content_index: Integer,
2261
+ item_id: String,
2262
+ output_index: Integer,
2263
+ refusal: String,
2264
+ sequence_number: Integer,
2265
+ type: Symbol,
2266
+ agent:
2267
+ T.nilable(OpenAI::Beta::BetaResponseRefusalDoneEvent::Agent),
2268
+ stream_id: String
2269
+ }
2270
+ )
2271
+ end
2272
+ def to_hash
2273
+ end
2274
+ end
2275
+
2276
+ class BetaResponseTextWsDelta < OpenAI::Models::Beta::BetaResponseTextDeltaEvent
2277
+ OrHash =
2278
+ T.type_alias do
2279
+ T.any(
2280
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseTextWsDelta,
2281
+ OpenAI::Internal::AnyHash
2282
+ )
2283
+ end
2284
+
2285
+ # The WebSocket lane that emitted this event. This field is present when the
2286
+ # originating `response.create` event supplied a `stream_id`.
2287
+ sig { returns(T.nilable(String)) }
2288
+ attr_reader :stream_id
2289
+
2290
+ sig { params(stream_id: String).void }
2291
+ attr_writer :stream_id
2292
+
2293
+ # Emitted when there is an additional text delta.
2294
+ sig do
2295
+ params(
2296
+ content_index: Integer,
2297
+ delta: String,
2298
+ item_id: String,
2299
+ logprobs:
2300
+ T::Array[
2301
+ OpenAI::Beta::BetaResponseTextDeltaEvent::Logprob::OrHash
2302
+ ],
2303
+ output_index: Integer,
2304
+ sequence_number: Integer,
2305
+ agent:
2306
+ T.nilable(
2307
+ OpenAI::Beta::BetaResponseTextDeltaEvent::Agent::OrHash
2308
+ ),
2309
+ type: Symbol,
2310
+ stream_id: String
2311
+ ).returns(T.attached_class)
2312
+ end
2313
+ def self.new(
2314
+ # The index of the content part that the text delta was added to.
2315
+ content_index:,
2316
+ # The text delta that was added.
2317
+ delta:,
2318
+ # The ID of the output item that the text delta was added to.
2319
+ item_id:,
2320
+ # The log probabilities of the tokens in the delta.
2321
+ logprobs:,
2322
+ # The index of the output item that the text delta was added to.
2323
+ output_index:,
2324
+ # The sequence number for this event.
2325
+ sequence_number:,
2326
+ # The agent that owns this multi-agent streaming event.
2327
+ agent: nil,
2328
+ # The type of the event. Always `response.output_text.delta`.
2329
+ type: :"response.output_text.delta",
2330
+ # The WebSocket lane that emitted this event.
2331
+ # This field is present when the originating response.create supplied a stream_id.
2332
+ stream_id: nil
2333
+ )
2334
+ end
2335
+
2336
+ sig do
2337
+ override.returns(
2338
+ {
2339
+ content_index: Integer,
2340
+ delta: String,
2341
+ item_id: String,
2342
+ logprobs:
2343
+ T::Array[OpenAI::Beta::BetaResponseTextDeltaEvent::Logprob],
2344
+ output_index: Integer,
2345
+ sequence_number: Integer,
2346
+ type: Symbol,
2347
+ agent:
2348
+ T.nilable(OpenAI::Beta::BetaResponseTextDeltaEvent::Agent),
2349
+ stream_id: String
2350
+ }
2351
+ )
2352
+ end
2353
+ def to_hash
2354
+ end
2355
+ end
2356
+
2357
+ class BetaResponseTextWsDone < OpenAI::Models::Beta::BetaResponseTextDoneEvent
2358
+ OrHash =
2359
+ T.type_alias do
2360
+ T.any(
2361
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseTextWsDone,
2362
+ OpenAI::Internal::AnyHash
2363
+ )
2364
+ end
2365
+
2366
+ # The WebSocket lane that emitted this event. This field is present when the
2367
+ # originating `response.create` event supplied a `stream_id`.
2368
+ sig { returns(T.nilable(String)) }
2369
+ attr_reader :stream_id
2370
+
2371
+ sig { params(stream_id: String).void }
2372
+ attr_writer :stream_id
2373
+
2374
+ # Emitted when text content is finalized.
2375
+ sig do
2376
+ params(
2377
+ content_index: Integer,
2378
+ item_id: String,
2379
+ logprobs:
2380
+ T::Array[
2381
+ OpenAI::Beta::BetaResponseTextDoneEvent::Logprob::OrHash
2382
+ ],
2383
+ output_index: Integer,
2384
+ sequence_number: Integer,
2385
+ text: String,
2386
+ agent:
2387
+ T.nilable(
2388
+ OpenAI::Beta::BetaResponseTextDoneEvent::Agent::OrHash
2389
+ ),
2390
+ type: Symbol,
2391
+ stream_id: String
2392
+ ).returns(T.attached_class)
2393
+ end
2394
+ def self.new(
2395
+ # The index of the content part that the text content is finalized.
2396
+ content_index:,
2397
+ # The ID of the output item that the text content is finalized.
2398
+ item_id:,
2399
+ # The log probabilities of the tokens in the delta.
2400
+ logprobs:,
2401
+ # The index of the output item that the text content is finalized.
2402
+ output_index:,
2403
+ # The sequence number for this event.
2404
+ sequence_number:,
2405
+ # The text content that is finalized.
2406
+ text:,
2407
+ # The agent that owns this multi-agent streaming event.
2408
+ agent: nil,
2409
+ # The type of the event. Always `response.output_text.done`.
2410
+ type: :"response.output_text.done",
2411
+ # The WebSocket lane that emitted this event.
2412
+ # This field is present when the originating response.create supplied a stream_id.
2413
+ stream_id: nil
2414
+ )
2415
+ end
2416
+
2417
+ sig do
2418
+ override.returns(
2419
+ {
2420
+ content_index: Integer,
2421
+ item_id: String,
2422
+ logprobs:
2423
+ T::Array[OpenAI::Beta::BetaResponseTextDoneEvent::Logprob],
2424
+ output_index: Integer,
2425
+ sequence_number: Integer,
2426
+ text: String,
2427
+ type: Symbol,
2428
+ agent:
2429
+ T.nilable(OpenAI::Beta::BetaResponseTextDoneEvent::Agent),
2430
+ stream_id: String
2431
+ }
2432
+ )
2433
+ end
2434
+ def to_hash
2435
+ end
2436
+ end
2437
+
2438
+ class BetaResponseWebSearchCallWsCompleted < OpenAI::Models::Beta::BetaResponseWebSearchCallCompletedEvent
2439
+ OrHash =
2440
+ T.type_alias do
2441
+ T.any(
2442
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallWsCompleted,
2443
+ OpenAI::Internal::AnyHash
2444
+ )
2445
+ end
2446
+
2447
+ # The WebSocket lane that emitted this event. This field is present when the
2448
+ # originating `response.create` event supplied a `stream_id`.
2449
+ sig { returns(T.nilable(String)) }
2450
+ attr_reader :stream_id
2451
+
2452
+ sig { params(stream_id: String).void }
2453
+ attr_writer :stream_id
2454
+
2455
+ # Emitted when a web search call is completed.
2456
+ sig do
2457
+ params(
2458
+ item_id: String,
2459
+ output_index: Integer,
2460
+ sequence_number: Integer,
2461
+ agent:
2462
+ T.nilable(
2463
+ OpenAI::Beta::BetaResponseWebSearchCallCompletedEvent::Agent::OrHash
2464
+ ),
2465
+ type: Symbol,
2466
+ stream_id: String
2467
+ ).returns(T.attached_class)
2468
+ end
2469
+ def self.new(
2470
+ # Unique ID for the output item associated with the web search call.
2471
+ item_id:,
2472
+ # The index of the output item that the web search call is associated with.
2473
+ output_index:,
2474
+ # The sequence number of the web search call being processed.
2475
+ sequence_number:,
2476
+ # The agent that owns this multi-agent streaming event.
2477
+ agent: nil,
2478
+ # The type of the event. Always `response.web_search_call.completed`.
2479
+ type: :"response.web_search_call.completed",
2480
+ # The WebSocket lane that emitted this event.
2481
+ # This field is present when the originating response.create supplied a stream_id.
2482
+ stream_id: nil
2483
+ )
2484
+ end
2485
+
2486
+ sig do
2487
+ override.returns(
2488
+ {
2489
+ item_id: String,
2490
+ output_index: Integer,
2491
+ sequence_number: Integer,
2492
+ type: Symbol,
2493
+ agent:
2494
+ T.nilable(
2495
+ OpenAI::Beta::BetaResponseWebSearchCallCompletedEvent::Agent
2496
+ ),
2497
+ stream_id: String
2498
+ }
2499
+ )
2500
+ end
2501
+ def to_hash
2502
+ end
2503
+ end
2504
+
2505
+ class BetaResponseWebSearchCallInWsProgress < OpenAI::Models::Beta::BetaResponseWebSearchCallInProgressEvent
2506
+ OrHash =
2507
+ T.type_alias do
2508
+ T.any(
2509
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallInWsProgress,
2510
+ OpenAI::Internal::AnyHash
2511
+ )
2512
+ end
2513
+
2514
+ # The WebSocket lane that emitted this event. This field is present when the
2515
+ # originating `response.create` event supplied a `stream_id`.
2516
+ sig { returns(T.nilable(String)) }
2517
+ attr_reader :stream_id
2518
+
2519
+ sig { params(stream_id: String).void }
2520
+ attr_writer :stream_id
2521
+
2522
+ # Emitted when a web search call is initiated.
2523
+ sig do
2524
+ params(
2525
+ item_id: String,
2526
+ output_index: Integer,
2527
+ sequence_number: Integer,
2528
+ agent:
2529
+ T.nilable(
2530
+ OpenAI::Beta::BetaResponseWebSearchCallInProgressEvent::Agent::OrHash
2531
+ ),
2532
+ type: Symbol,
2533
+ stream_id: String
2534
+ ).returns(T.attached_class)
2535
+ end
2536
+ def self.new(
2537
+ # Unique ID for the output item associated with the web search call.
2538
+ item_id:,
2539
+ # The index of the output item that the web search call is associated with.
2540
+ output_index:,
2541
+ # The sequence number of the web search call being processed.
2542
+ sequence_number:,
2543
+ # The agent that owns this multi-agent streaming event.
2544
+ agent: nil,
2545
+ # The type of the event. Always `response.web_search_call.in_progress`.
2546
+ type: :"response.web_search_call.in_progress",
2547
+ # The WebSocket lane that emitted this event.
2548
+ # This field is present when the originating response.create supplied a stream_id.
2549
+ stream_id: nil
2550
+ )
2551
+ end
2552
+
2553
+ sig do
2554
+ override.returns(
2555
+ {
2556
+ item_id: String,
2557
+ output_index: Integer,
2558
+ sequence_number: Integer,
2559
+ type: Symbol,
2560
+ agent:
2561
+ T.nilable(
2562
+ OpenAI::Beta::BetaResponseWebSearchCallInProgressEvent::Agent
2563
+ ),
2564
+ stream_id: String
2565
+ }
2566
+ )
2567
+ end
2568
+ def to_hash
2569
+ end
2570
+ end
2571
+
2572
+ class BetaResponseWebSearchCallWsSearching < OpenAI::Models::Beta::BetaResponseWebSearchCallSearchingEvent
2573
+ OrHash =
2574
+ T.type_alias do
2575
+ T.any(
2576
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWebSearchCallWsSearching,
2577
+ OpenAI::Internal::AnyHash
2578
+ )
2579
+ end
2580
+
2581
+ # The WebSocket lane that emitted this event. This field is present when the
2582
+ # originating `response.create` event supplied a `stream_id`.
2583
+ sig { returns(T.nilable(String)) }
2584
+ attr_reader :stream_id
2585
+
2586
+ sig { params(stream_id: String).void }
2587
+ attr_writer :stream_id
2588
+
2589
+ # Emitted when a web search call is executing.
2590
+ sig do
2591
+ params(
2592
+ item_id: String,
2593
+ output_index: Integer,
2594
+ sequence_number: Integer,
2595
+ agent:
2596
+ T.nilable(
2597
+ OpenAI::Beta::BetaResponseWebSearchCallSearchingEvent::Agent::OrHash
2598
+ ),
2599
+ type: Symbol,
2600
+ stream_id: String
2601
+ ).returns(T.attached_class)
2602
+ end
2603
+ def self.new(
2604
+ # Unique ID for the output item associated with the web search call.
2605
+ item_id:,
2606
+ # The index of the output item that the web search call is associated with.
2607
+ output_index:,
2608
+ # The sequence number of the web search call being processed.
2609
+ sequence_number:,
2610
+ # The agent that owns this multi-agent streaming event.
2611
+ agent: nil,
2612
+ # The type of the event. Always `response.web_search_call.searching`.
2613
+ type: :"response.web_search_call.searching",
2614
+ # The WebSocket lane that emitted this event.
2615
+ # This field is present when the originating response.create supplied a stream_id.
2616
+ stream_id: nil
2617
+ )
2618
+ end
2619
+
2620
+ sig do
2621
+ override.returns(
2622
+ {
2623
+ item_id: String,
2624
+ output_index: Integer,
2625
+ sequence_number: Integer,
2626
+ type: Symbol,
2627
+ agent:
2628
+ T.nilable(
2629
+ OpenAI::Beta::BetaResponseWebSearchCallSearchingEvent::Agent
2630
+ ),
2631
+ stream_id: String
2632
+ }
2633
+ )
2634
+ end
2635
+ def to_hash
2636
+ end
2637
+ end
2638
+
2639
+ class BetaResponseImageGenCallWsCompleted < OpenAI::Models::Beta::BetaResponseImageGenCallCompletedEvent
2640
+ OrHash =
2641
+ T.type_alias do
2642
+ T.any(
2643
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallWsCompleted,
2644
+ OpenAI::Internal::AnyHash
2645
+ )
2646
+ end
2647
+
2648
+ # The WebSocket lane that emitted this event. This field is present when the
2649
+ # originating `response.create` event supplied a `stream_id`.
2650
+ sig { returns(T.nilable(String)) }
2651
+ attr_reader :stream_id
2652
+
2653
+ sig { params(stream_id: String).void }
2654
+ attr_writer :stream_id
2655
+
2656
+ # Emitted when an image generation tool call has completed and the final image is
2657
+ # available.
2658
+ sig do
2659
+ params(
2660
+ item_id: String,
2661
+ output_index: Integer,
2662
+ sequence_number: Integer,
2663
+ agent:
2664
+ T.nilable(
2665
+ OpenAI::Beta::BetaResponseImageGenCallCompletedEvent::Agent::OrHash
2666
+ ),
2667
+ type: Symbol,
2668
+ stream_id: String
2669
+ ).returns(T.attached_class)
2670
+ end
2671
+ def self.new(
2672
+ # The unique identifier of the image generation item being processed.
2673
+ item_id:,
2674
+ # The index of the output item in the response's output array.
2675
+ output_index:,
2676
+ # The sequence number of this event.
2677
+ sequence_number:,
2678
+ # The agent that owns this multi-agent streaming event.
2679
+ agent: nil,
2680
+ # The type of the event. Always 'response.image_generation_call.completed'.
2681
+ type: :"response.image_generation_call.completed",
2682
+ # The WebSocket lane that emitted this event.
2683
+ # This field is present when the originating response.create supplied a stream_id.
2684
+ stream_id: nil
2685
+ )
2686
+ end
2687
+
2688
+ sig do
2689
+ override.returns(
2690
+ {
2691
+ item_id: String,
2692
+ output_index: Integer,
2693
+ sequence_number: Integer,
2694
+ type: Symbol,
2695
+ agent:
2696
+ T.nilable(
2697
+ OpenAI::Beta::BetaResponseImageGenCallCompletedEvent::Agent
2698
+ ),
2699
+ stream_id: String
2700
+ }
2701
+ )
2702
+ end
2703
+ def to_hash
2704
+ end
2705
+ end
2706
+
2707
+ class BetaResponseImageGenCallWsGenerating < OpenAI::Models::Beta::BetaResponseImageGenCallGeneratingEvent
2708
+ OrHash =
2709
+ T.type_alias do
2710
+ T.any(
2711
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallWsGenerating,
2712
+ OpenAI::Internal::AnyHash
2713
+ )
2714
+ end
2715
+
2716
+ # The WebSocket lane that emitted this event. This field is present when the
2717
+ # originating `response.create` event supplied a `stream_id`.
2718
+ sig { returns(T.nilable(String)) }
2719
+ attr_reader :stream_id
2720
+
2721
+ sig { params(stream_id: String).void }
2722
+ attr_writer :stream_id
2723
+
2724
+ # Emitted when an image generation tool call is actively generating an image
2725
+ # (intermediate state).
2726
+ sig do
2727
+ params(
2728
+ item_id: String,
2729
+ output_index: Integer,
2730
+ sequence_number: Integer,
2731
+ agent:
2732
+ T.nilable(
2733
+ OpenAI::Beta::BetaResponseImageGenCallGeneratingEvent::Agent::OrHash
2734
+ ),
2735
+ type: Symbol,
2736
+ stream_id: String
2737
+ ).returns(T.attached_class)
2738
+ end
2739
+ def self.new(
2740
+ # The unique identifier of the image generation item being processed.
2741
+ item_id:,
2742
+ # The index of the output item in the response's output array.
2743
+ output_index:,
2744
+ # The sequence number of the image generation item being processed.
2745
+ sequence_number:,
2746
+ # The agent that owns this multi-agent streaming event.
2747
+ agent: nil,
2748
+ # The type of the event. Always 'response.image_generation_call.generating'.
2749
+ type: :"response.image_generation_call.generating",
2750
+ # The WebSocket lane that emitted this event.
2751
+ # This field is present when the originating response.create supplied a stream_id.
2752
+ stream_id: nil
2753
+ )
2754
+ end
2755
+
2756
+ sig do
2757
+ override.returns(
2758
+ {
2759
+ item_id: String,
2760
+ output_index: Integer,
2761
+ sequence_number: Integer,
2762
+ type: Symbol,
2763
+ agent:
2764
+ T.nilable(
2765
+ OpenAI::Beta::BetaResponseImageGenCallGeneratingEvent::Agent
2766
+ ),
2767
+ stream_id: String
2768
+ }
2769
+ )
2770
+ end
2771
+ def to_hash
2772
+ end
2773
+ end
2774
+
2775
+ class BetaResponseImageGenCallInWsProgress < OpenAI::Models::Beta::BetaResponseImageGenCallInProgressEvent
2776
+ OrHash =
2777
+ T.type_alias do
2778
+ T.any(
2779
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallInWsProgress,
2780
+ OpenAI::Internal::AnyHash
2781
+ )
2782
+ end
2783
+
2784
+ # The WebSocket lane that emitted this event. This field is present when the
2785
+ # originating `response.create` event supplied a `stream_id`.
2786
+ sig { returns(T.nilable(String)) }
2787
+ attr_reader :stream_id
2788
+
2789
+ sig { params(stream_id: String).void }
2790
+ attr_writer :stream_id
2791
+
2792
+ # Emitted when an image generation tool call is in progress.
2793
+ sig do
2794
+ params(
2795
+ item_id: String,
2796
+ output_index: Integer,
2797
+ sequence_number: Integer,
2798
+ agent:
2799
+ T.nilable(
2800
+ OpenAI::Beta::BetaResponseImageGenCallInProgressEvent::Agent::OrHash
2801
+ ),
2802
+ type: Symbol,
2803
+ stream_id: String
2804
+ ).returns(T.attached_class)
2805
+ end
2806
+ def self.new(
2807
+ # The unique identifier of the image generation item being processed.
2808
+ item_id:,
2809
+ # The index of the output item in the response's output array.
2810
+ output_index:,
2811
+ # The sequence number of the image generation item being processed.
2812
+ sequence_number:,
2813
+ # The agent that owns this multi-agent streaming event.
2814
+ agent: nil,
2815
+ # The type of the event. Always 'response.image_generation_call.in_progress'.
2816
+ type: :"response.image_generation_call.in_progress",
2817
+ # The WebSocket lane that emitted this event.
2818
+ # This field is present when the originating response.create supplied a stream_id.
2819
+ stream_id: nil
2820
+ )
2821
+ end
2822
+
2823
+ sig do
2824
+ override.returns(
2825
+ {
2826
+ item_id: String,
2827
+ output_index: Integer,
2828
+ sequence_number: Integer,
2829
+ type: Symbol,
2830
+ agent:
2831
+ T.nilable(
2832
+ OpenAI::Beta::BetaResponseImageGenCallInProgressEvent::Agent
2833
+ ),
2834
+ stream_id: String
2835
+ }
2836
+ )
2837
+ end
2838
+ def to_hash
2839
+ end
2840
+ end
2841
+
2842
+ class BetaResponseImageGenCallPartialWsImage < OpenAI::Models::Beta::BetaResponseImageGenCallPartialImageEvent
2843
+ OrHash =
2844
+ T.type_alias do
2845
+ T.any(
2846
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseImageGenCallPartialWsImage,
2847
+ OpenAI::Internal::AnyHash
2848
+ )
2849
+ end
2850
+
2851
+ # The WebSocket lane that emitted this event. This field is present when the
2852
+ # originating `response.create` event supplied a `stream_id`.
2853
+ sig { returns(T.nilable(String)) }
2854
+ attr_reader :stream_id
2855
+
2856
+ sig { params(stream_id: String).void }
2857
+ attr_writer :stream_id
2858
+
2859
+ # Emitted when a partial image is available during image generation streaming.
2860
+ sig do
2861
+ params(
2862
+ item_id: String,
2863
+ output_index: Integer,
2864
+ partial_image_b64: String,
2865
+ partial_image_index: Integer,
2866
+ sequence_number: Integer,
2867
+ agent:
2868
+ T.nilable(
2869
+ OpenAI::Beta::BetaResponseImageGenCallPartialImageEvent::Agent::OrHash
2870
+ ),
2871
+ type: Symbol,
2872
+ stream_id: String
2873
+ ).returns(T.attached_class)
2874
+ end
2875
+ def self.new(
2876
+ # The unique identifier of the image generation item being processed.
2877
+ item_id:,
2878
+ # The index of the output item in the response's output array.
2879
+ output_index:,
2880
+ # Base64-encoded partial image data, suitable for rendering as an image.
2881
+ partial_image_b64:,
2882
+ # 0-based index for the partial image (backend is 1-based, but this is 0-based for
2883
+ # the user).
2884
+ partial_image_index:,
2885
+ # The sequence number of the image generation item being processed.
2886
+ sequence_number:,
2887
+ # The agent that owns this multi-agent streaming event.
2888
+ agent: nil,
2889
+ # The type of the event. Always 'response.image_generation_call.partial_image'.
2890
+ type: :"response.image_generation_call.partial_image",
2891
+ # The WebSocket lane that emitted this event.
2892
+ # This field is present when the originating response.create supplied a stream_id.
2893
+ stream_id: nil
2894
+ )
2895
+ end
2896
+
2897
+ sig do
2898
+ override.returns(
2899
+ {
2900
+ item_id: String,
2901
+ output_index: Integer,
2902
+ partial_image_b64: String,
2903
+ partial_image_index: Integer,
2904
+ sequence_number: Integer,
2905
+ type: Symbol,
2906
+ agent:
2907
+ T.nilable(
2908
+ OpenAI::Beta::BetaResponseImageGenCallPartialImageEvent::Agent
2909
+ ),
2910
+ stream_id: String
2911
+ }
2912
+ )
2913
+ end
2914
+ def to_hash
2915
+ end
2916
+ end
2917
+
2918
+ class BetaResponseMcpCallArgumentsWsDelta < OpenAI::Models::Beta::BetaResponseMcpCallArgumentsDeltaEvent
2919
+ OrHash =
2920
+ T.type_alias do
2921
+ T.any(
2922
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallArgumentsWsDelta,
2923
+ OpenAI::Internal::AnyHash
2924
+ )
2925
+ end
2926
+
2927
+ # The WebSocket lane that emitted this event. This field is present when the
2928
+ # originating `response.create` event supplied a `stream_id`.
2929
+ sig { returns(T.nilable(String)) }
2930
+ attr_reader :stream_id
2931
+
2932
+ sig { params(stream_id: String).void }
2933
+ attr_writer :stream_id
2934
+
2935
+ # Emitted when there is a delta (partial update) to the arguments of an MCP tool
2936
+ # call.
2937
+ sig do
2938
+ params(
2939
+ delta: String,
2940
+ item_id: String,
2941
+ output_index: Integer,
2942
+ sequence_number: Integer,
2943
+ agent:
2944
+ T.nilable(
2945
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDeltaEvent::Agent::OrHash
2946
+ ),
2947
+ type: Symbol,
2948
+ stream_id: String
2949
+ ).returns(T.attached_class)
2950
+ end
2951
+ def self.new(
2952
+ # A JSON string containing the partial update to the arguments for the MCP tool
2953
+ # call.
2954
+ delta:,
2955
+ # The unique identifier of the MCP tool call item being processed.
2956
+ item_id:,
2957
+ # The index of the output item in the response's output array.
2958
+ output_index:,
2959
+ # The sequence number of this event.
2960
+ sequence_number:,
2961
+ # The agent that owns this multi-agent streaming event.
2962
+ agent: nil,
2963
+ # The type of the event. Always 'response.mcp_call_arguments.delta'.
2964
+ type: :"response.mcp_call_arguments.delta",
2965
+ # The WebSocket lane that emitted this event.
2966
+ # This field is present when the originating response.create supplied a stream_id.
2967
+ stream_id: nil
2968
+ )
2969
+ end
2970
+
2971
+ sig do
2972
+ override.returns(
2973
+ {
2974
+ delta: String,
2975
+ item_id: String,
2976
+ output_index: Integer,
2977
+ sequence_number: Integer,
2978
+ type: Symbol,
2979
+ agent:
2980
+ T.nilable(
2981
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDeltaEvent::Agent
2982
+ ),
2983
+ stream_id: String
2984
+ }
2985
+ )
2986
+ end
2987
+ def to_hash
2988
+ end
2989
+ end
2990
+
2991
+ class BetaResponseMcpCallArgumentsWsDone < OpenAI::Models::Beta::BetaResponseMcpCallArgumentsDoneEvent
2992
+ OrHash =
2993
+ T.type_alias do
2994
+ T.any(
2995
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallArgumentsWsDone,
2996
+ OpenAI::Internal::AnyHash
2997
+ )
2998
+ end
2999
+
3000
+ # The WebSocket lane that emitted this event. This field is present when the
3001
+ # originating `response.create` event supplied a `stream_id`.
3002
+ sig { returns(T.nilable(String)) }
3003
+ attr_reader :stream_id
3004
+
3005
+ sig { params(stream_id: String).void }
3006
+ attr_writer :stream_id
3007
+
3008
+ # Emitted when the arguments for an MCP tool call are finalized.
3009
+ sig do
3010
+ params(
3011
+ arguments: String,
3012
+ item_id: String,
3013
+ output_index: Integer,
3014
+ sequence_number: Integer,
3015
+ agent:
3016
+ T.nilable(
3017
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDoneEvent::Agent::OrHash
3018
+ ),
3019
+ type: Symbol,
3020
+ stream_id: String
3021
+ ).returns(T.attached_class)
3022
+ end
3023
+ def self.new(
3024
+ # A JSON string containing the finalized arguments for the MCP tool call.
3025
+ arguments:,
3026
+ # The unique identifier of the MCP tool call item being processed.
3027
+ item_id:,
3028
+ # The index of the output item in the response's output array.
3029
+ output_index:,
3030
+ # The sequence number of this event.
3031
+ sequence_number:,
3032
+ # The agent that owns this multi-agent streaming event.
3033
+ agent: nil,
3034
+ # The type of the event. Always 'response.mcp_call_arguments.done'.
3035
+ type: :"response.mcp_call_arguments.done",
3036
+ # The WebSocket lane that emitted this event.
3037
+ # This field is present when the originating response.create supplied a stream_id.
3038
+ stream_id: nil
3039
+ )
3040
+ end
3041
+
3042
+ sig do
3043
+ override.returns(
3044
+ {
3045
+ arguments: String,
3046
+ item_id: String,
3047
+ output_index: Integer,
3048
+ sequence_number: Integer,
3049
+ type: Symbol,
3050
+ agent:
3051
+ T.nilable(
3052
+ OpenAI::Beta::BetaResponseMcpCallArgumentsDoneEvent::Agent
3053
+ ),
3054
+ stream_id: String
3055
+ }
3056
+ )
3057
+ end
3058
+ def to_hash
3059
+ end
3060
+ end
3061
+
3062
+ class BetaResponseMcpCallWsCompleted < OpenAI::Models::Beta::BetaResponseMcpCallCompletedEvent
3063
+ OrHash =
3064
+ T.type_alias do
3065
+ T.any(
3066
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallWsCompleted,
3067
+ OpenAI::Internal::AnyHash
3068
+ )
3069
+ end
3070
+
3071
+ # The WebSocket lane that emitted this event. This field is present when the
3072
+ # originating `response.create` event supplied a `stream_id`.
3073
+ sig { returns(T.nilable(String)) }
3074
+ attr_reader :stream_id
3075
+
3076
+ sig { params(stream_id: String).void }
3077
+ attr_writer :stream_id
3078
+
3079
+ # Emitted when an MCP tool call has completed successfully.
3080
+ sig do
3081
+ params(
3082
+ item_id: String,
3083
+ output_index: Integer,
3084
+ sequence_number: Integer,
3085
+ agent:
3086
+ T.nilable(
3087
+ OpenAI::Beta::BetaResponseMcpCallCompletedEvent::Agent::OrHash
3088
+ ),
3089
+ type: Symbol,
3090
+ stream_id: String
3091
+ ).returns(T.attached_class)
3092
+ end
3093
+ def self.new(
3094
+ # The ID of the MCP tool call item that completed.
3095
+ item_id:,
3096
+ # The index of the output item that completed.
3097
+ output_index:,
3098
+ # The sequence number of this event.
3099
+ sequence_number:,
3100
+ # The agent that owns this multi-agent streaming event.
3101
+ agent: nil,
3102
+ # The type of the event. Always 'response.mcp_call.completed'.
3103
+ type: :"response.mcp_call.completed",
3104
+ # The WebSocket lane that emitted this event.
3105
+ # This field is present when the originating response.create supplied a stream_id.
3106
+ stream_id: nil
3107
+ )
3108
+ end
3109
+
3110
+ sig do
3111
+ override.returns(
3112
+ {
3113
+ item_id: String,
3114
+ output_index: Integer,
3115
+ sequence_number: Integer,
3116
+ type: Symbol,
3117
+ agent:
3118
+ T.nilable(
3119
+ OpenAI::Beta::BetaResponseMcpCallCompletedEvent::Agent
3120
+ ),
3121
+ stream_id: String
3122
+ }
3123
+ )
3124
+ end
3125
+ def to_hash
3126
+ end
3127
+ end
3128
+
3129
+ class BetaResponseMcpCallWsFailed < OpenAI::Models::Beta::BetaResponseMcpCallFailedEvent
3130
+ OrHash =
3131
+ T.type_alias do
3132
+ T.any(
3133
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallWsFailed,
3134
+ OpenAI::Internal::AnyHash
3135
+ )
3136
+ end
3137
+
3138
+ # The WebSocket lane that emitted this event. This field is present when the
3139
+ # originating `response.create` event supplied a `stream_id`.
3140
+ sig { returns(T.nilable(String)) }
3141
+ attr_reader :stream_id
3142
+
3143
+ sig { params(stream_id: String).void }
3144
+ attr_writer :stream_id
3145
+
3146
+ # Emitted when an MCP tool call has failed.
3147
+ sig do
3148
+ params(
3149
+ item_id: String,
3150
+ output_index: Integer,
3151
+ sequence_number: Integer,
3152
+ agent:
3153
+ T.nilable(
3154
+ OpenAI::Beta::BetaResponseMcpCallFailedEvent::Agent::OrHash
3155
+ ),
3156
+ type: Symbol,
3157
+ stream_id: String
3158
+ ).returns(T.attached_class)
3159
+ end
3160
+ def self.new(
3161
+ # The ID of the MCP tool call item that failed.
3162
+ item_id:,
3163
+ # The index of the output item that failed.
3164
+ output_index:,
3165
+ # The sequence number of this event.
3166
+ sequence_number:,
3167
+ # The agent that owns this multi-agent streaming event.
3168
+ agent: nil,
3169
+ # The type of the event. Always 'response.mcp_call.failed'.
3170
+ type: :"response.mcp_call.failed",
3171
+ # The WebSocket lane that emitted this event.
3172
+ # This field is present when the originating response.create supplied a stream_id.
3173
+ stream_id: nil
3174
+ )
3175
+ end
3176
+
3177
+ sig do
3178
+ override.returns(
3179
+ {
3180
+ item_id: String,
3181
+ output_index: Integer,
3182
+ sequence_number: Integer,
3183
+ type: Symbol,
3184
+ agent:
3185
+ T.nilable(
3186
+ OpenAI::Beta::BetaResponseMcpCallFailedEvent::Agent
3187
+ ),
3188
+ stream_id: String
3189
+ }
3190
+ )
3191
+ end
3192
+ def to_hash
3193
+ end
3194
+ end
3195
+
3196
+ class BetaResponseMcpCallInWsProgress < OpenAI::Models::Beta::BetaResponseMcpCallInProgressEvent
3197
+ OrHash =
3198
+ T.type_alias do
3199
+ T.any(
3200
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpCallInWsProgress,
3201
+ OpenAI::Internal::AnyHash
3202
+ )
3203
+ end
3204
+
3205
+ # The WebSocket lane that emitted this event. This field is present when the
3206
+ # originating `response.create` event supplied a `stream_id`.
3207
+ sig { returns(T.nilable(String)) }
3208
+ attr_reader :stream_id
3209
+
3210
+ sig { params(stream_id: String).void }
3211
+ attr_writer :stream_id
3212
+
3213
+ # Emitted when an MCP tool call is in progress.
3214
+ sig do
3215
+ params(
3216
+ item_id: String,
3217
+ output_index: Integer,
3218
+ sequence_number: Integer,
3219
+ agent:
3220
+ T.nilable(
3221
+ OpenAI::Beta::BetaResponseMcpCallInProgressEvent::Agent::OrHash
3222
+ ),
3223
+ type: Symbol,
3224
+ stream_id: String
3225
+ ).returns(T.attached_class)
3226
+ end
3227
+ def self.new(
3228
+ # The unique identifier of the MCP tool call item being processed.
3229
+ item_id:,
3230
+ # The index of the output item in the response's output array.
3231
+ output_index:,
3232
+ # The sequence number of this event.
3233
+ sequence_number:,
3234
+ # The agent that owns this multi-agent streaming event.
3235
+ agent: nil,
3236
+ # The type of the event. Always 'response.mcp_call.in_progress'.
3237
+ type: :"response.mcp_call.in_progress",
3238
+ # The WebSocket lane that emitted this event.
3239
+ # This field is present when the originating response.create supplied a stream_id.
3240
+ stream_id: nil
3241
+ )
3242
+ end
3243
+
3244
+ sig do
3245
+ override.returns(
3246
+ {
3247
+ item_id: String,
3248
+ output_index: Integer,
3249
+ sequence_number: Integer,
3250
+ type: Symbol,
3251
+ agent:
3252
+ T.nilable(
3253
+ OpenAI::Beta::BetaResponseMcpCallInProgressEvent::Agent
3254
+ ),
3255
+ stream_id: String
3256
+ }
3257
+ )
3258
+ end
3259
+ def to_hash
3260
+ end
3261
+ end
3262
+
3263
+ class BetaResponseMcpListToolsWsCompleted < OpenAI::Models::Beta::BetaResponseMcpListToolsCompletedEvent
3264
+ OrHash =
3265
+ T.type_alias do
3266
+ T.any(
3267
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsWsCompleted,
3268
+ OpenAI::Internal::AnyHash
3269
+ )
3270
+ end
3271
+
3272
+ # The WebSocket lane that emitted this event. This field is present when the
3273
+ # originating `response.create` event supplied a `stream_id`.
3274
+ sig { returns(T.nilable(String)) }
3275
+ attr_reader :stream_id
3276
+
3277
+ sig { params(stream_id: String).void }
3278
+ attr_writer :stream_id
3279
+
3280
+ # Emitted when the list of available MCP tools has been successfully retrieved.
3281
+ sig do
3282
+ params(
3283
+ item_id: String,
3284
+ output_index: Integer,
3285
+ sequence_number: Integer,
3286
+ agent:
3287
+ T.nilable(
3288
+ OpenAI::Beta::BetaResponseMcpListToolsCompletedEvent::Agent::OrHash
3289
+ ),
3290
+ type: Symbol,
3291
+ stream_id: String
3292
+ ).returns(T.attached_class)
3293
+ end
3294
+ def self.new(
3295
+ # The ID of the MCP tool call item that produced this output.
3296
+ item_id:,
3297
+ # The index of the output item that was processed.
3298
+ output_index:,
3299
+ # The sequence number of this event.
3300
+ sequence_number:,
3301
+ # The agent that owns this multi-agent streaming event.
3302
+ agent: nil,
3303
+ # The type of the event. Always 'response.mcp_list_tools.completed'.
3304
+ type: :"response.mcp_list_tools.completed",
3305
+ # The WebSocket lane that emitted this event.
3306
+ # This field is present when the originating response.create supplied a stream_id.
3307
+ stream_id: nil
3308
+ )
3309
+ end
3310
+
3311
+ sig do
3312
+ override.returns(
3313
+ {
3314
+ item_id: String,
3315
+ output_index: Integer,
3316
+ sequence_number: Integer,
3317
+ type: Symbol,
3318
+ agent:
3319
+ T.nilable(
3320
+ OpenAI::Beta::BetaResponseMcpListToolsCompletedEvent::Agent
3321
+ ),
3322
+ stream_id: String
3323
+ }
3324
+ )
3325
+ end
3326
+ def to_hash
3327
+ end
3328
+ end
3329
+
3330
+ class BetaResponseMcpListToolsWsFailed < OpenAI::Models::Beta::BetaResponseMcpListToolsFailedEvent
3331
+ OrHash =
3332
+ T.type_alias do
3333
+ T.any(
3334
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsWsFailed,
3335
+ OpenAI::Internal::AnyHash
3336
+ )
3337
+ end
3338
+
3339
+ # The WebSocket lane that emitted this event. This field is present when the
3340
+ # originating `response.create` event supplied a `stream_id`.
3341
+ sig { returns(T.nilable(String)) }
3342
+ attr_reader :stream_id
3343
+
3344
+ sig { params(stream_id: String).void }
3345
+ attr_writer :stream_id
3346
+
3347
+ # Emitted when the attempt to list available MCP tools has failed.
3348
+ sig do
3349
+ params(
3350
+ item_id: String,
3351
+ output_index: Integer,
3352
+ sequence_number: Integer,
3353
+ agent:
3354
+ T.nilable(
3355
+ OpenAI::Beta::BetaResponseMcpListToolsFailedEvent::Agent::OrHash
3356
+ ),
3357
+ type: Symbol,
3358
+ stream_id: String
3359
+ ).returns(T.attached_class)
3360
+ end
3361
+ def self.new(
3362
+ # The ID of the MCP tool call item that failed.
3363
+ item_id:,
3364
+ # The index of the output item that failed.
3365
+ output_index:,
3366
+ # The sequence number of this event.
3367
+ sequence_number:,
3368
+ # The agent that owns this multi-agent streaming event.
3369
+ agent: nil,
3370
+ # The type of the event. Always 'response.mcp_list_tools.failed'.
3371
+ type: :"response.mcp_list_tools.failed",
3372
+ # The WebSocket lane that emitted this event.
3373
+ # This field is present when the originating response.create supplied a stream_id.
3374
+ stream_id: nil
3375
+ )
3376
+ end
3377
+
3378
+ sig do
3379
+ override.returns(
3380
+ {
3381
+ item_id: String,
3382
+ output_index: Integer,
3383
+ sequence_number: Integer,
3384
+ type: Symbol,
3385
+ agent:
3386
+ T.nilable(
3387
+ OpenAI::Beta::BetaResponseMcpListToolsFailedEvent::Agent
3388
+ ),
3389
+ stream_id: String
3390
+ }
3391
+ )
3392
+ end
3393
+ def to_hash
3394
+ end
3395
+ end
3396
+
3397
+ class BetaResponseMcpListToolsInWsProgress < OpenAI::Models::Beta::BetaResponseMcpListToolsInProgressEvent
3398
+ OrHash =
3399
+ T.type_alias do
3400
+ T.any(
3401
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseMcpListToolsInWsProgress,
3402
+ OpenAI::Internal::AnyHash
3403
+ )
3404
+ end
3405
+
3406
+ # The WebSocket lane that emitted this event. This field is present when the
3407
+ # originating `response.create` event supplied a `stream_id`.
3408
+ sig { returns(T.nilable(String)) }
3409
+ attr_reader :stream_id
3410
+
3411
+ sig { params(stream_id: String).void }
3412
+ attr_writer :stream_id
3413
+
3414
+ # Emitted when the system is in the process of retrieving the list of available
3415
+ # MCP tools.
3416
+ sig do
3417
+ params(
3418
+ item_id: String,
3419
+ output_index: Integer,
3420
+ sequence_number: Integer,
3421
+ agent:
3422
+ T.nilable(
3423
+ OpenAI::Beta::BetaResponseMcpListToolsInProgressEvent::Agent::OrHash
3424
+ ),
3425
+ type: Symbol,
3426
+ stream_id: String
3427
+ ).returns(T.attached_class)
3428
+ end
3429
+ def self.new(
3430
+ # The ID of the MCP tool call item that is being processed.
3431
+ item_id:,
3432
+ # The index of the output item that is being processed.
3433
+ output_index:,
3434
+ # The sequence number of this event.
3435
+ sequence_number:,
3436
+ # The agent that owns this multi-agent streaming event.
3437
+ agent: nil,
3438
+ # The type of the event. Always 'response.mcp_list_tools.in_progress'.
3439
+ type: :"response.mcp_list_tools.in_progress",
3440
+ # The WebSocket lane that emitted this event.
3441
+ # This field is present when the originating response.create supplied a stream_id.
3442
+ stream_id: nil
3443
+ )
3444
+ end
3445
+
3446
+ sig do
3447
+ override.returns(
3448
+ {
3449
+ item_id: String,
3450
+ output_index: Integer,
3451
+ sequence_number: Integer,
3452
+ type: Symbol,
3453
+ agent:
3454
+ T.nilable(
3455
+ OpenAI::Beta::BetaResponseMcpListToolsInProgressEvent::Agent
3456
+ ),
3457
+ stream_id: String
3458
+ }
3459
+ )
3460
+ end
3461
+ def to_hash
3462
+ end
3463
+ end
3464
+
3465
+ class BetaResponseOutputTextAnnotationWsAdded < OpenAI::Models::Beta::BetaResponseOutputTextAnnotationAddedEvent
3466
+ OrHash =
3467
+ T.type_alias do
3468
+ T.any(
3469
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseOutputTextAnnotationWsAdded,
3470
+ OpenAI::Internal::AnyHash
3471
+ )
3472
+ end
3473
+
3474
+ # The WebSocket lane that emitted this event. This field is present when the
3475
+ # originating `response.create` event supplied a `stream_id`.
3476
+ sig { returns(T.nilable(String)) }
3477
+ attr_reader :stream_id
3478
+
3479
+ sig { params(stream_id: String).void }
3480
+ attr_writer :stream_id
3481
+
3482
+ # Emitted when an annotation is added to output text content.
3483
+ sig do
3484
+ params(
3485
+ annotation: T.anything,
3486
+ annotation_index: Integer,
3487
+ content_index: Integer,
3488
+ item_id: String,
3489
+ output_index: Integer,
3490
+ sequence_number: Integer,
3491
+ agent:
3492
+ T.nilable(
3493
+ OpenAI::Beta::BetaResponseOutputTextAnnotationAddedEvent::Agent::OrHash
3494
+ ),
3495
+ type: Symbol,
3496
+ stream_id: String
3497
+ ).returns(T.attached_class)
3498
+ end
3499
+ def self.new(
3500
+ # The annotation object being added. (See annotation schema for details.)
3501
+ annotation:,
3502
+ # The index of the annotation within the content part.
3503
+ annotation_index:,
3504
+ # The index of the content part within the output item.
3505
+ content_index:,
3506
+ # The unique identifier of the item to which the annotation is being added.
3507
+ item_id:,
3508
+ # The index of the output item in the response's output array.
3509
+ output_index:,
3510
+ # The sequence number of this event.
3511
+ sequence_number:,
3512
+ # The agent that owns this multi-agent streaming event.
3513
+ agent: nil,
3514
+ # The type of the event. Always 'response.output_text.annotation.added'.
3515
+ type: :"response.output_text.annotation.added",
3516
+ # The WebSocket lane that emitted this event.
3517
+ # This field is present when the originating response.create supplied a stream_id.
3518
+ stream_id: nil
3519
+ )
3520
+ end
3521
+
3522
+ sig do
3523
+ override.returns(
3524
+ {
3525
+ annotation: T.anything,
3526
+ annotation_index: Integer,
3527
+ content_index: Integer,
3528
+ item_id: String,
3529
+ output_index: Integer,
3530
+ sequence_number: Integer,
3531
+ type: Symbol,
3532
+ agent:
3533
+ T.nilable(
3534
+ OpenAI::Beta::BetaResponseOutputTextAnnotationAddedEvent::Agent
3535
+ ),
3536
+ stream_id: String
3537
+ }
3538
+ )
3539
+ end
3540
+ def to_hash
3541
+ end
3542
+ end
3543
+
3544
+ class BetaResponseWsQueued < OpenAI::Models::Beta::BetaResponseQueuedEvent
3545
+ OrHash =
3546
+ T.type_alias do
3547
+ T.any(
3548
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsQueued,
3549
+ OpenAI::Internal::AnyHash
3550
+ )
3551
+ end
3552
+
3553
+ # The WebSocket lane that emitted this event. This field is present when the
3554
+ # originating `response.create` event supplied a `stream_id`.
3555
+ sig { returns(T.nilable(String)) }
3556
+ attr_reader :stream_id
3557
+
3558
+ sig { params(stream_id: String).void }
3559
+ attr_writer :stream_id
3560
+
3561
+ # Emitted when a response is queued and waiting to be processed.
3562
+ sig do
3563
+ params(
3564
+ response: OpenAI::Beta::BetaResponse::OrHash,
3565
+ sequence_number: Integer,
3566
+ agent:
3567
+ T.nilable(OpenAI::Beta::BetaResponseQueuedEvent::Agent::OrHash),
3568
+ type: Symbol,
3569
+ stream_id: String
3570
+ ).returns(T.attached_class)
3571
+ end
3572
+ def self.new(
3573
+ # The full response object that is queued.
3574
+ response:,
3575
+ # The sequence number for this event.
3576
+ sequence_number:,
3577
+ # The agent that owns this multi-agent streaming event.
3578
+ agent: nil,
3579
+ # The type of the event. Always 'response.queued'.
3580
+ type: :"response.queued",
3581
+ # The WebSocket lane that emitted this event.
3582
+ # This field is present when the originating response.create supplied a stream_id.
3583
+ stream_id: nil
3584
+ )
3585
+ end
3586
+
3587
+ sig do
3588
+ override.returns(
3589
+ {
3590
+ response: OpenAI::Beta::BetaResponse,
3591
+ sequence_number: Integer,
3592
+ type: Symbol,
3593
+ agent: T.nilable(OpenAI::Beta::BetaResponseQueuedEvent::Agent),
3594
+ stream_id: String
3595
+ }
3596
+ )
3597
+ end
3598
+ def to_hash
3599
+ end
3600
+ end
3601
+
3602
+ class BetaResponseCustomToolCallInputWsDelta < OpenAI::Models::Beta::BetaResponseCustomToolCallInputDeltaEvent
3603
+ OrHash =
3604
+ T.type_alias do
3605
+ T.any(
3606
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCustomToolCallInputWsDelta,
3607
+ OpenAI::Internal::AnyHash
3608
+ )
3609
+ end
3610
+
3611
+ # The WebSocket lane that emitted this event. This field is present when the
3612
+ # originating `response.create` event supplied a `stream_id`.
3613
+ sig { returns(T.nilable(String)) }
3614
+ attr_reader :stream_id
3615
+
3616
+ sig { params(stream_id: String).void }
3617
+ attr_writer :stream_id
3618
+
3619
+ # Event representing a delta (partial update) to the input of a custom tool call.
3620
+ sig do
3621
+ params(
3622
+ delta: String,
3623
+ item_id: String,
3624
+ output_index: Integer,
3625
+ sequence_number: Integer,
3626
+ agent:
3627
+ T.nilable(
3628
+ OpenAI::Beta::BetaResponseCustomToolCallInputDeltaEvent::Agent::OrHash
3629
+ ),
3630
+ type: Symbol,
3631
+ stream_id: String
3632
+ ).returns(T.attached_class)
3633
+ end
3634
+ def self.new(
3635
+ # The incremental input data (delta) for the custom tool call.
3636
+ delta:,
3637
+ # Unique identifier for the API item associated with this event.
3638
+ item_id:,
3639
+ # The index of the output this delta applies to.
3640
+ output_index:,
3641
+ # The sequence number of this event.
3642
+ sequence_number:,
3643
+ # The agent that owns this multi-agent streaming event.
3644
+ agent: nil,
3645
+ # The event type identifier.
3646
+ type: :"response.custom_tool_call_input.delta",
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
+ delta: String,
3657
+ item_id: String,
3658
+ output_index: Integer,
3659
+ sequence_number: Integer,
3660
+ type: Symbol,
3661
+ agent:
3662
+ T.nilable(
3663
+ OpenAI::Beta::BetaResponseCustomToolCallInputDeltaEvent::Agent
3664
+ ),
3665
+ stream_id: String
3666
+ }
3667
+ )
3668
+ end
3669
+ def to_hash
3670
+ end
3671
+ end
3672
+
3673
+ class BetaResponseCustomToolCallInputWsDone < OpenAI::Models::Beta::BetaResponseCustomToolCallInputDoneEvent
3674
+ OrHash =
3675
+ T.type_alias do
3676
+ T.any(
3677
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseCustomToolCallInputWsDone,
3678
+ OpenAI::Internal::AnyHash
3679
+ )
3680
+ end
3681
+
3682
+ # The WebSocket lane that emitted this event. This field is present when the
3683
+ # originating `response.create` event supplied a `stream_id`.
3684
+ sig { returns(T.nilable(String)) }
3685
+ attr_reader :stream_id
3686
+
3687
+ sig { params(stream_id: String).void }
3688
+ attr_writer :stream_id
3689
+
3690
+ # Event indicating that input for a custom tool call is complete.
3691
+ sig do
3692
+ params(
3693
+ input: String,
3694
+ item_id: String,
3695
+ output_index: Integer,
3696
+ sequence_number: Integer,
3697
+ agent:
3698
+ T.nilable(
3699
+ OpenAI::Beta::BetaResponseCustomToolCallInputDoneEvent::Agent::OrHash
3700
+ ),
3701
+ type: Symbol,
3702
+ stream_id: String
3703
+ ).returns(T.attached_class)
3704
+ end
3705
+ def self.new(
3706
+ # The complete input data for the custom tool call.
3707
+ input:,
3708
+ # Unique identifier for the API item associated with this event.
3709
+ item_id:,
3710
+ # The index of the output this event applies to.
3711
+ output_index:,
3712
+ # The sequence number of this event.
3713
+ sequence_number:,
3714
+ # The agent that owns this multi-agent streaming event.
3715
+ agent: nil,
3716
+ # The event type identifier.
3717
+ type: :"response.custom_tool_call_input.done",
3718
+ # The WebSocket lane that emitted this event.
3719
+ # This field is present when the originating response.create supplied a stream_id.
3720
+ stream_id: nil
3721
+ )
3722
+ end
3723
+
3724
+ sig do
3725
+ override.returns(
3726
+ {
3727
+ input: String,
3728
+ item_id: String,
3729
+ output_index: Integer,
3730
+ sequence_number: Integer,
3731
+ type: Symbol,
3732
+ agent:
3733
+ T.nilable(
3734
+ OpenAI::Beta::BetaResponseCustomToolCallInputDoneEvent::Agent
3735
+ ),
3736
+ stream_id: String
3737
+ }
3738
+ )
3739
+ end
3740
+ def to_hash
3741
+ end
3742
+ end
3743
+
3744
+ class BetaResponseWsError < OpenAI::Internal::Type::BaseModel
3745
+ OrHash =
3746
+ T.type_alias do
3747
+ T.any(
3748
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError,
3749
+ OpenAI::Internal::AnyHash
3750
+ )
3751
+ end
3752
+
3753
+ # Details about the error.
3754
+ sig do
3755
+ returns(
3756
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error
3757
+ )
3758
+ end
3759
+ attr_reader :error
3760
+
3761
+ sig do
3762
+ params(
3763
+ error:
3764
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::OrHash
3765
+ ).void
3766
+ end
3767
+ attr_writer :error
3768
+
3769
+ # The type of the event. Always `error`.
3770
+ sig { returns(Symbol) }
3771
+ attr_accessor :type
3772
+
3773
+ # The agent that owns this multi-agent streaming event.
3774
+ sig do
3775
+ returns(
3776
+ T.nilable(
3777
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Agent
3778
+ )
3779
+ )
3780
+ end
3781
+ attr_reader :agent
3782
+
3783
+ sig do
3784
+ params(
3785
+ agent:
3786
+ T.nilable(
3787
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Agent::OrHash
3788
+ )
3789
+ ).void
3790
+ end
3791
+ attr_writer :agent
3792
+
3793
+ # The sequence number of an error emitted by the response stream.
3794
+ sig { returns(T.nilable(Integer)) }
3795
+ attr_reader :sequence_number
3796
+
3797
+ sig { params(sequence_number: Integer).void }
3798
+ attr_writer :sequence_number
3799
+
3800
+ # The HTTP status code associated with a WebSocket protocol error.
3801
+ sig { returns(T.nilable(Integer)) }
3802
+ attr_reader :status
3803
+
3804
+ sig { params(status: Integer).void }
3805
+ attr_writer :status
3806
+
3807
+ # The WebSocket lane that emitted this event. This field is present when the
3808
+ # originating `response.create` event supplied a `stream_id`.
3809
+ sig { returns(T.nilable(String)) }
3810
+ attr_reader :stream_id
3811
+
3812
+ sig { params(stream_id: String).void }
3813
+ attr_writer :stream_id
3814
+
3815
+ # Emitted when an error occurs while processing a Responses WebSocket request.
3816
+ sig do
3817
+ params(
3818
+ error:
3819
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::OrHash,
3820
+ agent:
3821
+ T.nilable(
3822
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Agent::OrHash
3823
+ ),
3824
+ sequence_number: Integer,
3825
+ status: Integer,
3826
+ stream_id: String,
3827
+ type: Symbol
3828
+ ).returns(T.attached_class)
3829
+ end
3830
+ def self.new(
3831
+ # Details about the error.
3832
+ error:,
3833
+ # The agent that owns this multi-agent streaming event.
3834
+ agent: nil,
3835
+ # The sequence number of an error emitted by the response stream.
3836
+ sequence_number: nil,
3837
+ # The HTTP status code associated with a WebSocket protocol error.
3838
+ status: nil,
3839
+ # The WebSocket lane that emitted this event. This field is present when the
3840
+ # originating `response.create` event supplied a `stream_id`.
3841
+ stream_id: nil,
3842
+ # The type of the event. Always `error`.
3843
+ type: :error
3844
+ )
3845
+ end
3846
+
3847
+ sig do
3848
+ override.returns(
3849
+ {
3850
+ error:
3851
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error,
3852
+ type: Symbol,
3853
+ agent:
3854
+ T.nilable(
3855
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Agent
3856
+ ),
3857
+ sequence_number: Integer,
3858
+ status: Integer,
3859
+ stream_id: String
3860
+ }
3861
+ )
3862
+ end
3863
+ def to_hash
3864
+ end
3865
+
3866
+ class Error < OpenAI::Internal::Type::BaseModel
3867
+ OrHash =
3868
+ T.type_alias do
3869
+ T.any(
3870
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error,
3871
+ OpenAI::Internal::AnyHash
3872
+ )
3873
+ end
3874
+
3875
+ # The error code that was emitted, if any.
3876
+ sig { returns(T.nilable(String)) }
3877
+ attr_accessor :code
3878
+
3879
+ # The human-readable error message that was emitted.
3880
+ sig { returns(String) }
3881
+ attr_accessor :message
3882
+
3883
+ # The parameter name that was associated with the error, if any.
3884
+ sig { returns(T.nilable(String)) }
3885
+ attr_accessor :param
3886
+
3887
+ # The error type that was emitted.
3888
+ sig { returns(String) }
3889
+ attr_accessor :type
3890
+
3891
+ # The response headers that were emitted with the error, if any.
3892
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
3893
+ attr_reader :headers
3894
+
3895
+ sig { params(headers: T::Hash[Symbol, String]).void }
3896
+ attr_writer :headers
3897
+
3898
+ # Details about the error.
3899
+ sig do
3900
+ params(
3901
+ code: T.nilable(String),
3902
+ message: String,
3903
+ param: T.nilable(String),
3904
+ type: String,
3905
+ headers: T::Hash[Symbol, String]
3906
+ ).returns(T.attached_class)
3907
+ end
3908
+ def self.new(
3909
+ # The error code that was emitted, if any.
3910
+ code:,
3911
+ # The human-readable error message that was emitted.
3912
+ message:,
3913
+ # The parameter name that was associated with the error, if any.
3914
+ param:,
3915
+ # The error type that was emitted.
3916
+ type:,
3917
+ # The response headers that were emitted with the error, if any.
3918
+ headers: nil
3919
+ )
3920
+ end
3921
+
3922
+ sig do
3923
+ override.returns(
3924
+ {
3925
+ code: T.nilable(String),
3926
+ message: String,
3927
+ param: T.nilable(String),
3928
+ type: String,
3929
+ headers: T::Hash[Symbol, String]
3930
+ }
3931
+ )
3932
+ end
3933
+ def to_hash
3934
+ end
3935
+ end
3936
+
3937
+ class Agent < OpenAI::Internal::Type::BaseModel
3938
+ OrHash =
3939
+ T.type_alias do
3940
+ T.any(
3941
+ OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Agent,
3942
+ OpenAI::Internal::AnyHash
3943
+ )
3944
+ end
3945
+
3946
+ # The canonical name of the agent that produced this item.
3947
+ sig { returns(String) }
3948
+ attr_accessor :agent_name
3949
+
3950
+ # The agent that owns this multi-agent streaming event.
3951
+ sig { params(agent_name: String).returns(T.attached_class) }
3952
+ def self.new(
3953
+ # The canonical name of the agent that produced this item.
3954
+ agent_name:
3955
+ )
3956
+ end
3957
+
3958
+ sig { override.returns({ agent_name: String }) }
3959
+ def to_hash
3960
+ end
3961
+ end
3962
+ end
3963
+
73
3964
  sig do
74
3965
  override.returns(
75
3966
  T::Array[OpenAI::Beta::BetaResponsesServerEvent::Variants]