openai 1.1.1 → 2.0.2

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.
package/dist/api.js ADDED
@@ -0,0 +1,1228 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * OpenAI API
6
+ * APIs for sampling from and fine-tuning language models
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.OpenAIApi = exports.OpenAIApiFactory = exports.OpenAIApiFp = exports.OpenAIApiAxiosParamCreator = void 0;
26
+ const axios_1 = require("axios");
27
+ // Some imports not used depending on template conditions
28
+ // @ts-ignore
29
+ const common_1 = require("./common");
30
+ // @ts-ignore
31
+ const base_1 = require("./base");
32
+ /**
33
+ * OpenAIApi - axios parameter creator
34
+ * @export
35
+ */
36
+ exports.OpenAIApiAxiosParamCreator = function (configuration) {
37
+ return {
38
+ /**
39
+ *
40
+ * @summary Immediately cancel a fine-tune job.
41
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ */
45
+ cancelFineTune: (fineTuneId, options = {}) => __awaiter(this, void 0, void 0, function* () {
46
+ // verify required parameter 'fineTuneId' is not null or undefined
47
+ common_1.assertParamExists('cancelFineTune', 'fineTuneId', fineTuneId);
48
+ const localVarPath = `/fine-tunes/{fine_tune_id}/cancel`
49
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
50
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
51
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
52
+ let baseOptions;
53
+ if (configuration) {
54
+ baseOptions = configuration.baseOptions;
55
+ }
56
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
57
+ const localVarHeaderParameter = {};
58
+ const localVarQueryParameter = {};
59
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
60
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
61
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
62
+ return {
63
+ url: common_1.toPathString(localVarUrlObj),
64
+ options: localVarRequestOptions,
65
+ };
66
+ }),
67
+ /**
68
+ *
69
+ * @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).
70
+ * @param {CreateAnswerRequest} createAnswerRequest
71
+ * @param {*} [options] Override http request option.
72
+ * @throws {RequiredError}
73
+ */
74
+ createAnswer: (createAnswerRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
75
+ // verify required parameter 'createAnswerRequest' is not null or undefined
76
+ common_1.assertParamExists('createAnswer', 'createAnswerRequest', createAnswerRequest);
77
+ const localVarPath = `/answers`;
78
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
79
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
80
+ let baseOptions;
81
+ if (configuration) {
82
+ baseOptions = configuration.baseOptions;
83
+ }
84
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
85
+ const localVarHeaderParameter = {};
86
+ const localVarQueryParameter = {};
87
+ localVarHeaderParameter['Content-Type'] = 'application/json';
88
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
89
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
90
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
91
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createAnswerRequest, localVarRequestOptions, configuration);
92
+ return {
93
+ url: common_1.toPathString(localVarUrlObj),
94
+ options: localVarRequestOptions,
95
+ };
96
+ }),
97
+ /**
98
+ *
99
+ * @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.
100
+ * @param {CreateClassificationRequest} createClassificationRequest
101
+ * @param {*} [options] Override http request option.
102
+ * @throws {RequiredError}
103
+ */
104
+ createClassification: (createClassificationRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
105
+ // verify required parameter 'createClassificationRequest' is not null or undefined
106
+ common_1.assertParamExists('createClassification', 'createClassificationRequest', createClassificationRequest);
107
+ const localVarPath = `/classifications`;
108
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
109
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
110
+ let baseOptions;
111
+ if (configuration) {
112
+ baseOptions = configuration.baseOptions;
113
+ }
114
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
115
+ const localVarHeaderParameter = {};
116
+ const localVarQueryParameter = {};
117
+ localVarHeaderParameter['Content-Type'] = 'application/json';
118
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
119
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
120
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
121
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createClassificationRequest, localVarRequestOptions, configuration);
122
+ return {
123
+ url: common_1.toPathString(localVarUrlObj),
124
+ options: localVarRequestOptions,
125
+ };
126
+ }),
127
+ /**
128
+ *
129
+ * @summary Creates a new completion for the provided prompt and parameters
130
+ * @param {string} engineId The ID of the engine to use for this request
131
+ * @param {CreateCompletionRequest} createCompletionRequest
132
+ * @param {*} [options] Override http request option.
133
+ * @throws {RequiredError}
134
+ */
135
+ createCompletion: (engineId, createCompletionRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
136
+ // verify required parameter 'engineId' is not null or undefined
137
+ common_1.assertParamExists('createCompletion', 'engineId', engineId);
138
+ // verify required parameter 'createCompletionRequest' is not null or undefined
139
+ common_1.assertParamExists('createCompletion', 'createCompletionRequest', createCompletionRequest);
140
+ const localVarPath = `/engines/{engine_id}/completions`
141
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
149
+ const localVarHeaderParameter = {};
150
+ const localVarQueryParameter = {};
151
+ localVarHeaderParameter['Content-Type'] = 'application/json';
152
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
153
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
154
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
155
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createCompletionRequest, localVarRequestOptions, configuration);
156
+ return {
157
+ url: common_1.toPathString(localVarUrlObj),
158
+ options: localVarRequestOptions,
159
+ };
160
+ }),
161
+ /**
162
+ *
163
+ * @summary Creates a completion using a fine-tuned model
164
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
165
+ * @param {*} [options] Override http request option.
166
+ * @throws {RequiredError}
167
+ */
168
+ createCompletionFromModel: (createCompletionFromModelRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
169
+ // verify required parameter 'createCompletionFromModelRequest' is not null or undefined
170
+ common_1.assertParamExists('createCompletionFromModel', 'createCompletionFromModelRequest', createCompletionFromModelRequest);
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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
179
+ const localVarHeaderParameter = {};
180
+ const localVarQueryParameter = {};
181
+ localVarHeaderParameter['Content-Type'] = 'application/json';
182
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
183
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
184
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
185
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createCompletionFromModelRequest, localVarRequestOptions, configuration);
186
+ return {
187
+ url: common_1.toPathString(localVarUrlObj),
188
+ options: localVarRequestOptions,
189
+ };
190
+ }),
191
+ /**
192
+ *
193
+ * @summary Creates an embedding vector representing the input text.
194
+ * @param {string} engineId The ID of the engine to use for this request
195
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
196
+ * @param {*} [options] Override http request option.
197
+ * @throws {RequiredError}
198
+ */
199
+ createEmbedding: (engineId, createEmbeddingRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
200
+ // verify required parameter 'engineId' is not null or undefined
201
+ common_1.assertParamExists('createEmbedding', 'engineId', engineId);
202
+ // verify required parameter 'createEmbeddingRequest' is not null or undefined
203
+ common_1.assertParamExists('createEmbedding', 'createEmbeddingRequest', createEmbeddingRequest);
204
+ const localVarPath = `/engines/{engine_id}/embeddings`
205
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
206
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
207
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
208
+ let baseOptions;
209
+ if (configuration) {
210
+ baseOptions = configuration.baseOptions;
211
+ }
212
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
213
+ const localVarHeaderParameter = {};
214
+ const localVarQueryParameter = {};
215
+ localVarHeaderParameter['Content-Type'] = 'application/json';
216
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
217
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
218
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
219
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createEmbeddingRequest, localVarRequestOptions, configuration);
220
+ return {
221
+ url: common_1.toPathString(localVarUrlObj),
222
+ options: localVarRequestOptions,
223
+ };
224
+ }),
225
+ /**
226
+ *
227
+ * @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.
228
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"search\\\" or \\\"answers\\\", each line is a JSON record with a \\\"text\\\" field and an optional \\\"metadata\\\" field. Only \\\"text\\\" field will be used for search. Specially, when the `purpose` is \\\"answers\\\", \\\"\\\\n\\\" is used as a delimiter to chunk contents in the \\\"text\\\" field into multiple documents for finer-grained matching. If the `purpose` is set to \\\"classifications\\\", each line is a JSON record representing a single training example with \\\"text\\\" and \\\"label\\\" fields along with an optional \\\"metadata\\\" field. 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).
229
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"search\\\" for [Search](/docs/api-reference/searches), \\\"answers\\\" for [Answers](/docs/api-reference/answers), \\\"classifications\\\" for [Classifications](/docs/api-reference/classifications) and \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
230
+ * @param {*} [options] Override http request option.
231
+ * @throws {RequiredError}
232
+ */
233
+ createFile: (file, purpose, options = {}) => __awaiter(this, void 0, void 0, function* () {
234
+ // verify required parameter 'file' is not null or undefined
235
+ common_1.assertParamExists('createFile', 'file', file);
236
+ // verify required parameter 'purpose' is not null or undefined
237
+ common_1.assertParamExists('createFile', 'purpose', purpose);
238
+ const localVarPath = `/files`;
239
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
240
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
241
+ let baseOptions;
242
+ if (configuration) {
243
+ baseOptions = configuration.baseOptions;
244
+ }
245
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
246
+ const localVarHeaderParameter = {};
247
+ const localVarQueryParameter = {};
248
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
249
+ if (file !== undefined) {
250
+ localVarFormParams.append('file', file);
251
+ }
252
+ if (purpose !== undefined) {
253
+ localVarFormParams.append('purpose', purpose);
254
+ }
255
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
256
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
257
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
258
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), localVarFormParams.getHeaders()), headersFromBaseOptions), options.headers);
259
+ localVarRequestOptions.data = localVarFormParams;
260
+ return {
261
+ url: common_1.toPathString(localVarUrlObj),
262
+ options: localVarRequestOptions,
263
+ };
264
+ }),
265
+ /**
266
+ *
267
+ * @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)
268
+ * @param {CreateFineTuneRequest} createFineTuneRequest
269
+ * @param {*} [options] Override http request option.
270
+ * @throws {RequiredError}
271
+ */
272
+ createFineTune: (createFineTuneRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
273
+ // verify required parameter 'createFineTuneRequest' is not null or undefined
274
+ common_1.assertParamExists('createFineTune', 'createFineTuneRequest', createFineTuneRequest);
275
+ const localVarPath = `/fine-tunes`;
276
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
277
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
278
+ let baseOptions;
279
+ if (configuration) {
280
+ baseOptions = configuration.baseOptions;
281
+ }
282
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
283
+ const localVarHeaderParameter = {};
284
+ const localVarQueryParameter = {};
285
+ localVarHeaderParameter['Content-Type'] = 'application/json';
286
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
287
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
288
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
289
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createFineTuneRequest, localVarRequestOptions, configuration);
290
+ return {
291
+ url: common_1.toPathString(localVarUrlObj),
292
+ options: localVarRequestOptions,
293
+ };
294
+ }),
295
+ /**
296
+ *
297
+ * @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.
298
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
299
+ * @param {CreateSearchRequest} createSearchRequest
300
+ * @param {*} [options] Override http request option.
301
+ * @throws {RequiredError}
302
+ */
303
+ createSearch: (engineId, createSearchRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
304
+ // verify required parameter 'engineId' is not null or undefined
305
+ common_1.assertParamExists('createSearch', 'engineId', engineId);
306
+ // verify required parameter 'createSearchRequest' is not null or undefined
307
+ common_1.assertParamExists('createSearch', 'createSearchRequest', createSearchRequest);
308
+ const localVarPath = `/engines/{engine_id}/search`
309
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
310
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
311
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
312
+ let baseOptions;
313
+ if (configuration) {
314
+ baseOptions = configuration.baseOptions;
315
+ }
316
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
317
+ const localVarHeaderParameter = {};
318
+ const localVarQueryParameter = {};
319
+ localVarHeaderParameter['Content-Type'] = 'application/json';
320
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
321
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
322
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
323
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createSearchRequest, localVarRequestOptions, configuration);
324
+ return {
325
+ url: common_1.toPathString(localVarUrlObj),
326
+ options: localVarRequestOptions,
327
+ };
328
+ }),
329
+ /**
330
+ *
331
+ * @summary Delete a file.
332
+ * @param {string} fileId The ID of the file to use for this request
333
+ * @param {*} [options] Override http request option.
334
+ * @throws {RequiredError}
335
+ */
336
+ deleteFile: (fileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
337
+ // verify required parameter 'fileId' is not null or undefined
338
+ common_1.assertParamExists('deleteFile', 'fileId', fileId);
339
+ const localVarPath = `/files/{file_id}`
340
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
341
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
342
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
343
+ let baseOptions;
344
+ if (configuration) {
345
+ baseOptions = configuration.baseOptions;
346
+ }
347
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
348
+ const localVarHeaderParameter = {};
349
+ const localVarQueryParameter = {};
350
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
351
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
352
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
353
+ return {
354
+ url: common_1.toPathString(localVarUrlObj),
355
+ options: localVarRequestOptions,
356
+ };
357
+ }),
358
+ /**
359
+ *
360
+ * @summary Returns the contents of the specified file
361
+ * @param {string} fileId The ID of the file to use for this request
362
+ * @param {*} [options] Override http request option.
363
+ * @throws {RequiredError}
364
+ */
365
+ downloadFile: (fileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
366
+ // verify required parameter 'fileId' is not null or undefined
367
+ common_1.assertParamExists('downloadFile', 'fileId', fileId);
368
+ const localVarPath = `/files/{file_id}/content`
369
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
377
+ const localVarHeaderParameter = {};
378
+ const localVarQueryParameter = {};
379
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
380
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
381
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
382
+ return {
383
+ url: common_1.toPathString(localVarUrlObj),
384
+ options: localVarRequestOptions,
385
+ };
386
+ }),
387
+ /**
388
+ *
389
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
390
+ * @param {*} [options] Override http request option.
391
+ * @throws {RequiredError}
392
+ */
393
+ listEngines: (options = {}) => __awaiter(this, void 0, void 0, function* () {
394
+ const localVarPath = `/engines`;
395
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
396
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
397
+ let baseOptions;
398
+ if (configuration) {
399
+ baseOptions = configuration.baseOptions;
400
+ }
401
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
402
+ const localVarHeaderParameter = {};
403
+ const localVarQueryParameter = {};
404
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
405
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
406
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
407
+ return {
408
+ url: common_1.toPathString(localVarUrlObj),
409
+ options: localVarRequestOptions,
410
+ };
411
+ }),
412
+ /**
413
+ *
414
+ * @summary Returns a list of files that belong to the user\'s organization.
415
+ * @param {*} [options] Override http request option.
416
+ * @throws {RequiredError}
417
+ */
418
+ listFiles: (options = {}) => __awaiter(this, void 0, void 0, function* () {
419
+ const localVarPath = `/files`;
420
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
421
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
422
+ let baseOptions;
423
+ if (configuration) {
424
+ baseOptions = configuration.baseOptions;
425
+ }
426
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
427
+ const localVarHeaderParameter = {};
428
+ const localVarQueryParameter = {};
429
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
430
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
431
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
432
+ return {
433
+ url: common_1.toPathString(localVarUrlObj),
434
+ options: localVarRequestOptions,
435
+ };
436
+ }),
437
+ /**
438
+ *
439
+ * @summary Get fine-grained status updates for a fine-tune job.
440
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
441
+ * @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.
442
+ * @param {*} [options] Override http request option.
443
+ * @throws {RequiredError}
444
+ */
445
+ listFineTuneEvents: (fineTuneId, stream, options = {}) => __awaiter(this, void 0, void 0, function* () {
446
+ // verify required parameter 'fineTuneId' is not null or undefined
447
+ common_1.assertParamExists('listFineTuneEvents', 'fineTuneId', fineTuneId);
448
+ const localVarPath = `/fine-tunes/{fine_tune_id}/events`
449
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
450
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
451
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
452
+ let baseOptions;
453
+ if (configuration) {
454
+ baseOptions = configuration.baseOptions;
455
+ }
456
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
457
+ const localVarHeaderParameter = {};
458
+ const localVarQueryParameter = {};
459
+ if (stream !== undefined) {
460
+ localVarQueryParameter['stream'] = stream;
461
+ }
462
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
463
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
464
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
465
+ return {
466
+ url: common_1.toPathString(localVarUrlObj),
467
+ options: localVarRequestOptions,
468
+ };
469
+ }),
470
+ /**
471
+ *
472
+ * @summary List your organization\'s fine-tuning jobs
473
+ * @param {*} [options] Override http request option.
474
+ * @throws {RequiredError}
475
+ */
476
+ listFineTunes: (options = {}) => __awaiter(this, void 0, void 0, function* () {
477
+ const localVarPath = `/fine-tunes`;
478
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
479
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
480
+ let baseOptions;
481
+ if (configuration) {
482
+ baseOptions = configuration.baseOptions;
483
+ }
484
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
485
+ const localVarHeaderParameter = {};
486
+ const localVarQueryParameter = {};
487
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
488
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
489
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
490
+ return {
491
+ url: common_1.toPathString(localVarUrlObj),
492
+ options: localVarRequestOptions,
493
+ };
494
+ }),
495
+ /**
496
+ *
497
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
498
+ * @param {string} engineId The ID of the engine to use for this request
499
+ * @param {*} [options] Override http request option.
500
+ * @throws {RequiredError}
501
+ */
502
+ retrieveEngine: (engineId, options = {}) => __awaiter(this, void 0, void 0, function* () {
503
+ // verify required parameter 'engineId' is not null or undefined
504
+ common_1.assertParamExists('retrieveEngine', 'engineId', engineId);
505
+ const localVarPath = `/engines/{engine_id}`
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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
514
+ const localVarHeaderParameter = {};
515
+ const localVarQueryParameter = {};
516
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
517
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
518
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
519
+ return {
520
+ url: common_1.toPathString(localVarUrlObj),
521
+ options: localVarRequestOptions,
522
+ };
523
+ }),
524
+ /**
525
+ *
526
+ * @summary Returns information about a specific file.
527
+ * @param {string} fileId The ID of the file to use for this request
528
+ * @param {*} [options] Override http request option.
529
+ * @throws {RequiredError}
530
+ */
531
+ retrieveFile: (fileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
532
+ // verify required parameter 'fileId' is not null or undefined
533
+ common_1.assertParamExists('retrieveFile', 'fileId', fileId);
534
+ const localVarPath = `/files/{file_id}`
535
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
536
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
537
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
538
+ let baseOptions;
539
+ if (configuration) {
540
+ baseOptions = configuration.baseOptions;
541
+ }
542
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
543
+ const localVarHeaderParameter = {};
544
+ const localVarQueryParameter = {};
545
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
546
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
547
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
548
+ return {
549
+ url: common_1.toPathString(localVarUrlObj),
550
+ options: localVarRequestOptions,
551
+ };
552
+ }),
553
+ /**
554
+ *
555
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
556
+ * @param {string} fineTuneId The ID of the fine-tune job
557
+ * @param {*} [options] Override http request option.
558
+ * @throws {RequiredError}
559
+ */
560
+ retrieveFineTune: (fineTuneId, options = {}) => __awaiter(this, void 0, void 0, function* () {
561
+ // verify required parameter 'fineTuneId' is not null or undefined
562
+ common_1.assertParamExists('retrieveFineTune', 'fineTuneId', fineTuneId);
563
+ const localVarPath = `/fine-tunes/{fine_tune_id}`
564
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
565
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
566
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
567
+ let baseOptions;
568
+ if (configuration) {
569
+ baseOptions = configuration.baseOptions;
570
+ }
571
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
572
+ const localVarHeaderParameter = {};
573
+ const localVarQueryParameter = {};
574
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
575
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
576
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
577
+ return {
578
+ url: common_1.toPathString(localVarUrlObj),
579
+ options: localVarRequestOptions,
580
+ };
581
+ }),
582
+ };
583
+ };
584
+ /**
585
+ * OpenAIApi - functional programming interface
586
+ * @export
587
+ */
588
+ exports.OpenAIApiFp = function (configuration) {
589
+ const localVarAxiosParamCreator = exports.OpenAIApiAxiosParamCreator(configuration);
590
+ return {
591
+ /**
592
+ *
593
+ * @summary Immediately cancel a fine-tune job.
594
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
595
+ * @param {*} [options] Override http request option.
596
+ * @throws {RequiredError}
597
+ */
598
+ cancelFineTune(fineTuneId, options) {
599
+ return __awaiter(this, void 0, void 0, function* () {
600
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelFineTune(fineTuneId, options);
601
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
602
+ });
603
+ },
604
+ /**
605
+ *
606
+ * @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).
607
+ * @param {CreateAnswerRequest} createAnswerRequest
608
+ * @param {*} [options] Override http request option.
609
+ * @throws {RequiredError}
610
+ */
611
+ createAnswer(createAnswerRequest, options) {
612
+ return __awaiter(this, void 0, void 0, function* () {
613
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createAnswer(createAnswerRequest, options);
614
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
615
+ });
616
+ },
617
+ /**
618
+ *
619
+ * @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.
620
+ * @param {CreateClassificationRequest} createClassificationRequest
621
+ * @param {*} [options] Override http request option.
622
+ * @throws {RequiredError}
623
+ */
624
+ createClassification(createClassificationRequest, options) {
625
+ return __awaiter(this, void 0, void 0, function* () {
626
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createClassification(createClassificationRequest, options);
627
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
628
+ });
629
+ },
630
+ /**
631
+ *
632
+ * @summary Creates a new completion for the provided prompt and parameters
633
+ * @param {string} engineId The ID of the engine to use for this request
634
+ * @param {CreateCompletionRequest} createCompletionRequest
635
+ * @param {*} [options] Override http request option.
636
+ * @throws {RequiredError}
637
+ */
638
+ createCompletion(engineId, createCompletionRequest, options) {
639
+ return __awaiter(this, void 0, void 0, function* () {
640
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createCompletion(engineId, createCompletionRequest, options);
641
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
642
+ });
643
+ },
644
+ /**
645
+ *
646
+ * @summary Creates a completion using a fine-tuned model
647
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
648
+ * @param {*} [options] Override http request option.
649
+ * @throws {RequiredError}
650
+ */
651
+ createCompletionFromModel(createCompletionFromModelRequest, options) {
652
+ return __awaiter(this, void 0, void 0, function* () {
653
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createCompletionFromModel(createCompletionFromModelRequest, options);
654
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
655
+ });
656
+ },
657
+ /**
658
+ *
659
+ * @summary Creates an embedding vector representing the input text.
660
+ * @param {string} engineId The ID of the engine to use for this request
661
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
662
+ * @param {*} [options] Override http request option.
663
+ * @throws {RequiredError}
664
+ */
665
+ createEmbedding(engineId, createEmbeddingRequest, options) {
666
+ return __awaiter(this, void 0, void 0, function* () {
667
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createEmbedding(engineId, createEmbeddingRequest, options);
668
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
669
+ });
670
+ },
671
+ /**
672
+ *
673
+ * @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.
674
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"search\\\" or \\\"answers\\\", each line is a JSON record with a \\\"text\\\" field and an optional \\\"metadata\\\" field. Only \\\"text\\\" field will be used for search. Specially, when the `purpose` is \\\"answers\\\", \\\"\\\\n\\\" is used as a delimiter to chunk contents in the \\\"text\\\" field into multiple documents for finer-grained matching. If the `purpose` is set to \\\"classifications\\\", each line is a JSON record representing a single training example with \\\"text\\\" and \\\"label\\\" fields along with an optional \\\"metadata\\\" field. 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).
675
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"search\\\" for [Search](/docs/api-reference/searches), \\\"answers\\\" for [Answers](/docs/api-reference/answers), \\\"classifications\\\" for [Classifications](/docs/api-reference/classifications) and \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
676
+ * @param {*} [options] Override http request option.
677
+ * @throws {RequiredError}
678
+ */
679
+ createFile(file, purpose, options) {
680
+ return __awaiter(this, void 0, void 0, function* () {
681
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createFile(file, purpose, options);
682
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
683
+ });
684
+ },
685
+ /**
686
+ *
687
+ * @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)
688
+ * @param {CreateFineTuneRequest} createFineTuneRequest
689
+ * @param {*} [options] Override http request option.
690
+ * @throws {RequiredError}
691
+ */
692
+ createFineTune(createFineTuneRequest, options) {
693
+ return __awaiter(this, void 0, void 0, function* () {
694
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createFineTune(createFineTuneRequest, options);
695
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
696
+ });
697
+ },
698
+ /**
699
+ *
700
+ * @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.
701
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
702
+ * @param {CreateSearchRequest} createSearchRequest
703
+ * @param {*} [options] Override http request option.
704
+ * @throws {RequiredError}
705
+ */
706
+ createSearch(engineId, createSearchRequest, options) {
707
+ return __awaiter(this, void 0, void 0, function* () {
708
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createSearch(engineId, createSearchRequest, options);
709
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
710
+ });
711
+ },
712
+ /**
713
+ *
714
+ * @summary Delete a file.
715
+ * @param {string} fileId The ID of the file to use for this request
716
+ * @param {*} [options] Override http request option.
717
+ * @throws {RequiredError}
718
+ */
719
+ deleteFile(fileId, options) {
720
+ return __awaiter(this, void 0, void 0, function* () {
721
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteFile(fileId, options);
722
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
723
+ });
724
+ },
725
+ /**
726
+ *
727
+ * @summary Returns the contents of the specified file
728
+ * @param {string} fileId The ID of the file to use for this request
729
+ * @param {*} [options] Override http request option.
730
+ * @throws {RequiredError}
731
+ */
732
+ downloadFile(fileId, options) {
733
+ return __awaiter(this, void 0, void 0, function* () {
734
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.downloadFile(fileId, options);
735
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
736
+ });
737
+ },
738
+ /**
739
+ *
740
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
741
+ * @param {*} [options] Override http request option.
742
+ * @throws {RequiredError}
743
+ */
744
+ listEngines(options) {
745
+ return __awaiter(this, void 0, void 0, function* () {
746
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listEngines(options);
747
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
748
+ });
749
+ },
750
+ /**
751
+ *
752
+ * @summary Returns a list of files that belong to the user\'s organization.
753
+ * @param {*} [options] Override http request option.
754
+ * @throws {RequiredError}
755
+ */
756
+ listFiles(options) {
757
+ return __awaiter(this, void 0, void 0, function* () {
758
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listFiles(options);
759
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
760
+ });
761
+ },
762
+ /**
763
+ *
764
+ * @summary Get fine-grained status updates for a fine-tune job.
765
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
766
+ * @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.
767
+ * @param {*} [options] Override http request option.
768
+ * @throws {RequiredError}
769
+ */
770
+ listFineTuneEvents(fineTuneId, stream, options) {
771
+ return __awaiter(this, void 0, void 0, function* () {
772
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listFineTuneEvents(fineTuneId, stream, options);
773
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
774
+ });
775
+ },
776
+ /**
777
+ *
778
+ * @summary List your organization\'s fine-tuning jobs
779
+ * @param {*} [options] Override http request option.
780
+ * @throws {RequiredError}
781
+ */
782
+ listFineTunes(options) {
783
+ return __awaiter(this, void 0, void 0, function* () {
784
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listFineTunes(options);
785
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
786
+ });
787
+ },
788
+ /**
789
+ *
790
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
791
+ * @param {string} engineId The ID of the engine to use for this request
792
+ * @param {*} [options] Override http request option.
793
+ * @throws {RequiredError}
794
+ */
795
+ retrieveEngine(engineId, options) {
796
+ return __awaiter(this, void 0, void 0, function* () {
797
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.retrieveEngine(engineId, options);
798
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
799
+ });
800
+ },
801
+ /**
802
+ *
803
+ * @summary Returns information about a specific file.
804
+ * @param {string} fileId The ID of the file to use for this request
805
+ * @param {*} [options] Override http request option.
806
+ * @throws {RequiredError}
807
+ */
808
+ retrieveFile(fileId, options) {
809
+ return __awaiter(this, void 0, void 0, function* () {
810
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.retrieveFile(fileId, options);
811
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
812
+ });
813
+ },
814
+ /**
815
+ *
816
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
817
+ * @param {string} fineTuneId The ID of the fine-tune job
818
+ * @param {*} [options] Override http request option.
819
+ * @throws {RequiredError}
820
+ */
821
+ retrieveFineTune(fineTuneId, options) {
822
+ return __awaiter(this, void 0, void 0, function* () {
823
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.retrieveFineTune(fineTuneId, options);
824
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
825
+ });
826
+ },
827
+ };
828
+ };
829
+ /**
830
+ * OpenAIApi - factory interface
831
+ * @export
832
+ */
833
+ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
834
+ const localVarFp = exports.OpenAIApiFp(configuration);
835
+ return {
836
+ /**
837
+ *
838
+ * @summary Immediately cancel a fine-tune job.
839
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
840
+ * @param {*} [options] Override http request option.
841
+ * @throws {RequiredError}
842
+ */
843
+ cancelFineTune(fineTuneId, options) {
844
+ return localVarFp.cancelFineTune(fineTuneId, options).then((request) => request(axios, basePath));
845
+ },
846
+ /**
847
+ *
848
+ * @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).
849
+ * @param {CreateAnswerRequest} createAnswerRequest
850
+ * @param {*} [options] Override http request option.
851
+ * @throws {RequiredError}
852
+ */
853
+ createAnswer(createAnswerRequest, options) {
854
+ return localVarFp.createAnswer(createAnswerRequest, options).then((request) => request(axios, basePath));
855
+ },
856
+ /**
857
+ *
858
+ * @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.
859
+ * @param {CreateClassificationRequest} createClassificationRequest
860
+ * @param {*} [options] Override http request option.
861
+ * @throws {RequiredError}
862
+ */
863
+ createClassification(createClassificationRequest, options) {
864
+ return localVarFp.createClassification(createClassificationRequest, options).then((request) => request(axios, basePath));
865
+ },
866
+ /**
867
+ *
868
+ * @summary Creates a new completion for the provided prompt and parameters
869
+ * @param {string} engineId The ID of the engine to use for this request
870
+ * @param {CreateCompletionRequest} createCompletionRequest
871
+ * @param {*} [options] Override http request option.
872
+ * @throws {RequiredError}
873
+ */
874
+ createCompletion(engineId, createCompletionRequest, options) {
875
+ return localVarFp.createCompletion(engineId, createCompletionRequest, options).then((request) => request(axios, basePath));
876
+ },
877
+ /**
878
+ *
879
+ * @summary Creates a completion using a fine-tuned model
880
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
881
+ * @param {*} [options] Override http request option.
882
+ * @throws {RequiredError}
883
+ */
884
+ createCompletionFromModel(createCompletionFromModelRequest, options) {
885
+ return localVarFp.createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(axios, basePath));
886
+ },
887
+ /**
888
+ *
889
+ * @summary Creates an embedding vector representing the input text.
890
+ * @param {string} engineId The ID of the engine to use for this request
891
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
892
+ * @param {*} [options] Override http request option.
893
+ * @throws {RequiredError}
894
+ */
895
+ createEmbedding(engineId, createEmbeddingRequest, options) {
896
+ return localVarFp.createEmbedding(engineId, createEmbeddingRequest, options).then((request) => request(axios, basePath));
897
+ },
898
+ /**
899
+ *
900
+ * @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.
901
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"search\\\" or \\\"answers\\\", each line is a JSON record with a \\\"text\\\" field and an optional \\\"metadata\\\" field. Only \\\"text\\\" field will be used for search. Specially, when the `purpose` is \\\"answers\\\", \\\"\\\\n\\\" is used as a delimiter to chunk contents in the \\\"text\\\" field into multiple documents for finer-grained matching. If the `purpose` is set to \\\"classifications\\\", each line is a JSON record representing a single training example with \\\"text\\\" and \\\"label\\\" fields along with an optional \\\"metadata\\\" field. 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).
902
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"search\\\" for [Search](/docs/api-reference/searches), \\\"answers\\\" for [Answers](/docs/api-reference/answers), \\\"classifications\\\" for [Classifications](/docs/api-reference/classifications) and \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
903
+ * @param {*} [options] Override http request option.
904
+ * @throws {RequiredError}
905
+ */
906
+ createFile(file, purpose, options) {
907
+ return localVarFp.createFile(file, purpose, options).then((request) => request(axios, basePath));
908
+ },
909
+ /**
910
+ *
911
+ * @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)
912
+ * @param {CreateFineTuneRequest} createFineTuneRequest
913
+ * @param {*} [options] Override http request option.
914
+ * @throws {RequiredError}
915
+ */
916
+ createFineTune(createFineTuneRequest, options) {
917
+ return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios, basePath));
918
+ },
919
+ /**
920
+ *
921
+ * @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.
922
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
923
+ * @param {CreateSearchRequest} createSearchRequest
924
+ * @param {*} [options] Override http request option.
925
+ * @throws {RequiredError}
926
+ */
927
+ createSearch(engineId, createSearchRequest, options) {
928
+ return localVarFp.createSearch(engineId, createSearchRequest, options).then((request) => request(axios, basePath));
929
+ },
930
+ /**
931
+ *
932
+ * @summary Delete a file.
933
+ * @param {string} fileId The ID of the file to use for this request
934
+ * @param {*} [options] Override http request option.
935
+ * @throws {RequiredError}
936
+ */
937
+ deleteFile(fileId, options) {
938
+ return localVarFp.deleteFile(fileId, options).then((request) => request(axios, basePath));
939
+ },
940
+ /**
941
+ *
942
+ * @summary Returns the contents of the specified file
943
+ * @param {string} fileId The ID of the file to use for this request
944
+ * @param {*} [options] Override http request option.
945
+ * @throws {RequiredError}
946
+ */
947
+ downloadFile(fileId, options) {
948
+ return localVarFp.downloadFile(fileId, options).then((request) => request(axios, basePath));
949
+ },
950
+ /**
951
+ *
952
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
953
+ * @param {*} [options] Override http request option.
954
+ * @throws {RequiredError}
955
+ */
956
+ listEngines(options) {
957
+ return localVarFp.listEngines(options).then((request) => request(axios, basePath));
958
+ },
959
+ /**
960
+ *
961
+ * @summary Returns a list of files that belong to the user\'s organization.
962
+ * @param {*} [options] Override http request option.
963
+ * @throws {RequiredError}
964
+ */
965
+ listFiles(options) {
966
+ return localVarFp.listFiles(options).then((request) => request(axios, basePath));
967
+ },
968
+ /**
969
+ *
970
+ * @summary Get fine-grained status updates for a fine-tune job.
971
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
972
+ * @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.
973
+ * @param {*} [options] Override http request option.
974
+ * @throws {RequiredError}
975
+ */
976
+ listFineTuneEvents(fineTuneId, stream, options) {
977
+ return localVarFp.listFineTuneEvents(fineTuneId, stream, options).then((request) => request(axios, basePath));
978
+ },
979
+ /**
980
+ *
981
+ * @summary List your organization\'s fine-tuning jobs
982
+ * @param {*} [options] Override http request option.
983
+ * @throws {RequiredError}
984
+ */
985
+ listFineTunes(options) {
986
+ return localVarFp.listFineTunes(options).then((request) => request(axios, basePath));
987
+ },
988
+ /**
989
+ *
990
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
991
+ * @param {string} engineId The ID of the engine to use for this request
992
+ * @param {*} [options] Override http request option.
993
+ * @throws {RequiredError}
994
+ */
995
+ retrieveEngine(engineId, options) {
996
+ return localVarFp.retrieveEngine(engineId, options).then((request) => request(axios, basePath));
997
+ },
998
+ /**
999
+ *
1000
+ * @summary Returns information about a specific file.
1001
+ * @param {string} fileId The ID of the file to use for this request
1002
+ * @param {*} [options] Override http request option.
1003
+ * @throws {RequiredError}
1004
+ */
1005
+ retrieveFile(fileId, options) {
1006
+ return localVarFp.retrieveFile(fileId, options).then((request) => request(axios, basePath));
1007
+ },
1008
+ /**
1009
+ *
1010
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1011
+ * @param {string} fineTuneId The ID of the fine-tune job
1012
+ * @param {*} [options] Override http request option.
1013
+ * @throws {RequiredError}
1014
+ */
1015
+ retrieveFineTune(fineTuneId, options) {
1016
+ return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios, basePath));
1017
+ },
1018
+ };
1019
+ };
1020
+ /**
1021
+ * OpenAIApi - object-oriented interface
1022
+ * @export
1023
+ * @class OpenAIApi
1024
+ * @extends {BaseAPI}
1025
+ */
1026
+ class OpenAIApi extends base_1.BaseAPI {
1027
+ /**
1028
+ *
1029
+ * @summary Immediately cancel a fine-tune job.
1030
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1031
+ * @param {*} [options] Override http request option.
1032
+ * @throws {RequiredError}
1033
+ * @memberof OpenAIApi
1034
+ */
1035
+ cancelFineTune(fineTuneId, options) {
1036
+ return exports.OpenAIApiFp(this.configuration).cancelFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
1037
+ }
1038
+ /**
1039
+ *
1040
+ * @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).
1041
+ * @param {CreateAnswerRequest} createAnswerRequest
1042
+ * @param {*} [options] Override http request option.
1043
+ * @throws {RequiredError}
1044
+ * @memberof OpenAIApi
1045
+ */
1046
+ createAnswer(createAnswerRequest, options) {
1047
+ return exports.OpenAIApiFp(this.configuration).createAnswer(createAnswerRequest, options).then((request) => request(this.axios, this.basePath));
1048
+ }
1049
+ /**
1050
+ *
1051
+ * @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.
1052
+ * @param {CreateClassificationRequest} createClassificationRequest
1053
+ * @param {*} [options] Override http request option.
1054
+ * @throws {RequiredError}
1055
+ * @memberof OpenAIApi
1056
+ */
1057
+ createClassification(createClassificationRequest, options) {
1058
+ return exports.OpenAIApiFp(this.configuration).createClassification(createClassificationRequest, options).then((request) => request(this.axios, this.basePath));
1059
+ }
1060
+ /**
1061
+ *
1062
+ * @summary Creates a new completion for the provided prompt and parameters
1063
+ * @param {string} engineId The ID of the engine to use for this request
1064
+ * @param {CreateCompletionRequest} createCompletionRequest
1065
+ * @param {*} [options] Override http request option.
1066
+ * @throws {RequiredError}
1067
+ * @memberof OpenAIApi
1068
+ */
1069
+ createCompletion(engineId, createCompletionRequest, options) {
1070
+ return exports.OpenAIApiFp(this.configuration).createCompletion(engineId, createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
1071
+ }
1072
+ /**
1073
+ *
1074
+ * @summary Creates a completion using a fine-tuned model
1075
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
1076
+ * @param {*} [options] Override http request option.
1077
+ * @throws {RequiredError}
1078
+ * @memberof OpenAIApi
1079
+ */
1080
+ createCompletionFromModel(createCompletionFromModelRequest, options) {
1081
+ return exports.OpenAIApiFp(this.configuration).createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(this.axios, this.basePath));
1082
+ }
1083
+ /**
1084
+ *
1085
+ * @summary Creates an embedding vector representing the input text.
1086
+ * @param {string} engineId The ID of the engine to use for this request
1087
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1088
+ * @param {*} [options] Override http request option.
1089
+ * @throws {RequiredError}
1090
+ * @memberof OpenAIApi
1091
+ */
1092
+ createEmbedding(engineId, createEmbeddingRequest, options) {
1093
+ return exports.OpenAIApiFp(this.configuration).createEmbedding(engineId, createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
1094
+ }
1095
+ /**
1096
+ *
1097
+ * @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.
1098
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the `purpose` is set to \\\"search\\\" or \\\"answers\\\", each line is a JSON record with a \\\"text\\\" field and an optional \\\"metadata\\\" field. Only \\\"text\\\" field will be used for search. Specially, when the `purpose` is \\\"answers\\\", \\\"\\\\n\\\" is used as a delimiter to chunk contents in the \\\"text\\\" field into multiple documents for finer-grained matching. If the `purpose` is set to \\\"classifications\\\", each line is a JSON record representing a single training example with \\\"text\\\" and \\\"label\\\" fields along with an optional \\\"metadata\\\" field. 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).
1099
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\"search\\\" for [Search](/docs/api-reference/searches), \\\"answers\\\" for [Answers](/docs/api-reference/answers), \\\"classifications\\\" for [Classifications](/docs/api-reference/classifications) and \\\"fine-tune\\\" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
1100
+ * @param {*} [options] Override http request option.
1101
+ * @throws {RequiredError}
1102
+ * @memberof OpenAIApi
1103
+ */
1104
+ createFile(file, purpose, options) {
1105
+ return exports.OpenAIApiFp(this.configuration).createFile(file, purpose, options).then((request) => request(this.axios, this.basePath));
1106
+ }
1107
+ /**
1108
+ *
1109
+ * @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)
1110
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1111
+ * @param {*} [options] Override http request option.
1112
+ * @throws {RequiredError}
1113
+ * @memberof OpenAIApi
1114
+ */
1115
+ createFineTune(createFineTuneRequest, options) {
1116
+ return exports.OpenAIApiFp(this.configuration).createFineTune(createFineTuneRequest, options).then((request) => request(this.axios, this.basePath));
1117
+ }
1118
+ /**
1119
+ *
1120
+ * @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.
1121
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
1122
+ * @param {CreateSearchRequest} createSearchRequest
1123
+ * @param {*} [options] Override http request option.
1124
+ * @throws {RequiredError}
1125
+ * @memberof OpenAIApi
1126
+ */
1127
+ createSearch(engineId, createSearchRequest, options) {
1128
+ return exports.OpenAIApiFp(this.configuration).createSearch(engineId, createSearchRequest, options).then((request) => request(this.axios, this.basePath));
1129
+ }
1130
+ /**
1131
+ *
1132
+ * @summary Delete a file.
1133
+ * @param {string} fileId The ID of the file to use for this request
1134
+ * @param {*} [options] Override http request option.
1135
+ * @throws {RequiredError}
1136
+ * @memberof OpenAIApi
1137
+ */
1138
+ deleteFile(fileId, options) {
1139
+ return exports.OpenAIApiFp(this.configuration).deleteFile(fileId, options).then((request) => request(this.axios, this.basePath));
1140
+ }
1141
+ /**
1142
+ *
1143
+ * @summary Returns the contents of the specified file
1144
+ * @param {string} fileId The ID of the file to use for this request
1145
+ * @param {*} [options] Override http request option.
1146
+ * @throws {RequiredError}
1147
+ * @memberof OpenAIApi
1148
+ */
1149
+ downloadFile(fileId, options) {
1150
+ return exports.OpenAIApiFp(this.configuration).downloadFile(fileId, options).then((request) => request(this.axios, this.basePath));
1151
+ }
1152
+ /**
1153
+ *
1154
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1155
+ * @param {*} [options] Override http request option.
1156
+ * @throws {RequiredError}
1157
+ * @memberof OpenAIApi
1158
+ */
1159
+ listEngines(options) {
1160
+ return exports.OpenAIApiFp(this.configuration).listEngines(options).then((request) => request(this.axios, this.basePath));
1161
+ }
1162
+ /**
1163
+ *
1164
+ * @summary Returns a list of files that belong to the user\'s organization.
1165
+ * @param {*} [options] Override http request option.
1166
+ * @throws {RequiredError}
1167
+ * @memberof OpenAIApi
1168
+ */
1169
+ listFiles(options) {
1170
+ return exports.OpenAIApiFp(this.configuration).listFiles(options).then((request) => request(this.axios, this.basePath));
1171
+ }
1172
+ /**
1173
+ *
1174
+ * @summary Get fine-grained status updates for a fine-tune job.
1175
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1176
+ * @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.
1177
+ * @param {*} [options] Override http request option.
1178
+ * @throws {RequiredError}
1179
+ * @memberof OpenAIApi
1180
+ */
1181
+ listFineTuneEvents(fineTuneId, stream, options) {
1182
+ return exports.OpenAIApiFp(this.configuration).listFineTuneEvents(fineTuneId, stream, options).then((request) => request(this.axios, this.basePath));
1183
+ }
1184
+ /**
1185
+ *
1186
+ * @summary List your organization\'s fine-tuning jobs
1187
+ * @param {*} [options] Override http request option.
1188
+ * @throws {RequiredError}
1189
+ * @memberof OpenAIApi
1190
+ */
1191
+ listFineTunes(options) {
1192
+ return exports.OpenAIApiFp(this.configuration).listFineTunes(options).then((request) => request(this.axios, this.basePath));
1193
+ }
1194
+ /**
1195
+ *
1196
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1197
+ * @param {string} engineId The ID of the engine to use for this request
1198
+ * @param {*} [options] Override http request option.
1199
+ * @throws {RequiredError}
1200
+ * @memberof OpenAIApi
1201
+ */
1202
+ retrieveEngine(engineId, options) {
1203
+ return exports.OpenAIApiFp(this.configuration).retrieveEngine(engineId, options).then((request) => request(this.axios, this.basePath));
1204
+ }
1205
+ /**
1206
+ *
1207
+ * @summary Returns information about a specific file.
1208
+ * @param {string} fileId The ID of the file to use for this request
1209
+ * @param {*} [options] Override http request option.
1210
+ * @throws {RequiredError}
1211
+ * @memberof OpenAIApi
1212
+ */
1213
+ retrieveFile(fileId, options) {
1214
+ return exports.OpenAIApiFp(this.configuration).retrieveFile(fileId, options).then((request) => request(this.axios, this.basePath));
1215
+ }
1216
+ /**
1217
+ *
1218
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1219
+ * @param {string} fineTuneId The ID of the fine-tune job
1220
+ * @param {*} [options] Override http request option.
1221
+ * @throws {RequiredError}
1222
+ * @memberof OpenAIApi
1223
+ */
1224
+ retrieveFineTune(fineTuneId, options) {
1225
+ return exports.OpenAIApiFp(this.configuration).retrieveFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
1226
+ }
1227
+ }
1228
+ exports.OpenAIApi = OpenAIApi;