openai 0.68.0 → 0.69.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 (701) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +7 -7
  4. data/lib/openai/internal/type/enum.rb +6 -6
  5. data/lib/openai/internal/util.rb +14 -2
  6. data/lib/openai/models/beta/assistant_create_params.rb +7 -14
  7. data/lib/openai/models/beta/assistant_update_params.rb +7 -14
  8. data/lib/openai/models/beta/beta_apply_patch_tool.rb +44 -0
  9. data/lib/openai/models/beta/beta_compacted_response.rb +58 -0
  10. data/lib/openai/models/beta/beta_computer_action.rb +398 -0
  11. data/lib/openai/models/beta/beta_computer_action_list.rb +13 -0
  12. data/lib/openai/models/beta/beta_computer_tool.rb +23 -0
  13. data/lib/openai/models/beta/beta_computer_use_preview_tool.rb +63 -0
  14. data/lib/openai/models/beta/beta_container_auto.rb +96 -0
  15. data/lib/openai/models/beta/beta_container_network_policy_allowlist.rb +37 -0
  16. data/lib/openai/models/beta/beta_container_network_policy_disabled.rb +20 -0
  17. data/lib/openai/models/beta/beta_container_network_policy_domain_secret.rb +36 -0
  18. data/lib/openai/models/beta/beta_container_reference.rb +28 -0
  19. data/lib/openai/models/beta/beta_custom_tool.rb +148 -0
  20. data/lib/openai/models/beta/beta_easy_input_message.rb +120 -0
  21. data/lib/openai/models/beta/beta_file_search_tool.rb +424 -0
  22. data/lib/openai/models/beta/beta_function_shell_tool.rb +67 -0
  23. data/lib/openai/models/beta/beta_function_tool.rb +97 -0
  24. data/lib/openai/models/beta/beta_inline_skill.rb +44 -0
  25. data/lib/openai/models/beta/beta_inline_skill_source.rb +38 -0
  26. data/lib/openai/models/beta/beta_local_environment.rb +28 -0
  27. data/lib/openai/models/beta/beta_local_skill.rb +36 -0
  28. data/lib/openai/models/beta/beta_namespace_tool.rb +146 -0
  29. data/lib/openai/models/beta/beta_response.rb +1425 -0
  30. data/lib/openai/models/beta/beta_response_apply_patch_tool_call.rb +258 -0
  31. data/lib/openai/models/beta/beta_response_apply_patch_tool_call_output.rb +156 -0
  32. data/lib/openai/models/beta/beta_response_audio_delta_event.rb +63 -0
  33. data/lib/openai/models/beta/beta_response_audio_done_event.rb +55 -0
  34. data/lib/openai/models/beta/beta_response_audio_transcript_delta_event.rb +63 -0
  35. data/lib/openai/models/beta/beta_response_audio_transcript_done_event.rb +55 -0
  36. data/lib/openai/models/beta/beta_response_code_interpreter_call_code_delta_event.rb +81 -0
  37. data/lib/openai/models/beta/beta_response_code_interpreter_call_code_done_event.rb +76 -0
  38. data/lib/openai/models/beta/beta_response_code_interpreter_call_completed_event.rb +73 -0
  39. data/lib/openai/models/beta/beta_response_code_interpreter_call_in_progress_event.rb +77 -0
  40. data/lib/openai/models/beta/beta_response_code_interpreter_call_interpreting_event.rb +77 -0
  41. data/lib/openai/models/beta/beta_response_code_interpreter_tool_call.rb +168 -0
  42. data/lib/openai/models/beta/beta_response_compaction_item.rb +69 -0
  43. data/lib/openai/models/beta/beta_response_compaction_item_param.rb +61 -0
  44. data/lib/openai/models/beta/beta_response_completed_event.rb +63 -0
  45. data/lib/openai/models/beta/beta_response_computer_tool_call.rb +156 -0
  46. data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +141 -0
  47. data/lib/openai/models/beta/beta_response_computer_tool_call_output_screenshot.rb +43 -0
  48. data/lib/openai/models/beta/beta_response_container_reference.rb +29 -0
  49. data/lib/openai/models/beta/beta_response_content.rb +56 -0
  50. data/lib/openai/models/beta/beta_response_content_part_added_event.rb +129 -0
  51. data/lib/openai/models/beta/beta_response_content_part_done_event.rb +129 -0
  52. data/lib/openai/models/beta/beta_response_conversation_param.rb +22 -0
  53. data/lib/openai/models/beta/beta_response_created_event.rb +63 -0
  54. data/lib/openai/models/beta/beta_response_custom_tool_call.rb +142 -0
  55. data/lib/openai/models/beta/beta_response_custom_tool_call_input_delta_event.rb +76 -0
  56. data/lib/openai/models/beta/beta_response_custom_tool_call_input_done_event.rb +76 -0
  57. data/lib/openai/models/beta/beta_response_custom_tool_call_item.rb +55 -0
  58. data/lib/openai/models/beta/beta_response_custom_tool_call_output.rb +171 -0
  59. data/lib/openai/models/beta/beta_response_custom_tool_call_output_item.rb +55 -0
  60. data/lib/openai/models/beta/beta_response_error.rb +63 -0
  61. data/lib/openai/models/beta/beta_response_error_event.rb +79 -0
  62. data/lib/openai/models/beta/beta_response_failed_event.rb +63 -0
  63. data/lib/openai/models/beta/beta_response_file_search_call_completed_event.rb +72 -0
  64. data/lib/openai/models/beta/beta_response_file_search_call_in_progress_event.rb +72 -0
  65. data/lib/openai/models/beta/beta_response_file_search_call_searching_event.rb +72 -0
  66. data/lib/openai/models/beta/beta_response_file_search_tool_call.rb +168 -0
  67. data/lib/openai/models/beta/beta_response_format_text_config.rb +72 -0
  68. data/lib/openai/models/beta/beta_response_format_text_json_schema_config.rb +66 -0
  69. data/lib/openai/models/beta/beta_response_function_call_arguments_delta_event.rb +80 -0
  70. data/lib/openai/models/beta/beta_response_function_call_arguments_done_event.rb +83 -0
  71. data/lib/openai/models/beta/beta_response_function_call_output_item.rb +28 -0
  72. data/lib/openai/models/beta/beta_response_function_call_output_item_list.rb +14 -0
  73. data/lib/openai/models/beta/beta_response_function_shell_call_output_content.rb +90 -0
  74. data/lib/openai/models/beta/beta_response_function_shell_tool_call.rb +216 -0
  75. data/lib/openai/models/beta/beta_response_function_shell_tool_call_output.rb +265 -0
  76. data/lib/openai/models/beta/beta_response_function_tool_call.rb +168 -0
  77. data/lib/openai/models/beta/beta_response_function_tool_call_item.rb +57 -0
  78. data/lib/openai/models/beta/beta_response_function_tool_call_output_item.rb +201 -0
  79. data/lib/openai/models/beta/beta_response_function_web_search.rb +238 -0
  80. data/lib/openai/models/beta/beta_response_image_gen_call_completed_event.rb +69 -0
  81. data/lib/openai/models/beta/beta_response_image_gen_call_generating_event.rb +69 -0
  82. data/lib/openai/models/beta/beta_response_image_gen_call_in_progress_event.rb +68 -0
  83. data/lib/openai/models/beta/beta_response_image_gen_call_partial_image_event.rb +89 -0
  84. data/lib/openai/models/beta/beta_response_in_progress_event.rb +63 -0
  85. data/lib/openai/models/beta/beta_response_includable.rb +45 -0
  86. data/lib/openai/models/beta/beta_response_incomplete_event.rb +63 -0
  87. data/lib/openai/models/beta/beta_response_inject_created_event.rb +51 -0
  88. data/lib/openai/models/beta/beta_response_inject_event.rb +40 -0
  89. data/lib/openai/models/beta/beta_response_inject_failed_event.rb +103 -0
  90. data/lib/openai/models/beta/beta_response_input.rb +13 -0
  91. data/lib/openai/models/beta/beta_response_input_audio.rb +70 -0
  92. data/lib/openai/models/beta/beta_response_input_content.rb +28 -0
  93. data/lib/openai/models/beta/beta_response_input_file.rb +113 -0
  94. data/lib/openai/models/beta/beta_response_input_file_content.rb +115 -0
  95. data/lib/openai/models/beta/beta_response_input_image.rb +94 -0
  96. data/lib/openai/models/beta/beta_response_input_image_content.rb +96 -0
  97. data/lib/openai/models/beta/beta_response_input_item.rb +2819 -0
  98. data/lib/openai/models/beta/beta_response_input_message_content_list.rb +14 -0
  99. data/lib/openai/models/beta/beta_response_input_message_item.rb +108 -0
  100. data/lib/openai/models/beta/beta_response_input_text.rb +59 -0
  101. data/lib/openai/models/beta/beta_response_input_text_content.rb +61 -0
  102. data/lib/openai/models/beta/beta_response_item.rb +1438 -0
  103. data/lib/openai/models/beta/beta_response_local_environment.rb +22 -0
  104. data/lib/openai/models/beta/beta_response_mcp_call_arguments_delta_event.rb +81 -0
  105. data/lib/openai/models/beta/beta_response_mcp_call_arguments_done_event.rb +79 -0
  106. data/lib/openai/models/beta/beta_response_mcp_call_completed_event.rb +68 -0
  107. data/lib/openai/models/beta/beta_response_mcp_call_failed_event.rb +68 -0
  108. data/lib/openai/models/beta/beta_response_mcp_call_in_progress_event.rb +68 -0
  109. data/lib/openai/models/beta/beta_response_mcp_list_tools_completed_event.rb +68 -0
  110. data/lib/openai/models/beta/beta_response_mcp_list_tools_failed_event.rb +68 -0
  111. data/lib/openai/models/beta/beta_response_mcp_list_tools_in_progress_event.rb +69 -0
  112. data/lib/openai/models/beta/beta_response_output_audio.rb +41 -0
  113. data/lib/openai/models/beta/beta_response_output_item.rb +1444 -0
  114. data/lib/openai/models/beta/beta_response_output_item_added_event.rb +71 -0
  115. data/lib/openai/models/beta/beta_response_output_item_done_event.rb +71 -0
  116. data/lib/openai/models/beta/beta_response_output_message.rb +139 -0
  117. data/lib/openai/models/beta/beta_response_output_refusal.rb +30 -0
  118. data/lib/openai/models/beta/beta_response_output_text.rb +292 -0
  119. data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +92 -0
  120. data/lib/openai/models/beta/beta_response_prompt.rb +65 -0
  121. data/lib/openai/models/beta/beta_response_queued_event.rb +60 -0
  122. data/lib/openai/models/beta/beta_response_reasoning_item.rb +151 -0
  123. data/lib/openai/models/beta/beta_response_reasoning_summary_part_added_event.rb +110 -0
  124. data/lib/openai/models/beta/beta_response_reasoning_summary_part_done_event.rb +132 -0
  125. data/lib/openai/models/beta/beta_response_reasoning_summary_text_delta_event.rb +88 -0
  126. data/lib/openai/models/beta/beta_response_reasoning_summary_text_done_event.rb +88 -0
  127. data/lib/openai/models/beta/beta_response_reasoning_text_delta_event.rb +87 -0
  128. data/lib/openai/models/beta/beta_response_reasoning_text_done_event.rb +87 -0
  129. data/lib/openai/models/beta/beta_response_refusal_delta_event.rb +87 -0
  130. data/lib/openai/models/beta/beta_response_refusal_done_event.rb +87 -0
  131. data/lib/openai/models/beta/beta_response_status.rb +25 -0
  132. data/lib/openai/models/beta/beta_response_stream_event.rb +203 -0
  133. data/lib/openai/models/beta/beta_response_text_config.rb +67 -0
  134. data/lib/openai/models/beta/beta_response_text_delta_event.rb +150 -0
  135. data/lib/openai/models/beta/beta_response_text_done_event.rb +150 -0
  136. data/lib/openai/models/beta/beta_response_tool_search_call.rb +117 -0
  137. data/lib/openai/models/beta/beta_response_tool_search_output_item.rb +117 -0
  138. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +109 -0
  139. data/lib/openai/models/beta/beta_response_usage.rb +95 -0
  140. data/lib/openai/models/beta/beta_response_web_search_call_completed_event.rb +72 -0
  141. data/lib/openai/models/beta/beta_response_web_search_call_in_progress_event.rb +72 -0
  142. data/lib/openai/models/beta/beta_response_web_search_call_searching_event.rb +72 -0
  143. data/lib/openai/models/beta/beta_responses_client_event.rb +1432 -0
  144. data/lib/openai/models/beta/beta_responses_server_event.rb +212 -0
  145. data/lib/openai/models/beta/beta_skill_reference.rb +36 -0
  146. data/lib/openai/models/beta/beta_tool.rb +910 -0
  147. data/lib/openai/models/beta/beta_tool_choice_allowed.rb +75 -0
  148. data/lib/openai/models/beta/beta_tool_choice_apply_patch.rb +22 -0
  149. data/lib/openai/models/beta/beta_tool_choice_custom.rb +30 -0
  150. data/lib/openai/models/beta/beta_tool_choice_function.rb +30 -0
  151. data/lib/openai/models/beta/beta_tool_choice_mcp.rb +42 -0
  152. data/lib/openai/models/beta/beta_tool_choice_options.rb +28 -0
  153. data/lib/openai/models/beta/beta_tool_choice_shell.rb +22 -0
  154. data/lib/openai/models/beta/beta_tool_choice_types.rb +67 -0
  155. data/lib/openai/models/beta/beta_tool_search_tool.rb +59 -0
  156. data/lib/openai/models/beta/beta_web_search_preview_tool.rb +143 -0
  157. data/lib/openai/models/beta/beta_web_search_tool.rb +162 -0
  158. data/lib/openai/models/beta/response_cancel_params.rb +37 -0
  159. data/lib/openai/models/beta/response_compact_params.rb +549 -0
  160. data/lib/openai/models/beta/response_create_params.rb +1343 -0
  161. data/lib/openai/models/beta/response_delete_params.rb +37 -0
  162. data/lib/openai/models/beta/response_retrieve_params.rb +74 -0
  163. data/lib/openai/models/beta/responses/beta_response_item_list.rb +54 -0
  164. data/lib/openai/models/beta/responses/input_item_list_params.rb +96 -0
  165. data/lib/openai/models/beta/responses/input_token_count_params.rb +542 -0
  166. data/lib/openai/models/beta/responses/input_token_count_response.rb +26 -0
  167. data/lib/openai/models/beta/threads/run_create_params.rb +7 -14
  168. data/lib/openai/models/chat/chat_completion_content_part.rb +31 -1
  169. data/lib/openai/models/chat/chat_completion_content_part_image.rb +31 -1
  170. data/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +31 -1
  171. data/lib/openai/models/chat/chat_completion_content_part_text.rb +31 -1
  172. data/lib/openai/models/chat/completion_create_params.rb +200 -19
  173. data/lib/openai/models/chat_model.rb +3 -0
  174. data/lib/openai/models/completion_usage.rb +9 -1
  175. data/lib/openai/models/conversations/computer_screenshot_content.rb +28 -1
  176. data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
  177. data/lib/openai/models/conversations/conversation_item.rb +106 -3
  178. data/lib/openai/models/conversations/conversation_item_list.rb +2 -2
  179. data/lib/openai/models/conversations/item_create_params.rb +2 -2
  180. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +7 -14
  181. data/lib/openai/models/evals/run_cancel_response.rb +16 -30
  182. data/lib/openai/models/evals/run_create_params.rb +16 -30
  183. data/lib/openai/models/evals/run_create_response.rb +16 -30
  184. data/lib/openai/models/evals/run_list_response.rb +16 -30
  185. data/lib/openai/models/evals/run_retrieve_response.rb +16 -30
  186. data/lib/openai/models/graders/score_model_grader.rb +7 -14
  187. data/lib/openai/models/realtime/realtime_response_create_mcp_tool.rb +23 -1
  188. data/lib/openai/models/realtime/realtime_session_create_request.rb +6 -0
  189. data/lib/openai/models/realtime/realtime_session_create_response.rb +29 -1
  190. data/lib/openai/models/realtime/realtime_tools_config_union.rb +23 -1
  191. data/lib/openai/models/reasoning.rb +47 -15
  192. data/lib/openai/models/reasoning_effort.rb +7 -13
  193. data/lib/openai/models/responses/apply_patch_tool.rb +23 -1
  194. data/lib/openai/models/responses/compacted_response.rb +2 -2
  195. data/lib/openai/models/responses/custom_tool.rb +21 -1
  196. data/lib/openai/models/responses/function_shell_tool.rb +23 -1
  197. data/lib/openai/models/responses/function_tool.rb +32 -3
  198. data/lib/openai/models/responses/input_token_count_params.rb +21 -8
  199. data/lib/openai/models/responses/namespace_tool.rb +41 -2
  200. data/lib/openai/models/responses/response.rb +98 -14
  201. data/lib/openai/models/responses/response_apply_patch_tool_call.rb +56 -1
  202. data/lib/openai/models/responses/response_apply_patch_tool_call_output.rb +56 -1
  203. data/lib/openai/models/responses/response_compact_params.rb +107 -4
  204. data/lib/openai/models/responses/response_create_params.rb +214 -13
  205. data/lib/openai/models/responses/response_custom_tool_call.rb +56 -1
  206. data/lib/openai/models/responses/response_custom_tool_call_output.rb +58 -1
  207. data/lib/openai/models/responses/response_error.rb +1 -0
  208. data/lib/openai/models/responses/response_function_shell_tool_call.rb +56 -1
  209. data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +56 -1
  210. data/lib/openai/models/responses/response_function_tool_call.rb +56 -1
  211. data/lib/openai/models/responses/response_function_tool_call_output_item.rb +58 -1
  212. data/lib/openai/models/responses/response_input_file.rb +39 -8
  213. data/lib/openai/models/responses/response_input_file_content.rb +41 -8
  214. data/lib/openai/models/responses/response_input_image.rb +27 -1
  215. data/lib/openai/models/responses/response_input_image_content.rb +29 -1
  216. data/lib/openai/models/responses/response_input_item.rb +396 -8
  217. data/lib/openai/models/responses/response_input_text.rb +30 -1
  218. data/lib/openai/models/responses/response_input_text_content.rb +32 -1
  219. data/lib/openai/models/responses/response_item.rb +106 -3
  220. data/lib/openai/models/responses/response_item_list.rb +2 -2
  221. data/lib/openai/models/responses/response_output_item.rb +106 -3
  222. data/lib/openai/models/responses/response_output_item_added_event.rb +2 -2
  223. data/lib/openai/models/responses/response_output_item_done_event.rb +2 -2
  224. data/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb +23 -1
  225. data/lib/openai/models/responses/response_tool_search_output_item.rb +2 -2
  226. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +2 -2
  227. data/lib/openai/models/responses/response_usage.rb +9 -1
  228. data/lib/openai/models/responses/responses_client_event.rb +215 -13
  229. data/lib/openai/models/responses/tool.rb +58 -3
  230. data/lib/openai/models/webhooks/safety_identifier_blocked_webhook_event.rb +118 -0
  231. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +4 -1
  232. data/lib/openai/resources/beta/assistants.rb +2 -2
  233. data/lib/openai/resources/beta/responses/input_items.rb +58 -0
  234. data/lib/openai/resources/beta/responses/input_tokens.rb +73 -0
  235. data/lib/openai/resources/beta/responses.rb +440 -0
  236. data/lib/openai/resources/beta/threads/runs.rb +2 -2
  237. data/lib/openai/resources/beta.rb +4 -0
  238. data/lib/openai/resources/chat/completions.rb +10 -6
  239. data/lib/openai/resources/conversations/items.rb +3 -3
  240. data/lib/openai/resources/conversations.rb +1 -1
  241. data/lib/openai/resources/responses/input_items.rb +1 -1
  242. data/lib/openai/resources/responses/input_tokens.rb +3 -3
  243. data/lib/openai/resources/responses.rb +22 -12
  244. data/lib/openai/resources/webhooks.rb +1 -1
  245. data/lib/openai/version.rb +1 -1
  246. data/lib/openai.rb +163 -0
  247. data/rbi/openai/models/beta/assistant_create_params.rbi +12 -26
  248. data/rbi/openai/models/beta/assistant_update_params.rbi +12 -26
  249. data/rbi/openai/models/beta/beta_apply_patch_tool.rbi +99 -0
  250. data/rbi/openai/models/beta/beta_compacted_response.rbi +120 -0
  251. data/rbi/openai/models/beta/beta_computer_action.rbi +593 -0
  252. data/rbi/openai/models/beta/beta_computer_action_list.rbi +18 -0
  253. data/rbi/openai/models/beta/beta_computer_tool.rbi +33 -0
  254. data/rbi/openai/models/beta/beta_computer_use_preview_tool.rbi +126 -0
  255. data/rbi/openai/models/beta/beta_container_auto.rbi +231 -0
  256. data/rbi/openai/models/beta/beta_container_network_policy_allowlist.rbi +81 -0
  257. data/rbi/openai/models/beta/beta_container_network_policy_disabled.rbi +35 -0
  258. data/rbi/openai/models/beta/beta_container_network_policy_domain_secret.rbi +53 -0
  259. data/rbi/openai/models/beta/beta_container_reference.rbi +42 -0
  260. data/rbi/openai/models/beta/beta_custom_tool.rbi +302 -0
  261. data/rbi/openai/models/beta/beta_easy_input_message.rbi +211 -0
  262. data/rbi/openai/models/beta/beta_file_search_tool.rbi +863 -0
  263. data/rbi/openai/models/beta/beta_function_shell_tool.rbi +155 -0
  264. data/rbi/openai/models/beta/beta_function_tool.rbi +154 -0
  265. data/rbi/openai/models/beta/beta_inline_skill.rbi +68 -0
  266. data/rbi/openai/models/beta/beta_inline_skill_source.rbi +53 -0
  267. data/rbi/openai/models/beta/beta_local_environment.rbi +51 -0
  268. data/rbi/openai/models/beta/beta_local_skill.rbi +49 -0
  269. data/rbi/openai/models/beta/beta_namespace_tool.rbi +252 -0
  270. data/rbi/openai/models/beta/beta_response.rbi +2495 -0
  271. data/rbi/openai/models/beta/beta_response_apply_patch_tool_call.rbi +431 -0
  272. data/rbi/openai/models/beta/beta_response_apply_patch_tool_call_output.rbi +277 -0
  273. data/rbi/openai/models/beta/beta_response_audio_delta_event.rbi +110 -0
  274. data/rbi/openai/models/beta/beta_response_audio_done_event.rbi +100 -0
  275. data/rbi/openai/models/beta/beta_response_audio_transcript_delta_event.rbi +118 -0
  276. data/rbi/openai/models/beta/beta_response_audio_transcript_done_event.rbi +108 -0
  277. data/rbi/openai/models/beta/beta_response_code_interpreter_call_code_delta_event.rbi +136 -0
  278. data/rbi/openai/models/beta/beta_response_code_interpreter_call_code_done_event.rbi +134 -0
  279. data/rbi/openai/models/beta/beta_response_code_interpreter_call_completed_event.rbi +128 -0
  280. data/rbi/openai/models/beta/beta_response_code_interpreter_call_in_progress_event.rbi +128 -0
  281. data/rbi/openai/models/beta/beta_response_code_interpreter_call_interpreting_event.rbi +128 -0
  282. data/rbi/openai/models/beta/beta_response_code_interpreter_tool_call.rbi +315 -0
  283. data/rbi/openai/models/beta/beta_response_compaction_item.rbi +116 -0
  284. data/rbi/openai/models/beta/beta_response_compaction_item_param.rbi +114 -0
  285. data/rbi/openai/models/beta/beta_response_completed_event.rbi +111 -0
  286. data/rbi/openai/models/beta/beta_response_computer_tool_call.rbi +404 -0
  287. data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +296 -0
  288. data/rbi/openai/models/beta/beta_response_computer_tool_call_output_screenshot.rbi +62 -0
  289. data/rbi/openai/models/beta/beta_response_container_reference.rbi +41 -0
  290. data/rbi/openai/models/beta/beta_response_content.rbi +66 -0
  291. data/rbi/openai/models/beta/beta_response_content_part_added_event.rbi +205 -0
  292. data/rbi/openai/models/beta/beta_response_content_part_done_event.rbi +203 -0
  293. data/rbi/openai/models/beta/beta_response_conversation_param.rbi +35 -0
  294. data/rbi/openai/models/beta/beta_response_created_event.rbi +109 -0
  295. data/rbi/openai/models/beta/beta_response_custom_tool_call.rbi +242 -0
  296. data/rbi/openai/models/beta/beta_response_custom_tool_call_input_delta_event.rbi +134 -0
  297. data/rbi/openai/models/beta/beta_response_custom_tool_call_input_done_event.rbi +134 -0
  298. data/rbi/openai/models/beta/beta_response_custom_tool_call_item.rbi +113 -0
  299. data/rbi/openai/models/beta/beta_response_custom_tool_call_output.rbi +303 -0
  300. data/rbi/openai/models/beta/beta_response_custom_tool_call_output_item.rbi +114 -0
  301. data/rbi/openai/models/beta/beta_response_error.rbi +165 -0
  302. data/rbi/openai/models/beta/beta_response_error_event.rbi +120 -0
  303. data/rbi/openai/models/beta/beta_response_failed_event.rbi +107 -0
  304. data/rbi/openai/models/beta/beta_response_file_search_call_completed_event.rbi +126 -0
  305. data/rbi/openai/models/beta/beta_response_file_search_call_in_progress_event.rbi +126 -0
  306. data/rbi/openai/models/beta/beta_response_file_search_call_searching_event.rbi +126 -0
  307. data/rbi/openai/models/beta/beta_response_file_search_tool_call.rbi +328 -0
  308. data/rbi/openai/models/beta/beta_response_format_text_config.rbi +97 -0
  309. data/rbi/openai/models/beta/beta_response_format_text_json_schema_config.rbi +97 -0
  310. data/rbi/openai/models/beta/beta_response_function_call_arguments_delta_event.rbi +134 -0
  311. data/rbi/openai/models/beta/beta_response_function_call_arguments_done_event.rbi +140 -0
  312. data/rbi/openai/models/beta/beta_response_function_call_output_item.rbi +32 -0
  313. data/rbi/openai/models/beta/beta_response_function_call_output_item_list.rbi +21 -0
  314. data/rbi/openai/models/beta/beta_response_function_shell_call_output_content.rbi +160 -0
  315. data/rbi/openai/models/beta/beta_response_function_shell_tool_call.rbi +389 -0
  316. data/rbi/openai/models/beta/beta_response_function_shell_tool_call_output.rbi +470 -0
  317. data/rbi/openai/models/beta/beta_response_function_tool_call.rbi +310 -0
  318. data/rbi/openai/models/beta/beta_response_function_tool_call_item.rbi +115 -0
  319. data/rbi/openai/models/beta/beta_response_function_tool_call_output_item.rbi +364 -0
  320. data/rbi/openai/models/beta/beta_response_function_web_search.rbi +416 -0
  321. data/rbi/openai/models/beta/beta_response_image_gen_call_completed_event.rbi +127 -0
  322. data/rbi/openai/models/beta/beta_response_image_gen_call_generating_event.rbi +127 -0
  323. data/rbi/openai/models/beta/beta_response_image_gen_call_in_progress_event.rbi +126 -0
  324. data/rbi/openai/models/beta/beta_response_image_gen_call_partial_image_event.rbi +144 -0
  325. data/rbi/openai/models/beta/beta_response_in_progress_event.rbi +113 -0
  326. data/rbi/openai/models/beta/beta_response_includable.rbi +86 -0
  327. data/rbi/openai/models/beta/beta_response_incomplete_event.rbi +113 -0
  328. data/rbi/openai/models/beta/beta_response_inject_created_event.rbi +75 -0
  329. data/rbi/openai/models/beta/beta_response_inject_event.rbi +183 -0
  330. data/rbi/openai/models/beta/beta_response_inject_failed_event.rbi +304 -0
  331. data/rbi/openai/models/beta/beta_response_input.rbi +18 -0
  332. data/rbi/openai/models/beta/beta_response_input_audio.rbi +144 -0
  333. data/rbi/openai/models/beta/beta_response_input_content.rbi +31 -0
  334. data/rbi/openai/models/beta/beta_response_input_file.rbi +210 -0
  335. data/rbi/openai/models/beta/beta_response_input_file_content.rbi +211 -0
  336. data/rbi/openai/models/beta/beta_response_input_image.rbi +173 -0
  337. data/rbi/openai/models/beta/beta_response_input_image_content.rbi +191 -0
  338. data/rbi/openai/models/beta/beta_response_input_item.rbi +5505 -0
  339. data/rbi/openai/models/beta/beta_response_input_message_content_list.rbi +21 -0
  340. data/rbi/openai/models/beta/beta_response_input_message_item.rbi +235 -0
  341. data/rbi/openai/models/beta/beta_response_input_text.rbi +109 -0
  342. data/rbi/openai/models/beta/beta_response_input_text_content.rbi +115 -0
  343. data/rbi/openai/models/beta/beta_response_item.rbi +2592 -0
  344. data/rbi/openai/models/beta/beta_response_local_environment.rbi +35 -0
  345. data/rbi/openai/models/beta/beta_response_mcp_call_arguments_delta_event.rbi +137 -0
  346. data/rbi/openai/models/beta/beta_response_mcp_call_arguments_done_event.rbi +134 -0
  347. data/rbi/openai/models/beta/beta_response_mcp_call_completed_event.rbi +123 -0
  348. data/rbi/openai/models/beta/beta_response_mcp_call_failed_event.rbi +121 -0
  349. data/rbi/openai/models/beta/beta_response_mcp_call_in_progress_event.rbi +124 -0
  350. data/rbi/openai/models/beta/beta_response_mcp_list_tools_completed_event.rbi +126 -0
  351. data/rbi/openai/models/beta/beta_response_mcp_list_tools_failed_event.rbi +124 -0
  352. data/rbi/openai/models/beta/beta_response_mcp_list_tools_in_progress_event.rbi +127 -0
  353. data/rbi/openai/models/beta/beta_response_output_audio.rbi +53 -0
  354. data/rbi/openai/models/beta/beta_response_output_item.rbi +2627 -0
  355. data/rbi/openai/models/beta/beta_response_output_item_added_event.rbi +154 -0
  356. data/rbi/openai/models/beta/beta_response_output_item_done_event.rbi +154 -0
  357. data/rbi/openai/models/beta/beta_response_output_message.rbi +267 -0
  358. data/rbi/openai/models/beta/beta_response_output_refusal.rbi +41 -0
  359. data/rbi/openai/models/beta/beta_response_output_text.rbi +479 -0
  360. data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +150 -0
  361. data/rbi/openai/models/beta/beta_response_prompt.rbi +122 -0
  362. data/rbi/openai/models/beta/beta_response_queued_event.rbi +107 -0
  363. data/rbi/openai/models/beta/beta_response_reasoning_item.rbi +274 -0
  364. data/rbi/openai/models/beta/beta_response_reasoning_summary_part_added_event.rbi +188 -0
  365. data/rbi/openai/models/beta/beta_response_reasoning_summary_part_done_event.rbi +243 -0
  366. data/rbi/openai/models/beta/beta_response_reasoning_summary_text_delta_event.rbi +142 -0
  367. data/rbi/openai/models/beta/beta_response_reasoning_summary_text_done_event.rbi +142 -0
  368. data/rbi/openai/models/beta/beta_response_reasoning_text_delta_event.rbi +140 -0
  369. data/rbi/openai/models/beta/beta_response_reasoning_text_done_event.rbi +140 -0
  370. data/rbi/openai/models/beta/beta_response_refusal_delta_event.rbi +135 -0
  371. data/rbi/openai/models/beta/beta_response_refusal_done_event.rbi +135 -0
  372. data/rbi/openai/models/beta/beta_response_status.rbi +38 -0
  373. data/rbi/openai/models/beta/beta_response_stream_event.rbi +81 -0
  374. data/rbi/openai/models/beta/beta_response_text_config.rbi +166 -0
  375. data/rbi/openai/models/beta/beta_response_text_delta_event.rbi +263 -0
  376. data/rbi/openai/models/beta/beta_response_text_done_event.rbi +261 -0
  377. data/rbi/openai/models/beta/beta_response_tool_search_call.rbi +218 -0
  378. data/rbi/openai/models/beta/beta_response_tool_search_output_item.rbi +248 -0
  379. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +307 -0
  380. data/rbi/openai/models/beta/beta_response_usage.rbi +163 -0
  381. data/rbi/openai/models/beta/beta_response_web_search_call_completed_event.rbi +126 -0
  382. data/rbi/openai/models/beta/beta_response_web_search_call_in_progress_event.rbi +126 -0
  383. data/rbi/openai/models/beta/beta_response_web_search_call_searching_event.rbi +126 -0
  384. data/rbi/openai/models/beta/beta_responses_client_event.rbi +2831 -0
  385. data/rbi/openai/models/beta/beta_responses_server_event.rbi +83 -0
  386. data/rbi/openai/models/beta/beta_skill_reference.rbi +52 -0
  387. data/rbi/openai/models/beta/beta_tool.rbi +1835 -0
  388. data/rbi/openai/models/beta/beta_tool_choice_allowed.rbi +126 -0
  389. data/rbi/openai/models/beta/beta_tool_choice_apply_patch.rbi +35 -0
  390. data/rbi/openai/models/beta/beta_tool_choice_custom.rbi +38 -0
  391. data/rbi/openai/models/beta/beta_tool_choice_function.rbi +41 -0
  392. data/rbi/openai/models/beta/beta_tool_choice_mcp.rbi +55 -0
  393. data/rbi/openai/models/beta/beta_tool_choice_options.rbi +38 -0
  394. data/rbi/openai/models/beta/beta_tool_choice_shell.rbi +32 -0
  395. data/rbi/openai/models/beta/beta_tool_choice_types.rbi +134 -0
  396. data/rbi/openai/models/beta/beta_tool_search_tool.rbi +109 -0
  397. data/rbi/openai/models/beta/beta_web_search_preview_tool.rbi +311 -0
  398. data/rbi/openai/models/beta/beta_web_search_tool.rbi +329 -0
  399. data/rbi/openai/models/beta/response_cancel_params.rbi +83 -0
  400. data/rbi/openai/models/beta/response_compact_params.rbi +1033 -0
  401. data/rbi/openai/models/beta/response_create_params.rbi +2739 -0
  402. data/rbi/openai/models/beta/response_delete_params.rbi +83 -0
  403. data/rbi/openai/models/beta/response_retrieve_params.rbi +145 -0
  404. data/rbi/openai/models/beta/responses/beta_response_item_list.rbi +113 -0
  405. data/rbi/openai/models/beta/responses/input_item_list_params.rbi +223 -0
  406. data/rbi/openai/models/beta/responses/input_token_count_params.rbi +1248 -0
  407. data/rbi/openai/models/beta/responses/input_token_count_response.rbi +37 -0
  408. data/rbi/openai/models/beta/threads/run_create_params.rbi +12 -26
  409. data/rbi/openai/models/chat/chat_completion_content_part.rbi +57 -1
  410. data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +57 -1
  411. data/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +57 -1
  412. data/rbi/openai/models/chat/chat_completion_content_part_text.rbi +70 -2
  413. data/rbi/openai/models/chat/completion_create_params.rbi +513 -32
  414. data/rbi/openai/models/chat_model.rbi +3 -0
  415. data/rbi/openai/models/completion_usage.rbi +21 -4
  416. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +57 -1
  417. data/rbi/openai/models/conversations/conversation_create_params.rbi +9 -3
  418. data/rbi/openai/models/conversations/conversation_item.rbi +178 -0
  419. data/rbi/openai/models/conversations/conversation_item_list.rbi +2 -0
  420. data/rbi/openai/models/conversations/item_create_params.rbi +9 -3
  421. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +12 -26
  422. data/rbi/openai/models/evals/run_cancel_response.rbi +26 -52
  423. data/rbi/openai/models/evals/run_create_params.rbi +28 -52
  424. data/rbi/openai/models/evals/run_create_response.rbi +26 -52
  425. data/rbi/openai/models/evals/run_list_response.rbi +26 -52
  426. data/rbi/openai/models/evals/run_retrieve_response.rbi +26 -52
  427. data/rbi/openai/models/graders/score_model_grader.rbi +12 -26
  428. data/rbi/openai/models/realtime/realtime_response_create_mcp_tool.rbi +60 -0
  429. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +10 -0
  430. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +70 -0
  431. data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +60 -0
  432. data/rbi/openai/models/reasoning.rbi +51 -26
  433. data/rbi/openai/models/reasoning_effort.rbi +7 -13
  434. data/rbi/openai/models/responses/apply_patch_tool.rbi +69 -2
  435. data/rbi/openai/models/responses/compacted_response.rbi +2 -0
  436. data/rbi/openai/models/responses/custom_tool.rbi +53 -0
  437. data/rbi/openai/models/responses/function_shell_tool.rbi +57 -0
  438. data/rbi/openai/models/responses/function_tool.rbi +68 -3
  439. data/rbi/openai/models/responses/input_token_count_params.rbi +32 -0
  440. data/rbi/openai/models/responses/namespace_tool.rbi +76 -0
  441. data/rbi/openai/models/responses/response.rbi +192 -3
  442. data/rbi/openai/models/responses/response_apply_patch_tool_call.rbi +98 -0
  443. data/rbi/openai/models/responses/response_apply_patch_tool_call_output.rbi +98 -0
  444. data/rbi/openai/models/responses/response_compact_params.rbi +231 -0
  445. data/rbi/openai/models/responses/response_create_params.rbi +537 -6
  446. data/rbi/openai/models/responses/response_custom_tool_call.rbi +104 -0
  447. data/rbi/openai/models/responses/response_custom_tool_call_output.rbi +111 -1
  448. data/rbi/openai/models/responses/response_error.rbi +5 -0
  449. data/rbi/openai/models/responses/response_function_shell_tool_call.rbi +98 -0
  450. data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +98 -0
  451. data/rbi/openai/models/responses/response_function_tool_call.rbi +104 -0
  452. data/rbi/openai/models/responses/response_function_tool_call_output_item.rbi +104 -0
  453. data/rbi/openai/models/responses/response_input_file.rbi +77 -10
  454. data/rbi/openai/models/responses/response_input_file_content.rbi +83 -10
  455. data/rbi/openai/models/responses/response_input_image.rbi +57 -1
  456. data/rbi/openai/models/responses/response_input_image_content.rbi +63 -1
  457. data/rbi/openai/models/responses/response_input_item.rbi +748 -8
  458. data/rbi/openai/models/responses/response_input_text.rbi +70 -2
  459. data/rbi/openai/models/responses/response_input_text_content.rbi +76 -2
  460. data/rbi/openai/models/responses/response_item.rbi +178 -0
  461. data/rbi/openai/models/responses/response_item_list.rbi +2 -0
  462. data/rbi/openai/models/responses/response_output_item.rbi +178 -0
  463. data/rbi/openai/models/responses/response_output_item_added_event.rbi +2 -0
  464. data/rbi/openai/models/responses/response_output_item_done_event.rbi +2 -0
  465. data/rbi/openai/models/responses/response_reasoning_summary_part_done_event.rbi +58 -1
  466. data/rbi/openai/models/responses/response_tool_search_output_item.rbi +1 -0
  467. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +3 -0
  468. data/rbi/openai/models/responses/response_usage.rbi +16 -2
  469. data/rbi/openai/models/responses/responses_client_event.rbi +537 -6
  470. data/rbi/openai/models/responses/tool.rbi +142 -1
  471. data/rbi/openai/models/webhooks/safety_identifier_blocked_webhook_event.rbi +209 -0
  472. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +2 -1
  473. data/rbi/openai/resources/beta/assistants.rbi +12 -26
  474. data/rbi/openai/resources/beta/responses/input_items.rbi +58 -0
  475. data/rbi/openai/resources/beta/responses/input_tokens.rbi +154 -0
  476. data/rbi/openai/resources/beta/responses.rbi +903 -0
  477. data/rbi/openai/resources/beta/threads/runs.rbi +12 -26
  478. data/rbi/openai/resources/beta.rbi +3 -0
  479. data/rbi/openai/resources/chat/completions.rbi +48 -28
  480. data/rbi/openai/resources/conversations/items.rbi +3 -1
  481. data/rbi/openai/resources/conversations.rbi +3 -1
  482. data/rbi/openai/resources/responses/input_tokens.rbi +2 -0
  483. data/rbi/openai/resources/responses.rbi +54 -2
  484. data/rbi/openai/resources/webhooks.rbi +2 -1
  485. data/sig/openai/client.rbs +1 -1
  486. data/sig/openai/internal/transport/base_client.rbs +2 -2
  487. data/sig/openai/models/beta/beta_apply_patch_tool.rbs +40 -0
  488. data/sig/openai/models/beta/beta_compacted_response.rbs +44 -0
  489. data/sig/openai/models/beta/beta_computer_action.rbs +259 -0
  490. data/sig/openai/models/beta/beta_computer_action_list.rbs +12 -0
  491. data/sig/openai/models/beta/beta_computer_tool.rbs +17 -0
  492. data/sig/openai/models/beta/beta_computer_use_preview_tool.rbs +53 -0
  493. data/sig/openai/models/beta/beta_container_auto.rbs +86 -0
  494. data/sig/openai/models/beta/beta_container_network_policy_allowlist.rbs +38 -0
  495. data/sig/openai/models/beta/beta_container_network_policy_disabled.rbs +17 -0
  496. data/sig/openai/models/beta/beta_container_network_policy_domain_secret.rbs +22 -0
  497. data/sig/openai/models/beta/beta_container_reference.rbs +23 -0
  498. data/sig/openai/models/beta/beta_custom_tool.rbs +126 -0
  499. data/sig/openai/models/beta/beta_easy_input_message.rbs +87 -0
  500. data/sig/openai/models/beta/beta_file_search_tool.rbs +298 -0
  501. data/sig/openai/models/beta/beta_function_shell_tool.rbs +56 -0
  502. data/sig/openai/models/beta/beta_function_tool.rbs +72 -0
  503. data/sig/openai/models/beta/beta_inline_skill.rbs +39 -0
  504. data/sig/openai/models/beta/beta_inline_skill_source.rbs +30 -0
  505. data/sig/openai/models/beta/beta_local_environment.rbs +30 -0
  506. data/sig/openai/models/beta/beta_local_skill.rbs +26 -0
  507. data/sig/openai/models/beta/beta_namespace_tool.rbs +114 -0
  508. data/sig/openai/models/beta/beta_response.rbs +860 -0
  509. data/sig/openai/models/beta/beta_response_apply_patch_tool_call.rbs +177 -0
  510. data/sig/openai/models/beta/beta_response_apply_patch_tool_call_output.rbs +118 -0
  511. data/sig/openai/models/beta/beta_response_audio_delta_event.rbs +49 -0
  512. data/sig/openai/models/beta/beta_response_audio_done_event.rbs +44 -0
  513. data/sig/openai/models/beta/beta_response_audio_transcript_delta_event.rbs +49 -0
  514. data/sig/openai/models/beta/beta_response_audio_transcript_done_event.rbs +44 -0
  515. data/sig/openai/models/beta/beta_response_code_interpreter_call_code_delta_event.rbs +59 -0
  516. data/sig/openai/models/beta/beta_response_code_interpreter_call_code_done_event.rbs +59 -0
  517. data/sig/openai/models/beta/beta_response_code_interpreter_call_completed_event.rbs +54 -0
  518. data/sig/openai/models/beta/beta_response_code_interpreter_call_in_progress_event.rbs +54 -0
  519. data/sig/openai/models/beta/beta_response_code_interpreter_call_interpreting_event.rbs +54 -0
  520. data/sig/openai/models/beta/beta_response_code_interpreter_tool_call.rbs +113 -0
  521. data/sig/openai/models/beta/beta_response_compaction_item.rbs +60 -0
  522. data/sig/openai/models/beta/beta_response_compaction_item_param.rbs +49 -0
  523. data/sig/openai/models/beta/beta_response_completed_event.rbs +49 -0
  524. data/sig/openai/models/beta/beta_response_computer_tool_call.rbs +118 -0
  525. data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +107 -0
  526. data/sig/openai/models/beta/beta_response_computer_tool_call_output_screenshot.rbs +34 -0
  527. data/sig/openai/models/beta/beta_response_container_reference.rbs +23 -0
  528. data/sig/openai/models/beta/beta_response_content.rbs +33 -0
  529. data/sig/openai/models/beta/beta_response_content_part_added_event.rbs +87 -0
  530. data/sig/openai/models/beta/beta_response_content_part_done_event.rbs +87 -0
  531. data/sig/openai/models/beta/beta_response_conversation_param.rbs +17 -0
  532. data/sig/openai/models/beta/beta_response_created_event.rbs +49 -0
  533. data/sig/openai/models/beta/beta_response_custom_tool_call.rbs +105 -0
  534. data/sig/openai/models/beta/beta_response_custom_tool_call_input_delta_event.rbs +59 -0
  535. data/sig/openai/models/beta/beta_response_custom_tool_call_input_done_event.rbs +59 -0
  536. data/sig/openai/models/beta/beta_response_custom_tool_call_item.rbs +54 -0
  537. data/sig/openai/models/beta/beta_response_custom_tool_call_output.rbs +116 -0
  538. data/sig/openai/models/beta/beta_response_custom_tool_call_output_item.rbs +54 -0
  539. data/sig/openai/models/beta/beta_response_error.rbs +73 -0
  540. data/sig/openai/models/beta/beta_response_error_event.rbs +59 -0
  541. data/sig/openai/models/beta/beta_response_failed_event.rbs +49 -0
  542. data/sig/openai/models/beta/beta_response_file_search_call_completed_event.rbs +54 -0
  543. data/sig/openai/models/beta/beta_response_file_search_call_in_progress_event.rbs +54 -0
  544. data/sig/openai/models/beta/beta_response_file_search_call_searching_event.rbs +54 -0
  545. data/sig/openai/models/beta/beta_response_file_search_tool_call.rbs +127 -0
  546. data/sig/openai/models/beta/beta_response_format_text_config.rbs +38 -0
  547. data/sig/openai/models/beta/beta_response_format_text_json_schema_config.rbs +46 -0
  548. data/sig/openai/models/beta/beta_response_function_call_arguments_delta_event.rbs +59 -0
  549. data/sig/openai/models/beta/beta_response_function_call_arguments_done_event.rbs +64 -0
  550. data/sig/openai/models/beta/beta_response_function_call_output_item.rbs +18 -0
  551. data/sig/openai/models/beta/beta_response_function_call_output_item_list.rbs +12 -0
  552. data/sig/openai/models/beta/beta_response_function_shell_call_output_content.rbs +66 -0
  553. data/sig/openai/models/beta/beta_response_function_shell_tool_call.rbs +161 -0
  554. data/sig/openai/models/beta/beta_response_function_shell_tool_call_output.rbs +190 -0
  555. data/sig/openai/models/beta/beta_response_function_tool_call.rbs +126 -0
  556. data/sig/openai/models/beta/beta_response_function_tool_call_item.rbs +54 -0
  557. data/sig/openai/models/beta/beta_response_function_tool_call_output_item.rbs +138 -0
  558. data/sig/openai/models/beta/beta_response_function_web_search.rbs +165 -0
  559. data/sig/openai/models/beta/beta_response_image_gen_call_completed_event.rbs +54 -0
  560. data/sig/openai/models/beta/beta_response_image_gen_call_generating_event.rbs +54 -0
  561. data/sig/openai/models/beta/beta_response_image_gen_call_in_progress_event.rbs +54 -0
  562. data/sig/openai/models/beta/beta_response_image_gen_call_partial_image_event.rbs +64 -0
  563. data/sig/openai/models/beta/beta_response_in_progress_event.rbs +49 -0
  564. data/sig/openai/models/beta/beta_response_includable.rbs +32 -0
  565. data/sig/openai/models/beta/beta_response_incomplete_event.rbs +49 -0
  566. data/sig/openai/models/beta/beta_response_inject_created_event.rbs +41 -0
  567. data/sig/openai/models/beta/beta_response_inject_event.rbs +34 -0
  568. data/sig/openai/models/beta/beta_response_inject_failed_event.rbs +84 -0
  569. data/sig/openai/models/beta/beta_response_input.rbs +12 -0
  570. data/sig/openai/models/beta/beta_response_input_audio.rbs +62 -0
  571. data/sig/openai/models/beta/beta_response_input_content.rbs +18 -0
  572. data/sig/openai/models/beta/beta_response_input_file.rbs +90 -0
  573. data/sig/openai/models/beta/beta_response_input_file_content.rbs +80 -0
  574. data/sig/openai/models/beta/beta_response_input_image.rbs +71 -0
  575. data/sig/openai/models/beta/beta_response_input_image_content.rbs +67 -0
  576. data/sig/openai/models/beta/beta_response_input_item.rbs +2064 -0
  577. data/sig/openai/models/beta/beta_response_input_message_content_list.rbs +12 -0
  578. data/sig/openai/models/beta/beta_response_input_message_item.rbs +87 -0
  579. data/sig/openai/models/beta/beta_response_input_text.rbs +48 -0
  580. data/sig/openai/models/beta/beta_response_input_text_content.rbs +44 -0
  581. data/sig/openai/models/beta/beta_response_item.rbs +1097 -0
  582. data/sig/openai/models/beta/beta_response_local_environment.rbs +17 -0
  583. data/sig/openai/models/beta/beta_response_mcp_call_arguments_delta_event.rbs +59 -0
  584. data/sig/openai/models/beta/beta_response_mcp_call_arguments_done_event.rbs +59 -0
  585. data/sig/openai/models/beta/beta_response_mcp_call_completed_event.rbs +54 -0
  586. data/sig/openai/models/beta/beta_response_mcp_call_failed_event.rbs +54 -0
  587. data/sig/openai/models/beta/beta_response_mcp_call_in_progress_event.rbs +54 -0
  588. data/sig/openai/models/beta/beta_response_mcp_list_tools_completed_event.rbs +54 -0
  589. data/sig/openai/models/beta/beta_response_mcp_list_tools_failed_event.rbs +54 -0
  590. data/sig/openai/models/beta/beta_response_mcp_list_tools_in_progress_event.rbs +54 -0
  591. data/sig/openai/models/beta/beta_response_output_audio.rbs +30 -0
  592. data/sig/openai/models/beta/beta_response_output_item.rbs +1096 -0
  593. data/sig/openai/models/beta/beta_response_output_item_added_event.rbs +54 -0
  594. data/sig/openai/models/beta/beta_response_output_item_done_event.rbs +54 -0
  595. data/sig/openai/models/beta/beta_response_output_message.rbs +97 -0
  596. data/sig/openai/models/beta/beta_response_output_refusal.rbs +19 -0
  597. data/sig/openai/models/beta/beta_response_output_text.rbs +243 -0
  598. data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +69 -0
  599. data/sig/openai/models/beta/beta_response_prompt.rbs +46 -0
  600. data/sig/openai/models/beta/beta_response_queued_event.rbs +49 -0
  601. data/sig/openai/models/beta/beta_response_reasoning_item.rbs +108 -0
  602. data/sig/openai/models/beta/beta_response_reasoning_summary_part_added_event.rbs +76 -0
  603. data/sig/openai/models/beta/beta_response_reasoning_summary_part_done_event.rbs +95 -0
  604. data/sig/openai/models/beta/beta_response_reasoning_summary_text_delta_event.rbs +64 -0
  605. data/sig/openai/models/beta/beta_response_reasoning_summary_text_done_event.rbs +64 -0
  606. data/sig/openai/models/beta/beta_response_reasoning_text_delta_event.rbs +64 -0
  607. data/sig/openai/models/beta/beta_response_reasoning_text_done_event.rbs +64 -0
  608. data/sig/openai/models/beta/beta_response_refusal_delta_event.rbs +64 -0
  609. data/sig/openai/models/beta/beta_response_refusal_done_event.rbs +64 -0
  610. data/sig/openai/models/beta/beta_response_status.rbs +23 -0
  611. data/sig/openai/models/beta/beta_response_stream_event.rbs +68 -0
  612. data/sig/openai/models/beta/beta_response_text_config.rbs +45 -0
  613. data/sig/openai/models/beta/beta_response_text_delta_event.rbs +116 -0
  614. data/sig/openai/models/beta/beta_response_text_done_event.rbs +116 -0
  615. data/sig/openai/models/beta/beta_response_tool_search_call.rbs +98 -0
  616. data/sig/openai/models/beta/beta_response_tool_search_output_item.rbs +98 -0
  617. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +91 -0
  618. data/sig/openai/models/beta/beta_response_usage.rbs +73 -0
  619. data/sig/openai/models/beta/beta_response_web_search_call_completed_event.rbs +54 -0
  620. data/sig/openai/models/beta/beta_response_web_search_call_in_progress_event.rbs +54 -0
  621. data/sig/openai/models/beta/beta_response_web_search_call_searching_event.rbs +54 -0
  622. data/sig/openai/models/beta/beta_responses_client_event.rbs +804 -0
  623. data/sig/openai/models/beta/beta_responses_server_event.rbs +70 -0
  624. data/sig/openai/models/beta/beta_skill_reference.rbs +32 -0
  625. data/sig/openai/models/beta/beta_tool.rbs +634 -0
  626. data/sig/openai/models/beta/beta_tool_choice_allowed.rbs +45 -0
  627. data/sig/openai/models/beta/beta_tool_choice_apply_patch.rbs +17 -0
  628. data/sig/openai/models/beta/beta_tool_choice_custom.rbs +19 -0
  629. data/sig/openai/models/beta/beta_tool_choice_function.rbs +19 -0
  630. data/sig/openai/models/beta/beta_tool_choice_mcp.rbs +26 -0
  631. data/sig/openai/models/beta/beta_tool_choice_options.rbs +19 -0
  632. data/sig/openai/models/beta/beta_tool_choice_shell.rbs +17 -0
  633. data/sig/openai/models/beta/beta_tool_choice_types.rbs +47 -0
  634. data/sig/openai/models/beta/beta_tool_search_tool.rbs +54 -0
  635. data/sig/openai/models/beta/beta_web_search_preview_tool.rbs +118 -0
  636. data/sig/openai/models/beta/beta_web_search_tool.rbs +127 -0
  637. data/sig/openai/models/beta/response_cancel_params.rbs +47 -0
  638. data/sig/openai/models/beta/response_compact_params.rbs +368 -0
  639. data/sig/openai/models/beta/response_create_params.rbs +804 -0
  640. data/sig/openai/models/beta/response_delete_params.rbs +47 -0
  641. data/sig/openai/models/beta/response_retrieve_params.rbs +70 -0
  642. data/sig/openai/models/beta/responses/beta_response_item_list.rbs +44 -0
  643. data/sig/openai/models/beta/responses/input_item_list_params.rbs +92 -0
  644. data/sig/openai/models/beta/responses/input_token_count_params.rbs +325 -0
  645. data/sig/openai/models/beta/responses/input_token_count_response.rbs +26 -0
  646. data/sig/openai/models/chat/chat_completion_content_part.rbs +21 -2
  647. data/sig/openai/models/chat/chat_completion_content_part_image.rbs +21 -2
  648. data/sig/openai/models/chat/chat_completion_content_part_input_audio.rbs +21 -2
  649. data/sig/openai/models/chat/chat_completion_content_part_text.rbs +32 -3
  650. data/sig/openai/models/chat/completion_create_params.rbs +153 -3
  651. data/sig/openai/models/chat_model.rbs +7 -1
  652. data/sig/openai/models/completion_usage.rbs +15 -2
  653. data/sig/openai/models/conversations/computer_screenshot_content.rbs +21 -2
  654. data/sig/openai/models/conversations/conversation_item.rbs +87 -0
  655. data/sig/openai/models/realtime/realtime_response_create_mcp_tool.rbs +16 -0
  656. data/sig/openai/models/realtime/realtime_session_create_request.rbs +4 -0
  657. data/sig/openai/models/realtime/realtime_session_create_response.rbs +20 -0
  658. data/sig/openai/models/realtime/realtime_tools_config_union.rbs +16 -0
  659. data/sig/openai/models/reasoning.rbs +20 -0
  660. data/sig/openai/models/reasoning_effort.rbs +3 -1
  661. data/sig/openai/models/responses/apply_patch_tool.rbs +26 -3
  662. data/sig/openai/models/responses/custom_tool.rbs +16 -0
  663. data/sig/openai/models/responses/function_shell_tool.rbs +16 -0
  664. data/sig/openai/models/responses/function_tool.rbs +23 -2
  665. data/sig/openai/models/responses/input_token_count_params.rbs +12 -0
  666. data/sig/openai/models/responses/namespace_tool.rbs +21 -0
  667. data/sig/openai/models/responses/response.rbs +64 -0
  668. data/sig/openai/models/responses/response_apply_patch_tool_call.rbs +37 -0
  669. data/sig/openai/models/responses/response_apply_patch_tool_call_output.rbs +37 -0
  670. data/sig/openai/models/responses/response_compact_params.rbs +63 -1
  671. data/sig/openai/models/responses/response_create_params.rbs +165 -3
  672. data/sig/openai/models/responses/response_custom_tool_call.rbs +37 -0
  673. data/sig/openai/models/responses/response_custom_tool_call_output.rbs +39 -2
  674. data/sig/openai/models/responses/response_error.rbs +2 -0
  675. data/sig/openai/models/responses/response_function_shell_tool_call.rbs +37 -0
  676. data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +37 -0
  677. data/sig/openai/models/responses/response_function_tool_call.rbs +37 -0
  678. data/sig/openai/models/responses/response_function_tool_call_output_item.rbs +37 -0
  679. data/sig/openai/models/responses/response_input_file.rbs +23 -3
  680. data/sig/openai/models/responses/response_input_file_content.rbs +19 -3
  681. data/sig/openai/models/responses/response_input_image.rbs +21 -2
  682. data/sig/openai/models/responses/response_input_image_content.rbs +17 -2
  683. data/sig/openai/models/responses/response_input_item.rbs +274 -2
  684. data/sig/openai/models/responses/response_input_text.rbs +32 -3
  685. data/sig/openai/models/responses/response_input_text_content.rbs +28 -3
  686. data/sig/openai/models/responses/response_item.rbs +87 -0
  687. data/sig/openai/models/responses/response_output_item.rbs +87 -0
  688. data/sig/openai/models/responses/response_reasoning_summary_part_done_event.rbs +21 -2
  689. data/sig/openai/models/responses/response_usage.rbs +12 -3
  690. data/sig/openai/models/responses/responses_client_event.rbs +165 -3
  691. data/sig/openai/models/responses/tool.rbs +45 -2
  692. data/sig/openai/models/webhooks/safety_identifier_blocked_webhook_event.rbs +99 -0
  693. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
  694. data/sig/openai/resources/beta/responses/input_items.rbs +21 -0
  695. data/sig/openai/resources/beta/responses/input_tokens.rbs +28 -0
  696. data/sig/openai/resources/beta/responses.rbs +128 -0
  697. data/sig/openai/resources/beta.rbs +2 -0
  698. data/sig/openai/resources/chat/completions.rbs +2 -0
  699. data/sig/openai/resources/responses.rbs +3 -0
  700. data/sig/openai/resources/webhooks.rbs +2 -1
  701. metadata +491 -2
