openai 3.0.0 → 3.1.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/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.5
7
+ * The version of the OpenAPI document: 1.1.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -82,7 +82,7 @@ export interface CreateAnswerRequest {
82
82
  */
83
83
  'temperature'?: number | null;
84
84
  /**
85
- * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact support@openai.com and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
85
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
86
86
  * @type {number}
87
87
  * @memberof CreateAnswerRequest
88
88
  */
@@ -130,7 +130,7 @@ export interface CreateAnswerRequest {
130
130
  */
131
131
  'expand'?: Array<any> | null;
132
132
  /**
133
- * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
133
+ * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
134
134
  * @type {string}
135
135
  * @memberof CreateAnswerRequest
136
136
  */
@@ -254,7 +254,7 @@ export interface CreateClassificationRequest {
254
254
  */
255
255
  'temperature'?: number | null;
256
256
  /**
257
- * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact support@openai.com and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
257
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
258
258
  * @type {number}
259
259
  * @memberof CreateClassificationRequest
260
260
  */
@@ -290,7 +290,7 @@ export interface CreateClassificationRequest {
290
290
  */
291
291
  'expand'?: Array<any> | null;
292
292
  /**
293
- * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
293
+ * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
294
294
  * @type {string}
295
295
  * @memberof CreateClassificationRequest
296
296
  */
@@ -419,7 +419,7 @@ export interface CreateCompletionRequest {
419
419
  */
420
420
  'stream'?: boolean | null;
421
421
  /**
422
- * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact support@openai.com and describe your use case.
422
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case.
423
423
  * @type {number}
424
424
  * @memberof CreateCompletionRequest
425
425
  */
@@ -461,7 +461,7 @@ export interface CreateCompletionRequest {
461
461
  */
462
462
  'logit_bias'?: object | null;
463
463
  /**
464
- * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
464
+ * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
465
465
  * @type {string}
466
466
  * @memberof CreateCompletionRequest
467
467
  */
@@ -492,31 +492,37 @@ export interface CreateCompletionResponse {
492
492
  * @type {string}
493
493
  * @memberof CreateCompletionResponse
494
494
  */
495
- 'id'?: string;
495
+ 'id': string;
496
496
  /**
497
497
  *
498
498
  * @type {string}
499
499
  * @memberof CreateCompletionResponse
500
500
  */
501
- 'object'?: string;
501
+ 'object': string;
502
502
  /**
503
503
  *
504
504
  * @type {number}
505
505
  * @memberof CreateCompletionResponse
506
506
  */
507
- 'created'?: number;
507
+ 'created': number;
508
508
  /**
509
509
  *
510
510
  * @type {string}
511
511
  * @memberof CreateCompletionResponse
512
512
  */
513
- 'model'?: string;
513
+ 'model': string;
514
514
  /**
515
515
  *
516
516
  * @type {Array<CreateCompletionResponseChoicesInner>}
517
517
  * @memberof CreateCompletionResponse
518
518
  */
519
- 'choices'?: Array<CreateCompletionResponseChoicesInner>;
519
+ 'choices': Array<CreateCompletionResponseChoicesInner>;
520
+ /**
521
+ *
522
+ * @type {CreateCompletionResponseUsage}
523
+ * @memberof CreateCompletionResponse
524
+ */
525
+ 'usage'?: CreateCompletionResponseUsage;
520
526
  }
521
527
  /**
522
528
  *
@@ -580,6 +586,31 @@ export interface CreateCompletionResponseChoicesInnerLogprobs {
580
586
  */
581
587
  'text_offset'?: Array<number>;
582
588
  }
589
+ /**
590
+ *
591
+ * @export
592
+ * @interface CreateCompletionResponseUsage
593
+ */
594
+ export interface CreateCompletionResponseUsage {
595
+ /**
596
+ *
597
+ * @type {number}
598
+ * @memberof CreateCompletionResponseUsage
599
+ */
600
+ 'prompt_tokens': number;
601
+ /**
602
+ *
603
+ * @type {number}
604
+ * @memberof CreateCompletionResponseUsage
605
+ */
606
+ 'completion_tokens': number;
607
+ /**
608
+ *
609
+ * @type {number}
610
+ * @memberof CreateCompletionResponseUsage
611
+ */
612
+ 'total_tokens': number;
613
+ }
583
614
  /**
584
615
  *
585
616
  * @export
@@ -634,31 +665,37 @@ export interface CreateEditResponse {
634
665
  * @type {string}
635
666
  * @memberof CreateEditResponse
636
667
  */
637
- 'id'?: string;
668
+ 'id': string;
638
669
  /**
639
670
  *
640
671
  * @type {string}
641
672
  * @memberof CreateEditResponse
642
673
  */
643
- 'object'?: string;
674
+ 'object': string;
644
675
  /**
645
676
  *
646
677
  * @type {number}
647
678
  * @memberof CreateEditResponse
648
679
  */
649
- 'created'?: number;
680
+ 'created': number;
650
681
  /**
651
682
  *
652
683
  * @type {string}
653
684
  * @memberof CreateEditResponse
654
685
  */
655
- 'model'?: string;
686
+ 'model': string;
656
687
  /**
657
688
  *
658
689
  * @type {Array<CreateCompletionResponseChoicesInner>}
659
690
  * @memberof CreateEditResponse
660
691
  */
661
- 'choices'?: Array<CreateCompletionResponseChoicesInner>;
692
+ 'choices': Array<CreateCompletionResponseChoicesInner>;
693
+ /**
694
+ *
695
+ * @type {CreateCompletionResponseUsage}
696
+ * @memberof CreateEditResponse
697
+ */
698
+ 'usage': CreateCompletionResponseUsage;
662
699
  }
663
700
  /**
664
701
  *
@@ -679,7 +716,7 @@ export interface CreateEmbeddingRequest {
679
716
  */
680
717
  'input': CreateEmbeddingRequestInput;
681
718
  /**
682
- * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
719
+ * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
683
720
  * @type {string}
684
721
  * @memberof CreateEmbeddingRequest
685
722
  */
@@ -687,7 +724,7 @@ export interface CreateEmbeddingRequest {
687
724
  }
688
725
  /**
689
726
  * @type CreateEmbeddingRequestInput
690
- * Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 2048 tokens in length. Unless your are embedding code, we suggest replacing newlines (`\\n`) in your input with a single space, as we have observed inferior results when newlines are present.
727
+ * Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 2048 tokens in length. Unless you are embedding code, we suggest replacing newlines (`\\n`) in your input with a single space, as we have observed inferior results when newlines are present.
691
728
  * @export
692
729
  */
693
730
  export type CreateEmbeddingRequestInput = Array<any> | Array<number> | Array<string> | string;
@@ -703,19 +740,25 @@ export interface CreateEmbeddingResponse {
703
740
  * @type {string}
704
741
  * @memberof CreateEmbeddingResponse
705
742
  */
706
- 'object'?: string;
743
+ 'object': string;
707
744
  /**
708
745
  *
709
746
  * @type {string}
710
747
  * @memberof CreateEmbeddingResponse
711
748
  */
712
- 'model'?: string;
749
+ 'model': string;
713
750
  /**
714
751
  *
715
752
  * @type {Array<CreateEmbeddingResponseDataInner>}
716
753
  * @memberof CreateEmbeddingResponse
717
754
  */
718
- 'data'?: Array<CreateEmbeddingResponseDataInner>;
755
+ 'data': Array<CreateEmbeddingResponseDataInner>;
756
+ /**
757
+ *
758
+ * @type {CreateEmbeddingResponseUsage}
759
+ * @memberof CreateEmbeddingResponse
760
+ */
761
+ 'usage': CreateEmbeddingResponseUsage;
719
762
  }
720
763
  /**
721
764
  *
@@ -728,19 +771,38 @@ export interface CreateEmbeddingResponseDataInner {
728
771
  * @type {number}
729
772
  * @memberof CreateEmbeddingResponseDataInner
730
773
  */
731
- 'index'?: number;
774
+ 'index': number;
732
775
  /**
733
776
  *
734
777
  * @type {string}
735
778
  * @memberof CreateEmbeddingResponseDataInner
736
779
  */
737
- 'object'?: string;
780
+ 'object': string;
738
781
  /**
739
782
  *
740
783
  * @type {Array<number>}
741
784
  * @memberof CreateEmbeddingResponseDataInner
742
785
  */
743
- 'embedding'?: Array<number>;
786
+ 'embedding': Array<number>;
787
+ }
788
+ /**
789
+ *
790
+ * @export
791
+ * @interface CreateEmbeddingResponseUsage
792
+ */
793
+ export interface CreateEmbeddingResponseUsage {
794
+ /**
795
+ *
796
+ * @type {number}
797
+ * @memberof CreateEmbeddingResponseUsage
798
+ */
799
+ 'prompt_tokens': number;
800
+ /**
801
+ *
802
+ * @type {number}
803
+ * @memberof CreateEmbeddingResponseUsage
804
+ */
805
+ 'total_tokens': number;
744
806
  }
745
807
  /**
746
808
  *
@@ -761,7 +823,7 @@ export interface CreateFineTuneRequest {
761
823
  */
762
824
  'validation_file'?: string | null;
763
825
  /**
764
- * The name of the base model to fine-tune. You can select one of \"ada\", \"babbage\", \"curie\", or \"davinci\". To learn more about these models, see the [Models](https://beta.openai.com/docs/models) documentation.
826
+ * The name of the base model to fine-tune. You can select one of \"ada\", \"babbage\", \"curie\", \"davinci\", or a fine-tuned model created after 2022-04-21. To learn more about these models, see the [Models](https://beta.openai.com/docs/models) documentation.
765
827
  * @type {string}
766
828
  * @memberof CreateFineTuneRequest
767
829
  */
@@ -821,6 +883,232 @@ export interface CreateFineTuneRequest {
821
883
  */
822
884
  'suffix'?: string | null;
823
885
  }
886
+ /**
887
+ *
888
+ * @export
889
+ * @interface CreateImageRequest
890
+ */
891
+ export interface CreateImageRequest {
892
+ /**
893
+ * A text description of the desired image(s). The maximum length is 1000 characters.
894
+ * @type {string}
895
+ * @memberof CreateImageRequest
896
+ */
897
+ 'prompt': string;
898
+ /**
899
+ * The number of images to generate. Must be between 1 and 10.
900
+ * @type {number}
901
+ * @memberof CreateImageRequest
902
+ */
903
+ 'n'?: number | null;
904
+ /**
905
+ * The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
906
+ * @type {string}
907
+ * @memberof CreateImageRequest
908
+ */
909
+ 'size'?: CreateImageRequestSizeEnum;
910
+ /**
911
+ * The format in which the generated images are returned. Must be one of `url` or `b64_json`.
912
+ * @type {string}
913
+ * @memberof CreateImageRequest
914
+ */
915
+ 'response_format'?: CreateImageRequestResponseFormatEnum;
916
+ /**
917
+ * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
918
+ * @type {string}
919
+ * @memberof CreateImageRequest
920
+ */
921
+ 'user'?: string;
922
+ }
923
+
924
+ export const CreateImageRequestSizeEnum = {
925
+ _256x256: '256x256',
926
+ _512x512: '512x512',
927
+ _1024x1024: '1024x1024'
928
+ } as const;
929
+
930
+ export type CreateImageRequestSizeEnum = typeof CreateImageRequestSizeEnum[keyof typeof CreateImageRequestSizeEnum];
931
+ export const CreateImageRequestResponseFormatEnum = {
932
+ Url: 'url',
933
+ B64Json: 'b64_json'
934
+ } as const;
935
+
936
+ export type CreateImageRequestResponseFormatEnum = typeof CreateImageRequestResponseFormatEnum[keyof typeof CreateImageRequestResponseFormatEnum];
937
+
938
+ /**
939
+ *
940
+ * @export
941
+ * @interface CreateModerationRequest
942
+ */
943
+ export interface CreateModerationRequest {
944
+ /**
945
+ *
946
+ * @type {CreateModerationRequestInput}
947
+ * @memberof CreateModerationRequest
948
+ */
949
+ 'input': CreateModerationRequestInput;
950
+ /**
951
+ * Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`. The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.
952
+ * @type {string}
953
+ * @memberof CreateModerationRequest
954
+ */
955
+ 'model'?: string;
956
+ }
957
+ /**
958
+ * @type CreateModerationRequestInput
959
+ * The input text to classify
960
+ * @export
961
+ */
962
+ export type CreateModerationRequestInput = Array<string> | string;
963
+
964
+ /**
965
+ *
966
+ * @export
967
+ * @interface CreateModerationResponse
968
+ */
969
+ export interface CreateModerationResponse {
970
+ /**
971
+ *
972
+ * @type {string}
973
+ * @memberof CreateModerationResponse
974
+ */
975
+ 'id': string;
976
+ /**
977
+ *
978
+ * @type {string}
979
+ * @memberof CreateModerationResponse
980
+ */
981
+ 'model': string;
982
+ /**
983
+ *
984
+ * @type {Array<CreateModerationResponseResultsInner>}
985
+ * @memberof CreateModerationResponse
986
+ */
987
+ 'results': Array<CreateModerationResponseResultsInner>;
988
+ }
989
+ /**
990
+ *
991
+ * @export
992
+ * @interface CreateModerationResponseResultsInner
993
+ */
994
+ export interface CreateModerationResponseResultsInner {
995
+ /**
996
+ *
997
+ * @type {boolean}
998
+ * @memberof CreateModerationResponseResultsInner
999
+ */
1000
+ 'flagged': boolean;
1001
+ /**
1002
+ *
1003
+ * @type {CreateModerationResponseResultsInnerCategories}
1004
+ * @memberof CreateModerationResponseResultsInner
1005
+ */
1006
+ 'categories': CreateModerationResponseResultsInnerCategories;
1007
+ /**
1008
+ *
1009
+ * @type {CreateModerationResponseResultsInnerCategoryScores}
1010
+ * @memberof CreateModerationResponseResultsInner
1011
+ */
1012
+ 'category_scores': CreateModerationResponseResultsInnerCategoryScores;
1013
+ }
1014
+ /**
1015
+ *
1016
+ * @export
1017
+ * @interface CreateModerationResponseResultsInnerCategories
1018
+ */
1019
+ export interface CreateModerationResponseResultsInnerCategories {
1020
+ /**
1021
+ *
1022
+ * @type {boolean}
1023
+ * @memberof CreateModerationResponseResultsInnerCategories
1024
+ */
1025
+ 'hate': boolean;
1026
+ /**
1027
+ *
1028
+ * @type {boolean}
1029
+ * @memberof CreateModerationResponseResultsInnerCategories
1030
+ */
1031
+ 'hate/threatening': boolean;
1032
+ /**
1033
+ *
1034
+ * @type {boolean}
1035
+ * @memberof CreateModerationResponseResultsInnerCategories
1036
+ */
1037
+ 'self-harm': boolean;
1038
+ /**
1039
+ *
1040
+ * @type {boolean}
1041
+ * @memberof CreateModerationResponseResultsInnerCategories
1042
+ */
1043
+ 'sexual': boolean;
1044
+ /**
1045
+ *
1046
+ * @type {boolean}
1047
+ * @memberof CreateModerationResponseResultsInnerCategories
1048
+ */
1049
+ 'sexual/minors': boolean;
1050
+ /**
1051
+ *
1052
+ * @type {boolean}
1053
+ * @memberof CreateModerationResponseResultsInnerCategories
1054
+ */
1055
+ 'violence': boolean;
1056
+ /**
1057
+ *
1058
+ * @type {boolean}
1059
+ * @memberof CreateModerationResponseResultsInnerCategories
1060
+ */
1061
+ 'violence/graphic': boolean;
1062
+ }
1063
+ /**
1064
+ *
1065
+ * @export
1066
+ * @interface CreateModerationResponseResultsInnerCategoryScores
1067
+ */
1068
+ export interface CreateModerationResponseResultsInnerCategoryScores {
1069
+ /**
1070
+ *
1071
+ * @type {number}
1072
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1073
+ */
1074
+ 'hate': number;
1075
+ /**
1076
+ *
1077
+ * @type {number}
1078
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1079
+ */
1080
+ 'hate/threatening': number;
1081
+ /**
1082
+ *
1083
+ * @type {number}
1084
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1085
+ */
1086
+ 'self-harm': number;
1087
+ /**
1088
+ *
1089
+ * @type {number}
1090
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1091
+ */
1092
+ 'sexual': number;
1093
+ /**
1094
+ *
1095
+ * @type {number}
1096
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1097
+ */
1098
+ 'sexual/minors': number;
1099
+ /**
1100
+ *
1101
+ * @type {number}
1102
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1103
+ */
1104
+ 'violence': number;
1105
+ /**
1106
+ *
1107
+ * @type {number}
1108
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1109
+ */
1110
+ 'violence/graphic': number;
1111
+ }
824
1112
  /**
825
1113
  *
826
1114
  * @export
@@ -858,7 +1146,7 @@ export interface CreateSearchRequest {
858
1146
  */
859
1147
  'return_metadata'?: boolean | null;
860
1148
  /**
861
- * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
1149
+ * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
862
1150
  * @type {string}
863
1151
  * @memberof CreateSearchRequest
864
1152
  */
@@ -925,19 +1213,19 @@ export interface DeleteFileResponse {
925
1213
  * @type {string}
926
1214
  * @memberof DeleteFileResponse
927
1215
  */
928
- 'id'?: string;
1216
+ 'id': string;
929
1217
  /**
930
1218
  *
931
1219
  * @type {string}
932
1220
  * @memberof DeleteFileResponse
933
1221
  */
934
- 'object'?: string;
1222
+ 'object': string;
935
1223
  /**
936
1224
  *
937
1225
  * @type {boolean}
938
1226
  * @memberof DeleteFileResponse
939
1227
  */
940
- 'deleted'?: boolean;
1228
+ 'deleted': boolean;
941
1229
  }
942
1230
  /**
943
1231
  *
@@ -950,19 +1238,19 @@ export interface DeleteModelResponse {
950
1238
  * @type {string}
951
1239
  * @memberof DeleteModelResponse
952
1240
  */
953
- 'id'?: string;
1241
+ 'id': string;
954
1242
  /**
955
1243
  *
956
1244
  * @type {string}
957
1245
  * @memberof DeleteModelResponse
958
1246
  */
959
- 'object'?: string;
1247
+ 'object': string;
960
1248
  /**
961
1249
  *
962
1250
  * @type {boolean}
963
1251
  * @memberof DeleteModelResponse
964
1252
  */
965
- 'deleted'?: boolean;
1253
+ 'deleted': boolean;
966
1254
  }
967
1255
  /**
968
1256
  *
@@ -975,25 +1263,25 @@ export interface Engine {
975
1263
  * @type {string}
976
1264
  * @memberof Engine
977
1265
  */
978
- 'id'?: string;
1266
+ 'id': string;
979
1267
  /**
980
1268
  *
981
1269
  * @type {string}
982
1270
  * @memberof Engine
983
1271
  */
984
- 'object'?: string;
1272
+ 'object': string;
985
1273
  /**
986
1274
  *
987
1275
  * @type {number}
988
1276
  * @memberof Engine
989
1277
  */
990
- 'created'?: number;
1278
+ 'created': number | null;
991
1279
  /**
992
1280
  *
993
1281
  * @type {boolean}
994
1282
  * @memberof Engine
995
1283
  */
996
- 'ready'?: boolean;
1284
+ 'ready': boolean;
997
1285
  }
998
1286
  /**
999
1287
  *
@@ -1006,73 +1294,73 @@ export interface FineTune {
1006
1294
  * @type {string}
1007
1295
  * @memberof FineTune
1008
1296
  */
1009
- 'id'?: string;
1297
+ 'id': string;
1010
1298
  /**
1011
1299
  *
1012
1300
  * @type {string}
1013
1301
  * @memberof FineTune
1014
1302
  */
1015
- 'object'?: string;
1303
+ 'object': string;
1016
1304
  /**
1017
1305
  *
1018
1306
  * @type {number}
1019
1307
  * @memberof FineTune
1020
1308
  */
1021
- 'created_at'?: number;
1309
+ 'created_at': number;
1022
1310
  /**
1023
1311
  *
1024
1312
  * @type {number}
1025
1313
  * @memberof FineTune
1026
1314
  */
1027
- 'updated_at'?: number;
1315
+ 'updated_at': number;
1028
1316
  /**
1029
1317
  *
1030
1318
  * @type {string}
1031
1319
  * @memberof FineTune
1032
1320
  */
1033
- 'model'?: string;
1321
+ 'model': string;
1034
1322
  /**
1035
1323
  *
1036
1324
  * @type {string}
1037
1325
  * @memberof FineTune
1038
1326
  */
1039
- 'fine_tuned_model'?: string | null;
1327
+ 'fine_tuned_model': string | null;
1040
1328
  /**
1041
1329
  *
1042
1330
  * @type {string}
1043
1331
  * @memberof FineTune
1044
1332
  */
1045
- 'organization_id'?: string;
1333
+ 'organization_id': string;
1046
1334
  /**
1047
1335
  *
1048
1336
  * @type {string}
1049
1337
  * @memberof FineTune
1050
1338
  */
1051
- 'status'?: string;
1339
+ 'status': string;
1052
1340
  /**
1053
1341
  *
1054
1342
  * @type {object}
1055
1343
  * @memberof FineTune
1056
1344
  */
1057
- 'hyperparams'?: object;
1345
+ 'hyperparams': object;
1058
1346
  /**
1059
1347
  *
1060
1348
  * @type {Array<OpenAIFile>}
1061
1349
  * @memberof FineTune
1062
1350
  */
1063
- 'training_files'?: Array<OpenAIFile>;
1351
+ 'training_files': Array<OpenAIFile>;
1064
1352
  /**
1065
1353
  *
1066
1354
  * @type {Array<OpenAIFile>}
1067
1355
  * @memberof FineTune
1068
1356
  */
1069
- 'validation_files'?: Array<OpenAIFile>;
1357
+ 'validation_files': Array<OpenAIFile>;
1070
1358
  /**
1071
1359
  *
1072
1360
  * @type {Array<OpenAIFile>}
1073
1361
  * @memberof FineTune
1074
1362
  */
1075
- 'result_files'?: Array<OpenAIFile>;
1363
+ 'result_files': Array<OpenAIFile>;
1076
1364
  /**
1077
1365
  *
1078
1366
  * @type {Array<FineTuneEvent>}
@@ -1091,25 +1379,63 @@ export interface FineTuneEvent {
1091
1379
  * @type {string}
1092
1380
  * @memberof FineTuneEvent
1093
1381
  */
1094
- 'object'?: string;
1382
+ 'object': string;
1095
1383
  /**
1096
1384
  *
1097
1385
  * @type {number}
1098
1386
  * @memberof FineTuneEvent
1099
1387
  */
1100
- 'created_at'?: number;
1388
+ 'created_at': number;
1101
1389
  /**
1102
1390
  *
1103
1391
  * @type {string}
1104
1392
  * @memberof FineTuneEvent
1105
1393
  */
1106
- 'level'?: string;
1394
+ 'level': string;
1107
1395
  /**
1108
1396
  *
1109
1397
  * @type {string}
1110
1398
  * @memberof FineTuneEvent
1111
1399
  */
1112
- 'message'?: string;
1400
+ 'message': string;
1401
+ }
1402
+ /**
1403
+ *
1404
+ * @export
1405
+ * @interface ImagesResponse
1406
+ */
1407
+ export interface ImagesResponse {
1408
+ /**
1409
+ *
1410
+ * @type {number}
1411
+ * @memberof ImagesResponse
1412
+ */
1413
+ 'created': number;
1414
+ /**
1415
+ *
1416
+ * @type {Array<ImagesResponseDataInner>}
1417
+ * @memberof ImagesResponse
1418
+ */
1419
+ 'data': Array<ImagesResponseDataInner>;
1420
+ }
1421
+ /**
1422
+ *
1423
+ * @export
1424
+ * @interface ImagesResponseDataInner
1425
+ */
1426
+ export interface ImagesResponseDataInner {
1427
+ /**
1428
+ *
1429
+ * @type {string}
1430
+ * @memberof ImagesResponseDataInner
1431
+ */
1432
+ 'url'?: string;
1433
+ /**
1434
+ *
1435
+ * @type {string}
1436
+ * @memberof ImagesResponseDataInner
1437
+ */
1438
+ 'b64_json'?: string;
1113
1439
  }
