openai 0.113.0 → 0.115.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 (284) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -0
  3. data/README.md +17 -2
  4. data/docs/architecture/security-model.md +11 -16
  5. data/examples/responses/websocket_workflows.rb +78 -3
  6. data/lib/openai/auth/subject_token_providers/azure_managed_identity_token_provider.rb +10 -8
  7. data/lib/openai/auth/subject_token_providers/gcp_id_token_provider.rb +8 -7
  8. data/lib/openai/helpers/chat/tool_runner.rb +1 -1
  9. data/lib/openai/helpers/live/websocket.rb +31 -0
  10. data/lib/openai/helpers/realtime/connection.rb +33 -0
  11. data/lib/openai/helpers/realtime/connection_manager.rb +1 -0
  12. data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +5 -0
  13. data/lib/openai/helpers/realtime/recovery.rb +5 -1
  14. data/lib/openai/helpers/realtime/translation.rb +5 -0
  15. data/lib/openai/helpers/realtime/transports/async_websocket.rb +19 -0
  16. data/lib/openai/helpers/responses_websocket/connection.rb +53 -15
  17. data/lib/openai/helpers/responses_websocket/connection_manager.rb +1 -0
  18. data/lib/openai/helpers/responses_websocket/connection_resources.rb +1 -1
  19. data/lib/openai/helpers/structured_output/response_parser.rb +1 -0
  20. data/lib/openai/helpers/structured_output.rb +58 -0
  21. data/lib/openai/helpers/websocket/connection_manager.rb +11 -0
  22. data/lib/openai/helpers/websocket/resource.rb +1 -0
  23. data/lib/openai/helpers/websocket/typed_connection.rb +1 -0
  24. data/lib/openai/internal/type/array_of.rb +1 -1
  25. data/lib/openai/internal/type/hash_of.rb +1 -1
  26. data/lib/openai/internal/type/request_parameters.rb +2 -1
  27. data/lib/openai/internal/type/union.rb +18 -6
  28. data/lib/openai/models/admin/organization/external_key.rb +169 -0
  29. data/lib/openai/models/admin/organization/external_key_create_params.rb +311 -0
  30. data/lib/openai/models/admin/organization/external_key_delete_params.rb +24 -0
  31. data/lib/openai/models/admin/organization/external_key_list_params.rb +69 -0
  32. data/lib/openai/models/admin/organization/external_key_retrieve_params.rb +24 -0
  33. data/lib/openai/models/admin/organization/external_key_validate_params.rb +24 -0
  34. data/lib/openai/models/admin/organization/external_key_validate_response.rb +20 -0
  35. data/lib/openai/models/audio/speech_model.rb +12 -0
  36. data/lib/openai/models/audio_model.rb +15 -0
  37. data/lib/openai/models/beta/agent.rb +49 -1
  38. data/lib/openai/models/beta/agent_create_params.rb +51 -1
  39. data/lib/openai/models/beta/agent_session.rb +75 -2
  40. data/lib/openai/models/beta/agent_update_params.rb +62 -1
  41. data/lib/openai/models/beta/agents/session_create_params.rb +94 -2
  42. data/lib/openai/models/beta/agents/session_list_params.rb +16 -1
  43. data/lib/openai/models/beta/agents/session_update_params.rb +50 -5
  44. data/lib/openai/models/beta/assistant_update_params.rb +18 -0
  45. data/lib/openai/models/beta/beta_response.rb +224 -1
  46. data/lib/openai/models/beta/beta_response_configuration_update_item.rb +64 -3
  47. data/lib/openai/models/beta/beta_response_configuration_update_item_param.rb +64 -4
  48. data/lib/openai/models/beta/beta_response_input_file.rb +9 -9
  49. data/lib/openai/models/beta/beta_response_input_file_content.rb +9 -9
  50. data/lib/openai/models/beta/beta_response_input_image.rb +9 -9
  51. data/lib/openai/models/beta/beta_response_input_image_content.rb +9 -9
  52. data/lib/openai/models/beta/beta_response_input_item.rb +2 -3
  53. data/lib/openai/models/beta/beta_response_input_text.rb +9 -9
  54. data/lib/openai/models/beta/beta_response_input_text_content.rb +9 -9
  55. data/lib/openai/models/beta/beta_response_item.rb +11 -11
  56. data/lib/openai/models/beta/beta_response_output_item.rb +9 -9
  57. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +6 -6
  58. data/lib/openai/models/beta/beta_responses_client_event.rb +20 -1
  59. data/lib/openai/models/beta/beta_tool.rb +6 -6
  60. data/lib/openai/models/beta/response_compact_params.rb +6 -0
  61. data/lib/openai/models/beta/response_create_params.rb +6 -0
  62. data/lib/openai/models/chat/chat_completion_content_part.rb +9 -9
  63. data/lib/openai/models/chat/chat_completion_content_part_image.rb +9 -9
  64. data/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +9 -9
  65. data/lib/openai/models/chat/chat_completion_content_part_text.rb +9 -9
  66. data/lib/openai/models/chat_model.rb +6 -0
  67. data/lib/openai/models/conversations/computer_screenshot_content.rb +9 -9
  68. data/lib/openai/models/conversations/conversation_item.rb +2 -2
  69. data/lib/openai/models/image_edit_params.rb +46 -25
  70. data/lib/openai/models/live/fork_server_event.rb +43 -3
  71. data/lib/openai/models/live/server_event.rb +43 -3
  72. data/lib/openai/models/live/sideband_client_event.rb +40 -1
  73. data/lib/openai/models/live/sideband_server_event.rb +43 -3
  74. data/lib/openai/models/realtime/audio_transcription.rb +15 -0
  75. data/lib/openai/models/realtime/conversation_item_added.rb +2 -2
  76. data/lib/openai/models/realtime/conversation_item_create_event.rb +2 -2
  77. data/lib/openai/models/realtime/conversation_item_created_event.rb +2 -2
  78. data/lib/openai/models/realtime/conversation_item_done.rb +2 -2
  79. data/lib/openai/models/realtime/realtime_response.rb +2 -2
  80. data/lib/openai/models/realtime/realtime_response_create_params.rb +2 -2
  81. data/lib/openai/models/realtime/realtime_server_event.rb +2 -2
  82. data/lib/openai/models/realtime/realtime_session.rb +18 -0
  83. data/lib/openai/models/realtime/realtime_session_create_request.rb +18 -0
  84. data/lib/openai/models/realtime/realtime_session_create_response.rb +18 -0
  85. data/lib/openai/models/realtime/response_output_item_added_event.rb +2 -2
  86. data/lib/openai/models/realtime/response_output_item_done_event.rb +2 -2
  87. data/lib/openai/models/responses/response.rb +221 -1
  88. data/lib/openai/models/responses/response_compact_params.rb +6 -0
  89. data/lib/openai/models/responses/response_configuration_update_item.rb +50 -3
  90. data/lib/openai/models/responses/response_configuration_update_item_param.rb +50 -4
  91. data/lib/openai/models/responses/response_input_file.rb +9 -9
  92. data/lib/openai/models/responses/response_input_file_content.rb +9 -9
  93. data/lib/openai/models/responses/response_input_image.rb +9 -9
  94. data/lib/openai/models/responses/response_input_image_content.rb +9 -9
  95. data/lib/openai/models/responses/response_input_item.rb +2 -3
  96. data/lib/openai/models/responses/response_input_text.rb +9 -9
  97. data/lib/openai/models/responses/response_input_text_content.rb +9 -9
  98. data/lib/openai/models/responses/response_item.rb +2 -2
  99. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +6 -6
  100. data/lib/openai/models/responses/responses_client_event.rb +14 -1
  101. data/lib/openai/models/responses/tool.rb +6 -6
  102. data/lib/openai/net_http_client.rb +6 -0
  103. data/lib/openai/providers/vertex.rb +0 -10
  104. data/lib/openai/resources/admin/organization/external_keys.rb +132 -0
  105. data/lib/openai/resources/admin/organization.rb +4 -0
  106. data/lib/openai/resources/audio/speech.rb +8 -0
  107. data/lib/openai/resources/audio/translations.rb +8 -0
  108. data/lib/openai/resources/beta/agents/sessions.rb +22 -6
  109. data/lib/openai/resources/beta/agents.rb +17 -2
  110. data/lib/openai/resources/images.rb +36 -18
  111. data/lib/openai/version.rb +1 -1
  112. data/lib/openai.rb +8 -0
  113. data/rbi/openai/helpers/live/websocket.rbi +1 -12
  114. data/rbi/openai/helpers/realtime/connection.rbi +5 -0
  115. data/rbi/openai/helpers/realtime/transports/async_websocket.rbi +5 -0
  116. data/rbi/openai/helpers/responses_websocket/connection.rbi +7 -2
  117. data/rbi/openai/helpers/structured_output.rbi +10 -0
  118. data/rbi/openai/internal/type/array_of.rbi +1 -1
  119. data/rbi/openai/internal/type/hash_of.rbi +1 -1
  120. data/rbi/openai/internal/type/union.rbi +5 -0
  121. data/rbi/openai/models/admin/organization/external_key.rbi +301 -0
  122. data/rbi/openai/models/admin/organization/external_key_create_params.rbi +532 -0
  123. data/rbi/openai/models/admin/organization/external_key_delete_params.rbi +57 -0
  124. data/rbi/openai/models/admin/organization/external_key_list_params.rbi +129 -0
  125. data/rbi/openai/models/admin/organization/external_key_retrieve_params.rbi +57 -0
  126. data/rbi/openai/models/admin/organization/external_key_validate_params.rbi +57 -0
  127. data/rbi/openai/models/admin/organization/external_key_validate_response.rbi +50 -0
  128. data/rbi/openai/models/beta/agent.rbi +103 -1
  129. data/rbi/openai/models/beta/agent_create_params.rbi +109 -0
  130. data/rbi/openai/models/beta/agent_session.rbi +136 -3
  131. data/rbi/openai/models/beta/agent_update_params.rbi +120 -0
  132. data/rbi/openai/models/beta/agents/session_create_params.rbi +153 -0
  133. data/rbi/openai/models/beta/agents/session_list_params.rbi +19 -0
  134. data/rbi/openai/models/beta/agents/session_update_params.rbi +94 -6
  135. data/rbi/openai/models/beta/beta_response.rbi +394 -0
  136. data/rbi/openai/models/beta/beta_response_configuration_update_item.rbi +113 -3
  137. data/rbi/openai/models/beta/beta_response_configuration_update_item_param.rbi +125 -4
  138. data/rbi/openai/models/beta/beta_response_input_file.rbi +9 -9
  139. data/rbi/openai/models/beta/beta_response_input_file_content.rbi +9 -9
  140. data/rbi/openai/models/beta/beta_response_input_image.rbi +9 -9
  141. data/rbi/openai/models/beta/beta_response_input_image_content.rbi +9 -9
  142. data/rbi/openai/models/beta/beta_response_input_text.rbi +9 -9
  143. data/rbi/openai/models/beta/beta_response_input_text_content.rbi +9 -9
  144. data/rbi/openai/models/beta/beta_response_item.rbi +9 -9
  145. data/rbi/openai/models/beta/beta_response_output_item.rbi +9 -9
  146. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +6 -6
  147. data/rbi/openai/models/beta/beta_responses_client_event.rbi +17 -0
  148. data/rbi/openai/models/beta/beta_tool.rbi +6 -6
  149. data/rbi/openai/models/chat/chat_completion_content_part.rbi +9 -9
  150. data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +9 -9
  151. data/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +9 -9
  152. data/rbi/openai/models/chat/chat_completion_content_part_text.rbi +9 -9
  153. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +9 -9
  154. data/rbi/openai/models/decision_create_params.rbi +4 -1
  155. data/rbi/openai/models/image_edit_params.rbi +49 -24
  156. data/rbi/openai/models/live/fork_server_event.rbi +65 -1
  157. data/rbi/openai/models/live/server_event.rbi +65 -1
  158. data/rbi/openai/models/live/sideband_client_event.rbi +60 -0
  159. data/rbi/openai/models/live/sideband_server_event.rbi +65 -1
  160. data/rbi/openai/models/realtime/conversation_item_added.rbi +6 -3
  161. data/rbi/openai/models/realtime/conversation_item_create_event.rbi +6 -3
  162. data/rbi/openai/models/realtime/conversation_item_created_event.rbi +6 -3
  163. data/rbi/openai/models/realtime/conversation_item_done.rbi +6 -3
  164. data/rbi/openai/models/realtime/realtime_response.rbi +8 -4
  165. data/rbi/openai/models/realtime/realtime_response_create_params.rbi +8 -4
  166. data/rbi/openai/models/realtime/realtime_server_event.rbi +6 -3
  167. data/rbi/openai/models/realtime/response_output_item_added_event.rbi +6 -3
  168. data/rbi/openai/models/realtime/response_output_item_done_event.rbi +6 -3
  169. data/rbi/openai/models/responses/response.rbi +394 -0
  170. data/rbi/openai/models/responses/response_configuration_update_item.rbi +76 -3
  171. data/rbi/openai/models/responses/response_configuration_update_item_param.rbi +74 -4
  172. data/rbi/openai/models/responses/response_input_file.rbi +9 -9
  173. data/rbi/openai/models/responses/response_input_file_content.rbi +9 -9
  174. data/rbi/openai/models/responses/response_input_image.rbi +9 -9
  175. data/rbi/openai/models/responses/response_input_image_content.rbi +9 -9
  176. data/rbi/openai/models/responses/response_input_text.rbi +9 -9
  177. data/rbi/openai/models/responses/response_input_text_content.rbi +9 -9
  178. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +6 -6
  179. data/rbi/openai/models/responses/responses_client_event.rbi +17 -0
  180. data/rbi/openai/models/responses/tool.rbi +6 -6
  181. data/rbi/openai/net_http_client.rbi +5 -0
  182. data/rbi/openai/resources/admin/organization/external_keys.rbi +86 -0
  183. data/rbi/openai/resources/admin/organization.rbi +3 -0
  184. data/rbi/openai/resources/audio/speech.rbi +8 -0
  185. data/rbi/openai/resources/audio/translations.rbi +6 -0
  186. data/rbi/openai/resources/beta/agents/sessions.rbi +18 -2
  187. data/rbi/openai/resources/beta/agents.rbi +15 -0
  188. data/rbi/openai/resources/images.rbi +34 -16
  189. data/rbi/openai/resources/responses.rbi +2 -0
  190. data/realtime.md +6 -0
  191. data/responses-websocket.md +53 -0
  192. data/sig/openai/helpers/live/websocket.rbs +1 -9
  193. data/sig/openai/helpers/realtime/connection.rbs +3 -0
  194. data/sig/openai/helpers/realtime/transports/async_websocket.rbs +3 -0
  195. data/sig/openai/helpers/responses_websocket/connection.rbs +7 -1
  196. data/sig/openai/helpers/structured_output.rbs +9 -0
  197. data/sig/openai/internal/type/union.rbs +4 -0
  198. data/sig/openai/models/admin/organization/external_key.rbs +186 -0
  199. data/sig/openai/models/admin/organization/external_key_create_params.rbs +423 -0
  200. data/sig/openai/models/admin/organization/external_key_delete_params.rbs +27 -0
  201. data/sig/openai/models/admin/organization/external_key_list_params.rbs +81 -0
  202. data/sig/openai/models/admin/organization/external_key_retrieve_params.rbs +27 -0
  203. data/sig/openai/models/admin/organization/external_key_validate_params.rbs +27 -0
  204. data/sig/openai/models/admin/organization/external_key_validate_response.rbs +17 -0
  205. data/sig/openai/models/admin/organization/external_storage_create_params.rbs +72 -2
  206. data/sig/openai/models/audio/speech_create_params.rbs +15 -2
  207. data/sig/openai/models/audio/transcription_create_params.rbs +30 -2
  208. data/sig/openai/models/audio/voice_create_params.rbs +47 -2
  209. data/sig/openai/models/beta/agent.rbs +54 -2
  210. data/sig/openai/models/beta/agent_create_params.rbs +54 -0
  211. data/sig/openai/models/beta/agent_session.rbs +82 -3
  212. data/sig/openai/models/beta/agent_update_params.rbs +64 -0
  213. data/sig/openai/models/beta/agents/session_create_params.rbs +91 -0
  214. data/sig/openai/models/beta/agents/session_list_params.rbs +20 -0
  215. data/sig/openai/models/beta/agents/session_update_params.rbs +48 -6
  216. data/sig/openai/models/beta/assistant_create_params.rbs +5 -2
  217. data/sig/openai/models/beta/beta_response.rbs +223 -0
  218. data/sig/openai/models/beta/beta_response_configuration_update_item.rbs +58 -2
  219. data/sig/openai/models/beta/beta_response_configuration_update_item_param.rbs +58 -2
  220. data/sig/openai/models/beta/beta_response_input_file.rbs +9 -9
  221. data/sig/openai/models/beta/beta_response_input_file_content.rbs +6 -6
  222. data/sig/openai/models/beta/beta_response_input_image.rbs +9 -9
  223. data/sig/openai/models/beta/beta_response_input_image_content.rbs +6 -6
  224. data/sig/openai/models/beta/beta_response_input_text.rbs +9 -9
  225. data/sig/openai/models/beta/beta_response_input_text_content.rbs +6 -6
  226. data/sig/openai/models/beta/beta_response_item.rbs +9 -9
  227. data/sig/openai/models/beta/beta_response_output_item.rbs +9 -9
  228. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +4 -4
  229. data/sig/openai/models/beta/beta_responses_client_event.rbs +17 -0
  230. data/sig/openai/models/beta/beta_tool.rbs +4 -4
  231. data/sig/openai/models/beta/response_create_params.rbs +5 -2
  232. data/sig/openai/models/beta/responses/input_token_count_params.rbs +10 -2
  233. data/sig/openai/models/beta/thread_create_and_run_params.rbs +11 -5
  234. data/sig/openai/models/beta/thread_create_params.rbs +11 -5
  235. data/sig/openai/models/beta/threads/message_create_params.rbs +6 -3
  236. data/sig/openai/models/beta/threads/run_create_params.rbs +6 -3
  237. data/sig/openai/models/chat/chat_completion_content_part.rbs +9 -9
  238. data/sig/openai/models/chat/chat_completion_content_part_image.rbs +9 -9
  239. data/sig/openai/models/chat/chat_completion_content_part_input_audio.rbs +9 -9
  240. data/sig/openai/models/chat/chat_completion_content_part_text.rbs +9 -9
  241. data/sig/openai/models/conversations/computer_screenshot_content.rbs +9 -9
  242. data/sig/openai/models/decision_create_params.rbs +27 -2
  243. data/sig/openai/models/eval_create_params.rbs +25 -4
  244. data/sig/openai/models/evals/run_create_params.rbs +52 -8
  245. data/sig/openai/models/image_edit_params.rbs +47 -16
  246. data/sig/openai/models/live/fork_server_event.rbs +39 -0
  247. data/sig/openai/models/live/server_event.rbs +39 -0
  248. data/sig/openai/models/live/session_accept_params.rbs +39 -2
  249. data/sig/openai/models/live/sideband_client_event.rbs +32 -0
  250. data/sig/openai/models/live/sideband_server_event.rbs +39 -0
  251. data/sig/openai/models/realtime/conversation_item.rbs +1 -0
  252. data/sig/openai/models/responses/input_token_count_params.rbs +10 -2
  253. data/sig/openai/models/responses/response.rbs +223 -0
  254. data/sig/openai/models/responses/response_configuration_update_item.rbs +45 -2
  255. data/sig/openai/models/responses/response_configuration_update_item_param.rbs +45 -2
  256. data/sig/openai/models/responses/response_create_params.rbs +5 -2
  257. data/sig/openai/models/responses/response_input_file.rbs +9 -9
  258. data/sig/openai/models/responses/response_input_file_content.rbs +6 -6
  259. data/sig/openai/models/responses/response_input_image.rbs +9 -9
  260. data/sig/openai/models/responses/response_input_image_content.rbs +6 -6
  261. data/sig/openai/models/responses/response_input_text.rbs +9 -9
  262. data/sig/openai/models/responses/response_input_text_content.rbs +6 -6
  263. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +4 -4
  264. data/sig/openai/models/responses/responses_client_event.rbs +17 -0
  265. data/sig/openai/models/responses/tool.rbs +4 -4
  266. data/sig/openai/models/video_edit_params.rbs +11 -2
  267. data/sig/openai/models/video_extend_params.rbs +11 -2
  268. data/sig/openai/net_http_client.rbs +3 -0
  269. data/sig/openai/resources/admin/organization/external_keys.rbs +70 -0
  270. data/sig/openai/resources/admin/organization/external_storage.rbs +23 -1
  271. data/sig/openai/resources/admin/organization.rbs +2 -0
  272. data/sig/openai/resources/audio/speech.rbs +2 -1
  273. data/sig/openai/resources/audio/transcriptions.rbs +14 -2
  274. data/sig/openai/resources/audio/voices.rbs +14 -1
  275. data/sig/openai/resources/beta/agents/sessions.rbs +4 -0
  276. data/sig/openai/resources/beta/agents.rbs +4 -0
  277. data/sig/openai/resources/beta/responses/input_tokens.rbs +2 -1
  278. data/sig/openai/resources/beta/responses.rbs +4 -2
  279. data/sig/openai/resources/decisions.rbs +7 -1
  280. data/sig/openai/resources/images.rbs +2 -0
  281. data/sig/openai/resources/responses/input_tokens.rbs +2 -1
  282. data/sig/openai/resources/responses.rbs +5 -2
  283. data/sig/openai/resources/videos.rbs +2 -2
  284. metadata +25 -1
