openai 2.0.5 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.4
8
+ * The version of the OpenAPI document: 1.0.5
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 new completion for the provided prompt and parameters
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: (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);
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(createCompletionFromModelRequest, localVarRequestOptions, configuration);
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: (engineId, createEditRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
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 = `/engines/{engine_id}/edits`
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: (engineId, createEmbeddingRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
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 = `/engines/{engine_id}/embeddings`
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 {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).
263
- * @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.
222
+ * @param {any} 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
  */
@@ -332,6 +292,7 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
332
292
  * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
333
293
  * @param {CreateSearchRequest} createSearchRequest
334
294
  * @param {*} [options] Override http request option.
295
+ * @deprecated
335
296
  * @throws {RequiredError}
336
297
  */
337
298
  createSearch: (engineId, createSearchRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
@@ -449,8 +410,9 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
449
410
  }),
450
411
  /**
451
412
  *
452
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
413
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
453
414
  * @param {*} [options] Override http request option.
415
+ * @deprecated
454
416
  * @throws {RequiredError}
455
417
  */
456
418
  listEngines: (options = {}) => __awaiter(this, void 0, void 0, function* () {
@@ -557,9 +519,35 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
557
519
  }),
558
520
  /**
559
521
  *
560
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
522
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
523
+ * @param {*} [options] Override http request option.
524
+ * @throws {RequiredError}
525
+ */
526
+ listModels: (options = {}) => __awaiter(this, void 0, void 0, function* () {
527
+ const localVarPath = `/models`;
528
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
529
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
530
+ let baseOptions;
531
+ if (configuration) {
532
+ baseOptions = configuration.baseOptions;
533
+ }
534
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
535
+ const localVarHeaderParameter = {};
536
+ const localVarQueryParameter = {};
537
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
538
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
539
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
540
+ return {
541
+ url: common_1.toPathString(localVarUrlObj),
542
+ options: localVarRequestOptions,
543
+ };
544
+ }),
545
+ /**
546
+ *
547
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
561
548
  * @param {string} engineId The ID of the engine to use for this request
562
549
  * @param {*} [options] Override http request option.
550
+ * @deprecated
563
551
  * @throws {RequiredError}
564
552
  */
565
553
  retrieveEngine: (engineId, options = {}) => __awaiter(this, void 0, void 0, function* () {
@@ -642,6 +630,35 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
642
630
  options: localVarRequestOptions,
643
631
  };
644
632
  }),
633
+ /**
634
+ *
635
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
636
+ * @param {string} model The ID of the model to use for this request
637
+ * @param {*} [options] Override http request option.
638
+ * @throws {RequiredError}
639
+ */
640
+ retrieveModel: (model, options = {}) => __awaiter(this, void 0, void 0, function* () {
641
+ // verify required parameter 'model' is not null or undefined
642
+ common_1.assertParamExists('retrieveModel', 'model', model);
643
+ const localVarPath = `/models/{model}`
644
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
645
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
646
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
647
+ let baseOptions;
648
+ if (configuration) {
649
+ baseOptions = configuration.baseOptions;
650
+ }
651
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
652
+ const localVarHeaderParameter = {};
653
+ const localVarQueryParameter = {};
654
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
655
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
656
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
657
+ return {
658
+ url: common_1.toPathString(localVarUrlObj),
659
+ options: localVarRequestOptions,
660
+ };
661
+ }),
645
662
  };
646
663
  };
647
664
  /**
@@ -669,6 +686,7 @@ exports.OpenAIApiFp = function (configuration) {
669
686
  * @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
687
  * @param {CreateAnswerRequest} createAnswerRequest
671
688
  * @param {*} [options] Override http request option.
689
+ * @deprecated
672
690
  * @throws {RequiredError}
673
691
  */