1114
1440
  /**
1115
1441
  *
@@ -1122,13 +1448,13 @@ export interface ListEnginesResponse {
1122
1448
  * @type {string}
1123
1449
  * @memberof ListEnginesResponse
1124
1450
  */
1125
- 'object'?: string;
1451
+ 'object': string;
1126
1452
  /**
1127
1453
  *
1128
1454
  * @type {Array<Engine>}
1129
1455
  * @memberof ListEnginesResponse
1130
1456
  */
1131
- 'data'?: Array<Engine>;
1457
+ 'data': Array<Engine>;
1132
1458
  }
1133
1459
  /**
1134
1460
  *
@@ -1141,13 +1467,13 @@ export interface ListFilesResponse {
1141
1467
  * @type {string}
1142
1468
  * @memberof ListFilesResponse
1143
1469
  */
1144
- 'object'?: string;
1470
+ 'object': string;
1145
1471
  /**
1146
1472
  *
1147
1473
  * @type {Array<OpenAIFile>}
1148
1474
  * @memberof ListFilesResponse
1149
1475
  */
1150
- 'data'?: Array<OpenAIFile>;
1476
+ 'data': Array<OpenAIFile>;
1151
1477
  }
1152
1478
  /**
1153
1479
  *
@@ -1160,13 +1486,13 @@ export interface ListFineTuneEventsResponse {
1160
1486
  * @type {string}
1161
1487
  * @memberof ListFineTuneEventsResponse
1162
1488
  */
