openapi_openai 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +72 -0
  4. data/README.md +171 -0
  5. data/Rakefile +10 -0
  6. data/bin/bundle +109 -0
  7. data/bin/byebug +27 -0
  8. data/bin/coderay +27 -0
  9. data/bin/htmldiff +27 -0
  10. data/bin/ldiff +27 -0
  11. data/bin/pry +27 -0
  12. data/bin/racc +27 -0
  13. data/bin/rake +27 -0
  14. data/bin/rspec +27 -0
  15. data/bin/rubocop +27 -0
  16. data/bin/ruby-parse +27 -0
  17. data/bin/ruby-rewrite +27 -0
  18. data/docs/ChatCompletionFunctions.md +22 -0
  19. data/docs/ChatCompletionRequestMessage.md +24 -0
  20. data/docs/ChatCompletionRequestMessageFunctionCall.md +20 -0
  21. data/docs/ChatCompletionResponseMessage.md +22 -0
  22. data/docs/ChatCompletionStreamResponseDelta.md +22 -0
  23. data/docs/CreateChatCompletionRequest.md +44 -0
  24. data/docs/CreateChatCompletionRequestFunctionCall.md +49 -0
  25. data/docs/CreateChatCompletionRequestFunctionCallOneOf.md +18 -0
  26. data/docs/CreateChatCompletionRequestModel.md +47 -0
  27. data/docs/CreateChatCompletionRequestStop.md +49 -0
  28. data/docs/CreateChatCompletionResponse.md +28 -0
  29. data/docs/CreateChatCompletionResponseChoicesInner.md +22 -0
  30. data/docs/CreateChatCompletionStreamResponse.md +26 -0
  31. data/docs/CreateChatCompletionStreamResponseChoicesInner.md +22 -0
  32. data/docs/CreateCompletionRequest.md +48 -0
  33. data/docs/CreateCompletionRequestModel.md +47 -0
  34. data/docs/CreateCompletionRequestPrompt.md +53 -0
  35. data/docs/CreateCompletionRequestStop.md +49 -0
  36. data/docs/CreateCompletionResponse.md +28 -0
  37. data/docs/CreateCompletionResponseChoicesInner.md +24 -0
  38. data/docs/CreateCompletionResponseChoicesInnerLogprobs.md +24 -0
  39. data/docs/CreateCompletionResponseUsage.md +22 -0
  40. data/docs/CreateEditRequest.md +28 -0
  41. data/docs/CreateEditRequestModel.md +47 -0
  42. data/docs/CreateEditResponse.md +24 -0
  43. data/docs/CreateEditResponseChoicesInner.md +24 -0
  44. data/docs/CreateEmbeddingRequest.md +22 -0
  45. data/docs/CreateEmbeddingRequestInput.md +53 -0
  46. data/docs/CreateEmbeddingRequestModel.md +47 -0
  47. data/docs/CreateEmbeddingResponse.md +24 -0
  48. data/docs/CreateEmbeddingResponseDataInner.md +22 -0
  49. data/docs/CreateEmbeddingResponseUsage.md +20 -0
  50. data/docs/CreateFineTuneRequest.md +40 -0
  51. data/docs/CreateFineTuneRequestModel.md +47 -0
  52. data/docs/CreateImageRequest.md +26 -0
  53. data/docs/CreateModerationRequest.md +20 -0
  54. data/docs/CreateModerationRequestInput.md +49 -0
  55. data/docs/CreateModerationRequestModel.md +47 -0
  56. data/docs/CreateModerationResponse.md +22 -0
  57. data/docs/CreateModerationResponseResultsInner.md +22 -0
  58. data/docs/CreateModerationResponseResultsInnerCategories.md +30 -0
  59. data/docs/CreateModerationResponseResultsInnerCategoryScores.md +30 -0
  60. data/docs/CreateTranscriptionRequestModel.md +47 -0
  61. data/docs/CreateTranscriptionResponse.md +18 -0
  62. data/docs/CreateTranslationResponse.md +18 -0
  63. data/docs/DeleteFileResponse.md +22 -0
  64. data/docs/DeleteModelResponse.md +22 -0
  65. data/docs/Error.md +24 -0
  66. data/docs/ErrorResponse.md +18 -0
  67. data/docs/FineTune.md +42 -0
  68. data/docs/FineTuneEvent.md +24 -0
  69. data/docs/ImagesResponse.md +20 -0
  70. data/docs/ImagesResponseDataInner.md +20 -0
  71. data/docs/ListFilesResponse.md +20 -0
  72. data/docs/ListFineTuneEventsResponse.md +20 -0
  73. data/docs/ListFineTunesResponse.md +20 -0
  74. data/docs/ListModelsResponse.md +20 -0
  75. data/docs/Model.md +24 -0
  76. data/docs/OpenAIApi.md +1499 -0
  77. data/docs/OpenAIFile.md +32 -0
  78. data/git_push.sh +57 -0
  79. data/lib/openapi_openai/api/open_ai_api.rb +1583 -0
  80. data/lib/openapi_openai/api_client.rb +393 -0
  81. data/lib/openapi_openai/api_error.rb +58 -0
  82. data/lib/openapi_openai/configuration.rb +291 -0
  83. data/lib/openapi_openai/models/chat_completion_functions.rb +244 -0
  84. data/lib/openapi_openai/models/chat_completion_request_message.rb +285 -0
  85. data/lib/openapi_openai/models/chat_completion_request_message_function_call.rb +226 -0
  86. data/lib/openapi_openai/models/chat_completion_response_message.rb +276 -0
  87. data/lib/openapi_openai/models/chat_completion_stream_response_delta.rb +269 -0
  88. data/lib/openapi_openai/models/create_chat_completion_request.rb +537 -0
  89. data/lib/openapi_openai/models/create_chat_completion_request_function_call.rb +106 -0
  90. data/lib/openapi_openai/models/create_chat_completion_request_function_call_one_of.rb +222 -0
  91. data/lib/openapi_openai/models/create_chat_completion_request_model.rb +105 -0
  92. data/lib/openapi_openai/models/create_chat_completion_request_stop.rb +106 -0
  93. data/lib/openapi_openai/models/create_chat_completion_response.rb +296 -0
  94. data/lib/openapi_openai/models/create_chat_completion_response_choices_inner.rb +266 -0
  95. data/lib/openapi_openai/models/create_chat_completion_stream_response.rb +287 -0
  96. data/lib/openapi_openai/models/create_chat_completion_stream_response_choices_inner.rb +266 -0
  97. data/lib/openapi_openai/models/create_completion_request.rb +586 -0
  98. data/lib/openapi_openai/models/create_completion_request_model.rb +105 -0
  99. data/lib/openapi_openai/models/create_completion_request_prompt.rb +108 -0
  100. data/lib/openapi_openai/models/create_completion_request_stop.rb +106 -0
  101. data/lib/openapi_openai/models/create_completion_response.rb +296 -0
  102. data/lib/openapi_openai/models/create_completion_response_choices_inner.rb +299 -0
  103. data/lib/openapi_openai/models/create_completion_response_choices_inner_logprobs.rb +249 -0
  104. data/lib/openapi_openai/models/create_completion_response_usage.rb +253 -0
  105. data/lib/openapi_openai/models/create_edit_request.rb +362 -0
  106. data/lib/openapi_openai/models/create_edit_request_model.rb +105 -0
  107. data/lib/openapi_openai/models/create_edit_response.rb +271 -0
  108. data/lib/openapi_openai/models/create_edit_response_choices_inner.rb +276 -0
  109. data/lib/openapi_openai/models/create_embedding_request.rb +247 -0
  110. data/lib/openapi_openai/models/create_embedding_request_input.rb +108 -0
  111. data/lib/openapi_openai/models/create_embedding_request_model.rb +105 -0
  112. data/lib/openapi_openai/models/create_embedding_response.rb +271 -0
  113. data/lib/openapi_openai/models/create_embedding_response_data_inner.rb +255 -0
  114. data/lib/openapi_openai/models/create_embedding_response_usage.rb +237 -0
  115. data/lib/openapi_openai/models/create_fine_tune_request.rb +374 -0
  116. data/lib/openapi_openai/models/create_fine_tune_request_model.rb +105 -0
  117. data/lib/openapi_openai/models/create_image_request.rb +341 -0
  118. data/lib/openapi_openai/models/create_moderation_request.rb +230 -0
  119. data/lib/openapi_openai/models/create_moderation_request_input.rb +106 -0
  120. data/lib/openapi_openai/models/create_moderation_request_model.rb +105 -0
  121. data/lib/openapi_openai/models/create_moderation_response.rb +255 -0
  122. data/lib/openapi_openai/models/create_moderation_response_results_inner.rb +253 -0
  123. data/lib/openapi_openai/models/create_moderation_response_results_inner_categories.rb +317 -0
  124. data/lib/openapi_openai/models/create_moderation_response_results_inner_category_scores.rb +317 -0
  125. data/lib/openapi_openai/models/create_transcription_request_model.rb +105 -0
  126. data/lib/openapi_openai/models/create_transcription_response.rb +221 -0
  127. data/lib/openapi_openai/models/create_translation_response.rb +221 -0
  128. data/lib/openapi_openai/models/delete_file_response.rb +253 -0
  129. data/lib/openapi_openai/models/delete_model_response.rb +253 -0
  130. data/lib/openapi_openai/models/error.rb +261 -0
  131. data/lib/openapi_openai/models/error_response.rb +221 -0
  132. data/lib/openapi_openai/models/fine_tune.rb +410 -0
  133. data/lib/openapi_openai/models/fine_tune_event.rb +269 -0
  134. data/lib/openapi_openai/models/images_response.rb +239 -0
  135. data/lib/openapi_openai/models/images_response_data_inner.rb +223 -0
  136. data/lib/openapi_openai/models/list_files_response.rb +239 -0
  137. data/lib/openapi_openai/models/list_fine_tune_events_response.rb +239 -0
  138. data/lib/openapi_openai/models/list_fine_tunes_response.rb +239 -0
  139. data/lib/openapi_openai/models/list_models_response.rb +239 -0
  140. data/lib/openapi_openai/models/model.rb +269 -0
  141. data/lib/openapi_openai/models/open_ai_file.rb +320 -0
  142. data/lib/openapi_openai/version.rb +15 -0
  143. data/lib/openapi_openai.rb +99 -0
  144. data/openapi_openai.gemspec +39 -0
  145. data/spec/api/open_ai_api_spec.rb +306 -0
  146. data/spec/models/chat_completion_functions_spec.rb +48 -0
  147. data/spec/models/chat_completion_request_message_function_call_spec.rb +42 -0
  148. data/spec/models/chat_completion_request_message_spec.rb +58 -0
  149. data/spec/models/chat_completion_response_message_spec.rb +52 -0
  150. data/spec/models/chat_completion_stream_response_delta_spec.rb +52 -0
  151. data/spec/models/create_chat_completion_request_function_call_one_of_spec.rb +36 -0
  152. data/spec/models/create_chat_completion_request_function_call_spec.rb +32 -0
  153. data/spec/models/create_chat_completion_request_model_spec.rb +32 -0
  154. data/spec/models/create_chat_completion_request_spec.rb +114 -0
  155. data/spec/models/create_chat_completion_request_stop_spec.rb +32 -0
  156. data/spec/models/create_chat_completion_response_choices_inner_spec.rb +52 -0
  157. data/spec/models/create_chat_completion_response_spec.rb +66 -0
  158. data/spec/models/create_chat_completion_stream_response_choices_inner_spec.rb +52 -0
  159. data/spec/models/create_chat_completion_stream_response_spec.rb +60 -0
  160. data/spec/models/create_completion_request_model_spec.rb +32 -0
  161. data/spec/models/create_completion_request_prompt_spec.rb +32 -0
  162. data/spec/models/create_completion_request_spec.rb +126 -0
  163. data/spec/models/create_completion_request_stop_spec.rb +32 -0
  164. data/spec/models/create_completion_response_choices_inner_logprobs_spec.rb +54 -0
  165. data/spec/models/create_completion_response_choices_inner_spec.rb +58 -0
  166. data/spec/models/create_completion_response_spec.rb +66 -0
  167. data/spec/models/create_completion_response_usage_spec.rb +48 -0
  168. data/spec/models/create_edit_request_model_spec.rb +32 -0
  169. data/spec/models/create_edit_request_spec.rb +66 -0
  170. data/spec/models/create_edit_response_choices_inner_spec.rb +58 -0
  171. data/spec/models/create_edit_response_spec.rb +54 -0
  172. data/spec/models/create_embedding_request_input_spec.rb +32 -0
  173. data/spec/models/create_embedding_request_model_spec.rb +32 -0
  174. data/spec/models/create_embedding_request_spec.rb +48 -0
  175. data/spec/models/create_embedding_response_data_inner_spec.rb +48 -0
  176. data/spec/models/create_embedding_response_spec.rb +54 -0
  177. data/spec/models/create_embedding_response_usage_spec.rb +42 -0
  178. data/spec/models/create_fine_tune_request_model_spec.rb +32 -0
  179. data/spec/models/create_fine_tune_request_spec.rb +102 -0
  180. data/spec/models/create_image_request_spec.rb +68 -0
  181. data/spec/models/create_moderation_request_input_spec.rb +32 -0
  182. data/spec/models/create_moderation_request_model_spec.rb +32 -0
  183. data/spec/models/create_moderation_request_spec.rb +42 -0
  184. data/spec/models/create_moderation_response_results_inner_categories_spec.rb +72 -0
  185. data/spec/models/create_moderation_response_results_inner_category_scores_spec.rb +72 -0
  186. data/spec/models/create_moderation_response_results_inner_spec.rb +48 -0
  187. data/spec/models/create_moderation_response_spec.rb +48 -0
  188. data/spec/models/create_transcription_request_model_spec.rb +32 -0
  189. data/spec/models/create_transcription_response_spec.rb +36 -0
  190. data/spec/models/create_translation_response_spec.rb +36 -0
  191. data/spec/models/delete_file_response_spec.rb +48 -0
  192. data/spec/models/delete_model_response_spec.rb +48 -0
  193. data/spec/models/error_response_spec.rb +36 -0
  194. data/spec/models/error_spec.rb +54 -0
  195. data/spec/models/fine_tune_event_spec.rb +54 -0
  196. data/spec/models/fine_tune_spec.rb +108 -0
  197. data/spec/models/images_response_data_inner_spec.rb +42 -0
  198. data/spec/models/images_response_spec.rb +42 -0
  199. data/spec/models/list_files_response_spec.rb +42 -0
  200. data/spec/models/list_fine_tune_events_response_spec.rb +42 -0
  201. data/spec/models/list_fine_tunes_response_spec.rb +42 -0
  202. data/spec/models/list_models_response_spec.rb +42 -0
  203. data/spec/models/model_spec.rb +54 -0
  204. data/spec/models/open_ai_file_spec.rb +78 -0
  205. data/spec/spec_helper.rb +111 -0
  206. metadata +348 -0