@@ -192,14 +192,14 @@ module OpenAI
192
192
  # to `computer_screenshot`.
193
193
  attr_accessor type: :computer_screenshot
194
194
 
195
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
196
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
197
- # token block.
195
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
196
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
197
+ # not rounded to a token block.
198
198
  attr_reader prompt_cache_breakpoint: OpenAI::Beta::BetaResponseItem::AgentMessage::Content::ComputerScreenshot::PromptCacheBreakpoint?
199
199
 
200
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
201
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
202
- # token block.
200
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
201
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
202
+ # not rounded to a token block.
203
203
  def prompt_cache_breakpoint=: (
204
204
  OpenAI::Beta::BetaResponseItem::AgentMessage::Content::ComputerScreenshot::PromptCacheBreakpoint
205
205
  ) -> OpenAI::Beta::BetaResponseItem::AgentMessage::Content::ComputerScreenshot::PromptCacheBreakpoint
@@ -212,9 +212,9 @@ module OpenAI
212
212
  # @param image_url
213
213
  # The URL of the screenshot image.
214
214
  # @param prompt_cache_breakpoint
215
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
216
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
217
- # token block.
215
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
216
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
217
+ # not rounded to a token block.
218
218
  # @param type
219
219
  # Specifies the event type. For a computer screenshot, this property is always set