1163
- 'object'?: string;
1489
+ 'object': string;
1164
1490
  /**
1165
1491
  *
1166
1492
  * @type {Array<FineTuneEvent>}
1167
1493
  * @memberof ListFineTuneEventsResponse
1168
1494
  */
1169
- 'data'?: Array<FineTuneEvent>;
1495
+ 'data': Array<FineTuneEvent>;
1170
1496
  }
1171
1497
  /**
1172
1498
  *
@@ -1179,13 +1505,13 @@ export interface ListFineTunesResponse {
1179
1505
  * @type {string}
1180
1506
  * @memberof ListFineTunesResponse
1181
1507
  */
1182
- 'object'?: string;
1508
+ 'object': string;
1183
1509
  /**
1184
1510
  *
1185
1511
  * @type {Array<FineTune>}
1186
1512
  * @memberof ListFineTunesResponse
1187
1513
  */
1188
- 'data'?: Array<FineTune>;
1514
+ 'data': Array<FineTune>;
1189
1515
  }
1190
1516
  /**
1191
1517
  *
@@ -1198,13 +1524,13 @@ export interface ListModelsResponse {
1198
1524
  * @type {string}
1199
1525
  * @memberof ListModelsResponse
1200
1526
  */
1201
- 'object'?: string;
1527
+ 'object': string;
1202
1528
  /**
1203
1529
  *
1204
1530
  * @type {Array<Model>}
1205
1531
  * @memberof ListModelsResponse
1206
1532
  */
