openai 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.1.0
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,13 +13,77 @@
13
13
  */
14
14
 
15
15
 
16
- import { Configuration } from './configuration';
17
- import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
16
+ import type { Configuration } from './configuration';
17
+ import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
18
19
  // Some imports not used depending on template conditions
19
20
  // @ts-ignore
20
21
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22
+ import type { RequestArgs } from './base';
21
23
  // @ts-ignore
22
- import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
24
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
25
+
26
+ /**
27
+ *
28
+ * @export
29
+ * @interface ChatCompletionRequestMessage
30
+ */
31
+ export interface ChatCompletionRequestMessage {
32
+ /**
33
+ * The role of the author of this message.
34
+ * @type {string}
35
+ * @memberof ChatCompletionRequestMessage
36
+ */
37
+ 'role': ChatCompletionRequestMessageRoleEnum;
38
+ /**
39
+ * The contents of the message
40
+ * @type {string}
41
+ * @memberof ChatCompletionRequestMessage
42
+ */
43
+ 'content': string;
44
+ /**
45
+ * The name of the user in a multi-user chat
46
+ * @type {string}
47
+ * @memberof ChatCompletionRequestMessage
48
+ */
49
+ 'name'?: string;
50
+ }
51
+
52
+ export const ChatCompletionRequestMessageRoleEnum = {
53
+ System: 'system',
54
+ User: 'user',
55
+ Assistant: 'assistant'
56
+ } as const;
57
+
58
+ export type ChatCompletionRequestMessageRoleEnum = typeof ChatCompletionRequestMessageRoleEnum[keyof typeof ChatCompletionRequestMessageRoleEnum];
59
+
60
+ /**
61
+ *
62
+ * @export
63
+ * @interface ChatCompletionResponseMessage
64
+ */
65
+ export interface ChatCompletionResponseMessage {
66
+ /**
67
+ * The role of the author of this message.
68
+ * @type {string}
69
+ * @memberof ChatCompletionResponseMessage
70
+ */
71
+ 'role': ChatCompletionResponseMessageRoleEnum;
72
+ /**
73
+ * The contents of the message
74
+ * @type {string}
75
+ * @memberof ChatCompletionResponseMessage
76
+ */
77
+ 'content': string;
78
+ }
79
+
80
+ export const ChatCompletionResponseMessageRoleEnum = {
81
+ System: 'system',
82
+ User: 'user',
83
+ Assistant: 'assistant'
84
+ } as const;
85
+
86
+ export type ChatCompletionResponseMessageRoleEnum = typeof ChatCompletionResponseMessageRoleEnum[keyof typeof ChatCompletionResponseMessageRoleEnum];
23
87
 
24
88
  /**
25
89
  *
@@ -76,7 +140,7 @@ export interface CreateAnswerRequest {
76
140
  */
77
141
  'max_rerank'?: number | null;
78
142
  /**
79
- * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values mean the model will take more risks and value 0 (argmax sampling) works better for scenarios with a well-defined answer.
143
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
80
144
  * @type {number}
81
145
  * @memberof CreateAnswerRequest
82
146
  */