@@ -0,0 +1,2739 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Beta
6
+ class ResponseCreateParams < OpenAI::Internal::Type::BaseModel
7
+ extend OpenAI::Internal::Type::RequestParameters::Converter
8
+ include OpenAI::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(OpenAI::Beta::ResponseCreateParams, OpenAI::Internal::AnyHash)
13
+ end
14
+
15
+ # Whether to run the model response in the background.
16
+ # [Learn more](https://platform.openai.com/docs/guides/background).
17
+ sig { returns(T.nilable(T::Boolean)) }
18
+ attr_accessor :background
19
+
20
+ # Context management configuration for this request.
21
+ sig do
22
+ returns(
23
+ T.nilable(
24
+ T::Array[OpenAI::Beta::ResponseCreateParams::ContextManagement]
25
+ )
26
+ )
27
+ end
28
+ attr_accessor :context_management
29
+
30
+ # The conversation that this response belongs to. Items from this conversation are
31
+ # prepended to `input_items` for this response request. Input items and output
32
+ # items from this response are automatically added to this conversation after this
33
+ # response completes.
34
+ sig do
35
+ returns(
36
+ T.nilable(
37
+ T.any(String, OpenAI::Beta::BetaResponseConversationParam)
38
+ )
39
+ )
40
+ end
41
+ attr_accessor :conversation
42
+
43
+ # Specify additional output data to include in the model response. Currently
44
+ # supported values are:
45
+ #
46
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
47
+ # call.
48
+ # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
49
+ # in code interpreter tool call items.
50
+ # - `computer_call_output.output.image_url`: Include image urls from the computer
51
+ # call output.
52
+ # - `file_search_call.results`: Include the search results of the file search tool
53
+ # call.
54
+ # - `message.input_image.image_url`: Include image urls from the input message.
55
+ # - `message.output_text.logprobs`: Include logprobs with assistant messages.
56
+ # - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
57
+ # tokens in reasoning item outputs. This enables reasoning items to be used in
58
+ # multi-turn conversations when using the Responses API statelessly (like when
59
+ # the `store` parameter is set to `false`, or when an organization is enrolled
60
+ # in the zero data retention program).
61
+ sig do
62
+ returns(
63
+ T.nilable(T::Array[OpenAI::Beta::BetaResponseIncludable::OrSymbol])
64
+ )
65
+ end
66
+ attr_accessor :include
67
+
68
+ # Text, image, or file inputs to the model, used to generate a response.
69
+ #
70
+ # Learn more:
71
+ #
72
+ # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
73
+ # - [Image inputs](https://platform.openai.com/docs/guides/images)
74
+ # - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
75
+ # - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
76
+ # - [Function calling](https://platform.openai.com/docs/guides/function-calling)
77
+ sig do
78
+ returns(
79
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Input::Variants)
80
+ )
81
+ end
82
+ attr_reader :input
83
+
84
+ sig do
85
+ params(
86
+ input: OpenAI::Beta::ResponseCreateParams::Input::Variants
87
+ ).void
88
+ end
89
+ attr_writer :input
90
+
91
+ # A system (or developer) message inserted into the model's context.
92
+ #
93
+ # When using along with `previous_response_id`, the instructions from a previous
94
+ # response will not be carried over to the next response. This makes it simple to
95
+ # swap out system (or developer) messages in new responses.
96
+ sig { returns(T.nilable(String)) }
97
+ attr_accessor :instructions
98
+
99
+ # An upper bound for the number of tokens that can be generated for a response,
100
+ # including visible output tokens and
101
+ # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
102
+ sig { returns(T.nilable(Integer)) }
103
+ attr_accessor :max_output_tokens
104
+
105
+ # The maximum number of total calls to built-in tools that can be processed in a
106
+ # response. This maximum number applies across all built-in tool calls, not per
107
+ # individual tool. Any further attempts to call a tool by the model will be
108
+ # ignored.
109
+ sig { returns(T.nilable(Integer)) }
110
+ attr_accessor :max_tool_calls
111
+
112
+ # Set of 16 key-value pairs that can be attached to an object. This can be useful
113
+ # for storing additional information about the object in a structured format, and
114
+ # querying for objects via API or the dashboard.
115
+ #
116
+ # Keys are strings with a maximum length of 64 characters. Values are strings with
117
+ # a maximum length of 512 characters.
118
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
119
+ attr_accessor :metadata
120
+
121
+ # Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
122
+ # wide range of models with different capabilities, performance characteristics,
123
+ # and price points. Refer to the
124
+ # [model guide](https://platform.openai.com/docs/models) to browse and compare
125
+ # available models.
126
+ sig do
127
+ returns(
128
+ T.nilable(
129
+ T.any(OpenAI::Beta::ResponseCreateParams::Model::OrSymbol, String)
130
+ )
131
+ )
132
+ end
133
+ attr_reader :model
134
+
135
+ sig do
136
+ params(
137
+ model:
138
+ T.any(OpenAI::Beta::ResponseCreateParams::Model::OrSymbol, String)
139
+ ).void
140
+ end
141
+ attr_writer :model
142
+
143
+ # Configuration for running moderation on the input and output of this response.
144
+ sig do
145
+ returns(T.nilable(OpenAI::Beta::ResponseCreateParams::Moderation))
146
+ end
147
+ attr_reader :moderation
148
+
149
+ sig do
150
+ params(
151
+ moderation:
152
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Moderation::OrHash)
153
+ ).void
154
+ end
155
+ attr_writer :moderation
156
+
157
+ # Configuration for server-hosted multi-agent execution.
158
+ sig do
159
+ returns(T.nilable(OpenAI::Beta::ResponseCreateParams::MultiAgent))
160
+ end
161
+ attr_reader :multi_agent
162
+
163
+ sig do
164
+ params(
165
+ multi_agent:
166
+ T.nilable(OpenAI::Beta::ResponseCreateParams::MultiAgent::OrHash)
167
+ ).void
168
+ end
169
+ attr_writer :multi_agent
170
+
171
+ # Whether to allow the model to run tool calls in parallel.
172
+ sig { returns(T.nilable(T::Boolean)) }
173
+ attr_accessor :parallel_tool_calls
174
+
175
+ # The unique ID of the previous response to the model. Use this to create
176
+ # multi-turn conversations. Learn more about
177
+ # [conversation state](https://platform.openai.com/docs/guides/conversation-state).
178
+ # Cannot be used in conjunction with `conversation`.
179
+ sig { returns(T.nilable(String)) }
180
+ attr_accessor :previous_response_id
181
+
182
+ # Reference to a prompt template and its variables.
183
+ # [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
184
+ sig { returns(T.nilable(OpenAI::Beta::BetaResponsePrompt)) }
185
+ attr_reader :prompt
186
+
187
+ sig do
188
+ params(
189
+ prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash)
190
+ ).void
191
+ end
192
+ attr_writer :prompt
193
+
194
+ # Used by OpenAI to cache responses for similar requests to optimize your cache
195
+ # hit rates. Replaces the `user` field.
196
+ # [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
197
+ sig { returns(T.nilable(String)) }
198
+ attr_reader :prompt_cache_key
199
+
200
+ sig { params(prompt_cache_key: String).void }
201
+ attr_writer :prompt_cache_key
202
+
203
+ # Options for prompt caching. Supported for `gpt-5.6` and later models. By
204
+ # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
205
+ # explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
206
+ # request can write up to four breakpoints. For cache matching, OpenAI considers
207
+ # up to the latest 80 breakpoints in the conversation, without a content-block
208
+ # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
209
+ # `ttl` defaults to `30m`, which is currently the only supported value. See the
210
+ # [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
211
+ # for current details.
212
+ sig do
213
+ returns(
214
+ T.nilable(OpenAI::Beta::ResponseCreateParams::PromptCacheOptions)
215
+ )
216
+ end
217
+ attr_reader :prompt_cache_options
218
+
219
+ sig do
220
+ params(
221
+ prompt_cache_options:
222
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::OrHash
223
+ ).void
224
+ end
225
+ attr_writer :prompt_cache_options
226
+
227
+ # Deprecated. Use `prompt_cache_options.ttl` instead.
228
+ #
229
+ # The retention policy for the prompt cache. Set to `24h` to enable extended
230
+ # prompt caching, which keeps cached prefixes active for longer, up to a maximum
231
+ # of 24 hours.
232
+ # [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
233
+ # This field expresses a maximum retention policy, while
234
+ # `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
235
+ # are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
236
+ # models, only `24h` is supported.
237
+ #
238
+ # For older models that support both `in_memory` and `24h`, the default depends on
239
+ # your organization's data retention policy:
240
+ #
241
+ # - Organizations without ZDR enabled default to `24h`.
242
+ # - Organizations with ZDR enabled default to `in_memory` when
243
+ # `prompt_cache_retention` is not specified.
244
+ sig do
245
+ returns(
246
+ T.nilable(
247
+ OpenAI::Beta::ResponseCreateParams::PromptCacheRetention::OrSymbol
248
+ )
249
+ )
250
+ end
251
+ attr_accessor :prompt_cache_retention
252
+
253
+ # **gpt-5 and o-series models only**
254
+ #
255
+ # Configuration options for
256
+ # [reasoning models](https://platform.openai.com/docs/guides/reasoning).
257
+ sig do
258
+ returns(T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning))
259
+ end
260
+ attr_reader :reasoning
261
+
262
+ sig do
263
+ params(
264
+ reasoning:
265
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning::OrHash)
266
+ ).void
267
+ end
268
+ attr_writer :reasoning
269
+
270
+ # A stable identifier used to help detect users of your application that may be
271
+ # violating OpenAI's usage policies. The IDs should be a string that uniquely
272
+ # identifies each user, with a maximum length of 64 characters. We recommend
273
+ # hashing their username or email address, in order to avoid sending us any
274
+ # identifying information.
275
+ # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
276
+ sig { returns(T.nilable(String)) }
277
+ attr_reader :safety_identifier
278
+
279
+ sig { params(safety_identifier: String).void }
280
+ attr_writer :safety_identifier
281
+
282
+ # Specifies the processing type used for serving the request.
283
+ #
284
+ # - If set to 'auto', then the request will be processed with the service tier
285
+ # configured in the Project settings. Unless otherwise configured, the Project
286
+ # will use 'default'.
287
+ # - If set to 'default', then the request will be processed with the standard
288
+ # pricing and performance for the selected model.
289
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
290
+ # '[priority](https://openai.com/api-priority-processing/)', then the request
291
+ # will be processed with the corresponding service tier.
292
+ # - When not set, the default behavior is 'auto'.
293
+ #
294
+ # When the `service_tier` parameter is set, the response body will include the
295
+ # `service_tier` value based on the processing mode actually used to serve the
296
+ # request. This response value may be different from the value set in the
297
+ # parameter.
298
+ sig do
299
+ returns(
300
+ T.nilable(OpenAI::Beta::ResponseCreateParams::ServiceTier::OrSymbol)
301
+ )
302
+ end
303
+ attr_accessor :service_tier
304
+
305
+ # Whether to store the generated model response for later retrieval via API.
306
+ sig { returns(T.nilable(T::Boolean)) }
307
+ attr_accessor :store
308
+
309
+ # Options for streaming responses. Only set this when you set `stream: true`.
310
+ sig do
311
+ returns(T.nilable(OpenAI::Beta::ResponseCreateParams::StreamOptions))
312
+ end
313
+ attr_reader :stream_options
314
+
315
+ sig do
316
+ params(
317
+ stream_options:
318
+ T.nilable(
319
+ OpenAI::Beta::ResponseCreateParams::StreamOptions::OrHash
320
+ )
321
+ ).void
322
+ end
323
+ attr_writer :stream_options
324
+
325
+ # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
326
+ # make the output more random, while lower values like 0.2 will make it more
327
+ # focused and deterministic. We generally recommend altering this or `top_p` but
328
+ # not both.
329
+ sig { returns(T.nilable(Float)) }
330
+ attr_accessor :temperature
331
+
332
+ # Configuration options for a text response from the model. Can be plain text or
333
+ # structured JSON data. Learn more:
334
+ #
335
+ # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
336
+ # - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
337
+ sig { returns(T.nilable(OpenAI::Beta::BetaResponseTextConfig)) }
338
+ attr_reader :text
339
+
340
+ sig { params(text: OpenAI::Beta::BetaResponseTextConfig::OrHash).void }
341
+ attr_writer :text
342
+
343
+ # How the model should select which tool (or tools) to use when generating a
344
+ # response. See the `tools` parameter to see how to specify which tools the model
345
+ # can call.
346
+ sig do
347
+ returns(
348
+ T.nilable(
349
+ T.any(
350
+ OpenAI::Beta::BetaToolChoiceOptions::OrSymbol,
351
+ OpenAI::Beta::BetaToolChoiceAllowed,
352
+ OpenAI::Beta::BetaToolChoiceTypes,
353
+ OpenAI::Beta::BetaToolChoiceFunction,
354
+ OpenAI::Beta::BetaToolChoiceMcp,
355
+ OpenAI::Beta::BetaToolChoiceCustom,
356
+ OpenAI::Beta::ResponseCreateParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam,
357
+ OpenAI::Beta::BetaToolChoiceApplyPatch,
358
+ OpenAI::Beta::BetaToolChoiceShell
359
+ )
360
+ )
361
+ )
362
+ end
363
+ attr_reader :tool_choice
364
+
365
+ sig do
366
+ params(
367
+ tool_choice:
368
+ T.any(
369
+ OpenAI::Beta::BetaToolChoiceOptions::OrSymbol,
370
+ OpenAI::Beta::BetaToolChoiceAllowed::OrHash,
371
+ OpenAI::Beta::BetaToolChoiceTypes::OrHash,
372
+ OpenAI::Beta::BetaToolChoiceFunction::OrHash,
373
+ OpenAI::Beta::BetaToolChoiceMcp::OrHash,
374
+ OpenAI::Beta::BetaToolChoiceCustom::OrHash,
375
+ OpenAI::Beta::ResponseCreateParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam::OrHash,
376
+ OpenAI::Beta::BetaToolChoiceApplyPatch::OrHash,
377
+ OpenAI::Beta::BetaToolChoiceShell::OrHash
378
+ )
379
+ ).void
380
+ end
381
+ attr_writer :tool_choice
382
+
383
+ # An array of tools the model may call while generating a response. You can
384
+ # specify which tool to use by setting the `tool_choice` parameter.
385
+ #
386
+ # We support the following categories of tools:
387
+ #
388
+ # - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
389
+ # capabilities, like
390
+ # [web search](https://platform.openai.com/docs/guides/tools-web-search) or
391
+ # [file search](https://platform.openai.com/docs/guides/tools-file-search).
392
+ # Learn more about
393
+ # [built-in tools](https://platform.openai.com/docs/guides/tools).
394
+ # - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
395
+ # predefined connectors such as Google Drive and SharePoint. Learn more about
396
+ # [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
397
+ # - **Function calls (custom tools)**: Functions that are defined by you, enabling
398
+ # the model to call your own code with strongly typed arguments and outputs.
399
+ # Learn more about
400
+ # [function calling](https://platform.openai.com/docs/guides/function-calling).
401
+ # You can also use custom tools to call your own code.
402
+ sig do
403
+ returns(
404
+ T.nilable(
405
+ T::Array[
406
+ T.any(
407
+ OpenAI::Beta::BetaFunctionTool,
408
+ OpenAI::Beta::BetaFileSearchTool,
409
+ OpenAI::Beta::BetaComputerTool,
410
+ OpenAI::Beta::BetaComputerUsePreviewTool,
411
+ OpenAI::Beta::BetaTool::Mcp,
412
+ OpenAI::Beta::BetaTool::CodeInterpreter,
413
+ OpenAI::Beta::BetaTool::ProgrammaticToolCalling,
414
+ OpenAI::Beta::BetaTool::ImageGeneration,
415
+ OpenAI::Beta::BetaTool::LocalShell,
416
+ OpenAI::Beta::BetaFunctionShellTool,
417
+ OpenAI::Beta::BetaCustomTool,
418
+ OpenAI::Beta::BetaNamespaceTool,
419
+ OpenAI::Beta::BetaToolSearchTool,
420
+ OpenAI::Beta::BetaApplyPatchTool,
421
+ OpenAI::Beta::BetaWebSearchTool,
422
+ OpenAI::Beta::BetaWebSearchPreviewTool
423
+ )
424
+ ]
425
+ )
426
+ )
427
+ end
428
+ attr_reader :tools
429
+
430
+ sig do
431
+ params(
432
+ tools:
433
+ T::Array[
434
+ T.any(
435
+ OpenAI::Beta::BetaFunctionTool::OrHash,
436
+ OpenAI::Beta::BetaFileSearchTool::OrHash,
437
+ OpenAI::Beta::BetaComputerTool::OrHash,
438
+ OpenAI::Beta::BetaComputerUsePreviewTool::OrHash,
439
+ OpenAI::Beta::BetaTool::Mcp::OrHash,
440
+ OpenAI::Beta::BetaTool::CodeInterpreter::OrHash,
441
+ OpenAI::Beta::BetaTool::ProgrammaticToolCalling::OrHash,
442
+ OpenAI::Beta::BetaTool::ImageGeneration::OrHash,
443
+ OpenAI::Beta::BetaTool::LocalShell::OrHash,
444
+ OpenAI::Beta::BetaFunctionShellTool::OrHash,
445
+ OpenAI::Beta::BetaCustomTool::OrHash,
446
+ OpenAI::Beta::BetaNamespaceTool::OrHash,
447
+ OpenAI::Beta::BetaToolSearchTool::OrHash,
448
+ OpenAI::Beta::BetaApplyPatchTool::OrHash,
449
+ OpenAI::Beta::BetaWebSearchTool::OrHash,
450
+ OpenAI::Beta::BetaWebSearchPreviewTool::OrHash
451
+ )
452
+ ]
453
+ ).void
454
+ end
455
+ attr_writer :tools
456
+
457
+ # An integer between 0 and 20 specifying the maximum number of most likely tokens
458
+ # to return at each token position, each with an associated log probability. In
459
+ # some cases, the number of returned tokens may be fewer than requested.
460
+ sig { returns(T.nilable(Integer)) }
461
+ attr_accessor :top_logprobs
462
+
463
+ # An alternative to sampling with temperature, called nucleus sampling, where the
464
+ # model considers the results of the tokens with top_p probability mass. So 0.1
465
+ # means only the tokens comprising the top 10% probability mass are considered.
466
+ #
467
+ # We generally recommend altering this or `temperature` but not both.
468
+ sig { returns(T.nilable(Float)) }
469
+ attr_accessor :top_p
470
+
471
+ # The truncation strategy to use for the model response.
472
+ #
473
+ # - `auto`: If the input to this Response exceeds the model's context window size,
474
+ # the model will truncate the response to fit the context window by dropping
475
+ # items from the beginning of the conversation.
476
+ # - `disabled` (default): If the input size will exceed the context window size
477
+ # for a model, the request will fail with a 400 error.
478
+ sig do
479
+ returns(
480
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Truncation::OrSymbol)
481
+ )
482
+ end
483
+ attr_accessor :truncation
484
+
485
+ # This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
486
+ # `prompt_cache_key` instead to maintain caching optimizations. A stable
487
+ # identifier for your end-users. Used to boost cache hit rates by better bucketing
488
+ # similar requests and to help OpenAI detect and prevent abuse.
489
+ # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
490
+ sig { returns(T.nilable(String)) }
491
+ attr_reader :user
492
+
493
+ sig { params(user: String).void }
494
+ attr_writer :user
495
+
496
+ sig do
497
+ returns(
498
+ T.nilable(
499
+ T::Array[OpenAI::Beta::ResponseCreateParams::Beta::OrSymbol]
500
+ )
501
+ )
502
+ end
503
+ attr_reader :betas
504
+
505
+ sig do
506
+ params(
507
+ betas: T::Array[OpenAI::Beta::ResponseCreateParams::Beta::OrSymbol]
508
+ ).void
509
+ end
510
+ attr_writer :betas
511
+
512
+ sig do
513
+ params(
514
+ background: T.nilable(T::Boolean),
515
+ context_management:
516
+ T.nilable(
517
+ T::Array[
518
+ OpenAI::Beta::ResponseCreateParams::ContextManagement::OrHash
519
+ ]
520
+ ),
521
+ conversation:
522
+ T.nilable(
523
+ T.any(
524
+ String,
525
+ OpenAI::Beta::BetaResponseConversationParam::OrHash
526
+ )
527
+ ),
528
+ include:
529
+ T.nilable(
530
+ T::Array[OpenAI::Beta::BetaResponseIncludable::OrSymbol]
531
+ ),
532
+ input: OpenAI::Beta::ResponseCreateParams::Input::Variants,
533
+ instructions: T.nilable(String),
534
+ max_output_tokens: T.nilable(Integer),
535
+ max_tool_calls: T.nilable(Integer),
536
+ metadata: T.nilable(T::Hash[Symbol, String]),
537
+ model:
538
+ T.any(
539
+ OpenAI::Beta::ResponseCreateParams::Model::OrSymbol,
540
+ String
541
+ ),
542
+ moderation:
543
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Moderation::OrHash),
544
+ multi_agent:
545
+ T.nilable(OpenAI::Beta::ResponseCreateParams::MultiAgent::OrHash),
546
+ parallel_tool_calls: T.nilable(T::Boolean),
547
+ previous_response_id: T.nilable(String),
548
+ prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash),
549
+ prompt_cache_key: String,
550
+ prompt_cache_options:
551
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::OrHash,
552
+ prompt_cache_retention:
553
+ T.nilable(
554
+ OpenAI::Beta::ResponseCreateParams::PromptCacheRetention::OrSymbol
555
+ ),
556
+ reasoning:
557
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning::OrHash),
558
+ safety_identifier: String,
559
+ service_tier:
560
+ T.nilable(
561
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::OrSymbol
562
+ ),
563
+ store: T.nilable(T::Boolean),
564
+ stream_options:
565
+ T.nilable(
566
+ OpenAI::Beta::ResponseCreateParams::StreamOptions::OrHash
567
+ ),
568
+ temperature: T.nilable(Float),
569
+ text: OpenAI::Beta::BetaResponseTextConfig::OrHash,
570
+ tool_choice:
571
+ T.any(
572
+ OpenAI::Beta::BetaToolChoiceOptions::OrSymbol,
573
+ OpenAI::Beta::BetaToolChoiceAllowed::OrHash,
574
+ OpenAI::Beta::BetaToolChoiceTypes::OrHash,
575
+ OpenAI::Beta::BetaToolChoiceFunction::OrHash,
576
+ OpenAI::Beta::BetaToolChoiceMcp::OrHash,
577
+ OpenAI::Beta::BetaToolChoiceCustom::OrHash,
578
+ OpenAI::Beta::ResponseCreateParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam::OrHash,
579
+ OpenAI::Beta::BetaToolChoiceApplyPatch::OrHash,
580
+ OpenAI::Beta::BetaToolChoiceShell::OrHash
581
+ ),
582
+ tools:
583
+ T::Array[
584
+ T.any(
585
+ OpenAI::Beta::BetaFunctionTool::OrHash,
586
+ OpenAI::Beta::BetaFileSearchTool::OrHash,
587
+ OpenAI::Beta::BetaComputerTool::OrHash,
588
+ OpenAI::Beta::BetaComputerUsePreviewTool::OrHash,
589
+ OpenAI::Beta::BetaTool::Mcp::OrHash,
590
+ OpenAI::Beta::BetaTool::CodeInterpreter::OrHash,
591
+ OpenAI::Beta::BetaTool::ProgrammaticToolCalling::OrHash,
592
+ OpenAI::Beta::BetaTool::ImageGeneration::OrHash,
593
+ OpenAI::Beta::BetaTool::LocalShell::OrHash,
594
+ OpenAI::Beta::BetaFunctionShellTool::OrHash,
595
+ OpenAI::Beta::BetaCustomTool::OrHash,
596
+ OpenAI::Beta::BetaNamespaceTool::OrHash,
597
+ OpenAI::Beta::BetaToolSearchTool::OrHash,
598
+ OpenAI::Beta::BetaApplyPatchTool::OrHash,
599
+ OpenAI::Beta::BetaWebSearchTool::OrHash,
600
+ OpenAI::Beta::BetaWebSearchPreviewTool::OrHash
601
+ )
602
+ ],
603
+ top_logprobs: T.nilable(Integer),
604
+ top_p: T.nilable(Float),
605
+ truncation:
606
+ T.nilable(
607
+ OpenAI::Beta::ResponseCreateParams::Truncation::OrSymbol
608
+ ),
609
+ user: String,
610
+ betas: T::Array[OpenAI::Beta::ResponseCreateParams::Beta::OrSymbol],
611
+ request_options: OpenAI::RequestOptions::OrHash
612
+ ).returns(T.attached_class)
613
+ end
614
+ def self.new(
615
+ # Whether to run the model response in the background.
616
+ # [Learn more](https://platform.openai.com/docs/guides/background).
617
+ background: nil,
618
+ # Context management configuration for this request.
619
+ context_management: nil,
620
+ # The conversation that this response belongs to. Items from this conversation are
621
+ # prepended to `input_items` for this response request. Input items and output
622
+ # items from this response are automatically added to this conversation after this
623
+ # response completes.
624
+ conversation: nil,
625
+ # Specify additional output data to include in the model response. Currently
626
+ # supported values are:
627
+ #
628
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
629
+ # call.
630
+ # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
631
+ # in code interpreter tool call items.
632
+ # - `computer_call_output.output.image_url`: Include image urls from the computer
633
+ # call output.
634
+ # - `file_search_call.results`: Include the search results of the file search tool
635
+ # call.
636
+ # - `message.input_image.image_url`: Include image urls from the input message.
637
+ # - `message.output_text.logprobs`: Include logprobs with assistant messages.
638
+ # - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
639
+ # tokens in reasoning item outputs. This enables reasoning items to be used in
640
+ # multi-turn conversations when using the Responses API statelessly (like when
641
+ # the `store` parameter is set to `false`, or when an organization is enrolled
642
+ # in the zero data retention program).
643
+ include: nil,
644
+ # Text, image, or file inputs to the model, used to generate a response.
645
+ #
646
+ # Learn more:
647
+ #
648
+ # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
649
+ # - [Image inputs](https://platform.openai.com/docs/guides/images)
650
+ # - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
651
+ # - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
652
+ # - [Function calling](https://platform.openai.com/docs/guides/function-calling)
653
+ input: nil,
654
+ # A system (or developer) message inserted into the model's context.
655
+ #
656
+ # When using along with `previous_response_id`, the instructions from a previous
657
+ # response will not be carried over to the next response. This makes it simple to
658
+ # swap out system (or developer) messages in new responses.
659
+ instructions: nil,
660
+ # An upper bound for the number of tokens that can be generated for a response,
661
+ # including visible output tokens and
662
+ # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
663
+ max_output_tokens: nil,
664
+ # The maximum number of total calls to built-in tools that can be processed in a
665
+ # response. This maximum number applies across all built-in tool calls, not per
666
+ # individual tool. Any further attempts to call a tool by the model will be
667
+ # ignored.
668
+ max_tool_calls: nil,
669
+ # Set of 16 key-value pairs that can be attached to an object. This can be useful
670
+ # for storing additional information about the object in a structured format, and
671
+ # querying for objects via API or the dashboard.
672
+ #
673
+ # Keys are strings with a maximum length of 64 characters. Values are strings with
674
+ # a maximum length of 512 characters.
675
+ metadata: nil,
676
+ # Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
677
+ # wide range of models with different capabilities, performance characteristics,
678
+ # and price points. Refer to the
679
+ # [model guide](https://platform.openai.com/docs/models) to browse and compare
680
+ # available models.
681
+ model: nil,
682
+ # Configuration for running moderation on the input and output of this response.
683
+ moderation: nil,
684
+ # Configuration for server-hosted multi-agent execution.
685
+ multi_agent: nil,
686
+ # Whether to allow the model to run tool calls in parallel.
687
+ parallel_tool_calls: nil,
688
+ # The unique ID of the previous response to the model. Use this to create
689
+ # multi-turn conversations. Learn more about
690
+ # [conversation state](https://platform.openai.com/docs/guides/conversation-state).
691
+ # Cannot be used in conjunction with `conversation`.
692
+ previous_response_id: nil,
693
+ # Reference to a prompt template and its variables.
694
+ # [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
695
+ prompt: nil,
696
+ # Used by OpenAI to cache responses for similar requests to optimize your cache
697
+ # hit rates. Replaces the `user` field.
698
+ # [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
699
+ prompt_cache_key: nil,
700
+ # Options for prompt caching. Supported for `gpt-5.6` and later models. By
701
+ # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
702
+ # explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
703
+ # request can write up to four breakpoints. For cache matching, OpenAI considers
704
+ # up to the latest 80 breakpoints in the conversation, without a content-block
705
+ # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
706
+ # `ttl` defaults to `30m`, which is currently the only supported value. See the
707
+ # [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
708
+ # for current details.
709
+ prompt_cache_options: nil,
710
+ # Deprecated. Use `prompt_cache_options.ttl` instead.
711
+ #
712
+ # The retention policy for the prompt cache. Set to `24h` to enable extended
713
+ # prompt caching, which keeps cached prefixes active for longer, up to a maximum
714
+ # of 24 hours.
715
+ # [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
716
+ # This field expresses a maximum retention policy, while
717
+ # `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
718
+ # are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
719
+ # models, only `24h` is supported.
720
+ #
721
+ # For older models that support both `in_memory` and `24h`, the default depends on
722
+ # your organization's data retention policy:
723
+ #
724
+ # - Organizations without ZDR enabled default to `24h`.
725
+ # - Organizations with ZDR enabled default to `in_memory` when
726
+ # `prompt_cache_retention` is not specified.
727
+ prompt_cache_retention: nil,
728
+ # **gpt-5 and o-series models only**
729
+ #
730
+ # Configuration options for
731
+ # [reasoning models](https://platform.openai.com/docs/guides/reasoning).
732
+ reasoning: nil,
733
+ # A stable identifier used to help detect users of your application that may be
734
+ # violating OpenAI's usage policies. The IDs should be a string that uniquely
735
+ # identifies each user, with a maximum length of 64 characters. We recommend
736
+ # hashing their username or email address, in order to avoid sending us any
737
+ # identifying information.
738
+ # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
739
+ safety_identifier: nil,
740
+ # Specifies the processing type used for serving the request.
741
+ #
742
+ # - If set to 'auto', then the request will be processed with the service tier
743
+ # configured in the Project settings. Unless otherwise configured, the Project
744
+ # will use 'default'.
745
+ # - If set to 'default', then the request will be processed with the standard
746
+ # pricing and performance for the selected model.
747
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
748
+ # '[priority](https://openai.com/api-priority-processing/)', then the request
749
+ # will be processed with the corresponding service tier.
750
+ # - When not set, the default behavior is 'auto'.
751
+ #
752
+ # When the `service_tier` parameter is set, the response body will include the
753
+ # `service_tier` value based on the processing mode actually used to serve the
754
+ # request. This response value may be different from the value set in the
755
+ # parameter.
756
+ service_tier: nil,
757
+ # Whether to store the generated model response for later retrieval via API.
758
+ store: nil,
759
+ # Options for streaming responses. Only set this when you set `stream: true`.
760
+ stream_options: nil,
761
+ # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
762
+ # make the output more random, while lower values like 0.2 will make it more
763
+ # focused and deterministic. We generally recommend altering this or `top_p` but
764
+ # not both.
765
+ temperature: nil,
766
+ # Configuration options for a text response from the model. Can be plain text or
767
+ # structured JSON data. Learn more:
768
+ #
769
+ # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
770
+ # - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
771
+ text: nil,
772
+ # How the model should select which tool (or tools) to use when generating a
773
+ # response. See the `tools` parameter to see how to specify which tools the model
774
+ # can call.
775
+ tool_choice: nil,
776
+ # An array of tools the model may call while generating a response. You can
777
+ # specify which tool to use by setting the `tool_choice` parameter.
778
+ #
779
+ # We support the following categories of tools:
780
+ #
781
+ # - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
782
+ # capabilities, like
783
+ # [web search](https://platform.openai.com/docs/guides/tools-web-search) or
784
+ # [file search](https://platform.openai.com/docs/guides/tools-file-search).
785
+ # Learn more about
786
+ # [built-in tools](https://platform.openai.com/docs/guides/tools).
787
+ # - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
788
+ # predefined connectors such as Google Drive and SharePoint. Learn more about
789
+ # [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
790
+ # - **Function calls (custom tools)**: Functions that are defined by you, enabling
791
+ # the model to call your own code with strongly typed arguments and outputs.
792
+ # Learn more about
793
+ # [function calling](https://platform.openai.com/docs/guides/function-calling).
794
+ # You can also use custom tools to call your own code.
795
+ tools: nil,
796
+ # An integer between 0 and 20 specifying the maximum number of most likely tokens
797
+ # to return at each token position, each with an associated log probability. In
798
+ # some cases, the number of returned tokens may be fewer than requested.
799
+ top_logprobs: nil,
800
+ # An alternative to sampling with temperature, called nucleus sampling, where the
801
+ # model considers the results of the tokens with top_p probability mass. So 0.1
802
+ # means only the tokens comprising the top 10% probability mass are considered.
803
+ #
804
+ # We generally recommend altering this or `temperature` but not both.
805
+ top_p: nil,
806
+ # The truncation strategy to use for the model response.
807
+ #
808
+ # - `auto`: If the input to this Response exceeds the model's context window size,
809
+ # the model will truncate the response to fit the context window by dropping
810
+ # items from the beginning of the conversation.
811
+ # - `disabled` (default): If the input size will exceed the context window size
812
+ # for a model, the request will fail with a 400 error.
813
+ truncation: nil,
814
+ # This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
815
+ # `prompt_cache_key` instead to maintain caching optimizations. A stable
816
+ # identifier for your end-users. Used to boost cache hit rates by better bucketing
817
+ # similar requests and to help OpenAI detect and prevent abuse.
818
+ # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
819
+ user: nil,
820
+ betas: nil,
821
+ request_options: {}
822
+ )
823
+ end
824
+
825
+ sig do
826
+ override.returns(
827
+ {
828
+ background: T.nilable(T::Boolean),
829
+ context_management:
830
+ T.nilable(
831
+ T::Array[
832
+ OpenAI::Beta::ResponseCreateParams::ContextManagement
833
+ ]
834
+ ),
835
+ conversation:
836
+ T.nilable(
837
+ T.any(String, OpenAI::Beta::BetaResponseConversationParam)
838
+ ),
839
+ include:
840
+ T.nilable(
841
+ T::Array[OpenAI::Beta::BetaResponseIncludable::OrSymbol]
842
+ ),
843
+ input: OpenAI::Beta::ResponseCreateParams::Input::Variants,
844
+ instructions: T.nilable(String),
845
+ max_output_tokens: T.nilable(Integer),
846
+ max_tool_calls: T.nilable(Integer),
847
+ metadata: T.nilable(T::Hash[Symbol, String]),
848
+ model:
849
+ T.any(
850
+ OpenAI::Beta::ResponseCreateParams::Model::OrSymbol,
851
+ String
852
+ ),
853
+ moderation:
854
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Moderation),
855
+ multi_agent:
856
+ T.nilable(OpenAI::Beta::ResponseCreateParams::MultiAgent),
857
+ parallel_tool_calls: T.nilable(T::Boolean),
858
+ previous_response_id: T.nilable(String),
859
+ prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt),
860
+ prompt_cache_key: String,
861
+ prompt_cache_options:
862
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions,
863
+ prompt_cache_retention:
864
+ T.nilable(
865
+ OpenAI::Beta::ResponseCreateParams::PromptCacheRetention::OrSymbol
866
+ ),
867
+ reasoning:
868
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning),
869
+ safety_identifier: String,
870
+ service_tier:
871
+ T.nilable(
872
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::OrSymbol
873
+ ),
874
+ store: T.nilable(T::Boolean),
875
+ stream_options:
876
+ T.nilable(OpenAI::Beta::ResponseCreateParams::StreamOptions),
877
+ temperature: T.nilable(Float),
878
+ text: OpenAI::Beta::BetaResponseTextConfig,
879
+ tool_choice:
880
+ T.any(
881
+ OpenAI::Beta::BetaToolChoiceOptions::OrSymbol,
882
+ OpenAI::Beta::BetaToolChoiceAllowed,
883
+ OpenAI::Beta::BetaToolChoiceTypes,
884
+ OpenAI::Beta::BetaToolChoiceFunction,
885
+ OpenAI::Beta::BetaToolChoiceMcp,
886
+ OpenAI::Beta::BetaToolChoiceCustom,
887
+ OpenAI::Beta::ResponseCreateParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam,
888
+ OpenAI::Beta::BetaToolChoiceApplyPatch,
889
+ OpenAI::Beta::BetaToolChoiceShell
890
+ ),
891
+ tools:
892
+ T::Array[
893
+ T.any(
894
+ OpenAI::Beta::BetaFunctionTool,
895
+ OpenAI::Beta::BetaFileSearchTool,
896
+ OpenAI::Beta::BetaComputerTool,
897
+ OpenAI::Beta::BetaComputerUsePreviewTool,
898
+ OpenAI::Beta::BetaTool::Mcp,
899
+ OpenAI::Beta::BetaTool::CodeInterpreter,
900
+ OpenAI::Beta::BetaTool::ProgrammaticToolCalling,
901
+ OpenAI::Beta::BetaTool::ImageGeneration,
902
+ OpenAI::Beta::BetaTool::LocalShell,
903
+ OpenAI::Beta::BetaFunctionShellTool,
904
+ OpenAI::Beta::BetaCustomTool,
905
+ OpenAI::Beta::BetaNamespaceTool,
906
+ OpenAI::Beta::BetaToolSearchTool,
907
+ OpenAI::Beta::BetaApplyPatchTool,
908
+ OpenAI::Beta::BetaWebSearchTool,
909
+ OpenAI::Beta::BetaWebSearchPreviewTool
910
+ )
911
+ ],
912
+ top_logprobs: T.nilable(Integer),
913
+ top_p: T.nilable(Float),
914
+ truncation:
915
+ T.nilable(
916
+ OpenAI::Beta::ResponseCreateParams::Truncation::OrSymbol
917
+ ),
918
+ user: String,
919
+ betas:
920
+ T::Array[OpenAI::Beta::ResponseCreateParams::Beta::OrSymbol],
921
+ request_options: OpenAI::RequestOptions
922
+ }
923
+ )
924
+ end
925
+ def to_hash
926
+ end
927
+
928
+ class ContextManagement < OpenAI::Internal::Type::BaseModel
929
+ OrHash =
930
+ T.type_alias do
931
+ T.any(
932
+ OpenAI::Beta::ResponseCreateParams::ContextManagement,
933
+ OpenAI::Internal::AnyHash
934
+ )
935
+ end
936
+
937
+ # The context management entry type. Currently only 'compaction' is supported.
938
+ sig { returns(String) }
939
+ attr_accessor :type
940
+
941
+ # Token threshold at which compaction should be triggered for this entry.
942
+ sig { returns(T.nilable(Integer)) }
943
+ attr_accessor :compact_threshold
944
+
945
+ sig do
946
+ params(type: String, compact_threshold: T.nilable(Integer)).returns(
947
+ T.attached_class
948
+ )
949
+ end
950
+ def self.new(
951
+ # The context management entry type. Currently only 'compaction' is supported.
952
+ type:,
953
+ # Token threshold at which compaction should be triggered for this entry.
954
+ compact_threshold: nil
955
+ )
956
+ end
957
+
958
+ sig do
959
+ override.returns(
960
+ { type: String, compact_threshold: T.nilable(Integer) }
961
+ )
962
+ end
963
+ def to_hash
964
+ end
965
+ end
966
+
967
+ # The conversation that this response belongs to. Items from this conversation are
968
+ # prepended to `input_items` for this response request. Input items and output
969
+ # items from this response are automatically added to this conversation after this
970
+ # response completes.
971
+ module Conversation
972
+ extend OpenAI::Internal::Type::Union
973
+
974
+ Variants =
975
+ T.type_alias do
976
+ T.any(String, OpenAI::Beta::BetaResponseConversationParam)
977
+ end
978
+
979
+ sig do
980
+ override.returns(
981
+ T::Array[
982
+ OpenAI::Beta::ResponseCreateParams::Conversation::Variants
983
+ ]
984
+ )
985
+ end
986
+ def self.variants
987
+ end
988
+ end
989
+
990
+ # Text, image, or file inputs to the model, used to generate a response.
991
+ #
992
+ # Learn more:
993
+ #
994
+ # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
995
+ # - [Image inputs](https://platform.openai.com/docs/guides/images)
996
+ # - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
997
+ # - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
998
+ # - [Function calling](https://platform.openai.com/docs/guides/function-calling)
999
+ module Input
1000
+ extend OpenAI::Internal::Type::Union
1001
+
1002
+ Variants =
1003
+ T.type_alias do
1004
+ T.any(
1005
+ String,
1006
+ T::Array[OpenAI::Beta::BetaResponseInputItem::Variants]
1007
+ )
1008
+ end
1009
+
1010
+ sig do
1011
+ override.returns(
1012
+ T::Array[OpenAI::Beta::ResponseCreateParams::Input::Variants]
1013
+ )
1014
+ end
1015
+ def self.variants
1016
+ end
1017
+ end
1018
+
1019
+ # Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
1020
+ # wide range of models with different capabilities, performance characteristics,
1021
+ # and price points. Refer to the
1022
+ # [model guide](https://platform.openai.com/docs/models) to browse and compare
1023
+ # available models.
1024
+ module Model
1025
+ extend OpenAI::Internal::Type::Union
1026
+
1027
+ Variants =
1028
+ T.type_alias do
1029
+ T.any(
1030
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol,
1031
+ String
1032
+ )
1033
+ end
1034
+
1035
+ sig do
1036
+ override.returns(
1037
+ T::Array[OpenAI::Beta::ResponseCreateParams::Model::Variants]
1038
+ )
1039
+ end
1040
+ def self.variants
1041
+ end
1042
+
1043
+ TaggedSymbol =
1044
+ T.type_alias do
1045
+ T.all(Symbol, OpenAI::Beta::ResponseCreateParams::Model)
1046
+ end
1047
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1048
+
1049
+ GPT_5_6_SOL =
1050
+ T.let(
1051
+ :"gpt-5.6-sol",
1052
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1053
+ )
1054
+ GPT_5_6_TERRA =
1055
+ T.let(
1056
+ :"gpt-5.6-terra",
1057
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1058
+ )
1059
+ GPT_5_6_LUNA =
1060
+ T.let(
1061
+ :"gpt-5.6-luna",
1062
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1063
+ )
1064
+ GPT_5_4 =
1065
+ T.let(
1066
+ :"gpt-5.4",
1067
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1068
+ )
1069
+ GPT_5_4_MINI =
1070
+ T.let(
1071
+ :"gpt-5.4-mini",
1072
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1073
+ )
1074
+ GPT_5_4_NANO =
1075
+ T.let(
1076
+ :"gpt-5.4-nano",
1077
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1078
+ )
1079
+ GPT_5_4_MINI_2026_03_17 =
1080
+ T.let(
1081
+ :"gpt-5.4-mini-2026-03-17",
1082
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1083
+ )
1084
+ GPT_5_4_NANO_2026_03_17 =
1085
+ T.let(
1086
+ :"gpt-5.4-nano-2026-03-17",
1087
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1088
+ )
1089
+ GPT_5_3_CHAT_LATEST =
1090
+ T.let(
1091
+ :"gpt-5.3-chat-latest",
1092
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1093
+ )
1094
+ GPT_5_2 =
1095
+ T.let(
1096
+ :"gpt-5.2",
1097
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1098
+ )
1099
+ GPT_5_2_2025_12_11 =
1100
+ T.let(
1101
+ :"gpt-5.2-2025-12-11",
1102
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1103
+ )
1104
+ GPT_5_2_CHAT_LATEST =
1105
+ T.let(
1106
+ :"gpt-5.2-chat-latest",
1107
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1108
+ )
1109
+ GPT_5_2_PRO =
1110
+ T.let(
1111
+ :"gpt-5.2-pro",
1112
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1113
+ )
1114
+ GPT_5_2_PRO_2025_12_11 =
1115
+ T.let(
1116
+ :"gpt-5.2-pro-2025-12-11",
1117
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1118
+ )
1119
+ GPT_5_1 =
1120
+ T.let(
1121
+ :"gpt-5.1",
1122
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1123
+ )
1124
+ GPT_5_1_2025_11_13 =
1125
+ T.let(
1126
+ :"gpt-5.1-2025-11-13",
1127
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1128
+ )
1129
+ GPT_5_1_CODEX =
1130
+ T.let(
1131
+ :"gpt-5.1-codex",
1132
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1133
+ )
1134
+ GPT_5_1_MINI =
1135
+ T.let(
1136
+ :"gpt-5.1-mini",
1137
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1138
+ )
1139
+ GPT_5_1_CHAT_LATEST =
1140
+ T.let(
1141
+ :"gpt-5.1-chat-latest",
1142
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1143
+ )
1144
+ GPT_5 =
1145
+ T.let(
1146
+ :"gpt-5",
1147
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1148
+ )
1149
+ GPT_5_MINI =
1150
+ T.let(
1151
+ :"gpt-5-mini",
1152
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1153
+ )
1154
+ GPT_5_NANO =
1155
+ T.let(
1156
+ :"gpt-5-nano",
1157
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1158
+ )
1159
+ GPT_5_2025_08_07 =
1160
+ T.let(
1161
+ :"gpt-5-2025-08-07",
1162
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1163
+ )
1164
+ GPT_5_MINI_2025_08_07 =
1165
+ T.let(
1166
+ :"gpt-5-mini-2025-08-07",
1167
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1168
+ )
1169
+ GPT_5_NANO_2025_08_07 =
1170
+ T.let(
1171
+ :"gpt-5-nano-2025-08-07",
1172
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1173
+ )
1174
+ GPT_5_CHAT_LATEST =
1175
+ T.let(
1176
+ :"gpt-5-chat-latest",
1177
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1178
+ )
1179
+ GPT_4_1 =
1180
+ T.let(
1181
+ :"gpt-4.1",
1182
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1183
+ )
1184
+ GPT_4_1_MINI =
1185
+ T.let(
1186
+ :"gpt-4.1-mini",
1187
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1188
+ )
1189
+ GPT_4_1_NANO =
1190
+ T.let(
1191
+ :"gpt-4.1-nano",
1192
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1193
+ )
1194
+ GPT_4_1_2025_04_14 =
1195
+ T.let(
1196
+ :"gpt-4.1-2025-04-14",
1197
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1198
+ )
1199
+ GPT_4_1_MINI_2025_04_14 =
1200
+ T.let(
1201
+ :"gpt-4.1-mini-2025-04-14",
1202
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1203
+ )
1204
+ GPT_4_1_NANO_2025_04_14 =
1205
+ T.let(
1206
+ :"gpt-4.1-nano-2025-04-14",
1207
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1208
+ )
1209
+ O4_MINI =
1210
+ T.let(
1211
+ :"o4-mini",
1212
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1213
+ )
1214
+ O4_MINI_2025_04_16 =
1215
+ T.let(
1216
+ :"o4-mini-2025-04-16",
1217
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1218
+ )
1219
+ O3 =
1220
+ T.let(:o3, OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol)
1221
+ O3_2025_04_16 =
1222
+ T.let(
1223
+ :"o3-2025-04-16",
1224
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1225
+ )
1226
+ O3_MINI =
1227
+ T.let(
1228
+ :"o3-mini",
1229
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1230
+ )
1231
+ O3_MINI_2025_01_31 =
1232
+ T.let(
1233
+ :"o3-mini-2025-01-31",
1234
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1235
+ )
1236
+ O1 =
1237
+ T.let(:o1, OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol)
1238
+ O1_2024_12_17 =
1239
+ T.let(
1240
+ :"o1-2024-12-17",
1241
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1242
+ )
1243
+ O1_PREVIEW =
1244
+ T.let(
1245
+ :"o1-preview",
1246
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1247
+ )
1248
+ O1_PREVIEW_2024_09_12 =
1249
+ T.let(
1250
+ :"o1-preview-2024-09-12",
1251
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1252
+ )
1253
+ O1_MINI =
1254
+ T.let(
1255
+ :"o1-mini",
1256
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1257
+ )
1258
+ O1_MINI_2024_09_12 =
1259
+ T.let(
1260
+ :"o1-mini-2024-09-12",
1261
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1262
+ )
1263
+ GPT_4O =
1264
+ T.let(
1265
+ :"gpt-4o",
1266
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1267
+ )
1268
+ GPT_4O_2024_11_20 =
1269
+ T.let(
1270
+ :"gpt-4o-2024-11-20",
1271
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1272
+ )
1273
+ GPT_4O_2024_08_06 =
1274
+ T.let(
1275
+ :"gpt-4o-2024-08-06",
1276
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1277
+ )
1278
+ GPT_4O_2024_05_13 =
1279
+ T.let(
1280
+ :"gpt-4o-2024-05-13",
1281
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1282
+ )
1283
+ GPT_4O_AUDIO_PREVIEW =
1284
+ T.let(
1285
+ :"gpt-4o-audio-preview",
1286
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1287
+ )
1288
+ GPT_4O_AUDIO_PREVIEW_2024_10_01 =
1289
+ T.let(
1290
+ :"gpt-4o-audio-preview-2024-10-01",
1291
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1292
+ )
1293
+ GPT_4O_AUDIO_PREVIEW_2024_12_17 =
1294
+ T.let(
1295
+ :"gpt-4o-audio-preview-2024-12-17",
1296
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1297
+ )
1298
+ GPT_4O_AUDIO_PREVIEW_2025_06_03 =
1299
+ T.let(
1300
+ :"gpt-4o-audio-preview-2025-06-03",
1301
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1302
+ )
1303
+ GPT_4O_MINI_AUDIO_PREVIEW =
1304
+ T.let(
1305
+ :"gpt-4o-mini-audio-preview",
1306
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1307
+ )
1308
+ GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17 =
1309
+ T.let(
1310
+ :"gpt-4o-mini-audio-preview-2024-12-17",
1311
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1312
+ )
1313
+ GPT_4O_SEARCH_PREVIEW =
1314
+ T.let(
1315
+ :"gpt-4o-search-preview",
1316
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1317
+ )
1318
+ GPT_4O_MINI_SEARCH_PREVIEW =
1319
+ T.let(
1320
+ :"gpt-4o-mini-search-preview",
1321
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1322
+ )
1323
+ GPT_4O_SEARCH_PREVIEW_2025_03_11 =
1324
+ T.let(
1325
+ :"gpt-4o-search-preview-2025-03-11",
1326
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1327
+ )
1328
+ GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11 =
1329
+ T.let(
1330
+ :"gpt-4o-mini-search-preview-2025-03-11",
1331
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1332
+ )
1333
+ CHATGPT_4O_LATEST =
1334
+ T.let(
1335
+ :"chatgpt-4o-latest",
1336
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1337
+ )
1338
+ CODEX_MINI_LATEST =
1339
+ T.let(
1340
+ :"codex-mini-latest",
1341
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1342
+ )
1343
+ GPT_4O_MINI =
1344
+ T.let(
1345
+ :"gpt-4o-mini",
1346
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1347
+ )
1348
+ GPT_4O_MINI_2024_07_18 =
1349
+ T.let(
1350
+ :"gpt-4o-mini-2024-07-18",
1351
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1352
+ )
1353
+ GPT_4_TURBO =
1354
+ T.let(
1355
+ :"gpt-4-turbo",
1356
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1357
+ )
1358
+ GPT_4_TURBO_2024_04_09 =
1359
+ T.let(
1360
+ :"gpt-4-turbo-2024-04-09",
1361
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1362
+ )
1363
+ GPT_4_0125_PREVIEW =
1364
+ T.let(
1365
+ :"gpt-4-0125-preview",
1366
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1367
+ )
1368
+ GPT_4_TURBO_PREVIEW =
1369
+ T.let(
1370
+ :"gpt-4-turbo-preview",
1371
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1372
+ )
1373
+ GPT_4_1106_PREVIEW =
1374
+ T.let(
1375
+ :"gpt-4-1106-preview",
1376
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1377
+ )
1378
+ GPT_4_VISION_PREVIEW =
1379
+ T.let(
1380
+ :"gpt-4-vision-preview",
1381
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1382
+ )
1383
+ GPT_4 =
1384
+ T.let(
1385
+ :"gpt-4",
1386
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1387
+ )
1388
+ GPT_4_0314 =
1389
+ T.let(
1390
+ :"gpt-4-0314",
1391
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1392
+ )
1393
+ GPT_4_0613 =
1394
+ T.let(
1395
+ :"gpt-4-0613",
1396
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1397
+ )
1398
+ GPT_4_32K =
1399
+ T.let(
1400
+ :"gpt-4-32k",
1401
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1402
+ )
1403
+ GPT_4_32K_0314 =
1404
+ T.let(
1405
+ :"gpt-4-32k-0314",
1406
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1407
+ )
1408
+ GPT_4_32K_0613 =
1409
+ T.let(
1410
+ :"gpt-4-32k-0613",
1411
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1412
+ )
1413
+ GPT_3_5_TURBO =
1414
+ T.let(
1415
+ :"gpt-3.5-turbo",
1416
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1417
+ )
1418
+ GPT_3_5_TURBO_16K =
1419
+ T.let(
1420
+ :"gpt-3.5-turbo-16k",
1421
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1422
+ )
1423
+ GPT_3_5_TURBO_0301 =
1424
+ T.let(
1425
+ :"gpt-3.5-turbo-0301",
1426
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1427
+ )
1428
+ GPT_3_5_TURBO_0613 =
1429
+ T.let(
1430
+ :"gpt-3.5-turbo-0613",
1431
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1432
+ )
1433
+ GPT_3_5_TURBO_1106 =
1434
+ T.let(
1435
+ :"gpt-3.5-turbo-1106",
1436
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1437
+ )
1438
+ GPT_3_5_TURBO_0125 =
1439
+ T.let(
1440
+ :"gpt-3.5-turbo-0125",
1441
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1442
+ )
1443
+ GPT_3_5_TURBO_16K_0613 =
1444
+ T.let(
1445
+ :"gpt-3.5-turbo-16k-0613",
1446
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1447
+ )
1448
+ O1_PRO =
1449
+ T.let(
1450
+ :"o1-pro",
1451
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1452
+ )
1453
+ O1_PRO_2025_03_19 =
1454
+ T.let(
1455
+ :"o1-pro-2025-03-19",
1456
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1457
+ )
1458
+ O3_PRO =
1459
+ T.let(
1460
+ :"o3-pro",
1461
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1462
+ )
1463
+ O3_PRO_2025_06_10 =
1464
+ T.let(
1465
+ :"o3-pro-2025-06-10",
1466
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1467
+ )
1468
+ O3_DEEP_RESEARCH =
1469
+ T.let(
1470
+ :"o3-deep-research",
1471
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1472
+ )
1473
+ O3_DEEP_RESEARCH_2025_06_26 =
1474
+ T.let(
1475
+ :"o3-deep-research-2025-06-26",
1476
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1477
+ )
1478
+ O4_MINI_DEEP_RESEARCH =
1479
+ T.let(
1480
+ :"o4-mini-deep-research",
1481
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1482
+ )
1483
+ O4_MINI_DEEP_RESEARCH_2025_06_26 =
1484
+ T.let(
1485
+ :"o4-mini-deep-research-2025-06-26",
1486
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1487
+ )
1488
+ COMPUTER_USE_PREVIEW =
1489
+ T.let(
1490
+ :"computer-use-preview",
1491
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1492
+ )
1493
+ COMPUTER_USE_PREVIEW_2025_03_11 =
1494
+ T.let(
1495
+ :"computer-use-preview-2025-03-11",
1496
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1497
+ )
1498
+ GPT_5_CODEX =
1499
+ T.let(
1500
+ :"gpt-5-codex",
1501
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1502
+ )
1503
+ GPT_5_PRO =
1504
+ T.let(
1505
+ :"gpt-5-pro",
1506
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1507
+ )
1508
+ GPT_5_PRO_2025_10_06 =
1509
+ T.let(
1510
+ :"gpt-5-pro-2025-10-06",
1511
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1512
+ )
1513
+ GPT_5_1_CODEX_MAX =
1514
+ T.let(
1515
+ :"gpt-5.1-codex-max",
1516
+ OpenAI::Beta::ResponseCreateParams::Model::TaggedSymbol
1517
+ )
1518
+ end
1519
+
1520
+ class Moderation < OpenAI::Internal::Type::BaseModel
1521
+ OrHash =
1522
+ T.type_alias do
1523
+ T.any(
1524
+ OpenAI::Beta::ResponseCreateParams::Moderation,
1525
+ OpenAI::Internal::AnyHash
1526
+ )
1527
+ end
1528
+
1529
+ # The moderation model to use for moderated completions, e.g.
1530
+ # 'omni-moderation-latest'.
1531
+ sig { returns(String) }
1532
+ attr_accessor :model
1533
+
1534
+ # The policy to apply to moderated response input and output.
1535
+ sig do
1536
+ returns(
1537
+ T.nilable(OpenAI::Beta::ResponseCreateParams::Moderation::Policy)
1538
+ )
1539
+ end
1540
+ attr_reader :policy
1541
+
1542
+ sig do
1543
+ params(
1544
+ policy:
1545
+ T.nilable(
1546
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::OrHash
1547
+ )
1548
+ ).void
1549
+ end
1550
+ attr_writer :policy
1551
+
1552
+ # Configuration for running moderation on the input and output of this response.
1553
+ sig do
1554
+ params(
1555
+ model: String,
1556
+ policy:
1557
+ T.nilable(
1558
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::OrHash
1559
+ )
1560
+ ).returns(T.attached_class)
1561
+ end
1562
+ def self.new(
1563
+ # The moderation model to use for moderated completions, e.g.
1564
+ # 'omni-moderation-latest'.
1565
+ model:,
1566
+ # The policy to apply to moderated response input and output.
1567
+ policy: nil
1568
+ )
1569
+ end
1570
+
1571
+ sig do
1572
+ override.returns(
1573
+ {
1574
+ model: String,
1575
+ policy:
1576
+ T.nilable(
1577
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy
1578
+ )
1579
+ }
1580
+ )
1581
+ end
1582
+ def to_hash
1583
+ end
1584
+
1585
+ class Policy < OpenAI::Internal::Type::BaseModel
1586
+ OrHash =
1587
+ T.type_alias do
1588
+ T.any(
1589
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy,
1590
+ OpenAI::Internal::AnyHash
1591
+ )
1592
+ end
1593
+
1594
+ # The moderation policy for the response input.
1595
+ sig do
1596
+ returns(
1597
+ T.nilable(
1598
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input
1599
+ )
1600
+ )
1601
+ end
1602
+ attr_reader :input
1603
+
1604
+ sig do
1605
+ params(
1606
+ input:
1607
+ T.nilable(
1608
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::OrHash
1609
+ )
1610
+ ).void
1611
+ end
1612
+ attr_writer :input
1613
+
1614
+ # The moderation policy for the response output.
1615
+ sig do
1616
+ returns(
1617
+ T.nilable(
1618
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output
1619
+ )
1620
+ )
1621
+ end
1622
+ attr_reader :output
1623
+
1624
+ sig do
1625
+ params(
1626
+ output:
1627
+ T.nilable(
1628
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::OrHash
1629
+ )
1630
+ ).void
1631
+ end
1632
+ attr_writer :output
1633
+
1634
+ # The policy to apply to moderated response input and output.
1635
+ sig do
1636
+ params(
1637
+ input:
1638
+ T.nilable(
1639
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::OrHash
1640
+ ),
1641
+ output:
1642
+ T.nilable(
1643
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::OrHash
1644
+ )
1645
+ ).returns(T.attached_class)
1646
+ end
1647
+ def self.new(
1648
+ # The moderation policy for the response input.
1649
+ input: nil,
1650
+ # The moderation policy for the response output.
1651
+ output: nil
1652
+ )
1653
+ end
1654
+
1655
+ sig do
1656
+ override.returns(
1657
+ {
1658
+ input:
1659
+ T.nilable(
1660
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input
1661
+ ),
1662
+ output:
1663
+ T.nilable(
1664
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output
1665
+ )
1666
+ }
1667
+ )
1668
+ end
1669
+ def to_hash
1670
+ end
1671
+
1672
+ class Input < OpenAI::Internal::Type::BaseModel
1673
+ OrHash =
1674
+ T.type_alias do
1675
+ T.any(
1676
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input,
1677
+ OpenAI::Internal::AnyHash
1678
+ )
1679
+ end
1680
+
1681
+ sig do
1682
+ returns(
1683
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::Mode::OrSymbol
1684
+ )
1685
+ end
1686
+ attr_accessor :mode
1687
+
1688
+ # The moderation policy for the response input.
1689
+ sig do
1690
+ params(
1691
+ mode:
1692
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::Mode::OrSymbol
1693
+ ).returns(T.attached_class)
1694
+ end
1695
+ def self.new(mode:)
1696
+ end
1697
+
1698
+ sig do
1699
+ override.returns(
1700
+ {
1701
+ mode:
1702
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::Mode::OrSymbol
1703
+ }
1704
+ )
1705
+ end
1706
+ def to_hash
1707
+ end
1708
+
1709
+ module Mode
1710
+ extend OpenAI::Internal::Type::Enum
1711
+
1712
+ TaggedSymbol =
1713
+ T.type_alias do
1714
+ T.all(
1715
+ Symbol,
1716
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::Mode
1717
+ )
1718
+ end
1719
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1720
+
1721
+ SCORE =
1722
+ T.let(
1723
+ :score,
1724
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::Mode::TaggedSymbol
1725
+ )
1726
+ BLOCK =
1727
+ T.let(
1728
+ :block,
1729
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::Mode::TaggedSymbol
1730
+ )
1731
+
1732
+ sig do
1733
+ override.returns(
1734
+ T::Array[
1735
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Input::Mode::TaggedSymbol
1736
+ ]
1737
+ )
1738
+ end
1739
+ def self.values
1740
+ end
1741
+ end
1742
+ end
1743
+
1744
+ class Output < OpenAI::Internal::Type::BaseModel
1745
+ OrHash =
1746
+ T.type_alias do
1747
+ T.any(
1748
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output,
1749
+ OpenAI::Internal::AnyHash
1750
+ )
1751
+ end
1752
+
1753
+ sig do
1754
+ returns(
1755
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::Mode::OrSymbol
1756
+ )
1757
+ end
1758
+ attr_accessor :mode
1759
+
1760
+ # The moderation policy for the response output.
1761
+ sig do
1762
+ params(
1763
+ mode:
1764
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::Mode::OrSymbol
1765
+ ).returns(T.attached_class)
1766
+ end
1767
+ def self.new(mode:)
1768
+ end
1769
+
1770
+ sig do
1771
+ override.returns(
1772
+ {
1773
+ mode:
1774
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::Mode::OrSymbol
1775
+ }
1776
+ )
1777
+ end
1778
+ def to_hash
1779
+ end
1780
+
1781
+ module Mode
1782
+ extend OpenAI::Internal::Type::Enum
1783
+
1784
+ TaggedSymbol =
1785
+ T.type_alias do
1786
+ T.all(
1787
+ Symbol,
1788
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::Mode
1789
+ )
1790
+ end
1791
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1792
+
1793
+ SCORE =
1794
+ T.let(
1795
+ :score,
1796
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::Mode::TaggedSymbol
1797
+ )
1798
+ BLOCK =
1799
+ T.let(
1800
+ :block,
1801
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::Mode::TaggedSymbol
1802
+ )
1803
+
1804
+ sig do
1805
+ override.returns(
1806
+ T::Array[
1807
+ OpenAI::Beta::ResponseCreateParams::Moderation::Policy::Output::Mode::TaggedSymbol
1808
+ ]
1809
+ )
1810
+ end
1811
+ def self.values
1812
+ end
1813
+ end
1814
+ end
1815
+ end
1816
+ end
1817
+
1818
+ class MultiAgent < OpenAI::Internal::Type::BaseModel
1819
+ OrHash =
1820
+ T.type_alias do
1821
+ T.any(
1822
+ OpenAI::Beta::ResponseCreateParams::MultiAgent,
1823
+ OpenAI::Internal::AnyHash
1824
+ )
1825
+ end
1826
+
1827
+ # Whether to enable server-hosted multi-agent execution for this response.
1828
+ sig { returns(T::Boolean) }
1829
+ attr_accessor :enabled
1830
+
1831
+ # `max_concurrent_subagents` sets the maximum number of subagents that can be
1832
+ # active simultaneously across the entire agent tree. It includes all
1833
+ # descendants—children, grandchildren, and deeper subagents—but excludes the root
1834
+ # agent. The API does not impose a fixed upper bound on this setting. The default
1835
+ # is `3`, which is recommended for most workloads. Multi-agent runs also have no
1836
+ # fixed limit on tree depth or the total number of subagents created during a run.
1837
+ sig { returns(T.nilable(Integer)) }
1838
+ attr_reader :max_concurrent_subagents
1839
+
1840
+ sig { params(max_concurrent_subagents: Integer).void }
1841
+ attr_writer :max_concurrent_subagents
1842
+
1843
+ # Configuration for server-hosted multi-agent execution.
1844
+ sig do
1845
+ params(
1846
+ enabled: T::Boolean,
1847
+ max_concurrent_subagents: Integer
1848
+ ).returns(T.attached_class)
1849
+ end
1850
+ def self.new(
1851
+ # Whether to enable server-hosted multi-agent execution for this response.
1852
+ enabled:,
1853
+ # `max_concurrent_subagents` sets the maximum number of subagents that can be
1854
+ # active simultaneously across the entire agent tree. It includes all
1855
+ # descendants—children, grandchildren, and deeper subagents—but excludes the root
1856
+ # agent. The API does not impose a fixed upper bound on this setting. The default
1857
+ # is `3`, which is recommended for most workloads. Multi-agent runs also have no
1858
+ # fixed limit on tree depth or the total number of subagents created during a run.
1859
+ max_concurrent_subagents: nil
1860
+ )
1861
+ end
1862
+
1863
+ sig do
1864
+ override.returns(
1865
+ { enabled: T::Boolean, max_concurrent_subagents: Integer }
1866
+ )
1867
+ end
1868
+ def to_hash
1869
+ end
1870
+ end
1871
+
1872
+ class PromptCacheOptions < OpenAI::Internal::Type::BaseModel
1873
+ OrHash =
1874
+ T.type_alias do
1875
+ T.any(
1876
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions,
1877
+ OpenAI::Internal::AnyHash
1878
+ )
1879
+ end
1880
+
1881
+ # Controls whether OpenAI automatically creates an implicit cache breakpoint.
1882
+ # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
1883
+ # and writes up to the latest three explicit breakpoints in the request. With
1884
+ # `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
1885
+ # latest four explicit breakpoints. If there are no explicit breakpoints, the
1886
+ # request does not use prompt caching.
1887
+ sig do
1888
+ returns(
1889
+ T.nilable(
1890
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode::OrSymbol
1891
+ )
1892
+ )
1893
+ end
1894
+ attr_reader :mode
1895
+
1896
+ sig do
1897
+ params(
1898
+ mode:
1899
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode::OrSymbol
1900
+ ).void
1901
+ end
1902
+ attr_writer :mode
1903
+
1904
+ # The minimum lifetime applied to every implicit and explicit cache breakpoint
1905
+ # written by the request. Defaults to `30m`, which is currently the only supported
1906
+ # value. The backend may retain cache entries for longer.
1907
+ sig do
1908
+ returns(
1909
+ T.nilable(
1910
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::OrSymbol
1911
+ )
1912
+ )
1913
+ end
1914
+ attr_reader :ttl
1915
+
1916
+ sig do
1917
+ params(
1918
+ ttl:
1919
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::OrSymbol
1920
+ ).void
1921
+ end
1922
+ attr_writer :ttl
1923
+
1924
+ # Options for prompt caching. Supported for `gpt-5.6` and later models. By
1925
+ # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
1926
+ # explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
1927
+ # request can write up to four breakpoints. For cache matching, OpenAI considers
1928
+ # up to the latest 80 breakpoints in the conversation, without a content-block
1929
+ # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
1930
+ # `ttl` defaults to `30m`, which is currently the only supported value. See the
1931
+ # [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
1932
+ # for current details.
1933
+ sig do
1934
+ params(
1935
+ mode:
1936
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode::OrSymbol,
1937
+ ttl:
1938
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::OrSymbol
1939
+ ).returns(T.attached_class)
1940
+ end
1941
+ def self.new(
1942
+ # Controls whether OpenAI automatically creates an implicit cache breakpoint.
1943
+ # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
1944
+ # and writes up to the latest three explicit breakpoints in the request. With
1945
+ # `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
1946
+ # latest four explicit breakpoints. If there are no explicit breakpoints, the
1947
+ # request does not use prompt caching.
1948
+ mode: nil,
1949
+ # The minimum lifetime applied to every implicit and explicit cache breakpoint
1950
+ # written by the request. Defaults to `30m`, which is currently the only supported
1951
+ # value. The backend may retain cache entries for longer.
1952
+ ttl: nil
1953
+ )
1954
+ end
1955
+
1956
+ sig do
1957
+ override.returns(
1958
+ {
1959
+ mode:
1960
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode::OrSymbol,
1961
+ ttl:
1962
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::OrSymbol
1963
+ }
1964
+ )
1965
+ end
1966
+ def to_hash
1967
+ end
1968
+
1969
+ # Controls whether OpenAI automatically creates an implicit cache breakpoint.
1970
+ # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
1971
+ # and writes up to the latest three explicit breakpoints in the request. With
1972
+ # `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
1973
+ # latest four explicit breakpoints. If there are no explicit breakpoints, the
1974
+ # request does not use prompt caching.
1975
+ module Mode
1976
+ extend OpenAI::Internal::Type::Enum
1977
+
1978
+ TaggedSymbol =
1979
+ T.type_alias do
1980
+ T.all(
1981
+ Symbol,
1982
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode
1983
+ )
1984
+ end
1985
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1986
+
1987
+ IMPLICIT =
1988
+ T.let(
1989
+ :implicit,
1990
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode::TaggedSymbol
1991
+ )
1992
+ EXPLICIT =
1993
+ T.let(
1994
+ :explicit,
1995
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode::TaggedSymbol
1996
+ )
1997
+
1998
+ sig do
1999
+ override.returns(
2000
+ T::Array[
2001
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Mode::TaggedSymbol
2002
+ ]
2003
+ )
2004
+ end
2005
+ def self.values
2006
+ end
2007
+ end
2008
+
2009
+ # The minimum lifetime applied to every implicit and explicit cache breakpoint
2010
+ # written by the request. Defaults to `30m`, which is currently the only supported
2011
+ # value. The backend may retain cache entries for longer.
2012
+ module Ttl
2013
+ extend OpenAI::Internal::Type::Enum
2014
+
2015
+ TaggedSymbol =
2016
+ T.type_alias do
2017
+ T.all(
2018
+ Symbol,
2019
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl
2020
+ )
2021
+ end
2022
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2023
+
2024
+ TTL_30M =
2025
+ T.let(
2026
+ :"30m",
2027
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol
2028
+ )
2029
+
2030
+ sig do
2031
+ override.returns(
2032
+ T::Array[
2033
+ OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::Ttl::TaggedSymbol
2034
+ ]
2035
+ )
2036
+ end
2037
+ def self.values
2038
+ end
2039
+ end
2040
+ end
2041
+
2042
+ # Deprecated. Use `prompt_cache_options.ttl` instead.
2043
+ #
2044
+ # The retention policy for the prompt cache. Set to `24h` to enable extended
2045
+ # prompt caching, which keeps cached prefixes active for longer, up to a maximum
2046
+ # of 24 hours.
2047
+ # [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
2048
+ # This field expresses a maximum retention policy, while
2049
+ # `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
2050
+ # are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
2051
+ # models, only `24h` is supported.
2052
+ #
2053
+ # For older models that support both `in_memory` and `24h`, the default depends on
2054
+ # your organization's data retention policy:
2055
+ #
2056
+ # - Organizations without ZDR enabled default to `24h`.
2057
+ # - Organizations with ZDR enabled default to `in_memory` when
2058
+ # `prompt_cache_retention` is not specified.
2059
+ module PromptCacheRetention
2060
+ extend OpenAI::Internal::Type::Enum
2061
+
2062
+ TaggedSymbol =
2063
+ T.type_alias do
2064
+ T.all(
2065
+ Symbol,
2066
+ OpenAI::Beta::ResponseCreateParams::PromptCacheRetention
2067
+ )
2068
+ end
2069
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2070
+
2071
+ IN_MEMORY =
2072
+ T.let(
2073
+ :in_memory,
2074
+ OpenAI::Beta::ResponseCreateParams::PromptCacheRetention::TaggedSymbol
2075
+ )
2076
+ PROMPT_CACHE_RETENTION_24H =
2077
+ T.let(
2078
+ :"24h",
2079
+ OpenAI::Beta::ResponseCreateParams::PromptCacheRetention::TaggedSymbol
2080
+ )
2081
+
2082
+ sig do
2083
+ override.returns(
2084
+ T::Array[
2085
+ OpenAI::Beta::ResponseCreateParams::PromptCacheRetention::TaggedSymbol
2086
+ ]
2087
+ )
2088
+ end
2089
+ def self.values
2090
+ end
2091
+ end
2092
+
2093
+ class Reasoning < OpenAI::Internal::Type::BaseModel
2094
+ OrHash =
2095
+ T.type_alias do
2096
+ T.any(
2097
+ OpenAI::Beta::ResponseCreateParams::Reasoning,
2098
+ OpenAI::Internal::AnyHash
2099
+ )
2100
+ end
2101
+
2102
+ # Controls which reasoning items are rendered back to the model on later turns.
2103
+ # When returned on a response, this is the effective reasoning context mode used
2104
+ # for the response.
2105
+ sig do
2106
+ returns(
2107
+ T.nilable(
2108
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context::OrSymbol
2109
+ )
2110
+ )
2111
+ end
2112
+ attr_accessor :context
2113
+
2114
+ # Constrains effort on reasoning for reasoning models. Currently supported values
2115
+ # are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
2116
+ # reasoning effort can result in faster responses and fewer tokens used on
2117
+ # reasoning in a response. Not all reasoning models support every value. See the
2118
+ # [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
2119
+ # model-specific support.
2120
+ sig do
2121
+ returns(
2122
+ T.nilable(
2123
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::OrSymbol
2124
+ )
2125
+ )
2126
+ end
2127
+ attr_accessor :effort
2128
+
2129
+ # **Deprecated:** use `summary` instead.
2130
+ #
2131
+ # A summary of the reasoning performed by the model. This can be useful for
2132
+ # debugging and understanding the model's reasoning process. One of `auto`,
2133
+ # `concise`, or `detailed`.
2134
+ sig do
2135
+ returns(
2136
+ T.nilable(
2137
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary::OrSymbol
2138
+ )
2139
+ )
2140
+ end
2141
+ attr_accessor :generate_summary
2142
+
2143
+ # Controls the reasoning execution mode for the request.
2144
+ #
2145
+ # When returned on a response, this is the effective execution mode.
2146
+ sig do
2147
+ returns(
2148
+ T.nilable(
2149
+ T.any(
2150
+ String,
2151
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::OrSymbol
2152
+ )
2153
+ )
2154
+ )
2155
+ end
2156
+ attr_reader :mode
2157
+
2158
+ sig do
2159
+ params(
2160
+ mode:
2161
+ T.any(
2162
+ String,
2163
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::OrSymbol
2164
+ )
2165
+ ).void
2166
+ end
2167
+ attr_writer :mode
2168
+
2169
+ # A summary of the reasoning performed by the model. This can be useful for
2170
+ # debugging and understanding the model's reasoning process. One of `auto`,
2171
+ # `concise`, or `detailed`.
2172
+ #
2173
+ # `concise` is supported for `computer-use-preview` models and all reasoning
2174
+ # models after `gpt-5`.
2175
+ sig do
2176
+ returns(
2177
+ T.nilable(
2178
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::OrSymbol
2179
+ )
2180
+ )
2181
+ end
2182
+ attr_accessor :summary
2183
+
2184
+ # **gpt-5 and o-series models only**
2185
+ #
2186
+ # Configuration options for
2187
+ # [reasoning models](https://platform.openai.com/docs/guides/reasoning).
2188
+ sig do
2189
+ params(
2190
+ context:
2191
+ T.nilable(
2192
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context::OrSymbol
2193
+ ),
2194
+ effort:
2195
+ T.nilable(
2196
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::OrSymbol
2197
+ ),
2198
+ generate_summary:
2199
+ T.nilable(
2200
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary::OrSymbol
2201
+ ),
2202
+ mode:
2203
+ T.any(
2204
+ String,
2205
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::OrSymbol
2206
+ ),
2207
+ summary:
2208
+ T.nilable(
2209
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::OrSymbol
2210
+ )
2211
+ ).returns(T.attached_class)
2212
+ end
2213
+ def self.new(
2214
+ # Controls which reasoning items are rendered back to the model on later turns.
2215
+ # When returned on a response, this is the effective reasoning context mode used
2216
+ # for the response.
2217
+ context: nil,
2218
+ # Constrains effort on reasoning for reasoning models. Currently supported values
2219
+ # are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
2220
+ # reasoning effort can result in faster responses and fewer tokens used on
2221
+ # reasoning in a response. Not all reasoning models support every value. See the
2222
+ # [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
2223
+ # model-specific support.
2224
+ effort: nil,
2225
+ # **Deprecated:** use `summary` instead.
2226
+ #
2227
+ # A summary of the reasoning performed by the model. This can be useful for
2228
+ # debugging and understanding the model's reasoning process. One of `auto`,
2229
+ # `concise`, or `detailed`.
2230
+ generate_summary: nil,
2231
+ # Controls the reasoning execution mode for the request.
2232
+ #
2233
+ # When returned on a response, this is the effective execution mode.
2234
+ mode: nil,
2235
+ # A summary of the reasoning performed by the model. This can be useful for
2236
+ # debugging and understanding the model's reasoning process. One of `auto`,
2237
+ # `concise`, or `detailed`.
2238
+ #
2239
+ # `concise` is supported for `computer-use-preview` models and all reasoning
2240
+ # models after `gpt-5`.
2241
+ summary: nil
2242
+ )
2243
+ end
2244
+
2245
+ sig do
2246
+ override.returns(
2247
+ {
2248
+ context:
2249
+ T.nilable(
2250
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context::OrSymbol
2251
+ ),
2252
+ effort:
2253
+ T.nilable(
2254
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::OrSymbol
2255
+ ),
2256
+ generate_summary:
2257
+ T.nilable(
2258
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary::OrSymbol
2259
+ ),
2260
+ mode:
2261
+ T.any(
2262
+ String,
2263
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::OrSymbol
2264
+ ),
2265
+ summary:
2266
+ T.nilable(
2267
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::OrSymbol
2268
+ )
2269
+ }
2270
+ )
2271
+ end
2272
+ def to_hash
2273
+ end
2274
+
2275
+ # Controls which reasoning items are rendered back to the model on later turns.
2276
+ # When returned on a response, this is the effective reasoning context mode used
2277
+ # for the response.
2278
+ module Context
2279
+ extend OpenAI::Internal::Type::Enum
2280
+
2281
+ TaggedSymbol =
2282
+ T.type_alias do
2283
+ T.all(
2284
+ Symbol,
2285
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context
2286
+ )
2287
+ end
2288
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2289
+
2290
+ AUTO =
2291
+ T.let(
2292
+ :auto,
2293
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context::TaggedSymbol
2294
+ )
2295
+ CURRENT_TURN =
2296
+ T.let(
2297
+ :current_turn,
2298
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context::TaggedSymbol
2299
+ )
2300
+ ALL_TURNS =
2301
+ T.let(
2302
+ :all_turns,
2303
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context::TaggedSymbol
2304
+ )
2305
+
2306
+ sig do
2307
+ override.returns(
2308
+ T::Array[
2309
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Context::TaggedSymbol
2310
+ ]
2311
+ )
2312
+ end
2313
+ def self.values
2314
+ end
2315
+ end
2316
+
2317
+ # Constrains effort on reasoning for reasoning models. Currently supported values
2318
+ # are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
2319
+ # reasoning effort can result in faster responses and fewer tokens used on
2320
+ # reasoning in a response. Not all reasoning models support every value. See the
2321
+ # [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
2322
+ # model-specific support.
2323
+ module Effort
2324
+ extend OpenAI::Internal::Type::Enum
2325
+
2326
+ TaggedSymbol =
2327
+ T.type_alias do
2328
+ T.all(
2329
+ Symbol,
2330
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort
2331
+ )
2332
+ end
2333
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2334
+
2335
+ NONE =
2336
+ T.let(
2337
+ :none,
2338
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2339
+ )
2340
+ MINIMAL =
2341
+ T.let(
2342
+ :minimal,
2343
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2344
+ )
2345
+ LOW =
2346
+ T.let(
2347
+ :low,
2348
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2349
+ )
2350
+ MEDIUM =
2351
+ T.let(
2352
+ :medium,
2353
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2354
+ )
2355
+ HIGH =
2356
+ T.let(
2357
+ :high,
2358
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2359
+ )
2360
+ XHIGH =
2361
+ T.let(
2362
+ :xhigh,
2363
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2364
+ )
2365
+ MAX =
2366
+ T.let(
2367
+ :max,
2368
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2369
+ )
2370
+
2371
+ sig do
2372
+ override.returns(
2373
+ T::Array[
2374
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Effort::TaggedSymbol
2375
+ ]
2376
+ )
2377
+ end
2378
+ def self.values
2379
+ end
2380
+ end
2381
+
2382
+ # **Deprecated:** use `summary` instead.
2383
+ #
2384
+ # A summary of the reasoning performed by the model. This can be useful for
2385
+ # debugging and understanding the model's reasoning process. One of `auto`,
2386
+ # `concise`, or `detailed`.
2387
+ module GenerateSummary
2388
+ extend OpenAI::Internal::Type::Enum
2389
+
2390
+ TaggedSymbol =
2391
+ T.type_alias do
2392
+ T.all(
2393
+ Symbol,
2394
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary
2395
+ )
2396
+ end
2397
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2398
+
2399
+ AUTO =
2400
+ T.let(
2401
+ :auto,
2402
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary::TaggedSymbol
2403
+ )
2404
+ CONCISE =
2405
+ T.let(
2406
+ :concise,
2407
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary::TaggedSymbol
2408
+ )
2409
+ DETAILED =
2410
+ T.let(
2411
+ :detailed,
2412
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary::TaggedSymbol
2413
+ )
2414
+
2415
+ sig do
2416
+ override.returns(
2417
+ T::Array[
2418
+ OpenAI::Beta::ResponseCreateParams::Reasoning::GenerateSummary::TaggedSymbol
2419
+ ]
2420
+ )
2421
+ end
2422
+ def self.values
2423
+ end
2424
+ end
2425
+
2426
+ # Controls the reasoning execution mode for the request.
2427
+ #
2428
+ # When returned on a response, this is the effective execution mode.
2429
+ module Mode
2430
+ extend OpenAI::Internal::Type::Union
2431
+
2432
+ Variants =
2433
+ T.type_alias do
2434
+ T.any(
2435
+ String,
2436
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::TaggedSymbol
2437
+ )
2438
+ end
2439
+
2440
+ sig do
2441
+ override.returns(
2442
+ T::Array[
2443
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::Variants
2444
+ ]
2445
+ )
2446
+ end
2447
+ def self.variants
2448
+ end
2449
+
2450
+ TaggedSymbol =
2451
+ T.type_alias do
2452
+ T.all(
2453
+ Symbol,
2454
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode
2455
+ )
2456
+ end
2457
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2458
+
2459
+ STANDARD =
2460
+ T.let(
2461
+ :standard,
2462
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::TaggedSymbol
2463
+ )
2464
+ PRO =
2465
+ T.let(
2466
+ :pro,
2467
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Mode::TaggedSymbol
2468
+ )
2469
+ end
2470
+
2471
+ # A summary of the reasoning performed by the model. This can be useful for
2472
+ # debugging and understanding the model's reasoning process. One of `auto`,
2473
+ # `concise`, or `detailed`.
2474
+ #
2475
+ # `concise` is supported for `computer-use-preview` models and all reasoning
2476
+ # models after `gpt-5`.
2477
+ module Summary
2478
+ extend OpenAI::Internal::Type::Enum
2479
+
2480
+ TaggedSymbol =
2481
+ T.type_alias do
2482
+ T.all(
2483
+ Symbol,
2484
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary
2485
+ )
2486
+ end
2487
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2488
+
2489
+ AUTO =
2490
+ T.let(
2491
+ :auto,
2492
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::TaggedSymbol
2493
+ )
2494
+ CONCISE =
2495
+ T.let(
2496
+ :concise,
2497
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::TaggedSymbol
2498
+ )
2499
+ DETAILED =
2500
+ T.let(
2501
+ :detailed,
2502
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::TaggedSymbol
2503
+ )
2504
+
2505
+ sig do
2506
+ override.returns(
2507
+ T::Array[
2508
+ OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::TaggedSymbol
2509
+ ]
2510
+ )
2511
+ end
2512
+ def self.values
2513
+ end
2514
+ end
2515
+ end
2516
+
2517
+ # Specifies the processing type used for serving the request.
2518
+ #
2519
+ # - If set to 'auto', then the request will be processed with the service tier
2520
+ # configured in the Project settings. Unless otherwise configured, the Project
2521
+ # will use 'default'.
2522
+ # - If set to 'default', then the request will be processed with the standard
2523
+ # pricing and performance for the selected model.
2524
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
2525
+ # '[priority](https://openai.com/api-priority-processing/)', then the request
2526
+ # will be processed with the corresponding service tier.
2527
+ # - When not set, the default behavior is 'auto'.
2528
+ #
2529
+ # When the `service_tier` parameter is set, the response body will include the
2530
+ # `service_tier` value based on the processing mode actually used to serve the
2531
+ # request. This response value may be different from the value set in the
2532
+ # parameter.
2533
+ module ServiceTier
2534
+ extend OpenAI::Internal::Type::Enum
2535
+
2536
+ TaggedSymbol =
2537
+ T.type_alias do
2538
+ T.all(Symbol, OpenAI::Beta::ResponseCreateParams::ServiceTier)
2539
+ end
2540
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2541
+
2542
+ AUTO =
2543
+ T.let(
2544
+ :auto,
2545
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::TaggedSymbol
2546
+ )
2547
+ DEFAULT =
2548
+ T.let(
2549
+ :default,
2550
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::TaggedSymbol
2551
+ )
2552
+ FLEX =
2553
+ T.let(
2554
+ :flex,
2555
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::TaggedSymbol
2556
+ )
2557
+ SCALE =
2558
+ T.let(
2559
+ :scale,
2560
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::TaggedSymbol
2561
+ )
2562
+ PRIORITY =
2563
+ T.let(
2564
+ :priority,
2565
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::TaggedSymbol
2566
+ )
2567
+
2568
+ sig do
2569
+ override.returns(
2570
+ T::Array[
2571
+ OpenAI::Beta::ResponseCreateParams::ServiceTier::TaggedSymbol
2572
+ ]
2573
+ )
2574
+ end
2575
+ def self.values
2576
+ end
2577
+ end
2578
+
2579
+ class StreamOptions < OpenAI::Internal::Type::BaseModel
2580
+ OrHash =
2581
+ T.type_alias do
2582
+ T.any(
2583
+ OpenAI::Beta::ResponseCreateParams::StreamOptions,
2584
+ OpenAI::Internal::AnyHash
2585
+ )
2586
+ end
2587
+
2588
+ # When true, stream obfuscation will be enabled. Stream obfuscation adds random
2589
+ # characters to an `obfuscation` field on streaming delta events to normalize
2590
+ # payload sizes as a mitigation to certain side-channel attacks. These obfuscation
2591
+ # fields are included by default, but add a small amount of overhead to the data
2592
+ # stream. You can set `include_obfuscation` to false to optimize for bandwidth if
2593
+ # you trust the network links between your application and the OpenAI API.
2594
+ sig { returns(T.nilable(T::Boolean)) }
2595
+ attr_reader :include_obfuscation
2596
+
2597
+ sig { params(include_obfuscation: T::Boolean).void }
2598
+ attr_writer :include_obfuscation
2599
+
2600
+ # Options for streaming responses. Only set this when you set `stream: true`.
2601
+ sig do
2602
+ params(include_obfuscation: T::Boolean).returns(T.attached_class)
2603
+ end
2604
+ def self.new(
2605
+ # When true, stream obfuscation will be enabled. Stream obfuscation adds random
2606
+ # characters to an `obfuscation` field on streaming delta events to normalize
2607
+ # payload sizes as a mitigation to certain side-channel attacks. These obfuscation
2608
+ # fields are included by default, but add a small amount of overhead to the data
2609
+ # stream. You can set `include_obfuscation` to false to optimize for bandwidth if
2610
+ # you trust the network links between your application and the OpenAI API.
2611
+ include_obfuscation: nil
2612
+ )
2613
+ end
2614
+
2615
+ sig { override.returns({ include_obfuscation: T::Boolean }) }
2616
+ def to_hash
2617
+ end
2618
+ end
2619
+
2620
+ # How the model should select which tool (or tools) to use when generating a
2621
+ # response. See the `tools` parameter to see how to specify which tools the model
2622
+ # can call.
2623
+ module ToolChoice
2624
+ extend OpenAI::Internal::Type::Union
2625
+
2626
+ Variants =
2627
+ T.type_alias do
2628
+ T.any(
2629
+ OpenAI::Beta::BetaToolChoiceOptions::TaggedSymbol,
2630
+ OpenAI::Beta::BetaToolChoiceAllowed,
2631
+ OpenAI::Beta::BetaToolChoiceTypes,
2632
+ OpenAI::Beta::BetaToolChoiceFunction,
2633
+ OpenAI::Beta::BetaToolChoiceMcp,
2634
+ OpenAI::Beta::BetaToolChoiceCustom,
2635
+ OpenAI::Beta::ResponseCreateParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam,
2636
+ OpenAI::Beta::BetaToolChoiceApplyPatch,
2637
+ OpenAI::Beta::BetaToolChoiceShell
2638
+ )
2639
+ end
2640
+
2641
+ class BetaSpecificProgrammaticToolCallingParam < OpenAI::Internal::Type::BaseModel
2642
+ OrHash =
2643
+ T.type_alias do
2644
+ T.any(
2645
+ OpenAI::Beta::ResponseCreateParams::ToolChoice::BetaSpecificProgrammaticToolCallingParam,
2646
+ OpenAI::Internal::AnyHash
2647
+ )
2648
+ end
2649
+
2650
+ # The tool to call. Always `programmatic_tool_calling`.
2651
+ sig { returns(Symbol) }
2652
+ attr_accessor :type
2653
+
2654
+ sig { params(type: Symbol).returns(T.attached_class) }
2655
+ def self.new(
2656
+ # The tool to call. Always `programmatic_tool_calling`.
2657
+ type: :programmatic_tool_calling
2658
+ )
2659
+ end
2660
+
2661
+ sig { override.returns({ type: Symbol }) }
2662
+ def to_hash
2663
+ end
2664
+ end
2665
+
2666
+ sig do
2667
+ override.returns(
2668
+ T::Array[OpenAI::Beta::ResponseCreateParams::ToolChoice::Variants]
2669
+ )
2670
+ end
2671
+ def self.variants
2672
+ end
2673
+ end
2674
+
2675
+ # The truncation strategy to use for the model response.
2676
+ #
2677
+ # - `auto`: If the input to this Response exceeds the model's context window size,
2678
+ # the model will truncate the response to fit the context window by dropping
2679
+ # items from the beginning of the conversation.
2680
+ # - `disabled` (default): If the input size will exceed the context window size
2681
+ # for a model, the request will fail with a 400 error.
2682
+ module Truncation
2683
+ extend OpenAI::Internal::Type::Enum
2684
+
2685
+ TaggedSymbol =
2686
+ T.type_alias do
2687
+ T.all(Symbol, OpenAI::Beta::ResponseCreateParams::Truncation)
2688
+ end
2689
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2690
+
2691
+ AUTO =
2692
+ T.let(
2693
+ :auto,
2694
+ OpenAI::Beta::ResponseCreateParams::Truncation::TaggedSymbol
2695
+ )
2696
+ DISABLED =
2697
+ T.let(
2698
+ :disabled,
2699
+ OpenAI::Beta::ResponseCreateParams::Truncation::TaggedSymbol
2700
+ )
2701
+
2702
+ sig do
2703
+ override.returns(
2704
+ T::Array[
2705
+ OpenAI::Beta::ResponseCreateParams::Truncation::TaggedSymbol
2706
+ ]
2707
+ )
2708
+ end
2709
+ def self.values
2710
+ end
2711
+ end
2712
+
2713
+ module Beta
2714
+ extend OpenAI::Internal::Type::Enum
2715
+
2716
+ TaggedSymbol =
2717
+ T.type_alias do
2718
+ T.all(Symbol, OpenAI::Beta::ResponseCreateParams::Beta)
2719
+ end
2720
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2721
+
2722
+ RESPONSES_MULTI_AGENT_V1 =
2723
+ T.let(
2724
+ :"responses_multi_agent=v1",
2725
+ OpenAI::Beta::ResponseCreateParams::Beta::TaggedSymbol
2726
+ )
2727
+
2728
+ sig do
2729
+ override.returns(
2730
+ T::Array[OpenAI::Beta::ResponseCreateParams::Beta::TaggedSymbol]
2731
+ )
2732
+ end
2733
+ def self.values
2734
+ end
2735
+ end
2736
+ end
2737
+ end
2738
+ end
2739
+ end