openai 0.19.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 (346) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -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/chat/chat_completion_message.rb +7 -5
  9. data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +7 -5
  10. data/lib/openai/models/conversations/item_list_params.rb +2 -0
  11. data/lib/openai/models/evals/run_cancel_response.rb +2 -2
  12. data/lib/openai/models/evals/run_create_params.rb +2 -2
  13. data/lib/openai/models/evals/run_create_response.rb +2 -2
  14. data/lib/openai/models/evals/run_list_response.rb +2 -2
  15. data/lib/openai/models/evals/run_retrieve_response.rb +2 -2
  16. data/lib/openai/models/realtime/client_secret_create_params.rb +93 -0
  17. data/lib/openai/models/realtime/client_secret_create_response.rb +300 -0
  18. data/lib/openai/models/realtime/conversation_created_event.rb +70 -0
  19. data/lib/openai/models/realtime/conversation_item.rb +44 -0
  20. data/lib/openai/models/realtime/conversation_item_added.rb +48 -0
  21. data/lib/openai/models/realtime/conversation_item_create_event.rb +57 -0
  22. data/lib/openai/models/realtime/conversation_item_created_event.rb +59 -0
  23. data/lib/openai/models/realtime/conversation_item_delete_event.rb +39 -0
  24. data/lib/openai/models/realtime/conversation_item_deleted_event.rb +38 -0
  25. data/lib/openai/models/realtime/conversation_item_done.rb +48 -0
  26. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +189 -0
  27. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +63 -0
  28. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rb +96 -0
  29. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_segment.rb +84 -0
  30. data/lib/openai/models/realtime/conversation_item_retrieve_event.rb +40 -0
  31. data/lib/openai/models/realtime/conversation_item_truncate_event.rb +68 -0
  32. data/lib/openai/models/realtime/conversation_item_truncated_event.rb +60 -0
  33. data/lib/openai/models/realtime/conversation_item_with_reference.rb +235 -0
  34. data/lib/openai/models/realtime/input_audio_buffer_append_event.rb +49 -0
  35. data/lib/openai/models/realtime/input_audio_buffer_clear_event.rb +29 -0
  36. data/lib/openai/models/realtime/input_audio_buffer_cleared_event.rb +29 -0
  37. data/lib/openai/models/realtime/input_audio_buffer_commit_event.rb +35 -0
  38. data/lib/openai/models/realtime/input_audio_buffer_committed_event.rb +51 -0
  39. data/lib/openai/models/realtime/input_audio_buffer_speech_started_event.rb +59 -0
  40. data/lib/openai/models/realtime/input_audio_buffer_speech_stopped_event.rb +51 -0
  41. data/lib/openai/models/realtime/input_audio_buffer_timeout_triggered.rb +52 -0
  42. data/lib/openai/models/realtime/log_prob_properties.rb +39 -0
  43. data/lib/openai/models/realtime/mcp_list_tools_completed.rb +36 -0
  44. data/lib/openai/models/realtime/mcp_list_tools_failed.rb +36 -0
  45. data/lib/openai/models/realtime/mcp_list_tools_in_progress.rb +36 -0
  46. data/lib/openai/models/realtime/output_audio_buffer_clear_event.rb +32 -0
  47. data/lib/openai/models/realtime/rate_limits_updated_event.rb +91 -0
  48. data/lib/openai/models/realtime/realtime_audio_config.rb +446 -0
  49. data/lib/openai/models/realtime/realtime_client_event.rb +123 -0
  50. data/lib/openai/models/realtime/realtime_client_secret_config.rb +64 -0
  51. data/lib/openai/models/realtime/realtime_conversation_item_assistant_message.rb +118 -0
  52. data/lib/openai/models/realtime/realtime_conversation_item_function_call.rb +94 -0
  53. data/lib/openai/models/realtime/realtime_conversation_item_function_call_output.rb +86 -0
  54. data/lib/openai/models/realtime/realtime_conversation_item_system_message.rb +118 -0
  55. data/lib/openai/models/realtime/realtime_conversation_item_user_message.rb +135 -0
  56. data/lib/openai/models/realtime/realtime_error.rb +55 -0
  57. data/lib/openai/models/realtime/realtime_error_event.rb +38 -0
  58. data/lib/openai/models/realtime/realtime_mcp_approval_request.rb +52 -0
  59. data/lib/openai/models/realtime/realtime_mcp_approval_response.rb +52 -0
  60. data/lib/openai/models/realtime/realtime_mcp_list_tools.rb +84 -0
  61. data/lib/openai/models/realtime/realtime_mcp_protocol_error.rb +29 -0
  62. data/lib/openai/models/realtime/realtime_mcp_tool_call.rb +94 -0
  63. data/lib/openai/models/realtime/realtime_mcp_tool_execution_error.rb +23 -0
  64. data/lib/openai/models/realtime/realtime_mcphttp_error.rb +29 -0
  65. data/lib/openai/models/realtime/realtime_response.rb +259 -0
  66. data/lib/openai/models/realtime/realtime_response_status.rb +103 -0
  67. data/lib/openai/models/realtime/realtime_response_usage.rb +61 -0
  68. data/lib/openai/models/realtime/realtime_response_usage_input_token_details.rb +36 -0
  69. data/lib/openai/models/realtime/realtime_response_usage_output_token_details.rb +28 -0
  70. data/lib/openai/models/realtime/realtime_server_event.rb +369 -0
  71. data/lib/openai/models/realtime/realtime_session.rb +696 -0
  72. data/lib/openai/models/realtime/realtime_session_create_request.rb +234 -0
  73. data/lib/openai/models/realtime/realtime_session_create_response.rb +579 -0
  74. data/lib/openai/models/realtime/realtime_tool_choice_config.rb +32 -0
  75. data/lib/openai/models/realtime/realtime_tools_config.rb +11 -0
  76. data/lib/openai/models/realtime/realtime_tools_config_union.rb +379 -0
  77. data/lib/openai/models/realtime/realtime_tracing_config.rb +61 -0
  78. data/lib/openai/models/realtime/realtime_transcription_session_create_request.rb +312 -0
  79. data/lib/openai/models/realtime/realtime_truncation.rb +67 -0
  80. data/lib/openai/models/realtime/response_audio_delta_event.rb +68 -0
  81. data/lib/openai/models/realtime/response_audio_done_event.rb +61 -0
  82. data/lib/openai/models/realtime/response_audio_transcript_delta_event.rb +68 -0
  83. data/lib/openai/models/realtime/response_audio_transcript_done_event.rb +70 -0
  84. data/lib/openai/models/realtime/response_cancel_event.rb +42 -0
  85. data/lib/openai/models/realtime/response_content_part_added_event.rb +120 -0
  86. data/lib/openai/models/realtime/response_content_part_done_event.rb +120 -0
  87. data/lib/openai/models/realtime/response_create_event.rb +391 -0
  88. data/lib/openai/models/realtime/response_created_event.rb +37 -0
  89. data/lib/openai/models/realtime/response_done_event.rb +38 -0
  90. data/lib/openai/models/realtime/response_function_call_arguments_delta_event.rb +72 -0
  91. data/lib/openai/models/realtime/response_function_call_arguments_done_event.rb +73 -0
  92. data/lib/openai/models/realtime/response_mcp_call_arguments_delta.rb +68 -0
  93. data/lib/openai/models/realtime/response_mcp_call_arguments_done.rb +60 -0
  94. data/lib/openai/models/realtime/response_mcp_call_completed.rb +44 -0
  95. data/lib/openai/models/realtime/response_mcp_call_failed.rb +44 -0
  96. data/lib/openai/models/realtime/response_mcp_call_in_progress.rb +44 -0
  97. data/lib/openai/models/realtime/response_output_item_added_event.rb +52 -0
  98. data/lib/openai/models/realtime/response_output_item_done_event.rb +53 -0
  99. data/lib/openai/models/realtime/response_text_delta_event.rb +68 -0
  100. data/lib/openai/models/realtime/response_text_done_event.rb +69 -0
  101. data/lib/openai/models/realtime/session_created_event.rb +38 -0
  102. data/lib/openai/models/realtime/session_update_event.rb +44 -0
  103. data/lib/openai/models/realtime/session_updated_event.rb +37 -0
  104. data/lib/openai/models/realtime/transcription_session_created.rb +278 -0
  105. data/lib/openai/models/realtime/transcription_session_update.rb +36 -0
  106. data/lib/openai/models/realtime/transcription_session_updated_event.rb +279 -0
  107. data/lib/openai/models/responses/response.rb +6 -3
  108. data/lib/openai/models/responses/response_create_params.rb +8 -3
  109. data/lib/openai/models/responses/response_function_tool_call.rb +7 -5
  110. data/lib/openai/models/responses/response_function_web_search.rb +35 -1
  111. data/lib/openai/models/responses/response_includable.rb +2 -0
  112. data/lib/openai/models/responses/response_output_text.rb +7 -5
  113. data/lib/openai/models/responses/tool.rb +6 -2
  114. data/lib/openai/models/responses/web_search_preview_tool.rb +124 -0
  115. data/lib/openai/models/responses/web_search_tool.rb +58 -21
  116. data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +119 -0
  117. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +4 -1
  118. data/lib/openai/models.rb +2 -0
  119. data/lib/openai/resources/conversations.rb +1 -1
  120. data/lib/openai/resources/realtime/client_secrets.rb +44 -0
  121. data/lib/openai/resources/realtime.rb +18 -0
  122. data/lib/openai/resources/responses.rb +2 -2
  123. data/lib/openai/resources/webhooks.rb +1 -1
  124. data/lib/openai/version.rb +1 -1
  125. data/lib/openai.rb +95 -0
  126. data/rbi/openai/client.rbi +3 -0
  127. data/rbi/openai/models/audio/speech_create_params.rbi +10 -0
  128. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +10 -0
  129. data/rbi/openai/models/conversations/item_list_params.rbi +4 -0
  130. data/rbi/openai/models/evals/run_cancel_response.rbi +4 -2
  131. data/rbi/openai/models/evals/run_create_params.rbi +8 -4
  132. data/rbi/openai/models/evals/run_create_response.rbi +4 -2
  133. data/rbi/openai/models/evals/run_list_response.rbi +4 -2
  134. data/rbi/openai/models/evals/run_retrieve_response.rbi +4 -2
  135. data/rbi/openai/models/realtime/client_secret_create_params.rbi +222 -0
  136. data/rbi/openai/models/realtime/client_secret_create_response.rbi +676 -0
  137. data/rbi/openai/models/realtime/conversation_created_event.rbi +164 -0
  138. data/rbi/openai/models/realtime/conversation_item.rbi +35 -0
  139. data/rbi/openai/models/realtime/conversation_item_added.rbi +105 -0
  140. data/rbi/openai/models/realtime/conversation_item_create_event.rbi +123 -0
  141. data/rbi/openai/models/realtime/conversation_item_created_event.rbi +117 -0
  142. data/rbi/openai/models/realtime/conversation_item_delete_event.rbi +57 -0
  143. data/rbi/openai/models/realtime/conversation_item_deleted_event.rbi +53 -0
  144. data/rbi/openai/models/realtime/conversation_item_done.rbi +105 -0
  145. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +305 -0
  146. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +93 -0
  147. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbi +158 -0
  148. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbi +107 -0
  149. data/rbi/openai/models/realtime/conversation_item_retrieve_event.rbi +58 -0
  150. data/rbi/openai/models/realtime/conversation_item_truncate_event.rbi +94 -0
  151. data/rbi/openai/models/realtime/conversation_item_truncated_event.rbi +80 -0
  152. data/rbi/openai/models/realtime/conversation_item_with_reference.rbi +549 -0
  153. data/rbi/openai/models/realtime/input_audio_buffer_append_event.rbi +65 -0
  154. data/rbi/openai/models/realtime/input_audio_buffer_clear_event.rbi +43 -0
  155. data/rbi/openai/models/realtime/input_audio_buffer_cleared_event.rbi +40 -0
  156. data/rbi/openai/models/realtime/input_audio_buffer_commit_event.rbi +49 -0
  157. data/rbi/openai/models/realtime/input_audio_buffer_committed_event.rbi +72 -0
  158. data/rbi/openai/models/realtime/input_audio_buffer_speech_started_event.rbi +82 -0
  159. data/rbi/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbi +73 -0
  160. data/rbi/openai/models/realtime/input_audio_buffer_timeout_triggered.rbi +75 -0
  161. data/rbi/openai/models/realtime/log_prob_properties.rbi +55 -0
  162. data/rbi/openai/models/realtime/mcp_list_tools_completed.rbi +51 -0
  163. data/rbi/openai/models/realtime/mcp_list_tools_failed.rbi +51 -0
  164. data/rbi/openai/models/realtime/mcp_list_tools_in_progress.rbi +51 -0
  165. data/rbi/openai/models/realtime/output_audio_buffer_clear_event.rbi +46 -0
  166. data/rbi/openai/models/realtime/rate_limits_updated_event.rbi +187 -0
  167. data/rbi/openai/models/realtime/realtime_audio_config.rbi +1004 -0
  168. data/rbi/openai/models/realtime/realtime_client_event.rbi +38 -0
  169. data/rbi/openai/models/realtime/realtime_client_secret_config.rbi +147 -0
  170. data/rbi/openai/models/realtime/realtime_conversation_item_assistant_message.rbi +292 -0
  171. data/rbi/openai/models/realtime/realtime_conversation_item_function_call.rbi +199 -0
  172. data/rbi/openai/models/realtime/realtime_conversation_item_function_call_output.rbi +188 -0
  173. data/rbi/openai/models/realtime/realtime_conversation_item_system_message.rbi +292 -0
  174. data/rbi/openai/models/realtime/realtime_conversation_item_user_message.rbi +319 -0
  175. data/rbi/openai/models/realtime/realtime_error.rbi +72 -0
  176. data/rbi/openai/models/realtime/realtime_error_event.rbi +64 -0
  177. data/rbi/openai/models/realtime/realtime_mcp_approval_request.rbi +75 -0
  178. data/rbi/openai/models/realtime/realtime_mcp_approval_response.rbi +75 -0
  179. data/rbi/openai/models/realtime/realtime_mcp_list_tools.rbi +131 -0
  180. data/rbi/openai/models/realtime/realtime_mcp_protocol_error.rbi +40 -0
  181. data/rbi/openai/models/realtime/realtime_mcp_tool_call.rbi +145 -0
  182. data/rbi/openai/models/realtime/realtime_mcp_tool_execution_error.rbi +31 -0
  183. data/rbi/openai/models/realtime/realtime_mcphttp_error.rbi +40 -0
  184. data/rbi/openai/models/realtime/realtime_response.rbi +573 -0
  185. data/rbi/openai/models/realtime/realtime_response_status.rbi +233 -0
  186. data/rbi/openai/models/realtime/realtime_response_usage.rbi +121 -0
  187. data/rbi/openai/models/realtime/realtime_response_usage_input_token_details.rbi +68 -0
  188. data/rbi/openai/models/realtime/realtime_response_usage_output_token_details.rbi +51 -0
  189. data/rbi/openai/models/realtime/realtime_server_event.rbi +311 -0
  190. data/rbi/openai/models/realtime/realtime_session.rbi +1426 -0
  191. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +560 -0
  192. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +1249 -0
  193. data/rbi/openai/models/realtime/realtime_tool_choice_config.rbi +30 -0
  194. data/rbi/openai/models/realtime/realtime_tools_config.rbi +15 -0
  195. data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +755 -0
  196. data/rbi/openai/models/realtime/realtime_tracing_config.rbi +95 -0
  197. data/rbi/openai/models/realtime/realtime_transcription_session_create_request.rbi +703 -0
  198. data/rbi/openai/models/realtime/realtime_truncation.rbi +117 -0
  199. data/rbi/openai/models/realtime/response_audio_delta_event.rbi +91 -0
  200. data/rbi/openai/models/realtime/response_audio_done_event.rbi +84 -0
  201. data/rbi/openai/models/realtime/response_audio_transcript_delta_event.rbi +91 -0
  202. data/rbi/openai/models/realtime/response_audio_transcript_done_event.rbi +93 -0
  203. data/rbi/openai/models/realtime/response_cancel_event.rbi +63 -0
  204. data/rbi/openai/models/realtime/response_content_part_added_event.rbi +219 -0
  205. data/rbi/openai/models/realtime/response_content_part_done_event.rbi +219 -0
  206. data/rbi/openai/models/realtime/response_create_event.rbi +863 -0
  207. data/rbi/openai/models/realtime/response_created_event.rbi +65 -0
  208. data/rbi/openai/models/realtime/response_done_event.rbi +66 -0
  209. data/rbi/openai/models/realtime/response_function_call_arguments_delta_event.rbi +91 -0
  210. data/rbi/openai/models/realtime/response_function_call_arguments_done_event.rbi +92 -0
  211. data/rbi/openai/models/realtime/response_mcp_call_arguments_delta.rbi +91 -0
  212. data/rbi/openai/models/realtime/response_mcp_call_arguments_done.rbi +83 -0
  213. data/rbi/openai/models/realtime/response_mcp_call_completed.rbi +67 -0
  214. data/rbi/openai/models/realtime/response_mcp_call_failed.rbi +67 -0
  215. data/rbi/openai/models/realtime/response_mcp_call_in_progress.rbi +67 -0
  216. data/rbi/openai/models/realtime/response_output_item_added_event.rbi +111 -0
  217. data/rbi/openai/models/realtime/response_output_item_done_event.rbi +112 -0
  218. data/rbi/openai/models/realtime/response_text_delta_event.rbi +91 -0
  219. data/rbi/openai/models/realtime/response_text_done_event.rbi +92 -0
  220. data/rbi/openai/models/realtime/session_created_event.rbi +64 -0
  221. data/rbi/openai/models/realtime/session_update_event.rbi +77 -0
  222. data/rbi/openai/models/realtime/session_updated_event.rbi +63 -0
  223. data/rbi/openai/models/realtime/transcription_session_created.rbi +653 -0
  224. data/rbi/openai/models/realtime/transcription_session_update.rbi +74 -0
  225. data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +657 -0
  226. data/rbi/openai/models/responses/response.rbi +10 -3
  227. data/rbi/openai/models/responses/response_create_params.rbi +20 -6
  228. data/rbi/openai/models/responses/response_function_web_search.rbi +78 -2
  229. data/rbi/openai/models/responses/response_includable.rbi +2 -0
  230. data/rbi/openai/models/responses/tool.rbi +2 -1
  231. data/rbi/openai/models/responses/web_search_preview_tool.rbi +245 -0
  232. data/rbi/openai/models/responses/web_search_tool.rbi +120 -23
  233. data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +222 -0
  234. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -0
  235. data/rbi/openai/models.rbi +2 -0
  236. data/rbi/openai/resources/conversations/items.rbi +2 -0
  237. data/rbi/openai/resources/conversations.rbi +1 -1
  238. data/rbi/openai/resources/realtime/client_secrets.rbi +38 -0
  239. data/rbi/openai/resources/realtime.rbi +15 -0
  240. data/rbi/openai/resources/responses.rbi +16 -4
  241. data/rbi/openai/resources/webhooks.rbi +1 -0
  242. data/sig/openai/client.rbs +2 -0
  243. data/sig/openai/models/audio/speech_create_params.rbs +4 -0
  244. data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -0
  245. data/sig/openai/models/realtime/client_secret_create_params.rbs +89 -0
  246. data/sig/openai/models/realtime/client_secret_create_response.rbs +292 -0
  247. data/sig/openai/models/realtime/conversation_created_event.rbs +70 -0
  248. data/sig/openai/models/realtime/conversation_item.rbs +22 -0
  249. data/sig/openai/models/realtime/conversation_item_added.rbs +37 -0
  250. data/sig/openai/models/realtime/conversation_item_create_event.rbs +41 -0
  251. data/sig/openai/models/realtime/conversation_item_created_event.rbs +37 -0
  252. data/sig/openai/models/realtime/conversation_item_delete_event.rbs +30 -0
  253. data/sig/openai/models/realtime/conversation_item_deleted_event.rbs +32 -0
  254. data/sig/openai/models/realtime/conversation_item_done.rbs +37 -0
  255. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbs +136 -0
  256. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbs +51 -0
  257. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbs +77 -0
  258. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbs +62 -0
  259. data/sig/openai/models/realtime/conversation_item_retrieve_event.rbs +34 -0
  260. data/sig/openai/models/realtime/conversation_item_truncate_event.rbs +44 -0
  261. data/sig/openai/models/realtime/conversation_item_truncated_event.rbs +42 -0
  262. data/sig/openai/models/realtime/conversation_item_with_reference.rbs +207 -0
  263. data/sig/openai/models/realtime/input_audio_buffer_append_event.rbs +30 -0
  264. data/sig/openai/models/realtime/input_audio_buffer_clear_event.rbs +23 -0
  265. data/sig/openai/models/realtime/input_audio_buffer_cleared_event.rbs +24 -0
  266. data/sig/openai/models/realtime/input_audio_buffer_commit_event.rbs +23 -0
  267. data/sig/openai/models/realtime/input_audio_buffer_committed_event.rbs +37 -0
  268. data/sig/openai/models/realtime/input_audio_buffer_speech_started_event.rbs +37 -0
  269. data/sig/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbs +37 -0
  270. data/sig/openai/models/realtime/input_audio_buffer_timeout_triggered.rbs +42 -0
  271. data/sig/openai/models/realtime/log_prob_properties.rbs +28 -0
  272. data/sig/openai/models/realtime/mcp_list_tools_completed.rbs +28 -0
  273. data/sig/openai/models/realtime/mcp_list_tools_failed.rbs +28 -0
  274. data/sig/openai/models/realtime/mcp_list_tools_in_progress.rbs +32 -0
  275. data/sig/openai/models/realtime/output_audio_buffer_clear_event.rbs +23 -0
  276. data/sig/openai/models/realtime/rate_limits_updated_event.rbs +85 -0
  277. data/sig/openai/models/realtime/realtime_audio_config.rbs +354 -0
  278. data/sig/openai/models/realtime/realtime_client_event.rbs +25 -0
  279. data/sig/openai/models/realtime/realtime_client_secret_config.rbs +60 -0
  280. data/sig/openai/models/realtime/realtime_conversation_item_assistant_message.rbs +117 -0
  281. data/sig/openai/models/realtime/realtime_conversation_item_function_call.rbs +86 -0
  282. data/sig/openai/models/realtime/realtime_conversation_item_function_call_output.rbs +79 -0
  283. data/sig/openai/models/realtime/realtime_conversation_item_system_message.rbs +117 -0
  284. data/sig/openai/models/realtime/realtime_conversation_item_user_message.rbs +132 -0
  285. data/sig/openai/models/realtime/realtime_error.rbs +42 -0
  286. data/sig/openai/models/realtime/realtime_error_event.rbs +32 -0
  287. data/sig/openai/models/realtime/realtime_mcp_approval_request.rbs +42 -0
  288. data/sig/openai/models/realtime/realtime_mcp_approval_response.rbs +42 -0
  289. data/sig/openai/models/realtime/realtime_mcp_list_tools.rbs +71 -0
  290. data/sig/openai/models/realtime/realtime_mcp_protocol_error.rbs +28 -0
  291. data/sig/openai/models/realtime/realtime_mcp_tool_call.rbs +68 -0
  292. data/sig/openai/models/realtime/realtime_mcp_tool_execution_error.rbs +18 -0
  293. data/sig/openai/models/realtime/realtime_mcphttp_error.rbs +24 -0
  294. data/sig/openai/models/realtime/realtime_response.rbs +210 -0
  295. data/sig/openai/models/realtime/realtime_response_status.rbs +90 -0
  296. data/sig/openai/models/realtime/realtime_response_usage.rbs +56 -0
  297. data/sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs +34 -0
  298. data/sig/openai/models/realtime/realtime_response_usage_output_token_details.rbs +22 -0
  299. data/sig/openai/models/realtime/realtime_server_event.rbs +168 -0
  300. data/sig/openai/models/realtime/realtime_session.rbs +521 -0
  301. data/sig/openai/models/realtime/realtime_session_create_request.rbs +178 -0
  302. data/sig/openai/models/realtime/realtime_session_create_response.rbs +526 -0
  303. data/sig/openai/models/realtime/realtime_tool_choice_config.rbs +16 -0
  304. data/sig/openai/models/realtime/realtime_tools_config.rbs +10 -0
  305. data/sig/openai/models/realtime/realtime_tools_config_union.rbs +280 -0
  306. data/sig/openai/models/realtime/realtime_tracing_config.rbs +43 -0
  307. data/sig/openai/models/realtime/realtime_transcription_session_create_request.rbs +242 -0
  308. data/sig/openai/models/realtime/realtime_truncation.rbs +53 -0
  309. data/sig/openai/models/realtime/response_audio_delta_event.rbs +52 -0
  310. data/sig/openai/models/realtime/response_audio_done_event.rbs +47 -0
  311. data/sig/openai/models/realtime/response_audio_transcript_delta_event.rbs +52 -0
  312. data/sig/openai/models/realtime/response_audio_transcript_done_event.rbs +52 -0
  313. data/sig/openai/models/realtime/response_cancel_event.rbs +32 -0
  314. data/sig/openai/models/realtime/response_content_part_added_event.rbs +105 -0
  315. data/sig/openai/models/realtime/response_content_part_done_event.rbs +105 -0
  316. data/sig/openai/models/realtime/response_create_event.rbs +281 -0
  317. data/sig/openai/models/realtime/response_created_event.rbs +32 -0
  318. data/sig/openai/models/realtime/response_done_event.rbs +32 -0
  319. data/sig/openai/models/realtime/response_function_call_arguments_delta_event.rbs +52 -0
  320. data/sig/openai/models/realtime/response_function_call_arguments_done_event.rbs +52 -0
  321. data/sig/openai/models/realtime/response_mcp_call_arguments_delta.rbs +52 -0
  322. data/sig/openai/models/realtime/response_mcp_call_arguments_done.rbs +47 -0
  323. data/sig/openai/models/realtime/response_mcp_call_completed.rbs +37 -0
  324. data/sig/openai/models/realtime/response_mcp_call_failed.rbs +37 -0
  325. data/sig/openai/models/realtime/response_mcp_call_in_progress.rbs +37 -0
  326. data/sig/openai/models/realtime/response_output_item_added_event.rbs +42 -0
  327. data/sig/openai/models/realtime/response_output_item_done_event.rbs +42 -0
  328. data/sig/openai/models/realtime/response_text_delta_event.rbs +52 -0
  329. data/sig/openai/models/realtime/response_text_done_event.rbs +52 -0
  330. data/sig/openai/models/realtime/session_created_event.rbs +32 -0
  331. data/sig/openai/models/realtime/session_update_event.rbs +34 -0
  332. data/sig/openai/models/realtime/session_updated_event.rbs +32 -0
  333. data/sig/openai/models/realtime/transcription_session_created.rbs +282 -0
  334. data/sig/openai/models/realtime/transcription_session_update.rbs +34 -0
  335. data/sig/openai/models/realtime/transcription_session_updated_event.rbs +282 -0
  336. data/sig/openai/models/responses/response_function_web_search.rbs +34 -3
  337. data/sig/openai/models/responses/tool.rbs +1 -0
  338. data/sig/openai/models/responses/web_search_preview_tool.rbs +96 -0
  339. data/sig/openai/models/responses/web_search_tool.rbs +39 -10
  340. data/sig/openai/models/webhooks/realtime_call_incoming_webhook_event.rbs +90 -0
  341. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
  342. data/sig/openai/models.rbs +2 -0
  343. data/sig/openai/resources/realtime/client_secrets.rbs +15 -0
  344. data/sig/openai/resources/realtime.rbs +9 -0
  345. data/sig/openai/resources/webhooks.rbs +1 -0
  346. metadata +287 -2