@@ -130,7 +194,7 @@ export interface CreateAnswerRequest {
130
194
  */
131
195
  'expand'?: Array<any> | null;
132
196
  /**
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).
197
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
134
198
  * @type {string}
135
199
  * @memberof CreateAnswerRequest
136
200
  */
@@ -205,6 +269,160 @@ export interface CreateAnswerResponseSelectedDocumentsInner {
205
269
  */
206
270
  'text'?: string;
207
271
  }
272
+ /**
273
+ *
274
+ * @export
275
+ * @interface CreateChatCompletionRequest
276
+ */
277
+ export interface CreateChatCompletionRequest {
278
+ /**
279
+ * ID of the model to use. Currently, only `gpt-3.5-turbo` and `gpt-3.5-turbo-0301` are supported.
280
+ * @type {string}
281
+ * @memberof CreateChatCompletionRequest
282
+ */
283
+ 'model': string;
284
+ /**
285
+ * The messages to generate chat completions for, in the [chat format](/docs/guides/chat/introduction).
286
+ * @type {Array<ChatCompletionRequestMessage>}
287
+ * @memberof CreateChatCompletionRequest
288
+ */
289
+ 'messages': Array<ChatCompletionRequestMessage>;
290
+ /**
291
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both.
292
+ * @type {number}
293
+ * @memberof CreateChatCompletionRequest
294
+ */
295
+ 'temperature'?: number | null;
296
+ /**
297
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.
298
+ * @type {number}
299
+ * @memberof CreateChatCompletionRequest
300
+ */
301
+ 'top_p'?: number | null;
302
+ /**
303
+ * How many chat completion choices to generate for each input message.
304
+ * @type {number}
305
+ * @memberof CreateChatCompletionRequest
306
+ */
307
+ 'n'?: number | null;
308
+ /**
309
+ * If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message.
310
+ * @type {boolean}
311
+ * @memberof CreateChatCompletionRequest
312
+ */
313
+ 'stream'?: boolean | null;
314
+ /**
315
+ *
316
+ * @type {CreateChatCompletionRequestStop}
317
+ * @memberof CreateChatCompletionRequest
318
+ */
319
+ 'stop'?: CreateChatCompletionRequestStop;
320
+ /**
321
+ * The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens).
322
+ * @type {number}
323
+ * @memberof CreateChatCompletionRequest
324
+ */
325
+ 'max_tokens'?: number;
326
+ /**
327
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model\'s likelihood to talk about new topics. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)
328
+ * @type {number}
329
+ * @memberof CreateChatCompletionRequest
330
+ */
331
+ 'presence_penalty'?: number | null;
332
+ /**
333
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model\'s likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)
334
+ * @type {number}
335
+ * @memberof CreateChatCompletionRequest
336
+ */
337
+ 'frequency_penalty'?: number | null;
338
+ /**
339
+ * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
340
+ * @type {object}
341
+ * @memberof CreateChatCompletionRequest
342
+ */
343
+ 'logit_bias'?: object | null;
344
+ /**
345
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
346
+ * @type {string}
347
+ * @memberof CreateChatCompletionRequest
348
+ */
349
+ 'user'?: string;
350
+ }
351
+ /**
352
+ * @type CreateChatCompletionRequestStop
353
+ * Up to 4 sequences where the API will stop generating further tokens.
354
+ * @export
355
+ */
356
+ export type CreateChatCompletionRequestStop = Array<string> | string;
357
+
358
+ /**
359
+ *
360
+ * @export
361
+ * @interface CreateChatCompletionResponse
362
+ */
363
+ export interface CreateChatCompletionResponse {
364
+ /**
365
+ *
366
+ * @type {string}
367
+ * @memberof CreateChatCompletionResponse
368
+ */
369
+ 'id': string;
370
+ /**
371
+ *
372
+ * @type {string}
373
+ * @memberof CreateChatCompletionResponse
374
+ */
375
+ 'object': string;
376
+ /**
377
+ *
378
+ * @type {number}
379
+ * @memberof CreateChatCompletionResponse
380
+ */
381
+ 'created': number;
382
+ /**
383
+ *
384
+ * @type {string}
385
+ * @memberof CreateChatCompletionResponse
386
+ */
387
+ 'model': string;
388
+ /**
389
+ *
390
+ * @type {Array<CreateChatCompletionResponseChoicesInner>}
391
+ * @memberof CreateChatCompletionResponse
392
+ */
393
+ 'choices': Array<CreateChatCompletionResponseChoicesInner>;
394
+ /**
395
+ *
396
+ * @type {CreateCompletionResponseUsage}
397
+ * @memberof CreateChatCompletionResponse
398
+ */
399
+ 'usage'?: CreateCompletionResponseUsage;
400
+ }
401
+ /**
402
+ *
403
+ * @export
404
+ * @interface CreateChatCompletionResponseChoicesInner
405
+ */
406
+ export interface CreateChatCompletionResponseChoicesInner {
407
+ /**
408
+ *
409
+ * @type {number}
410
+ * @memberof CreateChatCompletionResponseChoicesInner
411
+ */
412
+ 'index'?: number;
413
+ /**
414
+ *
415
+ * @type {ChatCompletionResponseMessage}
416
+ * @memberof CreateChatCompletionResponseChoicesInner
417
+ */
418
+ 'message'?: ChatCompletionResponseMessage;
419
+ /**
420
+ *
421
+ * @type {string}
422
+ * @memberof CreateChatCompletionResponseChoicesInner
423
+ */
424
+ 'finish_reason'?: string;
425
+ }
208
426
  /**
209
427
  *
210
428
  * @export
@@ -248,7 +466,7 @@ export interface CreateClassificationRequest {
248
466
  */
249
467
  'search_model'?: string | null;
250
468
  /**
251
- * What sampling `temperature` to use. Higher values mean the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.
469
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
252
470
  * @type {number}
253
471
  * @memberof CreateClassificationRequest
254
472
  */
@@ -290,7 +508,7 @@ export interface CreateClassificationRequest {
290
508
  */
291
509
  'expand'?: Array<any> | null;
292
510
  /**
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).
511
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
294
512
  * @type {string}
295
513
  * @memberof CreateClassificationRequest
296
514
  */
@@ -395,7 +613,7 @@ export interface CreateCompletionRequest {
395
613
  */
396
614
  'max_tokens'?: number | null;
397
615
  /**
398
- * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both.
616
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both.
399
617
  * @type {number}
400
618
  * @memberof CreateCompletionRequest
401
619
  */
@@ -461,7 +679,7 @@ export interface CreateCompletionRequest {
461
679
  */
462
680
  'logit_bias'?: object | null;
463
681
  /**
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).
682
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
465
683
  * @type {string}
466
684
  * @memberof CreateCompletionRequest
467
685
  */
@@ -618,7 +836,7 @@ export interface CreateCompletionResponseUsage {
618
836
  */
619
837
  export interface CreateEditRequest {
620
838
  /**
621
- * ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
839
+ * ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint.
622
840
  * @type {string}
623
841
  * @memberof CreateEditRequest
624
842
  */
@@ -642,7 +860,7 @@ export interface CreateEditRequest {
642
860
  */
643
861
  'n'?: number | null;
644
862
  /**
645
- * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both.
863
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both.
646
864
  * @type {number}
647
865
  * @memberof CreateEditRequest
648
866
  */
@@ -660,12 +878,6 @@ export interface CreateEditRequest {
660
878
  * @interface CreateEditResponse
661
879
  */
662
880
  export interface CreateEditResponse {
663
- /**
664
- *
665
- * @type {string}
666
- * @memberof CreateEditResponse
667
- */
668
- 'id': string;
669
881
  /**
670
882
  *
671
883
  * @type {string}
@@ -678,12 +890,6 @@ export interface CreateEditResponse {
678
890
  * @memberof CreateEditResponse
679
891
  */
680
892
  'created': number;
681
- /**
682
- *
683
- * @type {string}
684
- * @memberof CreateEditResponse
685
- */
686
- 'model': string;
687
893
  /**
688
894
  *
689
895
  * @type {Array<CreateCompletionResponseChoicesInner>}
@@ -716,7 +922,7 @@ export interface CreateEmbeddingRequest {
716
922
  */
717
923
  'input': CreateEmbeddingRequestInput;
718
924
  /**
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).
925
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
720
926
  * @type {string}
721
927
  * @memberof CreateEmbeddingRequest
722
928
  */
@@ -724,7 +930,7 @@ export interface CreateEmbeddingRequest {
724
930
  }
725
931
  /**
726
932
  * @type CreateEmbeddingRequestInput
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.
933
+ * 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 8192 tokens in length.
728
934
  * @export
729
935
  */
730
936
  export type CreateEmbeddingRequestInput = Array<any> | Array<number> | Array<string> | string;
@@ -823,7 +1029,7 @@ export interface CreateFineTuneRequest {
823
1029
  */
824
1030
  'validation_file'?: string | null;
825
1031
  /**
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.
1032
+ * 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://platform.openai.com/docs/models) documentation.
827
1033
  * @type {string}
828
1034
  * @memberof CreateFineTuneRequest
829
1035
  */
@@ -914,7 +1120,7 @@ export interface CreateImageRequest {
914
1120
  */
915
1121
  'response_format'?: CreateImageRequestResponseFormatEnum;
916
1122
  /**
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).
1123
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
918
1124
  * @type {string}
919
1125
  * @memberof CreateImageRequest
920
1126
  */
@@ -1146,7 +1352,7 @@ export interface CreateSearchRequest {
1146
1352
  */
1147
1353
  'return_metadata'?: boolean | null;
1148
1354
  /**
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).
1355
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
1150
1356
  * @type {string}
1151
1357
  * @memberof CreateSearchRequest
1152
1358
  */
@@ -1202,6 +1408,32 @@ export interface CreateSearchResponseDataInner {
1202
1408
  */
1203
1409
  'score'?: number;
1204
1410
  }
1411
+ /**
1412
+ *
1413
+ * @export
1414
+ * @interface CreateTranscriptionResponse
1415
+ */
1416
+ export interface CreateTranscriptionResponse {
1417
+ /**
1418
+ *
1419
+ * @type {string}
1420
+ * @memberof CreateTranscriptionResponse
1421
+ */
1422
+ 'text': string;
1423
+ }
1424
+ /**
1425
+ *
1426
+ * @export
1427
+ * @interface CreateTranslationResponse
1428
+ */
1429
+ export interface CreateTranslationResponse {
1430
+ /**
1431
+ *
1432
+ * @type {string}
1433
+ * @memberof CreateTranslationResponse
1434
+ */
1435
+ 'text': string;
1436
+ }
1205
1437
  /**
1206
1438
  *
1207
1439
  * @export
@@ -1696,6 +1928,42 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1696
1928
  options: localVarRequestOptions,
1697
1929
  };
1698
1930
  },
1931
+ /**
1932
+ *
1933
+ * @summary Creates a completion for the chat message
1934
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
1935
+ * @param {*} [options] Override http request option.
1936
+ * @throws {RequiredError}
1937
+ */
1938
+ createChatCompletion: async (createChatCompletionRequest: CreateChatCompletionRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1939
+ // verify required parameter 'createChatCompletionRequest' is not null or undefined
1940
+ assertParamExists('createChatCompletion', 'createChatCompletionRequest', createChatCompletionRequest)
1941
+ const localVarPath = `/chat/completions`;
1942
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1943
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1944
+ let baseOptions;
1945
+ if (configuration) {
1946
+ baseOptions = configuration.baseOptions;
1947
+ }
1948
+
1949
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1950
+ const localVarHeaderParameter = {} as any;
1951
+ const localVarQueryParameter = {} as any;
1952
+
1953
+
1954
+
1955
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1956
+
1957
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1958
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1959
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1960
+ localVarRequestOptions.data = serializeDataIfNeeded(createChatCompletionRequest, localVarRequestOptions, configuration)
1961
+
1962
+ return {
1963
+ url: toPathString(localVarUrlObj),
1964
+ options: localVarRequestOptions,
1965
+ };
1966
+ },
1699
1967
  /**
1700
1968
  *
1701
1969
  * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
@@ -1771,7 +2039,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1771
2039
  },
1772
2040
  /**
1773
2041
  *
1774
- * @summary Creates a new edit for the provided input, instruction, and parameters
2042
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
1775
2043
  * @param {CreateEditRequest} createEditRequest
1776
2044
  * @param {*} [options] Override http request option.
1777
2045
  * @throws {RequiredError}
@@ -1964,21 +2232,19 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1964
2232
  /**
1965
2233
  *
1966
2234
  * @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;.
2235
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
1969
2236
  * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
2237
+ * @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;.
1970
2238
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
1971
2239
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
1972
2240
  * @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).
2241
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
1974
2242
  * @param {*} [options] Override http request option.
1975
2243
  * @throws {RequiredError}
1976
2244
  */
1977
- createImageEdit: async (image: File, mask: File, prompt: string, n?: number, size?: string, responseFormat?: string, user?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2245
+ createImageEdit: async (image: File, prompt: string, mask?: File, n?: number, size?: string, responseFormat?: string, user?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1978
2246
  // verify required parameter 'image' is not null or undefined
1979
2247
  assertParamExists('createImageEdit', 'image', image)
1980
- // verify required parameter 'mask' is not null or undefined
1981
- assertParamExists('createImageEdit', 'mask', mask)
1982
2248
  // verify required parameter 'prompt' is not null or undefined
1983
2249
  assertParamExists('createImageEdit', 'prompt', prompt)
1984
2250
  const localVarPath = `/images/edits`;
@@ -2043,7 +2309,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
2043
2309
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2044
2310
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2045
2311
  * @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).
2312
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
2047
2313
  * @param {*} [options] Override http request option.
2048
2314
  * @throws {RequiredError}
2049
2315
  */
@@ -2174,6 +2440,137 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
2174
2440
  options: localVarRequestOptions,
2175
2441
  };
2176
2442
  },
2443
+ /**
2444
+ *
2445
+ * @summary Transcribes audio into the input language.
2446
+ * @param {File} file The audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
2447
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
2448
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
2449
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
2450
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
2451
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
2452
+ * @param {*} [options] Override http request option.
2453
+ * @throws {RequiredError}
2454
+ */
2455
+ createTranscription: async (file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2456
+ // verify required parameter 'file' is not null or undefined
2457
+ assertParamExists('createTranscription', 'file', file)
2458
+ // verify required parameter 'model' is not null or undefined
2459
+ assertParamExists('createTranscription', 'model', model)
2460
+ const localVarPath = `/audio/transcriptions`;
2461
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2462
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2463
+ let baseOptions;
2464
+ if (configuration) {
2465
+ baseOptions = configuration.baseOptions;
2466
+ }
2467
+
2468
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2469
+ const localVarHeaderParameter = {} as any;
2470
+ const localVarQueryParameter = {} as any;
2471
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2472
+
2473
+
2474
+ if (file !== undefined) {
2475
+ localVarFormParams.append('file', file as any);
2476
+ }
2477
+
2478
+ if (model !== undefined) {
2479
+ localVarFormParams.append('model', model as any);
2480
+ }
2481
+
2482
+ if (prompt !== undefined) {
2483
+ localVarFormParams.append('prompt', prompt as any);
2484
+ }
2485
+
2486
+ if (responseFormat !== undefined) {
2487
+ localVarFormParams.append('response_format', responseFormat as any);
2488
+ }
2489
+
2490
+ if (temperature !== undefined) {
2491
+ localVarFormParams.append('temperature', temperature as any);
2492
+ }
2493
+
2494
+ if (language !== undefined) {
2495
+ localVarFormParams.append('language', language as any);
2496
+ }
2497
+
2498
+
2499
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2500
+
2501
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2502
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2503
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2504
+ localVarRequestOptions.data = localVarFormParams;
2505
+
2506
+ return {
2507
+ url: toPathString(localVarUrlObj),
2508
+ options: localVarRequestOptions,
2509
+ };
2510
+ },
2511
+ /**
2512
+ *
2513
+ * @summary Translates audio into into English.
2514
+ * @param {File} file The audio file to translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
2515
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
2516
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
2517
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
2518
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
2519
+ * @param {*} [options] Override http request option.
2520
+ * @throws {RequiredError}
2521
+ */
2522
+ createTranslation: async (file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2523
+ // verify required parameter 'file' is not null or undefined
2524
+ assertParamExists('createTranslation', 'file', file)
2525
+ // verify required parameter 'model' is not null or undefined
2526
+ assertParamExists('createTranslation', 'model', model)
2527
+ const localVarPath = `/audio/translations`;
2528
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2529
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2530
+ let baseOptions;
2531
+ if (configuration) {
2532
+ baseOptions = configuration.baseOptions;
2533
+ }
2534
+
2535
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2536
+ const localVarHeaderParameter = {} as any;
2537
+ const localVarQueryParameter = {} as any;
2538
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2539
+
2540
+
2541
+ if (file !== undefined) {
2542
+ localVarFormParams.append('file', file as any);
2543
+ }
2544
+
2545
+ if (model !== undefined) {
2546
+ localVarFormParams.append('model', model as any);
2547
+ }
2548
+
2549
+ if (prompt !== undefined) {
2550
+ localVarFormParams.append('prompt', prompt as any);
2551
+ }
2552
+
2553
+ if (responseFormat !== undefined) {
2554
+ localVarFormParams.append('response_format', responseFormat as any);
2555
+ }
2556
+
2557
+ if (temperature !== undefined) {
2558
+ localVarFormParams.append('temperature', temperature as any);
2559
+ }
2560
+
2561
+
2562
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2563
+
2564
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2565
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2566
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2567
+ localVarRequestOptions.data = localVarFormParams;
2568
+
2569
+ return {
2570
+ url: toPathString(localVarUrlObj),
2571
+ options: localVarRequestOptions,
2572
+ };
2573
+ },
2177
2574
  /**
2178
2575
  *
2179
2576
  * @summary Delete a file.
@@ -2606,6 +3003,17 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2606
3003
  const localVarAxiosArgs = await localVarAxiosParamCreator.createAnswer(createAnswerRequest, options);
2607
3004
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2608
3005
  },
3006
+ /**
3007
+ *
3008
+ * @summary Creates a completion for the chat message
3009
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
3010
+ * @param {*} [options] Override http request option.
3011
+ * @throws {RequiredError}
3012
+ */
3013
+ async createChatCompletion(createChatCompletionRequest: CreateChatCompletionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateChatCompletionResponse>> {
3014
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createChatCompletion(createChatCompletionRequest, options);
3015
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3016
+ },
2609
3017
  /**
2610
3018
  *
2611
3019
  * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
@@ -2631,7 +3039,7 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2631
3039
  },
2632
3040
  /**
2633
3041
  *
2634
- * @summary Creates a new edit for the provided input, instruction, and parameters
3042
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
2635
3043
  * @param {CreateEditRequest} createEditRequest
2636
3044
  * @param {*} [options] Override http request option.
2637
3045
  * @throws {RequiredError}
@@ -2688,18 +3096,18 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2688
3096
  /**
2689
3097
  *
2690
3098
  * @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;.
3099
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
2693
3100
  * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
3101
+ * @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;.
2694
3102
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2695
3103
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2696
3104
  * @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).
3105
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
2698
3106
  * @param {*} [options] Override http request option.
2699
3107
  * @throws {RequiredError}
2700
3108
  */
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);
3109
+ async createImageEdit(image: File, prompt: string, mask?: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImagesResponse>> {
3110
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options);
2703
3111
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2704
3112
  },
2705
3113
  /**
@@ -2709,7 +3117,7 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2709
3117
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2710
3118
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2711
3119
  * @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).
3120
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
2713
3121
  * @param {*} [options] Override http request option.
2714
3122
  * @throws {RequiredError}
2715
3123
  */
@@ -2741,6 +3149,37 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2741
3149
  const localVarAxiosArgs = await localVarAxiosParamCreator.createSearch(engineId, createSearchRequest, options);
2742
3150
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2743
3151
  },
3152
+ /**
3153
+ *
3154
+ * @summary Transcribes audio into the input language.
3155
+ * @param {File} file The audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3156
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3157
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
3158
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3159
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
3160
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
3161
+ * @param {*} [options] Override http request option.
3162
+ * @throws {RequiredError}
3163
+ */
3164
+ async createTranscription(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateTranscriptionResponse>> {
3165
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTranscription(file, model, prompt, responseFormat, temperature, language, options);
3166
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3167
+ },
3168
+ /**
3169
+ *
3170
+ * @summary Translates audio into into English.
3171
+ * @param {File} file The audio file to translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3172
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3173
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
3174
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3175
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
3176
+ * @param {*} [options] Override http request option.
3177
+ * @throws {RequiredError}
3178
+ */
3179
+ async createTranslation(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateTranslationResponse>> {
3180
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTranslation(file, model, prompt, responseFormat, temperature, options);
3181
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3182
+ },
2744
3183
  /**
2745
3184
  *
2746
3185
  * @summary Delete a file.
@@ -2903,6 +3342,16 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2903
3342
  createAnswer(createAnswerRequest: CreateAnswerRequest, options?: any): AxiosPromise<CreateAnswerResponse> {
2904
3343
  return localVarFp.createAnswer(createAnswerRequest, options).then((request) => request(axios, basePath));
2905
3344
  },
3345
+ /**
3346
+ *
3347
+ * @summary Creates a completion for the chat message
3348
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
3349
+ * @param {*} [options] Override http request option.
3350
+ * @throws {RequiredError}
3351
+ */
3352
+ createChatCompletion(createChatCompletionRequest: CreateChatCompletionRequest, options?: any): AxiosPromise<CreateChatCompletionResponse> {
3353
+ return localVarFp.createChatCompletion(createChatCompletionRequest, options).then((request) => request(axios, basePath));
3354
+ },
2906
3355
  /**
2907
3356
  *
2908
3357
  * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
@@ -2926,7 +3375,7 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2926
3375
  },
2927
3376
  /**
2928
3377
  *
2929
- * @summary Creates a new edit for the provided input, instruction, and parameters
3378
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
2930
3379
  * @param {CreateEditRequest} createEditRequest
2931
3380
  * @param {*} [options] Override http request option.
2932
3381
  * @throws {RequiredError}
@@ -2978,18 +3427,18 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2978
3427
  /**
2979
3428
  *
2980
3429
  * @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;.
3430
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
2983
3431
  * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
3432
+ * @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;.
2984
3433
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2985
3434
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2986
3435
  * @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).
3436
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
2988
3437
  * @param {*} [options] Override http request option.
2989
3438
  * @throws {RequiredError}
2990
3439
  */
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));
3440
+ createImageEdit(image: File, prompt: string, mask?: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: any): AxiosPromise<ImagesResponse> {
3441
+ return localVarFp.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(axios, basePath));
2993
3442
  },
2994
3443
  /**
2995
3444
  *
@@ -2998,7 +3447,7 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2998
3447
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2999
3448
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3000
3449
  * @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).
3450
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
3002
3451
  * @param {*} [options] Override http request option.
3003
3452
  * @throws {RequiredError}
3004
3453
  */
@@ -3027,6 +3476,35 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
3027
3476
  createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: any): AxiosPromise<CreateSearchResponse> {
3028
3477
  return localVarFp.createSearch(engineId, createSearchRequest, options).then((request) => request(axios, basePath));
3029
3478
  },
3479
+ /**
3480
+ *
3481
+ * @summary Transcribes audio into the input language.
3482
+ * @param {File} file The audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3483
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3484
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
3485
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3486
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
3487
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
3488
+ * @param {*} [options] Override http request option.
3489
+ * @throws {RequiredError}
3490
+ */
3491
+ createTranscription(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options?: any): AxiosPromise<CreateTranscriptionResponse> {
3492
+ return localVarFp.createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(axios, basePath));
3493
+ },
3494
+ /**
3495
+ *
3496
+ * @summary Translates audio into into English.
3497
+ * @param {File} file The audio file to translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3498
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3499
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
3500
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3501
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
3502
+ * @param {*} [options] Override http request option.
3503
+ * @throws {RequiredError}
3504
+ */
3505
+ createTranslation(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options?: any): AxiosPromise<CreateTranslationResponse> {
3506
+ return localVarFp.createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(axios, basePath));
3507
+ },
3030
3508
  /**
3031
3509
  *
3032
3510
  * @summary Delete a file.
@@ -3181,6 +3659,18 @@ export class OpenAIApi extends BaseAPI {
3181
3659
  return OpenAIApiFp(this.configuration).createAnswer(createAnswerRequest, options).then((request) => request(this.axios, this.basePath));
3182
3660
  }
3183
3661
 
3662
+ /**
3663
+ *
3664
+ * @summary Creates a completion for the chat message
3665
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
3666
+ * @param {*} [options] Override http request option.
3667
+ * @throws {RequiredError}
3668
+ * @memberof OpenAIApi
3669
+ */
3670
+ public createChatCompletion(createChatCompletionRequest: CreateChatCompletionRequest, options?: AxiosRequestConfig) {
3671
+ return OpenAIApiFp(this.configuration).createChatCompletion(createChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
3672
+ }
3673
+
3184
3674
  /**
3185
3675
  *
3186
3676
  * @summary Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
@@ -3208,7 +3698,7 @@ export class OpenAIApi extends BaseAPI {
3208
3698
 
3209
3699
  /**
3210
3700
  *
3211
- * @summary Creates a new edit for the provided input, instruction, and parameters
3701
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
3212
3702
  * @param {CreateEditRequest} createEditRequest
3213
3703
  * @param {*} [options] Override http request option.
3214
3704
  * @throws {RequiredError}
@@ -3270,19 +3760,19 @@ export class OpenAIApi extends BaseAPI {
3270
3760
  /**
3271
3761
  *
3272
3762
  * @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;.
3763
+ * @param {File} image The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
3275
3764
  * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
3765
+ * @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;.
3276
3766
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3277
3767
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3278
3768
  * @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).
3769
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
3280
3770
  * @param {*} [options] Override http request option.
3281
3771
  * @throws {RequiredError}
3282
3772
  * @memberof OpenAIApi
3283
3773
  */
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));
3774
+ public createImageEdit(image: File, prompt: string, mask?: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig) {
3775
+ return OpenAIApiFp(this.configuration).createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(this.axios, this.basePath));
3286
3776
  }
3287
3777
 
3288
3778
  /**
@@ -3292,7 +3782,7 @@ export class OpenAIApi extends BaseAPI {
3292
3782
  * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3293
3783
  * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3294
3784
  * @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).
3785
+ * @param {string} [user] A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
3296
3786
  * @param {*} [options] Override http request option.
3297
3787
  * @throws {RequiredError}
3298
3788
  * @memberof OpenAIApi
@@ -3327,6 +3817,39 @@ export class OpenAIApi extends BaseAPI {
3327
3817
  return OpenAIApiFp(this.configuration).createSearch(engineId, createSearchRequest, options).then((request) => request(this.axios, this.basePath));
3328
3818
  }
3329
3819
 
3820
+ /**
3821
+ *
3822
+ * @summary Transcribes audio into the input language.
3823
+ * @param {File} file The audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3824
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3825
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
3826
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3827
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
3828
+ * @param {string} [language] The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
3829
+ * @param {*} [options] Override http request option.
3830
+ * @throws {RequiredError}
3831
+ * @memberof OpenAIApi
3832
+ */
3833
+ public createTranscription(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options?: AxiosRequestConfig) {
3834
+ return OpenAIApiFp(this.configuration).createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(this.axios, this.basePath));
3835
+ }
3836
+
3837
+ /**
3838
+ *
3839
+ * @summary Translates audio into into English.
3840
+ * @param {File} file The audio file to translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3841
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3842
+ * @param {string} [prompt] An optional text to guide the model\\\&#39;s style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
3843
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3844
+ * @param {number} [temperature] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
3845
+ * @param {*} [options] Override http request option.
3846
+ * @throws {RequiredError}
3847
+ * @memberof OpenAIApi
3848
+ */
3849
+ public createTranslation(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options?: AxiosRequestConfig) {
3850
+ return OpenAIApiFp(this.configuration).createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(this.axios, this.basePath));
3851
+ }
3852
+
3330
3853
  /**
3331
3854
  *
3332
3855
  * @summary Delete a file.