openai 2.0.4 → 2.0.5

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/api.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * OpenAI API
5
5
  * APIs for sampling from and fine-tuning language models
6
6
  *
7
- * The version of the OpenAPI document: 1.0.3
7
+ * The version of the OpenAPI document: 1.0.4
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -370,7 +370,13 @@ export interface CreateCompletionFromModelRequest {
370
370
  */
371
371
  'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
372
372
  /**
373
- * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except `code-davinci-001`, which supports 4096).
373
+ * The suffix that comes after a completion of inserted text, encoded as a string or array of strings.
374
+ * @type {string | Array<string>}
375
+ * @memberof CreateCompletionFromModelRequest
376
+ */
377
+ 'suffix'?: string | Array<string> | null;
378
+ /**
379
+ * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
374
380
  * @type {number}
375
381
  * @memberof CreateCompletionFromModelRequest
376
382
  */
@@ -480,7 +486,13 @@ export interface CreateCompletionRequest {
480
486
  */
481
487
  'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
482
488
  /**
483
- * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except `code-davinci-001`, which supports 4096).
489
+ * The suffix that comes after a completion of inserted text, encoded as a string or array of strings.
490
+ * @type {string | Array<string>}
491
+ * @memberof CreateCompletionRequest
492
+ */
493
+ 'suffix'?: string | Array<string> | null;
494
+ /**
495
+ * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
484
496
  * @type {number}
485
497
  * @memberof CreateCompletionRequest
486
498
  */
@@ -657,6 +669,74 @@ export interface CreateCompletionResponseLogprobs {
657
669
  */
658
670
  'text_offset'?: Array<number>;
659
671
  }
672
+ /**
673
+ *
674
+ * @export
675
+ * @interface CreateEditRequest
676
+ */
677
+ export interface CreateEditRequest {
678
+ /**
679
+ * The input text to use as a starting point for the edit.
680
+ * @type {string}
681
+ * @memberof CreateEditRequest
682
+ */
683
+ 'input'?: string | null;
684
+ /**
685
+ * The instruction that tells the model how to edit the prompt.
686
+ * @type {string}
687
+ * @memberof CreateEditRequest
688
+ */
689
+ 'instruction': string;
690
+ /**
691
+ * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both.
692
+ * @type {number}
693
+ * @memberof CreateEditRequest
694
+ */
695
+ 'temperature'?: number | null;
696
+ /**
697
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.
698
+ * @type {number}
699
+ * @memberof CreateEditRequest
700
+ */
701
+ 'top_p'?: number | null;
702
+ }
703
+ /**
704
+ *
705
+ * @export
706
+ * @interface CreateEditResponse
707
+ */
708
+ export interface CreateEditResponse {
709
+ /**
710
+ *
711
+ * @type {string}
712
+ * @memberof CreateEditResponse
713
+ */
714
+ 'id'?: string;
715
+ /**
716
+ *
717
+ * @type {string}
718
+ * @memberof CreateEditResponse
719
+ */
720
+ 'object'?: string;
721
+ /**
722
+ *
723
+ * @type {number}
724
+ * @memberof CreateEditResponse
725
+ */
726
+ 'created'?: number;
727
+ /**
728
+ *
729
+ * @type {string}
730
+ * @memberof CreateEditResponse
731
+ */
732
+ 'model'?: string;
733
+ /**
734
+ *
735
+ * @type {Array<CreateCompletionResponseChoices>}
736
+ * @memberof CreateEditResponse
737
+ */
738
+ 'choices'?: Array<CreateCompletionResponseChoices>;
739
+ }
660
740
  /**
661
741
  *
662
742
  * @export
@@ -798,6 +878,12 @@ export interface CreateFineTuneRequest {
798
878
  * @memberof CreateFineTuneRequest
799
879
  */
800
880
  'classification_betas'?: Array<number> | null;
881
+ /**
882
+ * A string of up to 40 characters that will be added to your fine-tuned model name. For example, a `suffix` of \"custom-model-name\" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`.
883
+ * @type {string}
884
+ * @memberof CreateFineTuneRequest
885
+ */
886
+ 'suffix'?: string | null;
801
887
  }
802
888
  /**
803
889
  *
@@ -917,6 +1003,31 @@ export interface DeleteFileResponse {
917
1003
  */
918
1004
  'deleted'?: boolean;
919
1005
  }