220
220
  # to `computer_screenshot`.
@@ -190,14 +190,14 @@ module OpenAI
190
190
  # to `computer_screenshot`.
191
191
  attr_accessor type: :computer_screenshot
192
192
 
193
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
194
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
195
- # token block.
193
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
194
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
195
+ # not rounded to a token block.
196
196
  attr_reader prompt_cache_breakpoint: OpenAI::Beta::BetaResponseOutputItem::AgentMessage::Content::ComputerScreenshot::PromptCacheBreakpoint?
197
197
 
198
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
199
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
200
- # token block.
198
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
199
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
200
+ # not rounded to a token block.
201
201
  def prompt_cache_breakpoint=: (
202
202
  OpenAI::Beta::BetaResponseOutputItem::AgentMessage::Content::ComputerScreenshot::PromptCacheBreakpoint
203
203
  ) -> OpenAI::Beta::BetaResponseOutputItem::AgentMessage::Content::ComputerScreenshot::PromptCacheBreakpoint
@@ -210,9 +210,9 @@ module OpenAI
210
210
  # @param image_url
211
211
  # The URL of the screenshot image.
212
212
  # @param prompt_cache_breakpoint
213
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
214
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
215
- # token block.
213
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
214
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
215
+ # not rounded to a token block.
216
216
  # @param type
