openai 0.102.0 → 0.104.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 (426) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +88 -0
  3. data/README.md +23 -1
  4. data/lib/openai/client.rb +3 -386
  5. data/lib/openai/helpers/admin/organization/projects/api_keys.rb +42 -0
  6. data/lib/openai/helpers/agents/session_stream_resource.rb +60 -0
  7. data/lib/openai/helpers/beta/agents/artifacts.rb +18 -0
  8. data/lib/openai/helpers/beta/agents/files.rb +41 -0
  9. data/lib/openai/helpers/client_runtime.rb +391 -0
  10. data/lib/openai/helpers/files.rb +47 -0
  11. data/lib/openai/helpers/live/websocket.rb +8 -57
  12. data/lib/openai/helpers/models/chat/parsed.rb +32 -0
  13. data/lib/openai/helpers/models/responses/parsed.rb +30 -0
  14. data/lib/openai/helpers/models/responses/response.rb +32 -0
  15. data/lib/openai/helpers/models/webhooks/webhook_endpoint_with_secret.rb +20 -0
  16. data/lib/openai/helpers/realtime/client_extension.rb +1 -2
  17. data/lib/openai/helpers/realtime/connection_manager.rb +1 -1
  18. data/lib/openai/helpers/realtime/translation.rb +7 -50
  19. data/lib/openai/helpers/responses_websocket/client_extension.rb +1 -2
  20. data/lib/openai/helpers/streaming/chat_completion_resource.rb +36 -0
  21. data/lib/openai/helpers/streaming/response_stream.rb +1 -16
  22. data/lib/openai/helpers/streaming/response_stream_resource.rb +78 -0
  23. data/lib/openai/helpers/vector_stores/file_batches.rb +188 -0
  24. data/lib/openai/helpers/vector_stores/files.rb +198 -0
  25. data/lib/openai/helpers/websocket/client_request.rb +31 -6
  26. data/lib/openai/helpers/websocket/connection.rb +58 -0
  27. data/lib/openai/helpers/websocket/connection_manager.rb +4 -2
  28. data/lib/openai/helpers/websocket/protocol.rb +2 -1
  29. data/lib/openai/helpers/websocket/resource.rb +54 -0
  30. data/lib/openai/helpers/websocket/typed_connection.rb +95 -0
  31. data/lib/openai/helpers/websocket.rb +4 -0
  32. data/lib/openai/models/admin/organization/audit_log_list_response.rb +5 -3
  33. data/lib/openai/models/admin/organization/external_storage_configuration.rb +5 -3
  34. data/lib/openai/models/admin/organization/external_storage_create_params.rb +33 -3
  35. data/lib/openai/models/admin/organization/oci_external_storage_provider.rb +37 -0
  36. data/lib/openai/models/admin/organization/project_residency.rb +3 -0
  37. data/lib/openai/models/admin/organization/projects/api_key_update_params.rb +64 -0
  38. data/lib/openai/models/admin/organization/projects/api_key_update_scopes_params.rb +34 -0
  39. data/lib/openai/models/admin/organization/usage_decisions_params.rb +177 -0
  40. data/lib/openai/models/admin/organization/usage_decisions_response.rb +351 -0
  41. data/lib/openai/models/audio/speech_create_params.rb +6 -3
  42. data/lib/openai/models/audio/translation_create_response.rb +0 -1
  43. data/lib/openai/models/audio/voice.rb +17 -2
  44. data/lib/openai/models/audio/voice_create_params.rb +100 -3
  45. data/lib/openai/models/beta/agent_create_params.rb +4 -2
  46. data/lib/openai/models/beta/agent_list_params.rb +4 -4
  47. data/lib/openai/models/beta/agent_session.rb +37 -1
  48. data/lib/openai/models/beta/agent_session_environment_expired_event.rb +57 -0
  49. data/lib/openai/models/beta/agent_session_environment_state.rb +6 -0
  50. data/lib/openai/models/beta/agent_session_environment_suspended_event.rb +57 -0
  51. data/lib/openai/models/beta/agent_session_event.rb +7 -1
  52. data/lib/openai/models/beta/agent_update_params.rb +4 -2
  53. data/lib/openai/models/beta/agents/environment_info.rb +3 -0
  54. data/lib/openai/models/beta/agents/environment_list_params.rb +7 -7
  55. data/lib/openai/models/beta/agents/session_create_params.rb +39 -3
  56. data/lib/openai/models/beta/agents/session_list_params.rb +7 -10
  57. data/lib/openai/models/beta/agents/session_update_params.rb +33 -1
  58. data/lib/openai/models/beta/agents/sessions/artifact_list_params.rb +11 -11
  59. data/lib/openai/models/beta/agents/vault_list_params.rb +23 -13
  60. data/lib/openai/models/beta/agents/vault_status_filter.rb +1 -3
  61. data/lib/openai/models/beta/agents/vault_update_params.rb +47 -0
  62. data/lib/openai/models/beta/agents/vaults/credential_list_params.rb +23 -13
  63. data/lib/openai/models/beta/beta_response.rb +23 -2
  64. data/lib/openai/models/beta/beta_response_error.rb +19 -1
  65. data/lib/openai/models/beta/beta_response_input_item.rb +107 -1
  66. data/lib/openai/models/beta/beta_response_item.rb +107 -1
  67. data/lib/openai/models/beta/beta_response_output_item.rb +107 -1
  68. data/lib/openai/models/beta/beta_responses_client_event.rb +23 -2
  69. data/lib/openai/models/beta/response_compact_params.rb +21 -0
  70. data/lib/openai/models/beta/response_create_params.rb +23 -2
  71. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  72. data/lib/openai/models/chat/chat_completion_audio_param.rb +3 -3
  73. data/lib/openai/models/chat/chat_completion_message.rb +0 -8
  74. data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +0 -8
  75. data/lib/openai/models/chat/completion_create_params.rb +5 -12
  76. data/lib/openai/models/chat_model.rb +21 -0
  77. data/lib/openai/models/conversations/conversation_item.rb +107 -1
  78. data/lib/openai/models/decision.rb +17 -2
  79. data/lib/openai/models/decision_create_params.rb +29 -12
  80. data/lib/openai/models/decision_input_image.rb +4 -3
  81. data/lib/openai/models/decision_input_message.rb +4 -4
  82. data/lib/openai/models/decision_input_part.rb +3 -2
  83. data/lib/openai/models/image_edit_completed_event.rb +1 -2
  84. data/lib/openai/models/image_edit_partial_image_event.rb +1 -2
  85. data/lib/openai/models/image_gen_completed_event.rb +1 -2
  86. data/lib/openai/models/image_gen_partial_image_event.rb +1 -2
  87. data/lib/openai/models/images_response.rb +1 -2
  88. data/lib/openai/models/live/built_in_voice.rb +1 -0
  89. data/lib/openai/models/live/client_event.rb +14 -2
  90. data/lib/openai/models/live/decision_create_event.rb +26 -0
  91. data/lib/openai/models/live/decision_event.rb +117 -0
  92. data/lib/openai/models/live/decision_item_create_event.rb +194 -0
  93. data/lib/openai/models/live/decision_item_created_event.rb +202 -0
  94. data/lib/openai/models/live/decision_item_delete_event.rb +38 -0
  95. data/lib/openai/models/live/decision_item_deleted_event.rb +46 -0
  96. data/lib/openai/models/live/decision_trigger.rb +244 -0
  97. data/lib/openai/models/live/decisions_delegation_config.rb +201 -0
  98. data/lib/openai/models/live/decisions_delegation_update_config.rb +208 -0
  99. data/lib/openai/models/live/delegation_created_event.rb +10 -10
  100. data/lib/openai/models/live/fork_client_event.rb +14 -2
  101. data/lib/openai/models/live/fork_server_event.rb +17 -2
  102. data/lib/openai/models/live/media_session_config.rb +47 -11
  103. data/lib/openai/models/live/output_audio_fixture_play_event.rb +48 -0
  104. data/lib/openai/models/live/output_audio_fixture_played_event.rb +42 -0
  105. data/lib/openai/models/live/output_audio_fixture_playing_event.rb +41 -0
  106. data/lib/openai/models/live/server_event.rb +17 -2
  107. data/lib/openai/models/live/session_accept_params.rb +47 -11
  108. data/lib/openai/models/live/session_config.rb +47 -11
  109. data/lib/openai/models/live/session_resource.rb +47 -11
  110. data/lib/openai/models/live/session_update_config.rb +38 -6
  111. data/lib/openai/models/live/session_update_event.rb +8 -8
  112. data/lib/openai/models/live/sideband_client_event.rb +57 -0
  113. data/lib/openai/models/live/sideband_server_event.rb +78 -0
  114. data/lib/openai/models/realtime/realtime_audio_config_output.rb +6 -3
  115. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +6 -3
  116. data/lib/openai/models/realtime/realtime_response_status.rb +10 -1
  117. data/lib/openai/models/response_format_json_schema.rb +1 -1
  118. data/lib/openai/models/responses/function_tool.rb +8 -6
  119. data/lib/openai/models/responses/response.rb +2 -23
  120. data/lib/openai/models/responses/response_compact_params.rb +21 -0
  121. data/lib/openai/models/responses/response_create_params.rb +3 -6
  122. data/lib/openai/models/responses/response_error.rb +19 -1
  123. data/lib/openai/models/responses/response_format_text_config.rb +0 -4
  124. data/lib/openai/models/responses/response_function_tool_call.rb +0 -8
  125. data/lib/openai/models/responses/response_input_item.rb +107 -1
  126. data/lib/openai/models/responses/response_item.rb +107 -1
  127. data/lib/openai/models/responses/response_output_item.rb +107 -1
  128. data/lib/openai/models/responses/response_output_text.rb +0 -8
  129. data/lib/openai/models/responses/responses_client_event.rb +2 -2
  130. data/lib/openai/models/safety/safety_alert.rb +12 -1
  131. data/lib/openai/models/video_create_error.rb +19 -1
  132. data/lib/openai/models/webhooks/agent_environment_expired_webhook_event.rb +72 -0
  133. data/lib/openai/models/webhooks/agent_environment_suspended_webhook_event.rb +72 -0
  134. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +8 -3
  135. data/lib/openai/models/webhooks/webhook_create_params.rb +2 -0
  136. data/lib/openai/models/webhooks/webhook_endpoint_with_secret.rb +0 -9
  137. data/lib/openai/models/webhooks/webhook_test_params.rb +2 -0
  138. data/lib/openai/models/webhooks/webhook_update_params.rb +2 -0
  139. data/lib/openai/resources/admin/organization/external_storage.rb +1 -1
  140. data/lib/openai/resources/admin/organization/projects/api_keys.rb +61 -0
  141. data/lib/openai/resources/admin/organization/usage.rb +67 -0
  142. data/lib/openai/resources/audio/speech.rb +2 -1
  143. data/lib/openai/resources/audio/voices.rb +10 -10
  144. data/lib/openai/resources/beta/agents/environments/files.rb +3 -31
  145. data/lib/openai/resources/beta/agents/environments.rb +3 -3
  146. data/lib/openai/resources/beta/agents/sessions/artifacts.rb +5 -11
  147. data/lib/openai/resources/beta/agents/sessions/events.rb +1 -1
  148. data/lib/openai/resources/beta/agents/sessions.rb +20 -56
  149. data/lib/openai/resources/beta/agents/vaults/credentials.rb +10 -6
  150. data/lib/openai/resources/beta/agents/vaults.rb +45 -6
  151. data/lib/openai/resources/beta/agents.rb +6 -4
  152. data/lib/openai/resources/beta/responses.rb +2 -2
  153. data/lib/openai/resources/chat/completions.rb +11 -37
  154. data/lib/openai/resources/decisions.rb +9 -15
  155. data/lib/openai/resources/files.rb +0 -39
  156. data/lib/openai/resources/live/forks.rb +19 -0
  157. data/lib/openai/resources/live/sideband.rb +19 -0
  158. data/lib/openai/resources/live.rb +19 -0
  159. data/lib/openai/resources/realtime/translations.rb +19 -0
  160. data/lib/openai/resources/realtime.rb +19 -0
  161. data/lib/openai/resources/responses.rb +44 -95
  162. data/lib/openai/resources/vector_stores/file_batches.rb +0 -178
  163. data/lib/openai/resources/vector_stores/files.rb +0 -188
  164. data/lib/openai/resources/webhooks.rb +13 -29
  165. data/lib/openai/version.rb +1 -1
  166. data/lib/openai.rb +35 -0
  167. data/rbi/openai/client.rbi +0 -103
  168. data/rbi/openai/helpers/admin/organization/projects/api_keys.rbi +25 -0
  169. data/rbi/openai/helpers/beta/agents/artifacts.rbi +25 -0
  170. data/rbi/openai/helpers/beta/agents/files.rbi +48 -0
  171. data/rbi/openai/helpers/client_runtime.rbi +108 -0
  172. data/rbi/openai/helpers/files.rbi +25 -0
  173. data/rbi/openai/helpers/models/chat/parsed.rbi +21 -0
  174. data/rbi/openai/helpers/models/responses/parsed.rbi +19 -0
  175. data/rbi/openai/helpers/models/responses/response.rbi +15 -0
  176. data/rbi/openai/helpers/streaming/response_stream.rbi +301 -0
  177. data/rbi/openai/helpers/vector_stores/file_batches.rbi +102 -0
  178. data/rbi/openai/helpers/vector_stores/files.rbi +122 -0
  179. data/rbi/openai/helpers/websocket.rbi +82 -0
  180. data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +6 -3
  181. data/rbi/openai/models/admin/organization/external_storage_configuration.rbi +4 -2
  182. data/rbi/openai/models/admin/organization/external_storage_create_params.rbi +63 -4
  183. data/rbi/openai/models/admin/organization/oci_external_storage_provider.rbi +71 -0
  184. data/rbi/openai/models/admin/organization/project_residency.rbi +12 -0
  185. data/rbi/openai/models/admin/organization/projects/api_key_update_params.rbi +110 -0
  186. data/rbi/openai/models/admin/organization/projects/api_key_update_scopes_params.rbi +72 -0
  187. data/rbi/openai/models/admin/organization/usage_decisions_params.rbi +229 -0
  188. data/rbi/openai/models/admin/organization/usage_decisions_response.rbi +479 -0
  189. data/rbi/openai/models/audio/speech_create_params.rbi +6 -3
  190. data/rbi/openai/models/audio/voice.rbi +21 -2
  191. data/rbi/openai/models/audio/voice_create_params.rbi +149 -4
  192. data/rbi/openai/models/beta/agent_create_params.rbi +4 -2
  193. data/rbi/openai/models/beta/agent_list_params.rbi +8 -5
  194. data/rbi/openai/models/beta/agent_session.rbi +64 -1
  195. data/rbi/openai/models/beta/agent_session_environment_expired_event.rbi +95 -0
  196. data/rbi/openai/models/beta/agent_session_environment_state.rbi +6 -0
  197. data/rbi/openai/models/beta/agent_session_environment_suspended_event.rbi +95 -0
  198. data/rbi/openai/models/beta/agent_session_event.rbi +2 -0
  199. data/rbi/openai/models/beta/agent_update_params.rbi +4 -2
  200. data/rbi/openai/models/beta/agents/environment_info.rbi +3 -0
  201. data/rbi/openai/models/beta/agents/environment_list_params.rbi +7 -7
  202. data/rbi/openai/models/beta/agents/session_create_params.rbi +62 -2
  203. data/rbi/openai/models/beta/agents/session_list_params.rbi +11 -11
  204. data/rbi/openai/models/beta/agents/session_update_params.rbi +56 -0
  205. data/rbi/openai/models/beta/agents/sessions/artifact_list_params.rbi +19 -13
  206. data/rbi/openai/models/beta/agents/vault_list_params.rbi +30 -13
  207. data/rbi/openai/models/beta/agents/vault_status_filter.rbi +1 -3
  208. data/rbi/openai/models/beta/agents/vault_update_params.rbi +87 -0
  209. data/rbi/openai/models/beta/agents/vaults/credential_list_params.rbi +30 -13
  210. data/rbi/openai/models/beta/beta_response.rbi +2 -2
  211. data/rbi/openai/models/beta/beta_response_error.rbi +24 -3
  212. data/rbi/openai/models/beta/beta_response_input_item.rbi +191 -0
  213. data/rbi/openai/models/beta/beta_response_item.rbi +189 -0
  214. data/rbi/openai/models/beta/beta_response_output_item.rbi +191 -0
  215. data/rbi/openai/models/beta/beta_responses_client_event.rbi +2 -2
  216. data/rbi/openai/models/beta/response_create_params.rbi +2 -2
  217. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  218. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +3 -3
  219. data/rbi/openai/models/chat/chat_completion_message.rbi +0 -4
  220. data/rbi/openai/models/chat/chat_completion_message_function_tool_call.rbi +0 -4
  221. data/rbi/openai/models/chat/completion_create_params.rbi +63 -78
  222. data/rbi/openai/models/conversations/conversation_item.rbi +191 -0
  223. data/rbi/openai/models/decision.rbi +14 -1
  224. data/rbi/openai/models/decision_create_params.rbi +23 -12
  225. data/rbi/openai/models/decision_input_image.rbi +4 -3
  226. data/rbi/openai/models/decision_input_message.rbi +4 -4
  227. data/rbi/openai/models/decision_input_part.rbi +2 -1
  228. data/rbi/openai/models/image_edit_completed_event.rbi +1 -0
  229. data/rbi/openai/models/image_edit_partial_image_event.rbi +1 -0
  230. data/rbi/openai/models/image_gen_completed_event.rbi +1 -0
  231. data/rbi/openai/models/image_gen_partial_image_event.rbi +1 -0
  232. data/rbi/openai/models/images_response.rbi +1 -0
  233. data/rbi/openai/models/live/built_in_voice.rbi +1 -0
  234. data/rbi/openai/models/live/client_event.rbi +4 -0
  235. data/rbi/openai/models/live/decision_create_event.rbi +55 -0
  236. data/rbi/openai/models/live/decision_event.rbi +185 -0
  237. data/rbi/openai/models/live/decision_item_create_event.rbi +338 -0
  238. data/rbi/openai/models/live/decision_item_created_event.rbi +354 -0
  239. data/rbi/openai/models/live/decision_item_delete_event.rbi +66 -0
  240. data/rbi/openai/models/live/decision_item_deleted_event.rbi +77 -0
  241. data/rbi/openai/models/live/decision_trigger.rbi +465 -0
  242. data/rbi/openai/models/live/decisions_delegation_config.rbi +393 -0
  243. data/rbi/openai/models/live/decisions_delegation_update_config.rbi +412 -0
  244. data/rbi/openai/models/live/delegation_created_event.rbi +8 -10
  245. data/rbi/openai/models/live/fork_client_event.rbi +4 -0
  246. data/rbi/openai/models/live/fork_server_event.rbi +5 -0
  247. data/rbi/openai/models/live/media_session_config.rbi +95 -14
  248. data/rbi/openai/models/live/output_audio_fixture_play_event.rbi +76 -0
  249. data/rbi/openai/models/live/output_audio_fixture_played_event.rbi +73 -0
  250. data/rbi/openai/models/live/output_audio_fixture_playing_event.rbi +72 -0
  251. data/rbi/openai/models/live/server_event.rbi +5 -0
  252. data/rbi/openai/models/live/session_accept_params.rbi +88 -12
  253. data/rbi/openai/models/live/session_config.rbi +100 -14
  254. data/rbi/openai/models/live/session_resource.rbi +81 -10
  255. data/rbi/openai/models/live/session_update_config.rbi +86 -9
  256. data/rbi/openai/models/live/session_update_event.rbi +8 -8
  257. data/rbi/openai/models/live/sideband_client_event.rbi +40 -0
  258. data/rbi/openai/models/live/sideband_server_event.rbi +47 -0
  259. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +6 -3
  260. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +6 -3
  261. data/rbi/openai/models/realtime/realtime_response_status.rbi +13 -1
  262. data/rbi/openai/models/realtime/realtime_translation_input_audio_buffer_append_event.rbi +1 -1
  263. data/rbi/openai/models/realtime/realtime_translation_output_audio_delta_event.rbi +3 -3
  264. data/rbi/openai/models/realtime/realtime_translation_session_close_event.rbi +1 -1
  265. data/rbi/openai/models/realtime/realtime_translation_session_update_event.rbi +5 -1
  266. data/rbi/openai/models/responses/response.rbi +2 -7
  267. data/rbi/openai/models/responses/response_create_params.rbi +5 -9
  268. data/rbi/openai/models/responses/response_error.rbi +24 -3
  269. data/rbi/openai/models/responses/response_function_tool_call.rbi +0 -4
  270. data/rbi/openai/models/responses/response_function_web_search.rbi +21 -17
  271. data/rbi/openai/models/responses/response_input_item.rbi +191 -0
  272. data/rbi/openai/models/responses/response_item.rbi +189 -0
  273. data/rbi/openai/models/responses/response_output_item.rbi +191 -0
  274. data/rbi/openai/models/responses/response_output_text.rbi +0 -4
  275. data/rbi/openai/models/responses/responses_client_event.rbi +2 -2
  276. data/rbi/openai/models/safety/safety_alert.rbi +13 -1
  277. data/rbi/openai/models/video_create_error.rbi +24 -3
  278. data/rbi/openai/models/webhooks/agent_environment_expired_webhook_event.rbi +133 -0
  279. data/rbi/openai/models/webhooks/agent_environment_suspended_webhook_event.rbi +133 -0
  280. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +3 -2
  281. data/rbi/openai/models/webhooks/webhook_create_params.rbi +8 -0
  282. data/rbi/openai/models/webhooks/webhook_test_params.rbi +8 -0
  283. data/rbi/openai/models/webhooks/webhook_update_params.rbi +8 -0
  284. data/rbi/openai/resources/admin/organization/external_storage.rbi +2 -1
  285. data/rbi/openai/resources/admin/organization/projects/api_keys.rbi +48 -0
  286. data/rbi/openai/resources/admin/organization/usage.rbi +56 -0
  287. data/rbi/openai/resources/audio/speech.rbi +2 -1
  288. data/rbi/openai/resources/audio/voices.rbi +13 -10
  289. data/rbi/openai/resources/beta/agents/environments/files.rbi +3 -33
  290. data/rbi/openai/resources/beta/agents/environments.rbi +3 -3
  291. data/rbi/openai/resources/beta/agents/sessions/artifacts.rbi +5 -13
  292. data/rbi/openai/resources/beta/agents/sessions.rbi +15 -4
  293. data/rbi/openai/resources/beta/agents/vaults/credentials.rbi +9 -5
  294. data/rbi/openai/resources/beta/agents/vaults.rbi +34 -5
  295. data/rbi/openai/resources/beta/agents.rbi +6 -4
  296. data/rbi/openai/resources/beta/responses.rbi +2 -2
  297. data/rbi/openai/resources/chat/completions.rbi +26 -29
  298. data/rbi/openai/resources/decisions.rbi +9 -15
  299. data/rbi/openai/resources/files.rbi +0 -18
  300. data/rbi/openai/resources/live/forks.rbi +17 -0
  301. data/rbi/openai/resources/live/sideband.rbi +17 -0
  302. data/rbi/openai/resources/live.rbi +17 -0
  303. data/rbi/openai/resources/realtime/translations.rbi +17 -0
  304. data/rbi/openai/resources/realtime.rbi +17 -0
  305. data/rbi/openai/resources/responses.rbi +41 -333
  306. data/rbi/openai/resources/vector_stores/file_batches.rbi +0 -93
  307. data/rbi/openai/resources/vector_stores/files.rbi +0 -113
  308. data/rbi/openai/resources/webhooks.rbi +2 -0
  309. data/sig/openai/client.rbs +0 -50
  310. data/sig/openai/helpers/admin/organization/projects/api_keys.rbs +18 -0
  311. data/sig/openai/helpers/beta/agents/artifacts.rbs +17 -0
  312. data/sig/openai/helpers/beta/agents/files.rbs +30 -0
  313. data/sig/openai/helpers/client_runtime.rbs +53 -0
  314. data/sig/openai/helpers/files.rbs +12 -0
  315. data/sig/openai/helpers/models/responses/response.rbs +9 -0
  316. data/sig/openai/helpers/streaming/response_stream.rbs +37 -0
  317. data/sig/openai/helpers/vector_stores/file_batches.rbs +38 -0
  318. data/sig/openai/helpers/vector_stores/files.rbs +43 -0
  319. data/sig/openai/helpers/websocket.rbs +40 -0
  320. data/sig/openai/models/admin/organization/audit_log_list_response.rbs +1 -0
  321. data/sig/openai/models/admin/organization/external_storage_configuration.rbs +1 -0
  322. data/sig/openai/models/admin/organization/external_storage_create_params.rbs +33 -0
  323. data/sig/openai/models/admin/organization/oci_external_storage_provider.rbs +34 -0
  324. data/sig/openai/models/admin/organization/project_residency.rbs +6 -0
  325. data/sig/openai/models/admin/organization/projects/api_key_update_params.rbs +77 -0
  326. data/sig/openai/models/admin/organization/projects/api_key_update_scopes_params.rbs +38 -0
  327. data/sig/openai/models/admin/organization/usage_decisions_params.rbs +170 -0
  328. data/sig/openai/models/admin/organization/usage_decisions_response.rbs +319 -0
  329. data/sig/openai/models/audio/speech_create_params.rbs +4 -2
  330. data/sig/openai/models/audio/voice.rbs +21 -3
  331. data/sig/openai/models/audio/voice_create_params.rbs +90 -1
  332. data/sig/openai/models/beta/agent_create_params.rbs +4 -2
  333. data/sig/openai/models/beta/agent_list_params.rbs +9 -6
  334. data/sig/openai/models/beta/agent_session.rbs +36 -2
  335. data/sig/openai/models/beta/agent_session_environment_expired_event.rbs +57 -0
  336. data/sig/openai/models/beta/agent_session_environment_state.rbs +14 -1
  337. data/sig/openai/models/beta/agent_session_environment_suspended_event.rbs +57 -0
  338. data/sig/openai/models/beta/agent_session_event.rbs +2 -0
  339. data/sig/openai/models/beta/agent_update_params.rbs +4 -2
  340. data/sig/openai/models/beta/agents/environment_info.rbs +11 -1
  341. data/sig/openai/models/beta/agents/environment_list_params.rbs +9 -9
  342. data/sig/openai/models/beta/agents/session_create_params.rbs +29 -2
  343. data/sig/openai/models/beta/agents/session_list_params.rbs +12 -12
  344. data/sig/openai/models/beta/agents/session_update_params.rbs +23 -0
  345. data/sig/openai/models/beta/agents/sessions/artifact_list_params.rbs +21 -15
  346. data/sig/openai/models/beta/agents/vault_list_params.rbs +32 -14
  347. data/sig/openai/models/beta/agents/vault_update_params.rbs +54 -0
  348. data/sig/openai/models/beta/agents/vaults/credential_list_params.rbs +32 -14
  349. data/sig/openai/models/beta/beta_response.rbs +2 -2
  350. data/sig/openai/models/beta/beta_response_error.rbs +19 -3
  351. data/sig/openai/models/beta/beta_response_input_item.rbs +110 -0
  352. data/sig/openai/models/beta/beta_response_item.rbs +110 -0
  353. data/sig/openai/models/beta/beta_response_output_item.rbs +110 -0
  354. data/sig/openai/models/beta/beta_responses_client_event.rbs +2 -2
  355. data/sig/openai/models/beta/response_create_params.rbs +2 -2
  356. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  357. data/sig/openai/models/chat/chat_completion_audio_param.rbs +2 -2
  358. data/sig/openai/models/chat/completion_create_params.rbs +2 -2
  359. data/sig/openai/models/conversations/conversation_item.rbs +110 -0
  360. data/sig/openai/models/decision.rbs +13 -0
  361. data/sig/openai/models/decision_create_params.rbs +19 -8
  362. data/sig/openai/models/decision_input_image.rbs +2 -2
  363. data/sig/openai/models/decision_input_message.rbs +2 -2
  364. data/sig/openai/models/live/built_in_voice.rbs +2 -0
  365. data/sig/openai/models/live/client_event.rbs +4 -0
  366. data/sig/openai/models/live/decision_create_event.rbs +18 -0
  367. data/sig/openai/models/live/decision_event.rbs +102 -0
  368. data/sig/openai/models/live/decision_item_create_event.rbs +183 -0
  369. data/sig/openai/models/live/decision_item_created_event.rbs +195 -0
  370. data/sig/openai/models/live/decision_item_delete_event.rbs +33 -0
  371. data/sig/openai/models/live/decision_item_deleted_event.rbs +49 -0
  372. data/sig/openai/models/live/decision_trigger.rbs +234 -0
  373. data/sig/openai/models/live/decisions_delegation_config.rbs +195 -0
  374. data/sig/openai/models/live/decisions_delegation_update_config.rbs +202 -0
  375. data/sig/openai/models/live/delegation_created_event.rbs +6 -7
  376. data/sig/openai/models/live/fork_client_event.rbs +4 -0
  377. data/sig/openai/models/live/fork_server_event.rbs +5 -0
  378. data/sig/openai/models/live/media_session_config.rbs +58 -11
  379. data/sig/openai/models/live/output_audio_fixture_play_event.rbs +42 -0
  380. data/sig/openai/models/live/output_audio_fixture_played_event.rbs +44 -0
  381. data/sig/openai/models/live/output_audio_fixture_playing_event.rbs +44 -0
  382. data/sig/openai/models/live/server_event.rbs +5 -0
  383. data/sig/openai/models/live/session_accept_params.rbs +57 -10
  384. data/sig/openai/models/live/session_config.rbs +58 -11
  385. data/sig/openai/models/live/session_resource.rbs +57 -10
  386. data/sig/openai/models/live/session_update_config.rbs +54 -3
  387. data/sig/openai/models/live/session_update_event.rbs +6 -6
  388. data/sig/openai/models/live/sideband_client_event.rbs +26 -0
  389. data/sig/openai/models/live/sideband_server_event.rbs +33 -0
  390. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +6 -3
  391. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +6 -3
  392. data/sig/openai/models/realtime/realtime_response_status.rbs +15 -3
  393. data/sig/openai/models/responses/response.rbs +2 -4
  394. data/sig/openai/models/responses/response_create_params.rbs +2 -2
  395. data/sig/openai/models/responses/response_error.rbs +19 -3
  396. data/sig/openai/models/responses/response_input_item.rbs +110 -0
  397. data/sig/openai/models/responses/response_item.rbs +110 -0
  398. data/sig/openai/models/responses/response_output_item.rbs +110 -0
  399. data/sig/openai/models/responses/responses_client_event.rbs +2 -2
  400. data/sig/openai/models/safety/safety_alert.rbs +12 -2
  401. data/sig/openai/models/video_create_error.rbs +19 -3
  402. data/sig/openai/models/webhooks/agent_environment_expired_webhook_event.rbs +70 -0
  403. data/sig/openai/models/webhooks/agent_environment_suspended_webhook_event.rbs +70 -0
  404. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +3 -1
  405. data/sig/openai/models/webhooks/webhook_create_params.rbs +4 -0
  406. data/sig/openai/models/webhooks/webhook_test_params.rbs +4 -0
  407. data/sig/openai/models/webhooks/webhook_update_params.rbs +4 -0
  408. data/sig/openai/resources/admin/organization/projects/api_keys.rbs +8 -0
  409. data/sig/openai/resources/admin/organization/usage.rbs +15 -0
  410. data/sig/openai/resources/beta/agents/environments/files.rbs +0 -17
  411. data/sig/openai/resources/beta/agents/sessions/artifacts.rbs +2 -6
  412. data/sig/openai/resources/beta/agents/sessions.rbs +4 -1
  413. data/sig/openai/resources/beta/agents/vaults/credentials.rbs +2 -1
  414. data/sig/openai/resources/beta/agents/vaults.rbs +9 -1
  415. data/sig/openai/resources/beta/agents.rbs +1 -1
  416. data/sig/openai/resources/files.rbs +0 -7
  417. data/sig/openai/resources/live/forks.rbs +8 -0
  418. data/sig/openai/resources/live/sideband.rbs +8 -0
  419. data/sig/openai/resources/live.rbs +7 -0
  420. data/sig/openai/resources/realtime/translations.rbs +7 -0
  421. data/sig/openai/resources/realtime.rbs +7 -0
  422. data/sig/openai/resources/responses.rbs +7 -31
  423. data/sig/openai/resources/vector_stores/file_batches.rbs +0 -31
  424. data/sig/openai/resources/vector_stores/files.rbs +0 -36
  425. data/sig/openai/resources/webhooks.rbs +3 -1
  426. metadata +101 -1