1207
- 'data'?: Array<Model>;
1533
+ 'data': Array<Model>;
1208
1534
  }
1209
1535
  /**
1210
1536
  *
@@ -1217,25 +1543,25 @@ export interface Model {
1217
1543
  * @type {string}
1218
1544
  * @memberof Model
1219
1545
  */
1220
- 'id'?: string;
1546
+ 'id': string;
1221
1547
  /**
1222
1548
  *
1223
1549
  * @type {string}
1224
1550
  * @memberof Model
1225
1551
  */
1226
- 'object'?: string;
1552
+ 'object': string;
1227
1553
  /**
1228
1554
  *
1229
1555
  * @type {number}
1230
1556
  * @memberof Model
1231
1557
  */
1232
- 'created'?: number;
1558
+ 'created': number;
1233
1559
  /**
1234
1560
  *
1235
1561
  * @type {string}
1236
1562
  * @memberof Model
1237
1563
  */
1238
- 'owned_by'?: string;
1564
+ 'owned_by': string;
1239
1565
  }
1240
1566
  /**
1241
1567
  *
@@ -1248,37 +1574,37 @@ export interface OpenAIFile {
1248
1574
  * @type {string}
1249
1575
  * @memberof OpenAIFile
1250
1576
  */
1251
- 'id'?: string;
1577
+ 'id': string;
1252
1578
  /**
1253
1579
  *
1254
1580
  * @type {string}
1255
1581
  * @memberof OpenAIFile
1256
1582
  */