217
217
  # Specifies the event type. For a computer screenshot, this property is always set
218
218
  # to `computer_screenshot`.
@@ -720,8 +720,8 @@ module OpenAI
720
720
 
721
721
  # Control how much effort the model will exert to match the style and features,
722
722
  # especially facial features, of input images. Supports `high` and `low` on
723
- # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
724
- # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
723
+ # `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
724
+ # this parameter. Defaults to `low` on supported models.
725
725
  attr_accessor input_fidelity: OpenAI::Models::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::input_fidelity?
726
726
 
727
727
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
@@ -843,8 +843,8 @@ module OpenAI
843
843
  # @param input_fidelity
844
844
  # Control how much effort the model will exert to match the style and features,
845
845
  # especially facial features, of input images. Supports `high` and `low` on
846
- # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
847
- # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
846
+ # `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
847
+ # this parameter. Defaults to `low` on supported models.
848
848
  # @param input_image_mask
849
849
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
850
850
  # `file_id` (string, optional).
@@ -18,6 +18,7 @@ module OpenAI
18
18
  ?background: bool?,
19
19
  ?context_management: ::Array[OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ContextManagement]?,
20
20
  ?conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?,
21
+ ?generate: bool,
21
22
  ?include: ::Array[OpenAI::Models::Beta::beta_response_includable]?,
