openapi_openai 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,221 @@
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 'date'
14
+ require 'time'
15
+
16
+ module OpenApiOpenAIClient
17
+ # Log probability information for the choice.
18
+ class CreateChatCompletionResponseChoicesInnerLogprobs
19
+ # A list of message content tokens with log probability information.
20
+ attr_accessor :content
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'content' => :'content'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'content' => :'Array<ChatCompletionTokenLogprob>'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ :'content'
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenApiOpenAIClient::CreateChatCompletionResponseChoicesInnerLogprobs` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenApiOpenAIClient::CreateChatCompletionResponseChoicesInnerLogprobs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'content')
64
+ if (value = attributes[:'content']).is_a?(Array)
65
+ self.content = value
66
+ end
67
+ else
68
+ self.content = nil
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ content == o.content
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [content].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def self._deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = OpenApiOpenAIClient.const_get(type)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #OpenAI API
3
3
 
4
- #APIs for sampling from and fine-tuning language models
4
+ #The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
5
5
 
6
6
  The version of the OpenAPI document: 2.0.0
7
7
  Contact: blah+oapicf@cliffano.com
@@ -14,25 +14,57 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenApiOpenAIClient
17
+ # Represents a streamed chunk of a chat completion response returned by model, based on the provided input.
17
18
  class CreateChatCompletionStreamResponse
19
+ # A unique identifier for the chat completion. Each chunk has the same ID.
18
20
  attr_accessor :id
19
21
 
20
- attr_accessor :object
22
+ # A list of chat completion choices. Can be more than one if `n` is greater than 1.
23
+ attr_accessor :choices
21
24
 
25
+ # The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
22
26
  attr_accessor :created
23
27
 
28
+ # The model to generate the completion.
24
29
  attr_accessor :model
25
30
 
26
- attr_accessor :choices
31
+ # This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
32
+ attr_accessor :system_fingerprint
33
+
34
+ # The object type, which is always `chat.completion.chunk`.
35
+ attr_accessor :object
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
27
58
 
28
59
  # Attribute mapping from ruby-style variable name to JSON key.
29
60
  def self.attribute_map
30
61
  {
31
62
  :'id' => :'id',
32
- :'object' => :'object',
63
+ :'choices' => :'choices',
33
64
  :'created' => :'created',
34
65
  :'model' => :'model',
35
- :'choices' => :'choices'
66
+ :'system_fingerprint' => :'system_fingerprint',
67
+ :'object' => :'object'
36
68
  }
37
69
  end
38
70
 
@@ -45,10 +77,11 @@ module OpenApiOpenAIClient
45
77
  def self.openapi_types
46
78
  {
47
79
  :'id' => :'String',
48
- :'object' => :'String',
80
+ :'choices' => :'Array<CreateChatCompletionStreamResponseChoicesInner>',
49
81
  :'created' => :'Integer',
50
82
  :'model' => :'String',
51
- :'choices' => :'Array<CreateChatCompletionStreamResponseChoicesInner>'
83
+ :'system_fingerprint' => :'String',
84
+ :'object' => :'String'
52
85
  }
53
86
  end
54
87
 
@@ -79,10 +112,12 @@ module OpenApiOpenAIClient
79
112
  self.id = nil
80
113
  end
81
114
 
82
- if attributes.key?(:'object')
83
- self.object = attributes[:'object']
115
+ if attributes.key?(:'choices')
116
+ if (value = attributes[:'choices']).is_a?(Array)
117
+ self.choices = value
118
+ end
84
119
  else
85
- self.object = nil
120
+ self.choices = nil
86
121
  end
87
122
 
88
123
  if attributes.key?(:'created')
@@ -97,12 +132,14 @@ module OpenApiOpenAIClient
97
132
  self.model = nil
98
133
  end
99
134
 
100
- if attributes.key?(:'choices')
101
- if (value = attributes[:'choices']).is_a?(Array)
102
- self.choices = value
103
- end
135
+ if attributes.key?(:'system_fingerprint')
136
+ self.system_fingerprint = attributes[:'system_fingerprint']
137
+ end
138
+
139
+ if attributes.key?(:'object')
140
+ self.object = attributes[:'object']
104
141
  else
105
- self.choices = nil
142
+ self.object = nil
106
143
  end
107
144
  end
108
145
 
@@ -115,8 +152,8 @@ module OpenApiOpenAIClient
115
152
  invalid_properties.push('invalid value for "id", id cannot be nil.')
116
153
  end
117
154
 
118
- if @object.nil?
119
- invalid_properties.push('invalid value for "object", object cannot be nil.')
155
+ if @choices.nil?
156
+ invalid_properties.push('invalid value for "choices", choices cannot be nil.')
120
157
  end
121
158
 
122
159
  if @created.nil?
@@ -127,8 +164,8 @@ module OpenApiOpenAIClient
127
164
  invalid_properties.push('invalid value for "model", model cannot be nil.')
128
165
  end
129
166
 
130
- if @choices.nil?
131
- invalid_properties.push('invalid value for "choices", choices cannot be nil.')
167
+ if @object.nil?
168
+ invalid_properties.push('invalid value for "object", object cannot be nil.')
132
169
  end
133
170
 
134
171
  invalid_properties
@@ -139,23 +176,36 @@ module OpenApiOpenAIClient
139
176
  def valid?
140
177
  warn '[DEPRECATED] the `valid?` method is obsolete'
141
178
  return false if @id.nil?
142
- return false if @object.nil?
179
+ return false if @choices.nil?
143
180
  return false if @created.nil?
144
181
  return false if @model.nil?
145
- return false if @choices.nil?
182
+ return false if @object.nil?
183
+ object_validator = EnumAttributeValidator.new('String', ["chat.completion.chunk"])
184
+ return false unless object_validator.valid?(@object)
146
185
  true
147
186
  end
148
187
 
188
+ # Custom attribute writer method checking allowed values (enum).
189
+ # @param [Object] object Object to be assigned
190
+ def object=(object)
191
+ validator = EnumAttributeValidator.new('String', ["chat.completion.chunk"])
192
+ unless validator.valid?(object)
193
+ fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}."
194
+ end
195
+ @object = object
196
+ end
197
+
149
198
  # Checks equality by comparing each attribute.
150
199
  # @param [Object] Object to be compared
151
200
  def ==(o)
152
201
  return true if self.equal?(o)
153
202
  self.class == o.class &&
154
203
  id == o.id &&
155
- object == o.object &&
204
+ choices == o.choices &&
156
205
  created == o.created &&
157
206
  model == o.model &&
158
- choices == o.choices
207
+ system_fingerprint == o.system_fingerprint &&
208
+ object == o.object
159
209
  end
160
210
 
161
211
  # @see the `==` method
@@ -167,7 +217,7 @@ module OpenApiOpenAIClient
167
217
  # Calculates hash code according to all attributes.
168
218
  # @return [Integer] Hash code
169
219
  def hash
170
- [id, object, created, model, choices].hash
220
+ [id, choices, created, model, system_fingerprint, object].hash
171
221
  end
172
222
 
173
223
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #OpenAI API
3
3
 
4
- #APIs for sampling from and fine-tuning language models
4
+ #The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
5
5
 
6
6
  The version of the OpenAPI document: 2.0.0
7
7
  Contact: blah+oapicf@cliffano.com
@@ -15,12 +15,16 @@ require 'time'
15
15
 
16
16
  module OpenApiOpenAIClient
17
17
  class CreateChatCompletionStreamResponseChoicesInner
18
- attr_accessor :index
19
-
20
18
  attr_accessor :delta
21
19
 
20
+ attr_accessor :logprobs
21
+
22
+ # The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
22
23
  attr_accessor :finish_reason
23
24
 
25
+ # The index of the choice in the list of choices.
26
+ attr_accessor :index
27
+
24
28
  class EnumAttributeValidator
25
29
  attr_reader :datatype
26
30
  attr_reader :allowable_values
@@ -46,9 +50,10 @@ module OpenApiOpenAIClient
46
50
  # Attribute mapping from ruby-style variable name to JSON key.
47
51
  def self.attribute_map
48
52
  {
49
- :'index' => :'index',
50
53
  :'delta' => :'delta',
51
- :'finish_reason' => :'finish_reason'
54
+ :'logprobs' => :'logprobs',
55
+ :'finish_reason' => :'finish_reason',
56
+ :'index' => :'index'
52
57
  }
53
58
  end
54
59
 
@@ -60,15 +65,18 @@ module OpenApiOpenAIClient
60
65
  # Attribute type mapping.
61
66
  def self.openapi_types
62
67
  {
63
- :'index' => :'Integer',
64
68
  :'delta' => :'ChatCompletionStreamResponseDelta',
65
- :'finish_reason' => :'String'
69
+ :'logprobs' => :'CreateChatCompletionResponseChoicesInnerLogprobs',
70
+ :'finish_reason' => :'String',
71
+ :'index' => :'Integer'
66
72
  }
67
73
  end
68
74
 
69
75
  # List of attributes with nullable: true
70
76
  def self.openapi_nullable
71
77
  Set.new([
78
+ :'logprobs',
79
+ :'finish_reason',
72
80
  ])
73
81
  end
74
82
 
@@ -87,16 +95,26 @@ module OpenApiOpenAIClient
87
95
  h[k.to_sym] = v
88
96
  }
89
97
 
90
- if attributes.key?(:'index')
91
- self.index = attributes[:'index']
92
- end
93
-
94
98
  if attributes.key?(:'delta')
95
99
  self.delta = attributes[:'delta']
100
+ else
101
+ self.delta = nil
102
+ end
103
+
104
+ if attributes.key?(:'logprobs')
105
+ self.logprobs = attributes[:'logprobs']
96
106
  end
97
107
 
98
108
  if attributes.key?(:'finish_reason')
99
109
  self.finish_reason = attributes[:'finish_reason']
110
+ else
111
+ self.finish_reason = nil
112
+ end
113
+
114
+ if attributes.key?(:'index')
115
+ self.index = attributes[:'index']
116
+ else
117
+ self.index = nil
100
118
  end
101
119
  end
102
120
 
@@ -105,6 +123,14 @@ module OpenApiOpenAIClient
105
123
  def list_invalid_properties
106
124
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
125
  invalid_properties = Array.new
126
+ if @delta.nil?
127
+ invalid_properties.push('invalid value for "delta", delta cannot be nil.')
128
+ end
129
+
130
+ if @index.nil?
131
+ invalid_properties.push('invalid value for "index", index cannot be nil.')
132
+ end
133
+
108
134
  invalid_properties
109
135
  end
110
136
 
@@ -112,15 +138,17 @@ module OpenApiOpenAIClient
112
138
  # @return true if the model is valid
113
139
  def valid?
114
140
  warn '[DEPRECATED] the `valid?` method is obsolete'
115
- finish_reason_validator = EnumAttributeValidator.new('String', ["stop", "length", "function_call"])
141
+ return false if @delta.nil?
142
+ finish_reason_validator = EnumAttributeValidator.new('String', ["stop", "length", "tool_calls", "content_filter", "function_call"])
116
143
  return false unless finish_reason_validator.valid?(@finish_reason)
144
+ return false if @index.nil?
117
145
  true
118
146
  end
119
147
 
120
148
  # Custom attribute writer method checking allowed values (enum).
121
149
  # @param [Object] finish_reason Object to be assigned
122
150
  def finish_reason=(finish_reason)
123
- validator = EnumAttributeValidator.new('String', ["stop", "length", "function_call"])
151
+ validator = EnumAttributeValidator.new('String', ["stop", "length", "tool_calls", "content_filter", "function_call"])
124
152
  unless validator.valid?(finish_reason)
125
153
  fail ArgumentError, "invalid value for \"finish_reason\", must be one of #{validator.allowable_values}."
126
154
  end
@@ -132,9 +160,10 @@ module OpenApiOpenAIClient
132
160
  def ==(o)
133
161
  return true if self.equal?(o)
134
162
  self.class == o.class &&
135
- index == o.index &&
136
163
  delta == o.delta &&
137
- finish_reason == o.finish_reason
164
+ logprobs == o.logprobs &&
165
+ finish_reason == o.finish_reason &&
166
+ index == o.index
138
167
  end
139
168
 
140
169
  # @see the `==` method
@@ -146,7 +175,7 @@ module OpenApiOpenAIClient
146
175
  # Calculates hash code according to all attributes.
147
176
  # @return [Integer] Hash code
148
177
  def hash
149
- [index, delta, finish_reason].hash
178
+ [delta, logprobs, finish_reason, index].hash
150
179
  end
151
180
 
152
181
  # Builds the object from hash