openai 0.20.0 → 0.21.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 (332) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +4 -0
  5. data/lib/openai/internal/stream.rb +3 -2
  6. data/lib/openai/models/audio/speech_create_params.rb +6 -0
  7. data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -0
  8. data/lib/openai/models/evals/run_cancel_response.rb +2 -2
  9. data/lib/openai/models/evals/run_create_params.rb +2 -2
  10. data/lib/openai/models/evals/run_create_response.rb +2 -2
  11. data/lib/openai/models/evals/run_list_response.rb +2 -2
  12. data/lib/openai/models/evals/run_retrieve_response.rb +2 -2
  13. data/lib/openai/models/realtime/client_secret_create_params.rb +93 -0
  14. data/lib/openai/models/realtime/client_secret_create_response.rb +300 -0
  15. data/lib/openai/models/realtime/conversation_created_event.rb +70 -0
  16. data/lib/openai/models/realtime/conversation_item.rb +44 -0
  17. data/lib/openai/models/realtime/conversation_item_added.rb +48 -0
  18. data/lib/openai/models/realtime/conversation_item_create_event.rb +57 -0
  19. data/lib/openai/models/realtime/conversation_item_created_event.rb +59 -0
  20. data/lib/openai/models/realtime/conversation_item_delete_event.rb +39 -0
  21. data/lib/openai/models/realtime/conversation_item_deleted_event.rb +38 -0
  22. data/lib/openai/models/realtime/conversation_item_done.rb +48 -0
  23. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +189 -0
  24. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +63 -0
  25. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rb +96 -0
  26. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_segment.rb +84 -0
  27. data/lib/openai/models/realtime/conversation_item_retrieve_event.rb +40 -0
  28. data/lib/openai/models/realtime/conversation_item_truncate_event.rb +68 -0
  29. data/lib/openai/models/realtime/conversation_item_truncated_event.rb +60 -0
  30. data/lib/openai/models/realtime/conversation_item_with_reference.rb +235 -0
  31. data/lib/openai/models/realtime/input_audio_buffer_append_event.rb +49 -0
  32. data/lib/openai/models/realtime/input_audio_buffer_clear_event.rb +29 -0
  33. data/lib/openai/models/realtime/input_audio_buffer_cleared_event.rb +29 -0
  34. data/lib/openai/models/realtime/input_audio_buffer_commit_event.rb +35 -0
  35. data/lib/openai/models/realtime/input_audio_buffer_committed_event.rb +51 -0
  36. data/lib/openai/models/realtime/input_audio_buffer_speech_started_event.rb +59 -0
  37. data/lib/openai/models/realtime/input_audio_buffer_speech_stopped_event.rb +51 -0
  38. data/lib/openai/models/realtime/input_audio_buffer_timeout_triggered.rb +52 -0
  39. data/lib/openai/models/realtime/log_prob_properties.rb +39 -0
  40. data/lib/openai/models/realtime/mcp_list_tools_completed.rb +36 -0
  41. data/lib/openai/models/realtime/mcp_list_tools_failed.rb +36 -0
  42. data/lib/openai/models/realtime/mcp_list_tools_in_progress.rb +36 -0
  43. data/lib/openai/models/realtime/output_audio_buffer_clear_event.rb +32 -0
  44. data/lib/openai/models/realtime/rate_limits_updated_event.rb +91 -0
  45. data/lib/openai/models/realtime/realtime_audio_config.rb +446 -0
  46. data/lib/openai/models/realtime/realtime_client_event.rb +123 -0
  47. data/lib/openai/models/realtime/realtime_client_secret_config.rb +64 -0
  48. data/lib/openai/models/realtime/realtime_conversation_item_assistant_message.rb +118 -0
  49. data/lib/openai/models/realtime/realtime_conversation_item_function_call.rb +94 -0
  50. data/lib/openai/models/realtime/realtime_conversation_item_function_call_output.rb +86 -0
  51. data/lib/openai/models/realtime/realtime_conversation_item_system_message.rb +118 -0
  52. data/lib/openai/models/realtime/realtime_conversation_item_user_message.rb +135 -0
  53. data/lib/openai/models/realtime/realtime_error.rb +55 -0
  54. data/lib/openai/models/realtime/realtime_error_event.rb +38 -0
  55. data/lib/openai/models/realtime/realtime_mcp_approval_request.rb +52 -0
  56. data/lib/openai/models/realtime/realtime_mcp_approval_response.rb +52 -0
  57. data/lib/openai/models/realtime/realtime_mcp_list_tools.rb +84 -0
  58. data/lib/openai/models/realtime/realtime_mcp_protocol_error.rb +29 -0
  59. data/lib/openai/models/realtime/realtime_mcp_tool_call.rb +94 -0
  60. data/lib/openai/models/realtime/realtime_mcp_tool_execution_error.rb +23 -0
  61. data/lib/openai/models/realtime/realtime_mcphttp_error.rb +29 -0
  62. data/lib/openai/models/realtime/realtime_response.rb +259 -0
  63. data/lib/openai/models/realtime/realtime_response_status.rb +103 -0
  64. data/lib/openai/models/realtime/realtime_response_usage.rb +61 -0
  65. data/lib/openai/models/realtime/realtime_response_usage_input_token_details.rb +36 -0
  66. data/lib/openai/models/realtime/realtime_response_usage_output_token_details.rb +28 -0
  67. data/lib/openai/models/realtime/realtime_server_event.rb +369 -0
  68. data/lib/openai/models/realtime/realtime_session.rb +696 -0
  69. data/lib/openai/models/realtime/realtime_session_create_request.rb +234 -0
  70. data/lib/openai/models/realtime/realtime_session_create_response.rb +579 -0
  71. data/lib/openai/models/realtime/realtime_tool_choice_config.rb +32 -0
  72. data/lib/openai/models/realtime/realtime_tools_config.rb +11 -0
  73. data/lib/openai/models/realtime/realtime_tools_config_union.rb +379 -0
  74. data/lib/openai/models/realtime/realtime_tracing_config.rb +61 -0
  75. data/lib/openai/models/realtime/realtime_transcription_session_create_request.rb +312 -0
  76. data/lib/openai/models/realtime/realtime_truncation.rb +67 -0
  77. data/lib/openai/models/realtime/response_audio_delta_event.rb +68 -0
  78. data/lib/openai/models/realtime/response_audio_done_event.rb +61 -0
  79. data/lib/openai/models/realtime/response_audio_transcript_delta_event.rb +68 -0
  80. data/lib/openai/models/realtime/response_audio_transcript_done_event.rb +70 -0
  81. data/lib/openai/models/realtime/response_cancel_event.rb +42 -0
  82. data/lib/openai/models/realtime/response_content_part_added_event.rb +120 -0
  83. data/lib/openai/models/realtime/response_content_part_done_event.rb +120 -0
  84. data/lib/openai/models/realtime/response_create_event.rb +391 -0
  85. data/lib/openai/models/realtime/response_created_event.rb +37 -0
  86. data/lib/openai/models/realtime/response_done_event.rb +38 -0
  87. data/lib/openai/models/realtime/response_function_call_arguments_delta_event.rb +72 -0
  88. data/lib/openai/models/realtime/response_function_call_arguments_done_event.rb +73 -0
  89. data/lib/openai/models/realtime/response_mcp_call_arguments_delta.rb +68 -0
  90. data/lib/openai/models/realtime/response_mcp_call_arguments_done.rb +60 -0
  91. data/lib/openai/models/realtime/response_mcp_call_completed.rb +44 -0
  92. data/lib/openai/models/realtime/response_mcp_call_failed.rb +44 -0
  93. data/lib/openai/models/realtime/response_mcp_call_in_progress.rb +44 -0
  94. data/lib/openai/models/realtime/response_output_item_added_event.rb +52 -0
  95. data/lib/openai/models/realtime/response_output_item_done_event.rb +53 -0
  96. data/lib/openai/models/realtime/response_text_delta_event.rb +68 -0
  97. data/lib/openai/models/realtime/response_text_done_event.rb +69 -0
  98. data/lib/openai/models/realtime/session_created_event.rb +38 -0
  99. data/lib/openai/models/realtime/session_update_event.rb +44 -0
  100. data/lib/openai/models/realtime/session_updated_event.rb +37 -0
  101. data/lib/openai/models/realtime/transcription_session_created.rb +278 -0
  102. data/lib/openai/models/realtime/transcription_session_update.rb +36 -0
  103. data/lib/openai/models/realtime/transcription_session_updated_event.rb +279 -0
  104. data/lib/openai/models/responses/response.rb +6 -3
  105. data/lib/openai/models/responses/response_create_params.rb +6 -3
  106. data/lib/openai/models/responses/tool.rb +3 -156
  107. data/lib/openai/models/responses/web_search_preview_tool.rb +124 -0
  108. data/lib/openai/models/responses/web_search_tool.rb +58 -21
  109. data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +119 -0
  110. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +4 -1
  111. data/lib/openai/models.rb +2 -0
  112. data/lib/openai/resources/realtime/client_secrets.rb +44 -0
  113. data/lib/openai/resources/realtime.rb +18 -0
  114. data/lib/openai/resources/responses.rb +2 -2
  115. data/lib/openai/resources/webhooks.rb +1 -1
  116. data/lib/openai/version.rb +1 -1
  117. data/lib/openai.rb +95 -0
  118. data/rbi/openai/client.rbi +3 -0
  119. data/rbi/openai/models/audio/speech_create_params.rbi +10 -0
  120. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +10 -0
  121. data/rbi/openai/models/evals/run_cancel_response.rbi +4 -4
  122. data/rbi/openai/models/evals/run_create_params.rbi +8 -8
  123. data/rbi/openai/models/evals/run_create_response.rbi +4 -4
  124. data/rbi/openai/models/evals/run_list_response.rbi +4 -4
  125. data/rbi/openai/models/evals/run_retrieve_response.rbi +4 -4
  126. data/rbi/openai/models/realtime/client_secret_create_params.rbi +222 -0
  127. data/rbi/openai/models/realtime/client_secret_create_response.rbi +676 -0
  128. data/rbi/openai/models/realtime/conversation_created_event.rbi +164 -0
  129. data/rbi/openai/models/realtime/conversation_item.rbi +35 -0
  130. data/rbi/openai/models/realtime/conversation_item_added.rbi +105 -0
  131. data/rbi/openai/models/realtime/conversation_item_create_event.rbi +123 -0
  132. data/rbi/openai/models/realtime/conversation_item_created_event.rbi +117 -0
  133. data/rbi/openai/models/realtime/conversation_item_delete_event.rbi +57 -0
  134. data/rbi/openai/models/realtime/conversation_item_deleted_event.rbi +53 -0
  135. data/rbi/openai/models/realtime/conversation_item_done.rbi +105 -0
  136. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +305 -0
  137. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +93 -0
  138. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbi +158 -0
  139. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbi +107 -0
  140. data/rbi/openai/models/realtime/conversation_item_retrieve_event.rbi +58 -0
  141. data/rbi/openai/models/realtime/conversation_item_truncate_event.rbi +94 -0
  142. data/rbi/openai/models/realtime/conversation_item_truncated_event.rbi +80 -0
  143. data/rbi/openai/models/realtime/conversation_item_with_reference.rbi +549 -0
  144. data/rbi/openai/models/realtime/input_audio_buffer_append_event.rbi +65 -0
  145. data/rbi/openai/models/realtime/input_audio_buffer_clear_event.rbi +43 -0
  146. data/rbi/openai/models/realtime/input_audio_buffer_cleared_event.rbi +40 -0
  147. data/rbi/openai/models/realtime/input_audio_buffer_commit_event.rbi +49 -0
  148. data/rbi/openai/models/realtime/input_audio_buffer_committed_event.rbi +72 -0
  149. data/rbi/openai/models/realtime/input_audio_buffer_speech_started_event.rbi +82 -0
  150. data/rbi/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbi +73 -0
  151. data/rbi/openai/models/realtime/input_audio_buffer_timeout_triggered.rbi +75 -0
  152. data/rbi/openai/models/realtime/log_prob_properties.rbi +55 -0
  153. data/rbi/openai/models/realtime/mcp_list_tools_completed.rbi +51 -0
  154. data/rbi/openai/models/realtime/mcp_list_tools_failed.rbi +51 -0
  155. data/rbi/openai/models/realtime/mcp_list_tools_in_progress.rbi +51 -0
  156. data/rbi/openai/models/realtime/output_audio_buffer_clear_event.rbi +46 -0
  157. data/rbi/openai/models/realtime/rate_limits_updated_event.rbi +187 -0
  158. data/rbi/openai/models/realtime/realtime_audio_config.rbi +1004 -0
  159. data/rbi/openai/models/realtime/realtime_client_event.rbi +38 -0
  160. data/rbi/openai/models/realtime/realtime_client_secret_config.rbi +147 -0
  161. data/rbi/openai/models/realtime/realtime_conversation_item_assistant_message.rbi +292 -0
  162. data/rbi/openai/models/realtime/realtime_conversation_item_function_call.rbi +199 -0
  163. data/rbi/openai/models/realtime/realtime_conversation_item_function_call_output.rbi +188 -0
  164. data/rbi/openai/models/realtime/realtime_conversation_item_system_message.rbi +292 -0
  165. data/rbi/openai/models/realtime/realtime_conversation_item_user_message.rbi +319 -0
  166. data/rbi/openai/models/realtime/realtime_error.rbi +72 -0
  167. data/rbi/openai/models/realtime/realtime_error_event.rbi +64 -0
  168. data/rbi/openai/models/realtime/realtime_mcp_approval_request.rbi +75 -0
  169. data/rbi/openai/models/realtime/realtime_mcp_approval_response.rbi +75 -0
  170. data/rbi/openai/models/realtime/realtime_mcp_list_tools.rbi +131 -0
  171. data/rbi/openai/models/realtime/realtime_mcp_protocol_error.rbi +40 -0
  172. data/rbi/openai/models/realtime/realtime_mcp_tool_call.rbi +145 -0
  173. data/rbi/openai/models/realtime/realtime_mcp_tool_execution_error.rbi +31 -0
  174. data/rbi/openai/models/realtime/realtime_mcphttp_error.rbi +40 -0
  175. data/rbi/openai/models/realtime/realtime_response.rbi +573 -0
  176. data/rbi/openai/models/realtime/realtime_response_status.rbi +233 -0
  177. data/rbi/openai/models/realtime/realtime_response_usage.rbi +121 -0
  178. data/rbi/openai/models/realtime/realtime_response_usage_input_token_details.rbi +68 -0
  179. data/rbi/openai/models/realtime/realtime_response_usage_output_token_details.rbi +51 -0
  180. data/rbi/openai/models/realtime/realtime_server_event.rbi +311 -0
  181. data/rbi/openai/models/realtime/realtime_session.rbi +1426 -0
  182. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +560 -0
  183. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +1249 -0
  184. data/rbi/openai/models/realtime/realtime_tool_choice_config.rbi +30 -0
  185. data/rbi/openai/models/realtime/realtime_tools_config.rbi +15 -0
  186. data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +755 -0
  187. data/rbi/openai/models/realtime/realtime_tracing_config.rbi +95 -0
  188. data/rbi/openai/models/realtime/realtime_transcription_session_create_request.rbi +703 -0
  189. data/rbi/openai/models/realtime/realtime_truncation.rbi +117 -0
  190. data/rbi/openai/models/realtime/response_audio_delta_event.rbi +91 -0
  191. data/rbi/openai/models/realtime/response_audio_done_event.rbi +84 -0
  192. data/rbi/openai/models/realtime/response_audio_transcript_delta_event.rbi +91 -0
  193. data/rbi/openai/models/realtime/response_audio_transcript_done_event.rbi +93 -0
  194. data/rbi/openai/models/realtime/response_cancel_event.rbi +63 -0
  195. data/rbi/openai/models/realtime/response_content_part_added_event.rbi +219 -0
  196. data/rbi/openai/models/realtime/response_content_part_done_event.rbi +219 -0
  197. data/rbi/openai/models/realtime/response_create_event.rbi +863 -0
  198. data/rbi/openai/models/realtime/response_created_event.rbi +65 -0
  199. data/rbi/openai/models/realtime/response_done_event.rbi +66 -0
  200. data/rbi/openai/models/realtime/response_function_call_arguments_delta_event.rbi +91 -0
  201. data/rbi/openai/models/realtime/response_function_call_arguments_done_event.rbi +92 -0
  202. data/rbi/openai/models/realtime/response_mcp_call_arguments_delta.rbi +91 -0
  203. data/rbi/openai/models/realtime/response_mcp_call_arguments_done.rbi +83 -0
  204. data/rbi/openai/models/realtime/response_mcp_call_completed.rbi +67 -0
  205. data/rbi/openai/models/realtime/response_mcp_call_failed.rbi +67 -0
  206. data/rbi/openai/models/realtime/response_mcp_call_in_progress.rbi +67 -0
  207. data/rbi/openai/models/realtime/response_output_item_added_event.rbi +111 -0
  208. data/rbi/openai/models/realtime/response_output_item_done_event.rbi +112 -0
  209. data/rbi/openai/models/realtime/response_text_delta_event.rbi +91 -0
  210. data/rbi/openai/models/realtime/response_text_done_event.rbi +92 -0
  211. data/rbi/openai/models/realtime/session_created_event.rbi +64 -0
  212. data/rbi/openai/models/realtime/session_update_event.rbi +77 -0
  213. data/rbi/openai/models/realtime/session_updated_event.rbi +63 -0
  214. data/rbi/openai/models/realtime/transcription_session_created.rbi +653 -0
  215. data/rbi/openai/models/realtime/transcription_session_update.rbi +74 -0
  216. data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +657 -0
  217. data/rbi/openai/models/responses/response.rbi +10 -4
  218. data/rbi/openai/models/responses/response_create_params.rbi +16 -10
  219. data/rbi/openai/models/responses/tool.rbi +2 -348
  220. data/rbi/openai/models/responses/web_search_preview_tool.rbi +245 -0
  221. data/rbi/openai/models/responses/web_search_tool.rbi +120 -23
  222. data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +222 -0
  223. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -0
  224. data/rbi/openai/models.rbi +2 -0
  225. data/rbi/openai/resources/realtime/client_secrets.rbi +38 -0
  226. data/rbi/openai/resources/realtime.rbi +15 -0
  227. data/rbi/openai/resources/responses.rbi +12 -6
  228. data/rbi/openai/resources/webhooks.rbi +1 -0
  229. data/sig/openai/client.rbs +2 -0
  230. data/sig/openai/models/audio/speech_create_params.rbs +4 -0
  231. data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -0
  232. data/sig/openai/models/realtime/client_secret_create_params.rbs +89 -0
  233. data/sig/openai/models/realtime/client_secret_create_response.rbs +292 -0
  234. data/sig/openai/models/realtime/conversation_created_event.rbs +70 -0
  235. data/sig/openai/models/realtime/conversation_item.rbs +22 -0
  236. data/sig/openai/models/realtime/conversation_item_added.rbs +37 -0
  237. data/sig/openai/models/realtime/conversation_item_create_event.rbs +41 -0
  238. data/sig/openai/models/realtime/conversation_item_created_event.rbs +37 -0
  239. data/sig/openai/models/realtime/conversation_item_delete_event.rbs +30 -0
  240. data/sig/openai/models/realtime/conversation_item_deleted_event.rbs +32 -0
  241. data/sig/openai/models/realtime/conversation_item_done.rbs +37 -0
  242. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbs +136 -0
  243. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbs +51 -0
  244. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbs +77 -0
  245. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbs +62 -0
  246. data/sig/openai/models/realtime/conversation_item_retrieve_event.rbs +34 -0
  247. data/sig/openai/models/realtime/conversation_item_truncate_event.rbs +44 -0
  248. data/sig/openai/models/realtime/conversation_item_truncated_event.rbs +42 -0
  249. data/sig/openai/models/realtime/conversation_item_with_reference.rbs +207 -0
  250. data/sig/openai/models/realtime/input_audio_buffer_append_event.rbs +30 -0
  251. data/sig/openai/models/realtime/input_audio_buffer_clear_event.rbs +23 -0
  252. data/sig/openai/models/realtime/input_audio_buffer_cleared_event.rbs +24 -0
  253. data/sig/openai/models/realtime/input_audio_buffer_commit_event.rbs +23 -0
  254. data/sig/openai/models/realtime/input_audio_buffer_committed_event.rbs +37 -0
  255. data/sig/openai/models/realtime/input_audio_buffer_speech_started_event.rbs +37 -0
  256. data/sig/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbs +37 -0
  257. data/sig/openai/models/realtime/input_audio_buffer_timeout_triggered.rbs +42 -0
  258. data/sig/openai/models/realtime/log_prob_properties.rbs +28 -0
  259. data/sig/openai/models/realtime/mcp_list_tools_completed.rbs +28 -0
  260. data/sig/openai/models/realtime/mcp_list_tools_failed.rbs +28 -0
  261. data/sig/openai/models/realtime/mcp_list_tools_in_progress.rbs +32 -0
  262. data/sig/openai/models/realtime/output_audio_buffer_clear_event.rbs +23 -0
  263. data/sig/openai/models/realtime/rate_limits_updated_event.rbs +85 -0
  264. data/sig/openai/models/realtime/realtime_audio_config.rbs +354 -0
  265. data/sig/openai/models/realtime/realtime_client_event.rbs +25 -0
  266. data/sig/openai/models/realtime/realtime_client_secret_config.rbs +60 -0
  267. data/sig/openai/models/realtime/realtime_conversation_item_assistant_message.rbs +117 -0
  268. data/sig/openai/models/realtime/realtime_conversation_item_function_call.rbs +86 -0
  269. data/sig/openai/models/realtime/realtime_conversation_item_function_call_output.rbs +79 -0
  270. data/sig/openai/models/realtime/realtime_conversation_item_system_message.rbs +117 -0
  271. data/sig/openai/models/realtime/realtime_conversation_item_user_message.rbs +132 -0
  272. data/sig/openai/models/realtime/realtime_error.rbs +42 -0
  273. data/sig/openai/models/realtime/realtime_error_event.rbs +32 -0
  274. data/sig/openai/models/realtime/realtime_mcp_approval_request.rbs +42 -0
  275. data/sig/openai/models/realtime/realtime_mcp_approval_response.rbs +42 -0
  276. data/sig/openai/models/realtime/realtime_mcp_list_tools.rbs +71 -0
  277. data/sig/openai/models/realtime/realtime_mcp_protocol_error.rbs +28 -0
  278. data/sig/openai/models/realtime/realtime_mcp_tool_call.rbs +68 -0
  279. data/sig/openai/models/realtime/realtime_mcp_tool_execution_error.rbs +18 -0
  280. data/sig/openai/models/realtime/realtime_mcphttp_error.rbs +24 -0
  281. data/sig/openai/models/realtime/realtime_response.rbs +210 -0
  282. data/sig/openai/models/realtime/realtime_response_status.rbs +90 -0
  283. data/sig/openai/models/realtime/realtime_response_usage.rbs +56 -0
  284. data/sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs +34 -0
  285. data/sig/openai/models/realtime/realtime_response_usage_output_token_details.rbs +22 -0
  286. data/sig/openai/models/realtime/realtime_server_event.rbs +168 -0
  287. data/sig/openai/models/realtime/realtime_session.rbs +521 -0
  288. data/sig/openai/models/realtime/realtime_session_create_request.rbs +178 -0
  289. data/sig/openai/models/realtime/realtime_session_create_response.rbs +526 -0
  290. data/sig/openai/models/realtime/realtime_tool_choice_config.rbs +16 -0
  291. data/sig/openai/models/realtime/realtime_tools_config.rbs +10 -0
  292. data/sig/openai/models/realtime/realtime_tools_config_union.rbs +280 -0
  293. data/sig/openai/models/realtime/realtime_tracing_config.rbs +43 -0
  294. data/sig/openai/models/realtime/realtime_transcription_session_create_request.rbs +242 -0
  295. data/sig/openai/models/realtime/realtime_truncation.rbs +53 -0
  296. data/sig/openai/models/realtime/response_audio_delta_event.rbs +52 -0
  297. data/sig/openai/models/realtime/response_audio_done_event.rbs +47 -0
  298. data/sig/openai/models/realtime/response_audio_transcript_delta_event.rbs +52 -0
  299. data/sig/openai/models/realtime/response_audio_transcript_done_event.rbs +52 -0
  300. data/sig/openai/models/realtime/response_cancel_event.rbs +32 -0
  301. data/sig/openai/models/realtime/response_content_part_added_event.rbs +105 -0
  302. data/sig/openai/models/realtime/response_content_part_done_event.rbs +105 -0
  303. data/sig/openai/models/realtime/response_create_event.rbs +281 -0
  304. data/sig/openai/models/realtime/response_created_event.rbs +32 -0
  305. data/sig/openai/models/realtime/response_done_event.rbs +32 -0
  306. data/sig/openai/models/realtime/response_function_call_arguments_delta_event.rbs +52 -0
  307. data/sig/openai/models/realtime/response_function_call_arguments_done_event.rbs +52 -0
  308. data/sig/openai/models/realtime/response_mcp_call_arguments_delta.rbs +52 -0
  309. data/sig/openai/models/realtime/response_mcp_call_arguments_done.rbs +47 -0
  310. data/sig/openai/models/realtime/response_mcp_call_completed.rbs +37 -0
  311. data/sig/openai/models/realtime/response_mcp_call_failed.rbs +37 -0
  312. data/sig/openai/models/realtime/response_mcp_call_in_progress.rbs +37 -0
  313. data/sig/openai/models/realtime/response_output_item_added_event.rbs +42 -0
  314. data/sig/openai/models/realtime/response_output_item_done_event.rbs +42 -0
  315. data/sig/openai/models/realtime/response_text_delta_event.rbs +52 -0
  316. data/sig/openai/models/realtime/response_text_done_event.rbs +52 -0
  317. data/sig/openai/models/realtime/session_created_event.rbs +32 -0
  318. data/sig/openai/models/realtime/session_update_event.rbs +34 -0
  319. data/sig/openai/models/realtime/session_updated_event.rbs +32 -0
  320. data/sig/openai/models/realtime/transcription_session_created.rbs +282 -0
  321. data/sig/openai/models/realtime/transcription_session_update.rbs +34 -0
  322. data/sig/openai/models/realtime/transcription_session_updated_event.rbs +282 -0
  323. data/sig/openai/models/responses/tool.rbs +1 -121
  324. data/sig/openai/models/responses/web_search_preview_tool.rbs +96 -0
  325. data/sig/openai/models/responses/web_search_tool.rbs +39 -10
  326. data/sig/openai/models/webhooks/realtime_call_incoming_webhook_event.rbs +90 -0
  327. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
  328. data/sig/openai/models.rbs +2 -0
  329. data/sig/openai/resources/realtime/client_secrets.rbs +15 -0
  330. data/sig/openai/resources/realtime.rbs +9 -0
  331. data/sig/openai/resources/webhooks.rbs +1 -0
  332. metadata +287 -2
