openai 2.0.5 → 3.0.1
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/.openapi-generator/VERSION +1 -1
- package/README.md +13 -3
- package/api.ts +728 -380
- package/base.ts +1 -1
- package/common.ts +23 -13
- package/configuration.ts +1 -1
- package/dist/api.d.ts +606 -319
- package/dist/api.js +248 -130
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +20 -14
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* OpenAI API
|
|
6
6
|
* APIs for sampling from and fine-tuning language models
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 1.0.
|
|
8
|
+
* The version of the OpenAPI document: 1.0.6
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -69,6 +69,7 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
69
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
70
|
* @param {CreateAnswerRequest} createAnswerRequest
|
|
71
71
|
* @param {*} [options] Override http request option.
|
|
72
|
+
* @deprecated
|
|
72
73
|
* @throws {RequiredError}
|
|
73
74
|
*/
|
|
74
75
|
createAnswer: (createAnswerRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -99,6 +100,7 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
99
100
|
* @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
101
|
* @param {CreateClassificationRequest} createClassificationRequest
|
|
101
102
|
* @param {*} [options] Override http request option.
|
|
103
|
+
* @deprecated
|
|
102
104
|
* @throws {RequiredError}
|
|
103
105
|
*/
|
|
104
106
|
createClassification: (createClassificationRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -126,48 +128,14 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
126
128
|
}),
|
|
127
129
|
/**
|
|
128
130
|
*
|
|
129
|
-
* @summary Creates a
|
|
130
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
131
|
+
* @summary Creates a completion for the provided prompt and parameters
|
|
131
132
|
* @param {CreateCompletionRequest} createCompletionRequest
|
|
132
133
|
* @param {*} [options] Override http request option.
|
|
133
134
|
* @throws {RequiredError}
|
|
134
135
|
*/
|
|
135
|
-
createCompletion: (
|
|
136
|
-
// verify required parameter 'engineId' is not null or undefined
|
|
137
|
-
common_1.assertParamExists('createCompletion', 'engineId', engineId);
|
|
136
|
+
createCompletion: (createCompletionRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
138
137
|
// verify required parameter 'createCompletionRequest' is not null or undefined
|
|
139
138
|
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
139
|
const localVarPath = `/completions`;
|
|
172
140
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
173
141
|
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -182,7 +150,7 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
182
150
|
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
183
151
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
184
152
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
185
|
-
localVarRequestOptions.data = common_1.serializeDataIfNeeded(
|
|
153
|
+
localVarRequestOptions.data = common_1.serializeDataIfNeeded(createCompletionRequest, localVarRequestOptions, configuration);
|
|
186
154
|
return {
|
|
187
155
|
url: common_1.toPathString(localVarUrlObj),
|
|
188
156
|
options: localVarRequestOptions,
|
|
@@ -191,18 +159,14 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
191
159
|
/**
|
|
192
160
|
*
|
|
193
161
|
* @summary Creates a new edit for the provided input, instruction, and parameters
|
|
194
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
195
162
|
* @param {CreateEditRequest} createEditRequest
|
|
196
163
|
* @param {*} [options] Override http request option.
|
|
197
164
|
* @throws {RequiredError}
|
|
198
165
|
*/
|
|
199
|
-
createEdit: (
|
|
200
|
-
// verify required parameter 'engineId' is not null or undefined
|
|
201
|
-
common_1.assertParamExists('createEdit', 'engineId', engineId);
|
|
166
|
+
createEdit: (createEditRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
202
167
|
// verify required parameter 'createEditRequest' is not null or undefined
|
|
203
168
|
common_1.assertParamExists('createEdit', 'createEditRequest', createEditRequest);
|
|
204
|
-
const localVarPath = `/
|
|
205
|
-
.replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
|
|
169
|
+
const localVarPath = `/edits`;
|
|
206
170
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
207
171
|
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
208
172
|
let baseOptions;
|
|
@@ -225,18 +189,14 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
225
189
|
/**
|
|
226
190
|
*
|
|
227
191
|
* @summary Creates an embedding vector representing the input text.
|
|
228
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
229
192
|
* @param {CreateEmbeddingRequest} createEmbeddingRequest
|
|
230
193
|
* @param {*} [options] Override http request option.
|
|
231
194
|
* @throws {RequiredError}
|
|
232
195
|
*/
|
|
233
|
-
createEmbedding: (
|
|
234
|
-
// verify required parameter 'engineId' is not null or undefined
|
|
235
|
-
common_1.assertParamExists('createEmbedding', 'engineId', engineId);
|
|
196
|
+
createEmbedding: (createEmbeddingRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
236
197
|
// verify required parameter 'createEmbeddingRequest' is not null or undefined
|
|
237
198
|
common_1.assertParamExists('createEmbedding', 'createEmbeddingRequest', createEmbeddingRequest);
|
|
238
|
-
const localVarPath = `/
|
|
239
|
-
.replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
|
|
199
|
+
const localVarPath = `/embeddings`;
|
|
240
200
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
241
201
|
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
242
202
|
let baseOptions;
|
|
@@ -259,8 +219,8 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
259
219
|
/**
|
|
260
220
|
*
|
|
261
221
|
* @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.
|
|
262
|
-
* @param {
|
|
263
|
-
* @param {string} purpose The intended purpose of the uploaded documents. Use \\\"
|
|
222
|
+
* @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).
|
|
223
|
+
* @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.
|
|
264
224
|
* @param {*} [options] Override http request option.
|
|
265
225
|
* @throws {RequiredError}
|
|
266
226
|
*/
|
|
@@ -326,12 +286,43 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
326
286
|
options: localVarRequestOptions,
|
|
327
287
|
};
|
|
328
288
|
}),
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
* @summary Classifies if text violates OpenAI\'s Content Policy
|
|
292
|
+
* @param {CreateModerationRequest} createModerationRequest
|
|
293
|
+
* @param {*} [options] Override http request option.
|
|
294
|
+
* @throws {RequiredError}
|
|
295
|
+
*/
|
|
296
|
+
createModeration: (createModerationRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
297
|
+
// verify required parameter 'createModerationRequest' is not null or undefined
|
|
298
|
+
common_1.assertParamExists('createModeration', 'createModerationRequest', createModerationRequest);
|
|
299
|
+
const localVarPath = `/moderations`;
|
|
300
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
301
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
302
|
+
let baseOptions;
|
|
303
|
+
if (configuration) {
|
|
304
|
+
baseOptions = configuration.baseOptions;
|
|
305
|
+
}
|
|
306
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
307
|
+
const localVarHeaderParameter = {};
|
|
308
|
+
const localVarQueryParameter = {};
|
|
309
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
310
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
311
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
312
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
313
|
+
localVarRequestOptions.data = common_1.serializeDataIfNeeded(createModerationRequest, localVarRequestOptions, configuration);
|
|
314
|
+
return {
|
|
315
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
316
|
+
options: localVarRequestOptions,
|
|
317
|
+
};
|
|
318
|
+
}),
|
|
329
319
|
/**
|
|
330
320
|
*
|
|
331
321
|
* @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.
|
|
332
322
|
* @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
|
|
333
323
|
* @param {CreateSearchRequest} createSearchRequest
|
|
334
324
|
* @param {*} [options] Override http request option.
|
|
325
|
+
* @deprecated
|
|
335
326
|
* @throws {RequiredError}
|
|
336
327
|
*/
|
|
337
328
|
createSearch: (engineId, createSearchRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -449,8 +440,9 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
449
440
|
}),
|
|
450
441
|
/**
|
|
451
442
|
*
|
|
452
|
-
* @summary Lists the currently available
|
|
443
|
+
* @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
|
|
453
444
|
* @param {*} [options] Override http request option.
|
|
445
|
+
* @deprecated
|
|
454
446
|
* @throws {RequiredError}
|
|
455
447
|
*/
|
|
456
448
|
listEngines: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -557,9 +549,35 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
557
549
|
}),
|
|
558
550
|
/**
|
|
559
551
|
*
|
|
560
|
-
* @summary
|
|
552
|
+
* @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
|
|
553
|
+
* @param {*} [options] Override http request option.
|
|
554
|
+
* @throws {RequiredError}
|
|
555
|
+
*/
|
|
556
|
+
listModels: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
557
|
+
const localVarPath = `/models`;
|
|
558
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
559
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
560
|
+
let baseOptions;
|
|
561
|
+
if (configuration) {
|
|
562
|
+
baseOptions = configuration.baseOptions;
|
|
563
|
+
}
|
|
564
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
565
|
+
const localVarHeaderParameter = {};
|
|
566
|
+
const localVarQueryParameter = {};
|
|
567
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
568
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
569
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
570
|
+
return {
|
|
571
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
572
|
+
options: localVarRequestOptions,
|
|
573
|
+
};
|
|
574
|
+
}),
|
|
575
|
+
/**
|
|
576
|
+
*
|
|
577
|
+
* @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
|
|
561
578
|
* @param {string} engineId The ID of the engine to use for this request
|
|
562
579
|
* @param {*} [options] Override http request option.
|
|
580
|
+
* @deprecated
|
|
563
581
|
* @throws {RequiredError}
|
|
564
582
|
*/
|
|
565
583
|
retrieveEngine: (engineId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -642,6 +660,35 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
|
|
|
642
660
|
options: localVarRequestOptions,
|
|
643
661
|
};
|
|
644
662
|
}),
|
|
663
|
+
/**
|
|
664
|
+
*
|
|
665
|
+
* @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
|
|
666
|
+
* @param {string} model The ID of the model to use for this request
|
|
667
|
+
* @param {*} [options] Override http request option.
|
|
668
|
+
* @throws {RequiredError}
|
|
669
|
+
*/
|
|
670
|
+
retrieveModel: (model, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
671
|
+
// verify required parameter 'model' is not null or undefined
|
|
672
|
+
common_1.assertParamExists('retrieveModel', '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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
682
|
+
const localVarHeaderParameter = {};
|
|
683
|
+
const localVarQueryParameter = {};
|
|
684
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
685
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
686
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
687
|
+
return {
|
|
688
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
689
|
+
options: localVarRequestOptions,
|
|
690
|
+
};
|
|
691
|
+
}),
|
|
645
692
|
};
|
|
646
693
|
};
|
|
647
694
|
/**
|
|
@@ -669,6 +716,7 @@ exports.OpenAIApiFp = function (configuration) {
|
|
|
669
716
|
* @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).
|
|
670
717
|
* @param {CreateAnswerRequest} createAnswerRequest
|
|
671
718
|
* @param {*} [options] Override http request option.
|
|
719
|
+
* @deprecated
|
|
672
720
|
* @throws {RequiredError}
|
|
673
721
|
*/
|
|
674
722
|
createAnswer(createAnswerRequest, options) {
|
|
@@ -682,6 +730,7 @@ exports.OpenAIApiFp = function (configuration) {
|
|
|
682
730
|
* @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.
|
|
683
731
|
* @param {CreateClassificationRequest} createClassificationRequest
|
|
684
732
|
* @param {*} [options] Override http request option.
|
|
733
|
+
* @deprecated
|
|
685
734
|
* @throws {RequiredError}
|
|
686
735
|
*/
|
|
687
736
|
createClassification(createClassificationRequest, options) {
|
|
@@ -692,64 +741,48 @@ exports.OpenAIApiFp = function (configuration) {
|
|
|
692
741
|
},
|
|
693
742
|
/**
|
|
694
743
|
*
|
|
695
|
-
* @summary Creates a
|
|
696
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
744
|
+
* @summary Creates a completion for the provided prompt and parameters
|
|
697
745
|
* @param {CreateCompletionRequest} createCompletionRequest
|
|
698
746
|
* @param {*} [options] Override http request option.
|
|
699
747
|
* @throws {RequiredError}
|
|
700
748
|
*/
|
|
701
|
-
createCompletion(
|
|
702
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
703
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.createCompletion(engineId, createCompletionRequest, options);
|
|
704
|
-
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
705
|
-
});
|
|
706
|
-
},
|
|
707
|
-
/**
|
|
708
|
-
*
|
|
709
|
-
* @summary Creates a completion using a fine-tuned model
|
|
710
|
-
* @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
|
|
711
|
-
* @param {*} [options] Override http request option.
|
|
712
|
-
* @throws {RequiredError}
|
|
713
|
-
*/
|
|
714
|
-
createCompletionFromModel(createCompletionFromModelRequest, options) {
|
|
749
|
+
createCompletion(createCompletionRequest, options) {
|
|
715
750
|
return __awaiter(this, void 0, void 0, function* () {
|
|
716
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
751
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createCompletion(createCompletionRequest, options);
|
|
717
752
|
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
718
753
|
});
|
|
719
754
|
},
|
|
720
755
|
/**
|
|
721
756
|
*
|
|
722
757
|
* @summary Creates a new edit for the provided input, instruction, and parameters
|
|
723
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
724
758
|
* @param {CreateEditRequest} createEditRequest
|
|
725
759
|
* @param {*} [options] Override http request option.
|
|
726
760
|
* @throws {RequiredError}
|
|
727
761
|
*/
|
|
728
|
-
createEdit(
|
|
762
|
+
createEdit(createEditRequest, options) {
|
|
729
763
|
return __awaiter(this, void 0, void 0, function* () {
|
|
730
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.createEdit(
|
|
764
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createEdit(createEditRequest, options);
|
|
731
765
|
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
732
766
|
});
|
|
733
767
|
},
|
|
734
768
|
/**
|
|
735
769
|
*
|
|
736
770
|
* @summary Creates an embedding vector representing the input text.
|
|
737
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
738
771
|
* @param {CreateEmbeddingRequest} createEmbeddingRequest
|
|
739
772
|
* @param {*} [options] Override http request option.
|
|
740
773
|
* @throws {RequiredError}
|
|
741
774
|
*/
|
|
742
|
-
createEmbedding(
|
|
775
|
+
createEmbedding(createEmbeddingRequest, options) {
|
|
743
776
|
return __awaiter(this, void 0, void 0, function* () {
|
|
744
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.createEmbedding(
|
|
777
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createEmbedding(createEmbeddingRequest, options);
|
|
745
778
|
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
746
779
|
});
|
|
747
780
|
},
|
|
748
781
|
/**
|
|
749
782
|
*
|
|
750
783
|
* @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.
|
|
751
|
-
* @param {
|
|
752
|
-
* @param {string} purpose The intended purpose of the uploaded documents. Use \\\"
|
|
784
|
+
* @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).
|
|
785
|
+
* @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.
|
|
753
786
|
* @param {*} [options] Override http request option.
|
|
754
787
|
* @throws {RequiredError}
|
|
755
788
|
*/
|
|
@@ -772,12 +805,26 @@ exports.OpenAIApiFp = function (configuration) {
|
|
|
772
805
|
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
773
806
|
});
|
|
774
807
|
},
|
|
808
|
+
/**
|
|
809
|
+
*
|
|
810
|
+
* @summary Classifies if text violates OpenAI\'s Content Policy
|
|
811
|
+
* @param {CreateModerationRequest} createModerationRequest
|
|
812
|
+
* @param {*} [options] Override http request option.
|
|
813
|
+
* @throws {RequiredError}
|
|
814
|
+
*/
|
|
815
|
+
createModeration(createModerationRequest, options) {
|
|
816
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
817
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createModeration(createModerationRequest, options);
|
|
818
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
819
|
+
});
|
|
820
|
+
},
|
|
775
821
|
/**
|
|
776
822
|
*
|
|
777
823
|
* @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.
|
|
778
824
|
* @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
|
|
779
825
|
* @param {CreateSearchRequest} createSearchRequest
|
|
780
826
|
* @param {*} [options] Override http request option.
|
|
827
|
+
* @deprecated
|
|
781
828
|
* @throws {RequiredError}
|
|
782
829
|
*/
|
|
783
830
|
createSearch(engineId, createSearchRequest, options) {
|
|
@@ -827,8 +874,9 @@ exports.OpenAIApiFp = function (configuration) {
|
|
|
827
874
|
},
|
|
828
875
|
/**
|
|
829
876
|
*
|
|
830
|
-
* @summary Lists the currently available
|
|
877
|
+
* @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
|
|
831
878
|
* @param {*} [options] Override http request option.
|
|
879
|
+
* @deprecated
|
|
832
880
|
* @throws {RequiredError}
|
|
833
881
|
*/
|
|
834
882
|
listEngines(options) {
|
|
@@ -877,9 +925,22 @@ exports.OpenAIApiFp = function (configuration) {
|
|
|
877
925
|
},
|
|
878
926
|
/**
|
|
879
927
|
*
|
|
880
|
-
* @summary
|
|
928
|
+
* @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
|
|
929
|
+
* @param {*} [options] Override http request option.
|
|
930
|
+
* @throws {RequiredError}
|
|
931
|
+
*/
|
|
932
|
+
listModels(options) {
|
|
933
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
934
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listModels(options);
|
|
935
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
936
|
+
});
|
|
937
|
+
},
|
|
938
|
+
/**
|
|
939
|
+
*
|
|
940
|
+
* @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
|
|
881
941
|
* @param {string} engineId The ID of the engine to use for this request
|
|
882
942
|
* @param {*} [options] Override http request option.
|
|
943
|
+
* @deprecated
|
|
883
944
|
* @throws {RequiredError}
|
|
884
945
|
*/
|
|
885
946
|
retrieveEngine(engineId, options) {
|
|
@@ -914,6 +975,19 @@ exports.OpenAIApiFp = function (configuration) {
|
|
|
914
975
|
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
915
976
|
});
|
|
916
977
|
},
|
|
978
|
+
/**
|
|
979
|
+
*
|
|
980
|
+
* @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
|
|
981
|
+
* @param {string} model The ID of the model to use for this request
|
|
982
|
+
* @param {*} [options] Override http request option.
|
|
983
|
+
* @throws {RequiredError}
|
|
984
|
+
*/
|
|
985
|
+
retrieveModel(model, options) {
|
|
986
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
987
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.retrieveModel(model, options);
|
|
988
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
989
|
+
});
|
|
990
|
+
},
|
|
917
991
|
};
|
|
918
992
|
};
|
|
919
993
|
/**
|
|
@@ -938,6 +1012,7 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
|
|
|
938
1012
|
* @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).
|
|
939
1013
|
* @param {CreateAnswerRequest} createAnswerRequest
|
|
940
1014
|
* @param {*} [options] Override http request option.
|
|
1015
|
+
* @deprecated
|
|
941
1016
|
* @throws {RequiredError}
|
|
942
1017
|
*/
|
|
943
1018
|
createAnswer(createAnswerRequest, options) {
|
|
@@ -948,6 +1023,7 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
|
|
|
948
1023
|
* @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.
|
|
949
1024
|
* @param {CreateClassificationRequest} createClassificationRequest
|
|
950
1025
|
* @param {*} [options] Override http request option.
|
|
1026
|
+
* @deprecated
|
|
951
1027
|
* @throws {RequiredError}
|
|
952
1028
|
*/
|
|
953
1029
|
createClassification(createClassificationRequest, options) {
|
|
@@ -955,52 +1031,39 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
|
|
|
955
1031
|
},
|
|
956
1032
|
/**
|
|
957
1033
|
*
|
|
958
|
-
* @summary Creates a
|
|
959
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
1034
|
+
* @summary Creates a completion for the provided prompt and parameters
|
|
960
1035
|
* @param {CreateCompletionRequest} createCompletionRequest
|
|
961
1036
|
* @param {*} [options] Override http request option.
|
|
962
1037
|
* @throws {RequiredError}
|
|
963
1038
|
*/
|
|
964
|
-
createCompletion(
|
|
965
|
-
return localVarFp.createCompletion(
|
|
966
|
-
},
|
|
967
|
-
/**
|
|
968
|
-
*
|
|
969
|
-
* @summary Creates a completion using a fine-tuned model
|
|
970
|
-
* @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
|
|
971
|
-
* @param {*} [options] Override http request option.
|
|
972
|
-
* @throws {RequiredError}
|
|
973
|
-
*/
|
|
974
|
-
createCompletionFromModel(createCompletionFromModelRequest, options) {
|
|
975
|
-
return localVarFp.createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(axios, basePath));
|
|
1039
|
+
createCompletion(createCompletionRequest, options) {
|
|
1040
|
+
return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios, basePath));
|
|
976
1041
|
},
|
|
977
1042
|
/**
|
|
978
1043
|
*
|
|
979
1044
|
* @summary Creates a new edit for the provided input, instruction, and parameters
|
|
980
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
981
1045
|
* @param {CreateEditRequest} createEditRequest
|
|
982
1046
|
* @param {*} [options] Override http request option.
|
|
983
1047
|
* @throws {RequiredError}
|
|
984
1048
|
*/
|
|
985
|
-
createEdit(
|
|
986
|
-
return localVarFp.createEdit(
|
|
1049
|
+
createEdit(createEditRequest, options) {
|
|
1050
|
+
return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios, basePath));
|
|
987
1051
|
},
|
|
988
1052
|
/**
|
|
989
1053
|
*
|
|
990
1054
|
* @summary Creates an embedding vector representing the input text.
|
|
991
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
992
1055
|
* @param {CreateEmbeddingRequest} createEmbeddingRequest
|
|
993
1056
|
* @param {*} [options] Override http request option.
|
|
994
1057
|
* @throws {RequiredError}
|
|
995
1058
|
*/
|
|
996
|
-
createEmbedding(
|
|
997
|
-
return localVarFp.createEmbedding(
|
|
1059
|
+
createEmbedding(createEmbeddingRequest, options) {
|
|
1060
|
+
return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios, basePath));
|
|
998
1061
|
},
|
|
999
1062
|
/**
|
|
1000
1063
|
*
|
|
1001
1064
|
* @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.
|
|
1002
|
-
* @param {
|
|
1003
|
-
* @param {string} purpose The intended purpose of the uploaded documents. Use \\\"
|
|
1065
|
+
* @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).
|
|
1066
|
+
* @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.
|
|
1004
1067
|
* @param {*} [options] Override http request option.
|
|
1005
1068
|
* @throws {RequiredError}
|
|
1006
1069
|
*/
|
|
@@ -1017,12 +1080,23 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
|
|
|
1017
1080
|
createFineTune(createFineTuneRequest, options) {
|
|
1018
1081
|
return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios, basePath));
|
|
1019
1082
|
},
|
|
1083
|
+
/**
|
|
1084
|
+
*
|
|
1085
|
+
* @summary Classifies if text violates OpenAI\'s Content Policy
|
|
1086
|
+
* @param {CreateModerationRequest} createModerationRequest
|
|
1087
|
+
* @param {*} [options] Override http request option.
|
|
1088
|
+
* @throws {RequiredError}
|
|
1089
|
+
*/
|
|
1090
|
+
createModeration(createModerationRequest, options) {
|
|
1091
|
+
return localVarFp.createModeration(createModerationRequest, options).then((request) => request(axios, basePath));
|
|
1092
|
+
},
|
|
1020
1093
|
/**
|
|
1021
1094
|
*
|
|
1022
1095
|
* @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.
|
|
1023
1096
|
* @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
|
|
1024
1097
|
* @param {CreateSearchRequest} createSearchRequest
|
|
1025
1098
|
* @param {*} [options] Override http request option.
|
|
1099
|
+
* @deprecated
|
|
1026
1100
|
* @throws {RequiredError}
|
|
1027
1101
|
*/
|
|
1028
1102
|
createSearch(engineId, createSearchRequest, options) {
|
|
@@ -1060,8 +1134,9 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
|
|
|
1060
1134
|
},
|
|
1061
1135
|
/**
|
|
1062
1136
|
*
|
|
1063
|
-
* @summary Lists the currently available
|
|
1137
|
+
* @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
|
|
1064
1138
|
* @param {*} [options] Override http request option.
|
|
1139
|
+
* @deprecated
|
|
1065
1140
|
* @throws {RequiredError}
|
|
1066
1141
|
*/
|
|
1067
1142
|
listEngines(options) {
|
|
@@ -1098,9 +1173,19 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
|
|
|
1098
1173
|
},
|
|
1099
1174
|
/**
|
|
1100
1175
|
*
|
|
1101
|
-
* @summary
|
|
1176
|
+
* @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
|
|
1177
|
+
* @param {*} [options] Override http request option.
|
|
1178
|
+
* @throws {RequiredError}
|
|
1179
|
+
*/
|
|
1180
|
+
listModels(options) {
|
|
1181
|
+
return localVarFp.listModels(options).then((request) => request(axios, basePath));
|
|
1182
|
+
},
|
|
1183
|
+
/**
|
|
1184
|
+
*
|
|
1185
|
+
* @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
|
|
1102
1186
|
* @param {string} engineId The ID of the engine to use for this request
|
|
1103
1187
|
* @param {*} [options] Override http request option.
|
|
1188
|
+
* @deprecated
|
|
1104
1189
|
* @throws {RequiredError}
|
|
1105
1190
|
*/
|
|
1106
1191
|
retrieveEngine(engineId, options) {
|
|
@@ -1126,6 +1211,16 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
|
|
|
1126
1211
|
retrieveFineTune(fineTuneId, options) {
|
|
1127
1212
|
return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios, basePath));
|
|
1128
1213
|
},
|
|
1214
|
+
/**
|
|
1215
|
+
*
|
|
1216
|
+
* @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
|
|
1217
|
+
* @param {string} model The ID of the model to use for this request
|
|
1218
|
+
* @param {*} [options] Override http request option.
|
|
1219
|
+
* @throws {RequiredError}
|
|
1220
|
+
*/
|
|
1221
|
+
retrieveModel(model, options) {
|
|
1222
|
+
return localVarFp.retrieveModel(model, options).then((request) => request(axios, basePath));
|
|
1223
|
+
},
|
|
1129
1224
|
};
|
|
1130
1225
|
};
|
|
1131
1226
|
/**
|
|
@@ -1151,6 +1246,7 @@ class OpenAIApi extends base_1.BaseAPI {
|
|
|
1151
1246
|
* @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).
|
|
1152
1247
|
* @param {CreateAnswerRequest} createAnswerRequest
|
|
1153
1248
|
* @param {*} [options] Override http request option.
|
|
1249
|
+
* @deprecated
|
|
1154
1250
|
* @throws {RequiredError}
|
|
1155
1251
|
* @memberof OpenAIApi
|
|
1156
1252
|
*/
|
|
@@ -1162,6 +1258,7 @@ class OpenAIApi extends base_1.BaseAPI {
|
|
|
1162
1258
|
* @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.
|
|
1163
1259
|
* @param {CreateClassificationRequest} createClassificationRequest
|
|
1164
1260
|
* @param {*} [options] Override http request option.
|
|
1261
|
+
* @deprecated
|
|
1165
1262
|
* @throws {RequiredError}
|
|
1166
1263
|
* @memberof OpenAIApi
|
|
1167
1264
|
*/
|
|
@@ -1170,56 +1267,42 @@ class OpenAIApi extends base_1.BaseAPI {
|
|
|
1170
1267
|
}
|
|
1171
1268
|
/**
|
|
1172
1269
|
*
|
|
1173
|
-
* @summary Creates a
|
|
1174
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
1270
|
+
* @summary Creates a completion for the provided prompt and parameters
|
|
1175
1271
|
* @param {CreateCompletionRequest} createCompletionRequest
|
|
1176
1272
|
* @param {*} [options] Override http request option.
|
|
1177
1273
|
* @throws {RequiredError}
|
|
1178
1274
|
* @memberof OpenAIApi
|
|
1179
1275
|
*/
|
|
1180
|
-
createCompletion(
|
|
1181
|
-
return exports.OpenAIApiFp(this.configuration).createCompletion(
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
*
|
|
1185
|
-
* @summary Creates a completion using a fine-tuned model
|
|
1186
|
-
* @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
|
|
1187
|
-
* @param {*} [options] Override http request option.
|
|
1188
|
-
* @throws {RequiredError}
|
|
1189
|
-
* @memberof OpenAIApi
|
|
1190
|
-
*/
|
|
1191
|
-
createCompletionFromModel(createCompletionFromModelRequest, options) {
|
|
1192
|
-
return exports.OpenAIApiFp(this.configuration).createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1276
|
+
createCompletion(createCompletionRequest, options) {
|
|
1277
|
+
return exports.OpenAIApiFp(this.configuration).createCompletion(createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1193
1278
|
}
|
|
1194
1279
|
/**
|
|
1195
1280
|
*
|
|
1196
1281
|
* @summary Creates a new edit for the provided input, instruction, and parameters
|
|
1197
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
1198
1282
|
* @param {CreateEditRequest} createEditRequest
|
|
1199
1283
|
* @param {*} [options] Override http request option.
|
|
1200
1284
|
* @throws {RequiredError}
|
|
1201
1285
|
* @memberof OpenAIApi
|
|
1202
1286
|
*/
|
|
1203
|
-
createEdit(
|
|
1204
|
-
return exports.OpenAIApiFp(this.configuration).createEdit(
|
|
1287
|
+
createEdit(createEditRequest, options) {
|
|
1288
|
+
return exports.OpenAIApiFp(this.configuration).createEdit(createEditRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1205
1289
|
}
|
|
1206
1290
|
/**
|
|
1207
1291
|
*
|
|
1208
1292
|
* @summary Creates an embedding vector representing the input text.
|
|
1209
|
-
* @param {string} engineId The ID of the engine to use for this request
|
|
1210
1293
|
* @param {CreateEmbeddingRequest} createEmbeddingRequest
|
|
1211
1294
|
* @param {*} [options] Override http request option.
|
|
1212
1295
|
* @throws {RequiredError}
|
|
1213
1296
|
* @memberof OpenAIApi
|
|
1214
1297
|
*/
|
|
1215
|
-
createEmbedding(
|
|
1216
|
-
return exports.OpenAIApiFp(this.configuration).createEmbedding(
|
|
1298
|
+
createEmbedding(createEmbeddingRequest, options) {
|
|
1299
|
+
return exports.OpenAIApiFp(this.configuration).createEmbedding(createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1217
1300
|
}
|
|
1218
1301
|
/**
|
|
1219
1302
|
*
|
|
1220
1303
|
* @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.
|
|
1221
|
-
* @param {
|
|
1222
|
-
* @param {string} purpose The intended purpose of the uploaded documents. Use \\\"
|
|
1304
|
+
* @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).
|
|
1305
|
+
* @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.
|
|
1223
1306
|
* @param {*} [options] Override http request option.
|
|
1224
1307
|
* @throws {RequiredError}
|
|
1225
1308
|
* @memberof OpenAIApi
|
|
@@ -1238,12 +1321,24 @@ class OpenAIApi extends base_1.BaseAPI {
|
|
|
1238
1321
|
createFineTune(createFineTuneRequest, options) {
|
|
1239
1322
|
return exports.OpenAIApiFp(this.configuration).createFineTune(createFineTuneRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1240
1323
|
}
|
|
1324
|
+
/**
|
|
1325
|
+
*
|
|
1326
|
+
* @summary Classifies if text violates OpenAI\'s Content Policy
|
|
1327
|
+
* @param {CreateModerationRequest} createModerationRequest
|
|
1328
|
+
* @param {*} [options] Override http request option.
|
|
1329
|
+
* @throws {RequiredError}
|
|
1330
|
+
* @memberof OpenAIApi
|
|
1331
|
+
*/
|
|
1332
|
+
createModeration(createModerationRequest, options) {
|
|
1333
|
+
return exports.OpenAIApiFp(this.configuration).createModeration(createModerationRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1334
|
+
}
|
|
1241
1335
|
/**
|
|
1242
1336
|
*
|
|
1243
1337
|
* @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.
|
|
1244
1338
|
* @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
|
|
1245
1339
|
* @param {CreateSearchRequest} createSearchRequest
|
|
1246
1340
|
* @param {*} [options] Override http request option.
|
|
1341
|
+
* @deprecated
|
|
1247
1342
|
* @throws {RequiredError}
|
|
1248
1343
|
* @memberof OpenAIApi
|
|
1249
1344
|
*/
|
|
@@ -1285,8 +1380,9 @@ class OpenAIApi extends base_1.BaseAPI {
|
|
|
1285
1380
|
}
|
|
1286
1381
|
/**
|
|
1287
1382
|
*
|
|
1288
|
-
* @summary Lists the currently available
|
|
1383
|
+
* @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
|
|
1289
1384
|
* @param {*} [options] Override http request option.
|
|
1385
|
+
* @deprecated
|
|
1290
1386
|
* @throws {RequiredError}
|
|
1291
1387
|
* @memberof OpenAIApi
|
|
1292
1388
|
*/
|
|
@@ -1327,9 +1423,20 @@ class OpenAIApi extends base_1.BaseAPI {
|
|
|
1327
1423
|
}
|
|
1328
1424
|
/**
|
|
1329
1425
|
*
|
|
1330
|
-
* @summary
|
|
1426
|
+
* @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
|
|
1427
|
+
* @param {*} [options] Override http request option.
|
|
1428
|
+
* @throws {RequiredError}
|
|
1429
|
+
* @memberof OpenAIApi
|
|
1430
|
+
*/
|
|
1431
|
+
listModels(options) {
|
|
1432
|
+
return exports.OpenAIApiFp(this.configuration).listModels(options).then((request) => request(this.axios, this.basePath));
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
*
|
|
1436
|
+
* @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
|
|
1331
1437
|
* @param {string} engineId The ID of the engine to use for this request
|
|
1332
1438
|
* @param {*} [options] Override http request option.
|
|
1439
|
+
* @deprecated
|
|
1333
1440
|
* @throws {RequiredError}
|
|
1334
1441
|
* @memberof OpenAIApi
|
|
1335
1442
|
*/
|
|
@@ -1358,5 +1465,16 @@ class OpenAIApi extends base_1.BaseAPI {
|
|
|
1358
1465
|
retrieveFineTune(fineTuneId, options) {
|
|
1359
1466
|
return exports.OpenAIApiFp(this.configuration).retrieveFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
|
|
1360
1467
|
}
|
|
1468
|
+
/**
|
|
1469
|
+
*
|
|
1470
|
+
* @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
|
|
1471
|
+
* @param {string} model The ID of the model to use for this request
|
|
1472
|
+
* @param {*} [options] Override http request option.
|
|
1473
|
+
* @throws {RequiredError}
|
|
1474
|
+
* @memberof OpenAIApi
|
|
1475
|
+
*/
|
|
1476
|
+
retrieveModel(model, options) {
|
|
1477
|
+
return exports.OpenAIApiFp(this.configuration).retrieveModel(model, options).then((request) => request(this.axios, this.basePath));
|
|
1478
|
+
}
|
|
1361
1479
|
}
|
|
1362
1480
|
exports.OpenAIApi = OpenAIApi;
|