1006
+ /**
1007
+ *
1008
+ * @export
1009
+ * @interface DeleteModelResponse
1010
+ */
1011
+ export interface DeleteModelResponse {
1012
+ /**
1013
+ *
1014
+ * @type {string}
1015
+ * @memberof DeleteModelResponse
1016
+ */
1017
+ 'id'?: string;
1018
+ /**
1019
+ *
1020
+ * @type {string}
1021
+ * @memberof DeleteModelResponse
1022
+ */
1023
+ 'object'?: string;
1024
+ /**
1025
+ *
1026
+ * @type {boolean}
1027
+ * @memberof DeleteModelResponse
1028
+ */
1029
+ 'deleted'?: boolean;
1030
+ }
920
1031
  /**
921
1032
  *
922
1033
  * @export
@@ -1384,6 +1495,46 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1384
1495
  options: localVarRequestOptions,
1385
1496
  };
1386
1497
  },
1498
+ /**
1499
+ *
1500
+ * @summary Creates a new edit for the provided input, instruction, and parameters
1501
+ * @param {string} engineId The ID of the engine to use for this request
1502
+ * @param {CreateEditRequest} createEditRequest
1503
+ * @param {*} [options] Override http request option.
1504
+ * @throws {RequiredError}
1505
+ */
1506
+ createEdit: async (engineId: string, createEditRequest: CreateEditRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1507
+ // verify required parameter 'engineId' is not null or undefined
1508
+ assertParamExists('createEdit', 'engineId', engineId)
1509
+ // verify required parameter 'createEditRequest' is not null or undefined
1510
+ assertParamExists('createEdit', 'createEditRequest', createEditRequest)
1511
+ const localVarPath = `/engines/{engine_id}/edits`
1512
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
1513
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1514
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1515
+ let baseOptions;
1516
+ if (configuration) {
1517
+ baseOptions = configuration.baseOptions;
1518
+ }
1519
+
1520
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1521
+ const localVarHeaderParameter = {} as any;
1522
+ const localVarQueryParameter = {} as any;
1523
+
1524
+
1525
+
1526
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1527
+
1528
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1529
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1530
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1531
+ localVarRequestOptions.data = serializeDataIfNeeded(createEditRequest, localVarRequestOptions, configuration)
1532
+
1533
+ return {
1534
+ url: toPathString(localVarUrlObj),
1535
+ options: localVarRequestOptions,
1536
+ };
1537
+ },
1387
1538
  /**
1388
1539
  *
1389
1540
  * @summary Creates an embedding vector representing the input text.
@@ -1573,6 +1724,40 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1573
1724
 
1574
1725
 
1575
1726
 
1727
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1728
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1729
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1730
+
1731
+ return {
1732
+ url: toPathString(localVarUrlObj),
1733
+ options: localVarRequestOptions,
1734
+ };
1735
+ },
1736
+ /**
1737
+ *
1738
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1739
+ * @param {string} model The model to delete
1740
+ * @param {*} [options] Override http request option.
1741
+ * @throws {RequiredError}
1742
+ */
1743
+ deleteModel: async (model: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1744
+ // verify required parameter 'model' is not null or undefined
1745
+ assertParamExists('deleteModel', 'model', model)
1746
+ const localVarPath = `/models/{model}`
1747
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
1748
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1749
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1750
+ let baseOptions;
1751
+ if (configuration) {
1752
+ baseOptions = configuration.baseOptions;
1753
+ }
1754
+
1755
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
1756
+ const localVarHeaderParameter = {} as any;
1757
+ const localVarQueryParameter = {} as any;
1758
+
1759
+
1760
+
1576
1761
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1577
1762
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1578
1763
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -1913,6 +2098,18 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
1913
2098
  const localVarAxiosArgs = await localVarAxiosParamCreator.createCompletionFromModel(createCompletionFromModelRequest, options);
1914
2099
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1915
2100
  },