22
23
  ?input: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::input,
23
24
  ?instructions: String?,
@@ -75,6 +76,16 @@ module OpenAI
75
76
  # response completes.
76
77
  attr_accessor conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?
77
78
 
79
+ # Whether to generate output for this response. Defaults to true when omitted. Set
80
+ # to false to prepare request state without model output; the response ID can be
81
+ # used as previous_response_id on a later turn.
82
+ attr_reader generate: bool?
83
+
84
+ # Whether to generate output for this response. Defaults to true when omitted. Set
85
+ # to false to prepare request state without model output; the response ID can be
86
+ # used as previous_response_id on a later turn.
87
+ def generate=: (bool) -> bool
88
+
78
89
  # Specify additional output data to include in the model response. Currently
79
90
  # supported values are:
80
91
  #
@@ -426,6 +437,10 @@ module OpenAI
426
437
  # prepended to `input_items` for this response request. Input items and output
427
438
  # items from this response are automatically added to this conversation after this
428
439
  # response completes.
440
+ # @param generate
441
+ # Whether to generate output for this response. Defaults to true when omitted. Set
442
+ # to false to prepare request state without model output; the response ID can be
443
+ # used as previous_response_id on a later turn.
429
444
  # @param include
430
445
  # Specify additional output data to include in the model response. Currently
431
446
  # supported values are:
@@ -653,6 +668,7 @@ module OpenAI
653
668
  ?background: bool?,
654
669
  ?context_management: ::Array[OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ContextManagement]?,
655
670
  ?conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?,
671
+ ?generate: bool,
656
672
  ?include: ::Array[OpenAI::Models::Beta::beta_response_includable]?,
657
673
  ?input: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::input,
658
674
  ?instructions: String?,
@@ -692,6 +708,7 @@ module OpenAI
692
708
  ?background: bool?,
693
709
  ?context_management: ::Array[OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ContextManagement]?,
694
710
  ?conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?,
711
+ ?generate: bool,
695
712
  ?include: ::Array[OpenAI::Models::Beta::beta_response_includable]?,
696
713
  ?input: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::input,
697
714
  ?instructions: String?,
@@ -645,8 +645,8 @@ module OpenAI
645
645
 
646
646
  # Control how much effort the model will exert to match the style and features,
647
647
  # especially facial features, of input images. Supports `high` and `low` on
648
- # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
649
- # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
648
+ # `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
649
+ # this parameter. Defaults to `low` on supported models.
650
650
  attr_accessor input_fidelity: OpenAI::Models::Beta::BetaTool::ImageGeneration::input_fidelity?
651
651
 
652
652
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
@@ -768,8 +768,8 @@ module OpenAI
768
768
  # @param input_fidelity
769
769
  # Control how much effort the model will exert to match the style and features,
770
770
  # especially facial features, of input images. Supports `high` and `low` on
771
- # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
772
- # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
771
+ # `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
772
+ # this parameter. Defaults to `low` on supported models.
773
773
  # @param input_image_mask
774
774
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
775
775
  # `file_id` (string, optional).
@@ -298,7 +298,9 @@ module OpenAI
298
298
  # can call.