674
692
  createAnswer(createAnswerRequest, options) {
@@ -682,6 +700,7 @@ exports.OpenAIApiFp = function (configuration) {
682
700
  * @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
701
  * @param {CreateClassificationRequest} createClassificationRequest
684
702
  * @param {*} [options] Override http request option.
703
+ * @deprecated
685
704
  * @throws {RequiredError}
686
705
  */
687
706
  createClassification(createClassificationRequest, options) {
@@ -692,64 +711,48 @@ exports.OpenAIApiFp = function (configuration) {
692
711
  },
693
712
  /**
694
713
  *
695
- * @summary Creates a new completion for the provided prompt and parameters
696
- * @param {string} engineId The ID of the engine to use for this request
714
+ * @summary Creates a completion for the provided prompt and parameters
697
715
  * @param {CreateCompletionRequest} createCompletionRequest
698
716
  * @param {*} [options] Override http request option.
699
717
  * @throws {RequiredError}
700
718
  */
701
- createCompletion(engineId, createCompletionRequest, options) {
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) {
719
+ createCompletion(createCompletionRequest, options) {
715
720
  return __awaiter(this, void 0, void 0, function* () {
716
- const localVarAxiosArgs = yield localVarAxiosParamCreator.createCompletionFromModel(createCompletionFromModelRequest, options);
721
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createCompletion(createCompletionRequest, options);
717
722
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
718
723
  });
719
724
  },
720
725
  /**
721
726
  *
722
727
  * @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
728
  * @param {CreateEditRequest} createEditRequest
725
729
  * @param {*} [options] Override http request option.
726
730
  * @throws {RequiredError}
727
731
  */
728
- createEdit(engineId, createEditRequest, options) {
732
+ createEdit(createEditRequest, options) {
729
733
  return __awaiter(this, void 0, void 0, function* () {
730
- const localVarAxiosArgs = yield localVarAxiosParamCreator.createEdit(engineId, createEditRequest, options);
734
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createEdit(createEditRequest, options);
731
735
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
732
736
  });
733
737
  },
734
738
  /**
735
739
  *
736
740
  * @summary Creates an embedding vector representing the input text.
737
- * @param {string} engineId The ID of the engine to use for this request
738
741
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
739
742
  * @param {*} [options] Override http request option.
740
743
  * @throws {RequiredError}
741
744
  */
742
- createEmbedding(engineId, createEmbeddingRequest, options) {
745
+ createEmbedding(createEmbeddingRequest, options) {
743
746
  return __awaiter(this, void 0, void 0, function* () {
744
- const localVarAxiosArgs = yield localVarAxiosParamCreator.createEmbedding(engineId, createEmbeddingRequest, options);
747
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createEmbedding(createEmbeddingRequest, options);
745
748
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
746
749
  });
747
750
  },
748
751
  /**
749
752
  *
750
753
  * @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 {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).
752
- * @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.
754
+ * @param {any} 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).
755
+ * @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
756
  * @param {*} [options] Override http request option.
754
757
  * @throws {RequiredError}
755
758
  */
@@ -778,6 +781,7 @@ exports.OpenAIApiFp = function (configuration) {
778
781
  * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
779
782
  * @param {CreateSearchRequest} createSearchRequest
780
783
  * @param {*} [options] Override http request option.
784
+ * @deprecated
781
785
  * @throws {RequiredError}
782
786
  */
783
787
  createSearch(engineId, createSearchRequest, options) {
@@ -827,8 +831,9 @@ exports.OpenAIApiFp = function (configuration) {
827
831
  },
828
832
  /**
829
833
  *
830
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
834
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
831
835
  * @param {*} [options] Override http request option.
836
+ * @deprecated
832
837
  * @throws {RequiredError}
833
838
  */
834
839
  listEngines(options) {
@@ -877,9 +882,22 @@ exports.OpenAIApiFp = function (configuration) {
877
882
  },
878
883
  /**
879
884
  *
880
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
885
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
886
+ * @param {*} [options] Override http request option.
887
+ * @throws {RequiredError}
888
+ */
889
+ listModels(options) {
890
+ return __awaiter(this, void 0, void 0, function* () {
891
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listModels(options);
892
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
893
+ });
894
+ },
895
+ /**
896
+ *
897
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
881
898
  * @param {string} engineId The ID of the engine to use for this request
882
899
  * @param {*} [options] Override http request option.
900
+ * @deprecated
883
901
  * @throws {RequiredError}
884
902
  */
885
903
  retrieveEngine(engineId, options) {
@@ -914,6 +932,19 @@ exports.OpenAIApiFp = function (configuration) {
914
932
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
915
933
  });
916
934
  },
935
+ /**
936
+ *
937
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
938
+ * @param {string} model The ID of the model to use for this request
939
+ * @param {*} [options] Override http request option.
940
+ * @throws {RequiredError}
941
+ */
942
+ retrieveModel(model, options) {
943
+ return __awaiter(this, void 0, void 0, function* () {
944
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.retrieveModel(model, options);
945
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
946
+ });
947
+ },
917
948
  };
918
949
  };
919
950
  /**
@@ -938,6 +969,7 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
938
969
  * @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
970
  * @param {CreateAnswerRequest} createAnswerRequest
940
971
  * @param {*} [options] Override http request option.
972
+ * @deprecated
941
973
  * @throws {RequiredError}
942
974
  */
943
975
  createAnswer(createAnswerRequest, options) {
@@ -948,6 +980,7 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
948
980
  * @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
981
  * @param {CreateClassificationRequest} createClassificationRequest
950
982
  * @param {*} [options] Override http request option.
983
+ * @deprecated
951
984
  * @throws {RequiredError}
952
985
  */
953
986
  createClassification(createClassificationRequest, options) {
@@ -955,52 +988,39 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
955
988
  },
956
989
  /**
957
990
  *
958
- * @summary Creates a new completion for the provided prompt and parameters
959
- * @param {string} engineId The ID of the engine to use for this request
991
+ * @summary Creates a completion for the provided prompt and parameters
960
992
  * @param {CreateCompletionRequest} createCompletionRequest
961
993
  * @param {*} [options] Override http request option.
962
994
  * @throws {RequiredError}
963
995
  */
964
- createCompletion(engineId, createCompletionRequest, options) {
965
- return localVarFp.createCompletion(engineId, createCompletionRequest, options).then((request) => request(axios, basePath));
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));
996
+ createCompletion(createCompletionRequest, options) {
997
+ return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios, basePath));
976
998
  },
977
999
  /**
978
1000
  *
979
1001
  * @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
1002
  * @param {CreateEditRequest} createEditRequest
982
1003
  * @param {*} [options] Override http request option.
983
1004
  * @throws {RequiredError}
984
1005
  */
985
- createEdit(engineId, createEditRequest, options) {
986
- return localVarFp.createEdit(engineId, createEditRequest, options).then((request) => request(axios, basePath));
1006
+ createEdit(createEditRequest, options) {
1007
+ return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios, basePath));
987
1008
  },
988
1009
  /**
989
1010
  *
990
1011
  * @summary Creates an embedding vector representing the input text.
991
- * @param {string} engineId The ID of the engine to use for this request
992
1012
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
993
1013
  * @param {*} [options] Override http request option.
994
1014
  * @throws {RequiredError}
995
1015
  */
996
- createEmbedding(engineId, createEmbeddingRequest, options) {
997
- return localVarFp.createEmbedding(engineId, createEmbeddingRequest, options).then((request) => request(axios, basePath));
1016
+ createEmbedding(createEmbeddingRequest, options) {
1017
+ return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios, basePath));
998
1018
  },
999
1019
  /**
1000
1020
  *
1001
1021
  * @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 {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).
1003
- * @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.
1022
+ * @param {any} 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).
1023
+ * @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
1024
  * @param {*} [options] Override http request option.
1005
1025
  * @throws {RequiredError}
1006
1026
  */
@@ -1023,6 +1043,7 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
1023
1043
  * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
1024
1044
  * @param {CreateSearchRequest} createSearchRequest
1025
1045
  * @param {*} [options] Override http request option.
1046
+ * @deprecated
1026
1047
  * @throws {RequiredError}
1027
1048
  */
1028
1049
  createSearch(engineId, createSearchRequest, options) {
@@ -1060,8 +1081,9 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
1060
1081
  },
1061
1082
  /**
1062
1083
  *
1063
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1084
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
1064
1085
  * @param {*} [options] Override http request option.
1086
+ * @deprecated
1065
1087
  * @throws {RequiredError}
1066
1088
  */
1067
1089
  listEngines(options) {
@@ -1098,9 +1120,19 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
1098
1120
  },
1099
1121
  /**
1100
1122
  *
1101
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1123
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
1124
+ * @param {*} [options] Override http request option.
1125
+ * @throws {RequiredError}
1126
+ */
1127
+ listModels(options) {
1128
+ return localVarFp.listModels(options).then((request) => request(axios, basePath));
1129
+ },
1130
+ /**
1131
+ *
1132
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
1102
1133
  * @param {string} engineId The ID of the engine to use for this request
1103
1134
  * @param {*} [options] Override http request option.
1135
+ * @deprecated
1104
1136
  * @throws {RequiredError}
1105
1137
  */
1106
1138
  retrieveEngine(engineId, options) {
@@ -1126,6 +1158,16 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
1126
1158
  retrieveFineTune(fineTuneId, options) {
1127
1159
  return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios, basePath));
1128
1160
  },
1161
+ /**
1162
+ *
1163
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
1164
+ * @param {string} model The ID of the model to use for this request
1165
+ * @param {*} [options] Override http request option.
1166
+ * @throws {RequiredError}
1167
+ */
1168
+ retrieveModel(model, options) {
1169
+ return localVarFp.retrieveModel(model, options).then((request) => request(axios, basePath));
1170
+ },
1129
1171
  };
