@scout9/admin 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +1 -0
  2. package/build/api-openai.d.ts +2992 -0
  3. package/build/api-openai.js +1968 -0
  4. package/build/api.d.ts +78 -0
  5. package/build/api.js +90 -0
  6. package/build/base.d.ts +43 -0
  7. package/build/base.js +52 -0
  8. package/build/common.d.ts +54 -0
  9. package/build/common.js +132 -0
  10. package/build/configuration.d.ts +84 -0
  11. package/build/configuration.js +106 -0
  12. package/build/index.d.ts +2 -0
  13. package/build/index.js +18 -0
  14. package/build/schemas/common/algolia.d.ts +20 -0
  15. package/build/schemas/common/algolia.js +2 -0
  16. package/build/schemas/common/contact-map.d.ts +33 -0
  17. package/build/schemas/common/contact-map.js +2 -0
  18. package/build/schemas/common/currency.d.ts +1 -0
  19. package/build/schemas/common/currency.js +2 -0
  20. package/build/schemas/common/index.d.ts +6 -0
  21. package/build/schemas/common/index.js +22 -0
  22. package/build/schemas/common/location.d.ts +5 -0
  23. package/build/schemas/common/location.js +2 -0
  24. package/build/schemas/common/task.d.ts +20 -0
  25. package/build/schemas/common/task.js +2 -0
  26. package/build/schemas/common/time.d.ts +14 -0
  27. package/build/schemas/common/time.js +2 -0
  28. package/build/schemas/common.d.ts +77 -0
  29. package/build/schemas/common.js +8 -0
  30. package/build/schemas/conversations/context.d.ts +55 -0
  31. package/build/schemas/conversations/context.js +2 -0
  32. package/build/schemas/conversations/conversation.d.ts +53 -0
  33. package/build/schemas/conversations/conversation.js +2 -0
  34. package/build/schemas/conversations/index.d.ts +6 -0
  35. package/build/schemas/conversations/index.js +22 -0
  36. package/build/schemas/conversations/message.d.ts +62 -0
  37. package/build/schemas/conversations/message.js +2 -0
  38. package/build/schemas/conversations/parsed.d.ts +7 -0
  39. package/build/schemas/conversations/parsed.js +2 -0
  40. package/build/schemas/conversations/scheduled-conversation.d.ts +31 -0
  41. package/build/schemas/conversations/scheduled-conversation.js +2 -0
  42. package/build/schemas/conversations/webhook.d.ts +8 -0
  43. package/build/schemas/conversations/webhook.js +2 -0
  44. package/build/schemas/index.d.ts +3 -0
  45. package/build/schemas/index.js +19 -0
  46. package/build/schemas/users/businesses/agents/agent.d.ts +76 -0
  47. package/build/schemas/users/businesses/agents/agent.js +2 -0
  48. package/build/schemas/users/businesses/agents/auth.d.ts +7 -0
  49. package/build/schemas/users/businesses/agents/auth.js +2 -0
  50. package/build/schemas/users/businesses/agents/index.d.ts +2 -0
  51. package/build/schemas/users/businesses/agents/index.js +18 -0
  52. package/build/schemas/users/businesses/business-location.d.ts +10 -0
  53. package/build/schemas/users/businesses/business-location.js +2 -0
  54. package/build/schemas/users/businesses/business.d.ts +32 -0
  55. package/build/schemas/users/businesses/business.js +2 -0
  56. package/build/schemas/users/businesses/context/context-indexed.d.ts +9 -0
  57. package/build/schemas/users/businesses/context/context-indexed.js +2 -0
  58. package/build/schemas/users/businesses/context/context-saves.d.ts +12 -0
  59. package/build/schemas/users/businesses/context/context-saves.js +2 -0
  60. package/build/schemas/users/businesses/context/context.d.ts +64 -0
  61. package/build/schemas/users/businesses/context/context.js +2 -0
  62. package/build/schemas/users/businesses/context/index.d.ts +2 -0
  63. package/build/schemas/users/businesses/context/index.js +18 -0
  64. package/build/schemas/users/businesses/index.d.ts +5 -0
  65. package/build/schemas/users/businesses/index.js +21 -0
  66. package/build/schemas/users/businesses/notifications.d.ts +7 -0
  67. package/build/schemas/users/businesses/notifications.js +2 -0
  68. package/build/schemas/users/businesses/offerings/index.d.ts +2 -0
  69. package/build/schemas/users/businesses/offerings/index.js +18 -0
  70. package/build/schemas/users/businesses/offerings/offer-indexed.d.ts +34 -0
  71. package/build/schemas/users/businesses/offerings/offer-indexed.js +2 -0
  72. package/build/schemas/users/businesses/offerings/offer.d.ts +29 -0
  73. package/build/schemas/users/businesses/offerings/offer.js +2 -0
  74. package/build/schemas/users/businesses/thread.d.ts +44 -0
  75. package/build/schemas/users/businesses/thread.js +2 -0
  76. package/build/schemas/users/customers/customer.d.ts +35 -0
  77. package/build/schemas/users/customers/customer.js +2 -0
  78. package/build/schemas/users/customers/index.d.ts +1 -0
  79. package/build/schemas/users/customers/index.js +17 -0
  80. package/build/schemas/users/index.d.ts +2 -0
  81. package/build/schemas/users/index.js +18 -0
  82. package/package.json +33 -0
  83. package/src/api-openai.txt +4117 -0
  84. package/src/api.ts +141 -0
  85. package/src/base.ts +55 -0
  86. package/src/common.ts +136 -0
  87. package/src/configuration.ts +124 -0
  88. package/src/index.ts +2 -0
  89. package/src/schemas/common/algolia.ts +24 -0
  90. package/src/schemas/common/contact-map.ts +35 -0
  91. package/src/schemas/common/currency.ts +1 -0
  92. package/src/schemas/common/index.ts +6 -0
  93. package/src/schemas/common/location.ts +6 -0
  94. package/src/schemas/common/task.ts +26 -0
  95. package/src/schemas/common/time.ts +15 -0
  96. package/src/schemas/common.ts +94 -0
  97. package/src/schemas/conversations/context.ts +64 -0
  98. package/src/schemas/conversations/conversation.ts +68 -0
  99. package/src/schemas/conversations/index.ts +6 -0
  100. package/src/schemas/conversations/message.ts +78 -0
  101. package/src/schemas/conversations/parsed.ts +5 -0
  102. package/src/schemas/conversations/scheduled-conversation.ts +35 -0
  103. package/src/schemas/conversations/webhook.ts +10 -0
  104. package/src/schemas/index.ts +3 -0
  105. package/src/schemas/users/businesses/agents/agent.ts +107 -0
  106. package/src/schemas/users/businesses/agents/auth.ts +8 -0
  107. package/src/schemas/users/businesses/agents/index.ts +2 -0
  108. package/src/schemas/users/businesses/business-location.ts +15 -0
  109. package/src/schemas/users/businesses/business.ts +43 -0
  110. package/src/schemas/users/businesses/context/context-indexed.ts +11 -0
  111. package/src/schemas/users/businesses/context/context-saves.ts +14 -0
  112. package/src/schemas/users/businesses/context/context.ts +76 -0
  113. package/src/schemas/users/businesses/context/index.ts +2 -0
  114. package/src/schemas/users/businesses/index.ts +6 -0
  115. package/src/schemas/users/businesses/notifications.ts +12 -0
  116. package/src/schemas/users/businesses/offerings/index.ts +2 -0
  117. package/src/schemas/users/businesses/offerings/offer-indexed.ts +42 -0
  118. package/src/schemas/users/businesses/offerings/offer.ts +39 -0
  119. package/src/schemas/users/businesses/thread.ts +55 -0
  120. package/src/schemas/users/customers/customer.ts +46 -0
  121. package/src/schemas/users/customers/index.ts +1 -0
  122. package/src/schemas/users/index.ts +2 -0
  123. package/tsconfig.json +16 -0
  124. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,1968 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.OpenAIApi = exports.OpenAIApiFactory = exports.OpenAIApiFp = exports.OpenAIApiAxiosParamCreator = exports.CreateImageRequestResponseFormatEnum = exports.CreateImageRequestSizeEnum = exports.ChatCompletionResponseMessageRoleEnum = exports.ChatCompletionRequestMessageRoleEnum = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ // Some imports not used depending on template conditions