2101
+ /**
2102
+ *
2103
+ * @summary Creates a new edit for the provided input, instruction, and parameters
2104
+ * @param {string} engineId The ID of the engine to use for this request
2105
+ * @param {CreateEditRequest} createEditRequest
2106
+ * @param {*} [options] Override http request option.
2107
+ * @throws {RequiredError}
2108
+ */
2109
+ async createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEditResponse>> {
2110
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEdit(engineId, createEditRequest, options);
2111
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2112
+ },
1916
2113
  /**
1917
2114
  *
1918
2115
  * @summary Creates an embedding vector representing the input text.
@@ -1971,6 +2168,17 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
1971
2168
  const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFile(fileId, options);
1972
2169
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1973
2170
  },
2171
+ /**
2172
+ *
2173
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
2174
+ * @param {string} model The model to delete
2175
+ * @param {*} [options] Override http request option.
2176
+ * @throws {RequiredError}
2177
+ */
2178
+ async deleteModel(model: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteModelResponse>> {
2179
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteModel(model, options);
2180
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2181
+ },
1974
2182
  /**
1975
2183
  *
1976
2184
  * @summary Returns the contents of the specified file
@@ -2118,6 +2326,17 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2118
2326
  createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: any): AxiosPromise<CreateCompletionResponse> {
2119
2327
  return localVarFp.createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(axios, basePath));
2120
2328
  },
2329
+ /**
2330
+ *
2331
+ * @summary Creates a new edit for the provided input, instruction, and parameters
2332
+ * @param {string} engineId The ID of the engine to use for this request
2333
+ * @param {CreateEditRequest} createEditRequest
2334
+ * @param {*} [options] Override http request option.
2335
+ * @throws {RequiredError}
2336
+ */
2337
+ createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: any): AxiosPromise<CreateEditResponse> {
2338
+ return localVarFp.createEdit(engineId, createEditRequest, options).then((request) => request(axios, basePath));
2339
+ },
2121
2340
  /**
2122
2341
  *
2123
2342
  * @summary Creates an embedding vector representing the input text.
@@ -2171,6 +2390,16 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2171
2390
  deleteFile(fileId: string, options?: any): AxiosPromise<DeleteFileResponse> {
2172
2391
  return localVarFp.deleteFile(fileId, options).then((request) => request(axios, basePath));
2173
2392
  },
2393
+ /**
2394
+ *
2395
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
2396
+ * @param {string} model The model to delete
2397
+ * @param {*} [options] Override http request option.
2398
+ * @throws {RequiredError}
2399
+ */
2400
+ deleteModel(model: string, options?: any): AxiosPromise<DeleteModelResponse> {
2401
+ return localVarFp.deleteModel(model, options).then((request) => request(axios, basePath));
2402
+ },
2174
2403
  /**
2175
2404
  *
2176
2405
  * @summary Returns the contents of the specified file
@@ -2320,6 +2549,19 @@ export class OpenAIApi extends BaseAPI {
2320
2549
  return OpenAIApiFp(this.configuration).createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(this.axios, this.basePath));
2321
2550
  }
2322
2551
 
2552
+ /**
2553
+ *
2554
+ * @summary Creates a new edit for the provided input, instruction, and parameters
2555
+ * @param {string} engineId The ID of the engine to use for this request
2556
+ * @param {CreateEditRequest} createEditRequest
2557
+ * @param {*} [options] Override http request option.
2558
+ * @throws {RequiredError}
2559
+ * @memberof OpenAIApi
2560
+ */
2561
+ public createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: AxiosRequestConfig) {
2562
+ return OpenAIApiFp(this.configuration).createEdit(engineId, createEditRequest, options).then((request) => request(this.axios, this.basePath));
2563
+ }
2564
+
2323
2565
  /**
2324
2566
  *
2325
2567
  * @summary Creates an embedding vector representing the input text.
@@ -2383,6 +2625,18 @@ export class OpenAIApi extends BaseAPI {
2383
2625
  return OpenAIApiFp(this.configuration).deleteFile(fileId, options).then((request) => request(this.axios, this.basePath));
2384
2626
  }
2385
2627
 
2628
+ /**
2629
+ *
2630
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
2631
+ * @param {string} model The model to delete
2632
+ * @param {*} [options] Override http request option.
2633
+ * @throws {RequiredError}
2634
+ * @memberof OpenAIApi
2635
+ */
2636
+ public deleteModel(model: string, options?: AxiosRequestConfig) {
2637
+ return OpenAIApiFp(this.configuration).deleteModel(model, options).then((request) => request(this.axios, this.basePath));
2638
+ }
2639
+
2386
2640
  /**
2387
2641
  *
2388
2642
  * @summary Returns the contents of the specified file
package/base.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * OpenAI API
5
5
  * APIs for sampling from and fine-tuning language models
6
6
  *
7
- * The version of the OpenAPI document: 1.0.3
7
+ * The version of the OpenAPI document: 1.0.4
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/common.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * OpenAI API
5
5
  * APIs for sampling from and fine-tuning language models
6
6
  *
7
- * The version of the OpenAPI document: 1.0.3
7
+ * The version of the OpenAPI document: 1.0.4
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/configuration.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * OpenAI API
5
5
  * APIs for sampling from and fine-tuning language models
6
6
  *
7
- * The version of the OpenAPI document: 1.0.3
7
+ * The version of the OpenAPI document: 1.0.4
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/api.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * OpenAI API
3
3
  * APIs for sampling from and fine-tuning language models
4
4
  *
5
- * The version of the OpenAPI document: 1.0.3
5
+ * The version of the OpenAPI document: 1.0.4
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -361,7 +361,13 @@ export interface CreateCompletionFromModelRequest {
361
361
  */