299
299
  def tool_choice=: (
300
300
  OpenAI::Models::Beta::ResponseCreateParams::tool_choice
301
- ) -> OpenAI::Models::Beta::ResponseCreateParams::tool_choice
301
+ | { type: :programmatic_tool_calling }
302
+ ) -> (OpenAI::Models::Beta::ResponseCreateParams::tool_choice
303
+ | { type: :programmatic_tool_calling })
302
304
 
303
305
  # An array of tools the model may call while generating a response. You can
304
306
  # specify which tool to use by setting the `tool_choice` parameter.
@@ -633,7 +635,8 @@ module OpenAI
633
635
  ?stream_options: OpenAI::Beta::ResponseCreateParams::StreamOptions?,
634
636
  ?temperature: Float?,
635
637
  ?text: OpenAI::Beta::BetaResponseTextConfig,
636
- ?tool_choice: OpenAI::Models::Beta::ResponseCreateParams::tool_choice,
638
+ ?tool_choice: OpenAI::Models::Beta::ResponseCreateParams::tool_choice
639
+ | { type: :programmatic_tool_calling },
637
640
  ?tools: ::Array[OpenAI::Models::Beta::beta_tool],
638
641
  ?top_logprobs: Integer?,
639
642
  ?top_p: Float?,
@@ -79,7 +79,14 @@ module OpenAI
79
79
  attr_accessor text: OpenAI::Beta::Responses::InputTokenCountParams::Text?
80
80
 
81
81
  # Controls which tool the model should use, if any.
82
- attr_accessor tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?
82
+ attr_reader tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?
83
+
84
+ # Controls which tool the model should use, if any.
85
+ def tool_choice=: (
86
+ (OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice
87
+ | { type: :programmatic_tool_calling })?
88
+ ) -> (OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice
89
+ | { type: :programmatic_tool_calling })?
83
90
 
84
91
  # An array of tools the model may call while generating a response. You can
85
92
  # specify which tool to use by setting the `tool_choice` parameter.
@@ -166,7 +173,8 @@ module OpenAI
166
173
  ?previous_response_id: String?,
167
174
  ?reasoning: OpenAI::Beta::Responses::InputTokenCountParams::Reasoning?,
168
175
  ?text: OpenAI::Beta::Responses::InputTokenCountParams::Text?,
169
- ?tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?,
176
+ ?tool_choice: (OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice
177
+ | { type: :programmatic_tool_calling })?,
170
178
  ?tools: ::Array[OpenAI::Models::Beta::beta_tool]?,
171
179
  ?truncation: OpenAI::Models::Beta::Responses::InputTokenCountParams::truncation,
172
180
  ?betas: ::Array[OpenAI::Models::Beta::Responses::InputTokenCountParams::beta],
@@ -441,8 +441,10 @@ module OpenAI
441
441
 
442
442
  # The tools to add this file to.
443
443
  def tools=: (
444
- ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool]
445
- ) -> ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool]
444
+ ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
445
+ | { type: :file_search }]
446
+ ) -> ::Array[(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
447
+ | { type: :file_search })]
446
448
 
447
449
  # @param file_id
448
450
  # The ID of the file to attach to the message.
@@ -450,7 +452,8 @@ module OpenAI
450
452
  # The tools to add this file to.
451
453
  def initialize: (
452
454
  ?file_id: String,
453
- ?tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool]
455
+ ?tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
456
+ | { type: :file_search }]
454
457
  ) -> void
455
458
 
456
459
  def to_hash: -> {
@@ -603,7 +606,9 @@ module OpenAI
603
606
  # strategy.
604
607
  def chunking_strategy=: (
605
608
  OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
606
- ) -> OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
609
+ | { type: :auto }
610
+ ) -> (OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
611
+ | { type: :auto })
607
612
 
608
613
  # A list of [file](https://developers.openai.com/api/reference/resources/files)
609
614
  # IDs to add to the vector store. For vector stores created before Nov 2025, there
@@ -641,7 +646,8 @@ module OpenAI
641
646
  # Keys are strings with a maximum length of 64 characters. Values are strings with
642
647
  # a maximum length of 512 characters.
643
648
  def initialize: (
644
- ?chunking_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy,
649
+ ?chunking_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
650
+ | { type: :auto },
645
651
  ?file_ids: ::Array[String],
646
652
  ?metadata: OpenAI::Models::metadata?
647
653
  ) -> void
@@ -173,8 +173,10 @@ module OpenAI
173
173
 
174
174
  # The tools to add this file to.
175
175
  def tools=: (
176
- ::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::tool]
177
- ) -> ::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::tool]
176
+ ::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::tool
177
+ | { type: :file_search }]
178
+ ) -> ::Array[(OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::tool
179
+ | { type: :file_search })]
178
180
 
179
181
  # @param file_id
180
182
  # The ID of the file to attach to the message.
@@ -182,7 +184,8 @@ module OpenAI
182
184
  # The tools to add this file to.
183
185
  def initialize: (
184
186
  ?file_id: String,
185
- ?tools: ::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::tool]
187
+ ?tools: ::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::tool
188
+ | { type: :file_search }]
186
189
  ) -> void
187
190
 
188
191
  def to_hash: -> {
@@ -335,7 +338,9 @@ module OpenAI
335
338
  # strategy.
336
339
  def chunking_strategy=: (
337
340
  OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::chunking_strategy
338
- ) -> OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::chunking_strategy
341
+ | { type: :auto }
342
+ ) -> (OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::chunking_strategy
343
+ | { type: :auto })
339
344
 
340
345
  # A list of [file](https://developers.openai.com/api/reference/resources/files)
341
346
  # IDs to add to the vector store. For vector stores created before Nov 2025, there
@@ -373,7 +378,8 @@ module OpenAI
373
378
  # Keys are strings with a maximum length of 64 characters. Values are strings with
374
379
  # a maximum length of 512 characters.