1257
- 'object'?: string;
1583
+ 'object': string;
1258
1584
  /**
1259
1585
  *
1260
1586
  * @type {number}
1261
1587
  * @memberof OpenAIFile
1262
1588
  */
1263
- 'bytes'?: number;
1589
+ 'bytes': number;
1264
1590
  /**
1265
1591
  *
1266
1592
  * @type {number}
1267
1593
  * @memberof OpenAIFile
1268
1594
  */
1269
- 'created_at'?: number;
1595
+ 'created_at': number;
1270
1596
  /**
1271
1597
  *
1272
1598
  * @type {string}
1273
1599
  * @memberof OpenAIFile
1274
1600
  */
1275
- 'filename'?: string;
1601
+ 'filename': string;
1276
1602
  /**
1277
1603
  *
1278
1604
  * @type {string}
1279
1605
  * @memberof OpenAIFile
1280
1606
  */
1281
- 'purpose'?: string;
1607
+ 'purpose': string;
1282
1608
  /**
1283
1609
  *
1284
1610
  * @type {string}
@@ -1518,12 +1844,12 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1518
1844
  /**
1519
1845
  *
1520
1846
  * @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.
1521
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
1847
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
1522
1848
  * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
1523
1849
  * @param {*} [options] Override http request option.
1524
1850
  * @throws {RequiredError}
1525
1851
  */
