openai 0.130.0 → 1.1.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 (446) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -0
  3. data/README.md +39 -3
  4. data/lib/openai/client.rb +0 -4
  5. data/lib/openai/helpers/agents/session_stream.rb +5 -0
  6. data/lib/openai/helpers/beta/agents/result.rb +8 -0
  7. data/lib/openai/internal/type/union.rb +5 -1
  8. data/lib/openai/models/batch_create_params.rb +6 -19
  9. data/lib/openai/models/beta/agent_session.rb +40 -1
  10. data/lib/openai/models/beta/agent_session_budget_reached_event.rb +48 -0
  11. data/lib/openai/models/beta/agent_session_event.rb +4 -1
  12. data/lib/openai/models/beta/agents/session_create_params.rb +33 -1
  13. data/lib/openai/models/beta/agents/session_update_params.rb +33 -1
  14. data/lib/openai/models/beta/beta_compacted_response.rb +3 -3
  15. data/lib/openai/models/beta/beta_response.rb +0 -18
  16. data/lib/openai/models/beta/beta_responses_client_event.rb +0 -26
  17. data/lib/openai/models/beta/response_compact_params.rb +0 -18
  18. data/lib/openai/models/beta/response_create_params.rb +0 -18
  19. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  20. data/lib/openai/models/chat/completion_create_params.rb +8 -6
  21. data/lib/openai/models/chat_model.rb +0 -12
  22. data/lib/openai/models/completion_create_params.rb +4 -2
  23. data/lib/openai/models/graders/multi_grader.rb +11 -15
  24. data/lib/openai/models/image_edit_completed_event.rb +9 -17
  25. data/lib/openai/models/image_edit_partial_image_event.rb +9 -17
  26. data/lib/openai/models/image_gen_completed_event.rb +9 -17
  27. data/lib/openai/models/image_gen_partial_image_event.rb +9 -17
  28. data/lib/openai/models/images_response.rb +8 -14
  29. data/lib/openai/models/live/responses_delegation_config.rb +47 -21
  30. data/lib/openai/models/live/responses_delegation_update_config.rb +47 -21
  31. data/lib/openai/models/responses/compacted_response.rb +3 -3
  32. data/lib/openai/models/responses/response_compact_params.rb +0 -18
  33. data/lib/openai/models.rb +0 -32
  34. data/lib/openai/providers/vertex.rb +9 -6
  35. data/lib/openai/resources/batches.rb +2 -6
  36. data/lib/openai/resources/beta/agents/sessions/events.rb +1 -1
  37. data/lib/openai/resources/beta/agents/sessions.rb +15 -3
  38. data/lib/openai/resources/beta.rb +0 -10
  39. data/lib/openai/resources/chat/completions.rb +8 -6
  40. data/lib/openai/resources/completions.rb +4 -2
  41. data/lib/openai/version.rb +1 -1
  42. data/lib/openai.rb +1 -114
  43. data/rbi/openai/client.rbi +0 -3
  44. data/rbi/openai/models/batch_create_params.rbi +6 -19
  45. data/rbi/openai/models/beta/agent_session.rbi +66 -0
  46. data/rbi/openai/models/beta/agent_session_budget_reached_event.rbi +83 -0
  47. data/rbi/openai/models/beta/agent_session_event.rbi +1 -0
  48. data/rbi/openai/models/beta/agents/session_create_params.rbi +56 -0
  49. data/rbi/openai/models/beta/agents/session_update_params.rbi +56 -0
  50. data/rbi/openai/models/beta/beta_compacted_response.rbi +22 -20
  51. data/rbi/openai/models/beta/beta_response.rbi +0 -3
  52. data/rbi/openai/models/beta/beta_responses_client_event.rbi +0 -12
  53. data/rbi/openai/models/beta/response_compact_params.rbi +0 -9
  54. data/rbi/openai/models/beta/response_create_params.rbi +0 -6
  55. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  56. data/rbi/openai/models/chat/completion_create_params.rbi +8 -6
  57. data/rbi/openai/models/chat_model.rbi +0 -3
  58. data/rbi/openai/models/completion_create_params.rbi +4 -2
  59. data/rbi/openai/models/graders/multi_grader.rbi +32 -27
  60. data/rbi/openai/models/image_edit_completed_event.rbi +11 -8
  61. data/rbi/openai/models/image_edit_partial_image_event.rbi +11 -8
  62. data/rbi/openai/models/image_gen_completed_event.rbi +11 -8
  63. data/rbi/openai/models/image_gen_partial_image_event.rbi +11 -8
  64. data/rbi/openai/models/images_response.rbi +6 -6
  65. data/rbi/openai/models/live/responses_delegation_config.rbi +54 -30
  66. data/rbi/openai/models/live/responses_delegation_update_config.rbi +54 -30
  67. data/rbi/openai/models/responses/compacted_response.rbi +19 -17
  68. data/rbi/openai/models/responses/response_compact_params.rbi +0 -12
  69. data/rbi/openai/models.rbi +0 -32
  70. data/rbi/openai/resources/batches.rbi +2 -6
  71. data/rbi/openai/resources/beta/agents/sessions.rbi +12 -0
  72. data/rbi/openai/resources/beta.rbi +0 -8
  73. data/rbi/openai/resources/chat/completions.rbi +8 -6
  74. data/rbi/openai/resources/completions.rbi +4 -2
  75. data/sig/openai/client.rbs +0 -2
  76. data/sig/openai/models/batch_create_params.rbs +4 -14
  77. data/sig/openai/models/beta/agent_session.rbs +33 -1
  78. data/sig/openai/models/beta/agent_session_budget_reached_event.rbs +52 -0
  79. data/sig/openai/models/beta/agent_session_event.rbs +1 -0
  80. data/sig/openai/models/beta/agents/session_create_params.rbs +23 -0
  81. data/sig/openai/models/beta/agents/session_update_params.rbs +23 -0
  82. data/sig/openai/models/beta/beta_compacted_response.rbs +4 -4
  83. data/sig/openai/models/beta/beta_response.rbs +0 -6
  84. data/sig/openai/models/beta/beta_responses_client_event.rbs +0 -6
  85. data/sig/openai/models/beta/response_compact_params.rbs +0 -6
  86. data/sig/openai/models/beta/response_create_params.rbs +0 -6
  87. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  88. data/sig/openai/models/chat/completion_create_params.rbs +8 -6
  89. data/sig/openai/models/chat_model.rbs +0 -6
  90. data/sig/openai/models/completion_create_params.rbs +4 -2
  91. data/sig/openai/models/graders/multi_grader.rbs +7 -12
  92. data/sig/openai/models/image_edit_completed_event.rbs +11 -9
  93. data/sig/openai/models/image_edit_partial_image_event.rbs +11 -9
  94. data/sig/openai/models/image_gen_completed_event.rbs +11 -9
  95. data/sig/openai/models/image_gen_partial_image_event.rbs +11 -9
  96. data/sig/openai/models/images_response.rbs +5 -7
  97. data/sig/openai/models/live/responses_delegation_config.rbs +50 -18
  98. data/sig/openai/models/live/responses_delegation_update_config.rbs +50 -18
  99. data/sig/openai/models/responses/compacted_response.rbs +4 -4
  100. data/sig/openai/models/responses/response_compact_params.rbs +0 -6
  101. data/sig/openai/models.rbs +0 -32
  102. data/sig/openai/resources/beta/agents/sessions.rbs +3 -0
  103. data/sig/openai/resources/beta.rbs +0 -4
  104. metadata +4 -343
  105. data/lib/openai/models/beta/assistant.rb +0 -270
  106. data/lib/openai/models/beta/assistant_create_params.rb +0 -448
  107. data/lib/openai/models/beta/assistant_delete_params.rb +0 -22
  108. data/lib/openai/models/beta/assistant_deleted.rb +0 -30
  109. data/lib/openai/models/beta/assistant_list_params.rb +0 -80
  110. data/lib/openai/models/beta/assistant_response_format_option.rb +0 -50
  111. data/lib/openai/models/beta/assistant_retrieve_params.rb +0 -22
  112. data/lib/openai/models/beta/assistant_stream_event.rb +0 -688
  113. data/lib/openai/models/beta/assistant_tool.rb +0 -22
  114. data/lib/openai/models/beta/assistant_tool_choice.rb +0 -43
  115. data/lib/openai/models/beta/assistant_tool_choice_function.rb +0 -19
  116. data/lib/openai/models/beta/assistant_tool_choice_option.rb +0 -42
  117. data/lib/openai/models/beta/assistant_update_params.rb +0 -450
  118. data/lib/openai/models/beta/code_interpreter_tool.rb +0 -19
  119. data/lib/openai/models/beta/file_search_tool.rb +0 -123
  120. data/lib/openai/models/beta/function_tool.rb +0 -26
  121. data/lib/openai/models/beta/message_stream_event.rb +0 -159
  122. data/lib/openai/models/beta/run_step_stream_event.rb +0 -201
  123. data/lib/openai/models/beta/run_stream_event.rb +0 -288
  124. data/lib/openai/models/beta/thread.rb +0 -133
  125. data/lib/openai/models/beta/thread_create_and_run_params.rb +0 -857
  126. data/lib/openai/models/beta/thread_create_params.rb +0 -443
  127. data/lib/openai/models/beta/thread_delete_params.rb +0 -22
  128. data/lib/openai/models/beta/thread_deleted.rb +0 -30
  129. data/lib/openai/models/beta/thread_retrieve_params.rb +0 -22
  130. data/lib/openai/models/beta/thread_stream_event.rb +0 -41
  131. data/lib/openai/models/beta/thread_update_params.rb +0 -114
  132. data/lib/openai/models/beta/threads/annotation.rb +0 -27
  133. data/lib/openai/models/beta/threads/annotation_delta.rb +0 -27
  134. data/lib/openai/models/beta/threads/file_citation_annotation.rb +0 -68
  135. data/lib/openai/models/beta/threads/file_citation_delta_annotation.rb +0 -86
  136. data/lib/openai/models/beta/threads/file_path_annotation.rb +0 -67
  137. data/lib/openai/models/beta/threads/file_path_delta_annotation.rb +0 -76
  138. data/lib/openai/models/beta/threads/image_file.rb +0 -51
  139. data/lib/openai/models/beta/threads/image_file_content_block.rb +0 -32
  140. data/lib/openai/models/beta/threads/image_file_delta.rb +0 -51
  141. data/lib/openai/models/beta/threads/image_file_delta_block.rb +0 -41
  142. data/lib/openai/models/beta/threads/image_url.rb +0 -49
  143. data/lib/openai/models/beta/threads/image_url_content_block.rb +0 -30
  144. data/lib/openai/models/beta/threads/image_url_delta.rb +0 -49
  145. data/lib/openai/models/beta/threads/image_url_delta_block.rb +0 -39
  146. data/lib/openai/models/beta/threads/message.rb +0 -272
  147. data/lib/openai/models/beta/threads/message_content.rb +0 -33
  148. data/lib/openai/models/beta/threads/message_content_delta.rb +0 -33
  149. data/lib/openai/models/beta/threads/message_content_part_param.rb +0 -30
  150. data/lib/openai/models/beta/threads/message_create_params.rb +0 -172
  151. data/lib/openai/models/beta/threads/message_delete_params.rb +0 -30
  152. data/lib/openai/models/beta/threads/message_deleted.rb +0 -32
  153. data/lib/openai/models/beta/threads/message_delta.rb +0 -48
  154. data/lib/openai/models/beta/threads/message_delta_event.rb +0 -42
  155. data/lib/openai/models/beta/threads/message_list_params.rb +0 -98
  156. data/lib/openai/models/beta/threads/message_retrieve_params.rb +0 -30
  157. data/lib/openai/models/beta/threads/message_update_params.rb +0 -51
  158. data/lib/openai/models/beta/threads/refusal_content_block.rb +0 -30
  159. data/lib/openai/models/beta/threads/refusal_delta_block.rb +0 -39
  160. data/lib/openai/models/beta/threads/required_action_function_tool_call.rb +0 -73
  161. data/lib/openai/models/beta/threads/run.rb +0 -557
  162. data/lib/openai/models/beta/threads/run_cancel_params.rb +0 -30
  163. data/lib/openai/models/beta/threads/run_create_params.rb +0 -565
  164. data/lib/openai/models/beta/threads/run_list_params.rb +0 -89
  165. data/lib/openai/models/beta/threads/run_retrieve_params.rb +0 -30
  166. data/lib/openai/models/beta/threads/run_status.rb +0 -29
  167. data/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb +0 -69
  168. data/lib/openai/models/beta/threads/run_update_params.rb +0 -51
  169. data/lib/openai/models/beta/threads/runs/code_interpreter_logs.rb +0 -43
  170. data/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rb +0 -54
  171. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb +0 -161
  172. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb +0 -107
  173. data/lib/openai/models/beta/threads/runs/file_search_tool_call.rb +0 -207
  174. data/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rb +0 -52
  175. data/lib/openai/models/beta/threads/runs/function_tool_call.rb +0 -78
  176. data/lib/openai/models/beta/threads/runs/function_tool_call_delta.rb +0 -87
  177. data/lib/openai/models/beta/threads/runs/message_creation_step_details.rb +0 -48
  178. data/lib/openai/models/beta/threads/runs/run_step.rb +0 -311
  179. data/lib/openai/models/beta/threads/runs/run_step_delta.rb +0 -45
  180. data/lib/openai/models/beta/threads/runs/run_step_delta_event.rb +0 -46
  181. data/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb +0 -47
  182. data/lib/openai/models/beta/threads/runs/run_step_include.rb +0 -22
  183. data/lib/openai/models/beta/threads/runs/step_list_params.rb +0 -122
  184. data/lib/openai/models/beta/threads/runs/step_retrieve_params.rb +0 -65
  185. data/lib/openai/models/beta/threads/runs/tool_call.rb +0 -28
  186. data/lib/openai/models/beta/threads/runs/tool_call_delta.rb +0 -28
  187. data/lib/openai/models/beta/threads/runs/tool_call_delta_object.rb +0 -41
  188. data/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb +0 -38
  189. data/lib/openai/models/beta/threads/text.rb +0 -28
  190. data/lib/openai/models/beta/threads/text_content_block.rb +0 -30
  191. data/lib/openai/models/beta/threads/text_content_block_param.rb +0 -32
  192. data/lib/openai/models/beta/threads/text_delta.rb +0 -31
  193. data/lib/openai/models/beta/threads/text_delta_block.rb +0 -39
  194. data/lib/openai/models/image_input_reference_param.rb +0 -24
  195. data/lib/openai/models/video.rb +0 -161
  196. data/lib/openai/models/video_create_character_params.rb +0 -40
  197. data/lib/openai/models/video_create_character_response.rb +0 -36
  198. data/lib/openai/models/video_create_error.rb +0 -166
  199. data/lib/openai/models/video_create_params.rb +0 -85
  200. data/lib/openai/models/video_delete_params.rb +0 -20
  201. data/lib/openai/models/video_delete_response.rb +0 -38
  202. data/lib/openai/models/video_download_content_params.rb +0 -42
  203. data/lib/openai/models/video_edit_params.rb +0 -68
  204. data/lib/openai/models/video_extend_params.rb +0 -79
  205. data/lib/openai/models/video_get_character_params.rb +0 -20
  206. data/lib/openai/models/video_get_character_response.rb +0 -36
  207. data/lib/openai/models/video_list_params.rb +0 -55
  208. data/lib/openai/models/video_model.rb +0 -38
  209. data/lib/openai/models/video_remix_params.rb +0 -30
  210. data/lib/openai/models/video_retrieve_params.rb +0 -20
  211. data/lib/openai/models/video_seconds.rb +0 -16
  212. data/lib/openai/models/video_size.rb +0 -17
  213. data/lib/openai/resources/beta/assistants.rb +0 -320
  214. data/lib/openai/resources/beta/threads/messages.rb +0 -236
  215. data/lib/openai/resources/beta/threads/runs/steps.rb +0 -141
  216. data/lib/openai/resources/beta/threads/runs.rb +0 -623
  217. data/lib/openai/resources/beta/threads.rb +0 -444
  218. data/lib/openai/resources/videos.rb +0 -354
  219. data/rbi/openai/models/beta/assistant.rbi +0 -411
  220. data/rbi/openai/models/beta/assistant_create_params.rbi +0 -776
  221. data/rbi/openai/models/beta/assistant_delete_params.rbi +0 -53
  222. data/rbi/openai/models/beta/assistant_deleted.rbi +0 -60
  223. data/rbi/openai/models/beta/assistant_list_params.rbi +0 -132
  224. data/rbi/openai/models/beta/assistant_response_format_option.rbi +0 -49
  225. data/rbi/openai/models/beta/assistant_retrieve_params.rbi +0 -53
  226. data/rbi/openai/models/beta/assistant_stream_event.rbi +0 -1277
  227. data/rbi/openai/models/beta/assistant_tool.rbi +0 -28
  228. data/rbi/openai/models/beta/assistant_tool_choice.rbi +0 -79
  229. data/rbi/openai/models/beta/assistant_tool_choice_function.rbi +0 -49
  230. data/rbi/openai/models/beta/assistant_tool_choice_option.rbi +0 -53
  231. data/rbi/openai/models/beta/assistant_update_params.rbi +0 -556
  232. data/rbi/openai/models/beta/code_interpreter_tool.rbi +0 -49
  233. data/rbi/openai/models/beta/file_search_tool.rbi +0 -223
  234. data/rbi/openai/models/beta/function_tool.rbi +0 -59
  235. data/rbi/openai/models/beta/message_stream_event.rbi +0 -288
  236. data/rbi/openai/models/beta/run_step_stream_event.rbi +0 -378
  237. data/rbi/openai/models/beta/run_stream_event.rbi +0 -537
  238. data/rbi/openai/models/beta/thread.rbi +0 -255
  239. data/rbi/openai/models/beta/thread_create_and_run_params.rbi +0 -1461
  240. data/rbi/openai/models/beta/thread_create_params.rbi +0 -823
  241. data/rbi/openai/models/beta/thread_delete_params.rbi +0 -53
  242. data/rbi/openai/models/beta/thread_deleted.rbi +0 -60
  243. data/rbi/openai/models/beta/thread_retrieve_params.rbi +0 -53
  244. data/rbi/openai/models/beta/thread_stream_event.rbi +0 -75
  245. data/rbi/openai/models/beta/thread_update_params.rbi +0 -240
  246. data/rbi/openai/models/beta/threads/annotation.rbi +0 -34
  247. data/rbi/openai/models/beta/threads/annotation_delta.rbi +0 -34
  248. data/rbi/openai/models/beta/threads/file_citation_annotation.rbi +0 -132
  249. data/rbi/openai/models/beta/threads/file_citation_delta_annotation.rbi +0 -166
  250. data/rbi/openai/models/beta/threads/file_path_annotation.rbi +0 -131
  251. data/rbi/openai/models/beta/threads/file_path_delta_annotation.rbi +0 -153
  252. data/rbi/openai/models/beta/threads/image_file.rbi +0 -88
  253. data/rbi/openai/models/beta/threads/image_file_content_block.rbi +0 -66
  254. data/rbi/openai/models/beta/threads/image_file_delta.rbi +0 -91
  255. data/rbi/openai/models/beta/threads/image_file_delta_block.rbi +0 -75
  256. data/rbi/openai/models/beta/threads/image_url.rbi +0 -86
  257. data/rbi/openai/models/beta/threads/image_url_content_block.rbi +0 -64
  258. data/rbi/openai/models/beta/threads/image_url_delta.rbi +0 -89
  259. data/rbi/openai/models/beta/threads/image_url_delta_block.rbi +0 -73
  260. data/rbi/openai/models/beta/threads/message.rbi +0 -433
  261. data/rbi/openai/models/beta/threads/message_content.rbi +0 -36
  262. data/rbi/openai/models/beta/threads/message_content_delta.rbi +0 -36
  263. data/rbi/openai/models/beta/threads/message_content_part_param.rbi +0 -35
  264. data/rbi/openai/models/beta/threads/message_create_params.rbi +0 -299
  265. data/rbi/openai/models/beta/threads/message_delete_params.rbi +0 -64
  266. data/rbi/openai/models/beta/threads/message_deleted.rbi +0 -64
  267. data/rbi/openai/models/beta/threads/message_delta.rbi +0 -106
  268. data/rbi/openai/models/beta/threads/message_delta_event.rbi +0 -76
  269. data/rbi/openai/models/beta/threads/message_list_params.rbi +0 -157
  270. data/rbi/openai/models/beta/threads/message_retrieve_params.rbi +0 -64
  271. data/rbi/openai/models/beta/threads/message_update_params.rbi +0 -88
  272. data/rbi/openai/models/beta/threads/refusal_content_block.rbi +0 -61
  273. data/rbi/openai/models/beta/threads/refusal_delta_block.rbi +0 -73
  274. data/rbi/openai/models/beta/threads/required_action_function_tool_call.rbi +0 -130
  275. data/rbi/openai/models/beta/threads/run.rbi +0 -803
  276. data/rbi/openai/models/beta/threads/run_cancel_params.rbi +0 -64
  277. data/rbi/openai/models/beta/threads/run_create_params.rbi +0 -825
  278. data/rbi/openai/models/beta/threads/run_list_params.rbi +0 -144
  279. data/rbi/openai/models/beta/threads/run_retrieve_params.rbi +0 -64
  280. data/rbi/openai/models/beta/threads/run_status.rbi +0 -39
  281. data/rbi/openai/models/beta/threads/run_submit_tool_outputs_params.rbi +0 -132
  282. data/rbi/openai/models/beta/threads/run_update_params.rbi +0 -88
  283. data/rbi/openai/models/beta/threads/runs/code_interpreter_logs.rbi +0 -79
  284. data/rbi/openai/models/beta/threads/runs/code_interpreter_output_image.rbi +0 -118
  285. data/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi +0 -315
  286. data/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi +0 -210
  287. data/rbi/openai/models/beta/threads/runs/file_search_tool_call.rbi +0 -409
  288. data/rbi/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi +0 -89
  289. data/rbi/openai/models/beta/threads/runs/function_tool_call.rbi +0 -138
  290. data/rbi/openai/models/beta/threads/runs/function_tool_call_delta.rbi +0 -161
  291. data/rbi/openai/models/beta/threads/runs/message_creation_step_details.rbi +0 -111
  292. data/rbi/openai/models/beta/threads/runs/run_step.rbi +0 -422
  293. data/rbi/openai/models/beta/threads/runs/run_step_delta.rbi +0 -91
  294. data/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi +0 -82
  295. data/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi +0 -113
  296. data/rbi/openai/models/beta/threads/runs/run_step_include.rbi +0 -37
  297. data/rbi/openai/models/beta/threads/runs/step_list_params.rbi +0 -181
  298. data/rbi/openai/models/beta/threads/runs/step_retrieve_params.rbi +0 -105
  299. data/rbi/openai/models/beta/threads/runs/tool_call.rbi +0 -37
  300. data/rbi/openai/models/beta/threads/runs/tool_call_delta.rbi +0 -37
  301. data/rbi/openai/models/beta/threads/runs/tool_call_delta_object.rbi +0 -91
  302. data/rbi/openai/models/beta/threads/runs/tool_calls_step_details.rbi +0 -77
  303. data/rbi/openai/models/beta/threads/text.rbi +0 -65
  304. data/rbi/openai/models/beta/threads/text_content_block.rbi +0 -64
  305. data/rbi/openai/models/beta/threads/text_content_block_param.rbi +0 -63
  306. data/rbi/openai/models/beta/threads/text_delta.rbi +0 -81
  307. data/rbi/openai/models/beta/threads/text_delta_block.rbi +0 -73
  308. data/rbi/openai/models/image_input_reference_param.rbi +0 -58
  309. data/rbi/openai/models/video.rbi +0 -203
  310. data/rbi/openai/models/video_create_character_params.rbi +0 -68
  311. data/rbi/openai/models/video_create_character_response.rbi +0 -63
  312. data/rbi/openai/models/video_create_error.rbi +0 -255
  313. data/rbi/openai/models/video_create_params.rbi +0 -132
  314. data/rbi/openai/models/video_delete_params.rbi +0 -49
  315. data/rbi/openai/models/video_delete_response.rbi +0 -64
  316. data/rbi/openai/models/video_download_content_params.rbi +0 -81
  317. data/rbi/openai/models/video_edit_params.rbi +0 -122
  318. data/rbi/openai/models/video_extend_params.rbi +0 -134
  319. data/rbi/openai/models/video_get_character_params.rbi +0 -49
  320. data/rbi/openai/models/video_get_character_response.rbi +0 -63
  321. data/rbi/openai/models/video_list_params.rbi +0 -101
  322. data/rbi/openai/models/video_model.rbi +0 -35
  323. data/rbi/openai/models/video_remix_params.rbi +0 -58
  324. data/rbi/openai/models/video_retrieve_params.rbi +0 -49
  325. data/rbi/openai/models/video_seconds.rbi +0 -22
  326. data/rbi/openai/models/video_size.rbi +0 -23
  327. data/rbi/openai/resources/beta/assistants.rbi +0 -285
  328. data/rbi/openai/resources/beta/threads/messages.rbi +0 -161
  329. data/rbi/openai/resources/beta/threads/runs/steps.rbi +0 -107
  330. data/rbi/openai/resources/beta/threads/runs.rbi +0 -527
  331. data/rbi/openai/resources/beta/threads.rbi +0 -391
  332. data/rbi/openai/resources/videos.rbi +0 -205
  333. data/sig/openai/models/beta/assistant.rbs +0 -278
  334. data/sig/openai/models/beta/assistant_create_params.rbs +0 -485
  335. data/sig/openai/models/beta/assistant_delete_params.rbs +0 -25
  336. data/sig/openai/models/beta/assistant_deleted.rbs +0 -28
  337. data/sig/openai/models/beta/assistant_list_params.rbs +0 -104
  338. data/sig/openai/models/beta/assistant_response_format_option.rbs +0 -17
  339. data/sig/openai/models/beta/assistant_retrieve_params.rbs +0 -25
  340. data/sig/openai/models/beta/assistant_stream_event.rbs +0 -645
  341. data/sig/openai/models/beta/assistant_tool.rbs +0 -16
  342. data/sig/openai/models/beta/assistant_tool_choice.rbs +0 -46
  343. data/sig/openai/models/beta/assistant_tool_choice_function.rbs +0 -18
  344. data/sig/openai/models/beta/assistant_tool_choice_option.rbs +0 -27
  345. data/sig/openai/models/beta/assistant_update_params.rbs +0 -396
  346. data/sig/openai/models/beta/code_interpreter_tool.rbs +0 -18
  347. data/sig/openai/models/beta/file_search_tool.rbs +0 -159
  348. data/sig/openai/models/beta/function_tool.rbs +0 -27
  349. data/sig/openai/models/beta/message_stream_event.rbs +0 -153
  350. data/sig/openai/models/beta/run_step_stream_event.rbs +0 -197
  351. data/sig/openai/models/beta/run_stream_event.rbs +0 -269
  352. data/sig/openai/models/beta/thread.rbs +0 -150
  353. data/sig/openai/models/beta/thread_create_and_run_params.rbs +0 -885
  354. data/sig/openai/models/beta/thread_create_params.rbs +0 -492
  355. data/sig/openai/models/beta/thread_delete_params.rbs +0 -25
  356. data/sig/openai/models/beta/thread_deleted.rbs +0 -28
  357. data/sig/openai/models/beta/thread_retrieve_params.rbs +0 -25
  358. data/sig/openai/models/beta/thread_stream_event.rbs +0 -43
  359. data/sig/openai/models/beta/thread_update_params.rbs +0 -137
  360. data/sig/openai/models/beta/threads/annotation.rbs +0 -17
  361. data/sig/openai/models/beta/threads/annotation_delta.rbs +0 -17
  362. data/sig/openai/models/beta/threads/file_citation_annotation.rbs +0 -63
  363. data/sig/openai/models/beta/threads/file_citation_delta_annotation.rbs +0 -93
  364. data/sig/openai/models/beta/threads/file_path_annotation.rbs +0 -63
  365. data/sig/openai/models/beta/threads/file_path_delta_annotation.rbs +0 -85
  366. data/sig/openai/models/beta/threads/image_file.rbs +0 -59
  367. data/sig/openai/models/beta/threads/image_file_content_block.rbs +0 -29
  368. data/sig/openai/models/beta/threads/image_file_delta.rbs +0 -64
  369. data/sig/openai/models/beta/threads/image_file_delta_block.rbs +0 -44
  370. data/sig/openai/models/beta/threads/image_url.rbs +0 -57
  371. data/sig/openai/models/beta/threads/image_url_content_block.rbs +0 -29
  372. data/sig/openai/models/beta/threads/image_url_delta.rbs +0 -61
  373. data/sig/openai/models/beta/threads/image_url_delta_block.rbs +0 -44
  374. data/sig/openai/models/beta/threads/message.rbs +0 -275
  375. data/sig/openai/models/beta/threads/message_content.rbs +0 -19
  376. data/sig/openai/models/beta/threads/message_content_delta.rbs +0 -19
  377. data/sig/openai/models/beta/threads/message_content_part_param.rbs +0 -18
  378. data/sig/openai/models/beta/threads/message_create_params.rbs +0 -167
  379. data/sig/openai/models/beta/threads/message_delete_params.rbs +0 -35
  380. data/sig/openai/models/beta/threads/message_deleted.rbs +0 -30
  381. data/sig/openai/models/beta/threads/message_delta.rbs +0 -56
  382. data/sig/openai/models/beta/threads/message_delta_event.rbs +0 -43
  383. data/sig/openai/models/beta/threads/message_list_params.rbs +0 -122
  384. data/sig/openai/models/beta/threads/message_retrieve_params.rbs +0 -35
  385. data/sig/openai/models/beta/threads/message_update_params.rbs +0 -53
  386. data/sig/openai/models/beta/threads/refusal_content_block.rbs +0 -22
  387. data/sig/openai/models/beta/threads/refusal_delta_block.rbs +0 -34
  388. data/sig/openai/models/beta/threads/required_action_function_tool_call.rbs +0 -69
  389. data/sig/openai/models/beta/threads/run.rbs +0 -545
  390. data/sig/openai/models/beta/threads/run_cancel_params.rbs +0 -35
  391. data/sig/openai/models/beta/threads/run_create_params.rbs +0 -524
  392. data/sig/openai/models/beta/threads/run_list_params.rbs +0 -111
  393. data/sig/openai/models/beta/threads/run_retrieve_params.rbs +0 -35
  394. data/sig/openai/models/beta/threads/run_status.rbs +0 -34
  395. data/sig/openai/models/beta/threads/run_submit_tool_outputs_params.rbs +0 -70
  396. data/sig/openai/models/beta/threads/run_update_params.rbs +0 -53
  397. data/sig/openai/models/beta/threads/runs/code_interpreter_logs.rbs +0 -40
  398. data/sig/openai/models/beta/threads/runs/code_interpreter_output_image.rbs +0 -65
  399. data/sig/openai/models/beta/threads/runs/code_interpreter_tool_call.rbs +0 -147
  400. data/sig/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbs +0 -115
  401. data/sig/openai/models/beta/threads/runs/file_search_tool_call.rbs +0 -228
  402. data/sig/openai/models/beta/threads/runs/file_search_tool_call_delta.rbs +0 -58
  403. data/sig/openai/models/beta/threads/runs/function_tool_call.rbs +0 -80
  404. data/sig/openai/models/beta/threads/runs/function_tool_call_delta.rbs +0 -103
  405. data/sig/openai/models/beta/threads/runs/message_creation_step_details.rbs +0 -47
  406. data/sig/openai/models/beta/threads/runs/run_step.rbs +0 -290
  407. data/sig/openai/models/beta/threads/runs/run_step_delta.rbs +0 -46
  408. data/sig/openai/models/beta/threads/runs/run_step_delta_event.rbs +0 -47
  409. data/sig/openai/models/beta/threads/runs/run_step_delta_message_delta.rbs +0 -56
  410. data/sig/openai/models/beta/threads/runs/run_step_include.rbs +0 -22
  411. data/sig/openai/models/beta/threads/runs/step_list_params.rbs +0 -149
  412. data/sig/openai/models/beta/threads/runs/step_retrieve_params.rbs +0 -73
  413. data/sig/openai/models/beta/threads/runs/tool_call.rbs +0 -20
  414. data/sig/openai/models/beta/threads/runs/tool_call_delta.rbs +0 -20
  415. data/sig/openai/models/beta/threads/runs/tool_call_delta_object.rbs +0 -48
  416. data/sig/openai/models/beta/threads/runs/tool_calls_step_details.rbs +0 -41
  417. data/sig/openai/models/beta/threads/text.rbs +0 -32
  418. data/sig/openai/models/beta/threads/text_content_block.rbs +0 -26
  419. data/sig/openai/models/beta/threads/text_content_block_param.rbs +0 -25
  420. data/sig/openai/models/beta/threads/text_delta.rbs +0 -39
  421. data/sig/openai/models/beta/threads/text_delta_block.rbs +0 -44
  422. data/sig/openai/models/image_input_reference_param.rbs +0 -23
  423. data/sig/openai/models/video.rbs +0 -142
  424. data/sig/openai/models/video_create_character_params.rbs +0 -45
  425. data/sig/openai/models/video_create_character_response.rbs +0 -27
  426. data/sig/openai/models/video_create_error.rbs +0 -163
  427. data/sig/openai/models/video_create_params.rbs +0 -104
  428. data/sig/openai/models/video_delete_params.rbs +0 -23
  429. data/sig/openai/models/video_delete_response.rbs +0 -31
  430. data/sig/openai/models/video_download_content_params.rbs +0 -51
  431. data/sig/openai/models/video_edit_params.rbs +0 -77
  432. data/sig/openai/models/video_extend_params.rbs +0 -87
  433. data/sig/openai/models/video_get_character_params.rbs +0 -23
  434. data/sig/openai/models/video_get_character_response.rbs +0 -27
  435. data/sig/openai/models/video_list_params.rbs +0 -70
  436. data/sig/openai/models/video_model.rbs +0 -23
  437. data/sig/openai/models/video_remix_params.rbs +0 -34
  438. data/sig/openai/models/video_retrieve_params.rbs +0 -23
  439. data/sig/openai/models/video_seconds.rbs +0 -15
  440. data/sig/openai/models/video_size.rbs +0 -16
  441. data/sig/openai/resources/beta/assistants.rbs +0 -58
  442. data/sig/openai/resources/beta/threads/messages.rbs +0 -49
  443. data/sig/openai/resources/beta/threads/runs/steps.rbs +0 -32
  444. data/sig/openai/resources/beta/threads/runs.rbs +0 -99
  445. data/sig/openai/resources/beta/threads.rbs +0 -75
  446. data/sig/openai/resources/videos.rbs +0 -69