375
380
  def initialize: (
376
- ?chunking_strategy: OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::chunking_strategy,
381
+ ?chunking_strategy: OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::chunking_strategy
382
+ | { type: :auto },
377
383
  ?file_ids: ::Array[String],
378
384
  ?metadata: OpenAI::Models::metadata?
379
385
  ) -> void
@@ -117,8 +117,10 @@ module OpenAI
117
117
 
118
118
  # The tools to add this file to.
119
119
  def tools=: (
120
- ::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::tool]
121
- ) -> ::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::tool]
120
+ ::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::tool
121
+ | { type: :file_search }]
122
+ ) -> ::Array[(OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::tool
123
+ | { type: :file_search })]
122
124
 
123
125
  # @param file_id
124
126
  # The ID of the file to attach to the message.
@@ -126,7 +128,8 @@ module OpenAI
126
128
  # The tools to add this file to.
127
129
  def initialize: (
128
130
  ?file_id: String,
129
- ?tools: ::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::tool]
131
+ ?tools: ::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::tool
132
+ | { type: :file_search }]
130
133
  ) -> void
131
134
 
132
135
  def to_hash: -> {
@@ -418,8 +418,10 @@ module OpenAI
418
418
 
419
419
  # The tools to add this file to.
420
420
  def tools=: (
421
- ::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::tool]
422
- ) -> ::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::tool]
421
+ ::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::tool
422
+ | { type: :file_search }]
423
+ ) -> ::Array[(OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::tool
424
+ | { type: :file_search })]
423
425
 
424
426
  # @param file_id
425
427
  # The ID of the file to attach to the message.
@@ -427,7 +429,8 @@ module OpenAI
427
429
  # The tools to add this file to.
428
430
  def initialize: (
429
431
  ?file_id: String,
430
- ?tools: ::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::tool]
432
+ ?tools: ::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::tool
433
+ | { type: :file_search }]
431
434
  ) -> void
432
435
 
