xbasis 0.0.0-stage → 0.0.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 ADDED
@@ -0,0 +1,4131 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * OpenAI API
5
+ * APIs for sampling from and fine-tuning language models
6
+ *
7
+ * The version of the OpenAPI document: 1.3.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from './configuration';
17
+ import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22
+ import type { RequestArgs } from './base';
23
+ // @ts-ignore
24
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
25
+
26
+ /**
27
+ *
28
+ * @export
29
+ * @interface ChatCompletionFunctions
30
+ */
31
+ export interface ChatCompletionFunctions {
32
+ /**
33
+ * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
34
+ * @type {string}
35
+ * @memberof ChatCompletionFunctions
36
+ */
37
+ 'name': string;
38
+ /**
39
+ * The description of what the function does.
40
+ * @type {string}
41
+ * @memberof ChatCompletionFunctions
42
+ */
43
+ 'description'?: string;
44
+ /**
45
+ * The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
46
+ * @type {{ [key: string]: any; }}
47
+ * @memberof ChatCompletionFunctions
48
+ */
49
+ 'parameters'?: { [key: string]: any; };
50
+ }
51
+ /**
52
+ *
53
+ * @export
54
+ * @interface ChatCompletionRequestMessage
55
+ */
56
+ export interface ChatCompletionRequestMessage {
57
+ /**
58
+ * The role of the messages author. One of `system`, `user`, `assistant`, or `function`.
59
+ * @type {string}
60
+ * @memberof ChatCompletionRequestMessage
61
+ */
62
+ 'role': ChatCompletionRequestMessageRoleEnum;
63
+ /**
64
+ * The contents of the message. `content` is required for all messages except assistant messages with function calls.
65
+ * @type {string}
66
+ * @memberof ChatCompletionRequestMessage
67
+ */
68
+ 'content'?: string;
69
+ /**
70
+ * The name of the author of this message. `name` is required if role is `function`, and it should be the name of the function whose response is in the `content`. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
71
+ * @type {string}
72
+ * @memberof ChatCompletionRequestMessage
73
+ */
74
+ 'name'?: string;
75
+ /**
76
+ *
77
+ * @type {ChatCompletionRequestMessageFunctionCall}
78
+ * @memberof ChatCompletionRequestMessage
79
+ */
80
+ 'function_call'?: ChatCompletionRequestMessageFunctionCall;
81
+ }
82
+
83
+ export const ChatCompletionRequestMessageRoleEnum = {
84
+ System: 'system',
85
+ User: 'user',
86
+ Assistant: 'assistant',
87
+ Function: 'function'
88
+ } as const;
89
+
90
+ export type ChatCompletionRequestMessageRoleEnum = typeof ChatCompletionRequestMessageRoleEnum[keyof typeof ChatCompletionRequestMessageRoleEnum];
91
+
92
+ /**
93
+ * The name and arguments of a function that should be called, as generated by the model.
94
+ * @export
95
+ * @interface ChatCompletionRequestMessageFunctionCall
96
+ */
97
+ export interface ChatCompletionRequestMessageFunctionCall {
98
+ /**
99
+ * The name of the function to call.
100
+ * @type {string}
101
+ * @memberof ChatCompletionRequestMessageFunctionCall
102
+ */
103
+ 'name'?: string;
104
+ /**
105
+ * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
106
+ * @type {string}
107
+ * @memberof ChatCompletionRequestMessageFunctionCall
108
+ */
109
+ 'arguments'?: string;
110
+ }
111
+ /**
112
+ *
113
+ * @export
114
+ * @interface ChatCompletionResponseMessage
115
+ */
116
+ export interface ChatCompletionResponseMessage {
117
+ /**
118
+ * The role of the author of this message.
119
+ * @type {string}
120
+ * @memberof ChatCompletionResponseMessage
121
+ */
122
+ 'role': ChatCompletionResponseMessageRoleEnum;
123
+ /**
124
+ * The contents of the message.
125
+ * @type {string}
126
+ * @memberof ChatCompletionResponseMessage
127
+ */
128
+ 'content'?: string;
129
+ /**
130
+ *
131
+ * @type {ChatCompletionRequestMessageFunctionCall}
132
+ * @memberof ChatCompletionResponseMessage
133
+ */
134
+ 'function_call'?: ChatCompletionRequestMessageFunctionCall;
135
+ }
136
+
137
+ export const ChatCompletionResponseMessageRoleEnum = {
138
+ System: 'system',
139
+ User: 'user',
140
+ Assistant: 'assistant',
141
+ Function: 'function'
142
+ } as const;
143
+
144
+ export type ChatCompletionResponseMessageRoleEnum = typeof ChatCompletionResponseMessageRoleEnum[keyof typeof ChatCompletionResponseMessageRoleEnum];
145
+
146
+ /**
147
+ *
148
+ * @export
149
+ * @interface CreateAnswerRequest
150
+ */
151
+ export interface CreateAnswerRequest {
152
+ /**
153
+ * ID of the model to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
154
+ * @type {string}
155
+ * @memberof CreateAnswerRequest
156
+ */
157
+ 'model': string;
158
+ /**
159
+ * Question to get answered.
160
+ * @type {string}
161
+ * @memberof CreateAnswerRequest
162
+ */
163
+ 'question': string;
164
+ /**
165
+ * List of (question, answer) pairs that will help steer the model towards the tone and answer format you\'d like. We recommend adding 2 to 3 examples.
166
+ * @type {Array<any>}
167
+ * @memberof CreateAnswerRequest
168
+ */
169
+ 'examples': Array<any>;
170
+ /**
171
+ * A text snippet containing the contextual information used to generate the answers for the `examples` you provide.
172
+ * @type {string}
173
+ * @memberof CreateAnswerRequest
174
+ */
175
+ 'examples_context': string;
176
+ /**
177
+ * List of documents from which the answer for the input `question` should be derived. If this is an empty list, the question will be answered based on the question-answer examples. You should specify either `documents` or a `file`, but not both.
178
+ * @type {Array<string>}
179
+ * @memberof CreateAnswerRequest
180
+ */
181
+ 'documents'?: Array<string> | null;
182
+ /**
183
+ * The ID of an uploaded file that contains documents to search over. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose. You should specify either `documents` or a `file`, but not both.
184
+ * @type {string}
185
+ * @memberof CreateAnswerRequest
186
+ */
187
+ 'file'?: string | null;
188
+ /**
189
+ * ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
190
+ * @type {string}
191
+ * @memberof CreateAnswerRequest
192
+ */
193
+ 'search_model'?: string | null;
194
+ /**
195
+ * The maximum number of documents to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost.
196
+ * @type {number}
197
+ * @memberof CreateAnswerRequest
198
+ */
199
+ 'max_rerank'?: number | null;
200
+ /**
201
+ * 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.
202
+ * @type {number}
203
+ * @memberof CreateAnswerRequest
204
+ */
205
+ 'temperature'?: number | null;
206
+ /**
207
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
208
+ * @type {number}
209
+ * @memberof CreateAnswerRequest
210
+ */
211
+ 'logprobs'?: number | null;
212
+ /**
213
+ * The maximum number of tokens allowed for the generated answer
214
+ * @type {number}
215
+ * @memberof CreateAnswerRequest
216
+ */
217
+ 'max_tokens'?: number | null;
218
+ /**
219
+ *
220
+ * @type {CreateAnswerRequestStop}
221
+ * @memberof CreateAnswerRequest
222
+ */
223
+ 'stop'?: CreateAnswerRequestStop | null;
224
+ /**
225
+ * How many answers to generate for each question.
226
+ * @type {number}
227
+ * @memberof CreateAnswerRequest
228
+ */
229
+ 'n'?: number | null;
230
+ /**
231
+ * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. 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. As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.
232
+ * @type {object}
233
+ * @memberof CreateAnswerRequest
234
+ */
235
+ 'logit_bias'?: object | null;
236
+ /**
237
+ * A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a \"metadata\" field. This flag only takes effect when `file` is set.
238
+ * @type {boolean}
239
+ * @memberof CreateAnswerRequest
240
+ */
241
+ 'return_metadata'?: boolean | null;
242
+ /**
243
+ * If set to `true`, the returned JSON will include a \"prompt\" field containing the final prompt that was used to request a completion. This is mainly useful for debugging purposes.
244
+ * @type {boolean}
245
+ * @memberof CreateAnswerRequest
246
+ */
247
+ 'return_prompt'?: boolean | null;
248
+ /**
249
+ * If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID. Currently we support `completion` and `file` objects for expansion.
250
+ * @type {Array<any>}
251
+ * @memberof CreateAnswerRequest
252
+ */
253
+ 'expand'?: Array<any> | null;
254
+ /**
255
+ * 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).
256
+ * @type {string}
257
+ * @memberof CreateAnswerRequest
258
+ */
259
+ 'user'?: string;
260
+ }
261
+ /**
262
+ * @type CreateAnswerRequestStop
263
+ * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
264
+ * @export
265
+ */
266
+ export type CreateAnswerRequestStop = Array<string> | string;
267
+
268
+ /**
269
+ *
270
+ * @export
271
+ * @interface CreateAnswerResponse
272
+ */
273
+ export interface CreateAnswerResponse {
274
+ /**
275
+ *
276
+ * @type {string}
277
+ * @memberof CreateAnswerResponse
278
+ */
279
+ 'object'?: string;
280
+ /**
281
+ *
282
+ * @type {string}
283
+ * @memberof CreateAnswerResponse
284
+ */
285
+ 'model'?: string;
286
+ /**
287
+ *
288
+ * @type {string}
289
+ * @memberof CreateAnswerResponse
290
+ */
291
+ 'search_model'?: string;
292
+ /**
293
+ *
294
+ * @type {string}
295
+ * @memberof CreateAnswerResponse
296
+ */
297
+ 'completion'?: string;
298
+ /**
299
+ *
300
+ * @type {Array<string>}
301
+ * @memberof CreateAnswerResponse
302
+ */
303
+ 'answers'?: Array<string>;
304
+ /**
305
+ *
306
+ * @type {Array<CreateAnswerResponseSelectedDocumentsInner>}
307
+ * @memberof CreateAnswerResponse
308
+ */
309
+ 'selected_documents'?: Array<CreateAnswerResponseSelectedDocumentsInner>;
310
+ }
311
+ /**
312
+ *
313
+ * @export
314
+ * @interface CreateAnswerResponseSelectedDocumentsInner
315
+ */
316
+ export interface CreateAnswerResponseSelectedDocumentsInner {
317
+ /**
318
+ *
319
+ * @type {number}
320
+ * @memberof CreateAnswerResponseSelectedDocumentsInner
321
+ */
322
+ 'document'?: number;
323
+ /**
324
+ *
325
+ * @type {string}
326
+ * @memberof CreateAnswerResponseSelectedDocumentsInner
327
+ */
328
+ 'text'?: string;
329
+ }
330
+ /**
331
+ *
332
+ * @export
333
+ * @interface CreateChatCompletionRequest
334
+ */
335
+ export interface CreateChatCompletionRequest {
336
+ /**
337
+ * ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.
338
+ * @type {string}
339
+ * @memberof CreateChatCompletionRequest
340
+ */
341
+ 'model': string;
342
+ /**
343
+ * A list of messages comprising the conversation so far. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb).
344
+ * @type {Array<ChatCompletionRequestMessage>}
345
+ * @memberof CreateChatCompletionRequest
346
+ */
347
+ 'messages': Array<ChatCompletionRequestMessage>;
348
+ /**
349
+ * A list of functions the model may generate JSON inputs for.
350
+ * @type {Array<ChatCompletionFunctions>}
351
+ * @memberof CreateChatCompletionRequest
352
+ */
353
+ 'functions'?: Array<ChatCompletionFunctions>;
354
+ /**
355
+ *
356
+ * @type {CreateChatCompletionRequestFunctionCall}
357
+ * @memberof CreateChatCompletionRequest
358
+ */
359
+ 'function_call'?: CreateChatCompletionRequestFunctionCall;
360
+ /**
361
+ * 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.
362
+ * @type {number}
363
+ * @memberof CreateChatCompletionRequest
364
+ */
365
+ 'temperature'?: number | null;
366
+ /**
367
+ * 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.
368
+ * @type {number}
369
+ * @memberof CreateChatCompletionRequest
370
+ */
371
+ 'top_p'?: number | null;
372
+ /**
373
+ * How many chat completion choices to generate for each input message.
374
+ * @type {number}
375
+ * @memberof CreateChatCompletionRequest
376
+ */
377
+ 'n'?: number | null;
378
+ /**
379
+ * 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. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_stream_completions.ipynb).
380
+ * @type {boolean}
381
+ * @memberof CreateChatCompletionRequest
382
+ */
383
+ 'stream'?: boolean | null;
384
+ /**
385
+ *
386
+ * @type {CreateChatCompletionRequestStop}
387
+ * @memberof CreateChatCompletionRequest
388
+ */
389
+ 'stop'?: CreateChatCompletionRequestStop;
390
+ /**
391
+ * The maximum number of [tokens](/tokenizer) to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model\'s context length. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens.
392
+ * @type {number}
393
+ * @memberof CreateChatCompletionRequest
394
+ */
395
+ 'max_tokens'?: number;
396
+ /**
397
+ * 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)
398
+ * @type {number}
399
+ * @memberof CreateChatCompletionRequest
400
+ */
401
+ 'presence_penalty'?: number | null;
402
+ /**
403
+ * 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)
404
+ * @type {number}
405
+ * @memberof CreateChatCompletionRequest
406
+ */
407
+ 'frequency_penalty'?: number | null;
408
+ /**
409
+ * 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.
410
+ * @type {object}
411
+ * @memberof CreateChatCompletionRequest
412
+ */
413
+ 'logit_bias'?: object | null;
414
+ /**
415
+ * 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).
416
+ * @type {string}
417
+ * @memberof CreateChatCompletionRequest
418
+ */
419
+ 'user'?: string;
420
+ }
421
+ /**
422
+ * @type CreateChatCompletionRequestFunctionCall
423
+ * Controls how the model responds to function calls. \"none\" means the model does not call a function, and responds to the end-user. \"auto\" means the model can pick between an end-user or calling a function. Specifying a particular function via `{\"name\":\\ \"my_function\"}` forces the model to call that function. \"none\" is the default when no functions are present. \"auto\" is the default if functions are present.
424
+ * @export
425
+ */
426
+ export type CreateChatCompletionRequestFunctionCall = CreateChatCompletionRequestFunctionCallOneOf | string;
427
+
428
+ /**
429
+ *
430
+ * @export
431
+ * @interface CreateChatCompletionRequestFunctionCallOneOf
432
+ */
433
+ export interface CreateChatCompletionRequestFunctionCallOneOf {
434
+ /**
435
+ * The name of the function to call.
436
+ * @type {string}
437
+ * @memberof CreateChatCompletionRequestFunctionCallOneOf
438
+ */
439
+ 'name': string;
440
+ }
441
+ /**
442
+ * @type CreateChatCompletionRequestStop
443
+ * Up to 4 sequences where the API will stop generating further tokens.
444
+ * @export
445
+ */
446
+ export type CreateChatCompletionRequestStop = Array<string> | string;
447
+
448
+ /**
449
+ *
450
+ * @export
451
+ * @interface CreateChatCompletionResponse
452
+ */
453
+ export interface CreateChatCompletionResponse {
454
+ /**
455
+ *
456
+ * @type {string}
457
+ * @memberof CreateChatCompletionResponse
458
+ */
459
+ 'id': string;
460
+ /**
461
+ *
462
+ * @type {string}
463
+ * @memberof CreateChatCompletionResponse
464
+ */
465
+ 'object': string;
466
+ /**
467
+ *
468
+ * @type {number}
469
+ * @memberof CreateChatCompletionResponse
470
+ */
471
+ 'created': number;
472
+ /**
473
+ *
474
+ * @type {string}
475
+ * @memberof CreateChatCompletionResponse
476
+ */
477
+ 'model': string;
478
+ /**
479
+ *
480
+ * @type {Array<CreateChatCompletionResponseChoicesInner>}
481
+ * @memberof CreateChatCompletionResponse
482
+ */
483
+ 'choices': Array<CreateChatCompletionResponseChoicesInner>;
484
+ /**
485
+ *
486
+ * @type {CreateCompletionResponseUsage}
487
+ * @memberof CreateChatCompletionResponse
488
+ */
489
+ 'usage'?: CreateCompletionResponseUsage;
490
+ }
491
+ /**
492
+ *
493
+ * @export
494
+ * @interface CreateChatCompletionResponseChoicesInner
495
+ */
496
+ export interface CreateChatCompletionResponseChoicesInner {
497
+ /**
498
+ *
499
+ * @type {number}
500
+ * @memberof CreateChatCompletionResponseChoicesInner
501
+ */
502
+ 'index'?: number;
503
+ /**
504
+ *
505
+ * @type {ChatCompletionResponseMessage}
506
+ * @memberof CreateChatCompletionResponseChoicesInner
507
+ */
508
+ 'message'?: ChatCompletionResponseMessage;
509
+ /**
510
+ *
511
+ * @type {string}
512
+ * @memberof CreateChatCompletionResponseChoicesInner
513
+ */
514
+ 'finish_reason'?: string;
515
+ }
516
+ /**
517
+ *
518
+ * @export
519
+ * @interface CreateClassificationRequest
520
+ */
521
+ export interface CreateClassificationRequest {
522
+ /**
523
+ * 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.
524
+ * @type {string}
525
+ * @memberof CreateClassificationRequest
526
+ */
527
+ 'model': string;
528
+ /**
529
+ * Query to be classified.
530
+ * @type {string}
531
+ * @memberof CreateClassificationRequest
532
+ */
533
+ 'query': string;
534
+ /**
535
+ * A list of examples with labels, in the following format: `[[\"The movie is so interesting.\", \"Positive\"], [\"It is quite boring.\", \"Negative\"], ...]` All the label strings will be normalized to be capitalized. You should specify either `examples` or `file`, but not both.
536
+ * @type {Array<any>}
537
+ * @memberof CreateClassificationRequest
538
+ */
539
+ 'examples'?: Array<any> | null;
540
+ /**
541
+ * The ID of the uploaded file that contains training examples. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose. You should specify either `examples` or `file`, but not both.
542
+ * @type {string}
543
+ * @memberof CreateClassificationRequest
544
+ */
545
+ 'file'?: string | null;
546
+ /**
547
+ * The set of categories being classified. If not specified, candidate labels will be automatically collected from the examples you provide. All the label strings will be normalized to be capitalized.
548
+ * @type {Array<string>}
549
+ * @memberof CreateClassificationRequest
550
+ */
551
+ 'labels'?: Array<string> | null;
552
+ /**
553
+ * ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
554
+ * @type {string}
555
+ * @memberof CreateClassificationRequest
556
+ */
557
+ 'search_model'?: string | null;
558
+ /**
559
+ * 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.
560
+ * @type {number}
561
+ * @memberof CreateClassificationRequest
562
+ */
563
+ 'temperature'?: number | null;
564
+ /**
565
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
566
+ * @type {number}
567
+ * @memberof CreateClassificationRequest
568
+ */
569
+ 'logprobs'?: number | null;
570
+ /**
571
+ * The maximum number of examples to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost.
572
+ * @type {number}
573
+ * @memberof CreateClassificationRequest
574
+ */
575
+ 'max_examples'?: number | null;
576
+ /**
577
+ * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. 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. As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.
578
+ * @type {object}
579
+ * @memberof CreateClassificationRequest
580
+ */
581
+ 'logit_bias'?: object | null;
582
+ /**
583
+ * If set to `true`, the returned JSON will include a \"prompt\" field containing the final prompt that was used to request a completion. This is mainly useful for debugging purposes.
584
+ * @type {boolean}
585
+ * @memberof CreateClassificationRequest
586
+ */
587
+ 'return_prompt'?: boolean | null;
588
+ /**
589
+ * A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a \"metadata\" field. This flag only takes effect when `file` is set.
590
+ * @type {boolean}
591
+ * @memberof CreateClassificationRequest
592
+ */
593
+ 'return_metadata'?: boolean | null;
594
+ /**
595
+ * If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID. Currently we support `completion` and `file` objects for expansion.
596
+ * @type {Array<any>}
597
+ * @memberof CreateClassificationRequest
598
+ */
599
+ 'expand'?: Array<any> | null;
600
+ /**
601
+ * 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).
602
+ * @type {string}
603
+ * @memberof CreateClassificationRequest
604
+ */
605
+ 'user'?: string;
606
+ }
607
+ /**
608
+ *
609
+ * @export
610
+ * @interface CreateClassificationResponse
611
+ */
612
+ export interface CreateClassificationResponse {
613
+ /**
614
+ *
615
+ * @type {string}
616
+ * @memberof CreateClassificationResponse
617
+ */
618
+ 'object'?: string;
619
+ /**
620
+ *
621
+ * @type {string}
622
+ * @memberof CreateClassificationResponse
623
+ */
624
+ 'model'?: string;
625
+ /**
626
+ *
627
+ * @type {string}
628
+ * @memberof CreateClassificationResponse
629
+ */
630
+ 'search_model'?: string;
631
+ /**
632
+ *
633
+ * @type {string}
634
+ * @memberof CreateClassificationResponse
635
+ */
636
+ 'completion'?: string;
637
+ /**
638
+ *
639
+ * @type {string}
640
+ * @memberof CreateClassificationResponse
641
+ */
642
+ 'label'?: string;
643
+ /**
644
+ *
645
+ * @type {Array<CreateClassificationResponseSelectedExamplesInner>}
646
+ * @memberof CreateClassificationResponse
647
+ */
648
+ 'selected_examples'?: Array<CreateClassificationResponseSelectedExamplesInner>;
649
+ }
650
+ /**
651
+ *
652
+ * @export
653
+ * @interface CreateClassificationResponseSelectedExamplesInner
654
+ */
655
+ export interface CreateClassificationResponseSelectedExamplesInner {
656
+ /**
657
+ *
658
+ * @type {number}
659
+ * @memberof CreateClassificationResponseSelectedExamplesInner
660
+ */
661
+ 'document'?: number;
662
+ /**
663
+ *
664
+ * @type {string}
665
+ * @memberof CreateClassificationResponseSelectedExamplesInner
666
+ */
667
+ 'text'?: string;
668
+ /**
669
+ *
670
+ * @type {string}
671
+ * @memberof CreateClassificationResponseSelectedExamplesInner
672
+ */
673
+ 'label'?: string;
674
+ }
675
+ /**
676
+ *
677
+ * @export
678
+ * @interface CreateCompletionRequest
679
+ */
680
+ export interface CreateCompletionRequest {
681
+ /**
682
+ * 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.
683
+ * @type {string}
684
+ * @memberof CreateCompletionRequest
685
+ */
686
+ 'model': string;
687
+ /**
688
+ *
689
+ * @type {CreateCompletionRequestPrompt}
690
+ * @memberof CreateCompletionRequest
691
+ */
692
+ 'prompt'?: CreateCompletionRequestPrompt | null;
693
+ /**
694
+ * The suffix that comes after a completion of inserted text.
695
+ * @type {string}
696
+ * @memberof CreateCompletionRequest
697
+ */
698
+ 'suffix'?: string | null;
699
+ /**
700
+ * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens.
701
+ * @type {number}
702
+ * @memberof CreateCompletionRequest
703
+ */
704
+ 'max_tokens'?: number | null;
705
+ /**
706
+ * 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.
707
+ * @type {number}
708
+ * @memberof CreateCompletionRequest
709
+ */
710
+ 'temperature'?: number | null;
711
+ /**
712
+ * 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.
713
+ * @type {number}
714
+ * @memberof CreateCompletionRequest
715
+ */
716
+ 'top_p'?: number | null;
717
+ /**
718
+ * How many completions to generate for each prompt. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
719
+ * @type {number}
720
+ * @memberof CreateCompletionRequest
721
+ */
722
+ 'n'?: number | null;
723
+ /**
724
+ * Whether to stream back partial progress. If set, 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. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_stream_completions.ipynb).
725
+ * @type {boolean}
726
+ * @memberof CreateCompletionRequest
727
+ */
728
+ 'stream'?: boolean | null;
729
+ /**
730
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5.
731
+ * @type {number}
732
+ * @memberof CreateCompletionRequest
733
+ */
734
+ 'logprobs'?: number | null;
735
+ /**
736
+ * Echo back the prompt in addition to the completion
737
+ * @type {boolean}
738
+ * @memberof CreateCompletionRequest
739
+ */
740
+ 'echo'?: boolean | null;
741
+ /**
742
+ *
743
+ * @type {CreateCompletionRequestStop}
744
+ * @memberof CreateCompletionRequest
745
+ */
746
+ 'stop'?: CreateCompletionRequestStop | null;
747
+ /**
748
+ * 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)
749
+ * @type {number}
750
+ * @memberof CreateCompletionRequest
751
+ */
752
+ 'presence_penalty'?: number | null;
753
+ /**
754
+ * 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)
755
+ * @type {number}
756
+ * @memberof CreateCompletionRequest
757
+ */
758
+ 'frequency_penalty'?: number | null;
759
+ /**
760
+ * Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed. When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
761
+ * @type {number}
762
+ * @memberof CreateCompletionRequest
763
+ */
764
+ 'best_of'?: number | null;
765
+ /**
766
+ * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. 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. As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.
767
+ * @type {object}
768
+ * @memberof CreateCompletionRequest
769
+ */
770
+ 'logit_bias'?: object | null;
771
+ /**
772
+ * 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).
773
+ * @type {string}
774
+ * @memberof CreateCompletionRequest
775
+ */
776
+ 'user'?: string;
777
+ }
778
+ /**
779
+ * @type CreateCompletionRequestPrompt
780
+ * The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
781
+ * @export
782
+ */
783
+ export type CreateCompletionRequestPrompt = Array<any> | Array<number> | Array<string> | string;
784
+
785
+ /**
786
+ * @type CreateCompletionRequestStop
787
+ * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
788
+ * @export
789
+ */
790
+ export type CreateCompletionRequestStop = Array<string> | string;
791
+
792
+ /**
793
+ *
794
+ * @export
795
+ * @interface CreateCompletionResponse
796
+ */
797
+ export interface CreateCompletionResponse {
798
+ /**
799
+ *
800
+ * @type {string}
801
+ * @memberof CreateCompletionResponse
802
+ */
803
+ 'id': string;
804
+ /**
805
+ *
806
+ * @type {string}
807
+ * @memberof CreateCompletionResponse
808
+ */
809
+ 'object': string;
810
+ /**
811
+ *
812
+ * @type {number}
813
+ * @memberof CreateCompletionResponse
814
+ */
815
+ 'created': number;
816
+ /**
817
+ *
818
+ * @type {string}
819
+ * @memberof CreateCompletionResponse
820
+ */
821
+ 'model': string;
822
+ /**
823
+ *
824
+ * @type {Array<CreateCompletionResponseChoicesInner>}
825
+ * @memberof CreateCompletionResponse
826
+ */
827
+ 'choices': Array<CreateCompletionResponseChoicesInner>;
828
+ /**
829
+ *
830
+ * @type {CreateCompletionResponseUsage}
831
+ * @memberof CreateCompletionResponse
832
+ */
833
+ 'usage'?: CreateCompletionResponseUsage;
834
+ }
835
+ /**
836
+ *
837
+ * @export
838
+ * @interface CreateCompletionResponseChoicesInner
839
+ */
840
+ export interface CreateCompletionResponseChoicesInner {
841
+ /**
842
+ *
843
+ * @type {string}
844
+ * @memberof CreateCompletionResponseChoicesInner
845
+ */
846
+ 'text'?: string;
847
+ /**
848
+ *
849
+ * @type {number}
850
+ * @memberof CreateCompletionResponseChoicesInner
851
+ */
852
+ 'index'?: number;
853
+ /**
854
+ *
855
+ * @type {CreateCompletionResponseChoicesInnerLogprobs}
856
+ * @memberof CreateCompletionResponseChoicesInner
857
+ */
858
+ 'logprobs'?: CreateCompletionResponseChoicesInnerLogprobs | null;
859
+ /**
860
+ *
861
+ * @type {string}
862
+ * @memberof CreateCompletionResponseChoicesInner
863
+ */
864
+ 'finish_reason'?: string;
865
+ }
866
+ /**
867
+ *
868
+ * @export
869
+ * @interface CreateCompletionResponseChoicesInnerLogprobs
870
+ */
871
+ export interface CreateCompletionResponseChoicesInnerLogprobs {
872
+ /**
873
+ *
874
+ * @type {Array<string>}
875
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
876
+ */
877
+ 'tokens'?: Array<string>;
878
+ /**
879
+ *
880
+ * @type {Array<number>}
881
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
882
+ */
883
+ 'token_logprobs'?: Array<number>;
884
+ /**
885
+ *
886
+ * @type {Array<object>}
887
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
888
+ */
889
+ 'top_logprobs'?: Array<object>;
890
+ /**
891
+ *
892
+ * @type {Array<number>}
893
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
894
+ */
895
+ 'text_offset'?: Array<number>;
896
+ }
897
+ /**
898
+ *
899
+ * @export
900
+ * @interface CreateCompletionResponseUsage
901
+ */
902
+ export interface CreateCompletionResponseUsage {
903
+ /**
904
+ *
905
+ * @type {number}
906
+ * @memberof CreateCompletionResponseUsage
907
+ */
908
+ 'prompt_tokens': number;
909
+ /**
910
+ *
911
+ * @type {number}
912
+ * @memberof CreateCompletionResponseUsage
913
+ */
914
+ 'completion_tokens': number;
915
+ /**
916
+ *
917
+ * @type {number}
918
+ * @memberof CreateCompletionResponseUsage
919
+ */
920
+ 'total_tokens': number;
921
+ }
922
+ /**
923
+ *
924
+ * @export
925
+ * @interface CreateEditRequest
926
+ */
927
+ export interface CreateEditRequest {
928
+ /**
929
+ * ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint.
930
+ * @type {string}
931
+ * @memberof CreateEditRequest
932
+ */
933
+ 'model': string;
934
+ /**
935
+ * The input text to use as a starting point for the edit.
936
+ * @type {string}
937
+ * @memberof CreateEditRequest
938
+ */
939
+ 'input'?: string | null;
940
+ /**
941
+ * The instruction that tells the model how to edit the prompt.
942
+ * @type {string}
943
+ * @memberof CreateEditRequest
944
+ */
945
+ 'instruction': string;
946
+ /**
947
+ * How many edits to generate for the input and instruction.
948
+ * @type {number}
949
+ * @memberof CreateEditRequest
950
+ */
951
+ 'n'?: number | null;
952
+ /**
953
+ * 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.
954
+ * @type {number}
955
+ * @memberof CreateEditRequest
956
+ */
957
+ 'temperature'?: number | null;
958
+ /**
959
+ * 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.
960
+ * @type {number}
961
+ * @memberof CreateEditRequest
962
+ */
963
+ 'top_p'?: number | null;
964
+ }
965
+ /**
966
+ *
967
+ * @export
968
+ * @interface CreateEditResponse
969
+ */
970
+ export interface CreateEditResponse {
971
+ /**
972
+ *
973
+ * @type {string}
974
+ * @memberof CreateEditResponse
975
+ */
976
+ 'object': string;
977
+ /**
978
+ *
979
+ * @type {number}
980
+ * @memberof CreateEditResponse
981
+ */
982
+ 'created': number;
983
+ /**
984
+ *
985
+ * @type {Array<CreateCompletionResponseChoicesInner>}
986
+ * @memberof CreateEditResponse
987
+ */
988
+ 'choices': Array<CreateCompletionResponseChoicesInner>;
989
+ /**
990
+ *
991
+ * @type {CreateCompletionResponseUsage}
992
+ * @memberof CreateEditResponse
993
+ */
994
+ 'usage': CreateCompletionResponseUsage;
995
+ }
996
+ /**
997
+ *
998
+ * @export
999
+ * @interface CreateEmbeddingRequest
1000
+ */
1001
+ export interface CreateEmbeddingRequest {
1002
+ /**
1003
+ * 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.
1004
+ * @type {string}
1005
+ * @memberof CreateEmbeddingRequest
1006
+ */
1007
+ 'model': string;
1008
+ /**
1009
+ *
1010
+ * @type {CreateEmbeddingRequestInput}
1011
+ * @memberof CreateEmbeddingRequest
1012
+ */
1013
+ 'input': CreateEmbeddingRequestInput;
1014
+ /**
1015
+ * 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).
1016
+ * @type {string}
1017
+ * @memberof CreateEmbeddingRequest
1018
+ */
1019
+ 'user'?: string;
1020
+ }
1021
+ /**
1022
+ * @type CreateEmbeddingRequestInput
1023
+ * Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed the max input tokens for the model (8191 tokens for `text-embedding-ada-002`). [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens.
1024
+ * @export
1025
+ */
1026
+ export type CreateEmbeddingRequestInput = Array<any> | Array<number> | Array<string> | string;
1027
+
1028
+ /**
1029
+ *
1030
+ * @export
1031
+ * @interface CreateEmbeddingResponse
1032
+ */
1033
+ export interface CreateEmbeddingResponse {
1034
+ /**
1035
+ *
1036
+ * @type {string}
1037
+ * @memberof CreateEmbeddingResponse
1038
+ */
1039
+ 'object': string;
1040
+ /**
1041
+ *
1042
+ * @type {string}
1043
+ * @memberof CreateEmbeddingResponse
1044
+ */
1045
+ 'model': string;
1046
+ /**
1047
+ *
1048
+ * @type {Array<CreateEmbeddingResponseDataInner>}
1049
+ * @memberof CreateEmbeddingResponse
1050
+ */
1051
+ 'data': Array<CreateEmbeddingResponseDataInner>;
1052
+ /**
1053
+ *
1054
+ * @type {CreateEmbeddingResponseUsage}
1055
+ * @memberof CreateEmbeddingResponse
1056
+ */
1057
+ 'usage': CreateEmbeddingResponseUsage;
1058
+ }
1059
+ /**
1060
+ *
1061
+ * @export
1062
+ * @interface CreateEmbeddingResponseDataInner
1063
+ */
1064
+ export interface CreateEmbeddingResponseDataInner {
1065
+ /**
1066
+ *
1067
+ * @type {number}
1068
+ * @memberof CreateEmbeddingResponseDataInner
1069
+ */
1070
+ 'index': number;
1071
+ /**
1072
+ *
1073
+ * @type {string}
1074
+ * @memberof CreateEmbeddingResponseDataInner
1075
+ */
1076
+ 'object': string;
1077
+ /**
1078
+ *
1079
+ * @type {Array<number>}
1080
+ * @memberof CreateEmbeddingResponseDataInner
1081
+ */
1082
+ 'embedding': Array<number>;
1083
+ }
1084
+ /**
1085
+ *
1086
+ * @export
1087
+ * @interface CreateEmbeddingResponseUsage
1088
+ */
1089
+ export interface CreateEmbeddingResponseUsage {
1090
+ /**
1091
+ *
1092
+ * @type {number}
1093
+ * @memberof CreateEmbeddingResponseUsage
1094
+ */
1095
+ 'prompt_tokens': number;
1096
+ /**
1097
+ *
1098
+ * @type {number}
1099
+ * @memberof CreateEmbeddingResponseUsage
1100
+ */
1101
+ 'total_tokens': number;
1102
+ }
1103
+ /**
1104
+ *
1105
+ * @export
1106
+ * @interface CreateFineTuneRequest
1107
+ */
1108
+ export interface CreateFineTuneRequest {
1109
+ /**
1110
+ * The ID of an uploaded file that contains training data. See [upload file](/docs/api-reference/files/upload) for how to upload a file. Your dataset must be formatted as a JSONL file, where each training example is a JSON object with the keys \"prompt\" and \"completion\". Additionally, you must upload your file with the purpose `fine-tune`. See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details.
1111
+ * @type {string}
1112
+ * @memberof CreateFineTuneRequest
1113
+ */
1114
+ 'training_file': string;
1115
+ /**
1116
+ * The ID of an uploaded file that contains validation data. If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the [fine-tuning results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model). Your train and validation data should be mutually exclusive. Your dataset must be formatted as a JSONL file, where each validation example is a JSON object with the keys \"prompt\" and \"completion\". Additionally, you must upload your file with the purpose `fine-tune`. See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details.
1117
+ * @type {string}
1118
+ * @memberof CreateFineTuneRequest
1119
+ */
1120
+ 'validation_file'?: string | null;
1121
+ /**
1122
+ * 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.
1123
+ * @type {string}
1124
+ * @memberof CreateFineTuneRequest
1125
+ */
1126
+ 'model'?: string | null;
1127
+ /**
1128
+ * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
1129
+ * @type {number}
1130
+ * @memberof CreateFineTuneRequest
1131
+ */
1132
+ 'n_epochs'?: number | null;
1133
+ /**
1134
+ * The batch size to use for training. The batch size is the number of training examples used to train a single forward and backward pass. By default, the batch size will be dynamically configured to be ~0.2% of the number of examples in the training set, capped at 256 - in general, we\'ve found that larger batch sizes tend to work better for larger datasets.
1135
+ * @type {number}
1136
+ * @memberof CreateFineTuneRequest
1137
+ */
1138
+ 'batch_size'?: number | null;
1139
+ /**
1140
+ * The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pretraining multiplied by this value. By default, the learning rate multiplier is the 0.05, 0.1, or 0.2 depending on final `batch_size` (larger learning rates tend to perform better with larger batch sizes). We recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results.
1141
+ * @type {number}
1142
+ * @memberof CreateFineTuneRequest
1143
+ */
1144
+ 'learning_rate_multiplier'?: number | null;
1145
+ /**
1146
+ * The weight to use for loss on the prompt tokens. This controls how much the model tries to learn to generate the prompt (as compared to the completion which always has a weight of 1.0), and can add a stabilizing effect to training when completions are short. If prompts are extremely long (relative to completions), it may make sense to reduce this weight so as to avoid over-prioritizing learning the prompt.
1147
+ * @type {number}
1148
+ * @memberof CreateFineTuneRequest
1149
+ */
1150
+ 'prompt_loss_weight'?: number | null;
1151
+ /**
1152
+ * If set, we calculate classification-specific metrics such as accuracy and F-1 score using the validation set at the end of every epoch. These metrics can be viewed in the [results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model). In order to compute classification metrics, you must provide a `validation_file`. Additionally, you must specify `classification_n_classes` for multiclass classification or `classification_positive_class` for binary classification.
1153
+ * @type {boolean}
1154
+ * @memberof CreateFineTuneRequest
1155
+ */
1156
+ 'compute_classification_metrics'?: boolean | null;
1157
+ /**
1158
+ * The number of classes in a classification task. This parameter is required for multiclass classification.
1159
+ * @type {number}
1160
+ * @memberof CreateFineTuneRequest
1161
+ */
1162
+ 'classification_n_classes'?: number | null;
1163
+ /**
1164
+ * The positive class in binary classification. This parameter is needed to generate precision, recall, and F1 metrics when doing binary classification.
1165
+ * @type {string}
1166
+ * @memberof CreateFineTuneRequest
1167
+ */
1168
+ 'classification_positive_class'?: string | null;
1169
+ /**
1170
+ * If this is provided, we calculate F-beta scores at the specified beta values. The F-beta score is a generalization of F-1 score. This is only used for binary classification. With a beta of 1 (i.e. the F-1 score), precision and recall are given the same weight. A larger beta score puts more weight on recall and less on precision. A smaller beta score puts more weight on precision and less on recall.
1171
+ * @type {Array<number>}
1172
+ * @memberof CreateFineTuneRequest
1173
+ */
1174
+ 'classification_betas'?: Array<number> | null;
1175
+ /**
1176
+ * A string of up to 40 characters that will be added to your fine-tuned model name. For example, a `suffix` of \"custom-model-name\" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`.
1177
+ * @type {string}
1178
+ * @memberof CreateFineTuneRequest
1179
+ */
1180
+ 'suffix'?: string | null;
1181
+ }
1182
+ /**
1183
+ *
1184
+ * @export
1185
+ * @interface CreateImageRequest
1186
+ */
1187
+ export interface CreateImageRequest {
1188
+ /**
1189
+ * A text description of the desired image(s). The maximum length is 1000 characters.
1190
+ * @type {string}
1191
+ * @memberof CreateImageRequest
1192
+ */
1193
+ 'prompt': string;
1194
+ /**
1195
+ * The number of images to generate. Must be between 1 and 10.
1196
+ * @type {number}
1197
+ * @memberof CreateImageRequest
1198
+ */
1199
+ 'n'?: number | null;
1200
+ /**
1201
+ * The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
1202
+ * @type {string}
1203
+ * @memberof CreateImageRequest
1204
+ */
1205
+ 'size'?: CreateImageRequestSizeEnum;
1206
+ /**
1207
+ * The format in which the generated images are returned. Must be one of `url` or `b64_json`.
1208
+ * @type {string}
1209
+ * @memberof CreateImageRequest
1210
+ */
1211
+ 'response_format'?: CreateImageRequestResponseFormatEnum;
1212
+ /**
1213
+ * 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).
1214
+ * @type {string}
1215
+ * @memberof CreateImageRequest
1216
+ */
1217
+ 'user'?: string;
1218
+ }
1219
+
1220
+ export const CreateImageRequestSizeEnum = {
1221
+ _256x256: '256x256',
1222
+ _512x512: '512x512',
1223
+ _1024x1024: '1024x1024'
1224
+ } as const;
1225
+
1226
+ export type CreateImageRequestSizeEnum = typeof CreateImageRequestSizeEnum[keyof typeof CreateImageRequestSizeEnum];
1227
+ export const CreateImageRequestResponseFormatEnum = {
1228
+ Url: 'url',
1229
+ B64Json: 'b64_json'
1230
+ } as const;
1231
+
1232
+ export type CreateImageRequestResponseFormatEnum = typeof CreateImageRequestResponseFormatEnum[keyof typeof CreateImageRequestResponseFormatEnum];
1233
+
1234
+ /**
1235
+ *
1236
+ * @export
1237
+ * @interface CreateModerationRequest
1238
+ */
1239
+ export interface CreateModerationRequest {
1240
+ /**
1241
+ *
1242
+ * @type {CreateModerationRequestInput}
1243
+ * @memberof CreateModerationRequest
1244
+ */
1245
+ 'input': CreateModerationRequestInput;
1246
+ /**
1247
+ * Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`. The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.
1248
+ * @type {string}
1249
+ * @memberof CreateModerationRequest
1250
+ */
1251
+ 'model'?: string;
1252
+ }
1253
+ /**
1254
+ * @type CreateModerationRequestInput
1255
+ * The input text to classify
1256
+ * @export
1257
+ */
1258
+ export type CreateModerationRequestInput = Array<string> | string;
1259
+
1260
+ /**
1261
+ *
1262
+ * @export
1263
+ * @interface CreateModerationResponse
1264
+ */
1265
+ export interface CreateModerationResponse {
1266
+ /**
1267
+ *
1268
+ * @type {string}
1269
+ * @memberof CreateModerationResponse
1270
+ */
1271
+ 'id': string;
1272
+ /**
1273
+ *
1274
+ * @type {string}
1275
+ * @memberof CreateModerationResponse
1276
+ */
1277
+ 'model': string;
1278
+ /**
1279
+ *
1280
+ * @type {Array<CreateModerationResponseResultsInner>}
1281
+ * @memberof CreateModerationResponse
1282
+ */
1283
+ 'results': Array<CreateModerationResponseResultsInner>;
1284
+ }
1285
+ /**
1286
+ *
1287
+ * @export
1288
+ * @interface CreateModerationResponseResultsInner
1289
+ */
1290
+ export interface CreateModerationResponseResultsInner {
1291
+ /**
1292
+ *
1293
+ * @type {boolean}
1294
+ * @memberof CreateModerationResponseResultsInner
1295
+ */
1296
+ 'flagged': boolean;
1297
+ /**
1298
+ *
1299
+ * @type {CreateModerationResponseResultsInnerCategories}
1300
+ * @memberof CreateModerationResponseResultsInner
1301
+ */
1302
+ 'categories': CreateModerationResponseResultsInnerCategories;
1303
+ /**
1304
+ *
1305
+ * @type {CreateModerationResponseResultsInnerCategoryScores}
1306
+ * @memberof CreateModerationResponseResultsInner
1307
+ */
1308
+ 'category_scores': CreateModerationResponseResultsInnerCategoryScores;
1309
+ }
1310
+ /**
1311
+ *
1312
+ * @export
1313
+ * @interface CreateModerationResponseResultsInnerCategories
1314
+ */
1315
+ export interface CreateModerationResponseResultsInnerCategories {
1316
+ /**
1317
+ *
1318
+ * @type {boolean}
1319
+ * @memberof CreateModerationResponseResultsInnerCategories
1320
+ */
1321
+ 'hate': boolean;
1322
+ /**
1323
+ *
1324
+ * @type {boolean}
1325
+ * @memberof CreateModerationResponseResultsInnerCategories
1326
+ */
1327
+ 'hate/threatening': boolean;
1328
+ /**
1329
+ *
1330
+ * @type {boolean}
1331
+ * @memberof CreateModerationResponseResultsInnerCategories
1332
+ */
1333
+ 'self-harm': boolean;
1334
+ /**
1335
+ *
1336
+ * @type {boolean}
1337
+ * @memberof CreateModerationResponseResultsInnerCategories
1338
+ */
1339
+ 'sexual': boolean;
1340
+ /**
1341
+ *
1342
+ * @type {boolean}
1343
+ * @memberof CreateModerationResponseResultsInnerCategories
1344
+ */
1345
+ 'sexual/minors': boolean;
1346
+ /**
1347
+ *
1348
+ * @type {boolean}
1349
+ * @memberof CreateModerationResponseResultsInnerCategories
1350
+ */
1351
+ 'violence': boolean;
1352
+ /**
1353
+ *
1354
+ * @type {boolean}
1355
+ * @memberof CreateModerationResponseResultsInnerCategories
1356
+ */
1357
+ 'violence/graphic': boolean;
1358
+ }
1359
+ /**
1360
+ *
1361
+ * @export
1362
+ * @interface CreateModerationResponseResultsInnerCategoryScores
1363
+ */
1364
+ export interface CreateModerationResponseResultsInnerCategoryScores {
1365
+ /**
1366
+ *
1367
+ * @type {number}
1368
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1369
+ */
1370
+ 'hate': number;
1371
+ /**
1372
+ *
1373
+ * @type {number}
1374
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1375
+ */
1376
+ 'hate/threatening': number;
1377
+ /**
1378
+ *
1379
+ * @type {number}
1380
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1381
+ */
1382
+ 'self-harm': number;
1383
+ /**
1384
+ *
1385
+ * @type {number}
1386
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1387
+ */
1388
+ 'sexual': number;
1389
+ /**
1390
+ *
1391
+ * @type {number}
1392
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1393
+ */
1394
+ 'sexual/minors': number;
1395
+ /**
1396
+ *
1397
+ * @type {number}
1398
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1399
+ */
1400
+ 'violence': number;
1401
+ /**
1402
+ *
1403
+ * @type {number}
1404
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1405
+ */
1406
+ 'violence/graphic': number;
1407
+ }
1408
+ /**
1409
+ *
1410
+ * @export
1411
+ * @interface CreateSearchRequest
1412
+ */
1413
+ export interface CreateSearchRequest {
1414
+ /**
1415
+ * Query to search against the documents.
1416
+ * @type {string}
1417
+ * @memberof CreateSearchRequest
1418
+ */
1419
+ 'query': string;
1420
+ /**
1421
+ * Up to 200 documents to search over, provided as a list of strings. The maximum document length (in tokens) is 2034 minus the number of tokens in the query. You should specify either `documents` or a `file`, but not both.
1422
+ * @type {Array<string>}
1423
+ * @memberof CreateSearchRequest
1424
+ */
1425
+ 'documents'?: Array<string> | null;
1426
+ /**
1427
+ * The ID of an uploaded file that contains documents to search over. You should specify either `documents` or a `file`, but not both.
1428
+ * @type {string}
1429
+ * @memberof CreateSearchRequest
1430
+ */
1431
+ 'file'?: string | null;
1432
+ /**
1433
+ * The maximum number of documents to be re-ranked and returned by search. This flag only takes effect when `file` is set.
1434
+ * @type {number}
1435
+ * @memberof CreateSearchRequest
1436
+ */
1437
+ 'max_rerank'?: number | null;
1438
+ /**
1439
+ * A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a \"metadata\" field. This flag only takes effect when `file` is set.
1440
+ * @type {boolean}
1441
+ * @memberof CreateSearchRequest
1442
+ */
1443
+ 'return_metadata'?: boolean | null;
1444
+ /**
1445
+ * 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).
1446
+ * @type {string}
1447
+ * @memberof CreateSearchRequest
1448
+ */
1449
+ 'user'?: string;
1450
+ }
1451
+ /**
1452
+ *
1453
+ * @export
1454
+ * @interface CreateSearchResponse
1455
+ */
1456
+ export interface CreateSearchResponse {
1457
+ /**
1458
+ *
1459
+ * @type {string}
1460
+ * @memberof CreateSearchResponse
1461
+ */
1462
+ 'object'?: string;
1463
+ /**
1464
+ *
1465
+ * @type {string}
1466
+ * @memberof CreateSearchResponse
1467
+ */
1468
+ 'model'?: string;
1469
+ /**
1470
+ *
1471
+ * @type {Array<CreateSearchResponseDataInner>}
1472
+ * @memberof CreateSearchResponse
1473
+ */
1474
+ 'data'?: Array<CreateSearchResponseDataInner>;
1475
+ }
1476
+ /**
1477
+ *
1478
+ * @export
1479
+ * @interface CreateSearchResponseDataInner
1480
+ */
1481
+ export interface CreateSearchResponseDataInner {
1482
+ /**
1483
+ *
1484
+ * @type {string}
1485
+ * @memberof CreateSearchResponseDataInner
1486
+ */
1487
+ 'object'?: string;
1488
+ /**
1489
+ *
1490
+ * @type {number}
1491
+ * @memberof CreateSearchResponseDataInner
1492
+ */
1493
+ 'document'?: number;
1494
+ /**
1495
+ *
1496
+ * @type {number}
1497
+ * @memberof CreateSearchResponseDataInner
1498
+ */
1499
+ 'score'?: number;
1500
+ }
1501
+ /**
1502
+ *
1503
+ * @export
1504
+ * @interface CreateTranscriptionResponse
1505
+ */
1506
+ export interface CreateTranscriptionResponse {
1507
+ /**
1508
+ *
1509
+ * @type {string}
1510
+ * @memberof CreateTranscriptionResponse
1511
+ */
1512
+ 'text': string;
1513
+ }
1514
+ /**
1515
+ *
1516
+ * @export
1517
+ * @interface CreateTranslationResponse
1518
+ */
1519
+ export interface CreateTranslationResponse {
1520
+ /**
1521
+ *
1522
+ * @type {string}
1523
+ * @memberof CreateTranslationResponse
1524
+ */
1525
+ 'text': string;
1526
+ }
1527
+ /**
1528
+ *
1529
+ * @export
1530
+ * @interface DeleteFileResponse
1531
+ */
1532
+ export interface DeleteFileResponse {
1533
+ /**
1534
+ *
1535
+ * @type {string}
1536
+ * @memberof DeleteFileResponse
1537
+ */
1538
+ 'id': string;
1539
+ /**
1540
+ *
1541
+ * @type {string}
1542
+ * @memberof DeleteFileResponse
1543
+ */
1544
+ 'object': string;
1545
+ /**
1546
+ *
1547
+ * @type {boolean}
1548
+ * @memberof DeleteFileResponse
1549
+ */
1550
+ 'deleted': boolean;
1551
+ }
1552
+ /**
1553
+ *
1554
+ * @export
1555
+ * @interface DeleteModelResponse
1556
+ */
1557
+ export interface DeleteModelResponse {
1558
+ /**
1559
+ *
1560
+ * @type {string}
1561
+ * @memberof DeleteModelResponse
1562
+ */
1563
+ 'id': string;
1564
+ /**
1565
+ *
1566
+ * @type {string}
1567
+ * @memberof DeleteModelResponse
1568
+ */
1569
+ 'object': string;
1570
+ /**
1571
+ *
1572
+ * @type {boolean}
1573
+ * @memberof DeleteModelResponse
1574
+ */
1575
+ 'deleted': boolean;
1576
+ }
1577
+ /**
1578
+ *
1579
+ * @export
1580
+ * @interface Engine
1581
+ */
1582
+ export interface Engine {
1583
+ /**
1584
+ *
1585
+ * @type {string}
1586
+ * @memberof Engine
1587
+ */
1588
+ 'id': string;
1589
+ /**
1590
+ *
1591
+ * @type {string}
1592
+ * @memberof Engine
1593
+ */
1594
+ 'object': string;
1595
+ /**
1596
+ *
1597
+ * @type {number}
1598
+ * @memberof Engine
1599
+ */
1600
+ 'created': number | null;
1601
+ /**
1602
+ *
1603
+ * @type {boolean}
1604
+ * @memberof Engine
1605
+ */
1606
+ 'ready': boolean;
1607
+ }
1608
+ /**
1609
+ *
1610
+ * @export
1611
+ * @interface ErrorResponse
1612
+ */
1613
+ export interface ErrorResponse {
1614
+ /**
1615
+ *
1616
+ * @type {Error}
1617
+ * @memberof ErrorResponse
1618
+ */
1619
+ 'error': Error;
1620
+ }
1621
+ /**
1622
+ *
1623
+ * @export
1624
+ * @interface FineTune
1625
+ */
1626
+ export interface FineTune {
1627
+ /**
1628
+ *
1629
+ * @type {string}
1630
+ * @memberof FineTune
1631
+ */
1632
+ 'id': string;
1633
+ /**
1634
+ *
1635
+ * @type {string}
1636
+ * @memberof FineTune
1637
+ */
1638
+ 'object': string;
1639
+ /**
1640
+ *
1641
+ * @type {number}
1642
+ * @memberof FineTune
1643
+ */
1644
+ 'created_at': number;
1645
+ /**
1646
+ *
1647
+ * @type {number}
1648
+ * @memberof FineTune
1649
+ */
1650
+ 'updated_at': number;
1651
+ /**
1652
+ *
1653
+ * @type {string}
1654
+ * @memberof FineTune
1655
+ */
1656
+ 'model': string;
1657
+ /**
1658
+ *
1659
+ * @type {string}
1660
+ * @memberof FineTune
1661
+ */
1662
+ 'fine_tuned_model': string | null;
1663
+ /**
1664
+ *
1665
+ * @type {string}
1666
+ * @memberof FineTune
1667
+ */
1668
+ 'organization_id': string;
1669
+ /**
1670
+ *
1671
+ * @type {string}
1672
+ * @memberof FineTune
1673
+ */
1674
+ 'status': string;
1675
+ /**
1676
+ *
1677
+ * @type {object}
1678
+ * @memberof FineTune
1679
+ */
1680
+ 'hyperparams': object;
1681
+ /**
1682
+ *
1683
+ * @type {Array<OpenAIFile>}
1684
+ * @memberof FineTune
1685
+ */
1686
+ 'training_files': Array<OpenAIFile>;
1687
+ /**
1688
+ *
1689
+ * @type {Array<OpenAIFile>}
1690
+ * @memberof FineTune
1691
+ */
1692
+ 'validation_files': Array<OpenAIFile>;
1693
+ /**
1694
+ *
1695
+ * @type {Array<OpenAIFile>}
1696
+ * @memberof FineTune
1697
+ */
1698
+ 'result_files': Array<OpenAIFile>;
1699
+ /**
1700
+ *
1701
+ * @type {Array<FineTuneEvent>}
1702
+ * @memberof FineTune
1703
+ */
1704
+ 'events'?: Array<FineTuneEvent>;
1705
+ }
1706
+ /**
1707
+ *
1708
+ * @export
1709
+ * @interface FineTuneEvent
1710
+ */
1711
+ export interface FineTuneEvent {
1712
+ /**
1713
+ *
1714
+ * @type {string}
1715
+ * @memberof FineTuneEvent
1716
+ */
1717
+ 'object': string;
1718
+ /**
1719
+ *
1720
+ * @type {number}
1721
+ * @memberof FineTuneEvent
1722
+ */
1723
+ 'created_at': number;
1724
+ /**
1725
+ *
1726
+ * @type {string}
1727
+ * @memberof FineTuneEvent
1728
+ */
1729
+ 'level': string;
1730
+ /**
1731
+ *
1732
+ * @type {string}
1733
+ * @memberof FineTuneEvent
1734
+ */
1735
+ 'message': string;
1736
+ }
1737
+ /**
1738
+ *
1739
+ * @export
1740
+ * @interface ImagesResponse
1741
+ */
1742
+ export interface ImagesResponse {
1743
+ /**
1744
+ *
1745
+ * @type {number}
1746
+ * @memberof ImagesResponse
1747
+ */
1748
+ 'created': number;
1749
+ /**
1750
+ *
1751
+ * @type {Array<ImagesResponseDataInner>}
1752
+ * @memberof ImagesResponse
1753
+ */
1754
+ 'data': Array<ImagesResponseDataInner>;
1755
+ }
1756
+ /**
1757
+ *
1758
+ * @export
1759
+ * @interface ImagesResponseDataInner
1760
+ */
1761
+ export interface ImagesResponseDataInner {
1762
+ /**
1763
+ *
1764
+ * @type {string}
1765
+ * @memberof ImagesResponseDataInner
1766
+ */
1767
+ 'url'?: string;
1768
+ /**
1769
+ *
1770
+ * @type {string}
1771
+ * @memberof ImagesResponseDataInner
1772
+ */
1773
+ 'b64_json'?: string;
1774
+ }
1775
+ /**
1776
+ *
1777
+ * @export
1778
+ * @interface ListEnginesResponse
1779
+ */
1780
+ export interface ListEnginesResponse {
1781
+ /**
1782
+ *
1783
+ * @type {string}
1784
+ * @memberof ListEnginesResponse
1785
+ */
1786
+ 'object': string;
1787
+ /**
1788
+ *
1789
+ * @type {Array<Engine>}
1790
+ * @memberof ListEnginesResponse
1791
+ */
1792
+ 'data': Array<Engine>;
1793
+ }
1794
+ /**
1795
+ *
1796
+ * @export
1797
+ * @interface ListFilesResponse
1798
+ */
1799
+ export interface ListFilesResponse {
1800
+ /**
1801
+ *
1802
+ * @type {string}
1803
+ * @memberof ListFilesResponse
1804
+ */
1805
+ 'object': string;
1806
+ /**
1807
+ *
1808
+ * @type {Array<OpenAIFile>}
1809
+ * @memberof ListFilesResponse
1810
+ */
1811
+ 'data': Array<OpenAIFile>;
1812
+ }
1813
+ /**
1814
+ *
1815
+ * @export
1816
+ * @interface ListFineTuneEventsResponse
1817
+ */
1818
+ export interface ListFineTuneEventsResponse {
1819
+ /**
1820
+ *
1821
+ * @type {string}
1822
+ * @memberof ListFineTuneEventsResponse
1823
+ */
1824
+ 'object': string;
1825
+ /**
1826
+ *
1827
+ * @type {Array<FineTuneEvent>}
1828
+ * @memberof ListFineTuneEventsResponse
1829
+ */
1830
+ 'data': Array<FineTuneEvent>;
1831
+ }
1832
+ /**
1833
+ *
1834
+ * @export
1835
+ * @interface ListFineTunesResponse
1836
+ */
1837
+ export interface ListFineTunesResponse {
1838
+ /**
1839
+ *
1840
+ * @type {string}
1841
+ * @memberof ListFineTunesResponse
1842
+ */
1843
+ 'object': string;
1844
+ /**
1845
+ *
1846
+ * @type {Array<FineTune>}
1847
+ * @memberof ListFineTunesResponse
1848
+ */
1849
+ 'data': Array<FineTune>;
1850
+ }
1851
+ /**
1852
+ *
1853
+ * @export
1854
+ * @interface ListModelsResponse
1855
+ */
1856
+ export interface ListModelsResponse {
1857
+ /**
1858
+ *
1859
+ * @type {string}
1860
+ * @memberof ListModelsResponse
1861
+ */
1862
+ 'object': string;
1863
+ /**
1864
+ *
1865
+ * @type {Array<Model>}
1866
+ * @memberof ListModelsResponse
1867
+ */
1868
+ 'data': Array<Model>;
1869
+ }
1870
+ /**
1871
+ *
1872
+ * @export
1873
+ * @interface Model
1874
+ */
1875
+ export interface Model {
1876
+ /**
1877
+ *
1878
+ * @type {string}
1879
+ * @memberof Model
1880
+ */
1881
+ 'id': string;
1882
+ /**
1883
+ *
1884
+ * @type {string}
1885
+ * @memberof Model
1886
+ */
1887
+ 'object': string;
1888
+ /**
1889
+ *
1890
+ * @type {number}
1891
+ * @memberof Model
1892
+ */
1893
+ 'created': number;
1894
+ /**
1895
+ *
1896
+ * @type {string}
1897
+ * @memberof Model
1898
+ */
1899
+ 'owned_by': string;
1900
+ }
1901
+ /**
1902
+ *
1903
+ * @export
1904
+ * @interface ModelError
1905
+ */
1906
+ export interface ModelError {
1907
+ /**
1908
+ *
1909
+ * @type {string}
1910
+ * @memberof ModelError
1911
+ */
1912
+ 'type': string;
1913
+ /**
1914
+ *
1915
+ * @type {string}
1916
+ * @memberof ModelError
1917
+ */
1918
+ 'message': string;
1919
+ /**
1920
+ *
1921
+ * @type {string}
1922
+ * @memberof ModelError
1923
+ */
1924
+ 'param': string | null;
1925
+ /**
1926
+ *
1927
+ * @type {string}
1928
+ * @memberof ModelError
1929
+ */
1930
+ 'code': string | null;
1931
+ }
1932
+ /**
1933
+ *
1934
+ * @export
1935
+ * @interface OpenAIFile
1936
+ */
1937
+ export interface OpenAIFile {
1938
+ /**
1939
+ *
1940
+ * @type {string}
1941
+ * @memberof OpenAIFile
1942
+ */
1943
+ 'id': string;
1944
+ /**
1945
+ *
1946
+ * @type {string}
1947
+ * @memberof OpenAIFile
1948
+ */
1949
+ 'object': string;
1950
+ /**
1951
+ *
1952
+ * @type {number}
1953
+ * @memberof OpenAIFile
1954
+ */
1955
+ 'bytes': number;
1956
+ /**
1957
+ *
1958
+ * @type {number}
1959
+ * @memberof OpenAIFile
1960
+ */
1961
+ 'created_at': number;
1962
+ /**
1963
+ *
1964
+ * @type {string}
1965
+ * @memberof OpenAIFile
1966
+ */
1967
+ 'filename': string;
1968
+ /**
1969
+ *
1970
+ * @type {string}
1971
+ * @memberof OpenAIFile
1972
+ */
1973
+ 'purpose': string;
1974
+ /**
1975
+ *
1976
+ * @type {string}
1977
+ * @memberof OpenAIFile
1978
+ */
1979
+ 'status'?: string;
1980
+ /**
1981
+ *
1982
+ * @type {object}
1983
+ * @memberof OpenAIFile
1984
+ */
1985
+ 'status_details'?: object | null;
1986
+ }
1987
+
1988
+ /**
1989
+ * OpenAIApi - axios parameter creator
1990
+ * @export
1991
+ */
1992
+ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuration) {
1993
+ return {
1994
+ /**
1995
+ *
1996
+ * @summary Immediately cancel a fine-tune job.
1997
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1998
+ * @param {*} [options] Override http request option.
1999
+ * @throws {RequiredError}
2000
+ */
2001
+ cancelFineTune: async (fineTuneId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2002
+ // verify required parameter 'fineTuneId' is not null or undefined
2003
+ assertParamExists('cancelFineTune', 'fineTuneId', fineTuneId)
2004
+ const localVarPath = `/fine-tunes/{fine_tune_id}/cancel`
2005
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
2006
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2007
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2008
+ let baseOptions;
2009
+ if (configuration) {
2010
+ baseOptions = configuration.baseOptions;
2011
+ }
2012
+
2013
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2014
+ const localVarHeaderParameter = {} as any;
2015
+ const localVarQueryParameter = {} as any;
2016
+
2017
+
2018
+
2019
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2020
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2021
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2022
+
2023
+ return {
2024
+ url: toPathString(localVarUrlObj),
2025
+ options: localVarRequestOptions,
2026
+ };
2027
+ },
2028
+ /**
2029
+ *
2030
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
2031
+ * @param {CreateAnswerRequest} createAnswerRequest
2032
+ * @param {*} [options] Override http request option.
2033
+ * @deprecated
2034
+ * @throws {RequiredError}
2035
+ */
2036
+ createAnswer: async (createAnswerRequest: CreateAnswerRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2037
+ // verify required parameter 'createAnswerRequest' is not null or undefined
2038
+ assertParamExists('createAnswer', 'createAnswerRequest', createAnswerRequest)
2039
+ const localVarPath = `/answers`;
2040
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2041
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2042
+ let baseOptions;
2043
+ if (configuration) {
2044
+ baseOptions = configuration.baseOptions;
2045
+ }
2046
+
2047
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2048
+ const localVarHeaderParameter = {} as any;
2049
+ const localVarQueryParameter = {} as any;
2050
+
2051
+
2052
+
2053
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2054
+
2055
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2056
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2057
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2058
+ localVarRequestOptions.data = serializeDataIfNeeded(createAnswerRequest, localVarRequestOptions, configuration)
2059
+
2060
+ return {
2061
+ url: toPathString(localVarUrlObj),
2062
+ options: localVarRequestOptions,
2063
+ };
2064
+ },
2065
+ /**
2066
+ *
2067
+ * @summary Creates a model response for the given chat conversation.
2068
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
2069
+ * @param {*} [options] Override http request option.
2070
+ * @throws {RequiredError}
2071
+ */
2072
+ createChatCompletion: async (createChatCompletionRequest: CreateChatCompletionRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2073
+ // verify required parameter 'createChatCompletionRequest' is not null or undefined
2074
+ assertParamExists('createChatCompletion', 'createChatCompletionRequest', createChatCompletionRequest)
2075
+ const localVarPath = `/chat/completions`;
2076
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2077
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2078
+ let baseOptions;
2079
+ if (configuration) {
2080
+ baseOptions = configuration.baseOptions;
2081
+ }
2082
+
2083
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2084
+ const localVarHeaderParameter = {} as any;
2085
+ const localVarQueryParameter = {} as any;
2086
+
2087
+
2088
+
2089
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2090
+
2091
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2092
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2093
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2094
+ localVarRequestOptions.data = serializeDataIfNeeded(createChatCompletionRequest, localVarRequestOptions, configuration)
2095
+
2096
+ return {
2097
+ url: toPathString(localVarUrlObj),
2098
+ options: localVarRequestOptions,
2099
+ };
2100
+ },
2101
+ /**
2102
+ *
2103
+ * @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.
2104
+ * @param {CreateClassificationRequest} createClassificationRequest
2105
+ * @param {*} [options] Override http request option.
2106
+ * @deprecated
2107
+ * @throws {RequiredError}
2108
+ */
2109
+ createClassification: async (createClassificationRequest: CreateClassificationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2110
+ // verify required parameter 'createClassificationRequest' is not null or undefined
2111
+ assertParamExists('createClassification', 'createClassificationRequest', createClassificationRequest)
2112
+ const localVarPath = `/classifications`;
2113
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2114
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2115
+ let baseOptions;
2116
+ if (configuration) {
2117
+ baseOptions = configuration.baseOptions;
2118
+ }
2119
+
2120
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2121
+ const localVarHeaderParameter = {} as any;
2122
+ const localVarQueryParameter = {} as any;
2123
+
2124
+
2125
+
2126
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2127
+
2128
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2129
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2130
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2131
+ localVarRequestOptions.data = serializeDataIfNeeded(createClassificationRequest, localVarRequestOptions, configuration)
2132
+
2133
+ return {
2134
+ url: toPathString(localVarUrlObj),
2135
+ options: localVarRequestOptions,
2136
+ };
2137
+ },
2138
+ /**
2139
+ *
2140
+ * @summary Creates a completion for the provided prompt and parameters.
2141
+ * @param {CreateCompletionRequest} createCompletionRequest
2142
+ * @param {*} [options] Override http request option.
2143
+ * @throws {RequiredError}
2144
+ */
2145
+ createCompletion: async (createCompletionRequest: CreateCompletionRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2146
+ // verify required parameter 'createCompletionRequest' is not null or undefined
2147
+ assertParamExists('createCompletion', 'createCompletionRequest', createCompletionRequest)
2148
+ const localVarPath = `/completions`;
2149
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2150
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2151
+ let baseOptions;
2152
+ if (configuration) {
2153
+ baseOptions = configuration.baseOptions;
2154
+ }
2155
+
2156
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2157
+ const localVarHeaderParameter = {} as any;
2158
+ const localVarQueryParameter = {} as any;
2159
+
2160
+
2161
+
2162
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2163
+
2164
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2165
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2166
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2167
+ localVarRequestOptions.data = serializeDataIfNeeded(createCompletionRequest, localVarRequestOptions, configuration)
2168
+
2169
+ return {
2170
+ url: toPathString(localVarUrlObj),
2171
+ options: localVarRequestOptions,
2172
+ };
2173
+ },
2174
+ /**
2175
+ *
2176
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
2177
+ * @param {CreateEditRequest} createEditRequest
2178
+ * @param {*} [options] Override http request option.
2179
+ * @throws {RequiredError}
2180
+ */
2181
+ createEdit: async (createEditRequest: CreateEditRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2182
+ // verify required parameter 'createEditRequest' is not null or undefined
2183
+ assertParamExists('createEdit', 'createEditRequest', createEditRequest)
2184
+ const localVarPath = `/edits`;
2185
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2186
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2187
+ let baseOptions;
2188
+ if (configuration) {
2189
+ baseOptions = configuration.baseOptions;
2190
+ }
2191
+
2192
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2193
+ const localVarHeaderParameter = {} as any;
2194
+ const localVarQueryParameter = {} as any;
2195
+
2196
+
2197
+
2198
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2199
+
2200
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2201
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2202
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2203
+ localVarRequestOptions.data = serializeDataIfNeeded(createEditRequest, localVarRequestOptions, configuration)
2204
+
2205
+ return {
2206
+ url: toPathString(localVarUrlObj),
2207
+ options: localVarRequestOptions,
2208
+ };
2209
+ },
2210
+ /**
2211
+ *
2212
+ * @summary Creates an embedding vector representing the input text.
2213
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
2214
+ * @param {*} [options] Override http request option.
2215
+ * @throws {RequiredError}
2216
+ */
2217
+ createEmbedding: async (createEmbeddingRequest: CreateEmbeddingRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2218
+ // verify required parameter 'createEmbeddingRequest' is not null or undefined
2219
+ assertParamExists('createEmbedding', 'createEmbeddingRequest', createEmbeddingRequest)
2220
+ const localVarPath = `/embeddings`;
2221
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2222
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2223
+ let baseOptions;
2224
+ if (configuration) {
2225
+ baseOptions = configuration.baseOptions;
2226
+ }
2227
+
2228
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2229
+ const localVarHeaderParameter = {} as any;
2230
+ const localVarQueryParameter = {} as any;
2231
+
2232
+
2233
+
2234
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2235
+
2236
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2237
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2238
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2239
+ localVarRequestOptions.data = serializeDataIfNeeded(createEmbeddingRequest, localVarRequestOptions, configuration)
2240
+
2241
+ return {
2242
+ url: toPathString(localVarUrlObj),
2243
+ options: localVarRequestOptions,
2244
+ };
2245
+ },
2246
+ /**
2247
+ *
2248
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
2249
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2250
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
2251
+ * @param {*} [options] Override http request option.
2252
+ * @throws {RequiredError}
2253
+ */
2254
+ createFile: async (file: File, purpose: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2255
+ // verify required parameter 'file' is not null or undefined
2256
+ assertParamExists('createFile', 'file', file)
2257
+ // verify required parameter 'purpose' is not null or undefined
2258
+ assertParamExists('createFile', 'purpose', purpose)
2259
+ const localVarPath = `/files`;
2260
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2261
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2262
+ let baseOptions;
2263
+ if (configuration) {
2264
+ baseOptions = configuration.baseOptions;
2265
+ }
2266
+
2267
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2268
+ const localVarHeaderParameter = {} as any;
2269
+ const localVarQueryParameter = {} as any;
2270
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2271
+
2272
+
2273
+ if (file !== undefined) {
2274
+ localVarFormParams.append('file', file as any);
2275
+ }
2276
+
2277
+ if (purpose !== undefined) {
2278
+ localVarFormParams.append('purpose', purpose as any);
2279
+ }
2280
+
2281
+
2282
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2283
+
2284
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2285
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2286
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2287
+ localVarRequestOptions.data = localVarFormParams;
2288
+
2289
+ return {
2290
+ url: toPathString(localVarUrlObj),
2291
+ options: localVarRequestOptions,
2292
+ };
2293
+ },
2294
+ /**
2295
+ *
2296
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
2297
+ * @param {CreateFineTuneRequest} createFineTuneRequest
2298
+ * @param {*} [options] Override http request option.
2299
+ * @throws {RequiredError}
2300
+ */
2301
+ createFineTune: async (createFineTuneRequest: CreateFineTuneRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2302
+ // verify required parameter 'createFineTuneRequest' is not null or undefined
2303
+ assertParamExists('createFineTune', 'createFineTuneRequest', createFineTuneRequest)
2304
+ const localVarPath = `/fine-tunes`;
2305
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2306
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2307
+ let baseOptions;
2308
+ if (configuration) {
2309
+ baseOptions = configuration.baseOptions;
2310
+ }
2311
+
2312
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2313
+ const localVarHeaderParameter = {} as any;
2314
+ const localVarQueryParameter = {} as any;
2315
+
2316
+
2317
+
2318
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2319
+
2320
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2321
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2322
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2323
+ localVarRequestOptions.data = serializeDataIfNeeded(createFineTuneRequest, localVarRequestOptions, configuration)
2324
+
2325
+ return {
2326
+ url: toPathString(localVarUrlObj),
2327
+ options: localVarRequestOptions,
2328
+ };
2329
+ },
2330
+ /**
2331
+ *
2332
+ * @summary Creates an image given a prompt.
2333
+ * @param {CreateImageRequest} createImageRequest
2334
+ * @param {*} [options] Override http request option.
2335
+ * @throws {RequiredError}
2336
+ */
2337
+ createImage: async (createImageRequest: CreateImageRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2338
+ // verify required parameter 'createImageRequest' is not null or undefined
2339
+ assertParamExists('createImage', 'createImageRequest', createImageRequest)
2340
+ const localVarPath = `/images/generations`;
2341
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2342
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2343
+ let baseOptions;
2344
+ if (configuration) {
2345
+ baseOptions = configuration.baseOptions;
2346
+ }
2347
+
2348
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2349
+ const localVarHeaderParameter = {} as any;
2350
+ const localVarQueryParameter = {} as any;
2351
+
2352
+
2353
+
2354
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2355
+
2356
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2357
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2358
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2359
+ localVarRequestOptions.data = serializeDataIfNeeded(createImageRequest, localVarRequestOptions, configuration)
2360
+
2361
+ return {
2362
+ url: toPathString(localVarUrlObj),
2363
+ options: localVarRequestOptions,
2364
+ };
2365
+ },
2366
+ /**
2367
+ *
2368
+ * @summary Creates an edited or extended image given an original image and a prompt.
2369
+ * @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.
2370
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
2371
+ * @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;.
2372
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2373
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2374
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
2375
+ * @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).
2376
+ * @param {*} [options] Override http request option.
2377
+ * @throws {RequiredError}
2378
+ */
2379
+ createImageEdit: async (image: File, prompt: string, mask?: File, n?: number, size?: string, responseFormat?: string, user?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2380
+ // verify required parameter 'image' is not null or undefined
2381
+ assertParamExists('createImageEdit', 'image', image)
2382
+ // verify required parameter 'prompt' is not null or undefined
2383
+ assertParamExists('createImageEdit', 'prompt', prompt)
2384
+ const localVarPath = `/images/edits`;
2385
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2386
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2387
+ let baseOptions;
2388
+ if (configuration) {
2389
+ baseOptions = configuration.baseOptions;
2390
+ }
2391
+
2392
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2393
+ const localVarHeaderParameter = {} as any;
2394
+ const localVarQueryParameter = {} as any;
2395
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2396
+
2397
+
2398
+ if (image !== undefined) {
2399
+ localVarFormParams.append('image', image as any);
2400
+ }
2401
+
2402
+ if (mask !== undefined) {
2403
+ localVarFormParams.append('mask', mask as any);
2404
+ }
2405
+
2406
+ if (prompt !== undefined) {
2407
+ localVarFormParams.append('prompt', prompt as any);
2408
+ }
2409
+
2410
+ if (n !== undefined) {
2411
+ localVarFormParams.append('n', n as any);
2412
+ }
2413
+
2414
+ if (size !== undefined) {
2415
+ localVarFormParams.append('size', size as any);
2416
+ }
2417
+
2418
+ if (responseFormat !== undefined) {
2419
+ localVarFormParams.append('response_format', responseFormat as any);
2420
+ }
2421
+
2422
+ if (user !== undefined) {
2423
+ localVarFormParams.append('user', user as any);
2424
+ }
2425
+
2426
+
2427
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2428
+
2429
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2430
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2431
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2432
+ localVarRequestOptions.data = localVarFormParams;
2433
+
2434
+ return {
2435
+ url: toPathString(localVarUrlObj),
2436
+ options: localVarRequestOptions,
2437
+ };
2438
+ },
2439
+ /**
2440
+ *
2441
+ * @summary Creates a variation of a given image.
2442
+ * @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.
2443
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
2444
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
2445
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
2446
+ * @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).
2447
+ * @param {*} [options] Override http request option.
2448
+ * @throws {RequiredError}
2449
+ */
2450
+ createImageVariation: async (image: File, n?: number, size?: string, responseFormat?: string, user?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2451
+ // verify required parameter 'image' is not null or undefined
2452
+ assertParamExists('createImageVariation', 'image', image)
2453
+ const localVarPath = `/images/variations`;
2454
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2455
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2456
+ let baseOptions;
2457
+ if (configuration) {
2458
+ baseOptions = configuration.baseOptions;
2459
+ }
2460
+
2461
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2462
+ const localVarHeaderParameter = {} as any;
2463
+ const localVarQueryParameter = {} as any;
2464
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2465
+
2466
+
2467
+ if (image !== undefined) {
2468
+ localVarFormParams.append('image', image as any);
2469
+ }
2470
+
2471
+ if (n !== undefined) {
2472
+ localVarFormParams.append('n', n as any);
2473
+ }
2474
+
2475
+ if (size !== undefined) {
2476
+ localVarFormParams.append('size', size as any);
2477
+ }
2478
+
2479
+ if (responseFormat !== undefined) {
2480
+ localVarFormParams.append('response_format', responseFormat as any);
2481
+ }
2482
+
2483
+ if (user !== undefined) {
2484
+ localVarFormParams.append('user', user as any);
2485
+ }
2486
+
2487
+
2488
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2489
+
2490
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2491
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2492
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2493
+ localVarRequestOptions.data = localVarFormParams;
2494
+
2495
+ return {
2496
+ url: toPathString(localVarUrlObj),
2497
+ options: localVarRequestOptions,
2498
+ };
2499
+ },
2500
+ /**
2501
+ *
2502
+ * @summary Classifies if text violates OpenAI\'s Content Policy
2503
+ * @param {CreateModerationRequest} createModerationRequest
2504
+ * @param {*} [options] Override http request option.
2505
+ * @throws {RequiredError}
2506
+ */
2507
+ createModeration: async (createModerationRequest: CreateModerationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2508
+ // verify required parameter 'createModerationRequest' is not null or undefined
2509
+ assertParamExists('createModeration', 'createModerationRequest', createModerationRequest)
2510
+ const localVarPath = `/moderations`;
2511
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2512
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2513
+ let baseOptions;
2514
+ if (configuration) {
2515
+ baseOptions = configuration.baseOptions;
2516
+ }
2517
+
2518
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2519
+ const localVarHeaderParameter = {} as any;
2520
+ const localVarQueryParameter = {} as any;
2521
+
2522
+
2523
+
2524
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2525
+
2526
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2527
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2528
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2529
+ localVarRequestOptions.data = serializeDataIfNeeded(createModerationRequest, localVarRequestOptions, configuration)
2530
+
2531
+ return {
2532
+ url: toPathString(localVarUrlObj),
2533
+ options: localVarRequestOptions,
2534
+ };
2535
+ },
2536
+ /**
2537
+ *
2538
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
2539
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of &#x60;ada&#x60;, &#x60;babbage&#x60;, &#x60;curie&#x60;, or &#x60;davinci&#x60;.
2540
+ * @param {CreateSearchRequest} createSearchRequest
2541
+ * @param {*} [options] Override http request option.
2542
+ * @deprecated
2543
+ * @throws {RequiredError}
2544
+ */
2545
+ createSearch: async (engineId: string, createSearchRequest: CreateSearchRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2546
+ // verify required parameter 'engineId' is not null or undefined
2547
+ assertParamExists('createSearch', 'engineId', engineId)
2548
+ // verify required parameter 'createSearchRequest' is not null or undefined
2549
+ assertParamExists('createSearch', 'createSearchRequest', createSearchRequest)
2550
+ const localVarPath = `/engines/{engine_id}/search`
2551
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
2552
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2553
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2554
+ let baseOptions;
2555
+ if (configuration) {
2556
+ baseOptions = configuration.baseOptions;
2557
+ }
2558
+
2559
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2560
+ const localVarHeaderParameter = {} as any;
2561
+ const localVarQueryParameter = {} as any;
2562
+
2563
+
2564
+
2565
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2566
+
2567
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2568
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2569
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2570
+ localVarRequestOptions.data = serializeDataIfNeeded(createSearchRequest, localVarRequestOptions, configuration)
2571
+
2572
+ return {
2573
+ url: toPathString(localVarUrlObj),
2574
+ options: localVarRequestOptions,
2575
+ };
2576
+ },
2577
+ /**
2578
+ *
2579
+ * @summary Transcribes audio into the input language.
2580
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
2581
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
2582
+ * @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.
2583
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
2584
+ * @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.
2585
+ * @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.
2586
+ * @param {*} [options] Override http request option.
2587
+ * @throws {RequiredError}
2588
+ */
2589
+ createTranscription: async (file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2590
+ // verify required parameter 'file' is not null or undefined
2591
+ assertParamExists('createTranscription', 'file', file)
2592
+ // verify required parameter 'model' is not null or undefined
2593
+ assertParamExists('createTranscription', 'model', model)
2594
+ const localVarPath = `/audio/transcriptions`;
2595
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2596
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2597
+ let baseOptions;
2598
+ if (configuration) {
2599
+ baseOptions = configuration.baseOptions;
2600
+ }
2601
+
2602
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2603
+ const localVarHeaderParameter = {} as any;
2604
+ const localVarQueryParameter = {} as any;
2605
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2606
+
2607
+
2608
+ if (file !== undefined) {
2609
+ localVarFormParams.append('file', file as any);
2610
+ }
2611
+
2612
+ if (model !== undefined) {
2613
+ localVarFormParams.append('model', model as any);
2614
+ }
2615
+
2616
+ if (prompt !== undefined) {
2617
+ localVarFormParams.append('prompt', prompt as any);
2618
+ }
2619
+
2620
+ if (responseFormat !== undefined) {
2621
+ localVarFormParams.append('response_format', responseFormat as any);
2622
+ }
2623
+
2624
+ if (temperature !== undefined) {
2625
+ localVarFormParams.append('temperature', temperature as any);
2626
+ }
2627
+
2628
+ if (language !== undefined) {
2629
+ localVarFormParams.append('language', language as any);
2630
+ }
2631
+
2632
+
2633
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2634
+
2635
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2636
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2637
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2638
+ localVarRequestOptions.data = localVarFormParams;
2639
+
2640
+ return {
2641
+ url: toPathString(localVarUrlObj),
2642
+ options: localVarRequestOptions,
2643
+ };
2644
+ },
2645
+ /**
2646
+ *
2647
+ * @summary Translates audio into into English.
2648
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
2649
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
2650
+ * @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.
2651
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
2652
+ * @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.
2653
+ * @param {*} [options] Override http request option.
2654
+ * @throws {RequiredError}
2655
+ */
2656
+ createTranslation: async (file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2657
+ // verify required parameter 'file' is not null or undefined
2658
+ assertParamExists('createTranslation', 'file', file)
2659
+ // verify required parameter 'model' is not null or undefined
2660
+ assertParamExists('createTranslation', 'model', model)
2661
+ const localVarPath = `/audio/translations`;
2662
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2663
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2664
+ let baseOptions;
2665
+ if (configuration) {
2666
+ baseOptions = configuration.baseOptions;
2667
+ }
2668
+
2669
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
2670
+ const localVarHeaderParameter = {} as any;
2671
+ const localVarQueryParameter = {} as any;
2672
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
2673
+
2674
+
2675
+ if (file !== undefined) {
2676
+ localVarFormParams.append('file', file as any);
2677
+ }
2678
+
2679
+ if (model !== undefined) {
2680
+ localVarFormParams.append('model', model as any);
2681
+ }
2682
+
2683
+ if (prompt !== undefined) {
2684
+ localVarFormParams.append('prompt', prompt as any);
2685
+ }
2686
+
2687
+ if (responseFormat !== undefined) {
2688
+ localVarFormParams.append('response_format', responseFormat as any);
2689
+ }
2690
+
2691
+ if (temperature !== undefined) {
2692
+ localVarFormParams.append('temperature', temperature as any);
2693
+ }
2694
+
2695
+
2696
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
2697
+
2698
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2699
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2700
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...localVarFormParams.getHeaders(), ...headersFromBaseOptions, ...options.headers};
2701
+ localVarRequestOptions.data = localVarFormParams;
2702
+
2703
+ return {
2704
+ url: toPathString(localVarUrlObj),
2705
+ options: localVarRequestOptions,
2706
+ };
2707
+ },
2708
+ /**
2709
+ *
2710
+ * @summary Delete a file.
2711
+ * @param {string} fileId The ID of the file to use for this request
2712
+ * @param {*} [options] Override http request option.
2713
+ * @throws {RequiredError}
2714
+ */
2715
+ deleteFile: async (fileId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2716
+ // verify required parameter 'fileId' is not null or undefined
2717
+ assertParamExists('deleteFile', 'fileId', fileId)
2718
+ const localVarPath = `/files/{file_id}`
2719
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
2720
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2721
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2722
+ let baseOptions;
2723
+ if (configuration) {
2724
+ baseOptions = configuration.baseOptions;
2725
+ }
2726
+
2727
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
2728
+ const localVarHeaderParameter = {} as any;
2729
+ const localVarQueryParameter = {} as any;
2730
+
2731
+
2732
+
2733
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2734
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2735
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2736
+
2737
+ return {
2738
+ url: toPathString(localVarUrlObj),
2739
+ options: localVarRequestOptions,
2740
+ };
2741
+ },
2742
+ /**
2743
+ *
2744
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
2745
+ * @param {string} model The model to delete
2746
+ * @param {*} [options] Override http request option.
2747
+ * @throws {RequiredError}
2748
+ */
2749
+ deleteModel: async (model: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2750
+ // verify required parameter 'model' is not null or undefined
2751
+ assertParamExists('deleteModel', 'model', model)
2752
+ const localVarPath = `/models/{model}`
2753
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
2754
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2755
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2756
+ let baseOptions;
2757
+ if (configuration) {
2758
+ baseOptions = configuration.baseOptions;
2759
+ }
2760
+
2761
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
2762
+ const localVarHeaderParameter = {} as any;
2763
+ const localVarQueryParameter = {} as any;
2764
+
2765
+
2766
+
2767
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2768
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2769
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2770
+
2771
+ return {
2772
+ url: toPathString(localVarUrlObj),
2773
+ options: localVarRequestOptions,
2774
+ };
2775
+ },
2776
+ /**
2777
+ *
2778
+ * @summary Returns the contents of the specified file
2779
+ * @param {string} fileId The ID of the file to use for this request
2780
+ * @param {*} [options] Override http request option.
2781
+ * @throws {RequiredError}
2782
+ */
2783
+ downloadFile: async (fileId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2784
+ // verify required parameter 'fileId' is not null or undefined
2785
+ assertParamExists('downloadFile', 'fileId', fileId)
2786
+ const localVarPath = `/files/{file_id}/content`
2787
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
2788
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2789
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2790
+ let baseOptions;
2791
+ if (configuration) {
2792
+ baseOptions = configuration.baseOptions;
2793
+ }
2794
+
2795
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2796
+ const localVarHeaderParameter = {} as any;
2797
+ const localVarQueryParameter = {} as any;
2798
+
2799
+
2800
+
2801
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2802
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2803
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2804
+
2805
+ return {
2806
+ url: toPathString(localVarUrlObj),
2807
+ options: localVarRequestOptions,
2808
+ };
2809
+ },
2810
+ /**
2811
+ *
2812
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
2813
+ * @param {*} [options] Override http request option.
2814
+ * @deprecated
2815
+ * @throws {RequiredError}
2816
+ */
2817
+ listEngines: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2818
+ const localVarPath = `/engines`;
2819
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2820
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2821
+ let baseOptions;
2822
+ if (configuration) {
2823
+ baseOptions = configuration.baseOptions;
2824
+ }
2825
+
2826
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2827
+ const localVarHeaderParameter = {} as any;
2828
+ const localVarQueryParameter = {} as any;
2829
+
2830
+
2831
+
2832
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2833
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2834
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2835
+
2836
+ return {
2837
+ url: toPathString(localVarUrlObj),
2838
+ options: localVarRequestOptions,
2839
+ };
2840
+ },
2841
+ /**
2842
+ *
2843
+ * @summary Returns a list of files that belong to the user\'s organization.
2844
+ * @param {*} [options] Override http request option.
2845
+ * @throws {RequiredError}
2846
+ */
2847
+ listFiles: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2848
+ const localVarPath = `/files`;
2849
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2850
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2851
+ let baseOptions;
2852
+ if (configuration) {
2853
+ baseOptions = configuration.baseOptions;
2854
+ }
2855
+
2856
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2857
+ const localVarHeaderParameter = {} as any;
2858
+ const localVarQueryParameter = {} as any;
2859
+
2860
+
2861
+
2862
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2863
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2864
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2865
+
2866
+ return {
2867
+ url: toPathString(localVarUrlObj),
2868
+ options: localVarRequestOptions,
2869
+ };
2870
+ },
2871
+ /**
2872
+ *
2873
+ * @summary Get fine-grained status updates for a fine-tune job.
2874
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
2875
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
2876
+ * @param {*} [options] Override http request option.
2877
+ * @throws {RequiredError}
2878
+ */
2879
+ listFineTuneEvents: async (fineTuneId: string, stream?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2880
+ // verify required parameter 'fineTuneId' is not null or undefined
2881
+ assertParamExists('listFineTuneEvents', 'fineTuneId', fineTuneId)
2882
+ const localVarPath = `/fine-tunes/{fine_tune_id}/events`
2883
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
2884
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2885
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2886
+ let baseOptions;
2887
+ if (configuration) {
2888
+ baseOptions = configuration.baseOptions;
2889
+ }
2890
+
2891
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2892
+ const localVarHeaderParameter = {} as any;
2893
+ const localVarQueryParameter = {} as any;
2894
+
2895
+ if (stream !== undefined) {
2896
+ localVarQueryParameter['stream'] = stream;
2897
+ }
2898
+
2899
+
2900
+
2901
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2902
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2903
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2904
+
2905
+ return {
2906
+ url: toPathString(localVarUrlObj),
2907
+ options: localVarRequestOptions,
2908
+ };
2909
+ },
2910
+ /**
2911
+ *
2912
+ * @summary List your organization\'s fine-tuning jobs
2913
+ * @param {*} [options] Override http request option.
2914
+ * @throws {RequiredError}
2915
+ */
2916
+ listFineTunes: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2917
+ const localVarPath = `/fine-tunes`;
2918
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2919
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2920
+ let baseOptions;
2921
+ if (configuration) {
2922
+ baseOptions = configuration.baseOptions;
2923
+ }
2924
+
2925
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2926
+ const localVarHeaderParameter = {} as any;
2927
+ const localVarQueryParameter = {} as any;
2928
+
2929
+
2930
+
2931
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2932
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2933
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2934
+
2935
+ return {
2936
+ url: toPathString(localVarUrlObj),
2937
+ options: localVarRequestOptions,
2938
+ };
2939
+ },
2940
+ /**
2941
+ *
2942
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
2943
+ * @param {*} [options] Override http request option.
2944
+ * @throws {RequiredError}
2945
+ */
2946
+ listModels: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2947
+ const localVarPath = `/models`;
2948
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2949
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2950
+ let baseOptions;
2951
+ if (configuration) {
2952
+ baseOptions = configuration.baseOptions;
2953
+ }
2954
+
2955
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2956
+ const localVarHeaderParameter = {} as any;
2957
+ const localVarQueryParameter = {} as any;
2958
+
2959
+
2960
+
2961
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2962
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2963
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2964
+
2965
+ return {
2966
+ url: toPathString(localVarUrlObj),
2967
+ options: localVarRequestOptions,
2968
+ };
2969
+ },
2970
+ /**
2971
+ *
2972
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
2973
+ * @param {string} engineId The ID of the engine to use for this request
2974
+ * @param {*} [options] Override http request option.
2975
+ * @deprecated
2976
+ * @throws {RequiredError}
2977
+ */
2978
+ retrieveEngine: async (engineId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2979
+ // verify required parameter 'engineId' is not null or undefined
2980
+ assertParamExists('retrieveEngine', 'engineId', engineId)
2981
+ const localVarPath = `/engines/{engine_id}`
2982
+ .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
2983
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2984
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2985
+ let baseOptions;
2986
+ if (configuration) {
2987
+ baseOptions = configuration.baseOptions;
2988
+ }
2989
+
2990
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2991
+ const localVarHeaderParameter = {} as any;
2992
+ const localVarQueryParameter = {} as any;
2993
+
2994
+
2995
+
2996
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2997
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2998
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2999
+
3000
+ return {
3001
+ url: toPathString(localVarUrlObj),
3002
+ options: localVarRequestOptions,
3003
+ };
3004
+ },
3005
+ /**
3006
+ *
3007
+ * @summary Returns information about a specific file.
3008
+ * @param {string} fileId The ID of the file to use for this request
3009
+ * @param {*} [options] Override http request option.
3010
+ * @throws {RequiredError}
3011
+ */
3012
+ retrieveFile: async (fileId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
3013
+ // verify required parameter 'fileId' is not null or undefined
3014
+ assertParamExists('retrieveFile', 'fileId', fileId)
3015
+ const localVarPath = `/files/{file_id}`
3016
+ .replace(`{${"file_id"}}`, encodeURIComponent(String(fileId)));
3017
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3018
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3019
+ let baseOptions;
3020
+ if (configuration) {
3021
+ baseOptions = configuration.baseOptions;
3022
+ }
3023
+
3024
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
3025
+ const localVarHeaderParameter = {} as any;
3026
+ const localVarQueryParameter = {} as any;
3027
+
3028
+
3029
+
3030
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3031
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3032
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3033
+
3034
+ return {
3035
+ url: toPathString(localVarUrlObj),
3036
+ options: localVarRequestOptions,
3037
+ };
3038
+ },
3039
+ /**
3040
+ *
3041
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
3042
+ * @param {string} fineTuneId The ID of the fine-tune job
3043
+ * @param {*} [options] Override http request option.
3044
+ * @throws {RequiredError}
3045
+ */
3046
+ retrieveFineTune: async (fineTuneId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
3047
+ // verify required parameter 'fineTuneId' is not null or undefined
3048
+ assertParamExists('retrieveFineTune', 'fineTuneId', fineTuneId)
3049
+ const localVarPath = `/fine-tunes/{fine_tune_id}`
3050
+ .replace(`{${"fine_tune_id"}}`, encodeURIComponent(String(fineTuneId)));
3051
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3052
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3053
+ let baseOptions;
3054
+ if (configuration) {
3055
+ baseOptions = configuration.baseOptions;
3056
+ }
3057
+
3058
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
3059
+ const localVarHeaderParameter = {} as any;
3060
+ const localVarQueryParameter = {} as any;
3061
+
3062
+
3063
+
3064
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3065
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3066
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3067
+
3068
+ return {
3069
+ url: toPathString(localVarUrlObj),
3070
+ options: localVarRequestOptions,
3071
+ };
3072
+ },
3073
+ /**
3074
+ *
3075
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
3076
+ * @param {string} model The ID of the model to use for this request
3077
+ * @param {*} [options] Override http request option.
3078
+ * @throws {RequiredError}
3079
+ */
3080
+ retrieveModel: async (model: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
3081
+ // verify required parameter 'model' is not null or undefined
3082
+ assertParamExists('retrieveModel', 'model', model)
3083
+ const localVarPath = `/models/{model}`
3084
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
3085
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3086
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3087
+ let baseOptions;
3088
+ if (configuration) {
3089
+ baseOptions = configuration.baseOptions;
3090
+ }
3091
+
3092
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
3093
+ const localVarHeaderParameter = {} as any;
3094
+ const localVarQueryParameter = {} as any;
3095
+
3096
+
3097
+
3098
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3099
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3100
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3101
+
3102
+ return {
3103
+ url: toPathString(localVarUrlObj),
3104
+ options: localVarRequestOptions,
3105
+ };
3106
+ },
3107
+ }
3108
+ };
3109
+
3110
+ /**
3111
+ * OpenAIApi - functional programming interface
3112
+ * @export
3113
+ */
3114
+ export const OpenAIApiFp = function(configuration?: Configuration) {
3115
+ const localVarAxiosParamCreator = OpenAIApiAxiosParamCreator(configuration)
3116
+ return {
3117
+ /**
3118
+ *
3119
+ * @summary Immediately cancel a fine-tune job.
3120
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
3121
+ * @param {*} [options] Override http request option.
3122
+ * @throws {RequiredError}
3123
+ */
3124
+ async cancelFineTune(fineTuneId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FineTune>> {
3125
+ const localVarAxiosArgs = await localVarAxiosParamCreator.cancelFineTune(fineTuneId, options);
3126
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3127
+ },
3128
+ /**
3129
+ *
3130
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
3131
+ * @param {CreateAnswerRequest} createAnswerRequest
3132
+ * @param {*} [options] Override http request option.
3133
+ * @deprecated
3134
+ * @throws {RequiredError}
3135
+ */
3136
+ async createAnswer(createAnswerRequest: CreateAnswerRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateAnswerResponse>> {
3137
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createAnswer(createAnswerRequest, options);
3138
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3139
+ },
3140
+ /**
3141
+ *
3142
+ * @summary Creates a model response for the given chat conversation.
3143
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
3144
+ * @param {*} [options] Override http request option.
3145
+ * @throws {RequiredError}
3146
+ */
3147
+ async createChatCompletion(createChatCompletionRequest: CreateChatCompletionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateChatCompletionResponse>> {
3148
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createChatCompletion(createChatCompletionRequest, options);
3149
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3150
+ },
3151
+ /**
3152
+ *
3153
+ * @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.
3154
+ * @param {CreateClassificationRequest} createClassificationRequest
3155
+ * @param {*} [options] Override http request option.
3156
+ * @deprecated
3157
+ * @throws {RequiredError}
3158
+ */
3159
+ async createClassification(createClassificationRequest: CreateClassificationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateClassificationResponse>> {
3160
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createClassification(createClassificationRequest, options);
3161
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3162
+ },
3163
+ /**
3164
+ *
3165
+ * @summary Creates a completion for the provided prompt and parameters.
3166
+ * @param {CreateCompletionRequest} createCompletionRequest
3167
+ * @param {*} [options] Override http request option.
3168
+ * @throws {RequiredError}
3169
+ */
3170
+ async createCompletion(createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>> {
3171
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createCompletion(createCompletionRequest, options);
3172
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3173
+ },
3174
+ /**
3175
+ *
3176
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
3177
+ * @param {CreateEditRequest} createEditRequest
3178
+ * @param {*} [options] Override http request option.
3179
+ * @throws {RequiredError}
3180
+ */
3181
+ async createEdit(createEditRequest: CreateEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEditResponse>> {
3182
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEdit(createEditRequest, options);
3183
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3184
+ },
3185
+ /**
3186
+ *
3187
+ * @summary Creates an embedding vector representing the input text.
3188
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
3189
+ * @param {*} [options] Override http request option.
3190
+ * @throws {RequiredError}
3191
+ */
3192
+ async createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEmbeddingResponse>> {
3193
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEmbedding(createEmbeddingRequest, options);
3194
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3195
+ },
3196
+ /**
3197
+ *
3198
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
3199
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
3200
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
3201
+ * @param {*} [options] Override http request option.
3202
+ * @throws {RequiredError}
3203
+ */
3204
+ async createFile(file: File, purpose: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>> {
3205
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createFile(file, purpose, options);
3206
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3207
+ },
3208
+ /**
3209
+ *
3210
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
3211
+ * @param {CreateFineTuneRequest} createFineTuneRequest
3212
+ * @param {*} [options] Override http request option.
3213
+ * @throws {RequiredError}
3214
+ */
3215
+ async createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FineTune>> {
3216
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createFineTune(createFineTuneRequest, options);
3217
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3218
+ },
3219
+ /**
3220
+ *
3221
+ * @summary Creates an image given a prompt.
3222
+ * @param {CreateImageRequest} createImageRequest
3223
+ * @param {*} [options] Override http request option.
3224
+ * @throws {RequiredError}
3225
+ */
3226
+ async createImage(createImageRequest: CreateImageRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImagesResponse>> {
3227
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImage(createImageRequest, options);
3228
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3229
+ },
3230
+ /**
3231
+ *
3232
+ * @summary Creates an edited or extended image given an original image and a prompt.
3233
+ * @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.
3234
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
3235
+ * @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;.
3236
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3237
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3238
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3239
+ * @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).
3240
+ * @param {*} [options] Override http request option.
3241
+ * @throws {RequiredError}
3242
+ */
3243
+ 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>> {
3244
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options);
3245
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3246
+ },
3247
+ /**
3248
+ *
3249
+ * @summary Creates a variation of a given image.
3250
+ * @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.
3251
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3252
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3253
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3254
+ * @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).
3255
+ * @param {*} [options] Override http request option.
3256
+ * @throws {RequiredError}
3257
+ */
3258
+ async createImageVariation(image: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImagesResponse>> {
3259
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createImageVariation(image, n, size, responseFormat, user, options);
3260
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3261
+ },
3262
+ /**
3263
+ *
3264
+ * @summary Classifies if text violates OpenAI\'s Content Policy
3265
+ * @param {CreateModerationRequest} createModerationRequest
3266
+ * @param {*} [options] Override http request option.
3267
+ * @throws {RequiredError}
3268
+ */
3269
+ async createModeration(createModerationRequest: CreateModerationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateModerationResponse>> {
3270
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createModeration(createModerationRequest, options);
3271
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3272
+ },
3273
+ /**
3274
+ *
3275
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
3276
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of &#x60;ada&#x60;, &#x60;babbage&#x60;, &#x60;curie&#x60;, or &#x60;davinci&#x60;.
3277
+ * @param {CreateSearchRequest} createSearchRequest
3278
+ * @param {*} [options] Override http request option.
3279
+ * @deprecated
3280
+ * @throws {RequiredError}
3281
+ */
3282
+ async createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateSearchResponse>> {
3283
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createSearch(engineId, createSearchRequest, options);
3284
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3285
+ },
3286
+ /**
3287
+ *
3288
+ * @summary Transcribes audio into the input language.
3289
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3290
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3291
+ * @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.
3292
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3293
+ * @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.
3294
+ * @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.
3295
+ * @param {*} [options] Override http request option.
3296
+ * @throws {RequiredError}
3297
+ */
3298
+ async createTranscription(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateTranscriptionResponse>> {
3299
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTranscription(file, model, prompt, responseFormat, temperature, language, options);
3300
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3301
+ },
3302
+ /**
3303
+ *
3304
+ * @summary Translates audio into into English.
3305
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3306
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3307
+ * @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.
3308
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3309
+ * @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.
3310
+ * @param {*} [options] Override http request option.
3311
+ * @throws {RequiredError}
3312
+ */
3313
+ async createTranslation(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateTranslationResponse>> {
3314
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTranslation(file, model, prompt, responseFormat, temperature, options);
3315
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3316
+ },
3317
+ /**
3318
+ *
3319
+ * @summary Delete a file.
3320
+ * @param {string} fileId The ID of the file to use for this request
3321
+ * @param {*} [options] Override http request option.
3322
+ * @throws {RequiredError}
3323
+ */
3324
+ async deleteFile(fileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteFileResponse>> {
3325
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFile(fileId, options);
3326
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3327
+ },
3328
+ /**
3329
+ *
3330
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
3331
+ * @param {string} model The model to delete
3332
+ * @param {*} [options] Override http request option.
3333
+ * @throws {RequiredError}
3334
+ */
3335
+ async deleteModel(model: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteModelResponse>> {
3336
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteModel(model, options);
3337
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3338
+ },
3339
+ /**
3340
+ *
3341
+ * @summary Returns the contents of the specified file
3342
+ * @param {string} fileId The ID of the file to use for this request
3343
+ * @param {*} [options] Override http request option.
3344
+ * @throws {RequiredError}
3345
+ */
3346
+ async downloadFile(fileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
3347
+ const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFile(fileId, options);
3348
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3349
+ },
3350
+ /**
3351
+ *
3352
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
3353
+ * @param {*} [options] Override http request option.
3354
+ * @deprecated
3355
+ * @throws {RequiredError}
3356
+ */
3357
+ async listEngines(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListEnginesResponse>> {
3358
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listEngines(options);
3359
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3360
+ },
3361
+ /**
3362
+ *
3363
+ * @summary Returns a list of files that belong to the user\'s organization.
3364
+ * @param {*} [options] Override http request option.
3365
+ * @throws {RequiredError}
3366
+ */
3367
+ async listFiles(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListFilesResponse>> {
3368
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFiles(options);
3369
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3370
+ },
3371
+ /**
3372
+ *
3373
+ * @summary Get fine-grained status updates for a fine-tune job.
3374
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
3375
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
3376
+ * @param {*} [options] Override http request option.
3377
+ * @throws {RequiredError}
3378
+ */
3379
+ async listFineTuneEvents(fineTuneId: string, stream?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListFineTuneEventsResponse>> {
3380
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFineTuneEvents(fineTuneId, stream, options);
3381
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3382
+ },
3383
+ /**
3384
+ *
3385
+ * @summary List your organization\'s fine-tuning jobs
3386
+ * @param {*} [options] Override http request option.
3387
+ * @throws {RequiredError}
3388
+ */
3389
+ async listFineTunes(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListFineTunesResponse>> {
3390
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFineTunes(options);
3391
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3392
+ },
3393
+ /**
3394
+ *
3395
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
3396
+ * @param {*} [options] Override http request option.
3397
+ * @throws {RequiredError}
3398
+ */
3399
+ async listModels(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListModelsResponse>> {
3400
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listModels(options);
3401
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3402
+ },
3403
+ /**
3404
+ *
3405
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
3406
+ * @param {string} engineId The ID of the engine to use for this request
3407
+ * @param {*} [options] Override http request option.
3408
+ * @deprecated
3409
+ * @throws {RequiredError}
3410
+ */
3411
+ async retrieveEngine(engineId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Engine>> {
3412
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveEngine(engineId, options);
3413
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3414
+ },
3415
+ /**
3416
+ *
3417
+ * @summary Returns information about a specific file.
3418
+ * @param {string} fileId The ID of the file to use for this request
3419
+ * @param {*} [options] Override http request option.
3420
+ * @throws {RequiredError}
3421
+ */
3422
+ async retrieveFile(fileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>> {
3423
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFile(fileId, options);
3424
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3425
+ },
3426
+ /**
3427
+ *
3428
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
3429
+ * @param {string} fineTuneId The ID of the fine-tune job
3430
+ * @param {*} [options] Override http request option.
3431
+ * @throws {RequiredError}
3432
+ */
3433
+ async retrieveFineTune(fineTuneId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FineTune>> {
3434
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFineTune(fineTuneId, options);
3435
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3436
+ },
3437
+ /**
3438
+ *
3439
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
3440
+ * @param {string} model The ID of the model to use for this request
3441
+ * @param {*} [options] Override http request option.
3442
+ * @throws {RequiredError}
3443
+ */
3444
+ async retrieveModel(model: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Model>> {
3445
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveModel(model, options);
3446
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
3447
+ },
3448
+ }
3449
+ };
3450
+
3451
+ /**
3452
+ * OpenAIApi - factory interface
3453
+ * @export
3454
+ */
3455
+ export const OpenAIApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
3456
+ const localVarFp = OpenAIApiFp(configuration)
3457
+ return {
3458
+ /**
3459
+ *
3460
+ * @summary Immediately cancel a fine-tune job.
3461
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
3462
+ * @param {*} [options] Override http request option.
3463
+ * @throws {RequiredError}
3464
+ */
3465
+ cancelFineTune(fineTuneId: string, options?: any): AxiosPromise<FineTune> {
3466
+ return localVarFp.cancelFineTune(fineTuneId, options).then((request) => request(axios, basePath));
3467
+ },
3468
+ /**
3469
+ *
3470
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
3471
+ * @param {CreateAnswerRequest} createAnswerRequest
3472
+ * @param {*} [options] Override http request option.
3473
+ * @deprecated
3474
+ * @throws {RequiredError}
3475
+ */
3476
+ createAnswer(createAnswerRequest: CreateAnswerRequest, options?: any): AxiosPromise<CreateAnswerResponse> {
3477
+ return localVarFp.createAnswer(createAnswerRequest, options).then((request) => request(axios, basePath));
3478
+ },
3479
+ /**
3480
+ *
3481
+ * @summary Creates a model response for the given chat conversation.
3482
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
3483
+ * @param {*} [options] Override http request option.
3484
+ * @throws {RequiredError}
3485
+ */
3486
+ createChatCompletion(createChatCompletionRequest: CreateChatCompletionRequest, options?: any): AxiosPromise<CreateChatCompletionResponse> {
3487
+ return localVarFp.createChatCompletion(createChatCompletionRequest, options).then((request) => request(axios, basePath));
3488
+ },
3489
+ /**
3490
+ *
3491
+ * @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.
3492
+ * @param {CreateClassificationRequest} createClassificationRequest
3493
+ * @param {*} [options] Override http request option.
3494
+ * @deprecated
3495
+ * @throws {RequiredError}
3496
+ */
3497
+ createClassification(createClassificationRequest: CreateClassificationRequest, options?: any): AxiosPromise<CreateClassificationResponse> {
3498
+ return localVarFp.createClassification(createClassificationRequest, options).then((request) => request(axios, basePath));
3499
+ },
3500
+ /**
3501
+ *
3502
+ * @summary Creates a completion for the provided prompt and parameters.
3503
+ * @param {CreateCompletionRequest} createCompletionRequest
3504
+ * @param {*} [options] Override http request option.
3505
+ * @throws {RequiredError}
3506
+ */
3507
+ createCompletion(createCompletionRequest: CreateCompletionRequest, options?: any): AxiosPromise<CreateCompletionResponse> {
3508
+ return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios, basePath));
3509
+ },
3510
+ /**
3511
+ *
3512
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
3513
+ * @param {CreateEditRequest} createEditRequest
3514
+ * @param {*} [options] Override http request option.
3515
+ * @throws {RequiredError}
3516
+ */
3517
+ createEdit(createEditRequest: CreateEditRequest, options?: any): AxiosPromise<CreateEditResponse> {
3518
+ return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios, basePath));
3519
+ },
3520
+ /**
3521
+ *
3522
+ * @summary Creates an embedding vector representing the input text.
3523
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
3524
+ * @param {*} [options] Override http request option.
3525
+ * @throws {RequiredError}
3526
+ */
3527
+ createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: any): AxiosPromise<CreateEmbeddingResponse> {
3528
+ return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios, basePath));
3529
+ },
3530
+ /**
3531
+ *
3532
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
3533
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
3534
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
3535
+ * @param {*} [options] Override http request option.
3536
+ * @throws {RequiredError}
3537
+ */
3538
+ createFile(file: File, purpose: string, options?: any): AxiosPromise<OpenAIFile> {
3539
+ return localVarFp.createFile(file, purpose, options).then((request) => request(axios, basePath));
3540
+ },
3541
+ /**
3542
+ *
3543
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
3544
+ * @param {CreateFineTuneRequest} createFineTuneRequest
3545
+ * @param {*} [options] Override http request option.
3546
+ * @throws {RequiredError}
3547
+ */
3548
+ createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: any): AxiosPromise<FineTune> {
3549
+ return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios, basePath));
3550
+ },
3551
+ /**
3552
+ *
3553
+ * @summary Creates an image given a prompt.
3554
+ * @param {CreateImageRequest} createImageRequest
3555
+ * @param {*} [options] Override http request option.
3556
+ * @throws {RequiredError}
3557
+ */
3558
+ createImage(createImageRequest: CreateImageRequest, options?: any): AxiosPromise<ImagesResponse> {
3559
+ return localVarFp.createImage(createImageRequest, options).then((request) => request(axios, basePath));
3560
+ },
3561
+ /**
3562
+ *
3563
+ * @summary Creates an edited or extended image given an original image and a prompt.
3564
+ * @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.
3565
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
3566
+ * @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;.
3567
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3568
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3569
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3570
+ * @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).
3571
+ * @param {*} [options] Override http request option.
3572
+ * @throws {RequiredError}
3573
+ */
3574
+ createImageEdit(image: File, prompt: string, mask?: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: any): AxiosPromise<ImagesResponse> {
3575
+ return localVarFp.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(axios, basePath));
3576
+ },
3577
+ /**
3578
+ *
3579
+ * @summary Creates a variation of a given image.
3580
+ * @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.
3581
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3582
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3583
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3584
+ * @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).
3585
+ * @param {*} [options] Override http request option.
3586
+ * @throws {RequiredError}
3587
+ */
3588
+ createImageVariation(image: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: any): AxiosPromise<ImagesResponse> {
3589
+ return localVarFp.createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(axios, basePath));
3590
+ },
3591
+ /**
3592
+ *
3593
+ * @summary Classifies if text violates OpenAI\'s Content Policy
3594
+ * @param {CreateModerationRequest} createModerationRequest
3595
+ * @param {*} [options] Override http request option.
3596
+ * @throws {RequiredError}
3597
+ */
3598
+ createModeration(createModerationRequest: CreateModerationRequest, options?: any): AxiosPromise<CreateModerationResponse> {
3599
+ return localVarFp.createModeration(createModerationRequest, options).then((request) => request(axios, basePath));
3600
+ },
3601
+ /**
3602
+ *
3603
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
3604
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of &#x60;ada&#x60;, &#x60;babbage&#x60;, &#x60;curie&#x60;, or &#x60;davinci&#x60;.
3605
+ * @param {CreateSearchRequest} createSearchRequest
3606
+ * @param {*} [options] Override http request option.
3607
+ * @deprecated
3608
+ * @throws {RequiredError}
3609
+ */
3610
+ createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: any): AxiosPromise<CreateSearchResponse> {
3611
+ return localVarFp.createSearch(engineId, createSearchRequest, options).then((request) => request(axios, basePath));
3612
+ },
3613
+ /**
3614
+ *
3615
+ * @summary Transcribes audio into the input language.
3616
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3617
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3618
+ * @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.
3619
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3620
+ * @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.
3621
+ * @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.
3622
+ * @param {*} [options] Override http request option.
3623
+ * @throws {RequiredError}
3624
+ */
3625
+ createTranscription(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options?: any): AxiosPromise<CreateTranscriptionResponse> {
3626
+ return localVarFp.createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(axios, basePath));
3627
+ },
3628
+ /**
3629
+ *
3630
+ * @summary Translates audio into into English.
3631
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3632
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3633
+ * @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.
3634
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3635
+ * @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.
3636
+ * @param {*} [options] Override http request option.
3637
+ * @throws {RequiredError}
3638
+ */
3639
+ createTranslation(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options?: any): AxiosPromise<CreateTranslationResponse> {
3640
+ return localVarFp.createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(axios, basePath));
3641
+ },
3642
+ /**
3643
+ *
3644
+ * @summary Delete a file.
3645
+ * @param {string} fileId The ID of the file to use for this request
3646
+ * @param {*} [options] Override http request option.
3647
+ * @throws {RequiredError}
3648
+ */
3649
+ deleteFile(fileId: string, options?: any): AxiosPromise<DeleteFileResponse> {
3650
+ return localVarFp.deleteFile(fileId, options).then((request) => request(axios, basePath));
3651
+ },
3652
+ /**
3653
+ *
3654
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
3655
+ * @param {string} model The model to delete
3656
+ * @param {*} [options] Override http request option.
3657
+ * @throws {RequiredError}
3658
+ */
3659
+ deleteModel(model: string, options?: any): AxiosPromise<DeleteModelResponse> {
3660
+ return localVarFp.deleteModel(model, options).then((request) => request(axios, basePath));
3661
+ },
3662
+ /**
3663
+ *
3664
+ * @summary Returns the contents of the specified file
3665
+ * @param {string} fileId The ID of the file to use for this request
3666
+ * @param {*} [options] Override http request option.
3667
+ * @throws {RequiredError}
3668
+ */
3669
+ downloadFile(fileId: string, options?: any): AxiosPromise<string> {
3670
+ return localVarFp.downloadFile(fileId, options).then((request) => request(axios, basePath));
3671
+ },
3672
+ /**
3673
+ *
3674
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
3675
+ * @param {*} [options] Override http request option.
3676
+ * @deprecated
3677
+ * @throws {RequiredError}
3678
+ */
3679
+ listEngines(options?: any): AxiosPromise<ListEnginesResponse> {
3680
+ return localVarFp.listEngines(options).then((request) => request(axios, basePath));
3681
+ },
3682
+ /**
3683
+ *
3684
+ * @summary Returns a list of files that belong to the user\'s organization.
3685
+ * @param {*} [options] Override http request option.
3686
+ * @throws {RequiredError}
3687
+ */
3688
+ listFiles(options?: any): AxiosPromise<ListFilesResponse> {
3689
+ return localVarFp.listFiles(options).then((request) => request(axios, basePath));
3690
+ },
3691
+ /**
3692
+ *
3693
+ * @summary Get fine-grained status updates for a fine-tune job.
3694
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
3695
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
3696
+ * @param {*} [options] Override http request option.
3697
+ * @throws {RequiredError}
3698
+ */
3699
+ listFineTuneEvents(fineTuneId: string, stream?: boolean, options?: any): AxiosPromise<ListFineTuneEventsResponse> {
3700
+ return localVarFp.listFineTuneEvents(fineTuneId, stream, options).then((request) => request(axios, basePath));
3701
+ },
3702
+ /**
3703
+ *
3704
+ * @summary List your organization\'s fine-tuning jobs
3705
+ * @param {*} [options] Override http request option.
3706
+ * @throws {RequiredError}
3707
+ */
3708
+ listFineTunes(options?: any): AxiosPromise<ListFineTunesResponse> {
3709
+ return localVarFp.listFineTunes(options).then((request) => request(axios, basePath));
3710
+ },
3711
+ /**
3712
+ *
3713
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
3714
+ * @param {*} [options] Override http request option.
3715
+ * @throws {RequiredError}
3716
+ */
3717
+ listModels(options?: any): AxiosPromise<ListModelsResponse> {
3718
+ return localVarFp.listModels(options).then((request) => request(axios, basePath));
3719
+ },
3720
+ /**
3721
+ *
3722
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
3723
+ * @param {string} engineId The ID of the engine to use for this request
3724
+ * @param {*} [options] Override http request option.
3725
+ * @deprecated
3726
+ * @throws {RequiredError}
3727
+ */
3728
+ retrieveEngine(engineId: string, options?: any): AxiosPromise<Engine> {
3729
+ return localVarFp.retrieveEngine(engineId, options).then((request) => request(axios, basePath));
3730
+ },
3731
+ /**
3732
+ *
3733
+ * @summary Returns information about a specific file.
3734
+ * @param {string} fileId The ID of the file to use for this request
3735
+ * @param {*} [options] Override http request option.
3736
+ * @throws {RequiredError}
3737
+ */
3738
+ retrieveFile(fileId: string, options?: any): AxiosPromise<OpenAIFile> {
3739
+ return localVarFp.retrieveFile(fileId, options).then((request) => request(axios, basePath));
3740
+ },
3741
+ /**
3742
+ *
3743
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
3744
+ * @param {string} fineTuneId The ID of the fine-tune job
3745
+ * @param {*} [options] Override http request option.
3746
+ * @throws {RequiredError}
3747
+ */
3748
+ retrieveFineTune(fineTuneId: string, options?: any): AxiosPromise<FineTune> {
3749
+ return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios, basePath));
3750
+ },
3751
+ /**
3752
+ *
3753
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
3754
+ * @param {string} model The ID of the model to use for this request
3755
+ * @param {*} [options] Override http request option.
3756
+ * @throws {RequiredError}
3757
+ */
3758
+ retrieveModel(model: string, options?: any): AxiosPromise<Model> {
3759
+ return localVarFp.retrieveModel(model, options).then((request) => request(axios, basePath));
3760
+ },
3761
+ };
3762
+ };
3763
+
3764
+ /**
3765
+ * OpenAIApi - object-oriented interface
3766
+ * @export
3767
+ * @class OpenAIApi
3768
+ * @extends {BaseAPI}
3769
+ */
3770
+ export class OpenAIApi extends BaseAPI {
3771
+ /**
3772
+ *
3773
+ * @summary Immediately cancel a fine-tune job.
3774
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
3775
+ * @param {*} [options] Override http request option.
3776
+ * @throws {RequiredError}
3777
+ * @memberof OpenAIApi
3778
+ */
3779
+ public cancelFineTune(fineTuneId: string, options?: AxiosRequestConfig) {
3780
+ return OpenAIApiFp(this.configuration).cancelFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
3781
+ }
3782
+
3783
+ /**
3784
+ *
3785
+ * @summary Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
3786
+ * @param {CreateAnswerRequest} createAnswerRequest
3787
+ * @param {*} [options] Override http request option.
3788
+ * @deprecated
3789
+ * @throws {RequiredError}
3790
+ * @memberof OpenAIApi
3791
+ */
3792
+ public createAnswer(createAnswerRequest: CreateAnswerRequest, options?: AxiosRequestConfig) {
3793
+ return OpenAIApiFp(this.configuration).createAnswer(createAnswerRequest, options).then((request) => request(this.axios, this.basePath));
3794
+ }
3795
+
3796
+ /**
3797
+ *
3798
+ * @summary Creates a model response for the given chat conversation.
3799
+ * @param {CreateChatCompletionRequest} createChatCompletionRequest
3800
+ * @param {*} [options] Override http request option.
3801
+ * @throws {RequiredError}
3802
+ * @memberof OpenAIApi
3803
+ */
3804
+ public createChatCompletion(createChatCompletionRequest: CreateChatCompletionRequest, options?: AxiosRequestConfig) {
3805
+ return OpenAIApiFp(this.configuration).createChatCompletion(createChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
3806
+ }
3807
+
3808
+ /**
3809
+ *
3810
+ * @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.
3811
+ * @param {CreateClassificationRequest} createClassificationRequest
3812
+ * @param {*} [options] Override http request option.
3813
+ * @deprecated
3814
+ * @throws {RequiredError}
3815
+ * @memberof OpenAIApi
3816
+ */
3817
+ public createClassification(createClassificationRequest: CreateClassificationRequest, options?: AxiosRequestConfig) {
3818
+ return OpenAIApiFp(this.configuration).createClassification(createClassificationRequest, options).then((request) => request(this.axios, this.basePath));
3819
+ }
3820
+
3821
+ /**
3822
+ *
3823
+ * @summary Creates a completion for the provided prompt and parameters.
3824
+ * @param {CreateCompletionRequest} createCompletionRequest
3825
+ * @param {*} [options] Override http request option.
3826
+ * @throws {RequiredError}
3827
+ * @memberof OpenAIApi
3828
+ */
3829
+ public createCompletion(createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig) {
3830
+ return OpenAIApiFp(this.configuration).createCompletion(createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
3831
+ }
3832
+
3833
+ /**
3834
+ *
3835
+ * @summary Creates a new edit for the provided input, instruction, and parameters.
3836
+ * @param {CreateEditRequest} createEditRequest
3837
+ * @param {*} [options] Override http request option.
3838
+ * @throws {RequiredError}
3839
+ * @memberof OpenAIApi
3840
+ */
3841
+ public createEdit(createEditRequest: CreateEditRequest, options?: AxiosRequestConfig) {
3842
+ return OpenAIApiFp(this.configuration).createEdit(createEditRequest, options).then((request) => request(this.axios, this.basePath));
3843
+ }
3844
+
3845
+ /**
3846
+ *
3847
+ * @summary Creates an embedding vector representing the input text.
3848
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
3849
+ * @param {*} [options] Override http request option.
3850
+ * @throws {RequiredError}
3851
+ * @memberof OpenAIApi
3852
+ */
3853
+ public createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig) {
3854
+ return OpenAIApiFp(this.configuration).createEmbedding(createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
3855
+ }
3856
+
3857
+ /**
3858
+ *
3859
+ * @summary Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
3860
+ * @param {File} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
3861
+ * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
3862
+ * @param {*} [options] Override http request option.
3863
+ * @throws {RequiredError}
3864
+ * @memberof OpenAIApi
3865
+ */
3866
+ public createFile(file: File, purpose: string, options?: AxiosRequestConfig) {
3867
+ return OpenAIApiFp(this.configuration).createFile(file, purpose, options).then((request) => request(this.axios, this.basePath));
3868
+ }
3869
+
3870
+ /**
3871
+ *
3872
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
3873
+ * @param {CreateFineTuneRequest} createFineTuneRequest
3874
+ * @param {*} [options] Override http request option.
3875
+ * @throws {RequiredError}
3876
+ * @memberof OpenAIApi
3877
+ */
3878
+ public createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: AxiosRequestConfig) {
3879
+ return OpenAIApiFp(this.configuration).createFineTune(createFineTuneRequest, options).then((request) => request(this.axios, this.basePath));
3880
+ }
3881
+
3882
+ /**
3883
+ *
3884
+ * @summary Creates an image given a prompt.
3885
+ * @param {CreateImageRequest} createImageRequest
3886
+ * @param {*} [options] Override http request option.
3887
+ * @throws {RequiredError}
3888
+ * @memberof OpenAIApi
3889
+ */
3890
+ public createImage(createImageRequest: CreateImageRequest, options?: AxiosRequestConfig) {
3891
+ return OpenAIApiFp(this.configuration).createImage(createImageRequest, options).then((request) => request(this.axios, this.basePath));
3892
+ }
3893
+
3894
+ /**
3895
+ *
3896
+ * @summary Creates an edited or extended image given an original image and a prompt.
3897
+ * @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.
3898
+ * @param {string} prompt A text description of the desired image(s). The maximum length is 1000 characters.
3899
+ * @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;.
3900
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3901
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3902
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3903
+ * @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).
3904
+ * @param {*} [options] Override http request option.
3905
+ * @throws {RequiredError}
3906
+ * @memberof OpenAIApi
3907
+ */
3908
+ public createImageEdit(image: File, prompt: string, mask?: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig) {
3909
+ return OpenAIApiFp(this.configuration).createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(this.axios, this.basePath));
3910
+ }
3911
+
3912
+ /**
3913
+ *
3914
+ * @summary Creates a variation of a given image.
3915
+ * @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.
3916
+ * @param {number} [n] The number of images to generate. Must be between 1 and 10.
3917
+ * @param {string} [size] The size of the generated images. Must be one of &#x60;256x256&#x60;, &#x60;512x512&#x60;, or &#x60;1024x1024&#x60;.
3918
+ * @param {string} [responseFormat] The format in which the generated images are returned. Must be one of &#x60;url&#x60; or &#x60;b64_json&#x60;.
3919
+ * @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).
3920
+ * @param {*} [options] Override http request option.
3921
+ * @throws {RequiredError}
3922
+ * @memberof OpenAIApi
3923
+ */
3924
+ public createImageVariation(image: File, n?: number, size?: string, responseFormat?: string, user?: string, options?: AxiosRequestConfig) {
3925
+ return OpenAIApiFp(this.configuration).createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(this.axios, this.basePath));
3926
+ }
3927
+
3928
+ /**
3929
+ *
3930
+ * @summary Classifies if text violates OpenAI\'s Content Policy
3931
+ * @param {CreateModerationRequest} createModerationRequest
3932
+ * @param {*} [options] Override http request option.
3933
+ * @throws {RequiredError}
3934
+ * @memberof OpenAIApi
3935
+ */
3936
+ public createModeration(createModerationRequest: CreateModerationRequest, options?: AxiosRequestConfig) {
3937
+ return OpenAIApiFp(this.configuration).createModeration(createModerationRequest, options).then((request) => request(this.axios, this.basePath));
3938
+ }
3939
+
3940
+ /**
3941
+ *
3942
+ * @summary The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
3943
+ * @param {string} engineId The ID of the engine to use for this request. You can select one of &#x60;ada&#x60;, &#x60;babbage&#x60;, &#x60;curie&#x60;, or &#x60;davinci&#x60;.
3944
+ * @param {CreateSearchRequest} createSearchRequest
3945
+ * @param {*} [options] Override http request option.
3946
+ * @deprecated
3947
+ * @throws {RequiredError}
3948
+ * @memberof OpenAIApi
3949
+ */
3950
+ public createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: AxiosRequestConfig) {
3951
+ return OpenAIApiFp(this.configuration).createSearch(engineId, createSearchRequest, options).then((request) => request(this.axios, this.basePath));
3952
+ }
3953
+
3954
+ /**
3955
+ *
3956
+ * @summary Transcribes audio into the input language.
3957
+ * @param {File} file The audio file object (not file name) to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3958
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3959
+ * @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.
3960
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3961
+ * @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.
3962
+ * @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.
3963
+ * @param {*} [options] Override http request option.
3964
+ * @throws {RequiredError}
3965
+ * @memberof OpenAIApi
3966
+ */
3967
+ public createTranscription(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, language?: string, options?: AxiosRequestConfig) {
3968
+ return OpenAIApiFp(this.configuration).createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(this.axios, this.basePath));
3969
+ }
3970
+
3971
+ /**
3972
+ *
3973
+ * @summary Translates audio into into English.
3974
+ * @param {File} file The audio file object (not file name) translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
3975
+ * @param {string} model ID of the model to use. Only &#x60;whisper-1&#x60; is currently available.
3976
+ * @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.
3977
+ * @param {string} [responseFormat] The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
3978
+ * @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.
3979
+ * @param {*} [options] Override http request option.
3980
+ * @throws {RequiredError}
3981
+ * @memberof OpenAIApi
3982
+ */
3983
+ public createTranslation(file: File, model: string, prompt?: string, responseFormat?: string, temperature?: number, options?: AxiosRequestConfig) {
3984
+ return OpenAIApiFp(this.configuration).createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(this.axios, this.basePath));
3985
+ }
3986
+
3987
+ /**
3988
+ *
3989
+ * @summary Delete a file.
3990
+ * @param {string} fileId The ID of the file to use for this request
3991
+ * @param {*} [options] Override http request option.
3992
+ * @throws {RequiredError}
3993
+ * @memberof OpenAIApi
3994
+ */
3995
+ public deleteFile(fileId: string, options?: AxiosRequestConfig) {
3996
+ return OpenAIApiFp(this.configuration).deleteFile(fileId, options).then((request) => request(this.axios, this.basePath));
3997
+ }
3998
+
3999
+ /**
4000
+ *
4001
+ * @summary Delete a fine-tuned model. You must have the Owner role in your organization.
4002
+ * @param {string} model The model to delete
4003
+ * @param {*} [options] Override http request option.
4004
+ * @throws {RequiredError}
4005
+ * @memberof OpenAIApi
4006
+ */
4007
+ public deleteModel(model: string, options?: AxiosRequestConfig) {
4008
+ return OpenAIApiFp(this.configuration).deleteModel(model, options).then((request) => request(this.axios, this.basePath));
4009
+ }
4010
+
4011
+ /**
4012
+ *
4013
+ * @summary Returns the contents of the specified file
4014
+ * @param {string} fileId The ID of the file to use for this request
4015
+ * @param {*} [options] Override http request option.
4016
+ * @throws {RequiredError}
4017
+ * @memberof OpenAIApi
4018
+ */
4019
+ public downloadFile(fileId: string, options?: AxiosRequestConfig) {
4020
+ return OpenAIApiFp(this.configuration).downloadFile(fileId, options).then((request) => request(this.axios, this.basePath));
4021
+ }
4022
+
4023
+ /**
4024
+ *
4025
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
4026
+ * @param {*} [options] Override http request option.
4027
+ * @deprecated
4028
+ * @throws {RequiredError}
4029
+ * @memberof OpenAIApi
4030
+ */
4031
+ public listEngines(options?: AxiosRequestConfig) {
4032
+ return OpenAIApiFp(this.configuration).listEngines(options).then((request) => request(this.axios, this.basePath));
4033
+ }
4034
+
4035
+ /**
4036
+ *
4037
+ * @summary Returns a list of files that belong to the user\'s organization.
4038
+ * @param {*} [options] Override http request option.
4039
+ * @throws {RequiredError}
4040
+ * @memberof OpenAIApi
4041
+ */
4042
+ public listFiles(options?: AxiosRequestConfig) {
4043
+ return OpenAIApiFp(this.configuration).listFiles(options).then((request) => request(this.axios, this.basePath));
4044
+ }
4045
+
4046
+ /**
4047
+ *
4048
+ * @summary Get fine-grained status updates for a fine-tune job.
4049
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
4050
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events 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. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
4051
+ * @param {*} [options] Override http request option.
4052
+ * @throws {RequiredError}
4053
+ * @memberof OpenAIApi
4054
+ */
4055
+ public listFineTuneEvents(fineTuneId: string, stream?: boolean, options?: AxiosRequestConfig) {
4056
+ return OpenAIApiFp(this.configuration).listFineTuneEvents(fineTuneId, stream, options).then((request) => request(this.axios, this.basePath));
4057
+ }
4058
+
4059
+ /**
4060
+ *
4061
+ * @summary List your organization\'s fine-tuning jobs
4062
+ * @param {*} [options] Override http request option.
4063
+ * @throws {RequiredError}
4064
+ * @memberof OpenAIApi
4065
+ */
4066
+ public listFineTunes(options?: AxiosRequestConfig) {
4067
+ return OpenAIApiFp(this.configuration).listFineTunes(options).then((request) => request(this.axios, this.basePath));
4068
+ }
4069
+
4070
+ /**
4071
+ *
4072
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
4073
+ * @param {*} [options] Override http request option.
4074
+ * @throws {RequiredError}
4075
+ * @memberof OpenAIApi
4076
+ */
4077
+ public listModels(options?: AxiosRequestConfig) {
4078
+ return OpenAIApiFp(this.configuration).listModels(options).then((request) => request(this.axios, this.basePath));
4079
+ }
4080
+
4081
+ /**
4082
+ *
4083
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
4084
+ * @param {string} engineId The ID of the engine to use for this request
4085
+ * @param {*} [options] Override http request option.
4086
+ * @deprecated
4087
+ * @throws {RequiredError}
4088
+ * @memberof OpenAIApi
4089
+ */
4090
+ public retrieveEngine(engineId: string, options?: AxiosRequestConfig) {
4091
+ return OpenAIApiFp(this.configuration).retrieveEngine(engineId, options).then((request) => request(this.axios, this.basePath));
4092
+ }
4093
+
4094
+ /**
4095
+ *
4096
+ * @summary Returns information about a specific file.
4097
+ * @param {string} fileId The ID of the file to use for this request
4098
+ * @param {*} [options] Override http request option.
4099
+ * @throws {RequiredError}
4100
+ * @memberof OpenAIApi
4101
+ */
4102
+ public retrieveFile(fileId: string, options?: AxiosRequestConfig) {
4103
+ return OpenAIApiFp(this.configuration).retrieveFile(fileId, options).then((request) => request(this.axios, this.basePath));
4104
+ }
4105
+
4106
+ /**
4107
+ *
4108
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
4109
+ * @param {string} fineTuneId The ID of the fine-tune job
4110
+ * @param {*} [options] Override http request option.
4111
+ * @throws {RequiredError}
4112
+ * @memberof OpenAIApi
4113
+ */
4114
+ public retrieveFineTune(fineTuneId: string, options?: AxiosRequestConfig) {
4115
+ return OpenAIApiFp(this.configuration).retrieveFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
4116
+ }
4117
+
4118
+ /**
4119
+ *
4120
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
4121
+ * @param {string} model The ID of the model to use for this request
4122
+ * @param {*} [options] Override http request option.
4123
+ * @throws {RequiredError}
4124
+ * @memberof OpenAIApi
4125
+ */
4126
+ public retrieveModel(model: string, options?: AxiosRequestConfig) {
4127
+ return OpenAIApiFp(this.configuration).retrieveModel(model, options).then((request) => request(this.axios, this.basePath));
4128
+ }
4129
+ }
4130
+
4131
+