openai 0.130.0 → 1.0.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 (422) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +39 -3
  4. data/lib/openai/client.rb +0 -4
  5. data/lib/openai/internal/type/union.rb +5 -1
  6. data/lib/openai/models/batch_create_params.rb +6 -19
  7. data/lib/openai/models/beta/beta_compacted_response.rb +3 -3
  8. data/lib/openai/models/beta/beta_response.rb +0 -18
  9. data/lib/openai/models/beta/beta_responses_client_event.rb +0 -26
  10. data/lib/openai/models/beta/response_compact_params.rb +0 -18
  11. data/lib/openai/models/beta/response_create_params.rb +0 -18
  12. data/lib/openai/models/chat/completion_create_params.rb +8 -6
  13. data/lib/openai/models/chat_model.rb +0 -12
  14. data/lib/openai/models/completion_create_params.rb +4 -2
  15. data/lib/openai/models/graders/multi_grader.rb +11 -15
  16. data/lib/openai/models/image_edit_completed_event.rb +9 -17
  17. data/lib/openai/models/image_edit_partial_image_event.rb +9 -17
  18. data/lib/openai/models/image_gen_completed_event.rb +9 -17
  19. data/lib/openai/models/image_gen_partial_image_event.rb +9 -17
  20. data/lib/openai/models/images_response.rb +8 -14
  21. data/lib/openai/models/live/responses_delegation_config.rb +47 -21
  22. data/lib/openai/models/live/responses_delegation_update_config.rb +47 -21
  23. data/lib/openai/models/responses/compacted_response.rb +3 -3
  24. data/lib/openai/models/responses/response_compact_params.rb +0 -18
  25. data/lib/openai/models.rb +0 -32
  26. data/lib/openai/providers/vertex.rb +9 -6
  27. data/lib/openai/resources/batches.rb +2 -6
  28. data/lib/openai/resources/beta.rb +0 -10
  29. data/lib/openai/resources/chat/completions.rb +8 -6
  30. data/lib/openai/resources/completions.rb +4 -2
  31. data/lib/openai/version.rb +1 -1
  32. data/lib/openai.rb +0 -114
  33. data/rbi/openai/client.rbi +0 -3
  34. data/rbi/openai/models/batch_create_params.rbi +6 -19
  35. data/rbi/openai/models/beta/beta_compacted_response.rbi +22 -20
  36. data/rbi/openai/models/beta/beta_response.rbi +0 -3
  37. data/rbi/openai/models/beta/beta_responses_client_event.rbi +0 -12
  38. data/rbi/openai/models/beta/response_compact_params.rbi +0 -9
  39. data/rbi/openai/models/beta/response_create_params.rbi +0 -6
  40. data/rbi/openai/models/chat/completion_create_params.rbi +8 -6
  41. data/rbi/openai/models/chat_model.rbi +0 -3
  42. data/rbi/openai/models/completion_create_params.rbi +4 -2
  43. data/rbi/openai/models/graders/multi_grader.rbi +32 -27
  44. data/rbi/openai/models/image_edit_completed_event.rbi +11 -8
  45. data/rbi/openai/models/image_edit_partial_image_event.rbi +11 -8
  46. data/rbi/openai/models/image_gen_completed_event.rbi +11 -8
  47. data/rbi/openai/models/image_gen_partial_image_event.rbi +11 -8
  48. data/rbi/openai/models/images_response.rbi +6 -6
  49. data/rbi/openai/models/live/responses_delegation_config.rbi +54 -30
  50. data/rbi/openai/models/live/responses_delegation_update_config.rbi +54 -30
  51. data/rbi/openai/models/responses/compacted_response.rbi +19 -17
  52. data/rbi/openai/models/responses/response_compact_params.rbi +0 -12
  53. data/rbi/openai/models.rbi +0 -32
  54. data/rbi/openai/resources/batches.rbi +2 -6
  55. data/rbi/openai/resources/beta.rbi +0 -8
  56. data/rbi/openai/resources/chat/completions.rbi +8 -6
  57. data/rbi/openai/resources/completions.rbi +4 -2
  58. data/sig/openai/client.rbs +0 -2
  59. data/sig/openai/models/batch_create_params.rbs +4 -14
  60. data/sig/openai/models/beta/beta_compacted_response.rbs +4 -4
  61. data/sig/openai/models/beta/beta_response.rbs +0 -6
  62. data/sig/openai/models/beta/beta_responses_client_event.rbs +0 -6
  63. data/sig/openai/models/beta/response_compact_params.rbs +0 -6
  64. data/sig/openai/models/beta/response_create_params.rbs +0 -6
  65. data/sig/openai/models/chat/completion_create_params.rbs +8 -6
  66. data/sig/openai/models/chat_model.rbs +0 -6
  67. data/sig/openai/models/completion_create_params.rbs +4 -2
  68. data/sig/openai/models/graders/multi_grader.rbs +7 -12
  69. data/sig/openai/models/image_edit_completed_event.rbs +11 -9
  70. data/sig/openai/models/image_edit_partial_image_event.rbs +11 -9
  71. data/sig/openai/models/image_gen_completed_event.rbs +11 -9
  72. data/sig/openai/models/image_gen_partial_image_event.rbs +11 -9
  73. data/sig/openai/models/images_response.rbs +5 -7
  74. data/sig/openai/models/live/responses_delegation_config.rbs +50 -18
  75. data/sig/openai/models/live/responses_delegation_update_config.rbs +50 -18
  76. data/sig/openai/models/responses/compacted_response.rbs +4 -4
  77. data/sig/openai/models/responses/response_compact_params.rbs +0 -6
  78. data/sig/openai/models.rbs +0 -32
  79. data/sig/openai/resources/beta.rbs +0 -4
  80. metadata +1 -343
  81. data/lib/openai/models/beta/assistant.rb +0 -270
  82. data/lib/openai/models/beta/assistant_create_params.rb +0 -448
  83. data/lib/openai/models/beta/assistant_delete_params.rb +0 -22
  84. data/lib/openai/models/beta/assistant_deleted.rb +0 -30
  85. data/lib/openai/models/beta/assistant_list_params.rb +0 -80
  86. data/lib/openai/models/beta/assistant_response_format_option.rb +0 -50
  87. data/lib/openai/models/beta/assistant_retrieve_params.rb +0 -22
  88. data/lib/openai/models/beta/assistant_stream_event.rb +0 -688
  89. data/lib/openai/models/beta/assistant_tool.rb +0 -22
  90. data/lib/openai/models/beta/assistant_tool_choice.rb +0 -43
  91. data/lib/openai/models/beta/assistant_tool_choice_function.rb +0 -19
  92. data/lib/openai/models/beta/assistant_tool_choice_option.rb +0 -42
  93. data/lib/openai/models/beta/assistant_update_params.rb +0 -450
  94. data/lib/openai/models/beta/code_interpreter_tool.rb +0 -19
  95. data/lib/openai/models/beta/file_search_tool.rb +0 -123
  96. data/lib/openai/models/beta/function_tool.rb +0 -26
  97. data/lib/openai/models/beta/message_stream_event.rb +0 -159
  98. data/lib/openai/models/beta/run_step_stream_event.rb +0 -201
  99. data/lib/openai/models/beta/run_stream_event.rb +0 -288
  100. data/lib/openai/models/beta/thread.rb +0 -133
  101. data/lib/openai/models/beta/thread_create_and_run_params.rb +0 -857
  102. data/lib/openai/models/beta/thread_create_params.rb +0 -443
  103. data/lib/openai/models/beta/thread_delete_params.rb +0 -22
  104. data/lib/openai/models/beta/thread_deleted.rb +0 -30
  105. data/lib/openai/models/beta/thread_retrieve_params.rb +0 -22
  106. data/lib/openai/models/beta/thread_stream_event.rb +0 -41
  107. data/lib/openai/models/beta/thread_update_params.rb +0 -114
  108. data/lib/openai/models/beta/threads/annotation.rb +0 -27
  109. data/lib/openai/models/beta/threads/annotation_delta.rb +0 -27
  110. data/lib/openai/models/beta/threads/file_citation_annotation.rb +0 -68
  111. data/lib/openai/models/beta/threads/file_citation_delta_annotation.rb +0 -86
  112. data/lib/openai/models/beta/threads/file_path_annotation.rb +0 -67
  113. data/lib/openai/models/beta/threads/file_path_delta_annotation.rb +0 -76
  114. data/lib/openai/models/beta/threads/image_file.rb +0 -51
  115. data/lib/openai/models/beta/threads/image_file_content_block.rb +0 -32
  116. data/lib/openai/models/beta/threads/image_file_delta.rb +0 -51
  117. data/lib/openai/models/beta/threads/image_file_delta_block.rb +0 -41
  118. data/lib/openai/models/beta/threads/image_url.rb +0 -49
  119. data/lib/openai/models/beta/threads/image_url_content_block.rb +0 -30
  120. data/lib/openai/models/beta/threads/image_url_delta.rb +0 -49
  121. data/lib/openai/models/beta/threads/image_url_delta_block.rb +0 -39
  122. data/lib/openai/models/beta/threads/message.rb +0 -272
  123. data/lib/openai/models/beta/threads/message_content.rb +0 -33
  124. data/lib/openai/models/beta/threads/message_content_delta.rb +0 -33
  125. data/lib/openai/models/beta/threads/message_content_part_param.rb +0 -30
  126. data/lib/openai/models/beta/threads/message_create_params.rb +0 -172
  127. data/lib/openai/models/beta/threads/message_delete_params.rb +0 -30
  128. data/lib/openai/models/beta/threads/message_deleted.rb +0 -32
  129. data/lib/openai/models/beta/threads/message_delta.rb +0 -48
  130. data/lib/openai/models/beta/threads/message_delta_event.rb +0 -42
  131. data/lib/openai/models/beta/threads/message_list_params.rb +0 -98
  132. data/lib/openai/models/beta/threads/message_retrieve_params.rb +0 -30
  133. data/lib/openai/models/beta/threads/message_update_params.rb +0 -51
  134. data/lib/openai/models/beta/threads/refusal_content_block.rb +0 -30
  135. data/lib/openai/models/beta/threads/refusal_delta_block.rb +0 -39
  136. data/lib/openai/models/beta/threads/required_action_function_tool_call.rb +0 -73
  137. data/lib/openai/models/beta/threads/run.rb +0 -557
  138. data/lib/openai/models/beta/threads/run_cancel_params.rb +0 -30
  139. data/lib/openai/models/beta/threads/run_create_params.rb +0 -565
  140. data/lib/openai/models/beta/threads/run_list_params.rb +0 -89
  141. data/lib/openai/models/beta/threads/run_retrieve_params.rb +0 -30
  142. data/lib/openai/models/beta/threads/run_status.rb +0 -29
  143. data/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb +0 -69
  144. data/lib/openai/models/beta/threads/run_update_params.rb +0 -51
  145. data/lib/openai/models/beta/threads/runs/code_interpreter_logs.rb +0 -43
  146. data/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rb +0 -54
  147. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb +0 -161
  148. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb +0 -107
  149. data/lib/openai/models/beta/threads/runs/file_search_tool_call.rb +0 -207
  150. data/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rb +0 -52
  151. data/lib/openai/models/beta/threads/runs/function_tool_call.rb +0 -78
  152. data/lib/openai/models/beta/threads/runs/function_tool_call_delta.rb +0 -87
  153. data/lib/openai/models/beta/threads/runs/message_creation_step_details.rb +0 -48
  154. data/lib/openai/models/beta/threads/runs/run_step.rb +0 -311
  155. data/lib/openai/models/beta/threads/runs/run_step_delta.rb +0 -45
  156. data/lib/openai/models/beta/threads/runs/run_step_delta_event.rb +0 -46
  157. data/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb +0 -47
  158. data/lib/openai/models/beta/threads/runs/run_step_include.rb +0 -22
  159. data/lib/openai/models/beta/threads/runs/step_list_params.rb +0 -122
  160. data/lib/openai/models/beta/threads/runs/step_retrieve_params.rb +0 -65
  161. data/lib/openai/models/beta/threads/runs/tool_call.rb +0 -28
  162. data/lib/openai/models/beta/threads/runs/tool_call_delta.rb +0 -28
  163. data/lib/openai/models/beta/threads/runs/tool_call_delta_object.rb +0 -41
  164. data/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb +0 -38
  165. data/lib/openai/models/beta/threads/text.rb +0 -28
  166. data/lib/openai/models/beta/threads/text_content_block.rb +0 -30
  167. data/lib/openai/models/beta/threads/text_content_block_param.rb +0 -32
  168. data/lib/openai/models/beta/threads/text_delta.rb +0 -31
  169. data/lib/openai/models/beta/threads/text_delta_block.rb +0 -39
  170. data/lib/openai/models/image_input_reference_param.rb +0 -24
  171. data/lib/openai/models/video.rb +0 -161
  172. data/lib/openai/models/video_create_character_params.rb +0 -40
  173. data/lib/openai/models/video_create_character_response.rb +0 -36
  174. data/lib/openai/models/video_create_error.rb +0 -166
  175. data/lib/openai/models/video_create_params.rb +0 -85
  176. data/lib/openai/models/video_delete_params.rb +0 -20
  177. data/lib/openai/models/video_delete_response.rb +0 -38
  178. data/lib/openai/models/video_download_content_params.rb +0 -42
  179. data/lib/openai/models/video_edit_params.rb +0 -68
  180. data/lib/openai/models/video_extend_params.rb +0 -79
  181. data/lib/openai/models/video_get_character_params.rb +0 -20
  182. data/lib/openai/models/video_get_character_response.rb +0 -36
  183. data/lib/openai/models/video_list_params.rb +0 -55
  184. data/lib/openai/models/video_model.rb +0 -38
  185. data/lib/openai/models/video_remix_params.rb +0 -30
  186. data/lib/openai/models/video_retrieve_params.rb +0 -20
  187. data/lib/openai/models/video_seconds.rb +0 -16
  188. data/lib/openai/models/video_size.rb +0 -17
  189. data/lib/openai/resources/beta/assistants.rb +0 -320
  190. data/lib/openai/resources/beta/threads/messages.rb +0 -236
  191. data/lib/openai/resources/beta/threads/runs/steps.rb +0 -141
  192. data/lib/openai/resources/beta/threads/runs.rb +0 -623
  193. data/lib/openai/resources/beta/threads.rb +0 -444
  194. data/lib/openai/resources/videos.rb +0 -354
  195. data/rbi/openai/models/beta/assistant.rbi +0 -411
  196. data/rbi/openai/models/beta/assistant_create_params.rbi +0 -776
  197. data/rbi/openai/models/beta/assistant_delete_params.rbi +0 -53
  198. data/rbi/openai/models/beta/assistant_deleted.rbi +0 -60
  199. data/rbi/openai/models/beta/assistant_list_params.rbi +0 -132
  200. data/rbi/openai/models/beta/assistant_response_format_option.rbi +0 -49
  201. data/rbi/openai/models/beta/assistant_retrieve_params.rbi +0 -53
  202. data/rbi/openai/models/beta/assistant_stream_event.rbi +0 -1277
  203. data/rbi/openai/models/beta/assistant_tool.rbi +0 -28
  204. data/rbi/openai/models/beta/assistant_tool_choice.rbi +0 -79
  205. data/rbi/openai/models/beta/assistant_tool_choice_function.rbi +0 -49
  206. data/rbi/openai/models/beta/assistant_tool_choice_option.rbi +0 -53
  207. data/rbi/openai/models/beta/assistant_update_params.rbi +0 -556
  208. data/rbi/openai/models/beta/code_interpreter_tool.rbi +0 -49
  209. data/rbi/openai/models/beta/file_search_tool.rbi +0 -223
  210. data/rbi/openai/models/beta/function_tool.rbi +0 -59
  211. data/rbi/openai/models/beta/message_stream_event.rbi +0 -288
  212. data/rbi/openai/models/beta/run_step_stream_event.rbi +0 -378
  213. data/rbi/openai/models/beta/run_stream_event.rbi +0 -537
  214. data/rbi/openai/models/beta/thread.rbi +0 -255
  215. data/rbi/openai/models/beta/thread_create_and_run_params.rbi +0 -1461
  216. data/rbi/openai/models/beta/thread_create_params.rbi +0 -823
  217. data/rbi/openai/models/beta/thread_delete_params.rbi +0 -53
  218. data/rbi/openai/models/beta/thread_deleted.rbi +0 -60
  219. data/rbi/openai/models/beta/thread_retrieve_params.rbi +0 -53
  220. data/rbi/openai/models/beta/thread_stream_event.rbi +0 -75
  221. data/rbi/openai/models/beta/thread_update_params.rbi +0 -240
  222. data/rbi/openai/models/beta/threads/annotation.rbi +0 -34
  223. data/rbi/openai/models/beta/threads/annotation_delta.rbi +0 -34
  224. data/rbi/openai/models/beta/threads/file_citation_annotation.rbi +0 -132
  225. data/rbi/openai/models/beta/threads/file_citation_delta_annotation.rbi +0 -166
  226. data/rbi/openai/models/beta/threads/file_path_annotation.rbi +0 -131
  227. data/rbi/openai/models/beta/threads/file_path_delta_annotation.rbi +0 -153
  228. data/rbi/openai/models/beta/threads/image_file.rbi +0 -88
  229. data/rbi/openai/models/beta/threads/image_file_content_block.rbi +0 -66
  230. data/rbi/openai/models/beta/threads/image_file_delta.rbi +0 -91
  231. data/rbi/openai/models/beta/threads/image_file_delta_block.rbi +0 -75
  232. data/rbi/openai/models/beta/threads/image_url.rbi +0 -86
  233. data/rbi/openai/models/beta/threads/image_url_content_block.rbi +0 -64
  234. data/rbi/openai/models/beta/threads/image_url_delta.rbi +0 -89
  235. data/rbi/openai/models/beta/threads/image_url_delta_block.rbi +0 -73
  236. data/rbi/openai/models/beta/threads/message.rbi +0 -433
  237. data/rbi/openai/models/beta/threads/message_content.rbi +0 -36
  238. data/rbi/openai/models/beta/threads/message_content_delta.rbi +0 -36
  239. data/rbi/openai/models/beta/threads/message_content_part_param.rbi +0 -35
  240. data/rbi/openai/models/beta/threads/message_create_params.rbi +0 -299
  241. data/rbi/openai/models/beta/threads/message_delete_params.rbi +0 -64
  242. data/rbi/openai/models/beta/threads/message_deleted.rbi +0 -64
  243. data/rbi/openai/models/beta/threads/message_delta.rbi +0 -106
  244. data/rbi/openai/models/beta/threads/message_delta_event.rbi +0 -76
  245. data/rbi/openai/models/beta/threads/message_list_params.rbi +0 -157
  246. data/rbi/openai/models/beta/threads/message_retrieve_params.rbi +0 -64
  247. data/rbi/openai/models/beta/threads/message_update_params.rbi +0 -88
  248. data/rbi/openai/models/beta/threads/refusal_content_block.rbi +0 -61
  249. data/rbi/openai/models/beta/threads/refusal_delta_block.rbi +0 -73
  250. data/rbi/openai/models/beta/threads/required_action_function_tool_call.rbi +0 -130
  251. data/rbi/openai/models/beta/threads/run.rbi +0 -803
  252. data/rbi/openai/models/beta/threads/run_cancel_params.rbi +0 -64
  253. data/rbi/openai/models/beta/threads/run_create_params.rbi +0 -825
  254. data/rbi/openai/models/beta/threads/run_list_params.rbi +0 -144
  255. data/rbi/openai/models/beta/threads/run_retrieve_params.rbi +0 -64
  256. data/rbi/openai/models/beta/threads/run_status.rbi +0 -39
  257. data/rbi/openai/models/beta/threads/run_submit_tool_outputs_params.rbi +0 -132
  258. data/rbi/openai/models/beta/threads/run_update_params.rbi +0 -88
  259. data/rbi/openai/models/beta/threads/runs/code_interpreter_logs.rbi +0 -79
  260. data/rbi/openai/models/beta/threads/runs/code_interpreter_output_image.rbi +0 -118
  261. data/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi +0 -315
  262. data/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi +0 -210
  263. data/rbi/openai/models/beta/threads/runs/file_search_tool_call.rbi +0 -409
  264. data/rbi/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi +0 -89
  265. data/rbi/openai/models/beta/threads/runs/function_tool_call.rbi +0 -138
  266. data/rbi/openai/models/beta/threads/runs/function_tool_call_delta.rbi +0 -161
  267. data/rbi/openai/models/beta/threads/runs/message_creation_step_details.rbi +0 -111
  268. data/rbi/openai/models/beta/threads/runs/run_step.rbi +0 -422
  269. data/rbi/openai/models/beta/threads/runs/run_step_delta.rbi +0 -91
  270. data/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi +0 -82
  271. data/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi +0 -113
  272. data/rbi/openai/models/beta/threads/runs/run_step_include.rbi +0 -37
  273. data/rbi/openai/models/beta/threads/runs/step_list_params.rbi +0 -181
  274. data/rbi/openai/models/beta/threads/runs/step_retrieve_params.rbi +0 -105
  275. data/rbi/openai/models/beta/threads/runs/tool_call.rbi +0 -37
  276. data/rbi/openai/models/beta/threads/runs/tool_call_delta.rbi +0 -37
  277. data/rbi/openai/models/beta/threads/runs/tool_call_delta_object.rbi +0 -91
  278. data/rbi/openai/models/beta/threads/runs/tool_calls_step_details.rbi +0 -77
  279. data/rbi/openai/models/beta/threads/text.rbi +0 -65
  280. data/rbi/openai/models/beta/threads/text_content_block.rbi +0 -64
  281. data/rbi/openai/models/beta/threads/text_content_block_param.rbi +0 -63
  282. data/rbi/openai/models/beta/threads/text_delta.rbi +0 -81
  283. data/rbi/openai/models/beta/threads/text_delta_block.rbi +0 -73
  284. data/rbi/openai/models/image_input_reference_param.rbi +0 -58
  285. data/rbi/openai/models/video.rbi +0 -203
  286. data/rbi/openai/models/video_create_character_params.rbi +0 -68
  287. data/rbi/openai/models/video_create_character_response.rbi +0 -63
  288. data/rbi/openai/models/video_create_error.rbi +0 -255
  289. data/rbi/openai/models/video_create_params.rbi +0 -132
  290. data/rbi/openai/models/video_delete_params.rbi +0 -49
  291. data/rbi/openai/models/video_delete_response.rbi +0 -64
  292. data/rbi/openai/models/video_download_content_params.rbi +0 -81
  293. data/rbi/openai/models/video_edit_params.rbi +0 -122
  294. data/rbi/openai/models/video_extend_params.rbi +0 -134
  295. data/rbi/openai/models/video_get_character_params.rbi +0 -49
  296. data/rbi/openai/models/video_get_character_response.rbi +0 -63
  297. data/rbi/openai/models/video_list_params.rbi +0 -101
  298. data/rbi/openai/models/video_model.rbi +0 -35
  299. data/rbi/openai/models/video_remix_params.rbi +0 -58
  300. data/rbi/openai/models/video_retrieve_params.rbi +0 -49
  301. data/rbi/openai/models/video_seconds.rbi +0 -22
  302. data/rbi/openai/models/video_size.rbi +0 -23
  303. data/rbi/openai/resources/beta/assistants.rbi +0 -285
  304. data/rbi/openai/resources/beta/threads/messages.rbi +0 -161
  305. data/rbi/openai/resources/beta/threads/runs/steps.rbi +0 -107
  306. data/rbi/openai/resources/beta/threads/runs.rbi +0 -527
  307. data/rbi/openai/resources/beta/threads.rbi +0 -391
  308. data/rbi/openai/resources/videos.rbi +0 -205
  309. data/sig/openai/models/beta/assistant.rbs +0 -278
  310. data/sig/openai/models/beta/assistant_create_params.rbs +0 -485
  311. data/sig/openai/models/beta/assistant_delete_params.rbs +0 -25
  312. data/sig/openai/models/beta/assistant_deleted.rbs +0 -28
  313. data/sig/openai/models/beta/assistant_list_params.rbs +0 -104
  314. data/sig/openai/models/beta/assistant_response_format_option.rbs +0 -17
  315. data/sig/openai/models/beta/assistant_retrieve_params.rbs +0 -25
  316. data/sig/openai/models/beta/assistant_stream_event.rbs +0 -645
  317. data/sig/openai/models/beta/assistant_tool.rbs +0 -16
  318. data/sig/openai/models/beta/assistant_tool_choice.rbs +0 -46
  319. data/sig/openai/models/beta/assistant_tool_choice_function.rbs +0 -18
  320. data/sig/openai/models/beta/assistant_tool_choice_option.rbs +0 -27
  321. data/sig/openai/models/beta/assistant_update_params.rbs +0 -396
  322. data/sig/openai/models/beta/code_interpreter_tool.rbs +0 -18
  323. data/sig/openai/models/beta/file_search_tool.rbs +0 -159
  324. data/sig/openai/models/beta/function_tool.rbs +0 -27
  325. data/sig/openai/models/beta/message_stream_event.rbs +0 -153
  326. data/sig/openai/models/beta/run_step_stream_event.rbs +0 -197
  327. data/sig/openai/models/beta/run_stream_event.rbs +0 -269
  328. data/sig/openai/models/beta/thread.rbs +0 -150
  329. data/sig/openai/models/beta/thread_create_and_run_params.rbs +0 -885
  330. data/sig/openai/models/beta/thread_create_params.rbs +0 -492
  331. data/sig/openai/models/beta/thread_delete_params.rbs +0 -25
  332. data/sig/openai/models/beta/thread_deleted.rbs +0 -28
  333. data/sig/openai/models/beta/thread_retrieve_params.rbs +0 -25
  334. data/sig/openai/models/beta/thread_stream_event.rbs +0 -43
  335. data/sig/openai/models/beta/thread_update_params.rbs +0 -137
  336. data/sig/openai/models/beta/threads/annotation.rbs +0 -17
  337. data/sig/openai/models/beta/threads/annotation_delta.rbs +0 -17
  338. data/sig/openai/models/beta/threads/file_citation_annotation.rbs +0 -63
  339. data/sig/openai/models/beta/threads/file_citation_delta_annotation.rbs +0 -93
  340. data/sig/openai/models/beta/threads/file_path_annotation.rbs +0 -63
  341. data/sig/openai/models/beta/threads/file_path_delta_annotation.rbs +0 -85
  342. data/sig/openai/models/beta/threads/image_file.rbs +0 -59
  343. data/sig/openai/models/beta/threads/image_file_content_block.rbs +0 -29
  344. data/sig/openai/models/beta/threads/image_file_delta.rbs +0 -64
  345. data/sig/openai/models/beta/threads/image_file_delta_block.rbs +0 -44
  346. data/sig/openai/models/beta/threads/image_url.rbs +0 -57
  347. data/sig/openai/models/beta/threads/image_url_content_block.rbs +0 -29
  348. data/sig/openai/models/beta/threads/image_url_delta.rbs +0 -61
  349. data/sig/openai/models/beta/threads/image_url_delta_block.rbs +0 -44
  350. data/sig/openai/models/beta/threads/message.rbs +0 -275
  351. data/sig/openai/models/beta/threads/message_content.rbs +0 -19
  352. data/sig/openai/models/beta/threads/message_content_delta.rbs +0 -19
  353. data/sig/openai/models/beta/threads/message_content_part_param.rbs +0 -18
  354. data/sig/openai/models/beta/threads/message_create_params.rbs +0 -167
  355. data/sig/openai/models/beta/threads/message_delete_params.rbs +0 -35
  356. data/sig/openai/models/beta/threads/message_deleted.rbs +0 -30
  357. data/sig/openai/models/beta/threads/message_delta.rbs +0 -56
  358. data/sig/openai/models/beta/threads/message_delta_event.rbs +0 -43
  359. data/sig/openai/models/beta/threads/message_list_params.rbs +0 -122
  360. data/sig/openai/models/beta/threads/message_retrieve_params.rbs +0 -35
  361. data/sig/openai/models/beta/threads/message_update_params.rbs +0 -53
  362. data/sig/openai/models/beta/threads/refusal_content_block.rbs +0 -22
  363. data/sig/openai/models/beta/threads/refusal_delta_block.rbs +0 -34
  364. data/sig/openai/models/beta/threads/required_action_function_tool_call.rbs +0 -69
  365. data/sig/openai/models/beta/threads/run.rbs +0 -545
  366. data/sig/openai/models/beta/threads/run_cancel_params.rbs +0 -35
  367. data/sig/openai/models/beta/threads/run_create_params.rbs +0 -524
  368. data/sig/openai/models/beta/threads/run_list_params.rbs +0 -111
  369. data/sig/openai/models/beta/threads/run_retrieve_params.rbs +0 -35
  370. data/sig/openai/models/beta/threads/run_status.rbs +0 -34
  371. data/sig/openai/models/beta/threads/run_submit_tool_outputs_params.rbs +0 -70
  372. data/sig/openai/models/beta/threads/run_update_params.rbs +0 -53
  373. data/sig/openai/models/beta/threads/runs/code_interpreter_logs.rbs +0 -40
  374. data/sig/openai/models/beta/threads/runs/code_interpreter_output_image.rbs +0 -65
  375. data/sig/openai/models/beta/threads/runs/code_interpreter_tool_call.rbs +0 -147
  376. data/sig/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbs +0 -115
  377. data/sig/openai/models/beta/threads/runs/file_search_tool_call.rbs +0 -228
  378. data/sig/openai/models/beta/threads/runs/file_search_tool_call_delta.rbs +0 -58
  379. data/sig/openai/models/beta/threads/runs/function_tool_call.rbs +0 -80
  380. data/sig/openai/models/beta/threads/runs/function_tool_call_delta.rbs +0 -103
  381. data/sig/openai/models/beta/threads/runs/message_creation_step_details.rbs +0 -47
  382. data/sig/openai/models/beta/threads/runs/run_step.rbs +0 -290
  383. data/sig/openai/models/beta/threads/runs/run_step_delta.rbs +0 -46
  384. data/sig/openai/models/beta/threads/runs/run_step_delta_event.rbs +0 -47
  385. data/sig/openai/models/beta/threads/runs/run_step_delta_message_delta.rbs +0 -56
  386. data/sig/openai/models/beta/threads/runs/run_step_include.rbs +0 -22
  387. data/sig/openai/models/beta/threads/runs/step_list_params.rbs +0 -149
  388. data/sig/openai/models/beta/threads/runs/step_retrieve_params.rbs +0 -73
  389. data/sig/openai/models/beta/threads/runs/tool_call.rbs +0 -20
  390. data/sig/openai/models/beta/threads/runs/tool_call_delta.rbs +0 -20
  391. data/sig/openai/models/beta/threads/runs/tool_call_delta_object.rbs +0 -48
  392. data/sig/openai/models/beta/threads/runs/tool_calls_step_details.rbs +0 -41
  393. data/sig/openai/models/beta/threads/text.rbs +0 -32
  394. data/sig/openai/models/beta/threads/text_content_block.rbs +0 -26
  395. data/sig/openai/models/beta/threads/text_content_block_param.rbs +0 -25
  396. data/sig/openai/models/beta/threads/text_delta.rbs +0 -39
  397. data/sig/openai/models/beta/threads/text_delta_block.rbs +0 -44
  398. data/sig/openai/models/image_input_reference_param.rbs +0 -23
  399. data/sig/openai/models/video.rbs +0 -142
  400. data/sig/openai/models/video_create_character_params.rbs +0 -45
  401. data/sig/openai/models/video_create_character_response.rbs +0 -27
  402. data/sig/openai/models/video_create_error.rbs +0 -163
  403. data/sig/openai/models/video_create_params.rbs +0 -104
  404. data/sig/openai/models/video_delete_params.rbs +0 -23
  405. data/sig/openai/models/video_delete_response.rbs +0 -31
  406. data/sig/openai/models/video_download_content_params.rbs +0 -51
  407. data/sig/openai/models/video_edit_params.rbs +0 -77
  408. data/sig/openai/models/video_extend_params.rbs +0 -87
  409. data/sig/openai/models/video_get_character_params.rbs +0 -23
  410. data/sig/openai/models/video_get_character_response.rbs +0 -27
  411. data/sig/openai/models/video_list_params.rbs +0 -70
  412. data/sig/openai/models/video_model.rbs +0 -23
  413. data/sig/openai/models/video_remix_params.rbs +0 -34
  414. data/sig/openai/models/video_retrieve_params.rbs +0 -23
  415. data/sig/openai/models/video_seconds.rbs +0 -15
  416. data/sig/openai/models/video_size.rbs +0 -16
  417. data/sig/openai/resources/beta/assistants.rbs +0 -58
  418. data/sig/openai/resources/beta/threads/messages.rbs +0 -49
  419. data/sig/openai/resources/beta/threads/runs/steps.rbs +0 -32
  420. data/sig/openai/resources/beta/threads/runs.rbs +0 -99
  421. data/sig/openai/resources/beta/threads.rbs +0 -75
  422. data/sig/openai/resources/videos.rbs +0 -69