@@ -1,857 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module OpenAI
4
- module Models
5
- module Beta
6
- # @see OpenAI::Resources::Beta::Threads#create_and_run
7
- #
8
- # @see OpenAI::Resources::Beta::Threads#stream_raw
9
- class ThreadCreateAndRunParams < OpenAI::Internal::Type::BaseModel
10
- extend OpenAI::Internal::Type::RequestParameters::Converter
11
- include OpenAI::Internal::Type::RequestParameters
12
-
13
- # @!attribute assistant_id
14
- # The ID of the
15
- # [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
16
- # to execute this run.
17
- #
18
- # @return [String]
19
- required :assistant_id, String
20
-
21
- # @!attribute instructions
22
- # Override the default system message of the assistant. This is useful for
23
- # modifying the behavior on a per-run basis.
24
- #
25
- # @return [String, nil]
26
- optional :instructions, String, nil?: true
27
-
28
- # @!attribute max_completion_tokens
29
- # The maximum number of completion tokens that may be used over the course of the
30
- # run. The run will make a best effort to use only the number of completion tokens
31
- # specified, across multiple turns of the run. If the run exceeds the number of
32
- # completion tokens specified, the run will end with status `incomplete`. See
33
- # `incomplete_details` for more info.
34
- #
35
- # @return [Integer, nil]
36
- optional :max_completion_tokens, Integer, nil?: true
37
-
38
- # @!attribute max_prompt_tokens
39
- # The maximum number of prompt tokens that may be used over the course of the run.
40
- # The run will make a best effort to use only the number of prompt tokens
41
- # specified, across multiple turns of the run. If the run exceeds the number of
42
- # prompt tokens specified, the run will end with status `incomplete`. See
43
- # `incomplete_details` for more info.
44
- #
45
- # @return [Integer, nil]
46
- optional :max_prompt_tokens, Integer, nil?: true
47
-
48
- # @!attribute metadata
49
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
50
- # for storing additional information about the object in a structured format, and
51
- # querying for objects via API or the dashboard.
52
- #
53
- # Keys are strings with a maximum length of 64 characters. Values are strings with
54
- # a maximum length of 512 characters.
55
- #
56
- # @return [Hash{Symbol=>String}, nil]
57
- optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true
58
-
59
- # @!attribute model
60
- # The ID of the
61
- # [Model](https://developers.openai.com/api/reference/resources/models) to be used
62
- # to execute this run. If a value is provided here, it will override the model
63
- # associated with the assistant. If not, the model associated with the assistant
64
- # will be used.
65
- #
66
- # @return [String, Symbol, OpenAI::Models::ChatModel, nil]
67
- optional :model, union: -> { OpenAI::Beta::ThreadCreateAndRunParams::Model }, nil?: true
68
-
69
- # @!attribute parallel_tool_calls
70
- # Whether to enable
71
- # [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
72
- # during tool use.
73
- #
74
- # @return [Boolean, nil]
75
- optional :parallel_tool_calls, OpenAI::Internal::Type::Boolean
76
-
77
- # @!attribute response_format
78
- # Specifies the format that the model must output. Compatible with
79
- # [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
80
- # [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
81
- # all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
82
- #
83
- # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
84
- # Outputs which ensures the model will match your supplied JSON schema. Learn more
85
- # in the
86
- # [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
87
- #
88
- # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
89
- # message the model generates is valid JSON.
90
- #
91
- # **Important:** when using JSON mode, you **must** also instruct the model to
92
- # produce JSON yourself via a system or user message. Without this, the model may
93
- # generate an unending stream of whitespace until the generation reaches the token
94
- # limit, resulting in a long-running and seemingly "stuck" request. Also note that
95
- # the message content may be partially cut off if `finish_reason="length"`, which
96
- # indicates the generation exceeded `max_tokens` or the conversation exceeded the
97
- # max context length.
98
- #
99
- # @return [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil]
100
- optional :response_format, union: -> { OpenAI::Beta::AssistantResponseFormatOption }, nil?: true
101
-
102
- # @!attribute temperature
103
- # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
104
- # make the output more random, while lower values like 0.2 will make it more
105
- # focused and deterministic.
106
- #
107
- # @return [Float, nil]
108
- optional :temperature, Float, nil?: true
109
-
110
- # @!attribute thread
111
- # Options to create a new thread. If no thread is provided when running a request,
112
- # an empty thread will be created.
113
- #
114
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, nil]
115
- optional :thread, -> { OpenAI::Beta::ThreadCreateAndRunParams::Thread }
116
-
117
- # @!attribute tool_choice
118
- # Controls which (if any) tool is called by the model. `none` means the model will
119
- # not call any tools and instead generates a message. `auto` is the default value
120
- # and means the model can pick between generating a message or calling one or more
121
- # tools. `required` means the model must call one or more tools before responding
122
- # to the user. Specifying a particular tool like `{"type": "file_search"}` or
123
- # `{"type": "function", "function": {"name": "my_function"}}` forces the model to
124
- # call that tool.
125
- #
126
- # @return [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil]
127
- optional :tool_choice, union: -> { OpenAI::Beta::AssistantToolChoiceOption }, nil?: true
128
-
129
- # @!attribute tool_resources
130
- # A set of resources that are used by the assistant's tools. The resources are
131
- # specific to the type of tool. For example, the `code_interpreter` tool requires
132
- # a list of file IDs, while the `file_search` tool requires a list of vector store
133
- # IDs.
134
- #
135
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil]
136
- optional :tool_resources, -> { OpenAI::Beta::ThreadCreateAndRunParams::ToolResources }, nil?: true
137
-
138
- # @!attribute tools
139
- # Override the tools the assistant can use for this run. This is useful for
140
- # modifying the behavior on a per-run basis.
141
- #
142
- # @return [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool>, nil]
143
- optional(
144
- :tools,
145
- -> {
146
- OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::AssistantTool]
147
- },
148
- nil?: true
149
- )
150
-
151
- # @!attribute top_p
152
- # An alternative to sampling with temperature, called nucleus sampling, where the
153
- # model considers the results of the tokens with top_p probability mass. So 0.1
154
- # means only the tokens comprising the top 10% probability mass are considered.
155
- #
156
- # We generally recommend altering this or temperature but not both.
157
- #
158
- # @return [Float, nil]
159
- optional :top_p, Float, nil?: true
160
-
161
- # @!attribute truncation_strategy
162
- # Controls for how a thread will be truncated prior to the run. Use this to
163
- # control the initial context window of the run.
164
- #
165
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil]
166
- optional(
167
- :truncation_strategy,
168
- -> { OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy },
169
- nil?: true
170
- )
171
-
172
- # @!method initialize(assistant_id:, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, response_format: nil, temperature: nil, thread: nil, tool_choice: nil, tool_resources: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {})
173
- # @param assistant_id [String]
174
- # The ID of the
175
- # [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
176
- # to execute this run.
177
- #
178
- # @param instructions [String, nil]
179
- # Override the default system message of the assistant. This is useful for
180
- # modifying the behavior on a per-run basis.
181
- #
182
- # @param max_completion_tokens [Integer, nil]
183
- # The maximum number of completion tokens that may be used over the course of the
184
- # run. The run will make a best effort to use only the number of completion tokens
185
- # specified, across multiple turns of the run. If the run exceeds the number of
186
- # completion tokens specified, the run will end with status `incomplete`. See
187
- # `incomplete_details` for more info.
188
- #
189
- # @param max_prompt_tokens [Integer, nil]
190
- # The maximum number of prompt tokens that may be used over the course of the run.
191
- # The run will make a best effort to use only the number of prompt tokens
192
- # specified, across multiple turns of the run. If the run exceeds the number of
193
- # prompt tokens specified, the run will end with status `incomplete`. See
194
- # `incomplete_details` for more info.
195
- #
196
- # @param metadata [Hash{Symbol=>String}, nil]
197
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
198
- # for storing additional information about the object in a structured format, and
199
- # querying for objects via API or the dashboard.
200
- #
201
- # Keys are strings with a maximum length of 64 characters. Values are strings with
202
- # a maximum length of 512 characters.
203
- #
204
- # @param model [String, Symbol, OpenAI::Models::ChatModel, nil]
205
- # The ID of the
206
- # [Model](https://developers.openai.com/api/reference/resources/models) to be used
207
- # to execute this run. If a value is provided here, it will override the model
208
- # associated with the assistant. If not, the model associated with the assistant
209
- # will be used.
210
- #
211
- # @param parallel_tool_calls [Boolean]
212
- # Whether to enable
213
- # [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
214
- # during tool use.
215
- #
216
- # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil]
217
- # Specifies the format that the model must output. Compatible with
218
- # [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
219
- # [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
220
- # all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
221
- #
222
- # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
223
- # Outputs which ensures the model will match your supplied JSON schema. Learn more
224
- # in the
225
- # [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
226
- #
227
- # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
228
- # message the model generates is valid JSON.
229
- #
230
- # **Important:** when using JSON mode, you **must** also instruct the model to
231
- # produce JSON yourself via a system or user message. Without this, the model may
232
- # generate an unending stream of whitespace until the generation reaches the token
233
- # limit, resulting in a long-running and seemingly "stuck" request. Also note that
234
- # the message content may be partially cut off if `finish_reason="length"`, which
235
- # indicates the generation exceeded `max_tokens` or the conversation exceeded the
236
- # max context length.
237
- #
238
- # @param temperature [Float, nil]
239
- # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
240
- # make the output more random, while lower values like 0.2 will make it more
241
- # focused and deterministic.
242
- #
243
- # @param thread [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread]
244
- # Options to create a new thread. If no thread is provided when running a request,
245
- # an empty thread will be created.
246
- #
247
- # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil]
248
- # Controls which (if any) tool is called by the model. `none` means the model will
249
- # not call any tools and instead generates a message. `auto` is the default value
250
- # and means the model can pick between generating a message or calling one or more
251
- # tools. `required` means the model must call one or more tools before responding
252
- # to the user. Specifying a particular tool like `{"type": "file_search"}` or
253
- # `{"type": "function", "function": {"name": "my_function"}}` forces the model to
254
- # call that tool.
255
- #
256
- # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil]
257
- # A set of resources that are used by the assistant's tools. The resources are
258
- # specific to the type of tool. For example, the `code_interpreter` tool requires
259
- # a list of file IDs, while the `file_search` tool requires a list of vector store
260
- # IDs.
261
- #
262
- # @param tools [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool>, nil]
263
- # Override the tools the assistant can use for this run. This is useful for
264
- # modifying the behavior on a per-run basis.
265
- #
266
- # @param top_p [Float, nil]
267
- # An alternative to sampling with temperature, called nucleus sampling, where the
268
- # model considers the results of the tokens with top_p probability mass. So 0.1
269
- # means only the tokens comprising the top 10% probability mass are considered.
270
- #
271
- # We generally recommend altering this or temperature but not both.
272
- #
273
- # @param truncation_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil]
274
- # Controls for how a thread will be truncated prior to the run. Use this to
275
- # control the initial context window of the run.
276
- #
277
- # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
278
-
279
- # The ID of the
280
- # [Model](https://developers.openai.com/api/reference/resources/models) to be used
281
- # to execute this run. If a value is provided here, it will override the model
282
- # associated with the assistant. If not, the model associated with the assistant
283
- # will be used.
284
- module Model
285
- extend OpenAI::Internal::Type::Union
286
-
287
- variant String
288
-
289
- # The ID of the [Model](https://developers.openai.com/api/reference/resources/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
290
- variant enum: -> { OpenAI::ChatModel }
291
-
292
- # @!method self.variants
293
- # @return [Array(String, Symbol, OpenAI::Models::ChatModel)]
294
- end
295
-
296
- class Thread < OpenAI::Internal::Type::BaseModel
297
- # @!attribute messages
298
- # A list of
299
- # [messages](https://developers.openai.com/api/docs/assistants/migration) to start
300
- # the thread with.
301
- #
302
- # @return [Array<OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message>, nil]
303
- optional(
304
- :messages,
305
- -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message] }
306
- )
307
-
308
- # @!attribute metadata
309
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
310
- # for storing additional information about the object in a structured format, and
311
- # querying for objects via API or the dashboard.
312
- #
313
- # Keys are strings with a maximum length of 64 characters. Values are strings with
314
- # a maximum length of 512 characters.
315
- #
316
- # @return [Hash{Symbol=>String}, nil]
317
- optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true
318
-
319
- # @!attribute tool_resources
320
- # A set of resources that are made available to the assistant's tools in this
321
- # thread. The resources are specific to the type of tool. For example, the
322
- # `code_interpreter` tool requires a list of file IDs, while the `file_search`
323
- # tool requires a list of vector store IDs.
324
- #
325
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources, nil]
326
- optional(
327
- :tool_resources,
328
- -> {
329
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources
330
- },
331
- nil?: true
332
- )
333
-
334
- # @!method initialize(messages: nil, metadata: nil, tool_resources: nil)
335
- # Options to create a new thread. If no thread is provided when running a request,
336
- # an empty thread will be created.
337
- #
338
- # @param messages [Array<OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message>]
339
- # A list of
340
- # [messages](https://developers.openai.com/api/docs/assistants/migration) to start
341
- # the thread with.
342
- #
343
- # @param metadata [Hash{Symbol=>String}, nil]
344
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
345
- # for storing additional information about the object in a structured format, and
346
- # querying for objects via API or the dashboard.
347
- #
348
- # Keys are strings with a maximum length of 64 characters. Values are strings with
349
- # a maximum length of 512 characters.
350
- #
351
- # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources, nil]
352
- # A set of resources that are made available to the assistant's tools in this
353
- # thread. The resources are specific to the type of tool. For example, the
354
- # `code_interpreter` tool requires a list of file IDs, while the `file_search`
355
- # tool requires a list of vector store IDs.
356
- class Message < OpenAI::Internal::Type::BaseModel
357
- # @!attribute content
358
- # The text contents of the message.
359
- #
360
- # @return [String, Array<OpenAI::Models::Beta::Threads::ImageFileContentBlock, OpenAI::Models::Beta::Threads::ImageURLContentBlock, OpenAI::Models::Beta::Threads::TextContentBlockParam>]
361
- required :content, union: -> { OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Content }
362
-
363
- # @!attribute role
364
- # The role of the entity that is creating the message. Allowed values include:
365
- #
366
- # - `user`: Indicates the message is sent by an actual user and should be used in
367
- # most cases to represent user-generated messages.
368
- # - `assistant`: Indicates the message is generated by the assistant. Use this
369
- # value to insert messages from the assistant into the conversation.
370
- #
371
- # @return [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Role]
372
- required :role, enum: -> { OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role }
373
-
374
- # @!attribute attachments
375
- # A list of files attached to the message, and the tools they should be added to.
376
- #
377
- # @return [Array<OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment>, nil]
378
- optional(
379
- :attachments,
380
- -> {
381
- OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment]
382
- },
383
- nil?: true
384
- )
385
-
386
- # @!attribute metadata
387
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
388
- # for storing additional information about the object in a structured format, and
389
- # querying for objects via API or the dashboard.
390
- #
391
- # Keys are strings with a maximum length of 64 characters. Values are strings with
392
- # a maximum length of 512 characters.
393
- #
394
- # @return [Hash{Symbol=>String}, nil]
395
- optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true
396
-
397
- # @!method initialize(content:, role:, attachments: nil, metadata: nil)
398
- # @param content [String, Array<OpenAI::Models::Beta::Threads::ImageFileContentBlock, OpenAI::Models::Beta::Threads::ImageURLContentBlock, OpenAI::Models::Beta::Threads::TextContentBlockParam>]
399
- # The text contents of the message.
400
- #
401
- # @param role [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Role]
402
- # The role of the entity that is creating the message. Allowed values include:
403
- #
404
- # - `user`: Indicates the message is sent by an actual user and should be used in
405
- # most cases to represent user-generated messages.
406
- # - `assistant`: Indicates the message is generated by the assistant. Use this
407
- # value to insert messages from the assistant into the conversation.
408
- #
409
- # @param attachments [Array<OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment>, nil]
410
- # A list of files attached to the message, and the tools they should be added to.
411
- #
412
- # @param metadata [Hash{Symbol=>String}, nil]
413
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
414
- # for storing additional information about the object in a structured format, and
415
- # querying for objects via API or the dashboard.
416
- #
417
- # Keys are strings with a maximum length of 64 characters. Values are strings with
418
- # a maximum length of 512 characters.
419
-
420
- # The text contents of the message.
421
- #
422
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message#content
423
- module Content
424
- extend OpenAI::Internal::Type::Union
425
-
426
- # The text contents of the message.
427
- variant String
428
-
429
- # An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](https://developers.openai.com/api/docs/models).
430
- variant(
431
- -> {
432
- OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Content::MessageContentPartParamArray
433
- }
434
- )
435
-
436
- # @!method self.variants
437
- # @return [Array(String, Array<OpenAI::Models::Beta::Threads::ImageFileContentBlock, OpenAI::Models::Beta::Threads::ImageURLContentBlock, OpenAI::Models::Beta::Threads::TextContentBlockParam>)]
438
-
439
- # @type [OpenAI::Internal::Type::Converter]
440
- MessageContentPartParamArray = OpenAI::Internal::Type::ArrayOf[
441
- union: -> { OpenAI::Beta::Threads::MessageContentPartParam }
442
- ]
443
- end
444
-
445
- # The role of the entity that is creating the message. Allowed values include:
446
- #
447
- # - `user`: Indicates the message is sent by an actual user and should be used in
448
- # most cases to represent user-generated messages.
449
- # - `assistant`: Indicates the message is generated by the assistant. Use this
450
- # value to insert messages from the assistant into the conversation.
451
- #
452
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message#role
453
- module Role
454
- extend OpenAI::Internal::Type::Enum
455
-
456
- USER = :user
457
- ASSISTANT = :assistant
458
-
459
- # @!method self.values
460
- # @return [Array<Symbol>]
461
- end
462
-
463
- class Attachment < OpenAI::Internal::Type::BaseModel
464
- # @!attribute file_id
465
- # The ID of the file to attach to the message.
466
- #
467
- # @return [String, nil]
468
- optional :file_id, String
469
-
470
- # @!attribute tools
471
- # The tools to add this file to.
472
- #
473
- # @return [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch>, nil]
474
- optional(
475
- :tools,
476
- -> {
477
- OpenAI::Internal::Type::ArrayOf[
478
- union: OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool
479
- ]
480
- }
481
- )
482
-
483
- # @!method initialize(file_id: nil, tools: nil)
484
- # @param file_id [String]
485
- # The ID of the file to attach to the message.
486
- #
487
- # @param tools [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch>]
488
- # The tools to add this file to.
489
- module Tool
490
- extend OpenAI::Internal::Type::Union
491
-
492
- discriminator :type
493
-
494
- variant :code_interpreter, -> { OpenAI::Beta::CodeInterpreterTool }
495
-
496
- variant(
497
- :file_search,
498
- -> { OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch }
499
- )
500
-
501
- class FileSearch < OpenAI::Internal::Type::BaseModel
502
- # @!attribute type
503
- # The type of tool being defined: `file_search`
504
- #
505
- # @return [Symbol, :file_search]
506
- required :type, const: :file_search
507
-
508
- # @!method initialize(type: :file_search)
509
- # @param type [Symbol, :file_search]
510
- # The type of tool being defined: `file_search`
511
- end
512
-
513
- # @!method self.variants
514
- # @return [Array(OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch)]
515
- end
516
- end
517
- end
518
-
519
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread#tool_resources
520
- class ToolResources < OpenAI::Internal::Type::BaseModel
521
- # @!attribute code_interpreter
522
- #
523
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter, nil]
524
- optional(
525
- :code_interpreter,
526
- -> { OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter }
527
- )
528
-
529
- # @!attribute file_search
530
- #
531
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch, nil]
532
- optional :file_search, -> { OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch }
533
-
534
- # @!method initialize(code_interpreter: nil, file_search: nil)
535
- # A set of resources that are made available to the assistant's tools in this
536
- # thread. The resources are specific to the type of tool. For example, the
537
- # `code_interpreter` tool requires a list of file IDs, while the `file_search`
538
- # tool requires a list of vector store IDs.
539
- #
540
- # @param code_interpreter [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter]
541
- # @param file_search [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch]
542
-
543
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources#code_interpreter
544
- class CodeInterpreter < OpenAI::Internal::Type::BaseModel
545
- # @!attribute file_ids
546
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
547
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
548
- # files associated with the tool.
549
- #
550
- # @return [Array<String>, nil]
551
- optional :file_ids, OpenAI::Internal::Type::ArrayOf[String]
552
-
553
- # @!method initialize(file_ids: nil)
554
- # @param file_ids [Array<String>]
555
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
556
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
557
- # files associated with the tool.
558
- end
559
-
560
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources#file_search
561
- class FileSearch < OpenAI::Internal::Type::BaseModel
562
- # @!attribute vector_store_ids
563
- # The
564
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
565
- # attached to this thread. There can be a maximum of 1 vector store attached to
566
- # the thread.
567
- #
568
- # @return [Array<String>, nil]
569
- optional :vector_store_ids, OpenAI::Internal::Type::ArrayOf[String]
570
-
571
- # @!attribute vector_stores
572
- # A helper to create a
573
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
574
- # with file_ids and attach it to this thread. There can be a maximum of 1 vector
575
- # store attached to the thread.
576
- #
577
- # @return [Array<OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore>, nil]
578
- optional(
579
- :vector_stores,
580
- -> {
581
- OpenAI::Internal::Type::ArrayOf[
582
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore
583
- ]
584
- }
585
- )
586
-
587
- # @!method initialize(vector_store_ids: nil, vector_stores: nil)
588
- # @param vector_store_ids [Array<String>]
589
- # The
590
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
591
- # attached to this thread. There can be a maximum of 1 vector store attached to
592
- # the thread.
593
- #
594
- # @param vector_stores [Array<OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore>]
595
- # A helper to create a
596
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
597
- # with file_ids and attach it to this thread. There can be a maximum of 1 vector
598
- # store attached to the thread.
599
- class VectorStore < OpenAI::Internal::Type::BaseModel
600
- # @!attribute chunking_strategy
601
- # The chunking strategy used to chunk the file(s). If not set, will use the `auto`
602
- # strategy.
603
- #
604
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static, nil]
605
- optional(
606
- :chunking_strategy,
607
- union: -> {
608
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy
609
- }
610
- )
611
-
612
- # @!attribute file_ids
613
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
614
- # IDs to add to the vector store. For vector stores created before Nov 2025, there
615
- # can be a maximum of 10,000 files in a vector store. For vector stores created
616
- # starting in Nov 2025, the limit is 100,000,000 files.
617
- #
618
- # @return [Array<String>, nil]
619
- optional :file_ids, OpenAI::Internal::Type::ArrayOf[String]
620
-
621
- # @!attribute metadata
622
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
623
- # for storing additional information about the object in a structured format, and
624
- # querying for objects via API or the dashboard.
625
- #
626
- # Keys are strings with a maximum length of 64 characters. Values are strings with
627
- # a maximum length of 512 characters.
628
- #
629
- # @return [Hash{Symbol=>String}, nil]
630
- optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true
631
-
632
- # @!method initialize(chunking_strategy: nil, file_ids: nil, metadata: nil)
633
- # @param chunking_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static]
634
- # The chunking strategy used to chunk the file(s). If not set, will use the `auto`
635
- # strategy.
636
- #
637
- # @param file_ids [Array<String>]
638
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
639
- # IDs to add to the vector store. For vector stores created before Nov 2025, there
640
- # can be a maximum of 10,000 files in a vector store. For vector stores created
641
- # starting in Nov 2025, the limit is 100,000,000 files.
642
- #
643
- # @param metadata [Hash{Symbol=>String}, nil]
644
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
645
- # for storing additional information about the object in a structured format, and
646
- # querying for objects via API or the dashboard.
647
- #
648
- # Keys are strings with a maximum length of 64 characters. Values are strings with
649
- # a maximum length of 512 characters.
650
-
651
- # The chunking strategy used to chunk the file(s). If not set, will use the `auto`
652
- # strategy.
653
- #
654
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore#chunking_strategy
655
- module ChunkingStrategy
656
- extend OpenAI::Internal::Type::Union
657
-
658
- discriminator :type
659
-
660
- # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
661
- variant(
662
- :auto,
663
- -> {
664
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto
665
- }
666
- )
667
-
668
- variant(
669
- :static,
670
- -> {
671
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static
672
- }
673
- )
674
-
675
- class Auto < OpenAI::Internal::Type::BaseModel
676
- # @!attribute type
677
- # Always `auto`.
678
- #
679
- # @return [Symbol, :auto]
680
- required :type, const: :auto
681
-
682
- # @!method initialize(type: :auto)
683
- # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
684
- # `800` and `chunk_overlap_tokens` of `400`.
685
- #
686
- # @param type [Symbol, :auto]
687
- # Always `auto`.
688
- end
689
-
690
- class Static < OpenAI::Internal::Type::BaseModel
691
- # @!attribute static
692
- #
693
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static]
694
- required(
695
- :static,
696
- -> {
697
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static
698
- }
699
- )
700
-
701
- # @!attribute type
702
- # Always `static`.
703
- #
704
- # @return [Symbol, :static]
705
- required :type, const: :static
706
-
707
- # @!method initialize(static:, type: :static)
708
- # @param static [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static]
709
- #
710
- # @param type [Symbol, :static]
711
- # Always `static`.
712
-
713
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static#static
714
- class Static < OpenAI::Internal::Type::BaseModel
715
- # @!attribute chunk_overlap_tokens
716
- # The number of tokens that overlap between chunks. The default value is `400`.
717
- #
718
- # Note that the overlap must not exceed half of `max_chunk_size_tokens`.
719
- #
720
- # @return [Integer]
721
- required :chunk_overlap_tokens, Integer
722
-
723
- # @!attribute max_chunk_size_tokens
724
- # The maximum number of tokens in each chunk. The default value is `800`. The
725
- # minimum value is `100` and the maximum value is `4096`.
726
- #
727
- # @return [Integer]
728
- required :max_chunk_size_tokens, Integer
729
-
730
- # @!method initialize(chunk_overlap_tokens:, max_chunk_size_tokens:)
731
- # @param chunk_overlap_tokens [Integer]
732
- # The number of tokens that overlap between chunks. The default value is `400`.
733
- #
734
- # Note that the overlap must not exceed half of `max_chunk_size_tokens`.
735
- #
736
- # @param max_chunk_size_tokens [Integer]
737
- # The maximum number of tokens in each chunk. The default value is `800`. The
738
- # minimum value is `100` and the maximum value is `4096`.
739
- end
740
- end
741
-
742
- # @!method self.variants
743
- # @return [Array(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static)]
744
- end
745
- end
746
- end
747
- end
748
- end
749
-
750
- class ToolResources < OpenAI::Internal::Type::BaseModel
751
- # @!attribute code_interpreter
752
- #
753
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter, nil]
754
- optional :code_interpreter, -> { OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter }
755
-
756
- # @!attribute file_search
757
- #
758
- # @return [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch, nil]
759
- optional :file_search, -> { OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch }
760
-
761
- # @!method initialize(code_interpreter: nil, file_search: nil)
762
- # A set of resources that are used by the assistant's tools. The resources are
763
- # specific to the type of tool. For example, the `code_interpreter` tool requires
764
- # a list of file IDs, while the `file_search` tool requires a list of vector store
765
- # IDs.
766
- #
767
- # @param code_interpreter [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter]
768
- # @param file_search [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch]
769
-
770
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources#code_interpreter
771
- class CodeInterpreter < OpenAI::Internal::Type::BaseModel
772
- # @!attribute file_ids
773
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
774
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
775
- # files associated with the tool.
776
- #
777
- # @return [Array<String>, nil]
778
- optional :file_ids, OpenAI::Internal::Type::ArrayOf[String]
779
-
780
- # @!method initialize(file_ids: nil)
781
- # @param file_ids [Array<String>]
782
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
783
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
784
- # files associated with the tool.
785
- end
786
-
787
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources#file_search
788
- class FileSearch < OpenAI::Internal::Type::BaseModel
789
- # @!attribute vector_store_ids
790
- # The ID of the
791
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
792
- # attached to this assistant. There can be a maximum of 1 vector store attached to
793
- # the assistant.
794
- #
795
- # @return [Array<String>, nil]
796
- optional :vector_store_ids, OpenAI::Internal::Type::ArrayOf[String]
797
-
798
- # @!method initialize(vector_store_ids: nil)
799
- # @param vector_store_ids [Array<String>]
800
- # The ID of the
801
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
802
- # attached to this assistant. There can be a maximum of 1 vector store attached to
803
- # the assistant.
804
- end
805
- end
806
-
807
- class TruncationStrategy < OpenAI::Internal::Type::BaseModel
808
- # @!attribute type
809
- # The truncation strategy to use for the thread. The default is `auto`. If set to
810
- # `last_messages`, the thread will be truncated to the n most recent messages in
811
- # the thread. When set to `auto`, messages in the middle of the thread will be
812
- # dropped to fit the context length of the model, `max_prompt_tokens`.
813
- #
814
- # @return [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type]
815
- required :type, enum: -> { OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type }
816
-
817
- # @!attribute last_messages
818
- # The number of most recent messages from the thread when constructing the context
819
- # for the run.
820
- #
821
- # @return [Integer, nil]
822
- optional :last_messages, Integer, nil?: true
823
-
824
- # @!method initialize(type:, last_messages: nil)
825
- # Controls for how a thread will be truncated prior to the run. Use this to
826
- # control the initial context window of the run.
827
- #
828
- # @param type [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type]
829
- # The truncation strategy to use for the thread. The default is `auto`. If set to
830
- # `last_messages`, the thread will be truncated to the n most recent messages in
831
- # the thread. When set to `auto`, messages in the middle of the thread will be
832
- # dropped to fit the context length of the model, `max_prompt_tokens`.
833
- #
834
- # @param last_messages [Integer, nil]
835
- # The number of most recent messages from the thread when constructing the context
836
- # for the run.
837
-
838
- # The truncation strategy to use for the thread. The default is `auto`. If set to
839
- # `last_messages`, the thread will be truncated to the n most recent messages in
840
- # the thread. When set to `auto`, messages in the middle of the thread will be
841
- # dropped to fit the context length of the model, `max_prompt_tokens`.
842
- #
843
- # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy#type
844
- module Type
845
- extend OpenAI::Internal::Type::Enum
846
-
847
- AUTO = :auto
848
- LAST_MESSAGES = :last_messages
849
-
850
- # @!method self.values
851
- # @return [Array<Symbol>]
852
- end
853
- end
854
- end
855
- end
856
- end
857
- end