openapi_openai 1.0.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 (766) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +274 -51
  4. data/docs/AssistantFileObject.md +24 -0
  5. data/docs/AssistantObject.md +36 -0
  6. data/docs/AssistantObjectToolsInner.md +51 -0
  7. data/docs/AssistantStreamEvent.md +57 -0
  8. data/docs/AssistantToolsCode.md +18 -0
  9. data/docs/AssistantToolsFunction.md +20 -0
  10. data/docs/AssistantToolsRetrieval.md +18 -0
  11. data/docs/AssistantsApi.md +2017 -0
  12. data/docs/AssistantsApiNamedToolChoice.md +20 -0
  13. data/docs/AssistantsApiResponseFormat.md +18 -0
  14. data/docs/AssistantsApiResponseFormatOption.md +49 -0
  15. data/docs/AssistantsApiToolChoiceOption.md +49 -0
  16. data/docs/AudioApi.md +235 -0
  17. data/docs/ChatApi.md +75 -0
  18. data/docs/{CreateChatCompletionRequestFunctionCallOneOf.md → ChatCompletionFunctionCallOption.md} +2 -2
  19. data/docs/ChatCompletionFunctions.md +3 -3
  20. data/docs/ChatCompletionMessageToolCall.md +22 -0
  21. data/docs/ChatCompletionMessageToolCallChunk.md +24 -0
  22. data/docs/{ChatCompletionRequestMessageFunctionCall.md → ChatCompletionMessageToolCallChunkFunction.md} +2 -2
  23. data/docs/ChatCompletionMessageToolCallFunction.md +20 -0
  24. data/docs/ChatCompletionNamedToolChoice.md +20 -0
  25. data/docs/ChatCompletionNamedToolChoiceFunction.md +18 -0
  26. data/docs/ChatCompletionRequestAssistantMessage.md +26 -0
  27. data/docs/ChatCompletionRequestAssistantMessageFunctionCall.md +20 -0
  28. data/docs/ChatCompletionRequestFunctionMessage.md +22 -0
  29. data/docs/ChatCompletionRequestMessage.md +45 -14
  30. data/docs/ChatCompletionRequestMessageContentPart.md +49 -0
  31. data/docs/ChatCompletionRequestMessageContentPartImage.md +20 -0
  32. data/docs/ChatCompletionRequestMessageContentPartImageImageUrl.md +20 -0
  33. data/docs/ChatCompletionRequestMessageContentPartText.md +20 -0
  34. data/docs/ChatCompletionRequestSystemMessage.md +22 -0
  35. data/docs/ChatCompletionRequestToolMessage.md +22 -0
  36. data/docs/ChatCompletionRequestUserMessage.md +22 -0
  37. data/docs/ChatCompletionRequestUserMessageContent.md +49 -0
  38. data/docs/ChatCompletionResponseMessage.md +5 -3
  39. data/docs/ChatCompletionRole.md +15 -0
  40. data/docs/ChatCompletionStreamResponseDelta.md +6 -4
  41. data/docs/ChatCompletionStreamResponseDeltaFunctionCall.md +20 -0
  42. data/docs/ChatCompletionTokenLogprob.md +24 -0
  43. data/docs/ChatCompletionTokenLogprobTopLogprobsInner.md +22 -0
  44. data/docs/ChatCompletionTool.md +20 -0
  45. data/docs/ChatCompletionToolChoiceOption.md +49 -0
  46. data/docs/CompletionUsage.md +22 -0
  47. data/docs/CompletionsApi.md +75 -0
  48. data/docs/CreateAssistantFileRequest.md +18 -0
  49. data/docs/CreateAssistantRequest.md +30 -0
  50. data/docs/CreateAssistantRequestModel.md +15 -0
  51. data/docs/CreateChatCompletionFunctionResponse.md +30 -0
  52. data/docs/CreateChatCompletionFunctionResponseChoicesInner.md +22 -0
  53. data/docs/CreateChatCompletionRequest.md +33 -21
  54. data/docs/CreateChatCompletionRequestFunctionCall.md +3 -3
  55. data/docs/CreateChatCompletionRequestModel.md +5 -37
  56. data/docs/CreateChatCompletionRequestResponseFormat.md +18 -0
  57. data/docs/CreateChatCompletionResponse.md +10 -8
  58. data/docs/CreateChatCompletionResponseChoicesInner.md +6 -4
  59. data/docs/CreateChatCompletionResponseChoicesInnerLogprobs.md +18 -0
  60. data/docs/CreateChatCompletionStreamResponse.md +9 -7
  61. data/docs/CreateChatCompletionStreamResponseChoicesInner.md +7 -5
  62. data/docs/CreateCompletionRequest.md +23 -21
  63. data/docs/CreateCompletionRequestModel.md +5 -37
  64. data/docs/CreateCompletionResponse.md +10 -8
  65. data/docs/CreateCompletionResponseChoicesInner.md +4 -4
  66. data/docs/CreateCompletionResponseChoicesInnerLogprobs.md +6 -6
  67. data/docs/CreateEmbeddingRequest.md +6 -2
  68. data/docs/CreateEmbeddingRequestModel.md +5 -37
  69. data/docs/CreateEmbeddingResponse.md +5 -5
  70. data/docs/CreateEmbeddingResponseUsage.md +2 -2
  71. data/docs/CreateFineTuningJobRequest.md +30 -0
  72. data/docs/CreateFineTuningJobRequestHyperparameters.md +22 -0
  73. data/docs/CreateFineTuningJobRequestHyperparametersBatchSize.md +49 -0
  74. data/docs/CreateFineTuningJobRequestHyperparametersLearningRateMultiplier.md +49 -0
  75. data/docs/CreateFineTuningJobRequestHyperparametersNEpochs.md +49 -0
  76. data/docs/CreateFineTuningJobRequestIntegrationsInner.md +20 -0
  77. data/docs/{CreateFineTuneRequestModel.md → CreateFineTuningJobRequestIntegrationsInnerType.md} +4 -4
  78. data/docs/CreateFineTuningJobRequestIntegrationsInnerWandb.md +24 -0
  79. data/docs/CreateFineTuningJobRequestModel.md +15 -0
  80. data/docs/CreateImageEditRequestModel.md +15 -0
  81. data/docs/CreateImageRequest.md +11 -5
  82. data/docs/CreateImageRequestModel.md +15 -0
  83. data/docs/CreateMessageRequest.md +24 -0
  84. data/docs/CreateModerationRequestModel.md +5 -37
  85. data/docs/CreateModerationResponse.md +3 -3
  86. data/docs/CreateModerationResponseResultsInner.md +1 -1
  87. data/docs/CreateModerationResponseResultsInnerCategories.md +15 -7
  88. data/docs/CreateModerationResponseResultsInnerCategoryScores.md +15 -7
  89. data/docs/CreateRunRequest.md +44 -0
  90. data/docs/CreateRunRequestModel.md +15 -0
  91. data/docs/CreateSpeechRequest.md +26 -0
  92. data/docs/CreateSpeechRequestModel.md +15 -0
  93. data/docs/CreateThreadAndRunRequest.md +42 -0
  94. data/docs/CreateThreadAndRunRequestToolsInner.md +51 -0
  95. data/docs/CreateThreadRequest.md +20 -0
  96. data/docs/CreateTranscription200Response.md +49 -0
  97. data/docs/CreateTranscriptionRequestModel.md +5 -37
  98. data/docs/CreateTranscriptionResponseJson.md +18 -0
  99. data/docs/CreateTranscriptionResponseVerboseJson.md +26 -0
  100. data/docs/CreateTranslation200Response.md +49 -0
  101. data/docs/{CreateTranscriptionResponse.md → CreateTranslationResponseJson.md} +2 -2
  102. data/docs/CreateTranslationResponseVerboseJson.md +24 -0
  103. data/docs/DeleteAssistantFileResponse.md +22 -0
  104. data/docs/DeleteAssistantResponse.md +22 -0
  105. data/docs/DeleteMessageResponse.md +22 -0
  106. data/docs/DeleteModelResponse.md +3 -3
  107. data/docs/DeleteThreadResponse.md +22 -0
  108. data/docs/DoneEvent.md +20 -0
  109. data/docs/Embedding.md +22 -0
  110. data/docs/EmbeddingsApi.md +75 -0
  111. data/docs/Error.md +4 -4
  112. data/docs/ErrorEvent.md +20 -0
  113. data/docs/FilesApi.md +351 -0
  114. data/docs/FineTuningApi.md +431 -0
  115. data/docs/FineTuningIntegration.md +20 -0
  116. data/docs/FineTuningJob.md +48 -0
  117. data/docs/FineTuningJobCheckpoint.md +30 -0
  118. data/docs/FineTuningJobCheckpointMetrics.md +30 -0
  119. data/docs/FineTuningJobError.md +22 -0
  120. data/docs/{FineTuneEvent.md → FineTuningJobEvent.md} +7 -5
  121. data/docs/FineTuningJobHyperparameters.md +18 -0
  122. data/docs/FineTuningJobHyperparametersNEpochs.md +49 -0
  123. data/docs/FineTuningJobIntegrationsInner.md +47 -0
  124. data/docs/FunctionObject.md +22 -0
  125. data/docs/Image.md +22 -0
  126. data/docs/ImagesApi.md +239 -0
  127. data/docs/ImagesResponse.md +1 -1
  128. data/docs/ListAssistantFilesResponse.md +26 -0
  129. data/docs/ListAssistantsResponse.md +26 -0
  130. data/docs/ListFilesResponse.md +3 -3
  131. data/docs/ListFineTuningJobCheckpointsResponse.md +26 -0
  132. data/docs/ListFineTuningJobEventsResponse.md +20 -0
  133. data/docs/ListMessageFilesResponse.md +26 -0
  134. data/docs/ListMessagesResponse.md +26 -0
  135. data/docs/ListPaginatedFineTuningJobsResponse.md +22 -0
  136. data/docs/ListRunStepsResponse.md +26 -0
  137. data/docs/ListRunsResponse.md +26 -0
  138. data/docs/ListThreadsResponse.md +26 -0
  139. data/docs/MessageContentImageFileObject.md +20 -0
  140. data/docs/MessageContentImageFileObjectImageFile.md +18 -0
  141. data/docs/MessageContentTextAnnotationsFileCitationObject.md +26 -0
  142. data/docs/MessageContentTextAnnotationsFileCitationObjectFileCitation.md +20 -0
  143. data/docs/MessageContentTextAnnotationsFilePathObject.md +26 -0
  144. data/docs/MessageContentTextAnnotationsFilePathObjectFilePath.md +18 -0
  145. data/docs/MessageContentTextObject.md +20 -0
  146. data/docs/MessageContentTextObjectText.md +20 -0
  147. data/docs/MessageContentTextObjectTextAnnotationsInner.md +49 -0
  148. data/docs/MessageDeltaContentImageFileObject.md +22 -0
  149. data/docs/MessageDeltaContentImageFileObjectImageFile.md +18 -0
  150. data/docs/MessageDeltaContentTextAnnotationsFileCitationObject.md +28 -0
  151. data/docs/MessageDeltaContentTextAnnotationsFileCitationObjectFileCitation.md +20 -0
  152. data/docs/MessageDeltaContentTextAnnotationsFilePathObject.md +28 -0
  153. data/docs/MessageDeltaContentTextAnnotationsFilePathObjectFilePath.md +18 -0
  154. data/docs/MessageDeltaContentTextObject.md +22 -0
  155. data/docs/MessageDeltaContentTextObjectText.md +20 -0
  156. data/docs/MessageDeltaContentTextObjectTextAnnotationsInner.md +49 -0
  157. data/docs/MessageDeltaObject.md +22 -0
  158. data/docs/MessageDeltaObjectDelta.md +22 -0
  159. data/docs/MessageDeltaObjectDeltaContentInner.md +49 -0
  160. data/docs/MessageFileObject.md +24 -0
  161. data/docs/MessageObject.md +44 -0
  162. data/docs/MessageObjectContentInner.md +49 -0
  163. data/docs/MessageObjectIncompleteDetails.md +18 -0
  164. data/docs/MessageStreamEvent.md +55 -0
  165. data/docs/MessageStreamEventOneOf.md +20 -0
  166. data/docs/MessageStreamEventOneOf1.md +20 -0
  167. data/docs/MessageStreamEventOneOf2.md +20 -0
  168. data/docs/MessageStreamEventOneOf3.md +20 -0
  169. data/docs/MessageStreamEventOneOf4.md +20 -0
  170. data/docs/Model.md +5 -5
  171. data/docs/ModelsApi.md +208 -0
  172. data/docs/ModerationsApi.md +75 -0
  173. data/docs/ModifyAssistantRequest.md +30 -0
  174. data/docs/ModifyMessageRequest.md +18 -0
  175. data/docs/ModifyRunRequest.md +18 -0
  176. data/docs/ModifyThreadRequest.md +18 -0
  177. data/docs/OpenAIFile.md +9 -9
  178. data/docs/RunCompletionUsage.md +22 -0
  179. data/docs/RunObject.md +68 -0
  180. data/docs/RunObjectIncompleteDetails.md +18 -0
  181. data/docs/RunObjectLastError.md +20 -0
  182. data/docs/RunObjectRequiredAction.md +20 -0
  183. data/docs/RunObjectRequiredActionSubmitToolOutputs.md +18 -0
  184. data/docs/RunStepCompletionUsage.md +22 -0
  185. data/docs/RunStepDeltaObject.md +22 -0
  186. data/docs/RunStepDeltaObjectDelta.md +18 -0
  187. data/docs/RunStepDeltaObjectDeltaStepDetails.md +49 -0
  188. data/docs/RunStepDeltaStepDetailsMessageCreationObject.md +20 -0
  189. data/docs/RunStepDeltaStepDetailsMessageCreationObjectMessageCreation.md +18 -0
  190. data/docs/RunStepDeltaStepDetailsToolCallsCodeObject.md +24 -0
  191. data/docs/RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreter.md +20 -0
  192. data/docs/RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.md +49 -0
  193. data/docs/RunStepDeltaStepDetailsToolCallsCodeOutputImageObject.md +22 -0
  194. data/docs/RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectImage.md +18 -0
  195. data/docs/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject.md +22 -0
  196. data/docs/RunStepDeltaStepDetailsToolCallsFunctionObject.md +24 -0
  197. data/docs/RunStepDeltaStepDetailsToolCallsFunctionObjectFunction.md +22 -0
  198. data/docs/RunStepDeltaStepDetailsToolCallsObject.md +20 -0
  199. data/docs/RunStepDeltaStepDetailsToolCallsObjectToolCallsInner.md +51 -0
  200. data/docs/RunStepDeltaStepDetailsToolCallsRetrievalObject.md +24 -0
  201. data/docs/RunStepDetailsMessageCreationObject.md +20 -0
  202. data/docs/RunStepDetailsMessageCreationObjectMessageCreation.md +18 -0
  203. data/docs/RunStepDetailsToolCallsCodeObject.md +22 -0
  204. data/docs/RunStepDetailsToolCallsCodeObjectCodeInterpreter.md +20 -0
  205. data/docs/RunStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.md +49 -0
  206. data/docs/RunStepDetailsToolCallsCodeOutputImageObject.md +20 -0
  207. data/docs/RunStepDetailsToolCallsCodeOutputImageObjectImage.md +18 -0
  208. data/docs/RunStepDetailsToolCallsCodeOutputLogsObject.md +20 -0
  209. data/docs/RunStepDetailsToolCallsFunctionObject.md +22 -0
  210. data/docs/RunStepDetailsToolCallsFunctionObjectFunction.md +22 -0
  211. data/docs/RunStepDetailsToolCallsObject.md +20 -0
  212. data/docs/RunStepDetailsToolCallsObjectToolCallsInner.md +51 -0
  213. data/docs/RunStepDetailsToolCallsRetrievalObject.md +22 -0
  214. data/docs/RunStepObject.md +48 -0
  215. data/docs/RunStepObjectLastError.md +20 -0
  216. data/docs/RunStepObjectStepDetails.md +49 -0
  217. data/docs/RunStepStreamEvent.md +59 -0
  218. data/docs/RunStepStreamEventOneOf.md +20 -0
  219. data/docs/RunStepStreamEventOneOf1.md +20 -0
  220. data/docs/RunStepStreamEventOneOf2.md +20 -0
  221. data/docs/RunStepStreamEventOneOf3.md +20 -0
  222. data/docs/RunStepStreamEventOneOf4.md +20 -0
  223. data/docs/RunStepStreamEventOneOf5.md +20 -0
  224. data/docs/RunStepStreamEventOneOf6.md +20 -0
  225. data/docs/RunStreamEvent.md +63 -0
  226. data/docs/RunStreamEventOneOf.md +20 -0
  227. data/docs/RunStreamEventOneOf1.md +20 -0
  228. data/docs/RunStreamEventOneOf2.md +20 -0
  229. data/docs/RunStreamEventOneOf3.md +20 -0
  230. data/docs/RunStreamEventOneOf4.md +20 -0
  231. data/docs/RunStreamEventOneOf5.md +20 -0
  232. data/docs/RunStreamEventOneOf6.md +20 -0
  233. data/docs/RunStreamEventOneOf7.md +20 -0
  234. data/docs/RunStreamEventOneOf8.md +20 -0
  235. data/docs/RunToolCallObject.md +22 -0
  236. data/docs/RunToolCallObjectFunction.md +20 -0
  237. data/docs/SubmitToolOutputsRunRequest.md +20 -0
  238. data/docs/SubmitToolOutputsRunRequestToolOutputsInner.md +20 -0
  239. data/docs/ThreadObject.md +24 -0
  240. data/docs/{CreateEditRequestModel.md → ThreadStreamEvent.md} +7 -7
  241. data/docs/ThreadStreamEventOneOf.md +20 -0
  242. data/docs/TranscriptionSegment.md +36 -0
  243. data/docs/TranscriptionWord.md +22 -0
  244. data/docs/TruncationObject.md +20 -0
  245. data/lib/openapi_openai/api/assistants_api.rb +2006 -0
  246. data/lib/openapi_openai/api/audio_api.rb +268 -0
  247. data/lib/openapi_openai/api/chat_api.rb +88 -0
  248. data/lib/openapi_openai/api/completions_api.rb +88 -0
  249. data/lib/openapi_openai/api/embeddings_api.rb +88 -0
  250. data/lib/openapi_openai/api/files_api.rb +342 -0
  251. data/lib/openapi_openai/api/fine_tuning_api.rb +405 -0
  252. data/lib/openapi_openai/api/images_api.rb +294 -0
  253. data/lib/openapi_openai/api/models_api.rb +199 -0
  254. data/lib/openapi_openai/api/moderations_api.rb +88 -0
  255. data/lib/openapi_openai/api_client.rb +2 -1
  256. data/lib/openapi_openai/api_error.rb +1 -1
  257. data/lib/openapi_openai/configuration.rb +8 -1
  258. data/lib/openapi_openai/models/assistant_file_object.rb +308 -0
  259. data/lib/openapi_openai/models/assistant_object.rb +481 -0
  260. data/lib/openapi_openai/models/assistant_object_tools_inner.rb +106 -0
  261. data/lib/openapi_openai/models/assistant_stream_event.rb +110 -0
  262. data/lib/openapi_openai/models/assistant_tools_code.rb +256 -0
  263. data/lib/openapi_openai/models/assistant_tools_function.rb +272 -0
  264. data/lib/openapi_openai/models/assistant_tools_retrieval.rb +256 -0
  265. data/lib/openapi_openai/models/assistants_api_named_tool_choice.rb +266 -0
  266. data/lib/openapi_openai/models/assistants_api_response_format.rb +252 -0
  267. data/lib/openapi_openai/models/assistants_api_response_format_option.rb +106 -0
  268. data/lib/openapi_openai/models/assistants_api_tool_choice_option.rb +106 -0
  269. data/lib/openapi_openai/models/chat_completion_function_call_option.rb +223 -0
  270. data/lib/openapi_openai/models/chat_completion_functions.rb +13 -13
  271. data/lib/openapi_openai/models/chat_completion_message_tool_call.rb +289 -0
  272. data/lib/openapi_openai/models/chat_completion_message_tool_call_chunk.rb +284 -0
  273. data/lib/openapi_openai/models/{chat_completion_request_message_function_call.rb → chat_completion_message_tool_call_chunk_function.rb} +4 -5
  274. data/lib/openapi_openai/models/chat_completion_message_tool_call_function.rb +240 -0
  275. data/lib/openapi_openai/models/chat_completion_named_tool_choice.rb +273 -0
  276. data/lib/openapi_openai/models/{create_chat_completion_request_function_call_one_of.rb → chat_completion_named_tool_choice_function.rb} +4 -4
  277. data/lib/openapi_openai/models/chat_completion_request_assistant_message.rb +298 -0
  278. data/lib/openapi_openai/models/chat_completion_request_assistant_message_function_call.rb +240 -0
  279. data/lib/openapi_openai/models/chat_completion_request_function_message.rb +286 -0
  280. data/lib/openapi_openai/models/chat_completion_request_message.rb +78 -255
  281. data/lib/openapi_openai/models/chat_completion_request_message_content_part.rb +105 -0
  282. data/lib/openapi_openai/models/chat_completion_request_message_content_part_image.rb +272 -0
  283. data/lib/openapi_openai/models/chat_completion_request_message_content_part_image_image_url.rb +268 -0
  284. data/lib/openapi_openai/models/chat_completion_request_message_content_part_text.rb +273 -0
  285. data/lib/openapi_openai/models/chat_completion_request_system_message.rb +283 -0
  286. data/lib/openapi_openai/models/chat_completion_request_tool_message.rb +290 -0
  287. data/lib/openapi_openai/models/chat_completion_request_user_message.rb +282 -0
  288. data/lib/openapi_openai/models/{create_fine_tune_request_model.rb → chat_completion_request_user_message_content.rb} +4 -3
  289. data/lib/openapi_openai/models/chat_completion_response_message.rb +30 -15
  290. data/lib/openapi_openai/models/chat_completion_role.rb +43 -0
  291. data/lib/openapi_openai/models/chat_completion_stream_response_delta.rb +29 -17
  292. data/lib/openapi_openai/models/chat_completion_stream_response_delta_function_call.rb +226 -0
  293. data/lib/openapi_openai/models/chat_completion_token_logprob.rb +273 -0
  294. data/lib/openapi_openai/models/chat_completion_token_logprob_top_logprobs_inner.rb +254 -0
  295. data/lib/openapi_openai/models/chat_completion_tool.rb +272 -0
  296. data/lib/openapi_openai/models/chat_completion_tool_choice_option.rb +106 -0
  297. data/lib/openapi_openai/models/{create_completion_response_usage.rb → completion_usage.rb} +25 -21
  298. data/lib/openapi_openai/models/create_assistant_file_request.rb +222 -0
  299. data/lib/openapi_openai/models/create_assistant_request.rb +372 -0
  300. data/lib/openapi_openai/models/create_assistant_request_model.rb +104 -0
  301. data/lib/openapi_openai/models/create_chat_completion_function_response.rb +346 -0
  302. data/lib/openapi_openai/models/create_chat_completion_function_response_choices_inner.rb +289 -0
  303. data/lib/openapi_openai/models/create_chat_completion_request.rb +277 -152
  304. data/lib/openapi_openai/models/create_chat_completion_request_function_call.rb +3 -3
  305. data/lib/openapi_openai/models/create_chat_completion_request_model.rb +8 -9
  306. data/lib/openapi_openai/models/create_chat_completion_request_response_format.rb +252 -0
  307. data/lib/openapi_openai/models/create_chat_completion_request_stop.rb +1 -1
  308. data/lib/openapi_openai/models/create_chat_completion_response.rb +75 -25
  309. data/lib/openapi_openai/models/create_chat_completion_response_choices_inner.rb +45 -10
  310. data/lib/openapi_openai/models/create_chat_completion_response_choices_inner_logprobs.rb +221 -0
  311. data/lib/openapi_openai/models/create_chat_completion_stream_response.rb +74 -24
  312. data/lib/openapi_openai/models/create_chat_completion_stream_response_choices_inner.rb +45 -16
  313. data/lib/openapi_openai/models/create_completion_request.rb +219 -182
  314. data/lib/openapi_openai/models/create_completion_request_model.rb +8 -9
  315. data/lib/openapi_openai/models/create_completion_request_prompt.rb +1 -1
  316. data/lib/openapi_openai/models/create_completion_request_stop.rb +1 -1
  317. data/lib/openapi_openai/models/create_completion_response.rb +75 -25
  318. data/lib/openapi_openai/models/create_completion_response_choices_inner.rb +25 -24
  319. data/lib/openapi_openai/models/create_completion_response_choices_inner_logprobs.rb +23 -23
  320. data/lib/openapi_openai/models/create_embedding_request.rb +87 -12
  321. data/lib/openapi_openai/models/create_embedding_request_input.rb +2 -2
  322. data/lib/openapi_openai/models/create_embedding_request_model.rb +8 -9
  323. data/lib/openapi_openai/models/create_embedding_response.rb +61 -24
  324. data/lib/openapi_openai/models/create_embedding_response_usage.rb +4 -1
  325. data/lib/openapi_openai/models/{create_fine_tune_request.rb → create_fine_tuning_job_request.rb} +78 -111
  326. data/lib/openapi_openai/models/create_fine_tuning_job_request_hyperparameters.rb +233 -0
  327. data/lib/openapi_openai/models/create_fine_tuning_job_request_hyperparameters_batch_size.rb +106 -0
  328. data/lib/openapi_openai/models/create_fine_tuning_job_request_hyperparameters_learning_rate_multiplier.rb +106 -0
  329. data/lib/openapi_openai/models/create_fine_tuning_job_request_hyperparameters_n_epochs.rb +106 -0
  330. data/lib/openapi_openai/models/{list_fine_tunes_response.rb → create_fine_tuning_job_request_integrations_inner.rb} +25 -27
  331. data/lib/openapi_openai/models/create_fine_tuning_job_request_integrations_inner_type.rb +105 -0
  332. data/lib/openapi_openai/models/create_fine_tuning_job_request_integrations_inner_wandb.rb +257 -0
  333. data/lib/openapi_openai/models/create_fine_tuning_job_request_model.rb +104 -0
  334. data/lib/openapi_openai/models/create_image_edit_request_model.rb +104 -0
  335. data/lib/openapi_openai/models/create_image_request.rb +81 -22
  336. data/lib/openapi_openai/models/create_image_request_model.rb +104 -0
  337. data/lib/openapi_openai/models/create_message_request.rb +352 -0
  338. data/lib/openapi_openai/models/create_moderation_request.rb +1 -1
  339. data/lib/openapi_openai/models/create_moderation_request_input.rb +1 -1
  340. data/lib/openapi_openai/models/create_moderation_request_model.rb +8 -9
  341. data/lib/openapi_openai/models/create_moderation_response.rb +5 -1
  342. data/lib/openapi_openai/models/create_moderation_response_results_inner.rb +2 -1
  343. data/lib/openapi_openai/models/create_moderation_response_results_inner_categories.rb +78 -2
  344. data/lib/openapi_openai/models/create_moderation_response_results_inner_category_scores.rb +78 -2
  345. data/lib/openapi_openai/models/create_run_request.rb +433 -0
  346. data/lib/openapi_openai/models/create_run_request_model.rb +104 -0
  347. data/lib/openapi_openai/models/{create_edit_request.rb → create_speech_request.rb} +105 -95
  348. data/lib/openapi_openai/models/create_speech_request_model.rb +104 -0
  349. data/lib/openapi_openai/models/create_thread_and_run_request.rb +418 -0
  350. data/lib/openapi_openai/models/create_thread_and_run_request_tools_inner.rb +106 -0
  351. data/lib/openapi_openai/models/{list_fine_tune_events_response.rb → create_thread_request.rb} +22 -33
  352. data/lib/openapi_openai/models/create_transcription200_response.rb +105 -0
  353. data/lib/openapi_openai/models/create_transcription_request_model.rb +9 -10
  354. data/lib/openapi_openai/models/{create_transcription_response.rb → create_transcription_response_json.rb} +6 -4
  355. data/lib/openapi_openai/models/create_transcription_response_verbose_json.rb +281 -0
  356. data/lib/openapi_openai/models/create_translation200_response.rb +105 -0
  357. data/lib/openapi_openai/models/{create_translation_response.rb → create_translation_response_json.rb} +4 -4
  358. data/lib/openapi_openai/models/create_translation_response_verbose_json.rb +268 -0
  359. data/lib/openapi_openai/models/delete_assistant_file_response.rb +288 -0
  360. data/lib/openapi_openai/models/delete_assistant_response.rb +287 -0
  361. data/lib/openapi_openai/models/delete_file_response.rb +35 -1
  362. data/lib/openapi_openai/models/delete_message_response.rb +287 -0
  363. data/lib/openapi_openai/models/delete_model_response.rb +21 -21
  364. data/lib/openapi_openai/models/delete_thread_response.rb +287 -0
  365. data/lib/openapi_openai/models/done_event.rb +284 -0
  366. data/lib/openapi_openai/models/embedding.rb +293 -0
  367. data/lib/openapi_openai/models/error.rb +22 -22
  368. data/lib/openapi_openai/models/error_event.rb +272 -0
  369. data/lib/openapi_openai/models/error_response.rb +1 -1
  370. data/lib/openapi_openai/models/fine_tuning_integration.rb +272 -0
  371. data/lib/openapi_openai/models/fine_tuning_job.rb +515 -0
  372. data/lib/openapi_openai/models/{fine_tune.rb → fine_tuning_job_checkpoint.rb} +94 -146
  373. data/lib/openapi_openai/models/fine_tuning_job_checkpoint_metrics.rb +269 -0
  374. data/lib/openapi_openai/models/{fine_tune_event.rb → fine_tuning_job_error.rb} +34 -50
  375. data/lib/openapi_openai/models/fine_tuning_job_event.rb +332 -0
  376. data/lib/openapi_openai/models/fine_tuning_job_hyperparameters.rb +222 -0
  377. data/lib/openapi_openai/models/fine_tuning_job_hyperparameters_n_epochs.rb +106 -0
  378. data/lib/openapi_openai/models/{create_edit_request_model.rb → fine_tuning_job_integrations_inner.rb} +3 -4
  379. data/lib/openapi_openai/models/function_object.rb +244 -0
  380. data/lib/openapi_openai/models/image.rb +236 -0
  381. data/lib/openapi_openai/models/images_response.rb +2 -2
  382. data/lib/openapi_openai/models/list_assistant_files_response.rb +287 -0
  383. data/lib/openapi_openai/models/list_assistants_response.rb +287 -0
  384. data/lib/openapi_openai/models/list_files_response.rb +54 -20
  385. data/lib/openapi_openai/models/list_fine_tuning_job_checkpoints_response.rb +309 -0
  386. data/lib/openapi_openai/models/{create_edit_response.rb → list_fine_tuning_job_events_response.rb} +57 -55
  387. data/lib/openapi_openai/models/list_message_files_response.rb +287 -0
  388. data/lib/openapi_openai/models/list_messages_response.rb +287 -0
  389. data/lib/openapi_openai/models/list_models_response.rb +35 -1
  390. data/lib/openapi_openai/models/list_paginated_fine_tuning_jobs_response.rb +289 -0
  391. data/lib/openapi_openai/models/list_run_steps_response.rb +287 -0
  392. data/lib/openapi_openai/models/list_runs_response.rb +287 -0
  393. data/lib/openapi_openai/models/list_threads_response.rb +287 -0
  394. data/lib/openapi_openai/models/message_content_image_file_object.rb +273 -0
  395. data/lib/openapi_openai/models/message_content_image_file_object_image_file.rb +222 -0
  396. data/lib/openapi_openai/models/message_content_text_annotations_file_citation_object.rb +360 -0
  397. data/lib/openapi_openai/models/message_content_text_annotations_file_citation_object_file_citation.rb +239 -0
  398. data/lib/openapi_openai/models/message_content_text_annotations_file_path_object.rb +360 -0
  399. data/lib/openapi_openai/models/message_content_text_annotations_file_path_object_file_path.rb +222 -0
  400. data/lib/openapi_openai/models/message_content_text_object.rb +273 -0
  401. data/lib/openapi_openai/models/message_content_text_object_text.rb +240 -0
  402. data/lib/openapi_openai/models/message_content_text_object_text_annotations_inner.rb +105 -0
  403. data/lib/openapi_openai/models/message_delta_content_image_file_object.rb +283 -0
  404. data/lib/openapi_openai/models/message_delta_content_image_file_object_image_file.rb +215 -0
  405. data/lib/openapi_openai/models/message_delta_content_text_annotations_file_citation_object.rb +349 -0
  406. data/lib/openapi_openai/models/message_delta_content_text_annotations_file_citation_object_file_citation.rb +225 -0
  407. data/lib/openapi_openai/models/message_delta_content_text_annotations_file_path_object.rb +349 -0
  408. data/lib/openapi_openai/models/message_delta_content_text_annotations_file_path_object_file_path.rb +215 -0
  409. data/lib/openapi_openai/models/{create_edit_response_choices_inner.rb → message_delta_content_text_object.rb} +42 -35
  410. data/lib/openapi_openai/models/message_delta_content_text_object_text.rb +226 -0
  411. data/lib/openapi_openai/models/message_delta_content_text_object_text_annotations_inner.rb +105 -0
  412. data/lib/openapi_openai/models/message_delta_object.rb +290 -0
  413. data/lib/openapi_openai/models/message_delta_object_delta.rb +293 -0
  414. data/lib/openapi_openai/models/message_delta_object_delta_content_inner.rb +105 -0
  415. data/lib/openapi_openai/models/message_file_object.rb +308 -0
  416. data/lib/openapi_openai/models/message_object.rb +500 -0
  417. data/lib/openapi_openai/models/message_object_content_inner.rb +105 -0
  418. data/lib/openapi_openai/models/message_object_incomplete_details.rb +257 -0
  419. data/lib/openapi_openai/models/message_stream_event.rb +108 -0
  420. data/lib/openapi_openai/models/message_stream_event_one_of.rb +272 -0
  421. data/lib/openapi_openai/models/message_stream_event_one_of1.rb +272 -0
  422. data/lib/openapi_openai/models/message_stream_event_one_of2.rb +272 -0
  423. data/lib/openapi_openai/models/message_stream_event_one_of3.rb +272 -0
  424. data/lib/openapi_openai/models/message_stream_event_one_of4.rb +272 -0
  425. data/lib/openapi_openai/models/model.rb +57 -18
  426. data/lib/openapi_openai/models/modify_assistant_request.rb +365 -0
  427. data/lib/openapi_openai/models/modify_message_request.rb +216 -0
  428. data/lib/openapi_openai/models/modify_run_request.rb +216 -0
  429. data/lib/openapi_openai/models/modify_thread_request.rb +216 -0
  430. data/lib/openapi_openai/models/open_ai_file.rb +93 -20
  431. data/lib/openapi_openai/models/run_completion_usage.rb +257 -0
  432. data/lib/openapi_openai/models/run_object.rb +686 -0
  433. data/lib/openapi_openai/models/run_object_incomplete_details.rb +250 -0
  434. data/lib/openapi_openai/models/run_object_last_error.rb +274 -0
  435. data/lib/openapi_openai/models/run_object_required_action.rb +273 -0
  436. data/lib/openapi_openai/models/run_object_required_action_submit_tool_outputs.rb +225 -0
  437. data/lib/openapi_openai/models/run_step_completion_usage.rb +257 -0
  438. data/lib/openapi_openai/models/run_step_delta_object.rb +290 -0
  439. data/lib/openapi_openai/models/{images_response_data_inner.rb → run_step_delta_object_delta.rb} +12 -20
  440. data/lib/openapi_openai/models/run_step_delta_object_delta_step_details.rb +106 -0
  441. data/lib/openapi_openai/models/run_step_delta_step_details_message_creation_object.rb +266 -0
  442. data/lib/openapi_openai/models/run_step_delta_step_details_message_creation_object_message_creation.rb +215 -0
  443. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_code_object.rb +293 -0
  444. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_code_object_code_interpreter.rb +228 -0
  445. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_code_object_code_interpreter_outputs_inner.rb +105 -0
  446. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_code_output_image_object.rb +282 -0
  447. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_code_output_image_object_image.rb +215 -0
  448. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_code_output_logs_object.rb +284 -0
  449. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_function_object.rb +292 -0
  450. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_function_object_function.rb +237 -0
  451. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_object.rb +269 -0
  452. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_object_tool_calls_inner.rb +106 -0
  453. data/lib/openapi_openai/models/run_step_delta_step_details_tool_calls_retrieval_object.rb +293 -0
  454. data/lib/openapi_openai/models/run_step_details_message_creation_object.rb +273 -0
  455. data/lib/openapi_openai/models/run_step_details_message_creation_object_message_creation.rb +222 -0
  456. data/lib/openapi_openai/models/run_step_details_tool_calls_code_object.rb +290 -0
  457. data/lib/openapi_openai/models/run_step_details_tool_calls_code_object_code_interpreter.rb +242 -0
  458. data/lib/openapi_openai/models/run_step_details_tool_calls_code_object_code_interpreter_outputs_inner.rb +105 -0
  459. data/lib/openapi_openai/models/run_step_details_tool_calls_code_output_image_object.rb +272 -0
  460. data/lib/openapi_openai/models/run_step_details_tool_calls_code_output_image_object_image.rb +222 -0
  461. data/lib/openapi_openai/models/run_step_details_tool_calls_code_output_logs_object.rb +274 -0
  462. data/lib/openapi_openai/models/run_step_details_tool_calls_function_object.rb +289 -0
  463. data/lib/openapi_openai/models/run_step_details_tool_calls_function_object_function.rb +253 -0
  464. data/lib/openapi_openai/models/run_step_details_tool_calls_object.rb +276 -0
  465. data/lib/openapi_openai/models/run_step_details_tool_calls_object_tool_calls_inner.rb +106 -0
  466. data/lib/openapi_openai/models/run_step_details_tool_calls_retrieval_object.rb +290 -0
  467. data/lib/openapi_openai/models/run_step_object.rb +505 -0
  468. data/lib/openapi_openai/models/run_step_object_last_error.rb +274 -0
  469. data/lib/openapi_openai/models/run_step_object_step_details.rb +106 -0
  470. data/lib/openapi_openai/models/run_step_stream_event.rb +110 -0
  471. data/lib/openapi_openai/models/run_step_stream_event_one_of.rb +272 -0
  472. data/lib/openapi_openai/models/run_step_stream_event_one_of1.rb +272 -0
  473. data/lib/openapi_openai/models/run_step_stream_event_one_of2.rb +272 -0
  474. data/lib/openapi_openai/models/run_step_stream_event_one_of3.rb +272 -0
  475. data/lib/openapi_openai/models/run_step_stream_event_one_of4.rb +272 -0
  476. data/lib/openapi_openai/models/run_step_stream_event_one_of5.rb +272 -0
  477. data/lib/openapi_openai/models/run_step_stream_event_one_of6.rb +272 -0
  478. data/lib/openapi_openai/models/run_stream_event.rb +112 -0
  479. data/lib/openapi_openai/models/run_stream_event_one_of.rb +272 -0
  480. data/lib/openapi_openai/models/run_stream_event_one_of1.rb +272 -0
  481. data/lib/openapi_openai/models/run_stream_event_one_of2.rb +272 -0
  482. data/lib/openapi_openai/models/run_stream_event_one_of3.rb +272 -0
  483. data/lib/openapi_openai/models/run_stream_event_one_of4.rb +272 -0
  484. data/lib/openapi_openai/models/run_stream_event_one_of5.rb +272 -0
  485. data/lib/openapi_openai/models/run_stream_event_one_of6.rb +272 -0
  486. data/lib/openapi_openai/models/run_stream_event_one_of7.rb +272 -0
  487. data/lib/openapi_openai/models/run_stream_event_one_of8.rb +272 -0
  488. data/lib/openapi_openai/models/run_tool_call_object.rb +290 -0
  489. data/lib/openapi_openai/models/run_tool_call_object_function.rb +240 -0
  490. data/lib/openapi_openai/models/submit_tool_outputs_run_request.rb +235 -0
  491. data/lib/openapi_openai/models/submit_tool_outputs_run_request_tool_outputs_inner.rb +225 -0
  492. data/lib/openapi_openai/models/thread_object.rb +304 -0
  493. data/lib/openapi_openai/models/thread_stream_event.rb +104 -0
  494. data/lib/openapi_openai/models/thread_stream_event_one_of.rb +272 -0
  495. data/lib/openapi_openai/models/transcription_segment.rb +377 -0
  496. data/lib/openapi_openai/models/{create_embedding_response_data_inner.rb → transcription_word.rb} +38 -37
  497. data/lib/openapi_openai/models/truncation_object.rb +275 -0
  498. data/lib/openapi_openai/version.rb +2 -2
  499. data/lib/openapi_openai.rb +209 -19
  500. data/openapi_openai.gemspec +2 -2
  501. data/spec/api/assistants_api_spec.rb +389 -0
  502. data/spec/api/audio_api_spec.rb +78 -0
  503. data/spec/api/chat_api_spec.rb +46 -0
  504. data/spec/api/completions_api_spec.rb +46 -0
  505. data/spec/api/embeddings_api_spec.rb +46 -0
  506. data/spec/api/files_api_spec.rb +91 -0
  507. data/spec/api/fine_tuning_api_spec.rb +106 -0
  508. data/spec/api/images_api_spec.rb +80 -0
  509. data/spec/api/models_api_spec.rb +67 -0
  510. data/spec/api/moderations_api_spec.rb +46 -0
  511. data/spec/models/assistant_file_object_spec.rb +58 -0
  512. data/spec/models/assistant_object_spec.rb +94 -0
  513. data/spec/models/assistant_object_tools_inner_spec.rb +32 -0
  514. data/spec/models/assistant_stream_event_spec.rb +32 -0
  515. data/spec/models/assistant_tools_code_spec.rb +40 -0
  516. data/spec/models/assistant_tools_function_spec.rb +46 -0
  517. data/spec/models/assistant_tools_retrieval_spec.rb +40 -0
  518. data/spec/models/assistants_api_named_tool_choice_spec.rb +46 -0
  519. data/spec/models/assistants_api_response_format_option_spec.rb +32 -0
  520. data/spec/models/assistants_api_response_format_spec.rb +40 -0
  521. data/spec/models/assistants_api_tool_choice_option_spec.rb +32 -0
  522. data/spec/models/chat_completion_function_call_option_spec.rb +36 -0
  523. data/spec/models/chat_completion_functions_spec.rb +3 -3
  524. data/spec/models/chat_completion_message_tool_call_chunk_function_spec.rb +42 -0
  525. data/spec/models/{create_edit_response_choices_inner_spec.rb → chat_completion_message_tool_call_chunk_spec.rb} +15 -15
  526. data/spec/models/{chat_completion_request_message_function_call_spec.rb → chat_completion_message_tool_call_function_spec.rb} +7 -7
  527. data/spec/models/chat_completion_message_tool_call_spec.rb +52 -0
  528. data/spec/models/chat_completion_named_tool_choice_function_spec.rb +36 -0
  529. data/spec/models/chat_completion_named_tool_choice_spec.rb +46 -0
  530. data/spec/models/chat_completion_request_assistant_message_function_call_spec.rb +42 -0
  531. data/spec/models/chat_completion_request_assistant_message_spec.rb +64 -0
  532. data/spec/models/chat_completion_request_function_message_spec.rb +52 -0
  533. data/spec/models/chat_completion_request_message_content_part_image_image_url_spec.rb +46 -0
  534. data/spec/models/chat_completion_request_message_content_part_image_spec.rb +46 -0
  535. data/spec/models/chat_completion_request_message_content_part_spec.rb +32 -0
  536. data/spec/models/chat_completion_request_message_content_part_text_spec.rb +46 -0
  537. data/spec/models/chat_completion_request_message_spec.rb +6 -32
  538. data/spec/models/chat_completion_request_system_message_spec.rb +52 -0
  539. data/spec/models/chat_completion_request_tool_message_spec.rb +52 -0
  540. data/spec/models/chat_completion_request_user_message_content_spec.rb +32 -0
  541. data/spec/models/chat_completion_request_user_message_spec.rb +52 -0
  542. data/spec/models/chat_completion_response_message_spec.rb +13 -7
  543. data/spec/models/chat_completion_role_spec.rb +30 -0
  544. data/spec/models/chat_completion_stream_response_delta_function_call_spec.rb +42 -0
  545. data/spec/models/chat_completion_stream_response_delta_spec.rb +14 -8
  546. data/spec/models/{create_edit_response_spec.rb → chat_completion_token_logprob_spec.rb} +11 -11
  547. data/spec/models/chat_completion_token_logprob_top_logprobs_inner_spec.rb +48 -0
  548. data/spec/models/chat_completion_tool_choice_option_spec.rb +32 -0
  549. data/spec/models/chat_completion_tool_spec.rb +46 -0
  550. data/spec/models/{create_completion_response_usage_spec.rb → completion_usage_spec.rb} +9 -9
  551. data/spec/models/create_assistant_file_request_spec.rb +36 -0
  552. data/spec/models/create_assistant_request_model_spec.rb +21 -0
  553. data/spec/models/{create_edit_request_spec.rb → create_assistant_request_spec.rb} +18 -12
  554. data/spec/models/create_chat_completion_function_response_choices_inner_spec.rb +52 -0
  555. data/spec/models/create_chat_completion_function_response_spec.rb +76 -0
  556. data/spec/models/create_chat_completion_request_function_call_spec.rb +1 -1
  557. data/spec/models/create_chat_completion_request_model_spec.rb +1 -12
  558. data/spec/models/{create_chat_completion_request_function_call_one_of_spec.rb → create_chat_completion_request_response_format_spec.rb} +12 -8
  559. data/spec/models/create_chat_completion_request_spec.rb +47 -11
  560. data/spec/models/create_chat_completion_request_stop_spec.rb +1 -1
  561. data/spec/models/create_chat_completion_response_choices_inner_logprobs_spec.rb +36 -0
  562. data/spec/models/create_chat_completion_response_choices_inner_spec.rb +12 -6
  563. data/spec/models/create_chat_completion_response_spec.rb +13 -3
  564. data/spec/models/create_chat_completion_stream_response_choices_inner_spec.rb +10 -4
  565. data/spec/models/create_chat_completion_stream_response_spec.rb +13 -3
  566. data/spec/models/create_completion_request_model_spec.rb +1 -12
  567. data/spec/models/create_completion_request_prompt_spec.rb +1 -1
  568. data/spec/models/create_completion_request_spec.rb +19 -13
  569. data/spec/models/create_completion_request_stop_spec.rb +1 -1
  570. data/spec/models/create_completion_response_choices_inner_logprobs_spec.rb +4 -4
  571. data/spec/models/create_completion_response_choices_inner_spec.rb +7 -7
  572. data/spec/models/create_completion_response_spec.rb +13 -3
  573. data/spec/models/create_embedding_request_input_spec.rb +1 -1
  574. data/spec/models/create_embedding_request_model_spec.rb +1 -12
  575. data/spec/models/create_embedding_request_spec.rb +18 -2
  576. data/spec/models/create_embedding_response_spec.rb +7 -3
  577. data/spec/models/create_embedding_response_usage_spec.rb +1 -1
  578. data/spec/models/create_fine_tuning_job_request_hyperparameters_batch_size_spec.rb +32 -0
  579. data/spec/models/create_fine_tuning_job_request_hyperparameters_learning_rate_multiplier_spec.rb +32 -0
  580. data/spec/models/create_fine_tuning_job_request_hyperparameters_n_epochs_spec.rb +32 -0
  581. data/spec/models/create_fine_tuning_job_request_hyperparameters_spec.rb +48 -0
  582. data/spec/models/create_fine_tuning_job_request_integrations_inner_spec.rb +42 -0
  583. data/spec/models/create_fine_tuning_job_request_integrations_inner_type_spec.rb +32 -0
  584. data/spec/models/create_fine_tuning_job_request_integrations_inner_wandb_spec.rb +54 -0
  585. data/spec/models/create_fine_tuning_job_request_model_spec.rb +21 -0
  586. data/spec/models/create_fine_tuning_job_request_spec.rb +72 -0
  587. data/spec/models/create_image_edit_request_model_spec.rb +21 -0
  588. data/spec/models/create_image_request_model_spec.rb +21 -0
  589. data/spec/models/create_image_request_spec.rb +30 -4
  590. data/spec/models/create_message_request_spec.rb +58 -0
  591. data/spec/models/create_moderation_request_input_spec.rb +1 -1
  592. data/spec/models/create_moderation_request_model_spec.rb +1 -12
  593. data/spec/models/create_moderation_request_spec.rb +1 -1
  594. data/spec/models/create_moderation_response_results_inner_categories_spec.rb +25 -1
  595. data/spec/models/create_moderation_response_results_inner_category_scores_spec.rb +25 -1
  596. data/spec/models/create_moderation_response_results_inner_spec.rb +1 -1
  597. data/spec/models/create_moderation_response_spec.rb +1 -1
  598. data/spec/models/create_run_request_model_spec.rb +21 -0
  599. data/spec/models/{create_fine_tune_request_spec.rb → create_run_request_spec.rb} +31 -19
  600. data/spec/models/create_speech_request_model_spec.rb +21 -0
  601. data/spec/models/create_speech_request_spec.rb +68 -0
  602. data/spec/models/{fine_tune_spec.rb → create_thread_and_run_request_spec.rb} +20 -20
  603. data/spec/models/create_thread_and_run_request_tools_inner_spec.rb +32 -0
  604. data/spec/models/{list_fine_tune_events_response_spec.rb → create_thread_request_spec.rb} +9 -9
  605. data/spec/models/create_transcription200_response_spec.rb +32 -0
  606. data/spec/models/create_transcription_request_model_spec.rb +1 -12
  607. data/spec/models/{create_transcription_response_spec.rb → create_transcription_response_json_spec.rb} +7 -7
  608. data/spec/models/create_transcription_response_verbose_json_spec.rb +60 -0
  609. data/spec/models/create_translation200_response_spec.rb +32 -0
  610. data/spec/models/{create_translation_response_spec.rb → create_translation_response_json_spec.rb} +7 -7
  611. data/spec/models/create_translation_response_verbose_json_spec.rb +54 -0
  612. data/spec/models/delete_assistant_file_response_spec.rb +52 -0
  613. data/spec/models/delete_assistant_response_spec.rb +52 -0
  614. data/spec/models/delete_file_response_spec.rb +5 -1
  615. data/spec/models/delete_message_response_spec.rb +52 -0
  616. data/spec/models/delete_model_response_spec.rb +3 -3
  617. data/spec/models/delete_thread_response_spec.rb +52 -0
  618. data/spec/models/done_event_spec.rb +50 -0
  619. data/spec/models/{create_embedding_response_data_inner_spec.rb → embedding_spec.rb} +13 -9
  620. data/spec/models/error_event_spec.rb +46 -0
  621. data/spec/models/error_response_spec.rb +1 -1
  622. data/spec/models/error_spec.rb +3 -3
  623. data/spec/models/fine_tuning_integration_spec.rb +46 -0
  624. data/spec/models/fine_tuning_job_checkpoint_metrics_spec.rb +72 -0
  625. data/spec/models/fine_tuning_job_checkpoint_spec.rb +76 -0
  626. data/spec/models/{fine_tune_event_spec.rb → fine_tuning_job_error_spec.rb} +10 -16
  627. data/spec/models/fine_tuning_job_event_spec.rb +68 -0
  628. data/spec/models/fine_tuning_job_hyperparameters_n_epochs_spec.rb +32 -0
  629. data/spec/models/fine_tuning_job_hyperparameters_spec.rb +36 -0
  630. data/spec/models/fine_tuning_job_integrations_inner_spec.rb +32 -0
  631. data/spec/models/fine_tuning_job_spec.rb +134 -0
  632. data/spec/models/function_object_spec.rb +48 -0
  633. data/spec/models/{images_response_data_inner_spec.rb → image_spec.rb} +14 -8
  634. data/spec/models/images_response_spec.rb +1 -1
  635. data/spec/models/list_assistant_files_response_spec.rb +60 -0
  636. data/spec/models/list_assistants_response_spec.rb +60 -0
  637. data/spec/models/list_files_response_spec.rb +7 -3
  638. data/spec/models/list_fine_tuning_job_checkpoints_response_spec.rb +64 -0
  639. data/spec/models/{list_fine_tunes_response_spec.rb → list_fine_tuning_job_events_response_spec.rb} +13 -9
  640. data/spec/models/list_message_files_response_spec.rb +60 -0
  641. data/spec/models/list_messages_response_spec.rb +60 -0
  642. data/spec/models/list_models_response_spec.rb +5 -1
  643. data/spec/models/list_paginated_fine_tuning_jobs_response_spec.rb +52 -0
  644. data/spec/models/list_run_steps_response_spec.rb +60 -0
  645. data/spec/models/list_runs_response_spec.rb +60 -0
  646. data/spec/models/list_threads_response_spec.rb +60 -0
  647. data/spec/models/message_content_image_file_object_image_file_spec.rb +36 -0
  648. data/spec/models/message_content_image_file_object_spec.rb +46 -0
  649. data/spec/models/message_content_text_annotations_file_citation_object_file_citation_spec.rb +42 -0
  650. data/spec/models/message_content_text_annotations_file_citation_object_spec.rb +64 -0
  651. data/spec/models/message_content_text_annotations_file_path_object_file_path_spec.rb +36 -0
  652. data/spec/models/message_content_text_annotations_file_path_object_spec.rb +64 -0
  653. data/spec/models/message_content_text_object_spec.rb +46 -0
  654. data/spec/models/message_content_text_object_text_annotations_inner_spec.rb +32 -0
  655. data/spec/models/message_content_text_object_text_spec.rb +42 -0
  656. data/spec/models/message_delta_content_image_file_object_image_file_spec.rb +36 -0
  657. data/spec/models/message_delta_content_image_file_object_spec.rb +52 -0
  658. data/spec/models/message_delta_content_text_annotations_file_citation_object_file_citation_spec.rb +42 -0
  659. data/spec/models/message_delta_content_text_annotations_file_citation_object_spec.rb +70 -0
  660. data/spec/models/message_delta_content_text_annotations_file_path_object_file_path_spec.rb +36 -0
  661. data/spec/models/message_delta_content_text_annotations_file_path_object_spec.rb +70 -0
  662. data/spec/models/message_delta_content_text_object_spec.rb +52 -0
  663. data/spec/models/message_delta_content_text_object_text_annotations_inner_spec.rb +32 -0
  664. data/spec/models/message_delta_content_text_object_text_spec.rb +42 -0
  665. data/spec/models/message_delta_object_delta_content_inner_spec.rb +32 -0
  666. data/spec/models/message_delta_object_delta_spec.rb +52 -0
  667. data/spec/models/message_delta_object_spec.rb +52 -0
  668. data/spec/models/message_file_object_spec.rb +58 -0
  669. data/spec/models/message_object_content_inner_spec.rb +32 -0
  670. data/spec/models/message_object_incomplete_details_spec.rb +40 -0
  671. data/spec/models/message_object_spec.rb +126 -0
  672. data/spec/models/message_stream_event_one_of1_spec.rb +46 -0
  673. data/spec/models/message_stream_event_one_of2_spec.rb +46 -0
  674. data/spec/models/message_stream_event_one_of3_spec.rb +46 -0
  675. data/spec/models/message_stream_event_one_of4_spec.rb +46 -0
  676. data/spec/models/message_stream_event_one_of_spec.rb +46 -0
  677. data/spec/models/message_stream_event_spec.rb +32 -0
  678. data/spec/models/model_spec.rb +7 -3
  679. data/spec/models/modify_assistant_request_spec.rb +72 -0
  680. data/spec/models/modify_message_request_spec.rb +36 -0
  681. data/spec/models/modify_run_request_spec.rb +36 -0
  682. data/spec/models/modify_thread_request_spec.rb +36 -0
  683. data/spec/models/open_ai_file_spec.rb +17 -5
  684. data/spec/models/run_completion_usage_spec.rb +48 -0
  685. data/spec/models/run_object_incomplete_details_spec.rb +40 -0
  686. data/spec/models/run_object_last_error_spec.rb +46 -0
  687. data/spec/models/run_object_required_action_spec.rb +46 -0
  688. data/spec/models/run_object_required_action_submit_tool_outputs_spec.rb +36 -0
  689. data/spec/models/run_object_spec.rb +194 -0
  690. data/spec/models/run_step_completion_usage_spec.rb +48 -0
  691. data/spec/models/run_step_delta_object_delta_spec.rb +36 -0
  692. data/spec/models/run_step_delta_object_delta_step_details_spec.rb +32 -0
  693. data/spec/models/run_step_delta_object_spec.rb +52 -0
  694. data/spec/models/run_step_delta_step_details_message_creation_object_message_creation_spec.rb +36 -0
  695. data/spec/models/run_step_delta_step_details_message_creation_object_spec.rb +46 -0
  696. data/spec/models/run_step_delta_step_details_tool_calls_code_object_code_interpreter_outputs_inner_spec.rb +32 -0
  697. data/spec/models/run_step_delta_step_details_tool_calls_code_object_code_interpreter_spec.rb +42 -0
  698. data/spec/models/run_step_delta_step_details_tool_calls_code_object_spec.rb +58 -0
  699. data/spec/models/run_step_delta_step_details_tool_calls_code_output_image_object_image_spec.rb +36 -0
  700. data/spec/models/run_step_delta_step_details_tool_calls_code_output_image_object_spec.rb +52 -0
  701. data/spec/models/run_step_delta_step_details_tool_calls_code_output_logs_object_spec.rb +52 -0
  702. data/spec/models/run_step_delta_step_details_tool_calls_function_object_function_spec.rb +48 -0
  703. data/spec/models/run_step_delta_step_details_tool_calls_function_object_spec.rb +58 -0
  704. data/spec/models/run_step_delta_step_details_tool_calls_object_spec.rb +46 -0
  705. data/spec/models/run_step_delta_step_details_tool_calls_object_tool_calls_inner_spec.rb +32 -0
  706. data/spec/models/run_step_delta_step_details_tool_calls_retrieval_object_spec.rb +58 -0
  707. data/spec/models/run_step_details_message_creation_object_message_creation_spec.rb +36 -0
  708. data/spec/models/run_step_details_message_creation_object_spec.rb +46 -0
  709. data/spec/models/run_step_details_tool_calls_code_object_code_interpreter_outputs_inner_spec.rb +32 -0
  710. data/spec/models/run_step_details_tool_calls_code_object_code_interpreter_spec.rb +42 -0
  711. data/spec/models/run_step_details_tool_calls_code_object_spec.rb +52 -0
  712. data/spec/models/run_step_details_tool_calls_code_output_image_object_image_spec.rb +36 -0
  713. data/spec/models/run_step_details_tool_calls_code_output_image_object_spec.rb +46 -0
  714. data/spec/models/run_step_details_tool_calls_code_output_logs_object_spec.rb +46 -0
  715. data/spec/models/run_step_details_tool_calls_function_object_function_spec.rb +48 -0
  716. data/spec/models/run_step_details_tool_calls_function_object_spec.rb +52 -0
  717. data/spec/models/run_step_details_tool_calls_object_spec.rb +46 -0
  718. data/spec/models/run_step_details_tool_calls_object_tool_calls_inner_spec.rb +32 -0
  719. data/spec/models/run_step_details_tool_calls_retrieval_object_spec.rb +52 -0
  720. data/spec/models/run_step_object_last_error_spec.rb +46 -0
  721. data/spec/models/run_step_object_spec.rb +138 -0
  722. data/spec/models/run_step_object_step_details_spec.rb +32 -0
  723. data/spec/models/run_step_stream_event_one_of1_spec.rb +46 -0
  724. data/spec/models/run_step_stream_event_one_of2_spec.rb +46 -0
  725. data/spec/models/run_step_stream_event_one_of3_spec.rb +46 -0
  726. data/spec/models/run_step_stream_event_one_of4_spec.rb +46 -0
  727. data/spec/models/run_step_stream_event_one_of5_spec.rb +46 -0
  728. data/spec/models/run_step_stream_event_one_of6_spec.rb +46 -0
  729. data/spec/models/run_step_stream_event_one_of_spec.rb +46 -0
  730. data/spec/models/run_step_stream_event_spec.rb +32 -0
  731. data/spec/models/run_stream_event_one_of1_spec.rb +46 -0
  732. data/spec/models/run_stream_event_one_of2_spec.rb +46 -0
  733. data/spec/models/run_stream_event_one_of3_spec.rb +46 -0
  734. data/spec/models/run_stream_event_one_of4_spec.rb +46 -0
  735. data/spec/models/run_stream_event_one_of5_spec.rb +46 -0
  736. data/spec/models/run_stream_event_one_of6_spec.rb +46 -0
  737. data/spec/models/run_stream_event_one_of7_spec.rb +46 -0
  738. data/spec/models/run_stream_event_one_of8_spec.rb +46 -0
  739. data/spec/models/run_stream_event_one_of_spec.rb +46 -0
  740. data/spec/models/{create_fine_tune_request_model_spec.rb → run_stream_event_spec.rb} +3 -3
  741. data/spec/models/run_tool_call_object_function_spec.rb +42 -0
  742. data/spec/models/run_tool_call_object_spec.rb +52 -0
  743. data/spec/models/submit_tool_outputs_run_request_spec.rb +42 -0
  744. data/spec/models/submit_tool_outputs_run_request_tool_outputs_inner_spec.rb +42 -0
  745. data/spec/models/thread_object_spec.rb +58 -0
  746. data/spec/models/thread_stream_event_one_of_spec.rb +46 -0
  747. data/spec/models/{create_edit_request_model_spec.rb → thread_stream_event_spec.rb} +3 -3
  748. data/spec/models/transcription_segment_spec.rb +90 -0
  749. data/spec/models/transcription_word_spec.rb +48 -0
  750. data/spec/models/truncation_object_spec.rb +46 -0
  751. data/spec/spec_helper.rb +1 -1
  752. metadata +867 -106
  753. data/docs/CreateCompletionResponseUsage.md +0 -22
  754. data/docs/CreateEditRequest.md +0 -28
  755. data/docs/CreateEditResponse.md +0 -24
  756. data/docs/CreateEditResponseChoicesInner.md +0 -24
  757. data/docs/CreateEmbeddingResponseDataInner.md +0 -22
  758. data/docs/CreateFineTuneRequest.md +0 -40
  759. data/docs/CreateTranslationResponse.md +0 -18
  760. data/docs/FineTune.md +0 -42
  761. data/docs/ImagesResponseDataInner.md +0 -20
  762. data/docs/ListFineTuneEventsResponse.md +0 -20
  763. data/docs/ListFineTunesResponse.md +0 -20
  764. data/docs/OpenAIApi.md +0 -1499
  765. data/lib/openapi_openai/api/open_ai_api.rb +0 -1583
  766. data/spec/api/open_ai_api_spec.rb +0 -306