1526
- createFile: async (file: any, purpose: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1852
+ createFile: async (file: File, purpose: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1527
1853
  // verify required parameter 'file' is not null or undefined
1528
1854
  assertParamExists('createFile', 'file', file)
1529
1855
  // verify required parameter 'purpose' is not null or undefined
@@ -1599,6 +1925,214 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1599
1925
  options: localVarRequestOptions,
1600
1926
  };
1601
1927
  },
1928
+ /**
1929
+ *
1930
+ * @summary Creates an image given a prompt.
1931
+ * @param {CreateImageRequest} createImageRequest
1932
+ * @param {*} [options] Override http request option.
1933
+ * @throws {RequiredError}
1934
+ */
1935
+ createImage: async (createImageRequest: CreateImageRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1936
+ // verify required parameter 'createImageRequest' is not null or undefined
1937
+ assertParamExists('createImage', 'createImageRequest', createImageRequest)
1938
+ const localVarPath = `/images/generations`;
1939
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1940
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1941
+ let baseOptions;
1942
+ if (configuration) {
1943
+ baseOptions = configuration.baseOptions;
1944
+ }
1945
+
1946
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1947
+ const localVarHeaderParameter = {} as any;
1948
+ const localVarQueryParameter = {} as any;
1949
+
1950
+
1951
+
1952
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1953
+
1954
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1955
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1956
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1957
+ localVarRequestOptions.data = serializeDataIfNeeded(createImageRequest, localVarRequestOptions, configuration)
1958
+
1959
+ return {
1960
+ url: toPathString(localVarUrlObj),
1961
+ options: localVarRequestOptions,
1962
+ };
1963
+ },
1964
+ /**
1965
+ *
1966
+ * @summary Creates an edited or extended image given an original image and a prompt.
1967
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square.
1968
+ * @param {File} mask An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where &#x60;image&#x60; should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as &#x60;image&#x60;.
1969
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
1970
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1971
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
1972
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
1973
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
1974
+ * @param {*} [options] Override http request option.
1975
+ * @throws {RequiredError}
1976
+ */
1977
+ createImageEdit: async (image: File, mask: File, prompt: string, n?: number, size?: string, responseFormat?: string, user?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1978
+ // verify required parameter 'image' is not null or undefined
1979
+ assertParamExists('createImageEdit', 'image', image)
1980
+ // verify required parameter 'mask' is not null or undefined
1981
+ assertParamExists('createImageEdit', 'mask', mask)
1982
+ // verify required parameter 'prompt' is not null or undefined
1983
+ assertParamExists('createImageEdit', 'prompt', prompt)
1984
+ const localVarPath = `/images/edits`;
1985
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1986
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1987
+ let baseOptions;
1988
+ if (configuration) {
1989
+ baseOptions = configuration.baseOptions;
1990
+ }
1991
+
1992
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1993
+ const localVarHeaderParameter = {} as any;
1994
+ const localVarQueryParameter = {} as any;
1995
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
1996
+
1997
+
1998
+ if (image !== undefined) {
1999
+ localVarFormParams.append('image', image as any);
2000
+ }
2001
+
2002
+ if (mask !== undefined) {
2003
+ localVarFormParams.append('mask', mask as any);
2004
+ }
2005
+
2006
+ if (prompt !== undefined) {
2007
+ localVarFormParams.append('prompt', prompt as any);
2008
+ }
2009
+
2010
+ if (n !== undefined) {
2011
+ localVarFormParams.append('n', n as any);
2012
+ }
2013
+
2014
+ if (size !== undefined) {
2015
+ localVarFormParams.append('size', size as any);
2016
+ }
2017
+
2018
+ if (responseFormat !== undefined) {
2019
+ localVarFormParams.append('response_format', responseFormat as any);
2020
+ }
2021
+
2022
+ if (user !== undefined) {
2023
+ localVarFormParams.append('user', user as any);
2024
+ }
2025
+
2026
+
2027
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2028
+
2029
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2030
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2031
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2032
+ localVarRequestOptions.data = localVarFormParams;
2033
+
2034
+ return {
2035
+ url: toPathString(localVarUrlObj),
2036
+ options: localVarRequestOptions,
2037
+ };
2038
+ },
2039
+ /**
2040
+ *
2041
+ * @summary Creates a variation of a given image.
2042
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
2043
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2044
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2045
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
2046
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
2047
+ * @param {*} [options] Override http request option.
2048
+ * @throws {RequiredError}
2049
+ */
2050
+ createImageVariation: async (image: File, n?: number, size?: string, responseFormat?: string, user?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2051
+ // verify required parameter 'image' is not null or undefined
2052
+ assertParamExists('createImageVariation', 'image', image)
2053
+ const localVarPath = `/images/variations`;
2054
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2055
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2056
+ let baseOptions;
2057
+ if (configuration) {
2058
+ baseOptions = configuration.baseOptions;
2059
+ }
2060
+
2061
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2062
+ const localVarHeaderParameter = {} as any;
2063
+ const localVarQueryParameter = {} as any;
2064
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2065
+
2066
+
2067
+ if (image !== undefined) {
2068
+ localVarFormParams.append('image', image as any);
2069
+ }
2070
+
2071
+ if (n !== undefined) {
2072
+ localVarFormParams.append('n', n as any);
2073
+ }
2074
+
2075
+ if (size !== undefined) {
2076
+ localVarFormParams.append('size', size as any);
2077
+ }
2078
+
2079
+ if (responseFormat !== undefined) {
2080
+ localVarFormParams.append('response_format', responseFormat as any);
2081
+ }
2082
+
2083
+ if (user !== undefined) {
2084
+ localVarFormParams.append('user', user as any);
2085
+ }
2086
+
2087
+
2088
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2089
+
2090
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2091
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2092
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2093
+ localVarRequestOptions.data = localVarFormParams;
2094
+
2095
+ return {
2096
+ url: toPathString(localVarUrlObj),
2097
+ options: localVarRequestOptions,
2098
+ };
2099
+ },
2100
+ /**
2101
+ *
2102
+ * @summary Classifies if text violates OpenAI\'s Content Policy
2103
+ * @param {CreateModerationRequest} createModerationRequest
2104
+ * @param {*} [options] Override http request option.
2105
+ * @throws {RequiredError}
2106
+ */
2107
+ createModeration: async (createModerationRequest: CreateModerationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2108
+ // verify required parameter 'createModerationRequest' is not null or undefined
2109
+ assertParamExists('createModeration', 'createModerationRequest', createModerationRequest)
2110
+ const localVarPath = `/moderations`;
2111
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2112
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2113
+ let baseOptions;
2114
+ if (configuration) {
2115
+ baseOptions = configuration.baseOptions;
2116
+ }
2117
+
2118
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2119
+ const localVarHeaderParameter = {} as any;
2120
+ const localVarQueryParameter = {} as any;
2121
+
2122
+
2123
+
2124
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2125
+
2126
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2127
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2128
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2129
+ localVarRequestOptions.data = serializeDataIfNeeded(createModerationRequest, localVarRequestOptions, configuration)
2130
+
2131
+ return {
2132
+ url: toPathString(localVarUrlObj),
2133
+ options: localVarRequestOptions,
2134
+ };
2135
+ },
1602
2136
  /**
1603
2137
  *
1604
2138
  * @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.
@@ -2120,12 +2654,12 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2120
2654
  /**
2121
2655
  *
2122
2656
  * @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.
2123
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2657
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2124
2658
  * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
2125
2659
  * @param {*} [options] Override http request option.
2126
2660
  * @throws {RequiredError}
2127
2661
  */
