openai 3.0.1 → 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/.github/ISSUE_TEMPLATE/bug_report.yml +56 -0
- package/.github/ISSUE_TEMPLATE/config.yml +7 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +20 -0
- package/.openapi-generator/VERSION +1 -1
- package/api.ts +397 -6
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +231 -6
- package/dist/api.js +285 -2
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Create a report to help us improve
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to fill out this bug report!
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: what-happened
|
|
11
|
+
attributes:
|
|
12
|
+
label: Describe the bug
|
|
13
|
+
description: A clear and concise description of what the bug is, and any additional context.
|
|
14
|
+
placeholder: Tell us what you see!
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: textarea
|
|
18
|
+
id: repro-steps
|
|
19
|
+
attributes:
|
|
20
|
+
label: To Reproduce
|
|
21
|
+
description: Steps to reproduce the behavior.
|
|
22
|
+
placeholder: |
|
|
23
|
+
1. Fetch a '...'
|
|
24
|
+
2. Update the '....'
|
|
25
|
+
3. See error
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
28
|
+
- type: textarea
|
|
29
|
+
id: code-snippets
|
|
30
|
+
attributes:
|
|
31
|
+
label: Code snippets
|
|
32
|
+
description: If applicable, add code snippets to help explain your problem.
|
|
33
|
+
render: JavaScript
|
|
34
|
+
validations:
|
|
35
|
+
required: false
|
|
36
|
+
- type: input
|
|
37
|
+
id: os
|
|
38
|
+
attributes:
|
|
39
|
+
label: OS
|
|
40
|
+
placeholder: macOS
|
|
41
|
+
validations:
|
|
42
|
+
required: true
|
|
43
|
+
- type: input
|
|
44
|
+
id: language-version
|
|
45
|
+
attributes:
|
|
46
|
+
label: Node version
|
|
47
|
+
placeholder: Node v16.14.2
|
|
48
|
+
validations:
|
|
49
|
+
required: true
|
|
50
|
+
- type: input
|
|
51
|
+
id: lib-version
|
|
52
|
+
attributes:
|
|
53
|
+
label: Library version
|
|
54
|
+
placeholder: openai v3.0.1
|
|
55
|
+
validations:
|
|
56
|
+
required: true
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: OpenAI support
|
|
4
|
+
url: https://help.openai.com/
|
|
5
|
+
about: |
|
|
6
|
+
Please only file issues here that you believe represent actual bugs or feature requests for the OpenAI Node library.
|
|
7
|
+
If you're having general trouble with the OpenAI API, please visit our help center to get support.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest an idea for this library
|
|
3
|
+
labels: ["feature-request"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to fill out this feature request!
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: feature
|
|
11
|
+
attributes:
|
|
12
|
+
label: Describe the feature or improvement you're requesting
|
|
13
|
+
description: A clear and concise description of what you want to happen.
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: context
|
|
18
|
+
attributes:
|
|
19
|
+
label: Additional context
|
|
20
|
+
description: Add any other context about the feature request here.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
6.2.
|
|
1
|
+
6.2.1
|
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
|
|
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).
|
|
@@ -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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -716,7 +716,7 @@ export interface CreateEmbeddingRequest {
|
|
|
716
716
|
*/
|
|
717
717
|
'input': CreateEmbeddingRequestInput;
|
|
718
718
|
/**
|
|
719
|
-
* 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).
|
|
720
720
|
* @type {string}
|
|
721
721
|
* @memberof CreateEmbeddingRequest
|
|
722
722
|
*/
|
|
@@ -883,6 +883,58 @@ export interface CreateFineTuneRequest {
|
|
|
883
883
|
*/
|
|
884
884
|
'suffix'?: string | null;
|
|
885
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
|
+
|
|
886
938
|
/**
|
|
887
939
|
*
|
|
888
940
|
* @export
|
|
@@ -1094,7 +1146,7 @@ export interface CreateSearchRequest {
|
|
|
1094
1146
|
*/
|
|
1095
1147
|
'return_metadata'?: boolean | null;
|
|
1096
1148
|
/**
|
|
1097
|
-
* 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).
|
|
1098
1150
|
* @type {string}
|
|
1099
1151
|
* @memberof CreateSearchRequest
|
|
1100
1152
|
*/
|
|
@@ -1347,6 +1399,44 @@ export interface FineTuneEvent {
|
|
|
1347
1399
|
*/
|
|
1348
1400
|
'message': string;
|
|
1349
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;
|
|
1439
|
+
}
|
|
1350
1440
|
/**
|
|
1351
1441
|
*
|
|
1352
1442
|
* @export
|
|
@@ -1835,6 +1925,178 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
1835
1925
|
options: localVarRequestOptions,
|
|
1836
1926
|
};
|
|
1837
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 `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
1972
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
2045
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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
|
+
},
|
|
1838
2100
|
/**
|
|
1839
2101
|
*
|
|
1840
2102
|
* @summary Classifies if text violates OpenAI\'s Content Policy
|
|
@@ -2412,6 +2674,49 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
|
|
|
2412
2674
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createFineTune(createFineTuneRequest, options);
|
|
2413
2675
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
2414
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 `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
2696
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
2711
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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
|
+
},
|
|
2415
2720
|
/**
|
|
2416
2721
|
*
|
|
2417
2722
|
* @summary Classifies if text violates OpenAI\'s Content Policy
|
|
@@ -2660,6 +2965,46 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
|
|
|
2660
2965
|
createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: any): AxiosPromise<FineTune> {
|
|
2661
2966
|
return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios, basePath));
|
|
2662
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 `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
2986
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
3000
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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
|
+
},
|
|
2663
3008
|
/**
|
|
2664
3009
|
*
|
|
2665
3010
|
* @summary Classifies if text violates OpenAI\'s Content Policy
|
|
@@ -2910,6 +3255,52 @@ export class OpenAIApi extends BaseAPI {
|
|
|
2910
3255
|
return OpenAIApiFp(this.configuration).createFineTune(createFineTuneRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2911
3256
|
}
|
|
2912
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 `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
3278
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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 `256x256`, `512x512`, or `1024x1024`.
|
|
3294
|
+
* @param {string} [responseFormat] The format in which the generated images are returned. Must be one of `url` or `b64_json`.
|
|
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
|
+
|
|
2913
3304
|
/**
|
|
2914
3305
|
*
|
|
2915
3306
|
* @summary Classifies if text violates OpenAI\'s Content Policy
|
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
|
|
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).
|
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
|
|
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).
|
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
|
|
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).
|