@@ -0,0 +1,2006 @@
1
+ =begin
2
+ #OpenAI API
3
+
4
+ #The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: blah+oapicf@cliffano.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.4.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OpenApiOpenAIClient
16
+ class AssistantsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Cancels a run that is `in_progress`.
23
+ # @param thread_id [String] The ID of the thread to which this run belongs.
24
+ # @param run_id [String] The ID of the run to cancel.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [RunObject]
27
+ def cancel_run(thread_id, run_id, opts = {})
28
+ data, _status_code, _headers = cancel_run_with_http_info(thread_id, run_id, opts)
29
+ data
30
+ end
31
+
32
+ # Cancels a run that is `in_progress`.
33
+ # @param thread_id [String] The ID of the thread to which this run belongs.
34
+ # @param run_id [String] The ID of the run to cancel.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(RunObject, Integer, Hash)>] RunObject data, response status code and response headers
37
+ def cancel_run_with_http_info(thread_id, run_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.cancel_run ...'
40
+ end
41
+ # verify the required parameter 'thread_id' is set
42
+ if @api_client.config.client_side_validation && thread_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.cancel_run"
44
+ end
45
+ # verify the required parameter 'run_id' is set
46
+ if @api_client.config.client_side_validation && run_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling AssistantsApi.cancel_run"
48
+ end
49
+ # resource path
50
+ local_var_path = '/threads/{thread_id}/runs/{run_id}/cancel'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body]
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'RunObject'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"AssistantsApi.cancel_run",
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: AssistantsApi#cancel_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # Create an assistant with a model and instructions.
90
+ # @param create_assistant_request [CreateAssistantRequest]
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [AssistantObject]
93
+ def create_assistant(create_assistant_request, opts = {})
94
+ data, _status_code, _headers = create_assistant_with_http_info(create_assistant_request, opts)
95
+ data
96
+ end
97
+
98
+ # Create an assistant with a model and instructions.
99
+ # @param create_assistant_request [CreateAssistantRequest]
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [Array<(AssistantObject, Integer, Hash)>] AssistantObject data, response status code and response headers
102
+ def create_assistant_with_http_info(create_assistant_request, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.create_assistant ...'
105
+ end
106
+ # verify the required parameter 'create_assistant_request' is set
107
+ if @api_client.config.client_side_validation && create_assistant_request.nil?
108
+ fail ArgumentError, "Missing the required parameter 'create_assistant_request' when calling AssistantsApi.create_assistant"
109
+ end
110
+ # resource path
111
+ local_var_path = '/assistants'
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
120
+ # HTTP header 'Content-Type'
121
+ content_type = @api_client.select_header_content_type(['application/json'])
122
+ if !content_type.nil?
123
+ header_params['Content-Type'] = content_type
124
+ end
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_assistant_request)
131
+
132
+ # return_type
133
+ return_type = opts[:debug_return_type] || 'AssistantObject'
134
+
135
+ # auth_names
136
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
137
+
138
+ new_options = opts.merge(
139
+ :operation => :"AssistantsApi.create_assistant",
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "API called: AssistantsApi#create_assistant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants).
156
+ # @param assistant_id [String] The ID of the assistant for which to create a File.
157
+ # @param create_assistant_file_request [CreateAssistantFileRequest]
158
+ # @param [Hash] opts the optional parameters
159
+ # @return [AssistantFileObject]
160
+ def create_assistant_file(assistant_id, create_assistant_file_request, opts = {})
161
+ data, _status_code, _headers = create_assistant_file_with_http_info(assistant_id, create_assistant_file_request, opts)
162
+ data
163
+ end
164
+
165
+ # Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants).
166
+ # @param assistant_id [String] The ID of the assistant for which to create a File.
167
+ # @param create_assistant_file_request [CreateAssistantFileRequest]
168
+ # @param [Hash] opts the optional parameters
169
+ # @return [Array<(AssistantFileObject, Integer, Hash)>] AssistantFileObject data, response status code and response headers
170
+ def create_assistant_file_with_http_info(assistant_id, create_assistant_file_request, opts = {})
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.create_assistant_file ...'
173
+ end
174
+ # verify the required parameter 'assistant_id' is set
175
+ if @api_client.config.client_side_validation && assistant_id.nil?
176
+ fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.create_assistant_file"
177
+ end
178
+ # verify the required parameter 'create_assistant_file_request' is set
179
+ if @api_client.config.client_side_validation && create_assistant_file_request.nil?
180
+ fail ArgumentError, "Missing the required parameter 'create_assistant_file_request' when calling AssistantsApi.create_assistant_file"
181
+ end
182
+ # resource path
183
+ local_var_path = '/assistants/{assistant_id}/files'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s))
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+
188
+ # header parameters
189
+ header_params = opts[:header_params] || {}
190
+ # HTTP header 'Accept' (if needed)
191
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
192
+ # HTTP header 'Content-Type'
193
+ content_type = @api_client.select_header_content_type(['application/json'])
194
+ if !content_type.nil?
195
+ header_params['Content-Type'] = content_type
196
+ end
197
+
198
+ # form parameters
199
+ form_params = opts[:form_params] || {}
200
+
201
+ # http body (model)
202
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_assistant_file_request)
203
+
204
+ # return_type
205
+ return_type = opts[:debug_return_type] || 'AssistantFileObject'
206
+
207
+ # auth_names
208
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
209
+
210
+ new_options = opts.merge(
211
+ :operation => :"AssistantsApi.create_assistant_file",
212
+ :header_params => header_params,
213
+ :query_params => query_params,
214
+ :form_params => form_params,
215
+ :body => post_body,
216
+ :auth_names => auth_names,
217
+ :return_type => return_type
218
+ )
219
+
220
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug "API called: AssistantsApi#create_assistant_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
223
+ end
224
+ return data, status_code, headers
225
+ end
226
+
227
+ # Create a message.
228
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) to create a message for.
229
+ # @param create_message_request [CreateMessageRequest]
230
+ # @param [Hash] opts the optional parameters
231
+ # @return [MessageObject]
232
+ def create_message(thread_id, create_message_request, opts = {})
233
+ data, _status_code, _headers = create_message_with_http_info(thread_id, create_message_request, opts)
234
+ data
235
+ end
236
+
237
+ # Create a message.
238
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) to create a message for.
239
+ # @param create_message_request [CreateMessageRequest]
240
+ # @param [Hash] opts the optional parameters
241
+ # @return [Array<(MessageObject, Integer, Hash)>] MessageObject data, response status code and response headers
242
+ def create_message_with_http_info(thread_id, create_message_request, opts = {})
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.create_message ...'
245
+ end
246
+ # verify the required parameter 'thread_id' is set
247
+ if @api_client.config.client_side_validation && thread_id.nil?
248
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.create_message"
249
+ end
250
+ # verify the required parameter 'create_message_request' is set
251
+ if @api_client.config.client_side_validation && create_message_request.nil?
252
+ fail ArgumentError, "Missing the required parameter 'create_message_request' when calling AssistantsApi.create_message"
253
+ end
254
+ # resource path
255
+ local_var_path = '/threads/{thread_id}/messages'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))
256
+
257
+ # query parameters
258
+ query_params = opts[:query_params] || {}
259
+
260
+ # header parameters
261
+ header_params = opts[:header_params] || {}
262
+ # HTTP header 'Accept' (if needed)
263
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
264
+ # HTTP header 'Content-Type'
265
+ content_type = @api_client.select_header_content_type(['application/json'])
266
+ if !content_type.nil?
267
+ header_params['Content-Type'] = content_type
268
+ end
269
+
270
+ # form parameters
271
+ form_params = opts[:form_params] || {}
272
+
273
+ # http body (model)
274
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_message_request)
275
+
276
+ # return_type
277
+ return_type = opts[:debug_return_type] || 'MessageObject'
278
+
279
+ # auth_names
280
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
281
+
282
+ new_options = opts.merge(
283
+ :operation => :"AssistantsApi.create_message",
284
+ :header_params => header_params,
285
+ :query_params => query_params,
286
+ :form_params => form_params,
287
+ :body => post_body,
288
+ :auth_names => auth_names,
289
+ :return_type => return_type
290
+ )
291
+
292
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
293
+ if @api_client.config.debugging
294
+ @api_client.config.logger.debug "API called: AssistantsApi#create_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
295
+ end
296
+ return data, status_code, headers
297
+ end
298
+
299
+ # Create a run.
300
+ # @param thread_id [String] The ID of the thread to run.
301
+ # @param create_run_request [CreateRunRequest]
302
+ # @param [Hash] opts the optional parameters
303
+ # @return [RunObject]
304
+ def create_run(thread_id, create_run_request, opts = {})
305
+ data, _status_code, _headers = create_run_with_http_info(thread_id, create_run_request, opts)
306
+ data
307
+ end
308
+
309
+ # Create a run.
310
+ # @param thread_id [String] The ID of the thread to run.
311
+ # @param create_run_request [CreateRunRequest]
312
+ # @param [Hash] opts the optional parameters
313
+ # @return [Array<(RunObject, Integer, Hash)>] RunObject data, response status code and response headers
314
+ def create_run_with_http_info(thread_id, create_run_request, opts = {})
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.create_run ...'
317
+ end
318
+ # verify the required parameter 'thread_id' is set
319
+ if @api_client.config.client_side_validation && thread_id.nil?
320
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.create_run"
321
+ end
322
+ # verify the required parameter 'create_run_request' is set
323
+ if @api_client.config.client_side_validation && create_run_request.nil?
324
+ fail ArgumentError, "Missing the required parameter 'create_run_request' when calling AssistantsApi.create_run"
325
+ end
326
+ # resource path
327
+ local_var_path = '/threads/{thread_id}/runs'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))
328
+
329
+ # query parameters
330
+ query_params = opts[:query_params] || {}
331
+
332
+ # header parameters
333
+ header_params = opts[:header_params] || {}
334
+ # HTTP header 'Accept' (if needed)
335
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
336
+ # HTTP header 'Content-Type'
337
+ content_type = @api_client.select_header_content_type(['application/json'])
338
+ if !content_type.nil?
339
+ header_params['Content-Type'] = content_type
340
+ end
341
+
342
+ # form parameters
343
+ form_params = opts[:form_params] || {}
344
+
345
+ # http body (model)
346
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_run_request)
347
+
348
+ # return_type
349
+ return_type = opts[:debug_return_type] || 'RunObject'
350
+
351
+ # auth_names
352
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
353
+
354
+ new_options = opts.merge(
355
+ :operation => :"AssistantsApi.create_run",
356
+ :header_params => header_params,
357
+ :query_params => query_params,
358
+ :form_params => form_params,
359
+ :body => post_body,
360
+ :auth_names => auth_names,
361
+ :return_type => return_type
362
+ )
363
+
364
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
365
+ if @api_client.config.debugging
366
+ @api_client.config.logger.debug "API called: AssistantsApi#create_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
367
+ end
368
+ return data, status_code, headers
369
+ end
370
+
371
+ # Create a thread.
372
+ # @param [Hash] opts the optional parameters
373
+ # @option opts [CreateThreadRequest] :create_thread_request
374
+ # @return [ThreadObject]
375
+ def create_thread(opts = {})
376
+ data, _status_code, _headers = create_thread_with_http_info(opts)
377
+ data
378
+ end
379
+
380
+ # Create a thread.
381
+ # @param [Hash] opts the optional parameters
382
+ # @option opts [CreateThreadRequest] :create_thread_request
383
+ # @return [Array<(ThreadObject, Integer, Hash)>] ThreadObject data, response status code and response headers
384
+ def create_thread_with_http_info(opts = {})
385
+ if @api_client.config.debugging
386
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.create_thread ...'
387
+ end
388
+ # resource path
389
+ local_var_path = '/threads'
390
+
391
+ # query parameters
392
+ query_params = opts[:query_params] || {}
393
+
394
+ # header parameters
395
+ header_params = opts[:header_params] || {}
396
+ # HTTP header 'Accept' (if needed)
397
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
398
+ # HTTP header 'Content-Type'
399
+ content_type = @api_client.select_header_content_type(['application/json'])
400
+ if !content_type.nil?
401
+ header_params['Content-Type'] = content_type
402
+ end
403
+
404
+ # form parameters
405
+ form_params = opts[:form_params] || {}
406
+
407
+ # http body (model)
408
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_thread_request'])
409
+
410
+ # return_type
411
+ return_type = opts[:debug_return_type] || 'ThreadObject'
412
+
413
+ # auth_names
414
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
415
+
416
+ new_options = opts.merge(
417
+ :operation => :"AssistantsApi.create_thread",
418
+ :header_params => header_params,
419
+ :query_params => query_params,
420
+ :form_params => form_params,
421
+ :body => post_body,
422
+ :auth_names => auth_names,
423
+ :return_type => return_type
424
+ )
425
+
426
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
427
+ if @api_client.config.debugging
428
+ @api_client.config.logger.debug "API called: AssistantsApi#create_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
429
+ end
430
+ return data, status_code, headers
431
+ end
432
+
433
+ # Create a thread and run it in one request.
434
+ # @param create_thread_and_run_request [CreateThreadAndRunRequest]
435
+ # @param [Hash] opts the optional parameters
436
+ # @return [RunObject]
437
+ def create_thread_and_run(create_thread_and_run_request, opts = {})
438
+ data, _status_code, _headers = create_thread_and_run_with_http_info(create_thread_and_run_request, opts)
439
+ data
440
+ end
441
+
442
+ # Create a thread and run it in one request.
443
+ # @param create_thread_and_run_request [CreateThreadAndRunRequest]
444
+ # @param [Hash] opts the optional parameters
445
+ # @return [Array<(RunObject, Integer, Hash)>] RunObject data, response status code and response headers
446
+ def create_thread_and_run_with_http_info(create_thread_and_run_request, opts = {})
447
+ if @api_client.config.debugging
448
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.create_thread_and_run ...'
449
+ end
450
+ # verify the required parameter 'create_thread_and_run_request' is set
451
+ if @api_client.config.client_side_validation && create_thread_and_run_request.nil?
452
+ fail ArgumentError, "Missing the required parameter 'create_thread_and_run_request' when calling AssistantsApi.create_thread_and_run"
453
+ end
454
+ # resource path
455
+ local_var_path = '/threads/runs'
456
+
457
+ # query parameters
458
+ query_params = opts[:query_params] || {}
459
+
460
+ # header parameters
461
+ header_params = opts[:header_params] || {}
462
+ # HTTP header 'Accept' (if needed)
463
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
464
+ # HTTP header 'Content-Type'
465
+ content_type = @api_client.select_header_content_type(['application/json'])
466
+ if !content_type.nil?
467
+ header_params['Content-Type'] = content_type
468
+ end
469
+
470
+ # form parameters
471
+ form_params = opts[:form_params] || {}
472
+
473
+ # http body (model)
474
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_thread_and_run_request)
475
+
476
+ # return_type
477
+ return_type = opts[:debug_return_type] || 'RunObject'
478
+
479
+ # auth_names
480
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
481
+
482
+ new_options = opts.merge(
483
+ :operation => :"AssistantsApi.create_thread_and_run",
484
+ :header_params => header_params,
485
+ :query_params => query_params,
486
+ :form_params => form_params,
487
+ :body => post_body,
488
+ :auth_names => auth_names,
489
+ :return_type => return_type
490
+ )
491
+
492
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
493
+ if @api_client.config.debugging
494
+ @api_client.config.logger.debug "API called: AssistantsApi#create_thread_and_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
495
+ end
496
+ return data, status_code, headers
497
+ end
498
+
499
+ # Delete an assistant.
500
+ # @param assistant_id [String] The ID of the assistant to delete.
501
+ # @param [Hash] opts the optional parameters
502
+ # @return [DeleteAssistantResponse]
503
+ def delete_assistant(assistant_id, opts = {})
504
+ data, _status_code, _headers = delete_assistant_with_http_info(assistant_id, opts)
505
+ data
506
+ end
507
+
508
+ # Delete an assistant.
509
+ # @param assistant_id [String] The ID of the assistant to delete.
510
+ # @param [Hash] opts the optional parameters
511
+ # @return [Array<(DeleteAssistantResponse, Integer, Hash)>] DeleteAssistantResponse data, response status code and response headers
512
+ def delete_assistant_with_http_info(assistant_id, opts = {})
513
+ if @api_client.config.debugging
514
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.delete_assistant ...'
515
+ end
516
+ # verify the required parameter 'assistant_id' is set
517
+ if @api_client.config.client_side_validation && assistant_id.nil?
518
+ fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.delete_assistant"
519
+ end
520
+ # resource path
521
+ local_var_path = '/assistants/{assistant_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s))
522
+
523
+ # query parameters
524
+ query_params = opts[:query_params] || {}
525
+
526
+ # header parameters
527
+ header_params = opts[:header_params] || {}
528
+ # HTTP header 'Accept' (if needed)
529
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
530
+
531
+ # form parameters
532
+ form_params = opts[:form_params] || {}
533
+
534
+ # http body (model)
535
+ post_body = opts[:debug_body]
536
+
537
+ # return_type
538
+ return_type = opts[:debug_return_type] || 'DeleteAssistantResponse'
539
+
540
+ # auth_names
541
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
542
+
543
+ new_options = opts.merge(
544
+ :operation => :"AssistantsApi.delete_assistant",
545
+ :header_params => header_params,
546
+ :query_params => query_params,
547
+ :form_params => form_params,
548
+ :body => post_body,
549
+ :auth_names => auth_names,
550
+ :return_type => return_type
551
+ )
552
+
553
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
554
+ if @api_client.config.debugging
555
+ @api_client.config.logger.debug "API called: AssistantsApi#delete_assistant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
556
+ end
557
+ return data, status_code, headers
558
+ end
559
+
560
+ # Delete an assistant file.
561
+ # @param assistant_id [String] The ID of the assistant that the file belongs to.
562
+ # @param file_id [String] The ID of the file to delete.
563
+ # @param [Hash] opts the optional parameters
564
+ # @return [DeleteAssistantFileResponse]
565
+ def delete_assistant_file(assistant_id, file_id, opts = {})
566
+ data, _status_code, _headers = delete_assistant_file_with_http_info(assistant_id, file_id, opts)
567
+ data
568
+ end
569
+
570
+ # Delete an assistant file.
571
+ # @param assistant_id [String] The ID of the assistant that the file belongs to.
572
+ # @param file_id [String] The ID of the file to delete.
573
+ # @param [Hash] opts the optional parameters
574
+ # @return [Array<(DeleteAssistantFileResponse, Integer, Hash)>] DeleteAssistantFileResponse data, response status code and response headers
575
+ def delete_assistant_file_with_http_info(assistant_id, file_id, opts = {})
576
+ if @api_client.config.debugging
577
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.delete_assistant_file ...'
578
+ end
579
+ # verify the required parameter 'assistant_id' is set
580
+ if @api_client.config.client_side_validation && assistant_id.nil?
581
+ fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.delete_assistant_file"
582
+ end
583
+ # verify the required parameter 'file_id' is set
584
+ if @api_client.config.client_side_validation && file_id.nil?
585
+ fail ArgumentError, "Missing the required parameter 'file_id' when calling AssistantsApi.delete_assistant_file"
586
+ end
587
+ # resource path
588
+ local_var_path = '/assistants/{assistant_id}/files/{file_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s)).sub('{' + 'file_id' + '}', CGI.escape(file_id.to_s))
589
+
590
+ # query parameters
591
+ query_params = opts[:query_params] || {}
592
+
593
+ # header parameters
594
+ header_params = opts[:header_params] || {}
595
+ # HTTP header 'Accept' (if needed)
596
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
597
+
598
+ # form parameters
599
+ form_params = opts[:form_params] || {}
600
+
601
+ # http body (model)
602
+ post_body = opts[:debug_body]
603
+
604
+ # return_type
605
+ return_type = opts[:debug_return_type] || 'DeleteAssistantFileResponse'
606
+
607
+ # auth_names
608
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
609
+
610
+ new_options = opts.merge(
611
+ :operation => :"AssistantsApi.delete_assistant_file",
612
+ :header_params => header_params,
613
+ :query_params => query_params,
614
+ :form_params => form_params,
615
+ :body => post_body,
616
+ :auth_names => auth_names,
617
+ :return_type => return_type
618
+ )
619
+
620
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
621
+ if @api_client.config.debugging
622
+ @api_client.config.logger.debug "API called: AssistantsApi#delete_assistant_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
623
+ end
624
+ return data, status_code, headers
625
+ end
626
+
627
+ # Delete a thread.
628
+ # @param thread_id [String] The ID of the thread to delete.
629
+ # @param [Hash] opts the optional parameters
630
+ # @return [DeleteThreadResponse]
631
+ def delete_thread(thread_id, opts = {})
632
+ data, _status_code, _headers = delete_thread_with_http_info(thread_id, opts)
633
+ data
634
+ end
635
+
636
+ # Delete a thread.
637
+ # @param thread_id [String] The ID of the thread to delete.
638
+ # @param [Hash] opts the optional parameters
639
+ # @return [Array<(DeleteThreadResponse, Integer, Hash)>] DeleteThreadResponse data, response status code and response headers
640
+ def delete_thread_with_http_info(thread_id, opts = {})
641
+ if @api_client.config.debugging
642
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.delete_thread ...'
643
+ end
644
+ # verify the required parameter 'thread_id' is set
645
+ if @api_client.config.client_side_validation && thread_id.nil?
646
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.delete_thread"
647
+ end
648
+ # resource path
649
+ local_var_path = '/threads/{thread_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))
650
+
651
+ # query parameters
652
+ query_params = opts[:query_params] || {}
653
+
654
+ # header parameters
655
+ header_params = opts[:header_params] || {}
656
+ # HTTP header 'Accept' (if needed)
657
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
658
+
659
+ # form parameters
660
+ form_params = opts[:form_params] || {}
661
+
662
+ # http body (model)
663
+ post_body = opts[:debug_body]
664
+
665
+ # return_type
666
+ return_type = opts[:debug_return_type] || 'DeleteThreadResponse'
667
+
668
+ # auth_names
669
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
670
+
671
+ new_options = opts.merge(
672
+ :operation => :"AssistantsApi.delete_thread",
673
+ :header_params => header_params,
674
+ :query_params => query_params,
675
+ :form_params => form_params,
676
+ :body => post_body,
677
+ :auth_names => auth_names,
678
+ :return_type => return_type
679
+ )
680
+
681
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
682
+ if @api_client.config.debugging
683
+ @api_client.config.logger.debug "API called: AssistantsApi#delete_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
684
+ end
685
+ return data, status_code, headers
686
+ end
687
+
688
+ # Retrieves an assistant.
689
+ # @param assistant_id [String] The ID of the assistant to retrieve.
690
+ # @param [Hash] opts the optional parameters
691
+ # @return [AssistantObject]
692
+ def get_assistant(assistant_id, opts = {})
693
+ data, _status_code, _headers = get_assistant_with_http_info(assistant_id, opts)
694
+ data
695
+ end
696
+
697
+ # Retrieves an assistant.
698
+ # @param assistant_id [String] The ID of the assistant to retrieve.
699
+ # @param [Hash] opts the optional parameters
700
+ # @return [Array<(AssistantObject, Integer, Hash)>] AssistantObject data, response status code and response headers
701
+ def get_assistant_with_http_info(assistant_id, opts = {})
702
+ if @api_client.config.debugging
703
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.get_assistant ...'
704
+ end
705
+ # verify the required parameter 'assistant_id' is set
706
+ if @api_client.config.client_side_validation && assistant_id.nil?
707
+ fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.get_assistant"
708
+ end
709
+ # resource path
710
+ local_var_path = '/assistants/{assistant_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s))
711
+
712
+ # query parameters
713
+ query_params = opts[:query_params] || {}
714
+
715
+ # header parameters
716
+ header_params = opts[:header_params] || {}
717
+ # HTTP header 'Accept' (if needed)
718
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
719
+
720
+ # form parameters
721
+ form_params = opts[:form_params] || {}
722
+
723
+ # http body (model)
724
+ post_body = opts[:debug_body]
725
+
726
+ # return_type
727
+ return_type = opts[:debug_return_type] || 'AssistantObject'
728
+
729
+ # auth_names
730
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
731
+
732
+ new_options = opts.merge(
733
+ :operation => :"AssistantsApi.get_assistant",
734
+ :header_params => header_params,
735
+ :query_params => query_params,
736
+ :form_params => form_params,
737
+ :body => post_body,
738
+ :auth_names => auth_names,
739
+ :return_type => return_type
740
+ )
741
+
742
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
743
+ if @api_client.config.debugging
744
+ @api_client.config.logger.debug "API called: AssistantsApi#get_assistant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
745
+ end
746
+ return data, status_code, headers
747
+ end
748
+
749
+ # Retrieves an AssistantFile.
750
+ # @param assistant_id [String] The ID of the assistant who the file belongs to.
751
+ # @param file_id [String] The ID of the file we&#39;re getting.
752
+ # @param [Hash] opts the optional parameters
753
+ # @return [AssistantFileObject]
754
+ def get_assistant_file(assistant_id, file_id, opts = {})
755
+ data, _status_code, _headers = get_assistant_file_with_http_info(assistant_id, file_id, opts)
756
+ data
757
+ end
758
+
759
+ # Retrieves an AssistantFile.
760
+ # @param assistant_id [String] The ID of the assistant who the file belongs to.
761
+ # @param file_id [String] The ID of the file we&#39;re getting.
762
+ # @param [Hash] opts the optional parameters
763
+ # @return [Array<(AssistantFileObject, Integer, Hash)>] AssistantFileObject data, response status code and response headers
764
+ def get_assistant_file_with_http_info(assistant_id, file_id, opts = {})
765
+ if @api_client.config.debugging
766
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.get_assistant_file ...'
767
+ end
768
+ # verify the required parameter 'assistant_id' is set
769
+ if @api_client.config.client_side_validation && assistant_id.nil?
770
+ fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.get_assistant_file"
771
+ end
772
+ # verify the required parameter 'file_id' is set
773
+ if @api_client.config.client_side_validation && file_id.nil?
774
+ fail ArgumentError, "Missing the required parameter 'file_id' when calling AssistantsApi.get_assistant_file"
775
+ end
776
+ # resource path
777
+ local_var_path = '/assistants/{assistant_id}/files/{file_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s)).sub('{' + 'file_id' + '}', CGI.escape(file_id.to_s))
778
+
779
+ # query parameters
780
+ query_params = opts[:query_params] || {}
781
+
782
+ # header parameters
783
+ header_params = opts[:header_params] || {}
784
+ # HTTP header 'Accept' (if needed)
785
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
786
+
787
+ # form parameters
788
+ form_params = opts[:form_params] || {}
789
+
790
+ # http body (model)
791
+ post_body = opts[:debug_body]
792
+
793
+ # return_type
794
+ return_type = opts[:debug_return_type] || 'AssistantFileObject'
795
+
796
+ # auth_names
797
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
798
+
799
+ new_options = opts.merge(
800
+ :operation => :"AssistantsApi.get_assistant_file",
801
+ :header_params => header_params,
802
+ :query_params => query_params,
803
+ :form_params => form_params,
804
+ :body => post_body,
805
+ :auth_names => auth_names,
806
+ :return_type => return_type
807
+ )
808
+
809
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
810
+ if @api_client.config.debugging
811
+ @api_client.config.logger.debug "API called: AssistantsApi#get_assistant_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
812
+ end
813
+ return data, status_code, headers
814
+ end
815
+
816
+ # Retrieve a message.
817
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) to which this message belongs.
818
+ # @param message_id [String] The ID of the message to retrieve.
819
+ # @param [Hash] opts the optional parameters
820
+ # @return [MessageObject]
821
+ def get_message(thread_id, message_id, opts = {})
822
+ data, _status_code, _headers = get_message_with_http_info(thread_id, message_id, opts)
823
+ data
824
+ end
825
+
826
+ # Retrieve a message.
827
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) to which this message belongs.
828
+ # @param message_id [String] The ID of the message to retrieve.
829
+ # @param [Hash] opts the optional parameters
830
+ # @return [Array<(MessageObject, Integer, Hash)>] MessageObject data, response status code and response headers
831
+ def get_message_with_http_info(thread_id, message_id, opts = {})
832
+ if @api_client.config.debugging
833
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.get_message ...'
834
+ end
835
+ # verify the required parameter 'thread_id' is set
836
+ if @api_client.config.client_side_validation && thread_id.nil?
837
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_message"
838
+ end
839
+ # verify the required parameter 'message_id' is set
840
+ if @api_client.config.client_side_validation && message_id.nil?
841
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.get_message"
842
+ end
843
+ # resource path
844
+ local_var_path = '/threads/{thread_id}/messages/{message_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_id.to_s))
845
+
846
+ # query parameters
847
+ query_params = opts[:query_params] || {}
848
+
849
+ # header parameters
850
+ header_params = opts[:header_params] || {}
851
+ # HTTP header 'Accept' (if needed)
852
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
853
+
854
+ # form parameters
855
+ form_params = opts[:form_params] || {}
856
+
857
+ # http body (model)
858
+ post_body = opts[:debug_body]
859
+
860
+ # return_type
861
+ return_type = opts[:debug_return_type] || 'MessageObject'
862
+
863
+ # auth_names
864
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
865
+
866
+ new_options = opts.merge(
867
+ :operation => :"AssistantsApi.get_message",
868
+ :header_params => header_params,
869
+ :query_params => query_params,
870
+ :form_params => form_params,
871
+ :body => post_body,
872
+ :auth_names => auth_names,
873
+ :return_type => return_type
874
+ )
875
+
876
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
877
+ if @api_client.config.debugging
878
+ @api_client.config.logger.debug "API called: AssistantsApi#get_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
879
+ end
880
+ return data, status_code, headers
881
+ end
882
+
883
+ # Retrieves a message file.
884
+ # @param thread_id [String] The ID of the thread to which the message and File belong.
885
+ # @param message_id [String] The ID of the message the file belongs to.
886
+ # @param file_id [String] The ID of the file being retrieved.
887
+ # @param [Hash] opts the optional parameters
888
+ # @return [MessageFileObject]
889
+ def get_message_file(thread_id, message_id, file_id, opts = {})
890
+ data, _status_code, _headers = get_message_file_with_http_info(thread_id, message_id, file_id, opts)
891
+ data
892
+ end
893
+
894
+ # Retrieves a message file.
895
+ # @param thread_id [String] The ID of the thread to which the message and File belong.
896
+ # @param message_id [String] The ID of the message the file belongs to.
897
+ # @param file_id [String] The ID of the file being retrieved.
898
+ # @param [Hash] opts the optional parameters
899
+ # @return [Array<(MessageFileObject, Integer, Hash)>] MessageFileObject data, response status code and response headers
900
+ def get_message_file_with_http_info(thread_id, message_id, file_id, opts = {})
901
+ if @api_client.config.debugging
902
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.get_message_file ...'
903
+ end
904
+ # verify the required parameter 'thread_id' is set
905
+ if @api_client.config.client_side_validation && thread_id.nil?
906
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_message_file"
907
+ end
908
+ # verify the required parameter 'message_id' is set
909
+ if @api_client.config.client_side_validation && message_id.nil?
910
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.get_message_file"
911
+ end
912
+ # verify the required parameter 'file_id' is set
913
+ if @api_client.config.client_side_validation && file_id.nil?
914
+ fail ArgumentError, "Missing the required parameter 'file_id' when calling AssistantsApi.get_message_file"
915
+ end
916
+ # resource path
917
+ local_var_path = '/threads/{thread_id}/messages/{message_id}/files/{file_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_id.to_s)).sub('{' + 'file_id' + '}', CGI.escape(file_id.to_s))
918
+
919
+ # query parameters
920
+ query_params = opts[:query_params] || {}
921
+
922
+ # header parameters
923
+ header_params = opts[:header_params] || {}
924
+ # HTTP header 'Accept' (if needed)
925
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
926
+
927
+ # form parameters
928
+ form_params = opts[:form_params] || {}
929
+
930
+ # http body (model)
931
+ post_body = opts[:debug_body]
932
+
933
+ # return_type
934
+ return_type = opts[:debug_return_type] || 'MessageFileObject'
935
+
936
+ # auth_names
937
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
938
+
939
+ new_options = opts.merge(
940
+ :operation => :"AssistantsApi.get_message_file",
941
+ :header_params => header_params,
942
+ :query_params => query_params,
943
+ :form_params => form_params,
944
+ :body => post_body,
945
+ :auth_names => auth_names,
946
+ :return_type => return_type
947
+ )
948
+
949
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
950
+ if @api_client.config.debugging
951
+ @api_client.config.logger.debug "API called: AssistantsApi#get_message_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
952
+ end
953
+ return data, status_code, headers
954
+ end
955
+
956
+ # Retrieves a run.
957
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) that was run.
958
+ # @param run_id [String] The ID of the run to retrieve.
959
+ # @param [Hash] opts the optional parameters
960
+ # @return [RunObject]
961
+ def get_run(thread_id, run_id, opts = {})
962
+ data, _status_code, _headers = get_run_with_http_info(thread_id, run_id, opts)
963
+ data
964
+ end
965
+
966
+ # Retrieves a run.
967
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) that was run.
968
+ # @param run_id [String] The ID of the run to retrieve.
969
+ # @param [Hash] opts the optional parameters
970
+ # @return [Array<(RunObject, Integer, Hash)>] RunObject data, response status code and response headers
971
+ def get_run_with_http_info(thread_id, run_id, opts = {})
972
+ if @api_client.config.debugging
973
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.get_run ...'
974
+ end
975
+ # verify the required parameter 'thread_id' is set
976
+ if @api_client.config.client_side_validation && thread_id.nil?
977
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_run"
978
+ end
979
+ # verify the required parameter 'run_id' is set
980
+ if @api_client.config.client_side_validation && run_id.nil?
981
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling AssistantsApi.get_run"
982
+ end
983
+ # resource path
984
+ local_var_path = '/threads/{thread_id}/runs/{run_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s))
985
+
986
+ # query parameters
987
+ query_params = opts[:query_params] || {}
988
+
989
+ # header parameters
990
+ header_params = opts[:header_params] || {}
991
+ # HTTP header 'Accept' (if needed)
992
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
993
+
994
+ # form parameters
995
+ form_params = opts[:form_params] || {}
996
+
997
+ # http body (model)
998
+ post_body = opts[:debug_body]
999
+
1000
+ # return_type
1001
+ return_type = opts[:debug_return_type] || 'RunObject'
1002
+
1003
+ # auth_names
1004
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1005
+
1006
+ new_options = opts.merge(
1007
+ :operation => :"AssistantsApi.get_run",
1008
+ :header_params => header_params,
1009
+ :query_params => query_params,
1010
+ :form_params => form_params,
1011
+ :body => post_body,
1012
+ :auth_names => auth_names,
1013
+ :return_type => return_type
1014
+ )
1015
+
1016
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1017
+ if @api_client.config.debugging
1018
+ @api_client.config.logger.debug "API called: AssistantsApi#get_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1019
+ end
1020
+ return data, status_code, headers
1021
+ end
1022
+
1023
+ # Retrieves a run step.
1024
+ # @param thread_id [String] The ID of the thread to which the run and run step belongs.
1025
+ # @param run_id [String] The ID of the run to which the run step belongs.
1026
+ # @param step_id [String] The ID of the run step to retrieve.
1027
+ # @param [Hash] opts the optional parameters
1028
+ # @return [RunStepObject]
1029
+ def get_run_step(thread_id, run_id, step_id, opts = {})
1030
+ data, _status_code, _headers = get_run_step_with_http_info(thread_id, run_id, step_id, opts)
1031
+ data
1032
+ end
1033
+
1034
+ # Retrieves a run step.
1035
+ # @param thread_id [String] The ID of the thread to which the run and run step belongs.
1036
+ # @param run_id [String] The ID of the run to which the run step belongs.
1037
+ # @param step_id [String] The ID of the run step to retrieve.
1038
+ # @param [Hash] opts the optional parameters
1039
+ # @return [Array<(RunStepObject, Integer, Hash)>] RunStepObject data, response status code and response headers
1040
+ def get_run_step_with_http_info(thread_id, run_id, step_id, opts = {})
1041
+ if @api_client.config.debugging
1042
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.get_run_step ...'
1043
+ end
1044
+ # verify the required parameter 'thread_id' is set
1045
+ if @api_client.config.client_side_validation && thread_id.nil?
1046
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_run_step"
1047
+ end
1048
+ # verify the required parameter 'run_id' is set
1049
+ if @api_client.config.client_side_validation && run_id.nil?
1050
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling AssistantsApi.get_run_step"
1051
+ end
1052
+ # verify the required parameter 'step_id' is set
1053
+ if @api_client.config.client_side_validation && step_id.nil?
1054
+ fail ArgumentError, "Missing the required parameter 'step_id' when calling AssistantsApi.get_run_step"
1055
+ end
1056
+ # resource path
1057
+ local_var_path = '/threads/{thread_id}/runs/{run_id}/steps/{step_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s)).sub('{' + 'step_id' + '}', CGI.escape(step_id.to_s))
1058
+
1059
+ # query parameters
1060
+ query_params = opts[:query_params] || {}
1061
+
1062
+ # header parameters
1063
+ header_params = opts[:header_params] || {}
1064
+ # HTTP header 'Accept' (if needed)
1065
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1066
+
1067
+ # form parameters
1068
+ form_params = opts[:form_params] || {}
1069
+
1070
+ # http body (model)
1071
+ post_body = opts[:debug_body]
1072
+
1073
+ # return_type
1074
+ return_type = opts[:debug_return_type] || 'RunStepObject'
1075
+
1076
+ # auth_names
1077
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1078
+
1079
+ new_options = opts.merge(
1080
+ :operation => :"AssistantsApi.get_run_step",
1081
+ :header_params => header_params,
1082
+ :query_params => query_params,
1083
+ :form_params => form_params,
1084
+ :body => post_body,
1085
+ :auth_names => auth_names,
1086
+ :return_type => return_type
1087
+ )
1088
+
1089
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1090
+ if @api_client.config.debugging
1091
+ @api_client.config.logger.debug "API called: AssistantsApi#get_run_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1092
+ end
1093
+ return data, status_code, headers
1094
+ end
1095
+
1096
+ # Retrieves a thread.
1097
+ # @param thread_id [String] The ID of the thread to retrieve.
1098
+ # @param [Hash] opts the optional parameters
1099
+ # @return [ThreadObject]
1100
+ def get_thread(thread_id, opts = {})
1101
+ data, _status_code, _headers = get_thread_with_http_info(thread_id, opts)
1102
+ data
1103
+ end
1104
+
1105
+ # Retrieves a thread.
1106
+ # @param thread_id [String] The ID of the thread to retrieve.
1107
+ # @param [Hash] opts the optional parameters
1108
+ # @return [Array<(ThreadObject, Integer, Hash)>] ThreadObject data, response status code and response headers
1109
+ def get_thread_with_http_info(thread_id, opts = {})
1110
+ if @api_client.config.debugging
1111
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.get_thread ...'
1112
+ end
1113
+ # verify the required parameter 'thread_id' is set
1114
+ if @api_client.config.client_side_validation && thread_id.nil?
1115
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_thread"
1116
+ end
1117
+ # resource path
1118
+ local_var_path = '/threads/{thread_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))
1119
+
1120
+ # query parameters
1121
+ query_params = opts[:query_params] || {}
1122
+
1123
+ # header parameters
1124
+ header_params = opts[:header_params] || {}
1125
+ # HTTP header 'Accept' (if needed)
1126
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1127
+
1128
+ # form parameters
1129
+ form_params = opts[:form_params] || {}
1130
+
1131
+ # http body (model)
1132
+ post_body = opts[:debug_body]
1133
+
1134
+ # return_type
1135
+ return_type = opts[:debug_return_type] || 'ThreadObject'
1136
+
1137
+ # auth_names
1138
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1139
+
1140
+ new_options = opts.merge(
1141
+ :operation => :"AssistantsApi.get_thread",
1142
+ :header_params => header_params,
1143
+ :query_params => query_params,
1144
+ :form_params => form_params,
1145
+ :body => post_body,
1146
+ :auth_names => auth_names,
1147
+ :return_type => return_type
1148
+ )
1149
+
1150
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1151
+ if @api_client.config.debugging
1152
+ @api_client.config.logger.debug "API called: AssistantsApi#get_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1153
+ end
1154
+ return data, status_code, headers
1155
+ end
1156
+
1157
+ # Returns a list of assistant files.
1158
+ # @param assistant_id [String] The ID of the assistant the file belongs to.
1159
+ # @param [Hash] opts the optional parameters
1160
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1161
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1162
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1163
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1164
+ # @return [ListAssistantFilesResponse]
1165
+ def list_assistant_files(assistant_id, opts = {})
1166
+ data, _status_code, _headers = list_assistant_files_with_http_info(assistant_id, opts)
1167
+ data
1168
+ end
1169
+
1170
+ # Returns a list of assistant files.
1171
+ # @param assistant_id [String] The ID of the assistant the file belongs to.
1172
+ # @param [Hash] opts the optional parameters
1173
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1174
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1175
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1176
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1177
+ # @return [Array<(ListAssistantFilesResponse, Integer, Hash)>] ListAssistantFilesResponse data, response status code and response headers
1178
+ def list_assistant_files_with_http_info(assistant_id, opts = {})
1179
+ if @api_client.config.debugging
1180
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.list_assistant_files ...'
1181
+ end
1182
+ # verify the required parameter 'assistant_id' is set
1183
+ if @api_client.config.client_side_validation && assistant_id.nil?
1184
+ fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.list_assistant_files"
1185
+ end
1186
+ allowable_values = ["asc", "desc"]
1187
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
1188
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
1189
+ end
1190
+ # resource path
1191
+ local_var_path = '/assistants/{assistant_id}/files'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s))
1192
+
1193
+ # query parameters
1194
+ query_params = opts[:query_params] || {}
1195
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1196
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1197
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
1198
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1199
+
1200
+ # header parameters
1201
+ header_params = opts[:header_params] || {}
1202
+ # HTTP header 'Accept' (if needed)
1203
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1204
+
1205
+ # form parameters
1206
+ form_params = opts[:form_params] || {}
1207
+
1208
+ # http body (model)
1209
+ post_body = opts[:debug_body]
1210
+
1211
+ # return_type
1212
+ return_type = opts[:debug_return_type] || 'ListAssistantFilesResponse'
1213
+
1214
+ # auth_names
1215
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1216
+
1217
+ new_options = opts.merge(
1218
+ :operation => :"AssistantsApi.list_assistant_files",
1219
+ :header_params => header_params,
1220
+ :query_params => query_params,
1221
+ :form_params => form_params,
1222
+ :body => post_body,
1223
+ :auth_names => auth_names,
1224
+ :return_type => return_type
1225
+ )
1226
+
1227
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1228
+ if @api_client.config.debugging
1229
+ @api_client.config.logger.debug "API called: AssistantsApi#list_assistant_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1230
+ end
1231
+ return data, status_code, headers
1232
+ end
1233
+
1234
+ # Returns a list of assistants.
1235
+ # @param [Hash] opts the optional parameters
1236
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1237
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1238
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1239
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1240
+ # @return [ListAssistantsResponse]
1241
+ def list_assistants(opts = {})
1242
+ data, _status_code, _headers = list_assistants_with_http_info(opts)
1243
+ data
1244
+ end
1245
+
1246
+ # Returns a list of assistants.
1247
+ # @param [Hash] opts the optional parameters
1248
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1249
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1250
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1251
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1252
+ # @return [Array<(ListAssistantsResponse, Integer, Hash)>] ListAssistantsResponse data, response status code and response headers
1253
+ def list_assistants_with_http_info(opts = {})
1254
+ if @api_client.config.debugging
1255
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.list_assistants ...'
1256
+ end
1257
+ allowable_values = ["asc", "desc"]
1258
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
1259
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
1260
+ end
1261
+ # resource path
1262
+ local_var_path = '/assistants'
1263
+
1264
+ # query parameters
1265
+ query_params = opts[:query_params] || {}
1266
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1267
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1268
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
1269
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1270
+
1271
+ # header parameters
1272
+ header_params = opts[:header_params] || {}
1273
+ # HTTP header 'Accept' (if needed)
1274
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1275
+
1276
+ # form parameters
1277
+ form_params = opts[:form_params] || {}
1278
+
1279
+ # http body (model)
1280
+ post_body = opts[:debug_body]
1281
+
1282
+ # return_type
1283
+ return_type = opts[:debug_return_type] || 'ListAssistantsResponse'
1284
+
1285
+ # auth_names
1286
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1287
+
1288
+ new_options = opts.merge(
1289
+ :operation => :"AssistantsApi.list_assistants",
1290
+ :header_params => header_params,
1291
+ :query_params => query_params,
1292
+ :form_params => form_params,
1293
+ :body => post_body,
1294
+ :auth_names => auth_names,
1295
+ :return_type => return_type
1296
+ )
1297
+
1298
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1299
+ if @api_client.config.debugging
1300
+ @api_client.config.logger.debug "API called: AssistantsApi#list_assistants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1301
+ end
1302
+ return data, status_code, headers
1303
+ end
1304
+
1305
+ # Returns a list of message files.
1306
+ # @param thread_id [String] The ID of the thread that the message and files belong to.
1307
+ # @param message_id [String] The ID of the message that the files belongs to.
1308
+ # @param [Hash] opts the optional parameters
1309
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1310
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1311
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1312
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1313
+ # @return [ListMessageFilesResponse]
1314
+ def list_message_files(thread_id, message_id, opts = {})
1315
+ data, _status_code, _headers = list_message_files_with_http_info(thread_id, message_id, opts)
1316
+ data
1317
+ end
1318
+
1319
+ # Returns a list of message files.
1320
+ # @param thread_id [String] The ID of the thread that the message and files belong to.
1321
+ # @param message_id [String] The ID of the message that the files belongs to.
1322
+ # @param [Hash] opts the optional parameters
1323
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1324
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1325
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1326
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1327
+ # @return [Array<(ListMessageFilesResponse, Integer, Hash)>] ListMessageFilesResponse data, response status code and response headers
1328
+ def list_message_files_with_http_info(thread_id, message_id, opts = {})
1329
+ if @api_client.config.debugging
1330
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.list_message_files ...'
1331
+ end
1332
+ # verify the required parameter 'thread_id' is set
1333
+ if @api_client.config.client_side_validation && thread_id.nil?
1334
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_message_files"
1335
+ end
1336
+ # verify the required parameter 'message_id' is set
1337
+ if @api_client.config.client_side_validation && message_id.nil?
1338
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.list_message_files"
1339
+ end
1340
+ allowable_values = ["asc", "desc"]
1341
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
1342
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
1343
+ end
1344
+ # resource path
1345
+ local_var_path = '/threads/{thread_id}/messages/{message_id}/files'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_id.to_s))
1346
+
1347
+ # query parameters
1348
+ query_params = opts[:query_params] || {}
1349
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1350
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1351
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
1352
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1353
+
1354
+ # header parameters
1355
+ header_params = opts[:header_params] || {}
1356
+ # HTTP header 'Accept' (if needed)
1357
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1358
+
1359
+ # form parameters
1360
+ form_params = opts[:form_params] || {}
1361
+
1362
+ # http body (model)
1363
+ post_body = opts[:debug_body]
1364
+
1365
+ # return_type
1366
+ return_type = opts[:debug_return_type] || 'ListMessageFilesResponse'
1367
+
1368
+ # auth_names
1369
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1370
+
1371
+ new_options = opts.merge(
1372
+ :operation => :"AssistantsApi.list_message_files",
1373
+ :header_params => header_params,
1374
+ :query_params => query_params,
1375
+ :form_params => form_params,
1376
+ :body => post_body,
1377
+ :auth_names => auth_names,
1378
+ :return_type => return_type
1379
+ )
1380
+
1381
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1382
+ if @api_client.config.debugging
1383
+ @api_client.config.logger.debug "API called: AssistantsApi#list_message_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1384
+ end
1385
+ return data, status_code, headers
1386
+ end
1387
+
1388
+ # Returns a list of messages for a given thread.
1389
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) the messages belong to.
1390
+ # @param [Hash] opts the optional parameters
1391
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1392
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1393
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1394
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1395
+ # @option opts [String] :run_id Filter messages by the run ID that generated them.
1396
+ # @return [ListMessagesResponse]
1397
+ def list_messages(thread_id, opts = {})
1398
+ data, _status_code, _headers = list_messages_with_http_info(thread_id, opts)
1399
+ data
1400
+ end
1401
+
1402
+ # Returns a list of messages for a given thread.
1403
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) the messages belong to.
1404
+ # @param [Hash] opts the optional parameters
1405
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1406
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1407
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1408
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1409
+ # @option opts [String] :run_id Filter messages by the run ID that generated them.
1410
+ # @return [Array<(ListMessagesResponse, Integer, Hash)>] ListMessagesResponse data, response status code and response headers
1411
+ def list_messages_with_http_info(thread_id, opts = {})
1412
+ if @api_client.config.debugging
1413
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.list_messages ...'
1414
+ end
1415
+ # verify the required parameter 'thread_id' is set
1416
+ if @api_client.config.client_side_validation && thread_id.nil?
1417
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_messages"
1418
+ end
1419
+ allowable_values = ["asc", "desc"]
1420
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
1421
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
1422
+ end
1423
+ # resource path
1424
+ local_var_path = '/threads/{thread_id}/messages'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))
1425
+
1426
+ # query parameters
1427
+ query_params = opts[:query_params] || {}
1428
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1429
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1430
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
1431
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1432
+ query_params[:'run_id'] = opts[:'run_id'] if !opts[:'run_id'].nil?
1433
+
1434
+ # header parameters
1435
+ header_params = opts[:header_params] || {}
1436
+ # HTTP header 'Accept' (if needed)
1437
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1438
+
1439
+ # form parameters
1440
+ form_params = opts[:form_params] || {}
1441
+
1442
+ # http body (model)
1443
+ post_body = opts[:debug_body]
1444
+
1445
+ # return_type
1446
+ return_type = opts[:debug_return_type] || 'ListMessagesResponse'
1447
+
1448
+ # auth_names
1449
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1450
+
1451
+ new_options = opts.merge(
1452
+ :operation => :"AssistantsApi.list_messages",
1453
+ :header_params => header_params,
1454
+ :query_params => query_params,
1455
+ :form_params => form_params,
1456
+ :body => post_body,
1457
+ :auth_names => auth_names,
1458
+ :return_type => return_type
1459
+ )
1460
+
1461
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1462
+ if @api_client.config.debugging
1463
+ @api_client.config.logger.debug "API called: AssistantsApi#list_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1464
+ end
1465
+ return data, status_code, headers
1466
+ end
1467
+
1468
+ # Returns a list of run steps belonging to a run.
1469
+ # @param thread_id [String] The ID of the thread the run and run steps belong to.
1470
+ # @param run_id [String] The ID of the run the run steps belong to.
1471
+ # @param [Hash] opts the optional parameters
1472
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1473
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1474
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1475
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1476
+ # @return [ListRunStepsResponse]
1477
+ def list_run_steps(thread_id, run_id, opts = {})
1478
+ data, _status_code, _headers = list_run_steps_with_http_info(thread_id, run_id, opts)
1479
+ data
1480
+ end
1481
+
1482
+ # Returns a list of run steps belonging to a run.
1483
+ # @param thread_id [String] The ID of the thread the run and run steps belong to.
1484
+ # @param run_id [String] The ID of the run the run steps belong to.
1485
+ # @param [Hash] opts the optional parameters
1486
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1487
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1488
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1489
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1490
+ # @return [Array<(ListRunStepsResponse, Integer, Hash)>] ListRunStepsResponse data, response status code and response headers
1491
+ def list_run_steps_with_http_info(thread_id, run_id, opts = {})
1492
+ if @api_client.config.debugging
1493
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.list_run_steps ...'
1494
+ end
1495
+ # verify the required parameter 'thread_id' is set
1496
+ if @api_client.config.client_side_validation && thread_id.nil?
1497
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_run_steps"
1498
+ end
1499
+ # verify the required parameter 'run_id' is set
1500
+ if @api_client.config.client_side_validation && run_id.nil?
1501
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling AssistantsApi.list_run_steps"
1502
+ end
1503
+ allowable_values = ["asc", "desc"]
1504
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
1505
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
1506
+ end
1507
+ # resource path
1508
+ local_var_path = '/threads/{thread_id}/runs/{run_id}/steps'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s))
1509
+
1510
+ # query parameters
1511
+ query_params = opts[:query_params] || {}
1512
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1513
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1514
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
1515
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1516
+
1517
+ # header parameters
1518
+ header_params = opts[:header_params] || {}
1519
+ # HTTP header 'Accept' (if needed)
1520
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1521
+
1522
+ # form parameters
1523
+ form_params = opts[:form_params] || {}
1524
+
1525
+ # http body (model)
1526
+ post_body = opts[:debug_body]
1527
+
1528
+ # return_type
1529
+ return_type = opts[:debug_return_type] || 'ListRunStepsResponse'
1530
+
1531
+ # auth_names
1532
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1533
+
1534
+ new_options = opts.merge(
1535
+ :operation => :"AssistantsApi.list_run_steps",
1536
+ :header_params => header_params,
1537
+ :query_params => query_params,
1538
+ :form_params => form_params,
1539
+ :body => post_body,
1540
+ :auth_names => auth_names,
1541
+ :return_type => return_type
1542
+ )
1543
+
1544
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1545
+ if @api_client.config.debugging
1546
+ @api_client.config.logger.debug "API called: AssistantsApi#list_run_steps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1547
+ end
1548
+ return data, status_code, headers
1549
+ end
1550
+
1551
+ # Returns a list of runs belonging to a thread.
1552
+ # @param thread_id [String] The ID of the thread the run belongs to.
1553
+ # @param [Hash] opts the optional parameters
1554
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1555
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1556
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1557
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1558
+ # @return [ListRunsResponse]
1559
+ def list_runs(thread_id, opts = {})
1560
+ data, _status_code, _headers = list_runs_with_http_info(thread_id, opts)
1561
+ data
1562
+ end
1563
+
1564
+ # Returns a list of runs belonging to a thread.
1565
+ # @param thread_id [String] The ID of the thread the run belongs to.
1566
+ # @param [Hash] opts the optional parameters
1567
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)
1568
+ # @option opts [String] :order Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to 'desc')
1569
+ # @option opts [String] :after A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.
1570
+ # @option opts [String] :before A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.
1571
+ # @return [Array<(ListRunsResponse, Integer, Hash)>] ListRunsResponse data, response status code and response headers
1572
+ def list_runs_with_http_info(thread_id, opts = {})
1573
+ if @api_client.config.debugging
1574
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.list_runs ...'
1575
+ end
1576
+ # verify the required parameter 'thread_id' is set
1577
+ if @api_client.config.client_side_validation && thread_id.nil?
1578
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_runs"
1579
+ end
1580
+ allowable_values = ["asc", "desc"]
1581
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
1582
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
1583
+ end
1584
+ # resource path
1585
+ local_var_path = '/threads/{thread_id}/runs'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))
1586
+
1587
+ # query parameters
1588
+ query_params = opts[:query_params] || {}
1589
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1590
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1591
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
1592
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1593
+
1594
+ # header parameters
1595
+ header_params = opts[:header_params] || {}
1596
+ # HTTP header 'Accept' (if needed)
1597
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1598
+
1599
+ # form parameters
1600
+ form_params = opts[:form_params] || {}
1601
+
1602
+ # http body (model)
1603
+ post_body = opts[:debug_body]
1604
+
1605
+ # return_type
1606
+ return_type = opts[:debug_return_type] || 'ListRunsResponse'
1607
+
1608
+ # auth_names
1609
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1610
+
1611
+ new_options = opts.merge(
1612
+ :operation => :"AssistantsApi.list_runs",
1613
+ :header_params => header_params,
1614
+ :query_params => query_params,
1615
+ :form_params => form_params,
1616
+ :body => post_body,
1617
+ :auth_names => auth_names,
1618
+ :return_type => return_type
1619
+ )
1620
+
1621
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1622
+ if @api_client.config.debugging
1623
+ @api_client.config.logger.debug "API called: AssistantsApi#list_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1624
+ end
1625
+ return data, status_code, headers
1626
+ end
1627
+
1628
+ # Modifies an assistant.
1629
+ # @param assistant_id [String] The ID of the assistant to modify.
1630
+ # @param modify_assistant_request [ModifyAssistantRequest]
1631
+ # @param [Hash] opts the optional parameters
1632
+ # @return [AssistantObject]
1633
+ def modify_assistant(assistant_id, modify_assistant_request, opts = {})
1634
+ data, _status_code, _headers = modify_assistant_with_http_info(assistant_id, modify_assistant_request, opts)
1635
+ data
1636
+ end
1637
+
1638
+ # Modifies an assistant.
1639
+ # @param assistant_id [String] The ID of the assistant to modify.
1640
+ # @param modify_assistant_request [ModifyAssistantRequest]
1641
+ # @param [Hash] opts the optional parameters
1642
+ # @return [Array<(AssistantObject, Integer, Hash)>] AssistantObject data, response status code and response headers
1643
+ def modify_assistant_with_http_info(assistant_id, modify_assistant_request, opts = {})
1644
+ if @api_client.config.debugging
1645
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_assistant ...'
1646
+ end
1647
+ # verify the required parameter 'assistant_id' is set
1648
+ if @api_client.config.client_side_validation && assistant_id.nil?
1649
+ fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.modify_assistant"
1650
+ end
1651
+ # verify the required parameter 'modify_assistant_request' is set
1652
+ if @api_client.config.client_side_validation && modify_assistant_request.nil?
1653
+ fail ArgumentError, "Missing the required parameter 'modify_assistant_request' when calling AssistantsApi.modify_assistant"
1654
+ end
1655
+ # resource path
1656
+ local_var_path = '/assistants/{assistant_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s))
1657
+
1658
+ # query parameters
1659
+ query_params = opts[:query_params] || {}
1660
+
1661
+ # header parameters
1662
+ header_params = opts[:header_params] || {}
1663
+ # HTTP header 'Accept' (if needed)
1664
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1665
+ # HTTP header 'Content-Type'
1666
+ content_type = @api_client.select_header_content_type(['application/json'])
1667
+ if !content_type.nil?
1668
+ header_params['Content-Type'] = content_type
1669
+ end
1670
+
1671
+ # form parameters
1672
+ form_params = opts[:form_params] || {}
1673
+
1674
+ # http body (model)
1675
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(modify_assistant_request)
1676
+
1677
+ # return_type
1678
+ return_type = opts[:debug_return_type] || 'AssistantObject'
1679
+
1680
+ # auth_names
1681
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1682
+
1683
+ new_options = opts.merge(
1684
+ :operation => :"AssistantsApi.modify_assistant",
1685
+ :header_params => header_params,
1686
+ :query_params => query_params,
1687
+ :form_params => form_params,
1688
+ :body => post_body,
1689
+ :auth_names => auth_names,
1690
+ :return_type => return_type
1691
+ )
1692
+
1693
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1694
+ if @api_client.config.debugging
1695
+ @api_client.config.logger.debug "API called: AssistantsApi#modify_assistant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1696
+ end
1697
+ return data, status_code, headers
1698
+ end
1699
+
1700
+ # Modifies a message.
1701
+ # @param thread_id [String] The ID of the thread to which this message belongs.
1702
+ # @param message_id [String] The ID of the message to modify.
1703
+ # @param modify_message_request [ModifyMessageRequest]
1704
+ # @param [Hash] opts the optional parameters
1705
+ # @return [MessageObject]
1706
+ def modify_message(thread_id, message_id, modify_message_request, opts = {})
1707
+ data, _status_code, _headers = modify_message_with_http_info(thread_id, message_id, modify_message_request, opts)
1708
+ data
1709
+ end
1710
+
1711
+ # Modifies a message.
1712
+ # @param thread_id [String] The ID of the thread to which this message belongs.
1713
+ # @param message_id [String] The ID of the message to modify.
1714
+ # @param modify_message_request [ModifyMessageRequest]
1715
+ # @param [Hash] opts the optional parameters
1716
+ # @return [Array<(MessageObject, Integer, Hash)>] MessageObject data, response status code and response headers
1717
+ def modify_message_with_http_info(thread_id, message_id, modify_message_request, opts = {})
1718
+ if @api_client.config.debugging
1719
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_message ...'
1720
+ end
1721
+ # verify the required parameter 'thread_id' is set
1722
+ if @api_client.config.client_side_validation && thread_id.nil?
1723
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.modify_message"
1724
+ end
1725
+ # verify the required parameter 'message_id' is set
1726
+ if @api_client.config.client_side_validation && message_id.nil?
1727
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.modify_message"
1728
+ end
1729
+ # verify the required parameter 'modify_message_request' is set
1730
+ if @api_client.config.client_side_validation && modify_message_request.nil?
1731
+ fail ArgumentError, "Missing the required parameter 'modify_message_request' when calling AssistantsApi.modify_message"
1732
+ end
1733
+ # resource path
1734
+ local_var_path = '/threads/{thread_id}/messages/{message_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_id.to_s))
1735
+
1736
+ # query parameters
1737
+ query_params = opts[:query_params] || {}
1738
+
1739
+ # header parameters
1740
+ header_params = opts[:header_params] || {}
1741
+ # HTTP header 'Accept' (if needed)
1742
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1743
+ # HTTP header 'Content-Type'
1744
+ content_type = @api_client.select_header_content_type(['application/json'])
1745
+ if !content_type.nil?
1746
+ header_params['Content-Type'] = content_type
1747
+ end
1748
+
1749
+ # form parameters
1750
+ form_params = opts[:form_params] || {}
1751
+
1752
+ # http body (model)
1753
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(modify_message_request)
1754
+
1755
+ # return_type
1756
+ return_type = opts[:debug_return_type] || 'MessageObject'
1757
+
1758
+ # auth_names
1759
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1760
+
1761
+ new_options = opts.merge(
1762
+ :operation => :"AssistantsApi.modify_message",
1763
+ :header_params => header_params,
1764
+ :query_params => query_params,
1765
+ :form_params => form_params,
1766
+ :body => post_body,
1767
+ :auth_names => auth_names,
1768
+ :return_type => return_type
1769
+ )
1770
+
1771
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1772
+ if @api_client.config.debugging
1773
+ @api_client.config.logger.debug "API called: AssistantsApi#modify_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1774
+ end
1775
+ return data, status_code, headers
1776
+ end
1777
+
1778
+ # Modifies a run.
1779
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) that was run.
1780
+ # @param run_id [String] The ID of the run to modify.
1781
+ # @param modify_run_request [ModifyRunRequest]
1782
+ # @param [Hash] opts the optional parameters
1783
+ # @return [RunObject]
1784
+ def modify_run(thread_id, run_id, modify_run_request, opts = {})
1785
+ data, _status_code, _headers = modify_run_with_http_info(thread_id, run_id, modify_run_request, opts)
1786
+ data
1787
+ end
1788
+
1789
+ # Modifies a run.
1790
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) that was run.
1791
+ # @param run_id [String] The ID of the run to modify.
1792
+ # @param modify_run_request [ModifyRunRequest]
1793
+ # @param [Hash] opts the optional parameters
1794
+ # @return [Array<(RunObject, Integer, Hash)>] RunObject data, response status code and response headers
1795
+ def modify_run_with_http_info(thread_id, run_id, modify_run_request, opts = {})
1796
+ if @api_client.config.debugging
1797
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_run ...'
1798
+ end
1799
+ # verify the required parameter 'thread_id' is set
1800
+ if @api_client.config.client_side_validation && thread_id.nil?
1801
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.modify_run"
1802
+ end
1803
+ # verify the required parameter 'run_id' is set
1804
+ if @api_client.config.client_side_validation && run_id.nil?
1805
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling AssistantsApi.modify_run"
1806
+ end
1807
+ # verify the required parameter 'modify_run_request' is set
1808
+ if @api_client.config.client_side_validation && modify_run_request.nil?
1809
+ fail ArgumentError, "Missing the required parameter 'modify_run_request' when calling AssistantsApi.modify_run"
1810
+ end
1811
+ # resource path
1812
+ local_var_path = '/threads/{thread_id}/runs/{run_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s))
1813
+
1814
+ # query parameters
1815
+ query_params = opts[:query_params] || {}
1816
+
1817
+ # header parameters
1818
+ header_params = opts[:header_params] || {}
1819
+ # HTTP header 'Accept' (if needed)
1820
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1821
+ # HTTP header 'Content-Type'
1822
+ content_type = @api_client.select_header_content_type(['application/json'])
1823
+ if !content_type.nil?
1824
+ header_params['Content-Type'] = content_type
1825
+ end
1826
+
1827
+ # form parameters
1828
+ form_params = opts[:form_params] || {}
1829
+
1830
+ # http body (model)
1831
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(modify_run_request)
1832
+
1833
+ # return_type
1834
+ return_type = opts[:debug_return_type] || 'RunObject'
1835
+
1836
+ # auth_names
1837
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1838
+
1839
+ new_options = opts.merge(
1840
+ :operation => :"AssistantsApi.modify_run",
1841
+ :header_params => header_params,
1842
+ :query_params => query_params,
1843
+ :form_params => form_params,
1844
+ :body => post_body,
1845
+ :auth_names => auth_names,
1846
+ :return_type => return_type
1847
+ )
1848
+
1849
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1850
+ if @api_client.config.debugging
1851
+ @api_client.config.logger.debug "API called: AssistantsApi#modify_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1852
+ end
1853
+ return data, status_code, headers
1854
+ end
1855
+
1856
+ # Modifies a thread.
1857
+ # @param thread_id [String] The ID of the thread to modify. Only the &#x60;metadata&#x60; can be modified.
1858
+ # @param modify_thread_request [ModifyThreadRequest]
1859
+ # @param [Hash] opts the optional parameters
1860
+ # @return [ThreadObject]
1861
+ def modify_thread(thread_id, modify_thread_request, opts = {})
1862
+ data, _status_code, _headers = modify_thread_with_http_info(thread_id, modify_thread_request, opts)
1863
+ data
1864
+ end
1865
+
1866
+ # Modifies a thread.
1867
+ # @param thread_id [String] The ID of the thread to modify. Only the &#x60;metadata&#x60; can be modified.
1868
+ # @param modify_thread_request [ModifyThreadRequest]
1869
+ # @param [Hash] opts the optional parameters
1870
+ # @return [Array<(ThreadObject, Integer, Hash)>] ThreadObject data, response status code and response headers
1871
+ def modify_thread_with_http_info(thread_id, modify_thread_request, opts = {})
1872
+ if @api_client.config.debugging
1873
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_thread ...'
1874
+ end
1875
+ # verify the required parameter 'thread_id' is set
1876
+ if @api_client.config.client_side_validation && thread_id.nil?
1877
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.modify_thread"
1878
+ end
1879
+ # verify the required parameter 'modify_thread_request' is set
1880
+ if @api_client.config.client_side_validation && modify_thread_request.nil?
1881
+ fail ArgumentError, "Missing the required parameter 'modify_thread_request' when calling AssistantsApi.modify_thread"
1882
+ end
1883
+ # resource path
1884
+ local_var_path = '/threads/{thread_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))
1885
+
1886
+ # query parameters
1887
+ query_params = opts[:query_params] || {}
1888
+
1889
+ # header parameters
1890
+ header_params = opts[:header_params] || {}
1891
+ # HTTP header 'Accept' (if needed)
1892
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1893
+ # HTTP header 'Content-Type'
1894
+ content_type = @api_client.select_header_content_type(['application/json'])
1895
+ if !content_type.nil?
1896
+ header_params['Content-Type'] = content_type
1897
+ end
1898
+
1899
+ # form parameters
1900
+ form_params = opts[:form_params] || {}
1901
+
1902
+ # http body (model)
1903
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(modify_thread_request)
1904
+
1905
+ # return_type
1906
+ return_type = opts[:debug_return_type] || 'ThreadObject'
1907
+
1908
+ # auth_names
1909
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1910
+
1911
+ new_options = opts.merge(
1912
+ :operation => :"AssistantsApi.modify_thread",
1913
+ :header_params => header_params,
1914
+ :query_params => query_params,
1915
+ :form_params => form_params,
1916
+ :body => post_body,
1917
+ :auth_names => auth_names,
1918
+ :return_type => return_type
1919
+ )
1920
+
1921
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1922
+ if @api_client.config.debugging
1923
+ @api_client.config.logger.debug "API called: AssistantsApi#modify_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1924
+ end
1925
+ return data, status_code, headers
1926
+ end
1927
+
1928
+ # When a run has the `status: \"requires_action\"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.
1929
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) to which this run belongs.
1930
+ # @param run_id [String] The ID of the run that requires the tool output submission.
1931
+ # @param submit_tool_outputs_run_request [SubmitToolOutputsRunRequest]
1932
+ # @param [Hash] opts the optional parameters
1933
+ # @return [RunObject]
1934
+ def submit_tool_ouputs_to_run(thread_id, run_id, submit_tool_outputs_run_request, opts = {})
1935
+ data, _status_code, _headers = submit_tool_ouputs_to_run_with_http_info(thread_id, run_id, submit_tool_outputs_run_request, opts)
1936
+ data
1937
+ end
1938
+
1939
+ # When a run has the &#x60;status: \&quot;requires_action\&quot;&#x60; and &#x60;required_action.type&#x60; is &#x60;submit_tool_outputs&#x60;, this endpoint can be used to submit the outputs from the tool calls once they&#39;re all completed. All outputs must be submitted in a single request.
1940
+ # @param thread_id [String] The ID of the [thread](/docs/api-reference/threads) to which this run belongs.
1941
+ # @param run_id [String] The ID of the run that requires the tool output submission.
1942
+ # @param submit_tool_outputs_run_request [SubmitToolOutputsRunRequest]
1943
+ # @param [Hash] opts the optional parameters
1944
+ # @return [Array<(RunObject, Integer, Hash)>] RunObject data, response status code and response headers
1945
+ def submit_tool_ouputs_to_run_with_http_info(thread_id, run_id, submit_tool_outputs_run_request, opts = {})
1946
+ if @api_client.config.debugging
1947
+ @api_client.config.logger.debug 'Calling API: AssistantsApi.submit_tool_ouputs_to_run ...'
1948
+ end
1949
+ # verify the required parameter 'thread_id' is set
1950
+ if @api_client.config.client_side_validation && thread_id.nil?
1951
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.submit_tool_ouputs_to_run"
1952
+ end
1953
+ # verify the required parameter 'run_id' is set
1954
+ if @api_client.config.client_side_validation && run_id.nil?
1955
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling AssistantsApi.submit_tool_ouputs_to_run"
1956
+ end
1957
+ # verify the required parameter 'submit_tool_outputs_run_request' is set
1958
+ if @api_client.config.client_side_validation && submit_tool_outputs_run_request.nil?
1959
+ fail ArgumentError, "Missing the required parameter 'submit_tool_outputs_run_request' when calling AssistantsApi.submit_tool_ouputs_to_run"
1960
+ end
1961
+ # resource path
1962
+ local_var_path = '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s))
1963
+
1964
+ # query parameters
1965
+ query_params = opts[:query_params] || {}
1966
+
1967
+ # header parameters
1968
+ header_params = opts[:header_params] || {}
1969
+ # HTTP header 'Accept' (if needed)
1970
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1971
+ # HTTP header 'Content-Type'
1972
+ content_type = @api_client.select_header_content_type(['application/json'])
1973
+ if !content_type.nil?
1974
+ header_params['Content-Type'] = content_type
1975
+ end
1976
+
1977
+ # form parameters
1978
+ form_params = opts[:form_params] || {}
1979
+
1980
+ # http body (model)
1981
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(submit_tool_outputs_run_request)
1982
+
1983
+ # return_type
1984
+ return_type = opts[:debug_return_type] || 'RunObject'
1985
+
1986
+ # auth_names
1987
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1988
+
1989
+ new_options = opts.merge(
1990
+ :operation => :"AssistantsApi.submit_tool_ouputs_to_run",
1991
+ :header_params => header_params,
1992
+ :query_params => query_params,
1993
+ :form_params => form_params,
1994
+ :body => post_body,
1995
+ :auth_names => auth_names,
1996
+ :return_type => return_type
1997
+ )
1998
+
1999
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2000
+ if @api_client.config.debugging
2001
+ @api_client.config.logger.debug "API called: AssistantsApi#submit_tool_ouputs_to_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2002
+ end
2003
+ return data, status_code, headers
2004
+ end
2005
+ end
2006
+ end