2128
- async createFile(file: any, purpose: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>> {
2662
+ async createFile(file: File, purpose: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>> {
2129
2663
  const localVarAxiosArgs = await localVarAxiosParamCreator.createFile(file, purpose, options);
2130
2664
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2131
2665
  },
@@ -2140,6 +2674,60 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2140
2674
  const localVarAxiosArgs = await localVarAxiosParamCreator.createFineTune(createFineTuneRequest, options);
2141
2675
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2142
2676
  },
2677
+ /**
2678
+ *
2679
+ * @summary Creates an image given a prompt.
2680
+ * @param {CreateImageRequest} createImageRequest
2681
+ * @param {*} [options] Override http request option.
2682
+ * @throws {RequiredError}
2683
+ */
2684
+ async createImage(createImageRequest: CreateImageRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImagesResponse>> {
2685
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImage(createImageRequest, options);
2686
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2687
+ },
2688
+ /**
2689
+ *
2690
+ * @summary Creates an edited or extended image given an original image and a prompt.
2691
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square.
2692
+ * @param {File} mask An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where &#x60;image&#x60; should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as &#x60;image&#x60;.
2693
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
2694
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2695
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2696
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
2697
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
2698
+ * @param {*} [options] Override http request option.
2699
+ * @throws {RequiredError}
2700
+ */
2701
+ async createImageEdit(image: File, mask: File, prompt: string, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImagesResponse>> {
2702
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImageEdit(image, mask, prompt, n, size, responseFormat, user, options);
2703
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2704
+ },
2705
+ /**
2706
+ *
2707
+ * @summary Creates a variation of a given image.
2708
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
2709
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2710
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2711
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
2712
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
2713
+ * @param {*} [options] Override http request option.
2714
+ * @throws {RequiredError}
2715
+ */
2716
+ async createImageVariation(image: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImagesResponse>> {
2717
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImageVariation(image, n, size, responseFormat, user, options);
2718
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2719
+ },
2720
+ /**
2721
+ *
2722
+ * @summary Classifies if text violates OpenAI\'s Content Policy
2723
+ * @param {CreateModerationRequest} createModerationRequest
2724
+ * @param {*} [options] Override http request option.
2725
+ * @throws {RequiredError}
2726
+ */
2727
+ async createModeration(createModerationRequest: CreateModerationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateModerationResponse>> {
2728
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createModeration(createModerationRequest, options);
2729
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2730
+ },
2143
2731
  /**
2144
2732
  *
2145
2733
  * @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.
@@ -2359,12 +2947,12 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2359
2947
  /**
2360
2948
  *
2361
2949
  * @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.
2362
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2950
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2363
2951
  * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
2364
2952
  * @param {*} [options] Override http request option.
2365
2953
  * @throws {RequiredError}
2366
2954
  */
2367
- createFile(file: any, purpose: string, options?: any): AxiosPromise<OpenAIFile> {
2955
+ createFile(file: File, purpose: string, options?: any): AxiosPromise<OpenAIFile> {
2368
2956
  return localVarFp.createFile(file, purpose, options).then((request) => request(axios, basePath));
2369
2957
  },
2370
2958
  /**
@@ -2377,6 +2965,56 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2377
2965
  createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: any): AxiosPromise<FineTune> {
2378
2966
  return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios, basePath));
2379
2967
  },
2968
+ /**
2969
+ *
2970
+ * @summary Creates an image given a prompt.
2971
+ * @param {CreateImageRequest} createImageRequest
2972
+ * @param {*} [options] Override http request option.
2973
+ * @throws {RequiredError}
2974
+ */
2975
+ createImage(createImageRequest: CreateImageRequest, options?: any): AxiosPromise<ImagesResponse> {
2976
+ return localVarFp.createImage(createImageRequest, options).then((request) => request(axios, basePath));
2977
+ },
2978
+ /**
2979
+ *
2980
+ * @summary Creates an edited or extended image given an original image and a prompt.
2981
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square.
2982
+ * @param {File} mask An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where &#x60;image&#x60; should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as &#x60;image&#x60;.
2983
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
2984
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2985
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2986
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
2987
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
2988
+ * @param {*} [options] Override http request option.
2989
+ * @throws {RequiredError}
2990
+ */
2991
+ createImageEdit(image: File, mask: File, prompt: string, n?: number, size?: string, responseFormat?: string, user?: string, options?: any): AxiosPromise<ImagesResponse> {
2992
+ return localVarFp.createImageEdit(image, mask, prompt, n, size, responseFormat, user, options).then((request) => request(axios, basePath));
2993
+ },
2994
+ /**
2995
+ *
2996
+ * @summary Creates a variation of a given image.
2997
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
2998
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2999
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3000
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3001
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
3002
+ * @param {*} [options] Override http request option.
3003
+ * @throws {RequiredError}
3004
+ */
3005
+ createImageVariation(image: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: any): AxiosPromise<ImagesResponse> {
3006
+ return localVarFp.createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(axios, basePath));
3007
+ },
3008
+ /**
3009
+ *
3010
+ * @summary Classifies if text violates OpenAI\'s Content Policy
3011
+ * @param {CreateModerationRequest} createModerationRequest
3012
+ * @param {*} [options] Override http request option.
3013
+ * @throws {RequiredError}
3014
+ */
3015
+ createModeration(createModerationRequest: CreateModerationRequest, options?: any): AxiosPromise<CreateModerationResponse> {
3016
+ return localVarFp.createModeration(createModerationRequest, options).then((request) => request(axios, basePath));
3017
+ },
2380
3018
  /**
2381
3019
  *
2382
3020
  * @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.
@@ -2595,13 +3233,13 @@ export class OpenAIApi extends BaseAPI {
2595
3233
  /**
2596
3234
  *
2597
3235
  * @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.
2598
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
3236
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2599
3237
  * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
2600
3238
  * @param {*} [options] Override http request option.
2601
3239
  * @throws {RequiredError}
2602
3240
  * @memberof OpenAIApi
2603
3241
  */
2604
- public createFile(file: any, purpose: string, options?: AxiosRequestConfig) {
3242
+ public createFile(file: File, purpose: string, options?: AxiosRequestConfig) {
2605
3243
  return OpenAIApiFp(this.configuration).createFile(file, purpose, options).then((request) => request(this.axios, this.basePath));
2606
3244
  }
2607
3245
 
@@ -2617,6 +3255,64 @@ export class OpenAIApi extends BaseAPI {
2617
3255
  return OpenAIApiFp(this.configuration).createFineTune(createFineTuneRequest, options).then((request) => request(this.axios, this.basePath));
2618
3256
  }
2619
3257
 
3258
+ /**
3259
+ *
3260
+ * @summary Creates an image given a prompt.
3261
+ * @param {CreateImageRequest} createImageRequest
3262
+ * @param {*} [options] Override http request option.
3263
+ * @throws {RequiredError}
3264
+ * @memberof OpenAIApi
3265
+ */
3266
+ public createImage(createImageRequest: CreateImageRequest, options?: AxiosRequestConfig) {
3267
+ return OpenAIApiFp(this.configuration).createImage(createImageRequest, options).then((request) => request(this.axios, this.basePath));
3268
+ }
3269
+
3270
+ /**
3271
+ *
3272
+ * @summary Creates an edited or extended image given an original image and a prompt.
3273
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square.
3274
+ * @param {File} mask An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where &#x60;image&#x60; should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as &#x60;image&#x60;.
3275
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
3276
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3277
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3278
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3279
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
3280
+ * @param {*} [options] Override http request option.
3281
+ * @throws {RequiredError}
3282
+ * @memberof OpenAIApi
3283
+ */
3284
+ public createImageEdit(image: File, mask: File, prompt: string, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig) {
3285
+ return OpenAIApiFp(this.configuration).createImageEdit(image, mask, prompt, n, size, responseFormat, user, options).then((request) => request(this.axios, this.basePath));
3286
+ }
3287
+
3288
+ /**
3289
+ *
3290
+ * @summary Creates a variation of a given image.
3291
+ * @param {File} image The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
3292
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3293
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3294
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3295
+ * @param {string} [user] A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).
3296
+ * @param {*} [options] Override http request option.
3297
+ * @throws {RequiredError}
3298
+ * @memberof OpenAIApi
3299
+ */
3300
+ public createImageVariation(image: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig) {
3301
+ return OpenAIApiFp(this.configuration).createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(this.axios, this.basePath));
3302
+ }
3303
+
3304
+ /**
3305
+ *
3306
+ * @summary Classifies if text violates OpenAI\'s Content Policy
3307
+ * @param {CreateModerationRequest} createModerationRequest
3308
+ * @param {*} [options] Override http request option.
3309
+ * @throws {RequiredError}
3310
+ * @memberof OpenAIApi
3311
+ */
3312
+ public createModeration(createModerationRequest: CreateModerationRequest, options?: AxiosRequestConfig) {
3313
+ return OpenAIApiFp(this.configuration).createModeration(createModerationRequest, options).then((request) => request(this.axios, this.basePath));
3314
+ }
3315
+
2620
3316
  /**
2621
3317
  *
2622
3318
  * @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.