9
+ // @ts-ignore
10
+ const common_1 = require("./common");
11
+ // @ts-ignore
12
+ const base_1 = require("./base");
13
+ exports.ChatCompletionRequestMessageRoleEnum = {
14
+ System: 'system',
15
+ User: 'user',
16
+ Assistant: 'assistant',
17
+ Function: 'function'
18
+ };
19
+ exports.ChatCompletionResponseMessageRoleEnum = {
20
+ System: 'system',
21
+ User: 'user',
22
+ Assistant: 'assistant',
23
+ Function: 'function'
24
+ };
25
+ exports.CreateImageRequestSizeEnum = {
26
+ _256x256: '256x256',
27
+ _512x512: '512x512',
28
+ _1024x1024: '1024x1024'
29
+ };
30
+ exports.CreateImageRequestResponseFormatEnum = {
31
+ Url: 'url',
32
+ B64Json: 'b64_json'
33
+ };
34
+ /**
35
+ * OpenAIApi - axios parameter creator
36
+ * @export
37
+ */
38
+ const OpenAIApiAxiosParamCreator = function (configuration) {
39
+ return {
40
+ /**
41
+ *
42
+ * @summary Immediately cancel a fine-tune job.
43
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
44
+ * @param {*} [options] Override http request option.
45
+ * @throws {RequiredError}
46
+ */
47
+ cancelFineTune: async (fineTuneId, options = {}) => {
48
+ // verify required parameter 'fineTuneId' is not null or undefined
49
+ (0, common_1.assertParamExists)('cancelFineTune', 'fineTuneId', fineTuneId);
50
+ const localVarPath = `/fine-tunes/{fine_tune_id}/cancel`
51
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
52
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
53
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
54
+ let baseOptions;
55
+ if (configuration) {
56
+ baseOptions = configuration.baseOptions;
57
+ }
58
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
59
+ const localVarHeaderParameter = {};
60
+ const localVarQueryParameter = {};
61
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
62
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
63
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
64
+ return {
65
+ url: (0, common_1.toPathString)(localVarUrlObj),
66
+ options: localVarRequestOptions,
67
+ };
68
+ },
69
+ /**
70
+ *
71
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
72
+ * @param {CreateAnswerRequest} createAnswerRequest
73
+ * @param {*} [options] Override http request option.
74
+ * @deprecated
75
+ * @throws {RequiredError}
76
+ */
77
+ createAnswer: async (createAnswerRequest, options = {}) => {
78
+ // verify required parameter 'createAnswerRequest' is not null or undefined
79
+ (0, common_1.assertParamExists)('createAnswer', 'createAnswerRequest', createAnswerRequest);
80
+ const localVarPath = `/answers`;
81
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
82
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
83
+ let baseOptions;
84
+ if (configuration) {
85
+ baseOptions = configuration.baseOptions;
86
+ }
87
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
88
+ const localVarHeaderParameter = {};
89
+ const localVarQueryParameter = {};
90
+ localVarHeaderParameter['Content-Type'] = 'application/json';
91
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
92
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
93
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
94
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createAnswerRequest, localVarRequestOptions, configuration);
95
+ return {
96
+ url: (0, common_1.toPathString)(localVarUrlObj),
97
+ options: localVarRequestOptions,
98
+ };
99
+ },
100
+ /**
101
+ *
102
+ * @summary Creates a model response for the given chat conversation.
103
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
104
+ * @param {*} [options] Override http request option.
105
+ * @throws {RequiredError}
106
+ */
107
+ createChatCompletion: async (createChatCompletionRequest, options = {}) => {
108
+ // verify required parameter 'createChatCompletionRequest' is not null or undefined
109
+ (0, common_1.assertParamExists)('createChatCompletion', 'createChatCompletionRequest', createChatCompletionRequest);
110
+ const localVarPath = `/chat/completions`;
111
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
112
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
113
+ let baseOptions;
114
+ if (configuration) {
115
+ baseOptions = configuration.baseOptions;
116
+ }
117
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
118
+ const localVarHeaderParameter = {};
119
+ const localVarQueryParameter = {};
120
+ localVarHeaderParameter['Content-Type'] = 'application/json';
121
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
122
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
123
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
124
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createChatCompletionRequest, localVarRequestOptions, configuration);
125
+ return {
126
+ url: (0, common_1.toPathString)(localVarUrlObj),
127
+ options: localVarRequestOptions,
128
+ };
129
+ },
130
+ /**
131
+ *
132
+ * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
133
+ * @param {CreateClassificationRequest} createClassificationRequest
134
+ * @param {*} [options] Override http request option.
135
+ * @deprecated
136
+ * @throws {RequiredError}
137
+ */
138
+ createClassification: async (createClassificationRequest, options = {}) => {
139
+ // verify required parameter 'createClassificationRequest' is not null or undefined
140
+ (0, common_1.assertParamExists)('createClassification', 'createClassificationRequest', createClassificationRequest);
141
+ const localVarPath = `/classifications`;
142
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
143
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
144
+ let baseOptions;
145
+ if (configuration) {
146
+ baseOptions = configuration.baseOptions;
147
+ }
148
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
149
+ const localVarHeaderParameter = {};
150
+ const localVarQueryParameter = {};
151
+ localVarHeaderParameter['Content-Type'] = 'application/json';
152
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
153
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
154
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
155
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createClassificationRequest, localVarRequestOptions, configuration);
156
+ return {
157
+ url: (0, common_1.toPathString)(localVarUrlObj),
158
+ options: localVarRequestOptions,
159
+ };
160
+ },
161
+ /**
162
+ *
163
+ * @summary Creates a completion for the provided prompt and parameters.
164
+ * @param {CreateCompletionRequest} createCompletionRequest
165
+ * @param {*} [options] Override http request option.
166
+ * @throws {RequiredError}
167
+ */
168
+ createCompletion: async (createCompletionRequest, options = {}) => {
169
+ // verify required parameter 'createCompletionRequest' is not null or undefined
170
+ (0, common_1.assertParamExists)('createCompletion', 'createCompletionRequest', createCompletionRequest);
171
+ const localVarPath = `/completions`;
172
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
173
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
174
+ let baseOptions;
175
+ if (configuration) {
176
+ baseOptions = configuration.baseOptions;
177
+ }
178
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
179
+ const localVarHeaderParameter = {};
180
+ const localVarQueryParameter = {};
181
+ localVarHeaderParameter['Content-Type'] = 'application/json';
182
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
183
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
184
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
185
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createCompletionRequest, localVarRequestOptions, configuration);
186
+ return {
187
+ url: (0, common_1.toPathString)(localVarUrlObj),
188
+ options: localVarRequestOptions,
189
+ };
190
+ },
191
+ /**
192
+ *
193
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
194
+ * @param {CreateEditRequest} createEditRequest
195
+ * @param {*} [options] Override http request option.
196
+ * @throws {RequiredError}
197
+ */
198
+ createEdit: async (createEditRequest, options = {}) => {
199
+ // verify required parameter 'createEditRequest' is not null or undefined
200
+ (0, common_1.assertParamExists)('createEdit', 'createEditRequest', createEditRequest);
201
+ const localVarPath = `/edits`;
202
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
203
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
204
+ let baseOptions;
205
+ if (configuration) {
206
+ baseOptions = configuration.baseOptions;
207
+ }
208
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
209
+ const localVarHeaderParameter = {};
210
+ const localVarQueryParameter = {};
211
+ localVarHeaderParameter['Content-Type'] = 'application/json';
212
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
213
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
214
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
215
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createEditRequest, localVarRequestOptions, configuration);
216
+ return {
217
+ url: (0, common_1.toPathString)(localVarUrlObj),
218
+ options: localVarRequestOptions,
219
+ };
220
+ },
221
+ /**
222
+ *
223
+ * @summary Creates an embedding vector representing the input text.
224
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
225
+ * @param {*} [options] Override http request option.
226
+ * @throws {RequiredError}
227
+ */
228
+ createEmbedding: async (createEmbeddingRequest, options = {}) => {
229
+ // verify required parameter 'createEmbeddingRequest' is not null or undefined
230
+ (0, common_1.assertParamExists)('createEmbedding', 'createEmbeddingRequest', createEmbeddingRequest);
231
+ const localVarPath = `/embeddings`;
232
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
233
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
234
+ let baseOptions;
235
+ if (configuration) {
236
+ baseOptions = configuration.baseOptions;
237
+ }
238
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
239
+ const localVarHeaderParameter = {};
240
+ const localVarQueryParameter = {};
241
+ localVarHeaderParameter['Content-Type'] = 'application/json';
242
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
243
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
244
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
245
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createEmbeddingRequest, localVarRequestOptions, configuration);
246
+ return {
247
+ url: (0, common_1.toPathString)(localVarUrlObj),
248
+ options: localVarRequestOptions,
249
+ };
250
+ },
251
+ /**
252
+ *
253
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
254
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"fine-tune\\\", each line is a JSON record with \\\"prompt\\\" and \\\"completion\\\" fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
255
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
256
+ * @param {*} [options] Override http request option.
257
+ * @throws {RequiredError}
258
+ */
259
+ createFile: async (file, purpose, options = {}) => {
260
+ // verify required parameter 'file' is not null or undefined
261
+ (0, common_1.assertParamExists)('createFile', 'file', file);
262
+ // verify required parameter 'purpose' is not null or undefined
263
+ (0, common_1.assertParamExists)('createFile', 'purpose', purpose);
264
+ const localVarPath = `/files`;
265
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
266
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
267
+ let baseOptions;
268
+ if (configuration) {
269
+ baseOptions = configuration.baseOptions;
270
+ }
271
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
272
+ const localVarHeaderParameter = {};
273
+ const localVarQueryParameter = {};
274
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
275
+ if (file !== undefined) {
276
+ localVarFormParams.append('file', file);
277
+ }
278
+ if (purpose !== undefined) {
279
+ localVarFormParams.append('purpose', purpose);
280
+ }
281
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
282
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
283
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
284
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers };
285
+ localVarRequestOptions.data = localVarFormParams;
286
+ return {
287
+ url: (0, common_1.toPathString)(localVarUrlObj),
288
+ options: localVarRequestOptions,
289
+ };
290
+ },
291
+ /**
292
+ *
293
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
294
+ * @param {CreateFineTuneRequest} createFineTuneRequest
295
+ * @param {*} [options] Override http request option.
296
+ * @throws {RequiredError}
297
+ */
298
+ createFineTune: async (createFineTuneRequest, options = {}) => {
299
+ // verify required parameter 'createFineTuneRequest' is not null or undefined
300
+ (0, common_1.assertParamExists)('createFineTune', 'createFineTuneRequest', createFineTuneRequest);
301
+ const localVarPath = `/fine-tunes`;
302
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
303
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
304
+ let baseOptions;
305
+ if (configuration) {
306
+ baseOptions = configuration.baseOptions;
307
+ }
308
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
309
+ const localVarHeaderParameter = {};
310
+ const localVarQueryParameter = {};
311
+ localVarHeaderParameter['Content-Type'] = 'application/json';
312
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
313
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
314
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
315
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createFineTuneRequest, localVarRequestOptions, configuration);
316
+ return {
317
+ url: (0, common_1.toPathString)(localVarUrlObj),
318
+ options: localVarRequestOptions,
319
+ };
320
+ },
321
+ /**
322
+ *
323
+ * @summary Creates an image given a prompt.
324
+ * @param {CreateImageRequest} createImageRequest
325
+ * @param {*} [options] Override http request option.
326
+ * @throws {RequiredError}
327
+ */
328
+ createImage: async (createImageRequest, options = {}) => {
329
+ // verify required parameter 'createImageRequest' is not null or undefined
330
+ (0, common_1.assertParamExists)('createImage', 'createImageRequest', createImageRequest);
331
+ const localVarPath = `/images/generations`;
332
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
333
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
334
+ let baseOptions;
335
+ if (configuration) {
336
+ baseOptions = configuration.baseOptions;
337
+ }
338
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
339
+ const localVarHeaderParameter = {};
340
+ const localVarQueryParameter = {};
341
+ localVarHeaderParameter['Content-Type'] = 'application/json';
342
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
343
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
344
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
345
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createImageRequest, localVarRequestOptions, configuration);
346
+ return {
347
+ url: (0, common_1.toPathString)(localVarUrlObj),
348
+ options: localVarRequestOptions,
349
+ };
350
+ },
351
+ /**
352
+ *
353
+ * @summary Creates an edited or extended image given an original image and a prompt.
354
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
355
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
356
+ * @param {File} [mask] An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
357
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
358
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
359
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
360
+ * @param {string} [user] 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).
361
+ * @param {*} [options] Override http request option.
362
+ * @throws {RequiredError}
363
+ */
364
+ createImageEdit: async (image, prompt, mask, n, size, responseFormat, user, options = {}) => {
365
+ // verify required parameter 'image' is not null or undefined
366
+ (0, common_1.assertParamExists)('createImageEdit', 'image', image);
367
+ // verify required parameter 'prompt' is not null or undefined
368
+ (0, common_1.assertParamExists)('createImageEdit', 'prompt', prompt);
369
+ const localVarPath = `/images/edits`;
370
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
371
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
372
+ let baseOptions;
373
+ if (configuration) {
374
+ baseOptions = configuration.baseOptions;
375
+ }
376
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
377
+ const localVarHeaderParameter = {};
378
+ const localVarQueryParameter = {};
379
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
380
+ if (image !== undefined) {
381
+ localVarFormParams.append('image', image);
382
+ }
383
+ if (mask !== undefined) {
384
+ localVarFormParams.append('mask', mask);
385
+ }
386
+ if (prompt !== undefined) {
387
+ localVarFormParams.append('prompt', prompt);
388
+ }
389
+ if (n !== undefined) {
390
+ localVarFormParams.append('n', n);
391
+ }
392
+ if (size !== undefined) {
393
+ localVarFormParams.append('size', size);
394
+ }
395
+ if (responseFormat !== undefined) {
396
+ localVarFormParams.append('response_format', responseFormat);
397
+ }
398
+ if (user !== undefined) {
399
+ localVarFormParams.append('user', user);
400
+ }
401
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
402
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
403
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
404
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers };
405
+ localVarRequestOptions.data = localVarFormParams;
406
+ return {
407
+ url: (0, common_1.toPathString)(localVarUrlObj),
408
+ options: localVarRequestOptions,
409
+ };
410
+ },
411
+ /**
412
+ *
413
+ * @summary Creates a variation of a given image.
414
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
415
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
416
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
417
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
418
+ * @param {string} [user] 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).
419
+ * @param {*} [options] Override http request option.
420
+ * @throws {RequiredError}
421
+ */
422
+ createImageVariation: async (image, n, size, responseFormat, user, options = {}) => {
423
+ // verify required parameter 'image' is not null or undefined
424
+ (0, common_1.assertParamExists)('createImageVariation', 'image', image);
425
+ const localVarPath = `/images/variations`;
426
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
427
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
428
+ let baseOptions;
429
+ if (configuration) {
430
+ baseOptions = configuration.baseOptions;
431
+ }
432
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
433
+ const localVarHeaderParameter = {};
434
+ const localVarQueryParameter = {};
435
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
436
+ if (image !== undefined) {
437
+ localVarFormParams.append('image', image);
438
+ }
439
+ if (n !== undefined) {
440
+ localVarFormParams.append('n', n);
441
+ }
442
+ if (size !== undefined) {
443
+ localVarFormParams.append('size', size);
444
+ }
445
+ if (responseFormat !== undefined) {
446
+ localVarFormParams.append('response_format', responseFormat);
447
+ }
448
+ if (user !== undefined) {
449
+ localVarFormParams.append('user', user);
450
+ }
451
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
452
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
453
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
454
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers };
455
+ localVarRequestOptions.data = localVarFormParams;
456
+ return {
457
+ url: (0, common_1.toPathString)(localVarUrlObj),
458
+ options: localVarRequestOptions,
459
+ };
460
+ },
461
+ /**
462
+ *
463
+ * @summary Classifies if text violates OpenAI\'s Content Policy
464
+ * @param {CreateModerationRequest} createModerationRequest
465
+ * @param {*} [options] Override http request option.
466
+ * @throws {RequiredError}
467
+ */
468
+ createModeration: async (createModerationRequest, options = {}) => {
469
+ // verify required parameter 'createModerationRequest' is not null or undefined
470
+ (0, common_1.assertParamExists)('createModeration', 'createModerationRequest', createModerationRequest);
471
+ const localVarPath = `/moderations`;
472
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
473
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
474
+ let baseOptions;
475
+ if (configuration) {
476
+ baseOptions = configuration.baseOptions;
477
+ }
478
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
479
+ const localVarHeaderParameter = {};
480
+ const localVarQueryParameter = {};
481
+ localVarHeaderParameter['Content-Type'] = 'application/json';
482
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
483
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
484
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
485
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createModerationRequest, localVarRequestOptions, configuration);
486
+ return {
487
+ url: (0, common_1.toPathString)(localVarUrlObj),
488
+ options: localVarRequestOptions,
489
+ };
490
+ },
491
+ /**
492
+ *
493
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
494
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
495
+ * @param {CreateSearchRequest} createSearchRequest
496
+ * @param {*} [options] Override http request option.
497
+ * @deprecated
498
+ * @throws {RequiredError}
499
+ */
500
+ createSearch: async (engineId, createSearchRequest, options = {}) => {
501
+ // verify required parameter 'engineId' is not null or undefined
502
+ (0, common_1.assertParamExists)('createSearch', 'engineId', engineId);
503
+ // verify required parameter 'createSearchRequest' is not null or undefined
504
+ (0, common_1.assertParamExists)('createSearch', 'createSearchRequest', createSearchRequest);
505
+ const localVarPath = `/engines/{engine_id}/search`
506
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
507
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
508
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
509
+ let baseOptions;
510
+ if (configuration) {
511
+ baseOptions = configuration.baseOptions;
512
+ }
513
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
514
+ const localVarHeaderParameter = {};
515
+ const localVarQueryParameter = {};
516
+ localVarHeaderParameter['Content-Type'] = 'application/json';
517
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
518
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
519
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
520
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createSearchRequest, localVarRequestOptions, configuration);
521
+ return {
522
+ url: (0, common_1.toPathString)(localVarUrlObj),
523
+ options: localVarRequestOptions,
524
+ };
525
+ },
526
+ /**
527
+ *
528
+ * @summary Transcribes audio into the input language.
529
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
530
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
531
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
532
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
533
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
534
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
535
+ * @param {*} [options] Override http request option.
536
+ * @throws {RequiredError}
537
+ */
538
+ createTranscription: async (file, model, prompt, responseFormat, temperature, language, options = {}) => {
539
+ // verify required parameter 'file' is not null or undefined
540
+ (0, common_1.assertParamExists)('createTranscription', 'file', file);
541
+ // verify required parameter 'model' is not null or undefined
542
+ (0, common_1.assertParamExists)('createTranscription', 'model', model);
543
+ const localVarPath = `/audio/transcriptions`;
544
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
545
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
546
+ let baseOptions;
547
+ if (configuration) {
548
+ baseOptions = configuration.baseOptions;
549
+ }
550
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
551
+ const localVarHeaderParameter = {};
552
+ const localVarQueryParameter = {};
553
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
554
+ if (file !== undefined) {
555
+ localVarFormParams.append('file', file);
556
+ }
557
+ if (model !== undefined) {
558
+ localVarFormParams.append('model', model);
559
+ }
560
+ if (prompt !== undefined) {
561
+ localVarFormParams.append('prompt', prompt);
562
+ }
563
+ if (responseFormat !== undefined) {
564
+ localVarFormParams.append('response_format', responseFormat);
565
+ }
566
+ if (temperature !== undefined) {
567
+ localVarFormParams.append('temperature', temperature);
568
+ }
569
+ if (language !== undefined) {
570
+ localVarFormParams.append('language', language);
571
+ }
572
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
573
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
574
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
575
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers };
576
+ localVarRequestOptions.data = localVarFormParams;
577
+ return {
578
+ url: (0, common_1.toPathString)(localVarUrlObj),
579
+ options: localVarRequestOptions,
580
+ };
581
+ },
582
+ /**
583
+ *
584
+ * @summary Translates audio into into English.
585
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
586
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
587
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
588
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
589
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
590
+ * @param {*} [options] Override http request option.
591
+ * @throws {RequiredError}
592
+ */
593
+ createTranslation: async (file, model, prompt, responseFormat, temperature, options = {}) => {
594
+ // verify required parameter 'file' is not null or undefined
595
+ (0, common_1.assertParamExists)('createTranslation', 'file', file);
596
+ // verify required parameter 'model' is not null or undefined
597
+ (0, common_1.assertParamExists)('createTranslation', 'model', model);
598
+ const localVarPath = `/audio/translations`;
599
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
600
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
601
+ let baseOptions;
602
+ if (configuration) {
603
+ baseOptions = configuration.baseOptions;
604
+ }
605
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
606
+ const localVarHeaderParameter = {};
607
+ const localVarQueryParameter = {};
608
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
609
+ if (file !== undefined) {
610
+ localVarFormParams.append('file', file);
611
+ }
612
+ if (model !== undefined) {
613
+ localVarFormParams.append('model', model);
614
+ }
615
+ if (prompt !== undefined) {
616
+ localVarFormParams.append('prompt', prompt);
617
+ }
618
+ if (responseFormat !== undefined) {
619
+ localVarFormParams.append('response_format', responseFormat);
620
+ }
621
+ if (temperature !== undefined) {
622
+ localVarFormParams.append('temperature', temperature);
623
+ }
624
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
625
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
626
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
627
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers };
628
+ localVarRequestOptions.data = localVarFormParams;
629
+ return {
630
+ url: (0, common_1.toPathString)(localVarUrlObj),
631
+ options: localVarRequestOptions,
632
+ };
633
+ },
634
+ /**
635
+ *
636
+ * @summary Delete a file.
637
+ * @param {string} fileId The ID of the file to use for this request
638
+ * @param {*} [options] Override http request option.
639
+ * @throws {RequiredError}
640
+ */
641
+ deleteFile: async (fileId, options = {}) => {
642
+ // verify required parameter 'fileId' is not null or undefined
643
+ (0, common_1.assertParamExists)('deleteFile', 'fileId', fileId);
644
+ const localVarPath = `/files/{file_id}`
645
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
646
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
647
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
648
+ let baseOptions;
649
+ if (configuration) {
650
+ baseOptions = configuration.baseOptions;
651
+ }
652
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
653
+ const localVarHeaderParameter = {};
654
+ const localVarQueryParameter = {};
655
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
656
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
657
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
658
+ return {
659
+ url: (0, common_1.toPathString)(localVarUrlObj),
660
+ options: localVarRequestOptions,
661
+ };
662
+ },
663
+ /**
664
+ *
665
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
666
+ * @param {string} model The model to delete
667
+ * @param {*} [options] Override http request option.
668
+ * @throws {RequiredError}
669
+ */
670
+ deleteModel: async (model, options = {}) => {
671
+ // verify required parameter 'model' is not null or undefined
672
+ (0, common_1.assertParamExists)('deleteModel', 'model', model);
673
+ const localVarPath = `/models/{model}`
674
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
675
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
676
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
677
+ let baseOptions;
678
+ if (configuration) {
679
+ baseOptions = configuration.baseOptions;
680
+ }
681
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
682
+ const localVarHeaderParameter = {};
683
+ const localVarQueryParameter = {};
684
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
685
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
686
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
687
+ return {
688
+ url: (0, common_1.toPathString)(localVarUrlObj),
689
+ options: localVarRequestOptions,
690
+ };
691
+ },
692
+ /**
693
+ *
694
+ * @summary Returns the contents of the specified file
695
+ * @param {string} fileId The ID of the file to use for this request
696
+ * @param {*} [options] Override http request option.
697
+ * @throws {RequiredError}
698
+ */
699
+ downloadFile: async (fileId, options = {}) => {
700
+ // verify required parameter 'fileId' is not null or undefined
701
+ (0, common_1.assertParamExists)('downloadFile', 'fileId', fileId);
702
+ const localVarPath = `/files/{file_id}/content`
703
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
704
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
705
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
706
+ let baseOptions;
707
+ if (configuration) {
708
+ baseOptions = configuration.baseOptions;
709
+ }
710
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
711
+ const localVarHeaderParameter = {};
712
+ const localVarQueryParameter = {};
713
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
714
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
715
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
716
+ return {
717
+ url: (0, common_1.toPathString)(localVarUrlObj),
718
+ options: localVarRequestOptions,
719
+ };
720
+ },
721
+ /**
722
+ *
723
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
724
+ * @param {*} [options] Override http request option.
725
+ * @deprecated
726
+ * @throws {RequiredError}
727
+ */
728
+ listEngines: async (options = {}) => {
729
+ const localVarPath = `/engines`;
730
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
731
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
732
+ let baseOptions;
733
+ if (configuration) {
734
+ baseOptions = configuration.baseOptions;
735
+ }
736
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
737
+ const localVarHeaderParameter = {};
738
+ const localVarQueryParameter = {};
739
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
740
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
741
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
742
+ return {
743
+ url: (0, common_1.toPathString)(localVarUrlObj),
744
+ options: localVarRequestOptions,
745
+ };
746
+ },
747
+ /**
748
+ *
749
+ * @summary Returns a list of files that belong to the user\'s organization.
750
+ * @param {*} [options] Override http request option.
751
+ * @throws {RequiredError}
752
+ */
753
+ listFiles: async (options = {}) => {
754
+ const localVarPath = `/files`;
755
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
756
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
757
+ let baseOptions;
758
+ if (configuration) {
759
+ baseOptions = configuration.baseOptions;
760
+ }
761
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
762
+ const localVarHeaderParameter = {};
763
+ const localVarQueryParameter = {};
764
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
765
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
766
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
767
+ return {
768
+ url: (0, common_1.toPathString)(localVarUrlObj),
769
+ options: localVarRequestOptions,
770
+ };
771
+ },
772
+ /**
773
+ *
774
+ * @summary Get fine-grained status updates for a fine-tune job.
775
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
776
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a `data: [DONE]` message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
777
+ * @param {*} [options] Override http request option.
778
+ * @throws {RequiredError}
779
+ */
780
+ listFineTuneEvents: async (fineTuneId, stream, options = {}) => {
781
+ // verify required parameter 'fineTuneId' is not null or undefined
782
+ (0, common_1.assertParamExists)('listFineTuneEvents', 'fineTuneId', fineTuneId);
783
+ const localVarPath = `/fine-tunes/{fine_tune_id}/events`
784
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
785
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
786
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
787
+ let baseOptions;
788
+ if (configuration) {
789
+ baseOptions = configuration.baseOptions;
790
+ }
791
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
792
+ const localVarHeaderParameter = {};
793
+ const localVarQueryParameter = {};
794
+ if (stream !== undefined) {
795
+ localVarQueryParameter['stream'] = stream;
796
+ }
797
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
798
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
799
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
800
+ return {
801
+ url: (0, common_1.toPathString)(localVarUrlObj),
802
+ options: localVarRequestOptions,
803
+ };
804
+ },
805
+ /**
806
+ *
807
+ * @summary List your organization\'s fine-tuning jobs
808
+ * @param {*} [options] Override http request option.
809
+ * @throws {RequiredError}
810
+ */
811
+ listFineTunes: async (options = {}) => {
812
+ const localVarPath = `/fine-tunes`;
813
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
814
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
815
+ let baseOptions;
816
+ if (configuration) {
817
+ baseOptions = configuration.baseOptions;
818
+ }
819
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
820
+ const localVarHeaderParameter = {};
821
+ const localVarQueryParameter = {};
822
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
823
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
824
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
825
+ return {
826
+ url: (0, common_1.toPathString)(localVarUrlObj),
827
+ options: localVarRequestOptions,
828
+ };
829
+ },
830
+ /**
831
+ *
832
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
833
+ * @param {*} [options] Override http request option.
834
+ * @throws {RequiredError}
835
+ */
836
+ listModels: async (options = {}) => {
837
+ const localVarPath = `/models`;
838
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
839
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
840
+ let baseOptions;
841
+ if (configuration) {
842
+ baseOptions = configuration.baseOptions;
843
+ }
844
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
845
+ const localVarHeaderParameter = {};
846
+ const localVarQueryParameter = {};
847
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
848
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
849
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
850
+ return {
851
+ url: (0, common_1.toPathString)(localVarUrlObj),
852
+ options: localVarRequestOptions,
853
+ };
854
+ },
855
+ /**
856
+ *
857
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
858
+ * @param {string} engineId The ID of the engine to use for this request
859
+ * @param {*} [options] Override http request option.
860
+ * @deprecated
861
+ * @throws {RequiredError}
862
+ */
863
+ retrieveEngine: async (engineId, options = {}) => {
864
+ // verify required parameter 'engineId' is not null or undefined
865
+ (0, common_1.assertParamExists)('retrieveEngine', 'engineId', engineId);
866
+ const localVarPath = `/engines/{engine_id}`
867
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
868
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
869
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
870
+ let baseOptions;
871
+ if (configuration) {
872
+ baseOptions = configuration.baseOptions;
873
+ }
874
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
875
+ const localVarHeaderParameter = {};
876
+ const localVarQueryParameter = {};
877
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
878
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
879
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
880
+ return {
881
+ url: (0, common_1.toPathString)(localVarUrlObj),
882
+ options: localVarRequestOptions,
883
+ };
884
+ },
885
+ /**
886
+ *
887
+ * @summary Returns information about a specific file.
888
+ * @param {string} fileId The ID of the file to use for this request
889
+ * @param {*} [options] Override http request option.
890
+ * @throws {RequiredError}
891
+ */
892
+ retrieveFile: async (fileId, options = {}) => {
893
+ // verify required parameter 'fileId' is not null or undefined
894
+ (0, common_1.assertParamExists)('retrieveFile', 'fileId', fileId);
895
+ const localVarPath = `/files/{file_id}`
896
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
897
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
898
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
899
+ let baseOptions;
900
+ if (configuration) {
901
+ baseOptions = configuration.baseOptions;
902
+ }
903
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
904
+ const localVarHeaderParameter = {};
905
+ const localVarQueryParameter = {};
906
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
907
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
908
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
909
+ return {
910
+ url: (0, common_1.toPathString)(localVarUrlObj),
911
+ options: localVarRequestOptions,
912
+ };
913
+ },
914
+ /**
915
+ *
916
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
917
+ * @param {string} fineTuneId The ID of the fine-tune job
918
+ * @param {*} [options] Override http request option.
919
+ * @throws {RequiredError}
920
+ */
921
+ retrieveFineTune: async (fineTuneId, options = {}) => {
922
+ // verify required parameter 'fineTuneId' is not null or undefined
923
+ (0, common_1.assertParamExists)('retrieveFineTune', 'fineTuneId', fineTuneId);
924
+ const localVarPath = `/fine-tunes/{fine_tune_id}`
925
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
926
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
927
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
928
+ let baseOptions;
929
+ if (configuration) {
930
+ baseOptions = configuration.baseOptions;
931
+ }
932
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
933
+ const localVarHeaderParameter = {};
934
+ const localVarQueryParameter = {};
935
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
936
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
937
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
938
+ return {
939
+ url: (0, common_1.toPathString)(localVarUrlObj),
940
+ options: localVarRequestOptions,
941
+ };
942
+ },
943
+ /**
944
+ *
945
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
946
+ * @param {string} model The ID of the model to use for this request
947
+ * @param {*} [options] Override http request option.
948
+ * @throws {RequiredError}
949
+ */
950
+ retrieveModel: async (model, options = {}) => {
951
+ // verify required parameter 'model' is not null or undefined
952
+ (0, common_1.assertParamExists)('retrieveModel', 'model', model);
953
+ const localVarPath = `/models/{model}`
954
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
955
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
956
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
957
+ let baseOptions;
958
+ if (configuration) {
959
+ baseOptions = configuration.baseOptions;
960
+ }
961
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
962
+ const localVarHeaderParameter = {};
963
+ const localVarQueryParameter = {};
964
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
965
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
966
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
967
+ return {
968
+ url: (0, common_1.toPathString)(localVarUrlObj),
969
+ options: localVarRequestOptions,
970
+ };
971
+ },
972
+ };
973
+ };
974
+ exports.OpenAIApiAxiosParamCreator = OpenAIApiAxiosParamCreator;
975
+ /**
976
+ * OpenAIApi - functional programming interface
977
+ * @export
978
+ */
979
+ const OpenAIApiFp = function (configuration) {
980
+ const localVarAxiosParamCreator = (0, exports.OpenAIApiAxiosParamCreator)(configuration);
981
+ return {
982
+ /**
983
+ *
984
+ * @summary Immediately cancel a fine-tune job.
985
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
986
+ * @param {*} [options] Override http request option.
987
+ * @throws {RequiredError}
988
+ */
989
+ async cancelFineTune(fineTuneId, options) {
990
+ const localVarAxiosArgs = await localVarAxiosParamCreator.cancelFineTune(fineTuneId, options);
991
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
992
+ },
993
+ /**
994
+ *
995
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
996
+ * @param {CreateAnswerRequest} createAnswerRequest
997
+ * @param {*} [options] Override http request option.
998
+ * @deprecated
999
+ * @throws {RequiredError}
1000
+ */
1001
+ async createAnswer(createAnswerRequest, options) {
1002
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createAnswer(createAnswerRequest, options);
1003
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1004
+ },
1005
+ /**
1006
+ *
1007
+ * @summary Creates a model response for the given chat conversation.
1008
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
1009
+ * @param {*} [options] Override http request option.
1010
+ * @throws {RequiredError}
1011
+ */
1012
+ async createChatCompletion(createChatCompletionRequest, options) {
1013
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createChatCompletion(createChatCompletionRequest, options);
1014
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1015
+ },
1016
+ /**
1017
+ *
1018
+ * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
1019
+ * @param {CreateClassificationRequest} createClassificationRequest
1020
+ * @param {*} [options] Override http request option.
1021
+ * @deprecated
1022
+ * @throws {RequiredError}
1023
+ */
1024
+ async createClassification(createClassificationRequest, options) {
1025
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createClassification(createClassificationRequest, options);
1026
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1027
+ },
1028
+ /**
1029
+ *
1030
+ * @summary Creates a completion for the provided prompt and parameters.
1031
+ * @param {CreateCompletionRequest} createCompletionRequest
1032
+ * @param {*} [options] Override http request option.
1033
+ * @throws {RequiredError}
1034
+ */
1035
+ async createCompletion(createCompletionRequest, options) {
1036
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createCompletion(createCompletionRequest, options);
1037
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1038
+ },
1039
+ /**
1040
+ *
1041
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
1042
+ * @param {CreateEditRequest} createEditRequest
1043
+ * @param {*} [options] Override http request option.
1044
+ * @throws {RequiredError}
1045
+ */
1046
+ async createEdit(createEditRequest, options) {
1047
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEdit(createEditRequest, options);
1048
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1049
+ },
1050
+ /**
1051
+ *
1052
+ * @summary Creates an embedding vector representing the input text.
1053
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1054
+ * @param {*} [options] Override http request option.
1055
+ * @throws {RequiredError}
1056
+ */
1057
+ async createEmbedding(createEmbeddingRequest, options) {
1058
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEmbedding(createEmbeddingRequest, options);
1059
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1060
+ },
1061
+ /**
1062
+ *
1063
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
1064
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"fine-tune\\\", each line is a JSON record with \\\"prompt\\\" and \\\"completion\\\" fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
1065
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
1066
+ * @param {*} [options] Override http request option.
1067
+ * @throws {RequiredError}
1068
+ */
1069
+ async createFile(file, purpose, options) {
1070
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createFile(file, purpose, options);
1071
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1072
+ },
1073
+ /**
1074
+ *
1075
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1076
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1077
+ * @param {*} [options] Override http request option.
1078
+ * @throws {RequiredError}
1079
+ */
1080
+ async createFineTune(createFineTuneRequest, options) {
1081
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createFineTune(createFineTuneRequest, options);
1082
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1083
+ },
1084
+ /**
1085
+ *
1086
+ * @summary Creates an image given a prompt.
1087
+ * @param {CreateImageRequest} createImageRequest
1088
+ * @param {*} [options] Override http request option.
1089
+ * @throws {RequiredError}
1090
+ */
1091
+ async createImage(createImageRequest, options) {
1092
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImage(createImageRequest, options);
1093
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1094
+ },
1095
+ /**
1096
+ *
1097
+ * @summary Creates an edited or extended image given an original image and a prompt.
1098
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
1099
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
1100
+ * @param {File} [mask] An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
1101
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1102
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
1103
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
1104
+ * @param {string} [user] 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).
1105
+ * @param {*} [options] Override http request option.
1106
+ * @throws {RequiredError}
1107
+ */
1108
+ async createImageEdit(image, prompt, mask, n, size, responseFormat, user, options) {
1109
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options);
1110
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1111
+ },
1112
+ /**
1113
+ *
1114
+ * @summary Creates a variation of a given image.
1115
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
1116
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1117
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
1118
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
1119
+ * @param {string} [user] 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).
1120
+ * @param {*} [options] Override http request option.
1121
+ * @throws {RequiredError}
1122
+ */
1123
+ async createImageVariation(image, n, size, responseFormat, user, options) {
1124
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImageVariation(image, n, size, responseFormat, user, options);
1125
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1126
+ },
1127
+ /**
1128
+ *
1129
+ * @summary Classifies if text violates OpenAI\'s Content Policy
1130
+ * @param {CreateModerationRequest} createModerationRequest
1131
+ * @param {*} [options] Override http request option.
1132
+ * @throws {RequiredError}
1133
+ */
1134
+ async createModeration(createModerationRequest, options) {
1135
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createModeration(createModerationRequest, options);
1136
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1137
+ },
1138
+ /**
1139
+ *
1140
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
1141
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
1142
+ * @param {CreateSearchRequest} createSearchRequest
1143
+ * @param {*} [options] Override http request option.
1144
+ * @deprecated
1145
+ * @throws {RequiredError}
1146
+ */
1147
+ async createSearch(engineId, createSearchRequest, options) {
1148
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createSearch(engineId, createSearchRequest, options);
1149
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1150
+ },
1151
+ /**
1152
+ *
1153
+ * @summary Transcribes audio into the input language.
1154
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
1155
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
1156
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
1157
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
1158
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
1159
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
1160
+ * @param {*} [options] Override http request option.
1161
+ * @throws {RequiredError}
1162
+ */
1163
+ async createTranscription(file, model, prompt, responseFormat, temperature, language, options) {
1164
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTranscription(file, model, prompt, responseFormat, temperature, language, options);
1165
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1166
+ },
1167
+ /**
1168
+ *
1169
+ * @summary Translates audio into into English.
1170
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
1171
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
1172
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
1173
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
1174
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
1175
+ * @param {*} [options] Override http request option.
1176
+ * @throws {RequiredError}
1177
+ */
1178
+ async createTranslation(file, model, prompt, responseFormat, temperature, options) {
1179
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTranslation(file, model, prompt, responseFormat, temperature, options);
1180
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1181
+ },
1182
+ /**
1183
+ *
1184
+ * @summary Delete a file.
1185
+ * @param {string} fileId The ID of the file to use for this request
1186
+ * @param {*} [options] Override http request option.
1187
+ * @throws {RequiredError}
1188
+ */
1189
+ async deleteFile(fileId, options) {
1190
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFile(fileId, options);
1191
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1192
+ },
1193
+ /**
1194
+ *
1195
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1196
+ * @param {string} model The model to delete
1197
+ * @param {*} [options] Override http request option.
1198
+ * @throws {RequiredError}
1199
+ */
1200
+ async deleteModel(model, options) {
1201
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteModel(model, options);
1202
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1203
+ },
1204
+ /**
1205
+ *
1206
+ * @summary Returns the contents of the specified file
1207
+ * @param {string} fileId The ID of the file to use for this request
1208
+ * @param {*} [options] Override http request option.
1209
+ * @throws {RequiredError}
1210
+ */
1211
+ async downloadFile(fileId, options) {
1212
+ const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFile(fileId, options);
1213
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1214
+ },
1215
+ /**
1216
+ *
1217
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
1218
+ * @param {*} [options] Override http request option.
1219
+ * @deprecated
1220
+ * @throws {RequiredError}
1221
+ */
1222
+ async listEngines(options) {
1223
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listEngines(options);
1224
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1225
+ },
1226
+ /**
1227
+ *
1228
+ * @summary Returns a list of files that belong to the user\'s organization.
1229
+ * @param {*} [options] Override http request option.
1230
+ * @throws {RequiredError}
1231
+ */
1232
+ async listFiles(options) {
1233
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFiles(options);
1234
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1235
+ },
1236
+ /**
1237
+ *
1238
+ * @summary Get fine-grained status updates for a fine-tune job.
1239
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1240
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a `data: [DONE]` message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
1241
+ * @param {*} [options] Override http request option.
1242
+ * @throws {RequiredError}
1243
+ */
1244
+ async listFineTuneEvents(fineTuneId, stream, options) {
1245
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFineTuneEvents(fineTuneId, stream, options);
1246
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1247
+ },
1248
+ /**
1249
+ *
1250
+ * @summary List your organization\'s fine-tuning jobs
1251
+ * @param {*} [options] Override http request option.
1252
+ * @throws {RequiredError}
1253
+ */
1254
+ async listFineTunes(options) {
1255
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFineTunes(options);
1256
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1257
+ },
1258
+ /**
1259
+ *
1260
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
1261
+ * @param {*} [options] Override http request option.
1262
+ * @throws {RequiredError}
1263
+ */
1264
+ async listModels(options) {
1265
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listModels(options);
1266
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1267
+ },
1268
+ /**
1269
+ *
1270
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
1271
+ * @param {string} engineId The ID of the engine to use for this request
1272
+ * @param {*} [options] Override http request option.
1273
+ * @deprecated
1274
+ * @throws {RequiredError}
1275
+ */
1276
+ async retrieveEngine(engineId, options) {
1277
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveEngine(engineId, options);
1278
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1279
+ },
1280
+ /**
1281
+ *
1282
+ * @summary Returns information about a specific file.
1283
+ * @param {string} fileId The ID of the file to use for this request
1284
+ * @param {*} [options] Override http request option.
1285
+ * @throws {RequiredError}
1286
+ */
1287
+ async retrieveFile(fileId, options) {
1288
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFile(fileId, options);
1289
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1290
+ },
1291
+ /**
1292
+ *
1293
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1294
+ * @param {string} fineTuneId The ID of the fine-tune job
1295
+ * @param {*} [options] Override http request option.
1296
+ * @throws {RequiredError}
1297
+ */
1298
+ async retrieveFineTune(fineTuneId, options) {
1299
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFineTune(fineTuneId, options);
1300
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1301
+ },
1302
+ /**
1303
+ *
1304
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
1305
+ * @param {string} model The ID of the model to use for this request
1306
+ * @param {*} [options] Override http request option.
1307
+ * @throws {RequiredError}
1308
+ */
1309
+ async retrieveModel(model, options) {
1310
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveModel(model, options);
1311
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1312
+ },
1313
+ };
1314
+ };
1315
+ exports.OpenAIApiFp = OpenAIApiFp;
1316
+ /**
1317
+ * OpenAIApi - factory interface
1318
+ * @export
1319
+ */
1320
+ const OpenAIApiFactory = function (configuration, basePath, axios) {
1321
+ const localVarFp = (0, exports.OpenAIApiFp)(configuration);
1322
+ return {
1323
+ /**
1324
+ *
1325
+ * @summary Immediately cancel a fine-tune job.
1326
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1327
+ * @param {*} [options] Override http request option.
1328
+ * @throws {RequiredError}
1329
+ */
1330
+ cancelFineTune(fineTuneId, options) {
1331
+ return localVarFp.cancelFineTune(fineTuneId, options).then((request) => request(axios, basePath));
1332
+ },
1333
+ /**
1334
+ *
1335
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
1336
+ * @param {CreateAnswerRequest} createAnswerRequest
1337
+ * @param {*} [options] Override http request option.
1338
+ * @deprecated
1339
+ * @throws {RequiredError}
1340
+ */
1341
+ createAnswer(createAnswerRequest, options) {
1342
+ return localVarFp.createAnswer(createAnswerRequest, options).then((request) => request(axios, basePath));
1343
+ },
1344
+ /**
1345
+ *
1346
+ * @summary Creates a model response for the given chat conversation.
1347
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
1348
+ * @param {*} [options] Override http request option.
1349
+ * @throws {RequiredError}
1350
+ */
1351
+ createChatCompletion(createChatCompletionRequest, options) {
1352
+ return localVarFp.createChatCompletion(createChatCompletionRequest, options).then((request) => request(axios, basePath));
1353
+ },
1354
+ /**
1355
+ *
1356
+ * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
1357
+ * @param {CreateClassificationRequest} createClassificationRequest
1358
+ * @param {*} [options] Override http request option.
1359
+ * @deprecated
1360
+ * @throws {RequiredError}
1361
+ */
1362
+ createClassification(createClassificationRequest, options) {
1363
+ return localVarFp.createClassification(createClassificationRequest, options).then((request) => request(axios, basePath));
1364
+ },
1365
+ /**
1366
+ *
1367
+ * @summary Creates a completion for the provided prompt and parameters.
1368
+ * @param {CreateCompletionRequest} createCompletionRequest
1369
+ * @param {*} [options] Override http request option.
1370
+ * @throws {RequiredError}
1371
+ */
1372
+ createCompletion(createCompletionRequest, options) {
1373
+ return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios, basePath));
1374
+ },
1375
+ /**
1376
+ *
1377
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
1378
+ * @param {CreateEditRequest} createEditRequest
1379
+ * @param {*} [options] Override http request option.
1380
+ * @throws {RequiredError}
1381
+ */
1382
+ createEdit(createEditRequest, options) {
1383
+ return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios, basePath));
1384
+ },
1385
+ /**
1386
+ *
1387
+ * @summary Creates an embedding vector representing the input text.
1388
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1389
+ * @param {*} [options] Override http request option.
1390
+ * @throws {RequiredError}
1391
+ */
1392
+ createEmbedding(createEmbeddingRequest, options) {
1393
+ return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios, basePath));
1394
+ },
1395
+ /**
1396
+ *
1397
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
1398
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"fine-tune\\\", each line is a JSON record with \\\"prompt\\\" and \\\"completion\\\" fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
1399
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
1400
+ * @param {*} [options] Override http request option.
1401
+ * @throws {RequiredError}
1402
+ */
1403
+ createFile(file, purpose, options) {
1404
+ return localVarFp.createFile(file, purpose, options).then((request) => request(axios, basePath));
1405
+ },
1406
+ /**
1407
+ *
1408
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1409
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1410
+ * @param {*} [options] Override http request option.
1411
+ * @throws {RequiredError}
1412
+ */
1413
+ createFineTune(createFineTuneRequest, options) {
1414
+ return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios, basePath));
1415
+ },
1416
+ /**
1417
+ *
1418
+ * @summary Creates an image given a prompt.
1419
+ * @param {CreateImageRequest} createImageRequest
1420
+ * @param {*} [options] Override http request option.
1421
+ * @throws {RequiredError}
1422
+ */
1423
+ createImage(createImageRequest, options) {
1424
+ return localVarFp.createImage(createImageRequest, options).then((request) => request(axios, basePath));
1425
+ },
1426
+ /**
1427
+ *
1428
+ * @summary Creates an edited or extended image given an original image and a prompt.
1429
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
1430
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
1431
+ * @param {File} [mask] An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
1432
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1433
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
1434
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
1435
+ * @param {string} [user] 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).
1436
+ * @param {*} [options] Override http request option.
1437
+ * @throws {RequiredError}
1438
+ */
1439
+ createImageEdit(image, prompt, mask, n, size, responseFormat, user, options) {
1440
+ return localVarFp.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(axios, basePath));
1441
+ },
1442
+ /**
1443
+ *
1444
+ * @summary Creates a variation of a given image.
1445
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
1446
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1447
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
1448
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
1449
+ * @param {string} [user] 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).
1450
+ * @param {*} [options] Override http request option.
1451
+ * @throws {RequiredError}
1452
+ */
1453
+ createImageVariation(image, n, size, responseFormat, user, options) {
1454
+ return localVarFp.createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(axios, basePath));
1455
+ },
1456
+ /**
1457
+ *
1458
+ * @summary Classifies if text violates OpenAI\'s Content Policy
1459
+ * @param {CreateModerationRequest} createModerationRequest
1460
+ * @param {*} [options] Override http request option.
1461
+ * @throws {RequiredError}
1462
+ */
1463
+ createModeration(createModerationRequest, options) {
1464
+ return localVarFp.createModeration(createModerationRequest, options).then((request) => request(axios, basePath));
1465
+ },
1466
+ /**
1467
+ *
1468
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
1469
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
1470
+ * @param {CreateSearchRequest} createSearchRequest
1471
+ * @param {*} [options] Override http request option.
1472
+ * @deprecated
1473
+ * @throws {RequiredError}
1474
+ */
1475
+ createSearch(engineId, createSearchRequest, options) {
1476
+ return localVarFp.createSearch(engineId, createSearchRequest, options).then((request) => request(axios, basePath));
1477
+ },
1478
+ /**
1479
+ *
1480
+ * @summary Transcribes audio into the input language.
1481
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
1482
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
1483
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
1484
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
1485
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
1486
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
1487
+ * @param {*} [options] Override http request option.
1488
+ * @throws {RequiredError}
1489
+ */
1490
+ createTranscription(file, model, prompt, responseFormat, temperature, language, options) {
1491
+ return localVarFp.createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(axios, basePath));
1492
+ },
1493
+ /**
1494
+ *
1495
+ * @summary Translates audio into into English.
1496
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
1497
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
1498
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
1499
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
1500
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
1501
+ * @param {*} [options] Override http request option.
1502
+ * @throws {RequiredError}
1503
+ */
1504
+ createTranslation(file, model, prompt, responseFormat, temperature, options) {
1505
+ return localVarFp.createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(axios, basePath));
1506
+ },
1507
+ /**
1508
+ *
1509
+ * @summary Delete a file.
1510
+ * @param {string} fileId The ID of the file to use for this request
1511
+ * @param {*} [options] Override http request option.
1512
+ * @throws {RequiredError}
1513
+ */
1514
+ deleteFile(fileId, options) {
1515
+ return localVarFp.deleteFile(fileId, options).then((request) => request(axios, basePath));
1516
+ },
1517
+ /**
1518
+ *
1519
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1520
+ * @param {string} model The model to delete
1521
+ * @param {*} [options] Override http request option.
1522
+ * @throws {RequiredError}
1523
+ */
1524
+ deleteModel(model, options) {
1525
+ return localVarFp.deleteModel(model, options).then((request) => request(axios, basePath));
1526
+ },
1527
+ /**
1528
+ *
1529
+ * @summary Returns the contents of the specified file
1530
+ * @param {string} fileId The ID of the file to use for this request
1531
+ * @param {*} [options] Override http request option.
1532
+ * @throws {RequiredError}
1533
+ */
1534
+ downloadFile(fileId, options) {
1535
+ return localVarFp.downloadFile(fileId, options).then((request) => request(axios, basePath));
1536
+ },
1537
+ /**
1538
+ *
1539
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
1540
+ * @param {*} [options] Override http request option.
1541
+ * @deprecated
1542
+ * @throws {RequiredError}
1543
+ */
1544
+ listEngines(options) {
1545
+ return localVarFp.listEngines(options).then((request) => request(axios, basePath));
1546
+ },
1547
+ /**
1548
+ *
1549
+ * @summary Returns a list of files that belong to the user\'s organization.
1550
+ * @param {*} [options] Override http request option.
1551
+ * @throws {RequiredError}
1552
+ */
1553
+ listFiles(options) {
1554
+ return localVarFp.listFiles(options).then((request) => request(axios, basePath));
1555
+ },
1556
+ /**
1557
+ *
1558
+ * @summary Get fine-grained status updates for a fine-tune job.
1559
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1560
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a `data: [DONE]` message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
1561
+ * @param {*} [options] Override http request option.
1562
+ * @throws {RequiredError}
1563
+ */
1564
+ listFineTuneEvents(fineTuneId, stream, options) {
1565
+ return localVarFp.listFineTuneEvents(fineTuneId, stream, options).then((request) => request(axios, basePath));
1566
+ },
1567
+ /**
1568
+ *
1569
+ * @summary List your organization\'s fine-tuning jobs
1570
+ * @param {*} [options] Override http request option.
1571
+ * @throws {RequiredError}
1572
+ */
1573
+ listFineTunes(options) {
1574
+ return localVarFp.listFineTunes(options).then((request) => request(axios, basePath));
1575
+ },
1576
+ /**
1577
+ *
1578
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
1579
+ * @param {*} [options] Override http request option.
1580
+ * @throws {RequiredError}
1581
+ */
1582
+ listModels(options) {
1583
+ return localVarFp.listModels(options).then((request) => request(axios, basePath));
1584
+ },
1585
+ /**
1586
+ *
1587
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
1588
+ * @param {string} engineId The ID of the engine to use for this request
1589
+ * @param {*} [options] Override http request option.
1590
+ * @deprecated
1591
+ * @throws {RequiredError}
1592
+ */
1593
+ retrieveEngine(engineId, options) {
1594
+ return localVarFp.retrieveEngine(engineId, options).then((request) => request(axios, basePath));
1595
+ },
1596
+ /**
1597
+ *
1598
+ * @summary Returns information about a specific file.
1599
+ * @param {string} fileId The ID of the file to use for this request
1600
+ * @param {*} [options] Override http request option.
1601
+ * @throws {RequiredError}
1602
+ */
1603
+ retrieveFile(fileId, options) {
1604
+ return localVarFp.retrieveFile(fileId, options).then((request) => request(axios, basePath));
1605
+ },
1606
+ /**
1607
+ *
1608
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1609
+ * @param {string} fineTuneId The ID of the fine-tune job
1610
+ * @param {*} [options] Override http request option.
1611
+ * @throws {RequiredError}
1612
+ */
1613
+ retrieveFineTune(fineTuneId, options) {
1614
+ return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios, basePath));
1615
+ },
1616
+ /**
1617
+ *
1618
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
1619
+ * @param {string} model The ID of the model to use for this request
1620
+ * @param {*} [options] Override http request option.
1621
+ * @throws {RequiredError}
1622
+ */
1623
+ retrieveModel(model, options) {
1624
+ return localVarFp.retrieveModel(model, options).then((request) => request(axios, basePath));
1625
+ },
1626
+ };
1627
+ };
1628
+ exports.OpenAIApiFactory = OpenAIApiFactory;
1629
+ /**
1630
+ * OpenAIApi - object-oriented interface
1631
+ * @export
1632
+ * @class OpenAIApi
1633
+ * @extends {BaseAPI}
1634
+ */
1635
+ class OpenAIApi extends base_1.BaseAPI {
1636
+ /**
1637
+ *
1638
+ * @summary Immediately cancel a fine-tune job.
1639
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1640
+ * @param {*} [options] Override http request option.
1641
+ * @throws {RequiredError}
1642
+ * @memberof OpenAIApi
1643
+ */
1644
+ cancelFineTune(fineTuneId, options) {
1645
+ return (0, exports.OpenAIApiFp)(this.configuration).cancelFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
1646
+ }
1647
+ /**
1648
+ *
1649
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
1650
+ * @param {CreateAnswerRequest} createAnswerRequest
1651
+ * @param {*} [options] Override http request option.
1652
+ * @deprecated
1653
+ * @throws {RequiredError}
1654
+ * @memberof OpenAIApi
1655
+ */
1656
+ createAnswer(createAnswerRequest, options) {
1657
+ return (0, exports.OpenAIApiFp)(this.configuration).createAnswer(createAnswerRequest, options).then((request) => request(this.axios, this.basePath));
1658
+ }
1659
+ /**
1660
+ *
1661
+ * @summary Creates a model response for the given chat conversation.
1662
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
1663
+ * @param {*} [options] Override http request option.
1664
+ * @throws {RequiredError}
1665
+ * @memberof OpenAIApi
1666
+ */
1667
+ createChatCompletion(createChatCompletionRequest, options) {
1668
+ return (0, exports.OpenAIApiFp)(this.configuration).createChatCompletion(createChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
1669
+ }
1670
+ /**
1671
+ *
1672
+ * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
1673
+ * @param {CreateClassificationRequest} createClassificationRequest
1674
+ * @param {*} [options] Override http request option.
1675
+ * @deprecated
1676
+ * @throws {RequiredError}
1677
+ * @memberof OpenAIApi
1678
+ */
1679
+ createClassification(createClassificationRequest, options) {
1680
+ return (0, exports.OpenAIApiFp)(this.configuration).createClassification(createClassificationRequest, options).then((request) => request(this.axios, this.basePath));
1681
+ }
1682
+ /**
1683
+ *
1684
+ * @summary Creates a completion for the provided prompt and parameters.
1685
+ * @param {CreateCompletionRequest} createCompletionRequest
1686
+ * @param {*} [options] Override http request option.
1687
+ * @throws {RequiredError}
1688
+ * @memberof OpenAIApi
1689
+ */
1690
+ createCompletion(createCompletionRequest, options) {
1691
+ return (0, exports.OpenAIApiFp)(this.configuration).createCompletion(createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
1692
+ }
1693
+ /**
1694
+ *
1695
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
1696
+ * @param {CreateEditRequest} createEditRequest
1697
+ * @param {*} [options] Override http request option.
1698
+ * @throws {RequiredError}
1699
+ * @memberof OpenAIApi
1700
+ */
1701
+ createEdit(createEditRequest, options) {
1702
+ return (0, exports.OpenAIApiFp)(this.configuration).createEdit(createEditRequest, options).then((request) => request(this.axios, this.basePath));
1703
+ }
1704
+ /**
1705
+ *
1706
+ * @summary Creates an embedding vector representing the input text.
1707
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1708
+ * @param {*} [options] Override http request option.
1709
+ * @throws {RequiredError}
1710
+ * @memberof OpenAIApi
1711
+ */
1712
+ createEmbedding(createEmbeddingRequest, options) {
1713
+ return (0, exports.OpenAIApiFp)(this.configuration).createEmbedding(createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
1714
+ }
1715
+ /**
1716
+ *
1717
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
1718
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"fine-tune\\\", each line is a JSON record with \\\"prompt\\\" and \\\"completion\\\" fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
1719
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
1720
+ * @param {*} [options] Override http request option.
1721
+ * @throws {RequiredError}
1722
+ * @memberof OpenAIApi
1723
+ */
1724
+ createFile(file, purpose, options) {
1725
+ return (0, exports.OpenAIApiFp)(this.configuration).createFile(file, purpose, options).then((request) => request(this.axios, this.basePath));
1726
+ }
1727
+ /**
1728
+ *
1729
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1730
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1731
+ * @param {*} [options] Override http request option.
1732
+ * @throws {RequiredError}
1733
+ * @memberof OpenAIApi
1734
+ */
1735
+ createFineTune(createFineTuneRequest, options) {
1736
+ return (0, exports.OpenAIApiFp)(this.configuration).createFineTune(createFineTuneRequest, options).then((request) => request(this.axios, this.basePath));
1737
+ }
1738
+ /**
1739
+ *
1740
+ * @summary Creates an image given a prompt.
1741
+ * @param {CreateImageRequest} createImageRequest
1742
+ * @param {*} [options] Override http request option.
1743
+ * @throws {RequiredError}
1744
+ * @memberof OpenAIApi
1745
+ */
1746
+ createImage(createImageRequest, options) {
1747
+ return (0, exports.OpenAIApiFp)(this.configuration).createImage(createImageRequest, options).then((request) => request(this.axios, this.basePath));
1748
+ }
1749
+ /**
1750
+ *
1751
+ * @summary Creates an edited or extended image given an original image and a prompt.
1752
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
1753
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
1754
+ * @param {File} [mask] An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
1755
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1756
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
1757
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
1758
+ * @param {string} [user] 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).
1759
+ * @param {*} [options] Override http request option.
1760
+ * @throws {RequiredError}
1761
+ * @memberof OpenAIApi
1762
+ */
1763
+ createImageEdit(image, prompt, mask, n, size, responseFormat, user, options) {
1764
+ return (0, exports.OpenAIApiFp)(this.configuration).createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(this.axios, this.basePath));
1765
+ }
1766
+ /**
1767
+ *
1768
+ * @summary Creates a variation of a given image.
1769
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
1770
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1771
+ * @param {string} [size] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
1772
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
1773
+ * @param {string} [user] 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).
1774
+ * @param {*} [options] Override http request option.
1775
+ * @throws {RequiredError}
1776
+ * @memberof OpenAIApi
1777
+ */
1778
+ createImageVariation(image, n, size, responseFormat, user, options) {
1779
+ return (0, exports.OpenAIApiFp)(this.configuration).createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(this.axios, this.basePath));
1780
+ }
1781
+ /**
1782
+ *
1783
+ * @summary Classifies if text violates OpenAI\'s Content Policy
1784
+ * @param {CreateModerationRequest} createModerationRequest
1785
+ * @param {*} [options] Override http request option.
1786
+ * @throws {RequiredError}
1787
+ * @memberof OpenAIApi
1788
+ */
1789
+ createModeration(createModerationRequest, options) {
1790
+ return (0, exports.OpenAIApiFp)(this.configuration).createModeration(createModerationRequest, options).then((request) => request(this.axios, this.basePath));
1791
+ }
1792
+ /**
1793
+ *
1794
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
1795
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
1796
+ * @param {CreateSearchRequest} createSearchRequest
1797
+ * @param {*} [options] Override http request option.
1798
+ * @deprecated
1799
+ * @throws {RequiredError}
1800
+ * @memberof OpenAIApi
1801
+ */
1802
+ createSearch(engineId, createSearchRequest, options) {
1803
+ return (0, exports.OpenAIApiFp)(this.configuration).createSearch(engineId, createSearchRequest, options).then((request) => request(this.axios, this.basePath));
1804
+ }
1805
+ /**
1806
+ *
1807
+ * @summary Transcribes audio into the input language.
1808
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
1809
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
1810
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
1811
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
1812
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
1813
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
1814
+ * @param {*} [options] Override http request option.
1815
+ * @throws {RequiredError}
1816
+ * @memberof OpenAIApi
1817
+ */
1818
+ createTranscription(file, model, prompt, responseFormat, temperature, language, options) {
1819
+ return (0, exports.OpenAIApiFp)(this.configuration).createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(this.axios, this.basePath));
1820
+ }
1821
+ /**
1822
+ *
1823
+ * @summary Translates audio into into English.
1824
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
1825
+ * @param {string} model ID of the model to use. Only `whisper-1` is currently available.
1826
+ * @param {string} [prompt] An optional text to guide the model\\\'s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
1827
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
1828
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
1829
+ * @param {*} [options] Override http request option.
1830
+ * @throws {RequiredError}
1831
+ * @memberof OpenAIApi
1832
+ */
1833
+ createTranslation(file, model, prompt, responseFormat, temperature, options) {
1834
+ return (0, exports.OpenAIApiFp)(this.configuration).createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(this.axios, this.basePath));
1835
+ }
1836
+ /**
1837
+ *
1838
+ * @summary Delete a file.
1839
+ * @param {string} fileId The ID of the file to use for this request
1840
+ * @param {*} [options] Override http request option.
1841
+ * @throws {RequiredError}
1842
+ * @memberof OpenAIApi
1843
+ */
1844
+ deleteFile(fileId, options) {
1845
+ return (0, exports.OpenAIApiFp)(this.configuration).deleteFile(fileId, options).then((request) => request(this.axios, this.basePath));
1846
+ }
1847
+ /**
1848
+ *
1849
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1850
+ * @param {string} model The model to delete
1851
+ * @param {*} [options] Override http request option.
1852
+ * @throws {RequiredError}
1853
+ * @memberof OpenAIApi
1854
+ */
1855
+ deleteModel(model, options) {
1856
+ return (0, exports.OpenAIApiFp)(this.configuration).deleteModel(model, options).then((request) => request(this.axios, this.basePath));
1857
+ }
1858
+ /**
1859
+ *
1860
+ * @summary Returns the contents of the specified file
1861
+ * @param {string} fileId The ID of the file to use for this request
1862
+ * @param {*} [options] Override http request option.
1863
+ * @throws {RequiredError}
1864
+ * @memberof OpenAIApi
1865
+ */
1866
+ downloadFile(fileId, options) {
1867
+ return (0, exports.OpenAIApiFp)(this.configuration).downloadFile(fileId, options).then((request) => request(this.axios, this.basePath));
1868
+ }
1869
+ /**
1870
+ *
1871
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
1872
+ * @param {*} [options] Override http request option.
1873
+ * @deprecated
1874
+ * @throws {RequiredError}
1875
+ * @memberof OpenAIApi
1876
+ */
1877
+ listEngines(options) {
1878
+ return (0, exports.OpenAIApiFp)(this.configuration).listEngines(options).then((request) => request(this.axios, this.basePath));
1879
+ }
1880
+ /**
1881
+ *
1882
+ * @summary Returns a list of files that belong to the user\'s organization.
1883
+ * @param {*} [options] Override http request option.
1884
+ * @throws {RequiredError}
1885
+ * @memberof OpenAIApi
1886
+ */
1887
+ listFiles(options) {
1888
+ return (0, exports.OpenAIApiFp)(this.configuration).listFiles(options).then((request) => request(this.axios, this.basePath));
1889
+ }
1890
+ /**
1891
+ *
1892
+ * @summary Get fine-grained status updates for a fine-tune job.
1893
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1894
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a `data: [DONE]` message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
1895
+ * @param {*} [options] Override http request option.
1896
+ * @throws {RequiredError}
1897
+ * @memberof OpenAIApi
1898
+ */
1899
+ listFineTuneEvents(fineTuneId, stream, options) {
1900
+ return (0, exports.OpenAIApiFp)(this.configuration).listFineTuneEvents(fineTuneId, stream, options).then((request) => request(this.axios, this.basePath));
1901
+ }
1902
+ /**
1903
+ *
1904
+ * @summary List your organization\'s fine-tuning jobs
1905
+ * @param {*} [options] Override http request option.
1906
+ * @throws {RequiredError}
1907
+ * @memberof OpenAIApi
1908
+ */
1909
+ listFineTunes(options) {
1910
+ return (0, exports.OpenAIApiFp)(this.configuration).listFineTunes(options).then((request) => request(this.axios, this.basePath));
1911
+ }
1912
+ /**
1913
+ *
1914
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
1915
+ * @param {*} [options] Override http request option.
1916
+ * @throws {RequiredError}
1917
+ * @memberof OpenAIApi
1918
+ */
1919
+ listModels(options) {
1920
+ return (0, exports.OpenAIApiFp)(this.configuration).listModels(options).then((request) => request(this.axios, this.basePath));
1921
+ }
1922
+ /**
1923
+ *
1924
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
1925
+ * @param {string} engineId The ID of the engine to use for this request
1926
+ * @param {*} [options] Override http request option.
1927
+ * @deprecated
1928
+ * @throws {RequiredError}
1929
+ * @memberof OpenAIApi
1930
+ */
1931
+ retrieveEngine(engineId, options) {
1932
+ return (0, exports.OpenAIApiFp)(this.configuration).retrieveEngine(engineId, options).then((request) => request(this.axios, this.basePath));
1933
+ }
1934
+ /**
1935
+ *
1936
+ * @summary Returns information about a specific file.
1937
+ * @param {string} fileId The ID of the file to use for this request
1938
+ * @param {*} [options] Override http request option.
1939
+ * @throws {RequiredError}
1940
+ * @memberof OpenAIApi
1941
+ */
1942
+ retrieveFile(fileId, options) {
1943
+ return (0, exports.OpenAIApiFp)(this.configuration).retrieveFile(fileId, options).then((request) => request(this.axios, this.basePath));
1944
+ }
1945
+ /**
1946
+ *
1947
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1948
+ * @param {string} fineTuneId The ID of the fine-tune job
1949
+ * @param {*} [options] Override http request option.
1950
+ * @throws {RequiredError}
1951
+ * @memberof OpenAIApi
1952
+ */
1953
+ retrieveFineTune(fineTuneId, options) {
1954
+ return (0, exports.OpenAIApiFp)(this.configuration).retrieveFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
1955
+ }
1956
+ /**
1957
+ *
1958
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
1959
+ * @param {string} model The ID of the model to use for this request
1960
+ * @param {*} [options] Override http request option.
1961
+ * @throws {RequiredError}
1962
+ * @memberof OpenAIApi
1963
+ */
1964
+ retrieveModel(model, options) {
1965
+ return (0, exports.OpenAIApiFp)(this.configuration).retrieveModel(model, options).then((request) => request(this.axios, this.basePath));
1966
+ }
1967
+ }
1968
+ exports.OpenAIApi = OpenAIApi;