@@ -0,0 +1,123 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ # A realtime client event.
7
+ module RealtimeClientEvent
8
+ extend OpenAI::Internal::Type::Union
9
+
10
+ discriminator :type
11
+
12
+ # Add a new Item to the Conversation's context, including messages, function
13
+ # calls, and function call responses. This event can be used both to populate a
14
+ # "history" of the conversation and to add new items mid-stream, but has the
15
+ # current limitation that it cannot populate assistant audio messages.
16
+ #
17
+ # If successful, the server will respond with a `conversation.item.created`
18
+ # event, otherwise an `error` event will be sent.
19
+ variant :"conversation.item.create", -> { OpenAI::Realtime::ConversationItemCreateEvent }
20
+
21
+ # Send this event when you want to remove any item from the conversation
22
+ # history. The server will respond with a `conversation.item.deleted` event,
23
+ # unless the item does not exist in the conversation history, in which case the
24
+ # server will respond with an error.
25
+ variant :"conversation.item.delete", -> { OpenAI::Realtime::ConversationItemDeleteEvent }
26
+
27
+ # Send this event when you want to retrieve the server's representation of a specific item in the conversation history. This is useful, for example, to inspect user audio after noise cancellation and VAD.
28
+ # The server will respond with a `conversation.item.retrieved` event,
29
+ # unless the item does not exist in the conversation history, in which case the
30
+ # server will respond with an error.
31
+ variant :"conversation.item.retrieve", -> { OpenAI::Realtime::ConversationItemRetrieveEvent }
32
+
33
+ # Send this event to truncate a previous assistant message’s audio. The server
34
+ # will produce audio faster than realtime, so this event is useful when the user
35
+ # interrupts to truncate audio that has already been sent to the client but not
36
+ # yet played. This will synchronize the server's understanding of the audio with
37
+ # the client's playback.
38
+ #
39
+ # Truncating audio will delete the server-side text transcript to ensure there
40
+ # is not text in the context that hasn't been heard by the user.
41
+ #
42
+ # If successful, the server will respond with a `conversation.item.truncated`
43
+ # event.
44
+ variant :"conversation.item.truncate", -> { OpenAI::Realtime::ConversationItemTruncateEvent }
45
+
46
+ # Send this event to append audio bytes to the input audio buffer. The audio
47
+ # buffer is temporary storage you can write to and later commit. In Server VAD
48
+ # mode, the audio buffer is used to detect speech and the server will decide
49
+ # when to commit. When Server VAD is disabled, you must commit the audio buffer
50
+ # manually.
51
+ #
52
+ # The client may choose how much audio to place in each event up to a maximum
53
+ # of 15 MiB, for example streaming smaller chunks from the client may allow the
54
+ # VAD to be more responsive. Unlike made other client events, the server will
55
+ # not send a confirmation response to this event.
56
+ variant :"input_audio_buffer.append", -> { OpenAI::Realtime::InputAudioBufferAppendEvent }
57
+
58
+ # Send this event to clear the audio bytes in the buffer. The server will
59
+ # respond with an `input_audio_buffer.cleared` event.
60
+ variant :"input_audio_buffer.clear", -> { OpenAI::Realtime::InputAudioBufferClearEvent }
61
+
62
+ # **WebRTC Only:** Emit to cut off the current audio response. This will trigger the server to
63
+ # stop generating audio and emit a `output_audio_buffer.cleared` event. This
64
+ # event should be preceded by a `response.cancel` client event to stop the
65
+ # generation of the current response.
66
+ # [Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc).
67
+ variant :"output_audio_buffer.clear", -> { OpenAI::Realtime::OutputAudioBufferClearEvent }
68
+
69
+ # Send this event to commit the user input audio buffer, which will create a
70
+ # new user message item in the conversation. This event will produce an error
71
+ # if the input audio buffer is empty. When in Server VAD mode, the client does
72
+ # not need to send this event, the server will commit the audio buffer
73
+ # automatically.
74
+ #
75
+ # Committing the input audio buffer will trigger input audio transcription
76
+ # (if enabled in session configuration), but it will not create a response
77
+ # from the model. The server will respond with an `input_audio_buffer.committed`
78
+ # event.
79
+ variant :"input_audio_buffer.commit", -> { OpenAI::Realtime::InputAudioBufferCommitEvent }
80
+
81
+ # Send this event to cancel an in-progress response. The server will respond
82
+ # with a `response.done` event with a status of `response.status=cancelled`. If
83
+ # there is no response to cancel, the server will respond with an error.
84
+ variant :"response.cancel", -> { OpenAI::Realtime::ResponseCancelEvent }
85
+
86
+ # This event instructs the server to create a Response, which means triggering
87
+ # model inference. When in Server VAD mode, the server will create Responses
88
+ # automatically.
89
+ #
90
+ # A Response will include at least one Item, and may have two, in which case
91
+ # the second will be a function call. These Items will be appended to the
92
+ # conversation history.
93
+ #
94
+ # The server will respond with a `response.created` event, events for Items
95
+ # and content created, and finally a `response.done` event to indicate the
96
+ # Response is complete.
97
+ #
98
+ # The `response.create` event includes inference configuration like
99
+ # `instructions`, and `temperature`. These fields will override the Session's
100
+ # configuration for this Response only.
101
+ variant :"response.create", -> { OpenAI::Realtime::ResponseCreateEvent }
102
+
103
+ # Send this event to update the session’s default configuration.
104
+ # The client may send this event at any time to update any field,
105
+ # except for `voice`. However, note that once a session has been
106
+ # initialized with a particular `model`, it can’t be changed to
107
+ # another model using `session.update`.
108
+ #
109
+ # When the server receives a `session.update`, it will respond
110
+ # with a `session.updated` event showing the full, effective configuration.
111
+ # Only the fields that are present are updated. To clear a field like
112
+ # `instructions`, pass an empty string.
113
+ variant :"session.update", -> { OpenAI::Realtime::SessionUpdateEvent }
114
+
115
+ # Send this event to update a transcription session.
116
+ variant :"transcription_session.update", -> { OpenAI::Realtime::TranscriptionSessionUpdate }
117
+
118
+ # @!method self.variants
119
+ # @return [Array(OpenAI::Models::Realtime::ConversationItemCreateEvent, OpenAI::Models::Realtime::ConversationItemDeleteEvent, OpenAI::Models::Realtime::ConversationItemRetrieveEvent, OpenAI::Models::Realtime::ConversationItemTruncateEvent, OpenAI::Models::Realtime::InputAudioBufferAppendEvent, OpenAI::Models::Realtime::InputAudioBufferClearEvent, OpenAI::Models::Realtime::OutputAudioBufferClearEvent, OpenAI::Models::Realtime::InputAudioBufferCommitEvent, OpenAI::Models::Realtime::ResponseCancelEvent, OpenAI::Models::Realtime::ResponseCreateEvent, OpenAI::Models::Realtime::SessionUpdateEvent, OpenAI::Models::Realtime::TranscriptionSessionUpdate)]
120
+ end
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeClientSecretConfig < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute expires_after
8
+ # Configuration for the ephemeral token expiration.
9
+ #
10
+ # @return [OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter, nil]
11
+ optional :expires_after, -> { OpenAI::Realtime::RealtimeClientSecretConfig::ExpiresAfter }
12
+
13
+ # @!method initialize(expires_after: nil)
14
+ # Some parameter documentations has been truncated, see
15
+ # {OpenAI::Models::Realtime::RealtimeClientSecretConfig} for more details.
16
+ #
17
+ # Configuration options for the generated client secret.
18
+ #
19
+ # @param expires_after [OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter] Configuration for the ephemeral token expiration.
20
+
21
+ # @see OpenAI::Models::Realtime::RealtimeClientSecretConfig#expires_after
22
+ class ExpiresAfter < OpenAI::Internal::Type::BaseModel
23
+ # @!attribute anchor
24
+ # The anchor point for the ephemeral token expiration. Only `created_at` is
25
+ # currently supported.
26
+ #
27
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter::Anchor]
28
+ required :anchor, enum: -> { OpenAI::Realtime::RealtimeClientSecretConfig::ExpiresAfter::Anchor }
29
+
30
+ # @!attribute seconds
31
+ # The number of seconds from the anchor point to the expiration. Select a value
32
+ # between `10` and `7200`.
33
+ #
34
+ # @return [Integer, nil]
35
+ optional :seconds, Integer
36
+
37
+ # @!method initialize(anchor:, seconds: nil)
38
+ # Some parameter documentations has been truncated, see
39
+ # {OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter} for more
40
+ # details.
41
+ #
42
+ # Configuration for the ephemeral token expiration.
43
+ #
44
+ # @param anchor [Symbol, OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter::Anchor] The anchor point for the ephemeral token expiration. Only `created_at` is curren
45
+ #
46
+ # @param seconds [Integer] The number of seconds from the anchor point to the expiration. Select a value be
47
+
48
+ # The anchor point for the ephemeral token expiration. Only `created_at` is
49
+ # currently supported.
50
+ #
51
+ # @see OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter#anchor
52
+ module Anchor
53
+ extend OpenAI::Internal::Type::Enum
54
+
55
+ CREATED_AT = :created_at
56
+
57
+ # @!method self.values
58
+ # @return [Array<Symbol>]
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeConversationItemAssistantMessage < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ # The content of the message.
9
+ #
10
+ # @return [Array<OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content>]
11
+ required :content,
12
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Content] }
13
+
14
+ # @!attribute role
15
+ # The role of the message sender. Always `assistant`.
16
+ #
17
+ # @return [Symbol, :assistant]
18
+ required :role, const: :assistant
19
+
20
+ # @!attribute type
21
+ # The type of the item. Always `message`.
22
+ #
23
+ # @return [Symbol, :message]
24
+ required :type, const: :message
25
+
26
+ # @!attribute id
27
+ # The unique ID of the item.
28
+ #
29
+ # @return [String, nil]
30
+ optional :id, String
31
+
32
+ # @!attribute object
33
+ # Identifier for the API object being returned - always `realtime.item`.
34
+ #
35
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Object, nil]
36
+ optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Object }
37
+
38
+ # @!attribute status
39
+ # The status of the item. Has no effect on the conversation.
40
+ #
41
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Status, nil]
42
+ optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Status }
43
+
44
+ # @!method initialize(content:, id: nil, object: nil, status: nil, role: :assistant, type: :message)
45
+ # An assistant message item in a Realtime conversation.
46
+ #
47
+ # @param content [Array<OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content>] The content of the message.
48
+ #
49
+ # @param id [String] The unique ID of the item.
50
+ #
51
+ # @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Object] Identifier for the API object being returned - always `realtime.item`.
52
+ #
53
+ # @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Status] The status of the item. Has no effect on the conversation.
54
+ #
55
+ # @param role [Symbol, :assistant] The role of the message sender. Always `assistant`.
56
+ #
57
+ # @param type [Symbol, :message] The type of the item. Always `message`.
58
+
59
+ class Content < OpenAI::Internal::Type::BaseModel
60
+ # @!attribute text
61
+ # The text content.
62
+ #
63
+ # @return [String, nil]
64
+ optional :text, String
65
+
66
+ # @!attribute type
67
+ # The content type. Always `text` for assistant messages.
68
+ #
69
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content::Type, nil]
70
+ optional :type, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Content::Type }
71
+
72
+ # @!method initialize(text: nil, type: nil)
73
+ # @param text [String] The text content.
74
+ #
75
+ # @param type [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content::Type] The content type. Always `text` for assistant messages.
76
+
77
+ # The content type. Always `text` for assistant messages.
78
+ #
79
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content#type
80
+ module Type
81
+ extend OpenAI::Internal::Type::Enum
82
+
83
+ TEXT = :text
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
88
+ end
89
+
90
+ # Identifier for the API object being returned - always `realtime.item`.
91
+ #
92
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage#object
93
+ module Object
94
+ extend OpenAI::Internal::Type::Enum
95
+
96
+ REALTIME_ITEM = :"realtime.item"
97
+
98
+ # @!method self.values
99
+ # @return [Array<Symbol>]
100
+ end
101
+
102
+ # The status of the item. Has no effect on the conversation.
103
+ #
104
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage#status
105
+ module Status
106
+ extend OpenAI::Internal::Type::Enum
107
+
108
+ COMPLETED = :completed
109
+ INCOMPLETE = :incomplete
110
+ IN_PROGRESS = :in_progress
111
+
112
+ # @!method self.values
113
+ # @return [Array<Symbol>]
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeConversationItemFunctionCall < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute arguments
8
+ # The arguments of the function call.
9
+ #
10
+ # @return [String]
11
+ required :arguments, String
12
+
13
+ # @!attribute name
14
+ # The name of the function being called.
15
+ #
16
+ # @return [String]
17
+ required :name, String
18
+
19
+ # @!attribute type
20
+ # The type of the item. Always `function_call`.
21
+ #
22
+ # @return [Symbol, :function_call]
23
+ required :type, const: :function_call
24
+
25
+ # @!attribute id
26
+ # The unique ID of the item.
27
+ #
28
+ # @return [String, nil]
29
+ optional :id, String
30
+
31
+ # @!attribute call_id
32
+ # The ID of the function call.
33
+ #
34
+ # @return [String, nil]
35
+ optional :call_id, String
36
+
37
+ # @!attribute object
38
+ # Identifier for the API object being returned - always `realtime.item`.
39
+ #
40
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Object, nil]
41
+ optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCall::Object }
42
+
43
+ # @!attribute status
44
+ # The status of the item. Has no effect on the conversation.
45
+ #
46
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Status, nil]
47
+ optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCall::Status }
48
+
49
+ # @!method initialize(arguments:, name:, id: nil, call_id: nil, object: nil, status: nil, type: :function_call)
50
+ # A function call item in a Realtime conversation.
51
+ #
52
+ # @param arguments [String] The arguments of the function call.
53
+ #
54
+ # @param name [String] The name of the function being called.
55
+ #
56
+ # @param id [String] The unique ID of the item.
57
+ #
58
+ # @param call_id [String] The ID of the function call.
59
+ #
60
+ # @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Object] Identifier for the API object being returned - always `realtime.item`.
61
+ #
62
+ # @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Status] The status of the item. Has no effect on the conversation.
63
+ #
64
+ # @param type [Symbol, :function_call] The type of the item. Always `function_call`.
65
+
66
+ # Identifier for the API object being returned - always `realtime.item`.
67
+ #
68
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall#object
69
+ module Object
70
+ extend OpenAI::Internal::Type::Enum
71
+
72
+ REALTIME_ITEM = :"realtime.item"
73
+
74
+ # @!method self.values
75
+ # @return [Array<Symbol>]
76
+ end
77
+
78
+ # The status of the item. Has no effect on the conversation.
79
+ #
80
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall#status
81
+ module Status
82
+ extend OpenAI::Internal::Type::Enum
83
+
84
+ COMPLETED = :completed
85
+ INCOMPLETE = :incomplete
86
+ IN_PROGRESS = :in_progress
87
+
88
+ # @!method self.values
89
+ # @return [Array<Symbol>]
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeConversationItemFunctionCallOutput < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute call_id
8
+ # The ID of the function call this output is for.
9
+ #
10
+ # @return [String]
11
+ required :call_id, String
12
+
13
+ # @!attribute output
14
+ # The output of the function call.
15
+ #
16
+ # @return [String]
17
+ required :output, String
18
+
19
+ # @!attribute type
20
+ # The type of the item. Always `function_call_output`.
21
+ #
22
+ # @return [Symbol, :function_call_output]
23
+ required :type, const: :function_call_output
24
+
25
+ # @!attribute id
26
+ # The unique ID of the item.
27
+ #
28
+ # @return [String, nil]
29
+ optional :id, String
30
+
31
+ # @!attribute object
32
+ # Identifier for the API object being returned - always `realtime.item`.
33
+ #
34
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Object, nil]
35
+ optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCallOutput::Object }
36
+
37
+ # @!attribute status
38
+ # The status of the item. Has no effect on the conversation.
39
+ #
40
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Status, nil]
41
+ optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCallOutput::Status }
42
+
43
+ # @!method initialize(call_id:, output:, id: nil, object: nil, status: nil, type: :function_call_output)
44
+ # A function call output item in a Realtime conversation.
45
+ #
46
+ # @param call_id [String] The ID of the function call this output is for.
47
+ #
48
+ # @param output [String] The output of the function call.
49
+ #
50
+ # @param id [String] The unique ID of the item.
51
+ #
52
+ # @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Object] Identifier for the API object being returned - always `realtime.item`.
53
+ #
54
+ # @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Status] The status of the item. Has no effect on the conversation.
55
+ #
56
+ # @param type [Symbol, :function_call_output] The type of the item. Always `function_call_output`.
57
+
58
+ # Identifier for the API object being returned - always `realtime.item`.
59
+ #
60
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput#object
61
+ module Object
62
+ extend OpenAI::Internal::Type::Enum
63
+
64
+ REALTIME_ITEM = :"realtime.item"
65
+
66
+ # @!method self.values
67
+ # @return [Array<Symbol>]
68
+ end
69
+
70
+ # The status of the item. Has no effect on the conversation.
71
+ #
72
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput#status
73
+ module Status
74
+ extend OpenAI::Internal::Type::Enum
75
+
76
+ COMPLETED = :completed
77
+ INCOMPLETE = :incomplete
78
+ IN_PROGRESS = :in_progress
79
+
80
+ # @!method self.values
81
+ # @return [Array<Symbol>]
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeConversationItemSystemMessage < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ # The content of the message.
9
+ #
10
+ # @return [Array<OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content>]
11
+ required :content,
12
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeConversationItemSystemMessage::Content] }
13
+
14
+ # @!attribute role
15
+ # The role of the message sender. Always `system`.
16
+ #
17
+ # @return [Symbol, :system]
18
+ required :role, const: :system
19
+
20
+ # @!attribute type
21
+ # The type of the item. Always `message`.
22
+ #
23
+ # @return [Symbol, :message]
24
+ required :type, const: :message
25
+
26
+ # @!attribute id
27
+ # The unique ID of the item.
28
+ #
29
+ # @return [String, nil]
30
+ optional :id, String
31
+
32
+ # @!attribute object
33
+ # Identifier for the API object being returned - always `realtime.item`.
34
+ #
35
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Object, nil]
36
+ optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemSystemMessage::Object }
37
+
38
+ # @!attribute status
39
+ # The status of the item. Has no effect on the conversation.
40
+ #
41
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Status, nil]
42
+ optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemSystemMessage::Status }
43
+
44
+ # @!method initialize(content:, id: nil, object: nil, status: nil, role: :system, type: :message)
45
+ # A system message item in a Realtime conversation.
46
+ #
47
+ # @param content [Array<OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content>] The content of the message.
48
+ #
49
+ # @param id [String] The unique ID of the item.
50
+ #
51
+ # @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Object] Identifier for the API object being returned - always `realtime.item`.
52
+ #
53
+ # @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Status] The status of the item. Has no effect on the conversation.
54
+ #
55
+ # @param role [Symbol, :system] The role of the message sender. Always `system`.
56
+ #
57
+ # @param type [Symbol, :message] The type of the item. Always `message`.
58
+
59
+ class Content < OpenAI::Internal::Type::BaseModel
60
+ # @!attribute text
61
+ # The text content.
62
+ #
63
+ # @return [String, nil]
64
+ optional :text, String
65
+
66
+ # @!attribute type
67
+ # The content type. Always `input_text` for system messages.
68
+ #
69
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content::Type, nil]
70
+ optional :type, enum: -> { OpenAI::Realtime::RealtimeConversationItemSystemMessage::Content::Type }
71
+
72
+ # @!method initialize(text: nil, type: nil)
73
+ # @param text [String] The text content.
74
+ #
75
+ # @param type [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content::Type] The content type. Always `input_text` for system messages.
76
+
77
+ # The content type. Always `input_text` for system messages.
78
+ #
79
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content#type
80
+ module Type
81
+ extend OpenAI::Internal::Type::Enum
82
+
83
+ INPUT_TEXT = :input_text
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
88
+ end
89
+
90
+ # Identifier for the API object being returned - always `realtime.item`.
91
+ #
92
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage#object
93
+ module Object
94
+ extend OpenAI::Internal::Type::Enum
95
+
96
+ REALTIME_ITEM = :"realtime.item"
97
+
98
+ # @!method self.values
99
+ # @return [Array<Symbol>]
100
+ end
101
+
102
+ # The status of the item. Has no effect on the conversation.
103
+ #
104
+ # @see OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage#status
105
+ module Status
106
+ extend OpenAI::Internal::Type::Enum
107
+
108
+ COMPLETED = :completed
109
+ INCOMPLETE = :incomplete
110
+ IN_PROGRESS = :in_progress
111
+
112
+ # @!method self.values
113
+ # @return [Array<Symbol>]
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end