362
362
  'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
363
363
  /**
364
- * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except `code-davinci-001`, which supports 4096).
364
+ * The suffix that comes after a completion of inserted text, encoded as a string or array of strings.
365
+ * @type {string | Array<string>}
366
+ * @memberof CreateCompletionFromModelRequest
367
+ */
368
+ 'suffix'?: string | Array<string> | null;
369
+ /**
370
+ * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
365
371
  * @type {number}
366
372
  * @memberof CreateCompletionFromModelRequest
367
373
  */
@@ -471,7 +477,13 @@ export interface CreateCompletionRequest {
471
477
  */
472
478
  'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
473
479
  /**
474
- * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except `code-davinci-001`, which supports 4096).
480
+ * The suffix that comes after a completion of inserted text, encoded as a string or array of strings.
481
+ * @type {string | Array<string>}
482
+ * @memberof CreateCompletionRequest
483
+ */
484
+ 'suffix'?: string | Array<string> | null;
485
+ /**
486
+ * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
475
487
  * @type {number}
476
488
  * @memberof CreateCompletionRequest
477
489
  */
@@ -648,6 +660,74 @@ export interface CreateCompletionResponseLogprobs {
648
660
  */
649
661
  'text_offset'?: Array<number>;
650
662
  }
663
+ /**
664
+ *
665
+ * @export
666
+ * @interface CreateEditRequest
667
+ */
668
+ export interface CreateEditRequest {
669
+ /**
670
+ * The input text to use as a starting point for the edit.
671
+ * @type {string}
672
+ * @memberof CreateEditRequest
673
+ */
674
+ 'input'?: string | null;
675
+ /**
676
+ * The instruction that tells the model how to edit the prompt.
677
+ * @type {string}
678
+ * @memberof CreateEditRequest
679
+ */
680
+ 'instruction': string;
681
+ /**
682
+ * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both.
683
+ * @type {number}
684
+ * @memberof CreateEditRequest
685
+ */
686
+ 'temperature'?: number | null;
687
+ /**
688
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.
689
+ * @type {number}
690
+ * @memberof CreateEditRequest
691
+ */
692
+ 'top_p'?: number | null;
693
+ }
694
+ /**
695
+ *
696
+ * @export
697
+ * @interface CreateEditResponse
698
+ */
699
+ export interface CreateEditResponse {
700
+ /**
701
+ *
702
+ * @type {string}
703
+ * @memberof CreateEditResponse
704
+ */
705
+ 'id'?: string;
706
+ /**
707
+ *
708
+ * @type {string}
709
+ * @memberof CreateEditResponse
710
+ */
711
+ 'object'?: string;
712
+ /**
713
+ *
714
+ * @type {number}
715
+ * @memberof CreateEditResponse
716
+ */
717
+ 'created'?: number;
718
+ /**
719
+ *
720
+ * @type {string}
721
+ * @memberof CreateEditResponse
722
+ */
723
+ 'model'?: string;
724
+ /**
725
+ *
726
+ * @type {Array<CreateCompletionResponseChoices>}
727
+ * @memberof CreateEditResponse
728
+ */
729
+ 'choices'?: Array<CreateCompletionResponseChoices>;
730
+ }
651
731
  /**
652
732
  *
653
733
  * @export
@@ -789,6 +869,12 @@ export interface CreateFineTuneRequest {
789
869
  * @memberof CreateFineTuneRequest
790
870
  */
791
871
  'classification_betas'?: Array<number> | null;
872
+ /**
873
+ * A string of up to 40 characters that will be added to your fine-tuned model name. For example, a `suffix` of \"custom-model-name\" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`.
874
+ * @type {string}
875
+ * @memberof CreateFineTuneRequest
876
+ */
877
+ 'suffix'?: string | null;
792
878
  }