@@ -1,1461 +0,0 @@
1
- # typed: strong
2
-
3
- module OpenAI
4
- module Models
5
-
6
- module Beta
7
-
8
- class ThreadCreateAndRunParams < OpenAI::Internal::Type::BaseModel
9
-
10
- extend OpenAI::Internal::Type::RequestParameters::Converter
11
- include OpenAI::Internal::Type::RequestParameters
12
-
13
- OrHash = T.type_alias do
14
- T.any(
15
- OpenAI::Beta::ThreadCreateAndRunParams,
16
- OpenAI::Internal::AnyHash
17
- )
18
- end
19
-
20
- # The ID of the
21
- # [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
22
- # to execute this run.
23
- sig { returns(String) }
24
- attr_accessor :assistant_id
25
-
26
- # Override the default system message of the assistant. This is useful for
27
- # modifying the behavior on a per-run basis.
28
- sig { returns(T.nilable(String)) }
29
- attr_accessor :instructions
30
-
31
- # The maximum number of completion tokens that may be used over the course of the
32
- # run. The run will make a best effort to use only the number of completion tokens
33
- # specified, across multiple turns of the run. If the run exceeds the number of
34
- # completion tokens specified, the run will end with status `incomplete`. See
35
- # `incomplete_details` for more info.
36
- sig { returns(T.nilable(Integer)) }
37
- attr_accessor :max_completion_tokens
38
-
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
- sig { returns(T.nilable(Integer)) }
45
- attr_accessor :max_prompt_tokens
46
-
47
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
48
- # for storing additional information about the object in a structured format, and
49
- # querying for objects via API or the dashboard.
50
- #
51
- # Keys are strings with a maximum length of 64 characters. Values are strings with
52
- # a maximum length of 512 characters.
53
- sig { returns(T.nilable(T::Hash[Symbol, String])) }
54
- attr_accessor :metadata
55
-
56
- # The ID of the
57
- # [Model](https://developers.openai.com/api/reference/resources/models) to be used
58
- # to execute this run. If a value is provided here, it will override the model
59
- # associated with the assistant. If not, the model associated with the assistant
60
- # will be used.
61
- sig { returns(T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol))) }
62
- attr_accessor :model
63
-
64
- # Whether to enable
65
- # [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
66
- # during tool use.
67
- sig { returns(T.nilable(T::Boolean)) }
68
- attr_reader :parallel_tool_calls
69
-
70
- sig { params(parallel_tool_calls: T::Boolean).void }
71
- attr_writer :parallel_tool_calls
72
-
73
- # Specifies the format that the model must output. Compatible with
74
- # [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
75
- # [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
76
- # all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
77
- #
78
- # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
79
- # Outputs which ensures the model will match your supplied JSON schema. Learn more
80
- # in the
81
- # [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
82
- #
83
- # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
84
- # message the model generates is valid JSON.
85
- #
86
- # **Important:** when using JSON mode, you **must** also instruct the model to
87
- # produce JSON yourself via a system or user message. Without this, the model may
88
- # generate an unending stream of whitespace until the generation reaches the token
89
- # limit, resulting in a long-running and seemingly "stuck" request. Also note that
90
- # the message content may be partially cut off if `finish_reason="length"`, which
91
- # indicates the generation exceeded `max_tokens` or the conversation exceeded the
92
- # max context length.
93
- sig {
94
- returns(
95
- T.nilable(
96
- T.any(
97
- Symbol,
98
- OpenAI::ResponseFormatText,
99
- OpenAI::ResponseFormatJSONObject,
100
- OpenAI::ResponseFormatJSONSchema
101
- )
102
- )
103
- )
104
- }
105
- attr_accessor :response_format
106
-
107
- # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
108
- # make the output more random, while lower values like 0.2 will make it more
109
- # focused and deterministic.
110
- sig { returns(T.nilable(Float)) }
111
- attr_accessor :temperature
112
-
113
- # Options to create a new thread. If no thread is provided when running a request,
114
- # an empty thread will be created.
115
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::Thread)) }
116
- attr_reader :thread
117
-
118
- sig { params(thread: OpenAI::Beta::ThreadCreateAndRunParams::Thread::OrHash).void }
119
- attr_writer :thread
120
-
121
- # Controls which (if any) tool is called by the model. `none` means the model will
122
- # not call any tools and instead generates a message. `auto` is the default value
123
- # and means the model can pick between generating a message or calling one or more
124
- # tools. `required` means the model must call one or more tools before responding
125
- # to the user. Specifying a particular tool like `{"type": "file_search"}` or
126
- # `{"type": "function", "function": {"name": "my_function"}}` forces the model to
127
- # call that tool.
128
- sig {
129
- returns(
130
- T.nilable(T.any(OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol, OpenAI::Beta::AssistantToolChoice))
131
- )
132
- }
133
- attr_accessor :tool_choice
134
-
135
- # A set of resources that are used by the assistant's tools. The resources are
136
- # specific to the type of tool. For example, the `code_interpreter` tool requires
137
- # a list of file IDs, while the `file_search` tool requires a list of vector store
138
- # IDs.
139
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources)) }
140
- attr_reader :tool_resources
141
-
142
- sig { params(tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::OrHash)).void }
143
- attr_writer :tool_resources
144
-
145
- # Override the tools the assistant can use for this run. This is useful for
146
- # modifying the behavior on a per-run basis.
147
- sig {
148
- returns(
149
- T.nilable(
150
- T::Array[
151
- T.any(OpenAI::Beta::CodeInterpreterTool, OpenAI::Beta::FileSearchTool, OpenAI::Beta::FunctionTool)
152
- ]
153
- )
154
- )
155
- }
156
- attr_accessor :tools
157
-
158
- # An alternative to sampling with temperature, called nucleus sampling, where the
159
- # model considers the results of the tokens with top_p probability mass. So 0.1
160
- # means only the tokens comprising the top 10% probability mass are considered.
161
- #
162
- # We generally recommend altering this or temperature but not both.
163
- sig { returns(T.nilable(Float)) }
164
- attr_accessor :top_p
165
-
166
- # Controls for how a thread will be truncated prior to the run. Use this to
167
- # control the initial context window of the run.
168
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy)) }
169
- attr_reader :truncation_strategy
170
-
171
- sig {
172
- params(truncation_strategy: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::OrHash))
173
- .void
174
- }
175
- attr_writer :truncation_strategy
176
-
177
- sig do
178
- params(
179
-
180
- assistant_id: String,
181
-
182
- instructions: T.nilable(String),
183
-
184
- max_completion_tokens: T.nilable(Integer),
185
-
186
- max_prompt_tokens: T.nilable(Integer),
187
-
188
- metadata: T.nilable(T::Hash[Symbol, String]),
189
-
190
- model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
191
-
192
- parallel_tool_calls: T::Boolean,
193
-
194
- response_format: T.nilable(
195
- T.any(
196
- Symbol,
197
- OpenAI::ResponseFormatText::OrHash,
198
- OpenAI::ResponseFormatJSONObject::OrHash,
199
- OpenAI::ResponseFormatJSONSchema::OrHash
200
- )
201
- ),
202
-
203
- temperature: T.nilable(Float),
204
-
205
- thread: OpenAI::Beta::ThreadCreateAndRunParams::Thread::OrHash,
206
-
207
- tool_choice: T.nilable(
208
- T.any(OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol, OpenAI::Beta::AssistantToolChoice::OrHash)
209
- ),
210
-
211
- tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::OrHash),
212
-
213
- tools: T.nilable(
214
- T::Array[
215
- T.any(
216
- OpenAI::Beta::CodeInterpreterTool::OrHash,
217
- OpenAI::Beta::FileSearchTool::OrHash,
218
- OpenAI::Beta::FunctionTool::OrHash
219
- )
220
- ]
221
- ),
222
-
223
- top_p: T.nilable(Float),
224
-
225
- truncation_strategy: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::OrHash),
226
-
227
- request_options: OpenAI::RequestOptions::OrHash
228
- )
229
- .returns(T.attached_class)
230
- end
231
- def self.new(
232
-
233
- # The ID of the
234
- # [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
235
- # to execute this run.
236
- assistant_id:,
237
-
238
- # Override the default system message of the assistant. This is useful for
239
- # modifying the behavior on a per-run basis.
240
- instructions: nil,
241
-
242
- # The maximum number of completion tokens that may be used over the course of the
243
- # run. The run will make a best effort to use only the number of completion tokens
244
- # specified, across multiple turns of the run. If the run exceeds the number of
245
- # completion tokens specified, the run will end with status `incomplete`. See
246
- # `incomplete_details` for more info.
247
- max_completion_tokens: nil,
248
-
249
- # The maximum number of prompt tokens that may be used over the course of the run.
250
- # The run will make a best effort to use only the number of prompt tokens
251
- # specified, across multiple turns of the run. If the run exceeds the number of
252
- # prompt tokens specified, the run will end with status `incomplete`. See
253
- # `incomplete_details` for more info.
254
- max_prompt_tokens: nil,
255
-
256
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
257
- # for storing additional information about the object in a structured format, and
258
- # querying for objects via API or the dashboard.
259
- #
260
- # Keys are strings with a maximum length of 64 characters. Values are strings with
261
- # a maximum length of 512 characters.
262
- metadata: nil,
263
-
264
- # The ID of the
265
- # [Model](https://developers.openai.com/api/reference/resources/models) to be used
266
- # to execute this run. If a value is provided here, it will override the model
267
- # associated with the assistant. If not, the model associated with the assistant
268
- # will be used.
269
- model: nil,
270
-
271
- # Whether to enable
272
- # [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
273
- # during tool use.
274
- parallel_tool_calls: nil,
275
-
276
- # Specifies the format that the model must output. Compatible with
277
- # [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
278
- # [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
279
- # all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
280
- #
281
- # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
282
- # Outputs which ensures the model will match your supplied JSON schema. Learn more
283
- # in the
284
- # [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
285
- #
286
- # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
287
- # message the model generates is valid JSON.
288
- #
289
- # **Important:** when using JSON mode, you **must** also instruct the model to
290
- # produce JSON yourself via a system or user message. Without this, the model may
291
- # generate an unending stream of whitespace until the generation reaches the token
292
- # limit, resulting in a long-running and seemingly "stuck" request. Also note that
293
- # the message content may be partially cut off if `finish_reason="length"`, which
294
- # indicates the generation exceeded `max_tokens` or the conversation exceeded the
295
- # max context length.
296
- response_format: nil,
297
-
298
- # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
299
- # make the output more random, while lower values like 0.2 will make it more
300
- # focused and deterministic.
301
- temperature: nil,
302
-
303
- # Options to create a new thread. If no thread is provided when running a request,
304
- # an empty thread will be created.
305
- thread: nil,
306
-
307
- # Controls which (if any) tool is called by the model. `none` means the model will
308
- # not call any tools and instead generates a message. `auto` is the default value
309
- # and means the model can pick between generating a message or calling one or more
310
- # tools. `required` means the model must call one or more tools before responding
311
- # to the user. Specifying a particular tool like `{"type": "file_search"}` or
312
- # `{"type": "function", "function": {"name": "my_function"}}` forces the model to
313
- # call that tool.
314
- tool_choice: nil,
315
-
316
- # A set of resources that are used by the assistant's tools. The resources are
317
- # specific to the type of tool. For example, the `code_interpreter` tool requires
318
- # a list of file IDs, while the `file_search` tool requires a list of vector store
319
- # IDs.
320
- tool_resources: nil,
321
-
322
- # Override the tools the assistant can use for this run. This is useful for
323
- # modifying the behavior on a per-run basis.
324
- tools: nil,
325
-
326
- # An alternative to sampling with temperature, called nucleus sampling, where the
327
- # model considers the results of the tokens with top_p probability mass. So 0.1
328
- # means only the tokens comprising the top 10% probability mass are considered.
329
- #
330
- # We generally recommend altering this or temperature but not both.
331
- top_p: nil,
332
-
333
- # Controls for how a thread will be truncated prior to the run. Use this to
334
- # control the initial context window of the run.
335
- truncation_strategy: nil,
336
-
337
- request_options: {}
338
- )
339
- end
340
-
341
- sig do
342
- override.returns(
343
- {
344
- assistant_id: String,
345
- instructions: T.nilable(String),
346
- max_completion_tokens: T.nilable(Integer),
347
- max_prompt_tokens: T.nilable(Integer),
348
- metadata: T.nilable(T::Hash[Symbol, String]),
349
- model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
350
- parallel_tool_calls: T::Boolean,
351
- response_format: T.nilable(
352
- T.any(
353
- Symbol,
354
- OpenAI::ResponseFormatText,
355
- OpenAI::ResponseFormatJSONObject,
356
- OpenAI::ResponseFormatJSONSchema
357
- )
358
- ),
359
- temperature: T.nilable(Float),
360
- thread: OpenAI::Beta::ThreadCreateAndRunParams::Thread,
361
- tool_choice: T.nilable(
362
- T.any(OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol, OpenAI::Beta::AssistantToolChoice)
363
- ),
364
- tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources),
365
- tools: T.nilable(
366
- T::Array[
367
- T.any(OpenAI::Beta::CodeInterpreterTool, OpenAI::Beta::FileSearchTool, OpenAI::Beta::FunctionTool)
368
- ]
369
- ),
370
- top_p: T.nilable(Float),
371
- truncation_strategy: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy),
372
- request_options: OpenAI::RequestOptions
373
- }
374
- )
375
- end
376
- def to_hash
377
- end
378
-
379
- # The ID of the
380
- # [Model](https://developers.openai.com/api/reference/resources/models) to be used
381
- # to execute this run. If a value is provided here, it will override the model
382
- # associated with the assistant. If not, the model associated with the assistant
383
- # will be used.
384
- module Model
385
- extend OpenAI::Internal::Type::Union
386
-
387
- Variants = T.type_alias { T.any(String, OpenAI::ChatModel::TaggedSymbol) }
388
-
389
- sig { override.returns(T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Model::Variants]) }
390
- def self.variants
391
- end
392
-
393
- end
394
-
395
- class Thread < OpenAI::Internal::Type::BaseModel
396
- OrHash = T.type_alias do
397
- T.any(
398
- OpenAI::Beta::ThreadCreateAndRunParams::Thread,
399
- OpenAI::Internal::AnyHash
400
- )
401
- end
402
-
403
- # A list of
404
- # [messages](https://developers.openai.com/api/docs/assistants/migration) to start
405
- # the thread with.
406
- sig { returns(T.nilable(T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message])) }
407
- attr_reader :messages
408
-
409
- sig { params(messages: T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::OrHash]).void }
410
- attr_writer :messages
411
-
412
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
413
- # for storing additional information about the object in a structured format, and
414
- # querying for objects via API or the dashboard.
415
- #
416
- # Keys are strings with a maximum length of 64 characters. Values are strings with
417
- # a maximum length of 512 characters.
418
- sig { returns(T.nilable(T::Hash[Symbol, String])) }
419
- attr_accessor :metadata
420
-
421
- # A set of resources that are made available to the assistant's tools in this
422
- # thread. The resources are specific to the type of tool. For example, the
423
- # `code_interpreter` tool requires a list of file IDs, while the `file_search`
424
- # tool requires a list of vector store IDs.
425
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources)) }
426
- attr_reader :tool_resources
427
-
428
- sig {
429
- params(tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::OrHash))
430
- .void
431
- }
432
- attr_writer :tool_resources
433
-
434
- # Options to create a new thread. If no thread is provided when running a request,
435
- # an empty thread will be created.
436
- sig do
437
- params(
438
-
439
- messages: T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::OrHash],
440
-
441
- metadata: T.nilable(T::Hash[Symbol, String]),
442
-
443
- tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::OrHash)
444
- )
445
- .returns(T.attached_class)
446
- end
447
- def self.new(
448
-
449
- # A list of
450
- # [messages](https://developers.openai.com/api/docs/assistants/migration) to start
451
- # the thread with.
452
- messages: nil,
453
-
454
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
455
- # for storing additional information about the object in a structured format, and
456
- # querying for objects via API or the dashboard.
457
- #
458
- # Keys are strings with a maximum length of 64 characters. Values are strings with
459
- # a maximum length of 512 characters.
460
- metadata: nil,
461
-
462
- # A set of resources that are made available to the assistant's tools in this
463
- # thread. The resources are specific to the type of tool. For example, the
464
- # `code_interpreter` tool requires a list of file IDs, while the `file_search`
465
- # tool requires a list of vector store IDs.
466
-
467
- tool_resources: nil
468
- )
469
- end
470
-
471
- sig do
472
- override.returns(
473
- {
474
- messages: T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message],
475
- metadata: T.nilable(T::Hash[Symbol, String]),
476
- tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources)
477
- }
478
- )
479
- end
480
- def to_hash
481
- end
482
-
483
- class Message < OpenAI::Internal::Type::BaseModel
484
- OrHash = T.type_alias do
485
- T.any(
486
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message,
487
- OpenAI::Internal::AnyHash
488
- )
489
- end
490
-
491
- # The text contents of the message.
492
- sig { returns(OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Content::Variants) }
493
- attr_accessor :content
494
-
495
- # The role of the entity that is creating the message. Allowed values include:
496
- #
497
- # - `user`: Indicates the message is sent by an actual user and should be used in
498
- # most cases to represent user-generated messages.
499
- # - `assistant`: Indicates the message is generated by the assistant. Use this
500
- # value to insert messages from the assistant into the conversation.
501
- sig { returns(OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role::OrSymbol) }
502
- attr_accessor :role
503
-
504
- # A list of files attached to the message, and the tools they should be added to.
505
- sig { returns(T.nilable(T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment])) }
506
- attr_accessor :attachments
507
-
508
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
509
- # for storing additional information about the object in a structured format, and
510
- # querying for objects via API or the dashboard.
511
- #
512
- # Keys are strings with a maximum length of 64 characters. Values are strings with
513
- # a maximum length of 512 characters.
514
- sig { returns(T.nilable(T::Hash[Symbol, String])) }
515
- attr_accessor :metadata
516
-
517
- sig do
518
- params(
519
-
520
- content: OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Content::Variants,
521
-
522
- role: OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role::OrSymbol,
523
-
524
- attachments: T.nilable(
525
- T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::OrHash]
526
- ),
527
-
528
- metadata: T.nilable(T::Hash[Symbol, String])
529
- )
530
- .returns(T.attached_class)
531
- end
532
- def self.new(
533
-
534
- # The text contents of the message.
535
- content:,
536
-
537
- # The role of the entity that is creating the message. Allowed values include:
538
- #
539
- # - `user`: Indicates the message is sent by an actual user and should be used in
540
- # most cases to represent user-generated messages.
541
- # - `assistant`: Indicates the message is generated by the assistant. Use this
542
- # value to insert messages from the assistant into the conversation.
543
- role:,
544
-
545
- # A list of files attached to the message, and the tools they should be added to.
546
- attachments: nil,
547
-
548
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
549
- # for storing additional information about the object in a structured format, and
550
- # querying for objects via API or the dashboard.
551
- #
552
- # Keys are strings with a maximum length of 64 characters. Values are strings with
553
- # a maximum length of 512 characters.
554
-
555
- metadata: nil
556
- )
557
- end
558
-
559
- sig do
560
- override.returns(
561
- {
562
- content: OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Content::Variants,
563
- role: OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role::OrSymbol,
564
- attachments: T.nilable(T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment]),
565
- metadata: T.nilable(T::Hash[Symbol, String])
566
- }
567
- )
568
- end
569
- def to_hash
570
- end
571
-
572
- # The text contents of the message.
573
- module Content
574
- extend OpenAI::Internal::Type::Union
575
-
576
- Variants = T.type_alias {
577
- T.any(String, T::Array[OpenAI::Beta::Threads::MessageContentPartParam::Variants])
578
- }
579
-
580
- sig {
581
- override.returns(T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Content::Variants])
582
- }
583
- def self.variants
584
- end
585
-
586
- MessageContentPartParamArray = T.let(
587
- OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::Threads::MessageContentPartParam],
588
- OpenAI::Internal::Type::Converter
589
- )
590
-
591
- end
592
-
593
- # The role of the entity that is creating the message. Allowed values include:
594
- #
595
- # - `user`: Indicates the message is sent by an actual user and should be used in
596
- # most cases to represent user-generated messages.
597
- # - `assistant`: Indicates the message is generated by the assistant. Use this
598
- # value to insert messages from the assistant into the conversation.
599
- module Role
600
- extend OpenAI::Internal::Type::Enum
601
-
602
- TaggedSymbol = T.type_alias {
603
- T.all(Symbol, OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role)
604
- }
605
- OrSymbol = T.type_alias { T.any(Symbol, String) }
606
-
607
- USER = T.let(:user, OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role::TaggedSymbol)
608
- ASSISTANT = T.let(:assistant, OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role::TaggedSymbol)
609
-
610
- sig {
611
- override.returns(T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Role::TaggedSymbol])
612
- }
613
- def self.values
614
- end
615
- end
616
-
617
- class Attachment < OpenAI::Internal::Type::BaseModel
618
- OrHash = T.type_alias do
619
- T.any(
620
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment,
621
- OpenAI::Internal::AnyHash
622
- )
623
- end
624
-
625
- # The ID of the file to attach to the message.
626
- sig { returns(T.nilable(String)) }
627
- attr_reader :file_id
628
-
629
- sig { params(file_id: String).void }
630
- attr_writer :file_id
631
-
632
- # The tools to add this file to.
633
- sig {
634
- returns(
635
- T.nilable(
636
- T::Array[
637
- T.any(
638
- OpenAI::Beta::CodeInterpreterTool,
639
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch
640
- )
641
- ]
642
- )
643
- )
644
- }
645
- attr_reader :tools
646
-
647
- sig {
648
- params(
649
- tools: T::Array[
650
- T.any(
651
- OpenAI::Beta::CodeInterpreterTool::OrHash,
652
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch::OrHash
653
- )
654
- ]
655
- )
656
- .void
657
- }
658
- attr_writer :tools
659
-
660
- sig do
661
- params(
662
-
663
- file_id: String,
664
-
665
- tools: T::Array[
666
- T.any(
667
- OpenAI::Beta::CodeInterpreterTool::OrHash,
668
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch::OrHash
669
- )
670
- ]
671
- )
672
- .returns(T.attached_class)
673
- end
674
- def self.new(
675
-
676
- # The ID of the file to attach to the message.
677
- file_id: nil,
678
-
679
- # The tools to add this file to.
680
-
681
- tools: nil
682
- )
683
- end
684
-
685
- sig do
686
- override.returns(
687
- {
688
- file_id: String,
689
- tools: T::Array[
690
- T.any(
691
- OpenAI::Beta::CodeInterpreterTool,
692
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch
693
- )
694
- ]
695
- }
696
- )
697
- end
698
- def to_hash
699
- end
700
-
701
- module Tool
702
- extend OpenAI::Internal::Type::Union
703
-
704
- Variants = T.type_alias {
705
- T.any(
706
- OpenAI::Beta::CodeInterpreterTool,
707
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch
708
- )
709
- }
710
-
711
- class FileSearch < OpenAI::Internal::Type::BaseModel
712
- OrHash = T.type_alias do
713
- T.any(
714
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch,
715
- OpenAI::Internal::AnyHash
716
- )
717
- end
718
-
719
- # The type of tool being defined: `file_search`
720
- sig { returns(Symbol) }
721
- attr_accessor :type
722
-
723
- sig do
724
- params(
725
-
726
- type: Symbol
727
- )
728
- .returns(T.attached_class)
729
- end
730
- def self.new(
731
-
732
- # The type of tool being defined: `file_search`
733
-
734
- type: :file_search
735
- )
736
- end
737
-
738
- sig do
739
- override.returns(
740
- {type: Symbol}
741
- )
742
- end
743
- def to_hash
744
- end
745
-
746
- end
747
-
748
- sig {
749
- override.returns(
750
- T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::Variants]
751
- )
752
- }
753
- def self.variants
754
- end
755
-
756
- end
757
- end
758
- end
759
-
760
- class ToolResources < OpenAI::Internal::Type::BaseModel
761
- OrHash = T.type_alias do
762
- T.any(
763
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources,
764
- OpenAI::Internal::AnyHash
765
- )
766
- end
767
-
768
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter)) }
769
- attr_reader :code_interpreter
770
-
771
- sig {
772
- params(
773
- code_interpreter: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter::OrHash
774
- )
775
- .void
776
- }
777
- attr_writer :code_interpreter
778
-
779
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch)) }
780
- attr_reader :file_search
781
-
782
- sig {
783
- params(file_search: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::OrHash)
784
- .void
785
- }
786
- attr_writer :file_search
787
-
788
- # A set of resources that are made available to the assistant's tools in this
789
- # thread. The resources are specific to the type of tool. For example, the
790
- # `code_interpreter` tool requires a list of file IDs, while the `file_search`
791
- # tool requires a list of vector store IDs.
792
- sig do
793
- params(
794
-
795
- code_interpreter: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter::OrHash,
796
-
797
- file_search: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::OrHash
798
- )
799
- .returns(T.attached_class)
800
- end
801
- def self.new(
802
-
803
- code_interpreter: nil,
804
-
805
- file_search: nil
806
- )
807
- end
808
-
809
- sig do
810
- override.returns(
811
- {
812
- code_interpreter: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter,
813
- file_search: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch
814
- }
815
- )
816
- end
817
- def to_hash
818
- end
819
-
820
- class CodeInterpreter < OpenAI::Internal::Type::BaseModel
821
- OrHash = T.type_alias do
822
- T.any(
823
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter,
824
- OpenAI::Internal::AnyHash
825
- )
826
- end
827
-
828
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
829
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
830
- # files associated with the tool.
831
- sig { returns(T.nilable(T::Array[String])) }
832
- attr_reader :file_ids
833
-
834
- sig { params(file_ids: T::Array[String]).void }
835
- attr_writer :file_ids
836
-
837
- sig do
838
- params(
839
-
840
- file_ids: T::Array[String]
841
- )
842
- .returns(T.attached_class)
843
- end
844
- def self.new(
845
-
846
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
847
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
848
- # files associated with the tool.
849
-
850
- file_ids: nil
851
- )
852
- end
853
-
854
- sig do
855
- override.returns(
856
- {file_ids: T::Array[String]}
857
- )
858
- end
859
- def to_hash
860
- end
861
-
862
- end
863
-
864
- class FileSearch < OpenAI::Internal::Type::BaseModel
865
- OrHash = T.type_alias do
866
- T.any(
867
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch,
868
- OpenAI::Internal::AnyHash
869
- )
870
- end
871
-
872
- # The
873
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
874
- # attached to this thread. There can be a maximum of 1 vector store attached to
875
- # the thread.
876
- sig { returns(T.nilable(T::Array[String])) }
877
- attr_reader :vector_store_ids
878
-
879
- sig { params(vector_store_ids: T::Array[String]).void }
880
- attr_writer :vector_store_ids
881
-
882
- # A helper to create a
883
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
884
- # with file_ids and attach it to this thread. There can be a maximum of 1 vector
885
- # store attached to the thread.
886
- sig {
887
- returns(
888
- T.nilable(
889
- T::Array[OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore]
890
- )
891
- )
892
- }
893
- attr_reader :vector_stores
894
-
895
- sig {
896
- params(
897
- vector_stores: T::Array[
898
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::OrHash
899
- ]
900
- )
901
- .void
902
- }
903
- attr_writer :vector_stores
904
-
905
- sig do
906
- params(
907
-
908
- vector_store_ids: T::Array[String],
909
-
910
- vector_stores: T::Array[
911
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::OrHash
912
- ]
913
- )
914
- .returns(T.attached_class)
915
- end
916
- def self.new(
917
-
918
- # The
919
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
920
- # attached to this thread. There can be a maximum of 1 vector store attached to
921
- # the thread.
922
- vector_store_ids: nil,
923
-
924
- # A helper to create a
925
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
926
- # with file_ids and attach it to this thread. There can be a maximum of 1 vector
927
- # store attached to the thread.
928
-
929
- vector_stores: nil
930
- )
931
- end
932
-
933
- sig do
934
- override.returns(
935
- {
936
- vector_store_ids: T::Array[String],
937
- vector_stores: T::Array[
938
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore
939
- ]
940
- }
941
- )
942
- end
943
- def to_hash
944
- end
945
-
946
- class VectorStore < OpenAI::Internal::Type::BaseModel
947
- OrHash = T.type_alias do
948
- T.any(
949
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore,
950
- OpenAI::Internal::AnyHash
951
- )
952
- end
953
-
954
- # The chunking strategy used to chunk the file(s). If not set, will use the `auto`
955
- # strategy.
956
- sig {
957
- returns(
958
- T.nilable(
959
- T.any(
960
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto,
961
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static
962
- )
963
- )
964
- )
965
- }
966
- attr_reader :chunking_strategy
967
-
968
- sig {
969
- params(
970
- chunking_strategy: T.any(
971
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto::OrHash,
972
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::OrHash
973
- )
974
- )
975
- .void
976
- }
977
- attr_writer :chunking_strategy
978
-
979
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
980
- # IDs to add to the vector store. For vector stores created before Nov 2025, there
981
- # can be a maximum of 10,000 files in a vector store. For vector stores created
982
- # starting in Nov 2025, the limit is 100,000,000 files.
983
- sig { returns(T.nilable(T::Array[String])) }
984
- attr_reader :file_ids
985
-
986
- sig { params(file_ids: T::Array[String]).void }
987
- attr_writer :file_ids
988
-
989
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
990
- # for storing additional information about the object in a structured format, and
991
- # querying for objects via API or the dashboard.
992
- #
993
- # Keys are strings with a maximum length of 64 characters. Values are strings with
994
- # a maximum length of 512 characters.
995
- sig { returns(T.nilable(T::Hash[Symbol, String])) }
996
- attr_accessor :metadata
997
-
998
- sig do
999
- params(
1000
-
1001
- chunking_strategy: T.any(
1002
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto::OrHash,
1003
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::OrHash
1004
- ),
1005
-
1006
- file_ids: T::Array[String],
1007
-
1008
- metadata: T.nilable(T::Hash[Symbol, String])
1009
- )
1010
- .returns(T.attached_class)
1011
- end
1012
- def self.new(
1013
-
1014
- # The chunking strategy used to chunk the file(s). If not set, will use the `auto`
1015
- # strategy.
1016
- chunking_strategy: nil,
1017
-
1018
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
1019
- # IDs to add to the vector store. For vector stores created before Nov 2025, there
1020
- # can be a maximum of 10,000 files in a vector store. For vector stores created
1021
- # starting in Nov 2025, the limit is 100,000,000 files.
1022
- file_ids: nil,
1023
-
1024
- # Set of 16 key-value pairs that can be attached to an object. This can be useful
1025
- # for storing additional information about the object in a structured format, and
1026
- # querying for objects via API or the dashboard.
1027
- #
1028
- # Keys are strings with a maximum length of 64 characters. Values are strings with
1029
- # a maximum length of 512 characters.
1030
-
1031
- metadata: nil
1032
- )
1033
- end
1034
-
1035
- sig do
1036
- override.returns(
1037
- {
1038
- chunking_strategy: T.any(
1039
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto,
1040
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static
1041
- ),
1042
- file_ids: T::Array[String],
1043
- metadata: T.nilable(T::Hash[Symbol, String])
1044
- }
1045
- )
1046
- end
1047
- def to_hash
1048
- end
1049
-
1050
- # The chunking strategy used to chunk the file(s). If not set, will use the `auto`
1051
- # strategy.
1052
- module ChunkingStrategy
1053
- extend OpenAI::Internal::Type::Union
1054
-
1055
- Variants = T.type_alias {
1056
- T.any(
1057
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto,
1058
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static
1059
- )
1060
- }
1061
-
1062
- class Auto < OpenAI::Internal::Type::BaseModel
1063
- OrHash = T.type_alias do
1064
- T.any(
1065
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto,
1066
- OpenAI::Internal::AnyHash
1067
- )
1068
- end
1069
-
1070
- # Always `auto`.
1071
- sig { returns(Symbol) }
1072
- attr_accessor :type
1073
-
1074
- # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
1075
- # `800` and `chunk_overlap_tokens` of `400`.
1076
- sig do
1077
- params(
1078
-
1079
- type: Symbol
1080
- )
1081
- .returns(T.attached_class)
1082
- end
1083
- def self.new(
1084
-
1085
- # Always `auto`.
1086
-
1087
- type: :auto
1088
- )
1089
- end
1090
-
1091
- sig do
1092
- override.returns(
1093
- {type: Symbol}
1094
- )
1095
- end
1096
- def to_hash
1097
- end
1098
-
1099
- end
1100
-
1101
- class Static < OpenAI::Internal::Type::BaseModel
1102
- OrHash = T.type_alias do
1103
- T.any(
1104
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static,
1105
- OpenAI::Internal::AnyHash
1106
- )
1107
- end
1108
-
1109
- sig {
1110
- returns(
1111
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static
1112
- )
1113
- }
1114
- attr_reader :static
1115
-
1116
- sig {
1117
- params(
1118
- static: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static::OrHash
1119
- )
1120
- .void
1121
- }
1122
- attr_writer :static
1123
-
1124
- # Always `static`.
1125
- sig { returns(Symbol) }
1126
- attr_accessor :type
1127
-
1128
- sig do
1129
- params(
1130
-
1131
- static: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static::OrHash,
1132
-
1133
- type: Symbol
1134
- )
1135
- .returns(T.attached_class)
1136
- end
1137
- def self.new(
1138
-
1139
- static:,
1140
-
1141
- # Always `static`.
1142
-
1143
- type: :static
1144
- )
1145
- end
1146
-
1147
- sig do
1148
- override.returns(
1149
- {
1150
- static: OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static,
1151
- type: Symbol
1152
- }
1153
- )
1154
- end
1155
- def to_hash
1156
- end
1157
-
1158
- class Static < OpenAI::Internal::Type::BaseModel
1159
- OrHash = T.type_alias do
1160
- T.any(
1161
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static,
1162
- OpenAI::Internal::AnyHash
1163
- )
1164
- end
1165
-
1166
- # The number of tokens that overlap between chunks. The default value is `400`.
1167
- #
1168
- # Note that the overlap must not exceed half of `max_chunk_size_tokens`.
1169
- sig { returns(Integer) }
1170
- attr_accessor :chunk_overlap_tokens
1171
-
1172
- # The maximum number of tokens in each chunk. The default value is `800`. The
1173
- # minimum value is `100` and the maximum value is `4096`.
1174
- sig { returns(Integer) }
1175
- attr_accessor :max_chunk_size_tokens
1176
-
1177
- sig do
1178
- params(
1179
-
1180
- chunk_overlap_tokens: Integer,
1181
-
1182
- max_chunk_size_tokens: Integer
1183
- )
1184
- .returns(T.attached_class)
1185
- end
1186
- def self.new(
1187
-
1188
- # The number of tokens that overlap between chunks. The default value is `400`.
1189
- #
1190
- # Note that the overlap must not exceed half of `max_chunk_size_tokens`.
1191
- chunk_overlap_tokens:,
1192
-
1193
- # The maximum number of tokens in each chunk. The default value is `800`. The
1194
- # minimum value is `100` and the maximum value is `4096`.
1195
-
1196
- max_chunk_size_tokens:
1197
- )
1198
- end
1199
-
1200
- sig do
1201
- override.returns(
1202
- {chunk_overlap_tokens: Integer, max_chunk_size_tokens: Integer}
1203
- )
1204
- end
1205
- def to_hash
1206
- end
1207
-
1208
- end
1209
- end
1210
-
1211
- sig {
1212
- override.returns(
1213
- T::Array[
1214
- OpenAI::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Variants
1215
- ]
1216
- )
1217
- }
1218
- def self.variants
1219
- end
1220
-
1221
- end
1222
- end
1223
- end
1224
- end
1225
- end
1226
-
1227
- class ToolResources < OpenAI::Internal::Type::BaseModel
1228
- OrHash = T.type_alias do
1229
- T.any(
1230
- OpenAI::Beta::ThreadCreateAndRunParams::ToolResources,
1231
- OpenAI::Internal::AnyHash
1232
- )
1233
- end
1234
-
1235
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter)) }
1236
- attr_reader :code_interpreter
1237
-
1238
- sig {
1239
- params(code_interpreter: OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter::OrHash)
1240
- .void
1241
- }
1242
- attr_writer :code_interpreter
1243
-
1244
- sig { returns(T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch)) }
1245
- attr_reader :file_search
1246
-
1247
- sig { params(file_search: OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch::OrHash).void }
1248
- attr_writer :file_search
1249
-
1250
- # A set of resources that are used by the assistant's tools. The resources are
1251
- # specific to the type of tool. For example, the `code_interpreter` tool requires
1252
- # a list of file IDs, while the `file_search` tool requires a list of vector store
1253
- # IDs.
1254
- sig do
1255
- params(
1256
-
1257
- code_interpreter: OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter::OrHash,
1258
-
1259
- file_search: OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch::OrHash
1260
- )
1261
- .returns(T.attached_class)
1262
- end
1263
- def self.new(
1264
-
1265
- code_interpreter: nil,
1266
-
1267
- file_search: nil
1268
- )
1269
- end
1270
-
1271
- sig do
1272
- override.returns(
1273
- {
1274
- code_interpreter: OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter,
1275
- file_search: OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch
1276
- }
1277
- )
1278
- end
1279
- def to_hash
1280
- end
1281
-
1282
- class CodeInterpreter < OpenAI::Internal::Type::BaseModel
1283
- OrHash = T.type_alias do
1284
- T.any(
1285
- OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter,
1286
- OpenAI::Internal::AnyHash
1287
- )
1288
- end
1289
-
1290
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
1291
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
1292
- # files associated with the tool.
1293
- sig { returns(T.nilable(T::Array[String])) }
1294
- attr_reader :file_ids
1295
-
1296
- sig { params(file_ids: T::Array[String]).void }
1297
- attr_writer :file_ids
1298
-
1299
- sig do
1300
- params(
1301
-
1302
- file_ids: T::Array[String]
1303
- )
1304
- .returns(T.attached_class)
1305
- end
1306
- def self.new(
1307
-
1308
- # A list of [file](https://developers.openai.com/api/reference/resources/files)
1309
- # IDs made available to the `code_interpreter` tool. There can be a maximum of 20
1310
- # files associated with the tool.
1311
-
1312
- file_ids: nil
1313
- )
1314
- end
1315
-
1316
- sig do
1317
- override.returns(
1318
- {file_ids: T::Array[String]}
1319
- )
1320
- end
1321
- def to_hash
1322
- end
1323
-
1324
- end
1325
-
1326
- class FileSearch < OpenAI::Internal::Type::BaseModel
1327
- OrHash = T.type_alias do
1328
- T.any(
1329
- OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch,
1330
- OpenAI::Internal::AnyHash
1331
- )
1332
- end
1333
-
1334
- # The ID of the
1335
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
1336
- # attached to this assistant. There can be a maximum of 1 vector store attached to
1337
- # the assistant.
1338
- sig { returns(T.nilable(T::Array[String])) }
1339
- attr_reader :vector_store_ids
1340
-
1341
- sig { params(vector_store_ids: T::Array[String]).void }
1342
- attr_writer :vector_store_ids
1343
-
1344
- sig do
1345
- params(
1346
-
1347
- vector_store_ids: T::Array[String]
1348
- )
1349
- .returns(T.attached_class)
1350
- end
1351
- def self.new(
1352
-
1353
- # The ID of the
1354
- # [vector store](https://developers.openai.com/api/reference/resources/vector_stores)
1355
- # attached to this assistant. There can be a maximum of 1 vector store attached to
1356
- # the assistant.
1357
-
1358
- vector_store_ids: nil
1359
- )
1360
- end
1361
-
1362
- sig do
1363
- override.returns(
1364
- {vector_store_ids: T::Array[String]}
1365
- )
1366
- end
1367
- def to_hash
1368
- end
1369
-
1370
- end
1371
- end
1372
-
1373
- class TruncationStrategy < OpenAI::Internal::Type::BaseModel
1374
- OrHash = T.type_alias do
1375
- T.any(
1376
- OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy,
1377
- OpenAI::Internal::AnyHash
1378
- )
1379
- end
1380
-
1381
- # The truncation strategy to use for the thread. The default is `auto`. If set to
1382
- # `last_messages`, the thread will be truncated to the n most recent messages in
1383
- # the thread. When set to `auto`, messages in the middle of the thread will be
1384
- # dropped to fit the context length of the model, `max_prompt_tokens`.
1385
- sig { returns(OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::OrSymbol) }
1386
- attr_accessor :type
1387
-
1388
- # The number of most recent messages from the thread when constructing the context
1389
- # for the run.
1390
- sig { returns(T.nilable(Integer)) }
1391
- attr_accessor :last_messages
1392
-
1393
- # Controls for how a thread will be truncated prior to the run. Use this to
1394
- # control the initial context window of the run.
1395
- sig do
1396
- params(
1397
-
1398
- type: OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::OrSymbol,
1399
-
1400
- last_messages: T.nilable(Integer)
1401
- )
1402
- .returns(T.attached_class)
1403
- end
1404
- def self.new(
1405
-
1406
- # The truncation strategy to use for the thread. The default is `auto`. If set to
1407
- # `last_messages`, the thread will be truncated to the n most recent messages in
1408
- # the thread. When set to `auto`, messages in the middle of the thread will be
1409
- # dropped to fit the context length of the model, `max_prompt_tokens`.
1410
- type:,
1411
-
1412
- # The number of most recent messages from the thread when constructing the context
1413
- # for the run.
1414
-
1415
- last_messages: nil
1416
- )
1417
- end
1418
-
1419
- sig do
1420
- override.returns(
1421
- {
1422
- type: OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::OrSymbol,
1423
- last_messages: T.nilable(Integer)
1424
- }
1425
- )
1426
- end
1427
- def to_hash
1428
- end
1429
-
1430
- # The truncation strategy to use for the thread. The default is `auto`. If set to
1431
- # `last_messages`, the thread will be truncated to the n most recent messages in
1432
- # the thread. When set to `auto`, messages in the middle of the thread will be
1433
- # dropped to fit the context length of the model, `max_prompt_tokens`.
1434
- module Type
1435
- extend OpenAI::Internal::Type::Enum
1436
-
1437
- TaggedSymbol = T.type_alias {
1438
- T.all(Symbol, OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type)
1439
- }
1440
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1441
-
1442
- AUTO = T.let(:auto, OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::TaggedSymbol)
1443
- LAST_MESSAGES = T.let(
1444
- :last_messages,
1445
- OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::TaggedSymbol
1446
- )
1447
-
1448
- sig {
1449
- override.returns(T::Array[OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::TaggedSymbol])
1450
- }
1451
- def self.values
1452
- end
1453
- end
1454
- end
1455
-
1456
- end
1457
-
1458
- end
1459
-
1460
- end
1461
- end