@@ -0,0 +1,244 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Live
6
+ class DecisionTrigger < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute decisions
8
+ # Questions evaluated using the current transcript and the session's shared
9
+ # Decision items.
10
+ #
11
+ # @return [OpenAI::Models::Live::DecisionTrigger::Decisions]
12
+ required :decisions, -> { OpenAI::Live::DecisionTrigger::Decisions }
13
+
14
+ # @!attribute event_type
15
+ #
16
+ # @return [Symbol, OpenAI::Models::Live::DecisionTrigger::EventType]
17
+ required :event_type, enum: -> { OpenAI::Live::DecisionTrigger::EventType }
18
+
19
+ # @!attribute type
20
+ #
21
+ # @return [Symbol, :decisions]
22
+ required :type, const: :decisions
23
+
24
+ # @!method initialize(decisions:, event_type:, type: :decisions)
25
+ # @param decisions [OpenAI::Models::Live::DecisionTrigger::Decisions]
26
+ # Questions evaluated using the current transcript and the session's shared
27
+ # Decision items.
28
+ #
29
+ # @param event_type [Symbol, OpenAI::Models::Live::DecisionTrigger::EventType]
30
+ #
31
+ # @param type [Symbol, :decisions]
32
+
33
+ # @see OpenAI::Models::Live::DecisionTrigger#decisions
34
+ class Decisions < OpenAI::Internal::Type::BaseModel
35
+ # @!attribute questions
36
+ # Native Decision API questions evaluated together, in order.
37
+ #
38
+ # @return [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Predicate, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score>]
39
+ required(
40
+ :questions,
41
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::DecisionTrigger::Decisions::Question] }
42
+ )
43
+
44
+ # @!method initialize(questions:)
45
+ # Questions evaluated using the current transcript and the session's shared
46
+ # Decision items.
47
+ #
48
+ # @param questions [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Predicate, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score>]
49
+ # Native Decision API questions evaluated together, in order.
50
+
51
+ # A question about the request's input, with an optional correlation name.
52
+ module Question
53
+ extend OpenAI::Internal::Type::Union
54
+
55
+ discriminator :type
56
+
57
+ # Estimate how likely it is that a statement about the input is true.
58
+ variant :predicate, -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Predicate }
59
+
60
+ # Choose from the supplied options based on the input.
61
+ variant :choice, -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Choice }
62
+
63
+ # Rate the input against the supplied ordered levels.
64
+ variant :score, -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Score }
65
+
66
+ class Predicate < OpenAI::Internal::Type::BaseModel
67
+ # @!attribute instructions
68
+ #
69
+ # @return [String]
70
+ required :instructions, String
71
+
72
+ # @!attribute type
73
+ # The type of the object. Always `predicate`.
74
+ #
75
+ # @return [Symbol, :predicate]
76
+ required :type, const: :predicate
77
+
78
+ # @!attribute name
79
+ #
80
+ # @return [String, nil]
81
+ optional :name, String
82
+
83
+ # @!method initialize(instructions:, name: nil, type: :predicate)
84
+ # Estimate how likely it is that a statement about the input is true.
85
+ #
86
+ # @param instructions [String]
87
+ #
88
+ # @param name [String]
89
+ #
90
+ # @param type [Symbol, :predicate]
91
+ # The type of the object. Always `predicate`.
92
+ end
93
+
94
+ class Choice < OpenAI::Internal::Type::BaseModel
95
+ # @!attribute choices
96
+ # Provide between 2 and 255 choices. Each choice must be unique.
97
+ #
98
+ # @return [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice::Choice>]
99
+ required(
100
+ :choices,
101
+ -> {
102
+ OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger::Decisions::Question::Choice::Choice]
103
+ }
104
+ )
105
+
106
+ # @!attribute instructions
107
+ #
108
+ # @return [String]
109
+ required :instructions, String
110
+
111
+ # @!attribute type
112
+ # The type of the object. Always `choice`.
113
+ #
114
+ # @return [Symbol, :choice]
115
+ required :type, const: :choice
116
+
117
+ # @!attribute name
118
+ #
119
+ # @return [String, nil]
120
+ optional :name, String
121
+
122
+ # @!method initialize(choices:, instructions:, name: nil, type: :choice)
123
+ # Choose from the supplied options based on the input.
124
+ #
125
+ # @param choices [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice::Choice>]
126
+ # Provide between 2 and 255 choices. Each choice must be unique.
127
+ #
128
+ # @param instructions [String]
129
+ #
130
+ # @param name [String]
131
+ #
132
+ # @param type [Symbol, :choice]
133
+ # The type of the object. Always `choice`.
134
+ class Choice < OpenAI::Internal::Type::BaseModel
135
+ # @!attribute value
136
+ # Choice values are typed: a string and a boolean with the same text are distinct.
137
+ #
138
+ # @return [String, Boolean]
139
+ required(
140
+ :value,
141
+ union: -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Choice::Choice::Value }
142
+ )
143
+
144
+ # @!attribute description
145
+ #
146
+ # @return [String, nil]
147
+ optional :description, String
148
+
149
+ # @!method initialize(value:, description: nil)
150
+ # @param value [String, Boolean]
151
+ # Choice values are typed: a string and a boolean with the same text are distinct.
152
+ #
153
+ # @param description [String]
154
+
155
+ # Choice values are typed: a string and a boolean with the same text are distinct.
156
+ #
157
+ # @see OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice::Choice#value
158
+ module Value
159
+ extend OpenAI::Internal::Type::Union
160
+
161
+ variant String
162
+
163
+ variant OpenAI::Internal::Type::Boolean
164
+
165
+ # @!method self.variants
166
+ # @return [Array(String, Boolean)]
167
+ end
168
+ end
169
+ end
170
+
171
+ class Score < OpenAI::Internal::Type::BaseModel
172
+ # @!attribute instructions
173
+ #
174
+ # @return [String]
175
+ required :instructions, String
176
+
177
+ # @!attribute levels
178
+ #
179
+ # @return [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score::Level>]
180
+ required(
181
+ :levels,
182
+ -> {
183
+ OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger::Decisions::Question::Score::Level]
184
+ }
185
+ )
186
+
187
+ # @!attribute type
188
+ # The type of the object. Always `score`.
189
+ #
190
+ # @return [Symbol, :score]
191
+ required :type, const: :score
192
+
193
+ # @!attribute name
194
+ #
195
+ # @return [String, nil]
196
+ optional :name, String
197
+
198
+ # @!method initialize(instructions:, levels:, name: nil, type: :score)
199
+ # Rate the input against the supplied ordered levels.
200
+ #
201
+ # @param instructions [String]
202
+ #
203
+ # @param levels [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score::Level>]
204
+ #
205
+ # @param name [String]
206
+ #
207
+ # @param type [Symbol, :score]
208
+ # The type of the object. Always `score`.
209
+ class Level < OpenAI::Internal::Type::BaseModel
210
+ # @!attribute label
211
+ #
212
+ # @return [String]
213
+ required :label, String
214
+
215
+ # @!attribute description
216
+ #
217
+ # @return [String, nil]
218
+ optional :description, String
219
+
220
+ # @!method initialize(label:, description: nil)
221
+ # @param label [String]
222
+ # @param description [String]
223
+ end
224
+ end
225
+
226
+ # @!method self.variants
227
+ # @return [Array(OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Predicate, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score)]
228
+ end
229
+ end
230
+
231
+ # @see OpenAI::Models::Live::DecisionTrigger#event_type
232
+ module EventType
233
+ extend OpenAI::Internal::Type::Enum
234
+
235
+ SESSION_INPUT_TRANSCRIPT_DELTA = :"session.input_transcript.delta"
236
+ SESSION_OUTPUT_TRANSCRIPT_DELTA = :"session.output_transcript.delta"
237
+
238
+ # @!method self.values
239
+ # @return [Array<Symbol>]
240
+ end
241
+ end
242
+ end
243
+ end
244
+ end
@@ -0,0 +1,201 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Live
6
+ class DecisionsDelegationConfig < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ #
9
+ # @return [String]
10
+ required :model, String
11
+
12
+ # @!attribute questions
13
+ # Native Decision API questions evaluated together, in order.
14
+ #
15
+ # @return [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score>]
16
+ required(
17
+ :questions,
18
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::DecisionsDelegationConfig::Question] }
19
+ )
20
+
21
+ # @!method initialize(model:, questions:)
22
+ # @param model [String]
23
+ #
24
+ # @param questions [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score>]
25
+ # Native Decision API questions evaluated together, in order.
26
+
27
+ # A question about the request's input, with an optional correlation name.
28
+ module Question
29
+ extend OpenAI::Internal::Type::Union
30
+
31
+ discriminator :type
32
+
33
+ # Estimate how likely it is that a statement about the input is true.
34
+ variant :predicate, -> { OpenAI::Live::DecisionsDelegationConfig::Question::Predicate }
35
+
36
+ # Choose from the supplied options based on the input.
37
+ variant :choice, -> { OpenAI::Live::DecisionsDelegationConfig::Question::Choice }
38
+
39
+ # Rate the input against the supplied ordered levels.
40
+ variant :score, -> { OpenAI::Live::DecisionsDelegationConfig::Question::Score }
41
+
42
+ class Predicate < OpenAI::Internal::Type::BaseModel
43
+ # @!attribute instructions
44
+ #
45
+ # @return [String]
46
+ required :instructions, String
47
+
48
+ # @!attribute type
49
+ # The type of the object. Always `predicate`.
50
+ #
51
+ # @return [Symbol, :predicate]
52
+ required :type, const: :predicate
53
+
54
+ # @!attribute name
55
+ #
56
+ # @return [String, nil]
57
+ optional :name, String
58
+
59
+ # @!method initialize(instructions:, name: nil, type: :predicate)
60
+ # Estimate how likely it is that a statement about the input is true.
61
+ #
62
+ # @param instructions [String]
63
+ #
64
+ # @param name [String]
65
+ #
66
+ # @param type [Symbol, :predicate]
67
+ # The type of the object. Always `predicate`.
68
+ end
69
+
70
+ class Choice < OpenAI::Internal::Type::BaseModel
71
+ # @!attribute choices
72
+ # Provide between 2 and 255 choices. Each choice must be unique.
73
+ #
74
+ # @return [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice::Choice>]
75
+ required(
76
+ :choices,
77
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionsDelegationConfig::Question::Choice::Choice] }
78
+ )
79
+
80
+ # @!attribute instructions
81
+ #
82
+ # @return [String]
83
+ required :instructions, String
84
+
85
+ # @!attribute type
86
+ # The type of the object. Always `choice`.
87
+ #
88
+ # @return [Symbol, :choice]
89
+ required :type, const: :choice
90
+
91
+ # @!attribute name
92
+ #
93
+ # @return [String, nil]
94
+ optional :name, String
95
+
96
+ # @!method initialize(choices:, instructions:, name: nil, type: :choice)
97
+ # Choose from the supplied options based on the input.
98
+ #
99
+ # @param choices [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice::Choice>]
100
+ # Provide between 2 and 255 choices. Each choice must be unique.
101
+ #
102
+ # @param instructions [String]
103
+ #
104
+ # @param name [String]
105
+ #
106
+ # @param type [Symbol, :choice]
107
+ # The type of the object. Always `choice`.
108
+ class Choice < OpenAI::Internal::Type::BaseModel
109
+ # @!attribute value
110
+ # Choice values are typed: a string and a boolean with the same text are distinct.
111
+ #
112
+ # @return [String, Boolean]
113
+ required :value, union: -> { OpenAI::Live::DecisionsDelegationConfig::Question::Choice::Choice::Value }
114
+
115
+ # @!attribute description
116
+ #
117
+ # @return [String, nil]
118
+ optional :description, String
119
+
120
+ # @!method initialize(value:, description: nil)
121
+ # @param value [String, Boolean]
122
+ # Choice values are typed: a string and a boolean with the same text are distinct.
123
+ #
124
+ # @param description [String]
125
+
126
+ # Choice values are typed: a string and a boolean with the same text are distinct.
127
+ #
128
+ # @see OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice::Choice#value
129
+ module Value
130
+ extend OpenAI::Internal::Type::Union
131
+
132
+ variant String
133
+
134
+ variant OpenAI::Internal::Type::Boolean
135
+
136
+ # @!method self.variants
137
+ # @return [Array(String, Boolean)]
138
+ end
139
+ end
140
+ end
141
+
142
+ class Score < OpenAI::Internal::Type::BaseModel
143
+ # @!attribute instructions
144
+ #
145
+ # @return [String]
146
+ required :instructions, String
147
+
148
+ # @!attribute levels
149
+ #
150
+ # @return [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score::Level>]
151
+ required(
152
+ :levels,
153
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionsDelegationConfig::Question::Score::Level] }
154
+ )
155
+
156
+ # @!attribute type
157
+ # The type of the object. Always `score`.
158
+ #
159
+ # @return [Symbol, :score]
160
+ required :type, const: :score
161
+
162
+ # @!attribute name
163
+ #
164
+ # @return [String, nil]
165
+ optional :name, String
166
+
167
+ # @!method initialize(instructions:, levels:, name: nil, type: :score)
168
+ # Rate the input against the supplied ordered levels.
169
+ #
170
+ # @param instructions [String]
171
+ #
172
+ # @param levels [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score::Level>]
173
+ #
174
+ # @param name [String]
175
+ #
176
+ # @param type [Symbol, :score]
177
+ # The type of the object. Always `score`.
178
+ class Level < OpenAI::Internal::Type::BaseModel
179
+ # @!attribute label
180
+ #
181
+ # @return [String]
182
+ required :label, String
183
+
184
+ # @!attribute description
185
+ #
186
+ # @return [String, nil]
187
+ optional :description, String
188
+
189
+ # @!method initialize(label:, description: nil)
190
+ # @param label [String]
191
+ # @param description [String]
192
+ end
193
+ end
194
+
195
+ # @!method self.variants
196
+ # @return [Array(OpenAI::Models::Live::DecisionsDelegationConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score)]
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end
@@ -0,0 +1,208 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Live
6
+ class DecisionsDelegationUpdateConfig < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ #
9
+ # @return [String, nil]
10
+ optional :model, String
11
+
12
+ # @!attribute questions
13
+ # Native Decision API questions evaluated together, in order.
14
+ #
15
+ # @return [Array<OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Score>, nil]
16
+ optional(
17
+ :questions,
18
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::DecisionsDelegationUpdateConfig::Question] }
19
+ )
20
+
21
+ # @!method initialize(model: nil, questions: nil)
22
+ # @param model [String]
23
+ #
24
+ # @param questions [Array<OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Score>]
25
+ # Native Decision API questions evaluated together, in order.
26
+
27
+ # A question about the request's input, with an optional correlation name.
28
+ module Question
29
+ extend OpenAI::Internal::Type::Union
30
+
31
+ discriminator :type
32
+
33
+ # Estimate how likely it is that a statement about the input is true.
34
+ variant :predicate, -> { OpenAI::Live::DecisionsDelegationUpdateConfig::Question::Predicate }
35
+
36
+ # Choose from the supplied options based on the input.
37
+ variant :choice, -> { OpenAI::Live::DecisionsDelegationUpdateConfig::Question::Choice }
38
+
39
+ # Rate the input against the supplied ordered levels.
40
+ variant :score, -> { OpenAI::Live::DecisionsDelegationUpdateConfig::Question::Score }
41
+
42
+ class Predicate < OpenAI::Internal::Type::BaseModel
43
+ # @!attribute instructions
44
+ #
45
+ # @return [String]
46
+ required :instructions, String
47
+
48
+ # @!attribute type
49
+ # The type of the object. Always `predicate`.
50
+ #
51
+ # @return [Symbol, :predicate]
52
+ required :type, const: :predicate
53
+
54
+ # @!attribute name
55
+ #
56
+ # @return [String, nil]
57
+ optional :name, String
58
+
59
+ # @!method initialize(instructions:, name: nil, type: :predicate)
60
+ # Estimate how likely it is that a statement about the input is true.
61
+ #
62
+ # @param instructions [String]
63
+ #
64
+ # @param name [String]
65
+ #
66
+ # @param type [Symbol, :predicate]
67
+ # The type of the object. Always `predicate`.
68
+ end
69
+
70
+ class Choice < OpenAI::Internal::Type::BaseModel
71
+ # @!attribute choices
72
+ # Provide between 2 and 255 choices. Each choice must be unique.
73
+ #
74
+ # @return [Array<OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Choice::Choice>]
75
+ required(
76
+ :choices,
77
+ -> {
78
+ OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionsDelegationUpdateConfig::Question::Choice::Choice]
79
+ }
80
+ )
81
+
82
+ # @!attribute instructions
83
+ #
84
+ # @return [String]
85
+ required :instructions, String
86
+
87
+ # @!attribute type
88
+ # The type of the object. Always `choice`.
89
+ #
90
+ # @return [Symbol, :choice]
91
+ required :type, const: :choice
92
+
93
+ # @!attribute name
94
+ #
95
+ # @return [String, nil]
96
+ optional :name, String
97
+
98
+ # @!method initialize(choices:, instructions:, name: nil, type: :choice)
99
+ # Choose from the supplied options based on the input.
100
+ #
101
+ # @param choices [Array<OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Choice::Choice>]
102
+ # Provide between 2 and 255 choices. Each choice must be unique.
103
+ #
104
+ # @param instructions [String]
105
+ #
106
+ # @param name [String]
107
+ #
108
+ # @param type [Symbol, :choice]
109
+ # The type of the object. Always `choice`.
110
+ class Choice < OpenAI::Internal::Type::BaseModel
111
+ # @!attribute value
112
+ # Choice values are typed: a string and a boolean with the same text are distinct.
113
+ #
114
+ # @return [String, Boolean]
115
+ required(
116
+ :value,
117
+ union: -> { OpenAI::Live::DecisionsDelegationUpdateConfig::Question::Choice::Choice::Value }
118
+ )
119
+
120
+ # @!attribute description
121
+ #
122
+ # @return [String, nil]
123
+ optional :description, String
124
+
125
+ # @!method initialize(value:, description: nil)
126
+ # @param value [String, Boolean]
127
+ # Choice values are typed: a string and a boolean with the same text are distinct.
128
+ #
129
+ # @param description [String]
130
+
131
+ # Choice values are typed: a string and a boolean with the same text are distinct.
132
+ #
133
+ # @see OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Choice::Choice#value
134
+ module Value
135
+ extend OpenAI::Internal::Type::Union
136
+
137
+ variant String
138
+
139
+ variant OpenAI::Internal::Type::Boolean
140
+
141
+ # @!method self.variants
142
+ # @return [Array(String, Boolean)]
143
+ end
144
+ end
145
+ end
146
+
147
+ class Score < OpenAI::Internal::Type::BaseModel
148
+ # @!attribute instructions
149
+ #
150
+ # @return [String]
151
+ required :instructions, String
152
+
153
+ # @!attribute levels
154
+ #
155
+ # @return [Array<OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Score::Level>]
156
+ required(
157
+ :levels,
158
+ -> {
159
+ OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionsDelegationUpdateConfig::Question::Score::Level]
160
+ }
161
+ )
162
+
163
+ # @!attribute type
164
+ # The type of the object. Always `score`.
165
+ #
166
+ # @return [Symbol, :score]
167
+ required :type, const: :score
168
+
169
+ # @!attribute name
170
+ #
171
+ # @return [String, nil]
172
+ optional :name, String
173
+
174
+ # @!method initialize(instructions:, levels:, name: nil, type: :score)
175
+ # Rate the input against the supplied ordered levels.
176
+ #
177
+ # @param instructions [String]
178
+ #
179
+ # @param levels [Array<OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Score::Level>]
180
+ #
181
+ # @param name [String]
182
+ #
183
+ # @param type [Symbol, :score]
184
+ # The type of the object. Always `score`.
185
+ class Level < OpenAI::Internal::Type::BaseModel
186
+ # @!attribute label
187
+ #
188
+ # @return [String]
189
+ required :label, String
190
+
191
+ # @!attribute description
192
+ #
193
+ # @return [String, nil]
194
+ optional :description, String
195
+
196
+ # @!method initialize(label:, description: nil)
197
+ # @param label [String]
198
+ # @param description [String]
199
+ end
200
+ end
201
+
202
+ # @!method self.variants
203
+ # @return [Array(OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationUpdateConfig::Question::Score)]
204
+ end
205
+ end
206
+ end
207
+ end
208
+ end