data/bin/ruby-rewrite ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby2.7
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'ruby-rewrite' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("parser", "ruby-rewrite")
@@ -0,0 +1,22 @@
1
+ # OpenApiOpenAIClient::ChatCompletionFunctions
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. | |
8
+ | **description** | **String** | The description of what the function does. | [optional] |
9
+ | **parameters** | **Hash<String, Object>** | The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'openapi_openai'
15
+
16
+ instance = OpenApiOpenAIClient::ChatCompletionFunctions.new(
17
+ name: null,
18
+ description: null,
19
+ parameters: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,24 @@
1
+ # OpenApiOpenAIClient::ChatCompletionRequestMessage
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **role** | **String** | The role of the messages author. One of `system`, `user`, `assistant`, or `function`. | |
8
+ | **content** | **String** | The contents of the message. `content` is required for all messages except assistant messages with function calls. | [optional] |
9
+ | **name** | **String** | The name of the author of this message. `name` is required if role is `function`, and it should be the name of the function whose response is in the `content`. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters. | [optional] |
10
+ | **function_call** | [**ChatCompletionRequestMessageFunctionCall**](ChatCompletionRequestMessageFunctionCall.md) | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'openapi_openai'
16
+
17
+ instance = OpenApiOpenAIClient::ChatCompletionRequestMessage.new(
18
+ role: null,
19
+ content: null,
20
+ name: null,
21
+ function_call: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,20 @@
1
+ # OpenApiOpenAIClient::ChatCompletionRequestMessageFunctionCall
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | The name of the function to call. | [optional] |
8
+ | **arguments** | **String** | The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'openapi_openai'
14
+
15
+ instance = OpenApiOpenAIClient::ChatCompletionRequestMessageFunctionCall.new(
16
+ name: null,
17
+ arguments: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,22 @@
1
+ # OpenApiOpenAIClient::ChatCompletionResponseMessage
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **role** | **String** | The role of the author of this message. | |
8
+ | **content** | **String** | The contents of the message. | [optional] |
9
+ | **function_call** | [**ChatCompletionRequestMessageFunctionCall**](ChatCompletionRequestMessageFunctionCall.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'openapi_openai'
15
+
16
+ instance = OpenApiOpenAIClient::ChatCompletionResponseMessage.new(
17
+ role: null,
18
+ content: null,
19
+ function_call: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,22 @@
1
+ # OpenApiOpenAIClient::ChatCompletionStreamResponseDelta
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **role** | **String** | The role of the author of this message. | [optional] |
8
+ | **content** | **String** | The contents of the chunk message. | [optional] |
9
+ | **function_call** | [**ChatCompletionRequestMessageFunctionCall**](ChatCompletionRequestMessageFunctionCall.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'openapi_openai'
15
+
16
+ instance = OpenApiOpenAIClient::ChatCompletionStreamResponseDelta.new(
17
+ role: null,
18
+ content: null,
19
+ function_call: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,44 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **model** | [**CreateChatCompletionRequestModel**](CreateChatCompletionRequestModel.md) | | |
8
+ | **messages** | [**Array<ChatCompletionRequestMessage>**](ChatCompletionRequestMessage.md) | A list of messages comprising the conversation so far. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb). | |
9
+ | **functions** | [**Array<ChatCompletionFunctions>**](ChatCompletionFunctions.md) | A list of functions the model may generate JSON inputs for. | [optional] |
10
+ | **function_call** | [**CreateChatCompletionRequestFunctionCall**](CreateChatCompletionRequestFunctionCall.md) | | [optional] |
11
+ | **temperature** | **Float** | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | [optional][default to 1] |
12
+ | **top_p** | **Float** | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | [optional][default to 1] |
13
+ | **n** | **Integer** | How many chat completion choices to generate for each input message. | [optional][default to 1] |
14
+ | **stream** | **Boolean** | If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_stream_completions.ipynb). | [optional][default to false] |
15
+ | **stop** | [**CreateChatCompletionRequestStop**](CreateChatCompletionRequestStop.md) | | [optional] |
16
+ | **max_tokens** | **Integer** | The maximum number of [tokens](/tokenizer) to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens. | [optional] |
17
+ | **presence_penalty** | **Float** | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) | [optional][default to 0] |
18
+ | **frequency_penalty** | **Float** | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) | [optional][default to 0] |
19
+ | **logit_bias** | **Object** | Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. | [optional] |
20
+ | **user** | **String** | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). | [optional] |
21
+
22
+ ## Example
23
+
24
+ ```ruby
25
+ require 'openapi_openai'
26
+
27
+ instance = OpenApiOpenAIClient::CreateChatCompletionRequest.new(
28
+ model: null,
29
+ messages: null,
30
+ functions: null,
31
+ function_call: null,
32
+ temperature: 1,
33
+ top_p: 1,
34
+ n: 1,
35
+ stream: null,
36
+ stop: null,
37
+ max_tokens: null,
38
+ presence_penalty: null,
39
+ frequency_penalty: null,
40
+ logit_bias: null,
41
+ user: user-1234
42
+ )
43
+ ```
44
+
@@ -0,0 +1,49 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionRequestFunctionCall
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'openapi_openai'
13
+
14
+ OpenApiOpenAIClient::CreateChatCompletionRequestFunctionCall.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'CreateChatCompletionRequestFunctionCallOneOf',
18
+ # :'String'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'openapi_openai'
30
+
31
+ OpenApiOpenAIClient::CreateChatCompletionRequestFunctionCall.build(data)
32
+ # => #<CreateChatCompletionRequestFunctionCallOneOf:0x00007fdd4aab02a0>
33
+
34
+ OpenApiOpenAIClient::CreateChatCompletionRequestFunctionCall.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `CreateChatCompletionRequestFunctionCallOneOf`
47
+ - `String`
48
+ - `nil` (if no type matches)
49
+
@@ -0,0 +1,18 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionRequestFunctionCallOneOf
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | The name of the function to call. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'openapi_openai'
13
+
14
+ instance = OpenApiOpenAIClient::CreateChatCompletionRequestFunctionCallOneOf.new(
15
+ name: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,47 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionRequestModel
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'openapi_openai'
13
+
14
+ OpenApiOpenAIClient::CreateChatCompletionRequestModel.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'String'
18
+ # ]
19
+ ```
20
+
21
+ ### build
22
+
23
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
24
+
25
+ #### Example
26
+
27
+ ```ruby
28
+ require 'openapi_openai'
29
+
30
+ OpenApiOpenAIClient::CreateChatCompletionRequestModel.build(data)
31
+ # => #<String:0x00007fdd4aab02a0>
32
+
33
+ OpenApiOpenAIClient::CreateChatCompletionRequestModel.build(data_that_doesnt_match)
34
+ # => nil
35
+ ```
36
+
37
+ #### Parameters
38
+
39
+ | Name | Type | Description |
40
+ | ---- | ---- | ----------- |
41
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
42
+
43
+ #### Return type
44
+
45
+ - `String`
46
+ - `nil` (if no type matches)
47
+
@@ -0,0 +1,49 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionRequestStop
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'openapi_openai'
13
+
14
+ OpenApiOpenAIClient::CreateChatCompletionRequestStop.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'Array<String>',
18
+ # :'String'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'openapi_openai'
30
+
31
+ OpenApiOpenAIClient::CreateChatCompletionRequestStop.build(data)
32
+ # => #<Array<String>:0x00007fdd4aab02a0>
33
+
34
+ OpenApiOpenAIClient::CreateChatCompletionRequestStop.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `Array<String>`
47
+ - `String`
48
+ - `nil` (if no type matches)
49
+
@@ -0,0 +1,28 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **object** | **String** | | |
9
+ | **created** | **Integer** | | |
10
+ | **model** | **String** | | |
11
+ | **choices** | [**Array&lt;CreateChatCompletionResponseChoicesInner&gt;**](CreateChatCompletionResponseChoicesInner.md) | | |
12
+ | **usage** | [**CreateCompletionResponseUsage**](CreateCompletionResponseUsage.md) | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'openapi_openai'
18
+
19
+ instance = OpenApiOpenAIClient::CreateChatCompletionResponse.new(
20
+ id: null,
21
+ object: null,
22
+ created: null,
23
+ model: null,
24
+ choices: null,
25
+ usage: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,22 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionResponseChoicesInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **index** | **Integer** | | [optional] |
8
+ | **message** | [**ChatCompletionResponseMessage**](ChatCompletionResponseMessage.md) | | [optional] |
9
+ | **finish_reason** | **String** | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'openapi_openai'
15
+
16
+ instance = OpenApiOpenAIClient::CreateChatCompletionResponseChoicesInner.new(
17
+ index: null,
18
+ message: null,
19
+ finish_reason: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,26 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionStreamResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **object** | **String** | | |
9
+ | **created** | **Integer** | | |
10
+ | **model** | **String** | | |
11
+ | **choices** | [**Array&lt;CreateChatCompletionStreamResponseChoicesInner&gt;**](CreateChatCompletionStreamResponseChoicesInner.md) | | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'openapi_openai'
17
+
18
+ instance = OpenApiOpenAIClient::CreateChatCompletionStreamResponse.new(
19
+ id: null,
20
+ object: null,
21
+ created: null,
22
+ model: null,
23
+ choices: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,22 @@
1
+ # OpenApiOpenAIClient::CreateChatCompletionStreamResponseChoicesInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **index** | **Integer** | | [optional] |
8
+ | **delta** | [**ChatCompletionStreamResponseDelta**](ChatCompletionStreamResponseDelta.md) | | [optional] |
9
+ | **finish_reason** | **String** | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'openapi_openai'
15
+
16
+ instance = OpenApiOpenAIClient::CreateChatCompletionStreamResponseChoicesInner.new(
17
+ index: null,
18
+ delta: null,
19
+ finish_reason: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,48 @@
1
+ # OpenApiOpenAIClient::CreateCompletionRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **model** | [**CreateCompletionRequestModel**](CreateCompletionRequestModel.md) | | |
8
+ | **prompt** | [**CreateCompletionRequestPrompt**](CreateCompletionRequestPrompt.md) | | |
9
+ | **suffix** | **String** | The suffix that comes after a completion of inserted text. | [optional] |
10
+ | **max_tokens** | **Integer** | The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus &#x60;max_tokens&#x60; cannot exceed the model&#39;s context length. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens. | [optional][default to 16] |
11
+ | **temperature** | **Float** | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or &#x60;top_p&#x60; but not both. | [optional][default to 1] |
12
+ | **top_p** | **Float** | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or &#x60;temperature&#x60; but not both. | [optional][default to 1] |
13
+ | **n** | **Integer** | How many completions to generate for each prompt. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for &#x60;max_tokens&#x60; and &#x60;stop&#x60;. | [optional][default to 1] |
14
+ | **stream** | **Boolean** | Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a &#x60;data: [DONE]&#x60; message. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_stream_completions.ipynb). | [optional][default to false] |
15
+ | **logprobs** | **Integer** | Include the log probabilities on the &#x60;logprobs&#x60; most likely tokens, as well the chosen tokens. For example, if &#x60;logprobs&#x60; is 5, the API will return a list of the 5 most likely tokens. The API will always return the &#x60;logprob&#x60; of the sampled token, so there may be up to &#x60;logprobs+1&#x60; elements in the response. The maximum value for &#x60;logprobs&#x60; is 5. | [optional] |
16
+ | **echo** | **Boolean** | Echo back the prompt in addition to the completion | [optional][default to false] |
17
+ | **stop** | [**CreateCompletionRequestStop**](CreateCompletionRequestStop.md) | | [optional] |
18
+ | **presence_penalty** | **Float** | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model&#39;s likelihood to talk about new topics. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) | [optional][default to 0] |
19
+ | **frequency_penalty** | **Float** | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model&#39;s likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) | [optional][default to 0] |
20
+ | **best_of** | **Integer** | Generates &#x60;best_of&#x60; completions server-side and returns the \&quot;best\&quot; (the one with the highest log probability per token). Results cannot be streamed. When used with &#x60;n&#x60;, &#x60;best_of&#x60; controls the number of candidate completions and &#x60;n&#x60; specifies how many to return – &#x60;best_of&#x60; must be greater than &#x60;n&#x60;. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for &#x60;max_tokens&#x60; and &#x60;stop&#x60;. | [optional][default to 1] |
21
+ | **logit_bias** | **Object** | Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view&#x3D;bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass &#x60;{\&quot;50256\&quot;: -100}&#x60; to prevent the &lt;|endoftext|&gt; token from being generated. | [optional] |
22
+ | **user** | **String** | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). | [optional] |
23
+
24
+ ## Example
25
+
26
+ ```ruby
27
+ require 'openapi_openai'
28
+
29
+ instance = OpenApiOpenAIClient::CreateCompletionRequest.new(
30
+ model: null,
31
+ prompt: null,
32
+ suffix: test.,
33
+ max_tokens: 16,
34
+ temperature: 1,
35
+ top_p: 1,
36
+ n: 1,
37
+ stream: null,
38
+ logprobs: null,
39
+ echo: null,
40
+ stop: null,
41
+ presence_penalty: null,
42
+ frequency_penalty: null,
43
+ best_of: null,
44
+ logit_bias: null,
45
+ user: user-1234
46
+ )
47
+ ```
48
+
@@ -0,0 +1,47 @@
1
+ # OpenApiOpenAIClient::CreateCompletionRequestModel
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'openapi_openai'
13
+
14
+ OpenApiOpenAIClient::CreateCompletionRequestModel.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'String'
18
+ # ]
19
+ ```
20
+
21
+ ### build
22
+
23
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
24
+
25
+ #### Example
26
+
27
+ ```ruby
28
+ require 'openapi_openai'
29
+
30
+ OpenApiOpenAIClient::CreateCompletionRequestModel.build(data)
31
+ # => #<String:0x00007fdd4aab02a0>
32
+
33
+ OpenApiOpenAIClient::CreateCompletionRequestModel.build(data_that_doesnt_match)
34
+ # => nil
35
+ ```
36
+
37
+ #### Parameters
38
+
39
+ | Name | Type | Description |
40
+ | ---- | ---- | ----------- |
41
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
42
+
43
+ #### Return type
44
+
45
+ - `String`
46
+ - `nil` (if no type matches)
47
+
@@ -0,0 +1,53 @@
1
+ # OpenApiOpenAIClient::CreateCompletionRequestPrompt
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'openapi_openai'
13
+
14
+ OpenApiOpenAIClient::CreateCompletionRequestPrompt.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'Array<Array<Integer>>',
18
+ # :'Array<Integer>',
19
+ # :'Array<String>',
20
+ # :'String'
21
+ # ]
22
+ ```
23
+
24
+ ### build
25
+
26
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
27
+
28
+ #### Example
29
+
30
+ ```ruby
31
+ require 'openapi_openai'
32
+
33
+ OpenApiOpenAIClient::CreateCompletionRequestPrompt.build(data)
34
+ # => #<Array<Array<Integer>>:0x00007fdd4aab02a0>
35
+
36
+ OpenApiOpenAIClient::CreateCompletionRequestPrompt.build(data_that_doesnt_match)
37
+ # => nil
38
+ ```
39
+
40
+ #### Parameters
41
+
42
+ | Name | Type | Description |
43
+ | ---- | ---- | ----------- |
44
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
45
+
46
+ #### Return type
47
+
48
+ - `Array<Array<Integer>>`
49
+ - `Array<Integer>`
50
+ - `Array<String>`
51
+ - `String`
52
+ - `nil` (if no type matches)
53
+
@@ -0,0 +1,49 @@
1
+ # OpenApiOpenAIClient::CreateCompletionRequestStop
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'openapi_openai'
13
+
14
+ OpenApiOpenAIClient::CreateCompletionRequestStop.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'Array<String>',
18
+ # :'String'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'openapi_openai'
30
+
31
+ OpenApiOpenAIClient::CreateCompletionRequestStop.build(data)
32
+ # => #<Array<String>:0x00007fdd4aab02a0>
33
+
34
+ OpenApiOpenAIClient::CreateCompletionRequestStop.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `Array<String>`
47
+ - `String`
48
+ - `nil` (if no type matches)
49
+