793
879
  /**
794
880
  *
@@ -908,6 +994,31 @@ export interface DeleteFileResponse {
908
994
  */
909
995
  'deleted'?: boolean;
910
996
  }
997
+ /**
998
+ *
999
+ * @export
1000
+ * @interface DeleteModelResponse
1001
+ */
1002
+ export interface DeleteModelResponse {
1003
+ /**
1004
+ *
1005
+ * @type {string}
1006
+ * @memberof DeleteModelResponse
1007
+ */
1008
+ 'id'?: string;
1009
+ /**
1010
+ *
1011
+ * @type {string}
1012
+ * @memberof DeleteModelResponse
1013
+ */
1014
+ 'object'?: string;
1015
+ /**
1016
+ *
1017
+ * @type {boolean}
1018
+ * @memberof DeleteModelResponse
1019
+ */
1020
+ 'deleted'?: boolean;
1021
+ }
911
1022
  /**
912
1023
  *
913
1024
  * @export
@@ -1232,6 +1343,15 @@ export declare const OpenAIApiAxiosParamCreator: (configuration?: Configuration)
1232
1343
  * @throws {RequiredError}
1233
1344
  */
1234
1345
  createCompletionFromModel: (createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1346
+ /**
1347
+ *
1348
+ * @summary Creates a new edit for the provided input, instruction, and parameters
1349
+ * @param {string} engineId The ID of the engine to use for this request
1350
+ * @param {CreateEditRequest} createEditRequest
1351
+ * @param {*} [options] Override http request option.
1352
+ * @throws {RequiredError}
1353
+ */
1354
+ createEdit: (engineId: string, createEditRequest: CreateEditRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1235
1355
  /**
1236
1356
  *
1237
1357
  * @summary Creates an embedding vector representing the input text.
@@ -1275,6 +1395,14 @@ export declare const OpenAIApiAxiosParamCreator: (configuration?: Configuration)
1275
1395
  * @throws {RequiredError}
1276
1396
  */
1277
1397
  deleteFile: (fileId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1398
+ /**
1399
+ *
1400
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1401
+ * @param {string} model The model to delete
1402
+ * @param {*} [options] Override http request option.
1403
+ * @throws {RequiredError}
1404
+ */
1405
+ deleteModel: (model: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1278
1406
  /**
1279
1407
  *
1280
1408
  * @summary Returns the contents of the specified file
@@ -1384,6 +1512,15 @@ export declare const OpenAIApiFp: (configuration?: Configuration) => {
1384
1512
  * @throws {RequiredError}
1385
1513
  */
1386
1514
  createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>>;
1515
+ /**
1516
+ *
1517
+ * @summary Creates a new edit for the provided input, instruction, and parameters
1518
+ * @param {string} engineId The ID of the engine to use for this request
1519
+ * @param {CreateEditRequest} createEditRequest
1520
+ * @param {*} [options] Override http request option.
1521
+ * @throws {RequiredError}
1522
+ */
1523
+ createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEditResponse>>;
1387
1524
  /**
1388
1525
  *
1389
1526
  * @summary Creates an embedding vector representing the input text.
@@ -1427,6 +1564,14 @@ export declare const OpenAIApiFp: (configuration?: Configuration) => {
1427
1564
  * @throws {RequiredError}
1428
1565
  */
1429
1566
  deleteFile(fileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteFileResponse>>;
1567
+ /**
1568
+ *
1569
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1570
+ * @param {string} model The model to delete
1571
+ * @param {*} [options] Override http request option.
1572
+ * @throws {RequiredError}
1573
+ */
1574
+ deleteModel(model: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteModelResponse>>;
1430
1575
  /**
1431
1576
  *
1432
1577
  * @summary Returns the contents of the specified file
@@ -1536,6 +1681,15 @@ export declare const OpenAIApiFactory: (configuration?: Configuration, basePath?
1536
1681
  * @throws {RequiredError}
1537
1682
  */
1538
1683
  createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: any): AxiosPromise<CreateCompletionResponse>;
1684
+ /**
1685
+ *
1686
+ * @summary Creates a new edit for the provided input, instruction, and parameters
1687
+ * @param {string} engineId The ID of the engine to use for this request
1688
+ * @param {CreateEditRequest} createEditRequest
1689
+ * @param {*} [options] Override http request option.
1690
+ * @throws {RequiredError}
1691
+ */
1692
+ createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: any): AxiosPromise<CreateEditResponse>;
1539
1693
  /**
1540
1694
  *
1541
1695
  * @summary Creates an embedding vector representing the input text.
@@ -1579,6 +1733,14 @@ export declare const OpenAIApiFactory: (configuration?: Configuration, basePath?
1579
1733
  * @throws {RequiredError}
1580
1734
  */
1581
1735
  deleteFile(fileId: string, options?: any): AxiosPromise<DeleteFileResponse>;
1736
+ /**
1737
+ *
1738
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1739
+ * @param {string} model The model to delete
1740
+ * @param {*} [options] Override http request option.
1741
+ * @throws {RequiredError}
1742
+ */
1743
+ deleteModel(model: string, options?: any): AxiosPromise<DeleteModelResponse>;
1582
1744
  /**
1583
1745
  *
1584
1746
  * @summary Returns the contents of the specified file
@@ -1695,6 +1857,16 @@ export declare class OpenAIApi extends BaseAPI {
1695
1857
  * @memberof OpenAIApi
1696
1858
  */
1697
1859
  createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCompletionResponse, any>>;
1860
+ /**
1861
+ *
1862
+ * @summary Creates a new edit for the provided input, instruction, and parameters
1863
+ * @param {string} engineId The ID of the engine to use for this request
1864
+ * @param {CreateEditRequest} createEditRequest
1865
+ * @param {*} [options] Override http request option.
1866
+ * @throws {RequiredError}
1867
+ * @memberof OpenAIApi
1868
+ */
1869
+ createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEditResponse, any>>;
1698
1870
  /**
1699
1871
  *
1700
1872
  * @summary Creates an embedding vector representing the input text.
@@ -1743,6 +1915,15 @@ export declare class OpenAIApi extends BaseAPI {
1743
1915
  * @memberof OpenAIApi
1744
1916
  */
1745
1917
  deleteFile(fileId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DeleteFileResponse, any>>;
1918
+ /**
1919
+ *
1920
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1921
+ * @param {string} model The model to delete
1922
+ * @param {*} [options] Override http request option.
1923
+ * @throws {RequiredError}
1924
+ * @memberof OpenAIApi
1925
+ */
1926
+ deleteModel(model: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DeleteModelResponse, any>>;
1746
1927
  /**
1747
1928
  *
1748
1929
  * @summary Returns the contents of the specified file
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.3
8
+ * The version of the OpenAPI document: 1.0.4
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -188,6 +188,40 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
188
188
  options: localVarRequestOptions,
189
189
  };
190
190
  }),
191
+ /**
192
+ *
193
+ * @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
+ * @param {CreateEditRequest} createEditRequest
196
+ * @param {*} [options] Override http request option.
197
+ * @throws {RequiredError}
198
+ */
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);
202
+ // verify required parameter 'createEditRequest' is not null or undefined
203
+ common_1.assertParamExists('createEdit', 'createEditRequest', createEditRequest);
204
+ const localVarPath = `/engines/{engine_id}/edits`
205
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
206
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
207
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
208
+ let baseOptions;
209
+ if (configuration) {
210
+ baseOptions = configuration.baseOptions;
211
+ }
212
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
213
+ const localVarHeaderParameter = {};
214
+ const localVarQueryParameter = {};
215
+ localVarHeaderParameter['Content-Type'] = 'application/json';
216
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
217
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
218
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
219
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createEditRequest, localVarRequestOptions, configuration);
220
+ return {
221
+ url: common_1.toPathString(localVarUrlObj),
222
+ options: localVarRequestOptions,
223
+ };
224
+ }),
191
225
  /**
192
226
  *
193
227
  * @summary Creates an embedding vector representing the input text.
@@ -355,6 +389,35 @@ exports.OpenAIApiAxiosParamCreator = function (configuration) {
355
389
  options: localVarRequestOptions,
356
390
  };
357
391
  }),
392
+ /**
393
+ *
394
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
395
+ * @param {string} model The model to delete
396
+ * @param {*} [options] Override http request option.
397
+ * @throws {RequiredError}
398
+ */
399
+ deleteModel: (model, options = {}) => __awaiter(this, void 0, void 0, function* () {
400
+ // verify required parameter 'model' is not null or undefined
401
+ common_1.assertParamExists('deleteModel', 'model', model);
402
+ const localVarPath = `/models/{model}`
403
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
404
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
405
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
406
+ let baseOptions;
407
+ if (configuration) {
408
+ baseOptions = configuration.baseOptions;
409
+ }
410
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
411
+ const localVarHeaderParameter = {};
412
+ const localVarQueryParameter = {};
413
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
414
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
415
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
416
+ return {
417
+ url: common_1.toPathString(localVarUrlObj),
418
+ options: localVarRequestOptions,
419
+ };
420
+ }),
358
421
  /**
359
422
  *
360
423
  * @summary Returns the contents of the specified file
@@ -654,6 +717,20 @@ exports.OpenAIApiFp = function (configuration) {
654
717
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
655
718
  });
656
719
  },
720
+ /**
721
+ *
722
+ * @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
+ * @param {CreateEditRequest} createEditRequest
725
+ * @param {*} [options] Override http request option.
726
+ * @throws {RequiredError}
727
+ */
728
+ createEdit(engineId, createEditRequest, options) {
729
+ return __awaiter(this, void 0, void 0, function* () {
730
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createEdit(engineId, createEditRequest, options);
731
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
732
+ });
733
+ },
657
734
  /**
658
735
  *
659
736
  * @summary Creates an embedding vector representing the input text.
@@ -722,6 +799,19 @@ exports.OpenAIApiFp = function (configuration) {
722
799
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
723
800
  });
724
801
  },
802
+ /**
803
+ *
804
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
805
+ * @param {string} model The model to delete
806
+ * @param {*} [options] Override http request option.
807
+ * @throws {RequiredError}
808
+ */
809
+ deleteModel(model, options) {
810
+ return __awaiter(this, void 0, void 0, function* () {
811
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteModel(model, options);
812
+ return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
813
+ });
814
+ },
725
815
  /**
726
816
  *
727
817
  * @summary Returns the contents of the specified file
@@ -884,6 +974,17 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
884
974
  createCompletionFromModel(createCompletionFromModelRequest, options) {
885
975
  return localVarFp.createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(axios, basePath));
886
976
  },
977
+ /**
978
+ *
979
+ * @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
+ * @param {CreateEditRequest} createEditRequest
982
+ * @param {*} [options] Override http request option.
983
+ * @throws {RequiredError}
984
+ */
985
+ createEdit(engineId, createEditRequest, options) {
986
+ return localVarFp.createEdit(engineId, createEditRequest, options).then((request) => request(axios, basePath));
987
+ },
887
988
  /**
888
989
  *
889
990
  * @summary Creates an embedding vector representing the input text.
@@ -937,6 +1038,16 @@ exports.OpenAIApiFactory = function (configuration, basePath, axios) {
937
1038
  deleteFile(fileId, options) {
938
1039
  return localVarFp.deleteFile(fileId, options).then((request) => request(axios, basePath));
939
1040
  },
1041
+ /**
1042
+ *
1043
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1044
+ * @param {string} model The model to delete
1045
+ * @param {*} [options] Override http request option.
1046
+ * @throws {RequiredError}
1047
+ */
1048
+ deleteModel(model, options) {
1049
+ return localVarFp.deleteModel(model, options).then((request) => request(axios, basePath));
1050
+ },
940
1051
  /**
941
1052
  *
942
1053
  * @summary Returns the contents of the specified file
@@ -1080,6 +1191,18 @@ class OpenAIApi extends base_1.BaseAPI {
1080
1191
  createCompletionFromModel(createCompletionFromModelRequest, options) {
1081
1192
  return exports.OpenAIApiFp(this.configuration).createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(this.axios, this.basePath));
1082
1193
  }
1194
+ /**
1195
+ *
1196
+ * @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
+ * @param {CreateEditRequest} createEditRequest
1199
+ * @param {*} [options] Override http request option.
1200
+ * @throws {RequiredError}
1201
+ * @memberof OpenAIApi
1202
+ */
1203
+ createEdit(engineId, createEditRequest, options) {
1204
+ return exports.OpenAIApiFp(this.configuration).createEdit(engineId, createEditRequest, options).then((request) => request(this.axios, this.basePath));
1205
+ }
1083
1206
  /**
1084
1207
  *
1085
1208
  * @summary Creates an embedding vector representing the input text.
@@ -1138,6 +1261,17 @@ class OpenAIApi extends base_1.BaseAPI {
1138
1261
  deleteFile(fileId, options) {
1139
1262
  return exports.OpenAIApiFp(this.configuration).deleteFile(fileId, options).then((request) => request(this.axios, this.basePath));
1140
1263
  }
1264
+ /**
1265
+ *
1266
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
1267
+ * @param {string} model The model to delete
1268
+ * @param {*} [options] Override http request option.
1269
+ * @throws {RequiredError}
1270
+ * @memberof OpenAIApi
1271
+ */
1272
+ deleteModel(model, options) {
1273
+ return exports.OpenAIApiFp(this.configuration).deleteModel(model, options).then((request) => request(this.axios, this.basePath));
1274
+ }
1141
1275
  /**
1142
1276
  *
1143
1277
  * @summary Returns the contents of the specified file
package/dist/base.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * OpenAI API
3
3
  * APIs for sampling from and fine-tuning language models
4
4
  *
5
- * The version of the OpenAPI document: 1.0.3
5
+ * The version of the OpenAPI document: 1.0.4
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/base.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.3
8
+ * The version of the OpenAPI document: 1.0.4
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/common.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * OpenAI API
3
3
  * APIs for sampling from and fine-tuning language models
4
4
  *
5
- * The version of the OpenAPI document: 1.0.3
5
+ * The version of the OpenAPI document: 1.0.4
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/common.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.3
8
+ * The version of the OpenAPI document: 1.0.4
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * OpenAI API
3
3
  * APIs for sampling from and fine-tuning language models
4
4
  *
5
- * The version of the OpenAPI document: 1.0.3
5
+ * The version of the OpenAPI document: 1.0.4
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -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.3
8
+ * The version of the OpenAPI document: 1.0.4
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * OpenAI API
3
3
  * APIs for sampling from and fine-tuning language models
4
4
  *
5
- * The version of the OpenAPI document: 1.0.3
5
+ * The version of the OpenAPI document: 1.0.4
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/index.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.3
8
+ * The version of the OpenAPI document: 1.0.4
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/index.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * OpenAI API
5
5
  * APIs for sampling from and fine-tuning language models
6
6
  *
7
- * The version of the OpenAPI document: 1.0.3
7
+ * The version of the OpenAPI document: 1.0.4
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openai",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Node.js library for the OpenAI API",
5
5
  "keywords": [
6
6
  "openai",