433
436
  def to_hash: -> {
@@ -25,22 +25,22 @@ module OpenAI
25
25
  # The type of the content part. Always `file`.
26
26
  attr_accessor type: :file
27
27
 
28
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
29
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
30
- # token block.
28
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
29
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
30
+ # not rounded to a token block.
31
31
  attr_reader prompt_cache_breakpoint: OpenAI::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint?
32
32
 
33
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
34
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
35
- # token block.
33
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
34
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
35
+ # not rounded to a token block.
36
36
  def prompt_cache_breakpoint=: (
37
37
  OpenAI::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint
38
38
  ) -> OpenAI::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint
39
39
 
40
40
  # @param prompt_cache_breakpoint
41
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
42
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
43
- # token block.
41
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
42
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
43
+ # not rounded to a token block.
44
44
  # @param type
45
45
  # The type of the content part. Always `file`.
46
46
  def initialize: (
@@ -16,22 +16,22 @@ module OpenAI
16
16
  # The type of the content part.
17
17
  attr_accessor type: :image_url
18
18
 
19
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
20
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
21
- # token block.
19
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
20
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
21
+ # not rounded to a token block.
22
22
  attr_reader prompt_cache_breakpoint: OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint?
23
23
 
24
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
25
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
26
- # token block.
24
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
25
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
26
+ # not rounded to a token block.
27
27
  def prompt_cache_breakpoint=: (
28
28
  OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint
29
29
  ) -> OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint
30
30
 
31
31
  # @param prompt_cache_breakpoint
32
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
33
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
34
- # token block.
32
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
33
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
34
+ # not rounded to a token block.
35
35
  # @param type
36
36
  # The type of the content part.
37
37
  def initialize: (
@@ -16,22 +16,22 @@ module OpenAI
16
16
  # The type of the content part. Always `input_audio`.
17
17
  attr_accessor type: :input_audio
18
18
 
19
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
20
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
21
- # token block.
19
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
20
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
21
+ # not rounded to a token block.
22
22
  attr_reader prompt_cache_breakpoint: OpenAI::Chat::ChatCompletionContentPartInputAudio::PromptCacheBreakpoint?
23
23
 
24
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
25
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
26
- # token block.
24
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
25
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
26
+ # not rounded to a token block.
27
27
  def prompt_cache_breakpoint=: (
28
28
  OpenAI::Chat::ChatCompletionContentPartInputAudio::PromptCacheBreakpoint
29
29
  ) -> OpenAI::Chat::ChatCompletionContentPartInputAudio::PromptCacheBreakpoint
30
30
 
31
31
  # @param prompt_cache_breakpoint
32
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
33
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
34
- # token block.
32
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
33
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
34
+ # not rounded to a token block.
35
35
  # @param type
36
36
  # The type of the content part. Always `input_audio`.
37
37
  def initialize: (
@@ -17,14 +17,14 @@ module OpenAI
17
17
  # The type of the content part.
18
18
  attr_accessor type: :text
19
19
 
20
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
21
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
22
- # token block.
20
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
21
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
22
+ # not rounded to a token block.
23
23
  attr_reader prompt_cache_breakpoint: OpenAI::Chat::ChatCompletionContentPartText::PromptCacheBreakpoint?
24
24
 
25
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
26
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
27
- # token block.
25
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
26
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
27
+ # not rounded to a token block.
28
28
  def prompt_cache_breakpoint=: (
29
29
  OpenAI::Chat::ChatCompletionContentPartText::PromptCacheBreakpoint
30
30
  ) -> OpenAI::Chat::ChatCompletionContentPartText::PromptCacheBreakpoint
@@ -32,9 +32,9 @@ module OpenAI
32
32
  # @param text
33
33
  # The text content.
34
34
  # @param prompt_cache_breakpoint
35
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
36
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
37
- # token block.
35
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
36
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
37
+ # not rounded to a token block.
38
38
  # @param type
39
39
  # The type of the content part.
40
40
  def initialize: (
@@ -25,14 +25,14 @@ module OpenAI
25
25
  # to `computer_screenshot`.
26
26
  attr_accessor type: :computer_screenshot
27
27
 
28
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
29
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
30
- # token block.
28
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
29
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
30
+ # not rounded to a token block.
31
31
  attr_reader prompt_cache_breakpoint: OpenAI::Conversations::ComputerScreenshotContent::PromptCacheBreakpoint?
32
32
 
33
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
34
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
35
- # token block.
33
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
34
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
35
+ # not rounded to a token block.
36
36
  def prompt_cache_breakpoint=: (
37
37
  OpenAI::Conversations::ComputerScreenshotContent::PromptCacheBreakpoint
38
38
  ) -> OpenAI::Conversations::ComputerScreenshotContent::PromptCacheBreakpoint
@@ -45,9 +45,9 @@ module OpenAI
45
45
  # @param image_url
46
46
  # The URL of the screenshot image.
47
47
  # @param prompt_cache_breakpoint
48
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
49
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
50
- # token block.
48
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
49
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
50
+ # not rounded to a token block.
51
51
  # @param type
52
52
  # Specifies the event type. For a computer screenshot, this property is always set
53
53
  # to `computer_screenshot`.
@@ -26,7 +26,25 @@ module OpenAI
26
26
 
27
27
  # Ask 1–400 questions about the input. Each question can be a predicate, choice,
28
28
  # or score. Answers come back in the same order.
29
- attr_accessor questions: ::Array[OpenAI::Models::DecisionCreateParams::question]
29
+ attr_reader questions: ::Array[OpenAI::Models::DecisionCreateParams::question]
30
+
31
+ # Ask 1–400 questions about the input. Each question can be a predicate, choice,
32
+ # or score. Answers come back in the same order.
33
+ def questions=: (
34
+ ::Array[OpenAI::Models::DecisionCreateParams::question
35
+ | {
36
+ instructions: String
37
+ | ::Array[OpenAI::Models::decision_question_input_part],
38
+ type: :predicate,
39
+ ?name: String
40
+ }]
41
+ ) -> ::Array[(OpenAI::Models::DecisionCreateParams::question
42
+ | {
43
+ instructions: (String
44
+ | ::Array[OpenAI::Models::decision_question_input_part]),
45
+ type: :predicate,
46
+ ?name: String
47
+ })]
30
48
 
31
49
  # Partition prompt cache reuse by caller-provided key.
32
50
  attr_accessor prompt_cache_key: String?
@@ -74,7 +92,13 @@ module OpenAI
74
92
  def initialize: (
75
93
  input: OpenAI::Models::DecisionCreateParams::input,
76
94
  model: String,
77
- questions: ::Array[OpenAI::Models::DecisionCreateParams::question],
95
+ questions: ::Array[OpenAI::Models::DecisionCreateParams::question
96
+ | {
97
+ instructions: String
98
+ | ::Array[OpenAI::Models::decision_question_input_part],
99
+ type: :predicate,
100
+ ?name: String
101
+ }],
78
102
  ?prompt_cache_key: String?,
79
103
  ?prompt_cache_options: (OpenAI::DecisionCreateParams::PromptCacheOptions
80
104
  | OpenAI::Models::DecisionCreateParams::prompt_cache_options)?,
@@ -102,6 +126,7 @@ module OpenAI
102
126
 
103
127
  type union_member1 =
104
128
  OpenAI::Models::decision_input_message
129
+ | OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputUserMessage
105
130
  | OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputDeveloperMessage
106
131
  | OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputSystemMessage
107
132
  | OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputAssistantMessage
@@ -195,7 +195,15 @@ module OpenAI
195
195
  class LabelModel < OpenAI::Internal::Type::BaseModel
196
196
  # A list of chat messages forming the prompt or context. May include variable
197
197
  # references to the `item` namespace, ie {{item.name}}.
198
- attr_accessor input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input]
198
+ attr_reader input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input]
199
+
200
+ # A list of chat messages forming the prompt or context. May include variable
201
+ # references to the `item` namespace, ie {{item.name}}.
202
+ def input=: (
203
+ ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input
204
+ | { content: String, role: String }]
205
+ ) -> ::Array[(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input
206
+ | { content: String, role: String })]
199
207
 
200
208
  # The labels to classify to each item in the evaluation.
201
209
  attr_accessor labels: ::Array[String]
@@ -226,7 +234,8 @@ module OpenAI
226
234
  # @param type
227
235
  # The object type, which is always `label_model`.
228
236
  def initialize: (
229
- input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input],
237
+ input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input
238
+ | { content: String, role: String }],
230
239
  labels: ::Array[String],
231
240
  model: String,
232
241
  name: String,
@@ -278,7 +287,17 @@ module OpenAI
278
287
  class EvalItem < OpenAI::Internal::Type::BaseModel
279
288
  # Inputs to the model - can contain template strings. Supports text, output text,
280
289
  # input images, and input audio, either as a single item or an array of items.
281
- attr_accessor content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content
290
+ attr_reader content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content
291
+
292
+ # Inputs to the model - can contain template strings. Supports text, output text,
293
+ # input images, and input audio, either as a single item or an array of items.
294
+ def content=: (
295
+ OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content
296
+ | { text: String, type: :output_text }
297
+ | { image_url: String, type: :input_image, ?detail: String }
298
+ ) -> (OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content
299
+ | { text: String, type: :output_text }
300
+ | { image_url: String, type: :input_image, ?detail: String })
282
301
 
283
302
  # The role of the message input. One of `user`, `assistant`, `system`, or
284
303
  # `developer`.
@@ -301,7 +320,9 @@ module OpenAI
301
320
  # @param type
302
321
  # The type of the message input. Always `message`.
303
322
  def initialize: (
304
- content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content,
323
+ content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content
324
+ | { text: String, type: :output_text }
325
+ | { image_url: String, type: :input_image, ?detail: String },
305
326
  role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::role,
306
327
  ?type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::type_
307
328
  ) -> void