@@ -0,0 +1,312 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeTranscriptionSessionCreateRequest < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ # ID of the model to use. The options are `gpt-4o-transcribe`,
9
+ # `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source
10
+ # Whisper V2 model).
11
+ #
12
+ # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model]
13
+ required :model, union: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::Model }
14
+
15
+ # @!attribute type
16
+ # The type of session to create. Always `transcription` for transcription
17
+ # sessions.
18
+ #
19
+ # @return [Symbol, :transcription]
20
+ required :type, const: :transcription
21
+
22
+ # @!attribute include
23
+ # The set of items to include in the transcription. Current available items are:
24
+ #
25
+ # - `item.input_audio_transcription.logprobs`
26
+ #
27
+ # @return [Array<Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Include>, nil]
28
+ optional :include,
29
+ -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::Include] }
30
+
31
+ # @!attribute input_audio_format
32
+ # The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
33
+ # `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
34
+ # (mono), and little-endian byte order.
35
+ #
36
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioFormat, nil]
37
+ optional :input_audio_format,
38
+ enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioFormat }
39
+
40
+ # @!attribute input_audio_noise_reduction
41
+ # Configuration for input audio noise reduction. This can be set to `null` to turn
42
+ # off. Noise reduction filters audio added to the input audio buffer before it is
43
+ # sent to VAD and the model. Filtering the audio can improve VAD and turn
44
+ # detection accuracy (reducing false positives) and model performance by improving
45
+ # perception of the input audio.
46
+ #
47
+ # @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction, nil]
48
+ optional :input_audio_noise_reduction,
49
+ -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction }
50
+
51
+ # @!attribute input_audio_transcription
52
+ # Configuration for input audio transcription. The client can optionally set the
53
+ # language and prompt for transcription, these offer additional guidance to the
54
+ # transcription service.
55
+ #
56
+ # @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription, nil]
57
+ optional :input_audio_transcription,
58
+ -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription }
59
+
60
+ # @!attribute turn_detection
61
+ # Configuration for turn detection. Can be set to `null` to turn off. Server VAD
62
+ # means that the model will detect the start and end of speech based on audio
63
+ # volume and respond at the end of user speech.
64
+ #
65
+ # @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection, nil]
66
+ optional :turn_detection,
67
+ -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection }
68
+
69
+ # @!method initialize(model:, include: nil, input_audio_format: nil, input_audio_noise_reduction: nil, input_audio_transcription: nil, turn_detection: nil, type: :transcription)
70
+ # Some parameter documentations has been truncated, see
71
+ # {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest} for more
72
+ # details.
73
+ #
74
+ # Realtime transcription session object configuration.
75
+ #
76
+ # @param model [String, Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc
77
+ #
78
+ # @param include [Array<Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Include>] The set of items to include in the transcription. Current available items are:
79
+ #
80
+ # @param input_audio_format [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioFormat] The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
81
+ #
82
+ # @param input_audio_noise_reduction [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction] Configuration for input audio noise reduction. This can be set to `null` to turn
83
+ #
84
+ # @param input_audio_transcription [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription] Configuration for input audio transcription. The client can optionally set the l
85
+ #
86
+ # @param turn_detection [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection] Configuration for turn detection. Can be set to `null` to turn off. Server VAD m
87
+ #
88
+ # @param type [Symbol, :transcription] The type of session to create. Always `transcription` for transcription sessions
89
+
90
+ # ID of the model to use. The options are `gpt-4o-transcribe`,
91
+ # `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source
92
+ # Whisper V2 model).
93
+ #
94
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#model
95
+ module Model
96
+ extend OpenAI::Internal::Type::Union
97
+
98
+ variant String
99
+
100
+ variant const: -> { OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::WHISPER_1 }
101
+
102
+ variant const: -> { OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::GPT_4O_TRANSCRIBE }
103
+
104
+ variant const: -> { OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::GPT_4O_MINI_TRANSCRIBE }
105
+
106
+ # @!method self.variants
107
+ # @return [Array(String, Symbol)]
108
+
109
+ define_sorbet_constant!(:Variants) do
110
+ T.type_alias { T.any(String, OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::TaggedSymbol) }
111
+ end
112
+
113
+ # @!group
114
+
115
+ WHISPER_1 = :"whisper-1"
116
+ GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"
117
+ GPT_4O_MINI_TRANSCRIBE = :"gpt-4o-mini-transcribe"
118
+
119
+ # @!endgroup
120
+ end
121
+
122
+ module Include
123
+ extend OpenAI::Internal::Type::Enum
124
+
125
+ ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = :"item.input_audio_transcription.logprobs"
126
+
127
+ # @!method self.values
128
+ # @return [Array<Symbol>]
129
+ end
130
+
131
+ # The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
132
+ # `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
133
+ # (mono), and little-endian byte order.
134
+ #
135
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#input_audio_format
136
+ module InputAudioFormat
137
+ extend OpenAI::Internal::Type::Enum
138
+
139
+ PCM16 = :pcm16
140
+ G711_ULAW = :g711_ulaw
141
+ G711_ALAW = :g711_alaw
142
+
143
+ # @!method self.values
144
+ # @return [Array<Symbol>]
145
+ end
146
+
147
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#input_audio_noise_reduction
148
+ class InputAudioNoiseReduction < OpenAI::Internal::Type::BaseModel
149
+ # @!attribute type
150
+ # Type of noise reduction. `near_field` is for close-talking microphones such as
151
+ # headphones, `far_field` is for far-field microphones such as laptop or
152
+ # conference room microphones.
153
+ #
154
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction::Type, nil]
155
+ optional :type,
156
+ enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction::Type }
157
+
158
+ # @!method initialize(type: nil)
159
+ # Some parameter documentations has been truncated, see
160
+ # {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction}
161
+ # for more details.
162
+ #
163
+ # Configuration for input audio noise reduction. This can be set to `null` to turn
164
+ # off. Noise reduction filters audio added to the input audio buffer before it is
165
+ # sent to VAD and the model. Filtering the audio can improve VAD and turn
166
+ # detection accuracy (reducing false positives) and model performance by improving
167
+ # perception of the input audio.
168
+ #
169
+ # @param type [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction::Type] Type of noise reduction. `near_field` is for close-talking microphones such as h
170
+
171
+ # Type of noise reduction. `near_field` is for close-talking microphones such as
172
+ # headphones, `far_field` is for far-field microphones such as laptop or
173
+ # conference room microphones.
174
+ #
175
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction#type
176
+ module Type
177
+ extend OpenAI::Internal::Type::Enum
178
+
179
+ NEAR_FIELD = :near_field
180
+ FAR_FIELD = :far_field
181
+
182
+ # @!method self.values
183
+ # @return [Array<Symbol>]
184
+ end
185
+ end
186
+
187
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#input_audio_transcription
188
+ class InputAudioTranscription < OpenAI::Internal::Type::BaseModel
189
+ # @!attribute language
190
+ # The language of the input audio. Supplying the input language in
191
+ # [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
192
+ # format will improve accuracy and latency.
193
+ #
194
+ # @return [String, nil]
195
+ optional :language, String
196
+
197
+ # @!attribute model
198
+ # The model to use for transcription, current options are `gpt-4o-transcribe`,
199
+ # `gpt-4o-mini-transcribe`, and `whisper-1`.
200
+ #
201
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription::Model, nil]
202
+ optional :model,
203
+ enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription::Model }
204
+
205
+ # @!attribute prompt
206
+ # An optional text to guide the model's style or continue a previous audio
207
+ # segment. For `whisper-1`, the
208
+ # [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
209
+ # For `gpt-4o-transcribe` models, the prompt is a free text string, for example
210
+ # "expect words related to technology".
211
+ #
212
+ # @return [String, nil]
213
+ optional :prompt, String
214
+
215
+ # @!method initialize(language: nil, model: nil, prompt: nil)
216
+ # Some parameter documentations has been truncated, see
217
+ # {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription}
218
+ # for more details.
219
+ #
220
+ # Configuration for input audio transcription. The client can optionally set the
221
+ # language and prompt for transcription, these offer additional guidance to the
222
+ # transcription service.
223
+ #
224
+ # @param language [String] The language of the input audio. Supplying the input language in
225
+ #
226
+ # @param model [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription::Model] The model to use for transcription, current options are `gpt-4o-transcribe`, `gp
227
+ #
228
+ # @param prompt [String] An optional text to guide the model's style or continue a previous audio
229
+
230
+ # The model to use for transcription, current options are `gpt-4o-transcribe`,
231
+ # `gpt-4o-mini-transcribe`, and `whisper-1`.
232
+ #
233
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription#model
234
+ module Model
235
+ extend OpenAI::Internal::Type::Enum
236
+
237
+ GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"
238
+ GPT_4O_MINI_TRANSCRIBE = :"gpt-4o-mini-transcribe"
239
+ WHISPER_1 = :"whisper-1"
240
+
241
+ # @!method self.values
242
+ # @return [Array<Symbol>]
243
+ end
244
+ end
245
+
246
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#turn_detection
247
+ class TurnDetection < OpenAI::Internal::Type::BaseModel
248
+ # @!attribute prefix_padding_ms
249
+ # Amount of audio to include before the VAD detected speech (in milliseconds).
250
+ # Defaults to 300ms.
251
+ #
252
+ # @return [Integer, nil]
253
+ optional :prefix_padding_ms, Integer
254
+
255
+ # @!attribute silence_duration_ms
256
+ # Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
257
+ # With shorter values the model will respond more quickly, but may jump in on
258
+ # short pauses from the user.
259
+ #
260
+ # @return [Integer, nil]
261
+ optional :silence_duration_ms, Integer
262
+
263
+ # @!attribute threshold
264
+ # Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
265
+ # threshold will require louder audio to activate the model, and thus might
266
+ # perform better in noisy environments.
267
+ #
268
+ # @return [Float, nil]
269
+ optional :threshold, Float
270
+
271
+ # @!attribute type
272
+ # Type of turn detection. Only `server_vad` is currently supported for
273
+ # transcription sessions.
274
+ #
275
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection::Type, nil]
276
+ optional :type,
277
+ enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection::Type }
278
+
279
+ # @!method initialize(prefix_padding_ms: nil, silence_duration_ms: nil, threshold: nil, type: nil)
280
+ # Some parameter documentations has been truncated, see
281
+ # {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection}
282
+ # for more details.
283
+ #
284
+ # Configuration for turn detection. Can be set to `null` to turn off. Server VAD
285
+ # means that the model will detect the start and end of speech based on audio
286
+ # volume and respond at the end of user speech.
287
+ #
288
+ # @param prefix_padding_ms [Integer] Amount of audio to include before the VAD detected speech (in
289
+ #
290
+ # @param silence_duration_ms [Integer] Duration of silence to detect speech stop (in milliseconds). Defaults
291
+ #
292
+ # @param threshold [Float] Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
293
+ #
294
+ # @param type [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection::Type] Type of turn detection. Only `server_vad` is currently supported for transcripti
295
+
296
+ # Type of turn detection. Only `server_vad` is currently supported for
297
+ # transcription sessions.
298
+ #
299
+ # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection#type
300
+ module Type
301
+ extend OpenAI::Internal::Type::Enum
302
+
303
+ SERVER_VAD = :server_vad
304
+
305
+ # @!method self.values
306
+ # @return [Array<Symbol>]
307
+ end
308
+ end
309
+ end
310
+ end
311
+ end
312
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ # Controls how the realtime conversation is truncated prior to model inference.
7
+ # The default is `auto`. When set to `retention_ratio`, the server retains a
8
+ # fraction of the conversation tokens prior to the instructions.
9
+ module RealtimeTruncation
10
+ extend OpenAI::Internal::Type::Union
11
+
12
+ # The truncation strategy to use for the session.
13
+ variant enum: -> { OpenAI::Realtime::RealtimeTruncation::RealtimeTruncationStrategy }
14
+
15
+ # Retain a fraction of the conversation tokens.
16
+ variant -> { OpenAI::Realtime::RealtimeTruncation::RetentionRatioTruncation }
17
+
18
+ # The truncation strategy to use for the session.
19
+ module RealtimeTruncationStrategy
20
+ extend OpenAI::Internal::Type::Enum
21
+
22
+ AUTO = :auto
23
+ DISABLED = :disabled
24
+
25
+ # @!method self.values
26
+ # @return [Array<Symbol>]
27
+ end
28
+
29
+ class RetentionRatioTruncation < OpenAI::Internal::Type::BaseModel
30
+ # @!attribute retention_ratio
31
+ # Fraction of pre-instruction conversation tokens to retain (0.0 - 1.0).
32
+ #
33
+ # @return [Float]
34
+ required :retention_ratio, Float
35
+
36
+ # @!attribute type
37
+ # Use retention ratio truncation.
38
+ #
39
+ # @return [Symbol, :retention_ratio]
40
+ required :type, const: :retention_ratio
41
+
42
+ # @!attribute post_instructions_token_limit
43
+ # Optional cap on tokens allowed after the instructions.
44
+ #
45
+ # @return [Integer, nil]
46
+ optional :post_instructions_token_limit, Integer, nil?: true
47
+
48
+ # @!method initialize(retention_ratio:, post_instructions_token_limit: nil, type: :retention_ratio)
49
+ # Some parameter documentations has been truncated, see
50
+ # {OpenAI::Models::Realtime::RealtimeTruncation::RetentionRatioTruncation} for
51
+ # more details.
52
+ #
53
+ # Retain a fraction of the conversation tokens.
54
+ #
55
+ # @param retention_ratio [Float] Fraction of pre-instruction conversation tokens to retain (0.0 - 1.0).
56
+ #
57
+ # @param post_instructions_token_limit [Integer, nil] Optional cap on tokens allowed after the instructions.
58
+ #
59
+ # @param type [Symbol, :retention_ratio] Use retention ratio truncation.
60
+ end
61
+
62
+ # @!method self.variants
63
+ # @return [Array(Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncation::RetentionRatioTruncation)]
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class ResponseAudioDeltaEvent < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content_index
8
+ # The index of the content part in the item's content array.
9
+ #
10
+ # @return [Integer]
11
+ required :content_index, Integer
12
+
13
+ # @!attribute delta
14
+ # Base64-encoded audio data delta.
15
+ #
16
+ # @return [String]
17
+ required :delta, String
18
+
19
+ # @!attribute event_id
20
+ # The unique ID of the server event.
21
+ #
22
+ # @return [String]
23
+ required :event_id, String
24
+
25
+ # @!attribute item_id
26
+ # The ID of the item.
27
+ #
28
+ # @return [String]
29
+ required :item_id, String
30
+
31
+ # @!attribute output_index
32
+ # The index of the output item in the response.
33
+ #
34
+ # @return [Integer]
35
+ required :output_index, Integer
36
+
37
+ # @!attribute response_id
38
+ # The ID of the response.
39
+ #
40
+ # @return [String]
41
+ required :response_id, String
42
+
43
+ # @!attribute type
44
+ # The event type, must be `response.output_audio.delta`.
45
+ #
46
+ # @return [Symbol, :"response.output_audio.delta"]
47
+ required :type, const: :"response.output_audio.delta"
48
+
49
+ # @!method initialize(content_index:, delta:, event_id:, item_id:, output_index:, response_id:, type: :"response.output_audio.delta")
50
+ # Returned when the model-generated audio is updated.
51
+ #
52
+ # @param content_index [Integer] The index of the content part in the item's content array.
53
+ #
54
+ # @param delta [String] Base64-encoded audio data delta.
55
+ #
56
+ # @param event_id [String] The unique ID of the server event.
57
+ #
58
+ # @param item_id [String] The ID of the item.
59
+ #
60
+ # @param output_index [Integer] The index of the output item in the response.
61
+ #
62
+ # @param response_id [String] The ID of the response.
63
+ #
64
+ # @param type [Symbol, :"response.output_audio.delta"] The event type, must be `response.output_audio.delta`.
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class ResponseAudioDoneEvent < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content_index
8
+ # The index of the content part in the item's content array.
9
+ #
10
+ # @return [Integer]
11
+ required :content_index, Integer
12
+
13
+ # @!attribute event_id
14
+ # The unique ID of the server event.
15
+ #
16
+ # @return [String]
17
+ required :event_id, String
18
+
19
+ # @!attribute item_id
20
+ # The ID of the item.
21
+ #
22
+ # @return [String]
23
+ required :item_id, String
24
+
25
+ # @!attribute output_index
26
+ # The index of the output item in the response.
27
+ #
28
+ # @return [Integer]
29
+ required :output_index, Integer
30
+
31
+ # @!attribute response_id
32
+ # The ID of the response.
33
+ #
34
+ # @return [String]
35
+ required :response_id, String
36
+
37
+ # @!attribute type
38
+ # The event type, must be `response.output_audio.done`.
39
+ #
40
+ # @return [Symbol, :"response.output_audio.done"]
41
+ required :type, const: :"response.output_audio.done"
42
+
43
+ # @!method initialize(content_index:, event_id:, item_id:, output_index:, response_id:, type: :"response.output_audio.done")
44
+ # Returned when the model-generated audio is done. Also emitted when a Response is
45
+ # interrupted, incomplete, or cancelled.
46
+ #
47
+ # @param content_index [Integer] The index of the content part in the item's content array.
48
+ #
49
+ # @param event_id [String] The unique ID of the server event.
50
+ #
51
+ # @param item_id [String] The ID of the item.
52
+ #
53
+ # @param output_index [Integer] The index of the output item in the response.
54
+ #
55
+ # @param response_id [String] The ID of the response.
56
+ #
57
+ # @param type [Symbol, :"response.output_audio.done"] The event type, must be `response.output_audio.done`.
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class ResponseAudioTranscriptDeltaEvent < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content_index
8
+ # The index of the content part in the item's content array.
9
+ #
10
+ # @return [Integer]
11
+ required :content_index, Integer
12
+
13
+ # @!attribute delta
14
+ # The transcript delta.
15
+ #
16
+ # @return [String]
17
+ required :delta, String
18
+
19
+ # @!attribute event_id
20
+ # The unique ID of the server event.
21
+ #
22
+ # @return [String]
23
+ required :event_id, String
24
+
25
+ # @!attribute item_id
26
+ # The ID of the item.
27
+ #
28
+ # @return [String]
29
+ required :item_id, String
30
+
31
+ # @!attribute output_index
32
+ # The index of the output item in the response.
33
+ #
34
+ # @return [Integer]
35
+ required :output_index, Integer
36
+
37
+ # @!attribute response_id
38
+ # The ID of the response.
39
+ #
40
+ # @return [String]
41
+ required :response_id, String
42
+
43
+ # @!attribute type
44
+ # The event type, must be `response.output_audio_transcript.delta`.
45
+ #
46
+ # @return [Symbol, :"response.output_audio_transcript.delta"]
47
+ required :type, const: :"response.output_audio_transcript.delta"
48
+
49
+ # @!method initialize(content_index:, delta:, event_id:, item_id:, output_index:, response_id:, type: :"response.output_audio_transcript.delta")
50
+ # Returned when the model-generated transcription of audio output is updated.
51
+ #
52
+ # @param content_index [Integer] The index of the content part in the item's content array.
53
+ #
54
+ # @param delta [String] The transcript delta.
55
+ #
56
+ # @param event_id [String] The unique ID of the server event.
57
+ #
58
+ # @param item_id [String] The ID of the item.
59
+ #
60
+ # @param output_index [Integer] The index of the output item in the response.
61
+ #
62
+ # @param response_id [String] The ID of the response.
63
+ #
64
+ # @param type [Symbol, :"response.output_audio_transcript.delta"] The event type, must be `response.output_audio_transcript.delta`.
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class ResponseAudioTranscriptDoneEvent < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content_index
8
+ # The index of the content part in the item's content array.
9
+ #
10
+ # @return [Integer]
11
+ required :content_index, Integer
12
+
13
+ # @!attribute event_id
14
+ # The unique ID of the server event.
15
+ #
16
+ # @return [String]
17
+ required :event_id, String
18
+
19
+ # @!attribute item_id
20
+ # The ID of the item.
21
+ #
22
+ # @return [String]
23
+ required :item_id, String
24
+
25
+ # @!attribute output_index
26
+ # The index of the output item in the response.
27
+ #
28
+ # @return [Integer]
29
+ required :output_index, Integer
30
+
31
+ # @!attribute response_id
32
+ # The ID of the response.
33
+ #
34
+ # @return [String]
35
+ required :response_id, String
36
+
37
+ # @!attribute transcript
38
+ # The final transcript of the audio.
39
+ #
40
+ # @return [String]
41
+ required :transcript, String
42
+
43
+ # @!attribute type
44
+ # The event type, must be `response.output_audio_transcript.done`.
45
+ #
46
+ # @return [Symbol, :"response.output_audio_transcript.done"]
47
+ required :type, const: :"response.output_audio_transcript.done"
48
+
49
+ # @!method initialize(content_index:, event_id:, item_id:, output_index:, response_id:, transcript:, type: :"response.output_audio_transcript.done")
50
+ # Returned when the model-generated transcription of audio output is done
51
+ # streaming. Also emitted when a Response is interrupted, incomplete, or
52
+ # cancelled.
53
+ #
54
+ # @param content_index [Integer] The index of the content part in the item's content array.
55
+ #
56
+ # @param event_id [String] The unique ID of the server event.
57
+ #
58
+ # @param item_id [String] The ID of the item.
59
+ #
60
+ # @param output_index [Integer] The index of the output item in the response.
61
+ #
62
+ # @param response_id [String] The ID of the response.
63
+ #
64
+ # @param transcript [String] The final transcript of the audio.
65
+ #
66
+ # @param type [Symbol, :"response.output_audio_transcript.done"] The event type, must be `response.output_audio_transcript.done`.
67
+ end
68
+ end
69
+ end
70
+ end