1130
1172
  };
1131
1173
  /**
@@ -1151,6 +1193,7 @@ class OpenAIApi extends base_1.BaseAPI {
1151
1193
  * @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
1194
  * @param {CreateAnswerRequest} createAnswerRequest
1153
1195
  * @param {*} [options] Override http request option.
1196
+ * @deprecated
1154
1197
  * @throws {RequiredError}
1155
1198
  * @memberof OpenAIApi
1156
1199
  */
@@ -1162,6 +1205,7 @@ class OpenAIApi extends base_1.BaseAPI {
1162
1205
  * @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
1206
  * @param {CreateClassificationRequest} createClassificationRequest
1164
1207
  * @param {*} [options] Override http request option.
1208
+ * @deprecated
1165
1209
  * @throws {RequiredError}
1166
1210
  * @memberof OpenAIApi
1167
1211
  */
@@ -1170,56 +1214,42 @@ class OpenAIApi extends base_1.BaseAPI {
1170
1214
  }
1171
1215
  /**
1172
1216
  *
1173
- * @summary Creates a new completion for the provided prompt and parameters
1174
- * @param {string} engineId The ID of the engine to use for this request
1217
+ * @summary Creates a completion for the provided prompt and parameters
1175
1218
  * @param {CreateCompletionRequest} createCompletionRequest
1176
1219
  * @param {*} [options] Override http request option.
1177
1220
  * @throws {RequiredError}
1178
1221
  * @memberof OpenAIApi
1179
1222
  */
1180
- createCompletion(engineId, createCompletionRequest, options) {
1181
- return exports.OpenAIApiFp(this.configuration).createCompletion(engineId, createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
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));
1223
+ createCompletion(createCompletionRequest, options) {
1224
+ return exports.OpenAIApiFp(this.configuration).createCompletion(createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
1193
1225
  }
1194
1226
  /**
1195
1227
  *
1196
1228
  * @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
1229
  * @param {CreateEditRequest} createEditRequest
1199
1230
  * @param {*} [options] Override http request option.
1200
1231
  * @throws {RequiredError}
1201
1232
  * @memberof OpenAIApi
1202
1233
  */
1203
- createEdit(engineId, createEditRequest, options) {
1204
- return exports.OpenAIApiFp(this.configuration).createEdit(engineId, createEditRequest, options).then((request) => request(this.axios, this.basePath));
1234
+ createEdit(createEditRequest, options) {
1235
+ return exports.OpenAIApiFp(this.configuration).createEdit(createEditRequest, options).then((request) => request(this.axios, this.basePath));
1205
1236
  }
1206
1237
  /**
1207
1238
  *
1208
1239
  * @summary Creates an embedding vector representing the input text.
1209
- * @param {string} engineId The ID of the engine to use for this request
1210
1240
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
1211
1241
  * @param {*} [options] Override http request option.
1212
1242
  * @throws {RequiredError}
1213
1243
  * @memberof OpenAIApi
1214
1244
  */
1215
- createEmbedding(engineId, createEmbeddingRequest, options) {
1216
- return exports.OpenAIApiFp(this.configuration).createEmbedding(engineId, createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
1245
+ createEmbedding(createEmbeddingRequest, options) {
1246
+ return exports.OpenAIApiFp(this.configuration).createEmbedding(createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
1217
1247
  }
1218
1248
  /**
1219
1249
  *
1220
1250
  * @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 {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).
1222
- * @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.
1251
+ * @param {any} 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).
1252
+ * @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
1253
  * @param {*} [options] Override http request option.
1224
1254
  * @throws {RequiredError}
1225
1255
  * @memberof OpenAIApi
@@ -1244,6 +1274,7 @@ class OpenAIApi extends base_1.BaseAPI {
1244
1274
  * @param {string} engineId The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
1245
1275
  * @param {CreateSearchRequest} createSearchRequest
1246
1276
  * @param {*} [options] Override http request option.
1277
+ * @deprecated
1247
1278
  * @throws {RequiredError}
1248
1279
  * @memberof OpenAIApi
1249
1280
  */
@@ -1285,8 +1316,9 @@ class OpenAIApi extends base_1.BaseAPI {
1285
1316
  }
1286
1317
  /**
1287
1318
  *
1288
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1319
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
1289
1320
  * @param {*} [options] Override http request option.
1321
+ * @deprecated
1290
1322
  * @throws {RequiredError}
1291
1323
  * @memberof OpenAIApi
1292
1324
  */
@@ -1327,9 +1359,20 @@ class OpenAIApi extends base_1.BaseAPI {
1327
1359
  }
1328
1360
  /**
1329
1361
  *
1330
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1362
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
1363
+ * @param {*} [options] Override http request option.
1364
+ * @throws {RequiredError}
1365
+ * @memberof OpenAIApi
1366
+ */
1367
+ listModels(options) {
1368
+ return exports.OpenAIApiFp(this.configuration).listModels(options).then((request) => request(this.axios, this.basePath));
1369
+ }
1370
+ /**
1371
+ *
1372
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
1331
1373
  * @param {string} engineId The ID of the engine to use for this request
1332
1374
  * @param {*} [options] Override http request option.
1375
+ * @deprecated
1333
1376
  * @throws {RequiredError}
1334
1377
  * @memberof OpenAIApi
1335
1378
  */
@@ -1358,5 +1401,16 @@ class OpenAIApi extends base_1.BaseAPI {
1358
1401
  retrieveFineTune(fineTuneId, options) {
1359
1402
  return exports.OpenAIApiFp(this.configuration).retrieveFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
1360
1403
  }
1404
+ /**
1405
+ *
1406
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
1407
+ * @param {string} model The ID of the model to use for this request
1408
+ * @param {*} [options] Override http request option.
1409
+ * @throws {RequiredError}
1410
+ * @memberof OpenAIApi
1411
+ */
1412
+ retrieveModel(model, options) {
1413
+ return exports.OpenAIApiFp(this.configuration).retrieveModel(model, options).then((request) => request(this.axios, this.basePath));
1414
+ }
1361
1415
  }
1362
1416
  exports.OpenAIApi = OpenAIApi;