openai 2.0.5 → 3.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 CHANGED
@@ -4,7 +4,7 @@
4
4
  * OpenAI API
5
5
  * APIs for sampling from and fine-tuning language models
6
6
  *
7
- * The version of the OpenAPI document: 1.0.4
7
+ * The version of the OpenAPI document: 1.0.6
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,7 +28,7 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
28
28
  */
29
29
  export interface CreateAnswerRequest {
30
30
  /**
31
- * ID of the engine to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
31
+ * ID of the model to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
32
32
  * @type {string}
33
33
  * @memberof CreateAnswerRequest
34
34
  */
@@ -64,7 +64,7 @@ export interface CreateAnswerRequest {
64
64
  */
65
65
  'file'?: string | null;
66
66
  /**
67
- * ID of the engine to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
67
+ * ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
68
68
  * @type {string}
69
69
  * @memberof CreateAnswerRequest
70
70
  */
@@ -82,7 +82,7 @@ export interface CreateAnswerRequest {
82
82
  */
83
83
  'temperature'?: number | null;
84
84
  /**
85
- * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact support@openai.com and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
85
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
86
86
  * @type {number}
87
87
  * @memberof CreateAnswerRequest
88
88
  */
@@ -94,11 +94,11 @@ export interface CreateAnswerRequest {
94
94
  */
95
95
  'max_tokens'?: number | null;
96
96
  /**
97
- * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
98
- * @type {string | Array<string>}
97
+ *
98
+ * @type {CreateAnswerRequestStop}
99
99
  * @memberof CreateAnswerRequest
100
100
  */
101
- 'stop'?: string | Array<string> | null;
101
+ 'stop'?: CreateAnswerRequestStop | null;
102
102
  /**
103
103
  * How many answers to generate for each question.
104
104
  * @type {number}
@@ -136,6 +136,13 @@ export interface CreateAnswerRequest {
136
136
  */
137
137
  'user'?: string;
138
138
  }
139
+ /**
140
+ * @type CreateAnswerRequestStop
141
+ * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
142
+ * @export
143
+ */
144
+ export type CreateAnswerRequestStop = Array<string> | string;
145
+
139
146
  /**
140
147
  *
141
148
  * @export
@@ -174,27 +181,27 @@ export interface CreateAnswerResponse {
174
181
  'answers'?: Array<string>;
175
182
  /**
176
183
  *
177
- * @type {Array<CreateAnswerResponseSelectedDocuments>}
184
+ * @type {Array<CreateAnswerResponseSelectedDocumentsInner>}
178
185
  * @memberof CreateAnswerResponse
179
186
  */
180
- 'selected_documents'?: Array<CreateAnswerResponseSelectedDocuments>;
187
+ 'selected_documents'?: Array<CreateAnswerResponseSelectedDocumentsInner>;
181
188
  }
182
189
  /**
183
190
  *
184
191
  * @export
185
- * @interface CreateAnswerResponseSelectedDocuments
192
+ * @interface CreateAnswerResponseSelectedDocumentsInner
186
193
  */
187
- export interface CreateAnswerResponseSelectedDocuments {
194
+ export interface CreateAnswerResponseSelectedDocumentsInner {
188
195
  /**
189
196
  *
190
197
  * @type {number}
191
- * @memberof CreateAnswerResponseSelectedDocuments
198
+ * @memberof CreateAnswerResponseSelectedDocumentsInner
192
199
  */
193
200
  'document'?: number;
194
201
  /**
195
202
  *
196
203
  * @type {string}
197
- * @memberof CreateAnswerResponseSelectedDocuments
204
+ * @memberof CreateAnswerResponseSelectedDocumentsInner
198
205
  */
199
206
  'text'?: string;
200
207
  }
@@ -205,7 +212,7 @@ export interface CreateAnswerResponseSelectedDocuments {
205
212
  */
206
213
  export interface CreateClassificationRequest {
207
214
  /**
208
- * ID of the engine to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
215
+ * 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.
209
216
  * @type {string}
210
217
  * @memberof CreateClassificationRequest
211
218
  */
@@ -235,7 +242,7 @@ export interface CreateClassificationRequest {
235
242
  */
236
243
  'labels'?: Array<string> | null;
237
244
  /**
238
- * ID of the engine to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
245
+ * ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
239
246
  * @type {string}
240
247
  * @memberof CreateClassificationRequest
241
248
  */
@@ -247,7 +254,7 @@ export interface CreateClassificationRequest {
247
254
  */
248
255
  'temperature'?: number | null;
249
256
  /**
250
- * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact support@openai.com and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
257
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case. When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
251
258
  * @type {number}
252
259
  * @memberof CreateClassificationRequest
253
260
  */
@@ -327,170 +334,60 @@ export interface CreateClassificationResponse {
327
334
  'label'?: string;
328
335
  /**
329
336
  *
330
- * @type {Array<CreateClassificationResponseSelectedExamples>}
337
+ * @type {Array<CreateClassificationResponseSelectedExamplesInner>}
331
338
  * @memberof CreateClassificationResponse
332
339
  */
333
- 'selected_examples'?: Array<CreateClassificationResponseSelectedExamples>;
340
+ 'selected_examples'?: Array<CreateClassificationResponseSelectedExamplesInner>;
334
341
  }
335
342
  /**
336
343
  *
337
344
  * @export
338
- * @interface CreateClassificationResponseSelectedExamples
345
+ * @interface CreateClassificationResponseSelectedExamplesInner
339
346
  */
340
- export interface CreateClassificationResponseSelectedExamples {
347
+ export interface CreateClassificationResponseSelectedExamplesInner {
341
348
  /**
342
349
  *
343
350
  * @type {number}
344
- * @memberof CreateClassificationResponseSelectedExamples
351
+ * @memberof CreateClassificationResponseSelectedExamplesInner
345
352
  */
346
353
  'document'?: number;
347
354
  /**
348
355
  *
349
356
  * @type {string}
350
- * @memberof CreateClassificationResponseSelectedExamples
357
+ * @memberof CreateClassificationResponseSelectedExamplesInner
351
358
  */
352
359
  'text'?: string;
353
360
  /**
354
361
  *
355
362
  * @type {string}
356
- * @memberof CreateClassificationResponseSelectedExamples
363
+ * @memberof CreateClassificationResponseSelectedExamplesInner
357
364
  */
358
365
  'label'?: string;
359
366
  }
360
367
  /**
361
368
  *
362
369
  * @export
363
- * @interface CreateCompletionFromModelRequest
364
- */
365
- export interface CreateCompletionFromModelRequest {
366
- /**
367
- * 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.
368
- * @type {string | Array<string> | Array<number> | Array<any>}
369
- * @memberof CreateCompletionFromModelRequest
370
- */
371
- 'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
372
- /**
373
- * The suffix that comes after a completion of inserted text, encoded as a string or array of strings.
374
- * @type {string | Array<string>}
375
- * @memberof CreateCompletionFromModelRequest
376
- */
377
- 'suffix'?: string | Array<string> | null;
378
- /**
379
- * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
380
- * @type {number}
381
- * @memberof CreateCompletionFromModelRequest
382
- */
383
- 'max_tokens'?: number | null;
384
- /**
385
- * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both.
386
- * @type {number}
387
- * @memberof CreateCompletionFromModelRequest
388
- */
389
- 'temperature'?: number | null;
390
- /**
391
- * 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.
392
- * @type {number}
393
- * @memberof CreateCompletionFromModelRequest
394
- */
395
- 'top_p'?: number | null;
396
- /**
397
- * 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`.
398
- * @type {number}
399
- * @memberof CreateCompletionFromModelRequest
400
- */
401
- 'n'?: number | null;
402
- /**
403
- * 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.
404
- * @type {boolean}
405
- * @memberof CreateCompletionFromModelRequest
406
- */
407
- 'stream'?: boolean | null;
408
- /**
409
- * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact support@openai.com and describe your use case.
410
- * @type {number}
411
- * @memberof CreateCompletionFromModelRequest
412
- */
413
- 'logprobs'?: number | null;
414
- /**
415
- * Echo back the prompt in addition to the completion
416
- * @type {boolean}
417
- * @memberof CreateCompletionFromModelRequest
418
- */
419
- 'echo'?: boolean | null;
420
- /**
421
- * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
422
- * @type {string | Array<string>}
423
- * @memberof CreateCompletionFromModelRequest
424
- */
425
- 'stop'?: string | Array<string> | null;
426
- /**
427
- * 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)
428
- * @type {number}
429
- * @memberof CreateCompletionFromModelRequest
430
- */
431
- 'presence_penalty'?: number | null;
432
- /**
433
- * 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)
434
- * @type {number}
435
- * @memberof CreateCompletionFromModelRequest
436
- */
437
- 'frequency_penalty'?: number | null;
438
- /**
439
- * Generates `best_of` completions server-side and returns the \"best\" (the one with the lowest 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`.
440
- * @type {number}
441
- * @memberof CreateCompletionFromModelRequest
442
- */
443
- 'best_of'?: number | null;
444
- /**
445
- * 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.
446
- * @type {object}
447
- * @memberof CreateCompletionFromModelRequest
448
- */
449
- 'logit_bias'?: object | null;
450
- /**
451
- * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
452
- * @type {string}
453
- * @memberof CreateCompletionFromModelRequest
454
- */
455
- 'user'?: string;
456
- /**
457
- * ID of the model to use for completion.
458
- * @type {string}
459
- * @memberof CreateCompletionFromModelRequest
460
- */
461
- 'model'?: string;
462
- }
463
- /**
464
- *
465
- * @export
466
- * @interface CreateCompletionFromModelRequestAllOf
370
+ * @interface CreateCompletionRequest
467
371
  */
468
- export interface CreateCompletionFromModelRequestAllOf {
372
+ export interface CreateCompletionRequest {
469
373
  /**
470
- * ID of the model to use for completion.
374
+ * 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.
471
375
  * @type {string}
472
- * @memberof CreateCompletionFromModelRequestAllOf
376
+ * @memberof CreateCompletionRequest
473
377
  */
474
- 'model'?: string;
475
- }
476
- /**
477
- *
478
- * @export
479
- * @interface CreateCompletionRequest
480
- */
481
- export interface CreateCompletionRequest {
378
+ 'model': string;
482
379
  /**
483
- * 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.
484
- * @type {string | Array<string> | Array<number> | Array<any>}
380
+ *
381
+ * @type {CreateCompletionRequestPrompt}
485
382
  * @memberof CreateCompletionRequest
486
383
  */
487
- 'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
384
+ 'prompt'?: CreateCompletionRequestPrompt | null;
488
385
  /**
489
- * The suffix that comes after a completion of inserted text, encoded as a string or array of strings.
490
- * @type {string | Array<string>}
386
+ * The suffix that comes after a completion of inserted text.
387
+ * @type {string}
491
388
  * @memberof CreateCompletionRequest
492
389
  */
493
- 'suffix'?: string | Array<string> | null;
390
+ 'suffix'?: string | null;
494
391
  /**
495
392
  * The maximum number of [tokens](/tokenizer) to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
496
393
  * @type {number}
@@ -522,7 +419,7 @@ export interface CreateCompletionRequest {
522
419
  */
523
420
  'stream'?: boolean | null;
524
421
  /**
525
- * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact support@openai.com and describe your use case.
422
+ * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case.
526
423
  * @type {number}
527
424
  * @memberof CreateCompletionRequest
528
425
  */
@@ -534,11 +431,11 @@ export interface CreateCompletionRequest {
534
431
  */
535
432
  'echo'?: boolean | null;
536
433
  /**
537
- * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
538
- * @type {string | Array<string>}
434
+ *
435
+ * @type {CreateCompletionRequestStop}
539
436
  * @memberof CreateCompletionRequest
540
437
  */
541
- 'stop'?: string | Array<string> | null;
438
+ 'stop'?: CreateCompletionRequestStop | null;
542
439
  /**
543
440
  * 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)
544
441
  * @type {number}
@@ -552,7 +449,7 @@ export interface CreateCompletionRequest {
552
449
  */
553
450
  'frequency_penalty'?: number | null;
554
451
  /**
555
- * Generates `best_of` completions server-side and returns the \"best\" (the one with the lowest 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`.
452
+ * 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`.
556
453
  * @type {number}
557
454
  * @memberof CreateCompletionRequest
558
455
  */
@@ -570,6 +467,20 @@ export interface CreateCompletionRequest {
570
467
  */
571
468
  'user'?: string;
572
469
  }
470
+ /**
471
+ * @type CreateCompletionRequestPrompt
472
+ * 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.
473
+ * @export
474
+ */
475
+ export type CreateCompletionRequestPrompt = Array<any> | Array<number> | Array<string> | string;
476
+
477
+ /**
478
+ * @type CreateCompletionRequestStop
479
+ * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
480
+ * @export
481
+ */
482
+ export type CreateCompletionRequestStop = Array<string> | string;
483
+
573
484
  /**
574
485
  *
575
486
  * @export
@@ -581,100 +492,137 @@ export interface CreateCompletionResponse {
581
492
  * @type {string}
582
493
  * @memberof CreateCompletionResponse
583
494
  */
584
- 'id'?: string;
495
+ 'id': string;
585
496
  /**
586
497
  *
587
498
  * @type {string}
588
499
  * @memberof CreateCompletionResponse
589
500
  */
590
- 'object'?: string;
501
+ 'object': string;
591
502
  /**
592
503
  *
593
504
  * @type {number}
594
505
  * @memberof CreateCompletionResponse
595
506
  */
596
- 'created'?: number;
507
+ 'created': number;
597
508
  /**
598
509
  *
599
510
  * @type {string}
600
511
  * @memberof CreateCompletionResponse
601
512
  */
602
- 'model'?: string;
513
+ 'model': string;
603
514
  /**
604
515
  *
605
- * @type {Array<CreateCompletionResponseChoices>}
516
+ * @type {Array<CreateCompletionResponseChoicesInner>}
606
517
  * @memberof CreateCompletionResponse
607
518
  */
608
- 'choices'?: Array<CreateCompletionResponseChoices>;
519
+ 'choices': Array<CreateCompletionResponseChoicesInner>;
520
+ /**
521
+ *
522
+ * @type {CreateCompletionResponseUsage}
523
+ * @memberof CreateCompletionResponse
524
+ */
525
+ 'usage'?: CreateCompletionResponseUsage;
609
526
  }
610
527
  /**
611
528
  *
612
529
  * @export
613
- * @interface CreateCompletionResponseChoices
530
+ * @interface CreateCompletionResponseChoicesInner
614
531
  */
615
- export interface CreateCompletionResponseChoices {
532
+ export interface CreateCompletionResponseChoicesInner {
616
533
  /**
617
534
  *
618
535
  * @type {string}
619
- * @memberof CreateCompletionResponseChoices
536
+ * @memberof CreateCompletionResponseChoicesInner
620
537
  */
621
538
  'text'?: string;
622
539
  /**
623
540
  *
624
541
  * @type {number}
625
- * @memberof CreateCompletionResponseChoices
542
+ * @memberof CreateCompletionResponseChoicesInner
626
543
  */
627
544
  'index'?: number;
628
545
  /**
629
546
  *
630
- * @type {CreateCompletionResponseLogprobs}
631
- * @memberof CreateCompletionResponseChoices
547
+ * @type {CreateCompletionResponseChoicesInnerLogprobs}
548
+ * @memberof CreateCompletionResponseChoicesInner
632
549
  */
633
- 'logprobs'?: CreateCompletionResponseLogprobs | null;
550
+ 'logprobs'?: CreateCompletionResponseChoicesInnerLogprobs | null;
634
551
  /**
635
552
  *
636
553
  * @type {string}
637
- * @memberof CreateCompletionResponseChoices
554
+ * @memberof CreateCompletionResponseChoicesInner
638
555
  */
639
556
  'finish_reason'?: string;
640
557
  }
641
558
  /**
642
559
  *
643
560
  * @export
644
- * @interface CreateCompletionResponseLogprobs
561
+ * @interface CreateCompletionResponseChoicesInnerLogprobs
645
562
  */
646
- export interface CreateCompletionResponseLogprobs {
563
+ export interface CreateCompletionResponseChoicesInnerLogprobs {
647
564
  /**
648
565
  *
649
566
  * @type {Array<string>}
650
- * @memberof CreateCompletionResponseLogprobs
567
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
651
568
  */
652
569
  'tokens'?: Array<string>;
653
570
  /**
654
571
  *
655
572
  * @type {Array<number>}
656
- * @memberof CreateCompletionResponseLogprobs
573
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
657
574
  */
658
575
  'token_logprobs'?: Array<number>;
659
576
  /**
660
577
  *
661
578
  * @type {Array<object>}
662
- * @memberof CreateCompletionResponseLogprobs
579
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
663
580
  */
664
581
  'top_logprobs'?: Array<object>;
665
582
  /**
666
583
  *
667
584
  * @type {Array<number>}
668
- * @memberof CreateCompletionResponseLogprobs
585
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
669
586
  */
670
587
  'text_offset'?: Array<number>;
671
588
  }
589
+ /**
590
+ *
591
+ * @export
592
+ * @interface CreateCompletionResponseUsage
593
+ */
594
+ export interface CreateCompletionResponseUsage {
595
+ /**
596
+ *
597
+ * @type {number}
598
+ * @memberof CreateCompletionResponseUsage
599
+ */
600
+ 'prompt_tokens': number;
601
+ /**
602
+ *
603
+ * @type {number}
604
+ * @memberof CreateCompletionResponseUsage
605
+ */
606
+ 'completion_tokens': number;
607
+ /**
608
+ *
609
+ * @type {number}
610
+ * @memberof CreateCompletionResponseUsage
611
+ */
612
+ 'total_tokens': number;
613
+ }
672
614
  /**
673
615
  *
674
616
  * @export
675
617
  * @interface CreateEditRequest
676
618
  */
677
619
  export interface CreateEditRequest {
620
+ /**
621
+ * ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
622
+ * @type {string}
623
+ * @memberof CreateEditRequest
624
+ */
625
+ 'model': string;
678
626
  /**
679
627
  * The input text to use as a starting point for the edit.
680
628
  * @type {string}
@@ -687,6 +635,12 @@ export interface CreateEditRequest {
687
635
  * @memberof CreateEditRequest
688
636
  */
689
637
  'instruction': string;
638
+ /**
639
+ * How many edits to generate for the input and instruction.
640
+ * @type {number}
641
+ * @memberof CreateEditRequest
642
+ */
643
+ 'n'?: number | null;
690
644
  /**
691
645
  * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both.
692
646
  * @type {number}
@@ -711,31 +665,37 @@ export interface CreateEditResponse {
711
665
  * @type {string}
712
666
  * @memberof CreateEditResponse
713
667
  */
714
- 'id'?: string;
668
+ 'id': string;
715
669
  /**
716
670
  *
717
671
  * @type {string}
718
672
  * @memberof CreateEditResponse
719
673
  */
720
- 'object'?: string;
674
+ 'object': string;
721
675
  /**
722
676
  *
723
677
  * @type {number}
724
678
  * @memberof CreateEditResponse
725
679
  */
726
- 'created'?: number;
680
+ 'created': number;
727
681
  /**
728
682
  *
729
683
  * @type {string}
730
684
  * @memberof CreateEditResponse
731
685
  */
732
- 'model'?: string;
686
+ 'model': string;
687
+ /**
688
+ *
689
+ * @type {Array<CreateCompletionResponseChoicesInner>}
690
+ * @memberof CreateEditResponse
691
+ */
692
+ 'choices': Array<CreateCompletionResponseChoicesInner>;
733
693
  /**
734
694
  *
735
- * @type {Array<CreateCompletionResponseChoices>}
695
+ * @type {CreateCompletionResponseUsage}
736
696
  * @memberof CreateEditResponse
737
697
  */
738
- 'choices'?: Array<CreateCompletionResponseChoices>;
698
+ 'usage': CreateCompletionResponseUsage;
739
699
  }
740
700
  /**
741
701
  *
@@ -744,11 +704,17 @@ export interface CreateEditResponse {
744
704
  */
745
705
  export interface CreateEmbeddingRequest {
746
706
  /**
747
- * Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 2048 tokens in length. Unless your are embedding code, we suggest replacing newlines (`\\n`) in your input with a single space, as we have observed inferior results when newlines are present.
748
- * @type {string | Array<string> | Array<number> | Array<any>}
707
+ * 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.
708
+ * @type {string}
709
+ * @memberof CreateEmbeddingRequest
710
+ */
711
+ 'model': string;
712
+ /**
713
+ *
714
+ * @type {CreateEmbeddingRequestInput}
749
715
  * @memberof CreateEmbeddingRequest
750
716
  */
751
- 'input': string | Array<string> | Array<number> | Array<any>;
717
+ 'input': CreateEmbeddingRequestInput;
752
718
  /**
753
719
  * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
754
720
  * @type {string}
@@ -756,6 +722,13 @@ export interface CreateEmbeddingRequest {
756
722
  */
757
723
  'user'?: string;
758
724
  }
725
+ /**
726
+ * @type CreateEmbeddingRequestInput
727
+ * Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 2048 tokens in length. Unless you are embedding code, we suggest replacing newlines (`\\n`) in your input with a single space, as we have observed inferior results when newlines are present.
728
+ * @export
729
+ */
730
+ export type CreateEmbeddingRequestInput = Array<any> | Array<number> | Array<string> | string;
731
+
759
732
  /**
760
733
  *
761
734
  * @export
@@ -767,44 +740,69 @@ export interface CreateEmbeddingResponse {
767
740
  * @type {string}
768
741
  * @memberof CreateEmbeddingResponse
769
742
  */
770
- 'object'?: string;
743
+ 'object': string;
771
744
  /**
772
745
  *
773
746
  * @type {string}
774
747
  * @memberof CreateEmbeddingResponse
775
748
  */
776
- 'model'?: string;
749
+ 'model': string;
777
750
  /**
778
751
  *
779
- * @type {Array<CreateEmbeddingResponseData>}
752
+ * @type {Array<CreateEmbeddingResponseDataInner>}
780
753
  * @memberof CreateEmbeddingResponse
781
754
  */
782
- 'data'?: Array<CreateEmbeddingResponseData>;
755
+ 'data': Array<CreateEmbeddingResponseDataInner>;
756
+ /**
757
+ *
758
+ * @type {CreateEmbeddingResponseUsage}
759
+ * @memberof CreateEmbeddingResponse
760
+ */
761
+ 'usage': CreateEmbeddingResponseUsage;
783
762
  }
784
763
  /**
785
764
  *
786
765
  * @export
787
- * @interface CreateEmbeddingResponseData
766
+ * @interface CreateEmbeddingResponseDataInner
788
767
  */
789
- export interface CreateEmbeddingResponseData {
768
+ export interface CreateEmbeddingResponseDataInner {
790
769
  /**
791
770
  *
792
771
  * @type {number}
793
- * @memberof CreateEmbeddingResponseData
772
+ * @memberof CreateEmbeddingResponseDataInner
794
773
  */
795
- 'index'?: number;
774
+ 'index': number;
796
775
  /**
797
776
  *
798
777
  * @type {string}
799
- * @memberof CreateEmbeddingResponseData
778
+ * @memberof CreateEmbeddingResponseDataInner
800
779
  */
801
- 'object'?: string;
780
+ 'object': string;
802
781
  /**
803
782
  *
804
783
  * @type {Array<number>}
805
- * @memberof CreateEmbeddingResponseData
784
+ * @memberof CreateEmbeddingResponseDataInner
785
+ */
786
+ 'embedding': Array<number>;
787
+ }
788
+ /**
789
+ *
790
+ * @export
791
+ * @interface CreateEmbeddingResponseUsage
792
+ */
793
+ export interface CreateEmbeddingResponseUsage {
794
+ /**
795
+ *
796
+ * @type {number}
797
+ * @memberof CreateEmbeddingResponseUsage
798
+ */
799
+ 'prompt_tokens': number;
800
+ /**
801
+ *
802
+ * @type {number}
803
+ * @memberof CreateEmbeddingResponseUsage
806
804
  */
807
- 'embedding'?: Array<number>;
805
+ 'total_tokens': number;
808
806
  }
809
807
  /**
810
808
  *
@@ -825,7 +823,7 @@ export interface CreateFineTuneRequest {
825
823
  */
826
824
  'validation_file'?: string | null;
827
825
  /**
828
- * The name of the base model to fine-tune. You can select one of \"ada\", \"babbage\", \"curie\", or \"davinci\". To learn more about these models, see the [Engines](https://beta.openai.com/docs/engines) documentation.
826
+ * The name of the base model to fine-tune. You can select one of \"ada\", \"babbage\", \"curie\", \"davinci\", or a fine-tuned model created after 2022-04-21. To learn more about these models, see the [Models](https://beta.openai.com/docs/models) documentation.
829
827
  * @type {string}
830
828
  * @memberof CreateFineTuneRequest
831
829
  */
@@ -885,6 +883,180 @@ export interface CreateFineTuneRequest {
885
883
  */
886
884
  'suffix'?: string | null;
887
885
  }
886
+ /**
887
+ *
888
+ * @export
889
+ * @interface CreateModerationRequest
890
+ */
891
+ export interface CreateModerationRequest {
892
+ /**
893
+ *
894
+ * @type {CreateModerationRequestInput}
895
+ * @memberof CreateModerationRequest
896
+ */
897
+ 'input': CreateModerationRequestInput;
898
+ /**
899
+ * 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`.
900
+ * @type {string}
901
+ * @memberof CreateModerationRequest
902
+ */
903
+ 'model'?: string;
904
+ }
905
+ /**
906
+ * @type CreateModerationRequestInput
907
+ * The input text to classify
908
+ * @export
909
+ */
910
+ export type CreateModerationRequestInput = Array<string> | string;
911
+
912
+ /**
913
+ *
914
+ * @export
915
+ * @interface CreateModerationResponse
916
+ */
917
+ export interface CreateModerationResponse {
918
+ /**
919
+ *
920
+ * @type {string}
921
+ * @memberof CreateModerationResponse
922
+ */
923
+ 'id': string;
924
+ /**
925
+ *
926
+ * @type {string}
927
+ * @memberof CreateModerationResponse
928
+ */
929
+ 'model': string;
930
+ /**
931
+ *
932
+ * @type {Array<CreateModerationResponseResultsInner>}
933
+ * @memberof CreateModerationResponse
934
+ */
935
+ 'results': Array<CreateModerationResponseResultsInner>;
936
+ }
937
+ /**
938
+ *
939
+ * @export
940
+ * @interface CreateModerationResponseResultsInner
941
+ */
942
+ export interface CreateModerationResponseResultsInner {
943
+ /**
944
+ *
945
+ * @type {boolean}
946
+ * @memberof CreateModerationResponseResultsInner
947
+ */
948
+ 'flagged': boolean;
949
+ /**
950
+ *
951
+ * @type {CreateModerationResponseResultsInnerCategories}
952
+ * @memberof CreateModerationResponseResultsInner
953
+ */
954
+ 'categories': CreateModerationResponseResultsInnerCategories;
955
+ /**
956
+ *
957
+ * @type {CreateModerationResponseResultsInnerCategoryScores}
958
+ * @memberof CreateModerationResponseResultsInner
959
+ */
960
+ 'category_scores': CreateModerationResponseResultsInnerCategoryScores;
961
+ }
962
+ /**
963
+ *
964
+ * @export
965
+ * @interface CreateModerationResponseResultsInnerCategories
966
+ */
967
+ export interface CreateModerationResponseResultsInnerCategories {
968
+ /**
969
+ *
970
+ * @type {boolean}
971
+ * @memberof CreateModerationResponseResultsInnerCategories
972
+ */
973
+ 'hate': boolean;
974
+ /**
975
+ *
976
+ * @type {boolean}
977
+ * @memberof CreateModerationResponseResultsInnerCategories
978
+ */
979
+ 'hate/threatening': boolean;
980
+ /**
981
+ *
982
+ * @type {boolean}
983
+ * @memberof CreateModerationResponseResultsInnerCategories
984
+ */
985
+ 'self-harm': boolean;
986
+ /**
987
+ *
988
+ * @type {boolean}
989
+ * @memberof CreateModerationResponseResultsInnerCategories
990
+ */
991
+ 'sexual': boolean;
992
+ /**
993
+ *
994
+ * @type {boolean}
995
+ * @memberof CreateModerationResponseResultsInnerCategories
996
+ */
997
+ 'sexual/minors': boolean;
998
+ /**
999
+ *
1000
+ * @type {boolean}
1001
+ * @memberof CreateModerationResponseResultsInnerCategories
1002
+ */
1003
+ 'violence': boolean;
1004
+ /**
1005
+ *
1006
+ * @type {boolean}
1007
+ * @memberof CreateModerationResponseResultsInnerCategories
1008
+ */
1009
+ 'violence/graphic': boolean;
1010
+ }
1011
+ /**
1012
+ *
1013
+ * @export
1014
+ * @interface CreateModerationResponseResultsInnerCategoryScores
1015
+ */
1016
+ export interface CreateModerationResponseResultsInnerCategoryScores {
1017
+ /**
1018
+ *
1019
+ * @type {number}
1020
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1021
+ */
1022
+ 'hate': number;
1023
+ /**
1024
+ *
1025
+ * @type {number}
1026
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1027
+ */
1028
+ 'hate/threatening': number;
1029
+ /**
1030
+ *
1031
+ * @type {number}
1032
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1033
+ */
1034
+ 'self-harm': number;
1035
+ /**
1036
+ *
1037
+ * @type {number}
1038
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1039
+ */
1040
+ 'sexual': number;
1041
+ /**
1042
+ *
1043
+ * @type {number}
1044
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1045
+ */
1046
+ 'sexual/minors': number;
1047
+ /**
1048
+ *
1049
+ * @type {number}
1050
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1051
+ */
1052
+ 'violence': number;
1053
+ /**
1054
+ *
1055
+ * @type {number}
1056
+ * @memberof CreateModerationResponseResultsInnerCategoryScores
1057
+ */
1058
+ 'violence/graphic': number;
1059
+ }
888
1060
  /**
889
1061
  *
890
1062
  * @export
@@ -948,33 +1120,33 @@ export interface CreateSearchResponse {
948
1120
  'model'?: string;
949
1121
  /**
950
1122
  *
951
- * @type {Array<CreateSearchResponseData>}
1123
+ * @type {Array<CreateSearchResponseDataInner>}
952
1124
  * @memberof CreateSearchResponse
953
1125
  */
954
- 'data'?: Array<CreateSearchResponseData>;
1126
+ 'data'?: Array<CreateSearchResponseDataInner>;
955
1127
  }
956
1128
  /**
957
1129
  *
958
1130
  * @export
959
- * @interface CreateSearchResponseData
1131
+ * @interface CreateSearchResponseDataInner
960
1132
  */
961
- export interface CreateSearchResponseData {
1133
+ export interface CreateSearchResponseDataInner {
962
1134
  /**
963
1135
  *
964
1136
  * @type {string}
965
- * @memberof CreateSearchResponseData
1137
+ * @memberof CreateSearchResponseDataInner
966
1138
  */
967
1139
  'object'?: string;
968
1140
  /**
969
1141
  *
970
1142
  * @type {number}
971
- * @memberof CreateSearchResponseData
1143
+ * @memberof CreateSearchResponseDataInner
972
1144
  */
973
1145
  'document'?: number;
974
1146
  /**
975
1147
  *
976
1148
  * @type {number}
977
- * @memberof CreateSearchResponseData
1149
+ * @memberof CreateSearchResponseDataInner
978
1150
  */
979
1151
  'score'?: number;
980
1152
  }
@@ -989,19 +1161,19 @@ export interface DeleteFileResponse {
989
1161
  * @type {string}
990
1162
  * @memberof DeleteFileResponse
991
1163
  */
992
- 'id'?: string;
1164
+ 'id': string;
993
1165
  /**
994
1166
  *
995
1167
  * @type {string}
996
1168
  * @memberof DeleteFileResponse
997
1169
  */
998
- 'object'?: string;
1170
+ 'object': string;
999
1171
  /**
1000
1172
  *
1001
1173
  * @type {boolean}
1002
1174
  * @memberof DeleteFileResponse
1003
1175
  */
1004
- 'deleted'?: boolean;
1176
+ 'deleted': boolean;
1005
1177
  }
1006
1178
  /**
1007
1179
  *
@@ -1014,19 +1186,19 @@ export interface DeleteModelResponse {
1014
1186
  * @type {string}
1015
1187
  * @memberof DeleteModelResponse
1016
1188
  */
1017
- 'id'?: string;
1189
+ 'id': string;
1018
1190
  /**
1019
1191
  *
1020
1192
  * @type {string}
1021
1193
  * @memberof DeleteModelResponse
1022
1194
  */
1023
- 'object'?: string;
1195
+ 'object': string;
1024
1196
  /**
1025
1197
  *
1026
1198
  * @type {boolean}
1027
1199
  * @memberof DeleteModelResponse
1028
1200
  */
1029
- 'deleted'?: boolean;
1201
+ 'deleted': boolean;
1030
1202
  }
1031
1203
  /**
1032
1204
  *
@@ -1039,25 +1211,25 @@ export interface Engine {
1039
1211
  * @type {string}
1040
1212
  * @memberof Engine
1041
1213
  */
1042
- 'id'?: string;
1214
+ 'id': string;
1043
1215
  /**
1044
1216
  *
1045
1217
  * @type {string}
1046
1218
  * @memberof Engine
1047
1219
  */
1048
- 'object'?: string;
1220
+ 'object': string;
1049
1221
  /**
1050
1222
  *
1051
1223
  * @type {number}
1052
1224
  * @memberof Engine
1053
1225
  */
1054
- 'created'?: number;
1226
+ 'created': number | null;
1055
1227
  /**
1056
1228
  *
1057
1229
  * @type {boolean}
1058
1230
  * @memberof Engine
1059
1231
  */
1060
- 'ready'?: boolean;
1232
+ 'ready': boolean;
1061
1233
  }
1062
1234
  /**
1063
1235
  *
@@ -1070,73 +1242,73 @@ export interface FineTune {
1070
1242
  * @type {string}
1071
1243
  * @memberof FineTune
1072
1244
  */
1073
- 'id'?: string;
1245
+ 'id': string;
1074
1246
  /**
1075
1247
  *
1076
1248
  * @type {string}
1077
1249
  * @memberof FineTune
1078
1250
  */
1079
- 'object'?: string;
1251
+ 'object': string;
1080
1252
  /**
1081
1253
  *
1082
1254
  * @type {number}
1083
1255
  * @memberof FineTune
1084
1256
  */
1085
- 'created_at'?: number;
1257
+ 'created_at': number;
1086
1258
  /**
1087
1259
  *
1088
1260
  * @type {number}
1089
1261
  * @memberof FineTune
1090
1262
  */
1091
- 'updated_at'?: number;
1263
+ 'updated_at': number;
1092
1264
  /**
1093
1265
  *
1094
1266
  * @type {string}
1095
1267
  * @memberof FineTune
1096
1268
  */
1097
- 'model'?: string;
1269
+ 'model': string;
1098
1270
  /**
1099
1271
  *
1100
1272
  * @type {string}
1101
1273
  * @memberof FineTune
1102
1274
  */
1103
- 'fine_tuned_model'?: string | null;
1275
+ 'fine_tuned_model': string | null;
1104
1276
  /**
1105
1277
  *
1106
1278
  * @type {string}
1107
1279
  * @memberof FineTune
1108
1280
  */
1109
- 'organization_id'?: string;
1281
+ 'organization_id': string;
1110
1282
  /**
1111
1283
  *
1112
1284
  * @type {string}
1113
1285
  * @memberof FineTune
1114
1286
  */
1115
- 'status'?: string;
1287
+ 'status': string;
1116
1288
  /**
1117
1289
  *
1118
1290
  * @type {object}
1119
1291
  * @memberof FineTune
1120
1292
  */
1121
- 'hyperparams'?: object;
1293
+ 'hyperparams': object;
1122
1294
  /**
1123
1295
  *
1124
1296
  * @type {Array<OpenAIFile>}
1125
1297
  * @memberof FineTune
1126
1298
  */
1127
- 'training_files'?: Array<OpenAIFile>;
1299
+ 'training_files': Array<OpenAIFile>;
1128
1300
  /**
1129
1301
  *
1130
1302
  * @type {Array<OpenAIFile>}
1131
1303
  * @memberof FineTune
1132
1304
  */
1133
- 'validation_files'?: Array<OpenAIFile>;
1305
+ 'validation_files': Array<OpenAIFile>;
1134
1306
  /**
1135
1307
  *
1136
1308
  * @type {Array<OpenAIFile>}
1137
1309
  * @memberof FineTune
1138
1310
  */
1139
- 'result_files'?: Array<OpenAIFile>;
1311
+ 'result_files': Array<OpenAIFile>;
1140
1312
  /**
1141
1313
  *
1142
1314
  * @type {Array<FineTuneEvent>}
@@ -1155,25 +1327,25 @@ export interface FineTuneEvent {
1155
1327
  * @type {string}
1156
1328
  * @memberof FineTuneEvent
1157
1329
  */
1158
- 'object'?: string;
1330
+ 'object': string;
1159
1331
  /**
1160
1332
  *
1161
1333
  * @type {number}
1162
1334
  * @memberof FineTuneEvent
1163
1335
  */
1164
- 'created_at'?: number;
1336
+ 'created_at': number;
1165
1337
  /**
1166
1338
  *
1167
1339
  * @type {string}
1168
1340
  * @memberof FineTuneEvent
1169
1341
  */
1170
- 'level'?: string;
1342
+ 'level': string;
1171
1343
  /**
1172
1344
  *
1173
1345
  * @type {string}
1174
1346
  * @memberof FineTuneEvent
1175
1347
  */
1176
- 'message'?: string;
1348
+ 'message': string;
1177
1349
  }
1178
1350
  /**
1179
1351
  *
@@ -1186,13 +1358,13 @@ export interface ListEnginesResponse {
1186
1358
  * @type {string}
1187
1359
  * @memberof ListEnginesResponse
1188
1360
  */
1189
- 'object'?: string;
1361
+ 'object': string;
1190
1362
  /**
1191
1363
  *
1192
1364
  * @type {Array<Engine>}
1193
1365
  * @memberof ListEnginesResponse
1194
1366
  */
1195
- 'data'?: Array<Engine>;
1367
+ 'data': Array<Engine>;
1196
1368
  }
1197
1369
  /**
1198
1370
  *
@@ -1205,13 +1377,13 @@ export interface ListFilesResponse {
1205
1377
  * @type {string}
1206
1378
  * @memberof ListFilesResponse
1207
1379
  */
1208
- 'object'?: string;
1380
+ 'object': string;
1209
1381
  /**
1210
1382
  *
1211
1383
  * @type {Array<OpenAIFile>}
1212
1384
  * @memberof ListFilesResponse
1213
1385
  */
1214
- 'data'?: Array<OpenAIFile>;
1386
+ 'data': Array<OpenAIFile>;
1215
1387
  }
1216
1388
  /**
1217
1389
  *
@@ -1224,13 +1396,13 @@ export interface ListFineTuneEventsResponse {
1224
1396
  * @type {string}
1225
1397
  * @memberof ListFineTuneEventsResponse
1226
1398
  */
1227
- 'object'?: string;
1399
+ 'object': string;
1228
1400
  /**
1229
1401
  *
1230
1402
  * @type {Array<FineTuneEvent>}
1231
1403
  * @memberof ListFineTuneEventsResponse
1232
1404
  */
1233
- 'data'?: Array<FineTuneEvent>;
1405
+ 'data': Array<FineTuneEvent>;
1234
1406
  }
1235
1407
  /**
1236
1408
  *
@@ -1243,13 +1415,63 @@ export interface ListFineTunesResponse {
1243
1415
  * @type {string}
1244
1416
  * @memberof ListFineTunesResponse
1245
1417
  */
1246
- 'object'?: string;
1418
+ 'object': string;
1247
1419
  /**
1248
1420
  *
1249
1421
  * @type {Array<FineTune>}
1250
1422
  * @memberof ListFineTunesResponse
1251
1423
  */
1252
- 'data'?: Array<FineTune>;
1424
+ 'data': Array<FineTune>;
1425
+ }
1426
+ /**
1427
+ *
1428
+ * @export
1429
+ * @interface ListModelsResponse
1430
+ */
1431
+ export interface ListModelsResponse {
1432
+ /**
1433
+ *
1434
+ * @type {string}
1435
+ * @memberof ListModelsResponse
1436
+ */
1437
+ 'object': string;
1438
+ /**
1439
+ *
1440
+ * @type {Array<Model>}
1441
+ * @memberof ListModelsResponse
1442
+ */
1443
+ 'data': Array<Model>;
1444
+ }
1445
+ /**
1446
+ *
1447
+ * @export
1448
+ * @interface Model
1449
+ */
1450
+ export interface Model {
1451
+ /**
1452
+ *
1453
+ * @type {string}
1454
+ * @memberof Model
1455
+ */
1456
+ 'id': string;
1457
+ /**
1458
+ *
1459
+ * @type {string}
1460
+ * @memberof Model
1461
+ */
1462
+ 'object': string;
1463
+ /**
1464
+ *
1465
+ * @type {number}
1466
+ * @memberof Model
1467
+ */
1468
+ 'created': number;
1469
+ /**
1470
+ *
1471
+ * @type {string}
1472
+ * @memberof Model
1473
+ */
1474
+ 'owned_by': string;
1253
1475
  }
1254
1476
  /**
1255
1477
  *
@@ -1262,37 +1484,37 @@ export interface OpenAIFile {
1262
1484
  * @type {string}
1263
1485
  * @memberof OpenAIFile
1264
1486
  */
1265
- 'id'?: string;
1487
+ 'id': string;
1266
1488
  /**
1267
1489
  *
1268
1490
  * @type {string}
1269
1491
  * @memberof OpenAIFile
1270
1492
  */
1271
- 'object'?: string;
1493
+ 'object': string;
1272
1494
  /**
1273
1495
  *
1274
1496
  * @type {number}
1275
1497
  * @memberof OpenAIFile
1276
1498
  */
1277
- 'bytes'?: number;
1499
+ 'bytes': number;
1278
1500
  /**
1279
1501
  *
1280
1502
  * @type {number}
1281
1503
  * @memberof OpenAIFile
1282
1504
  */
1283
- 'created_at'?: number;
1505
+ 'created_at': number;
1284
1506
  /**
1285
1507
  *
1286
1508
  * @type {string}
1287
1509
  * @memberof OpenAIFile
1288
1510
  */
1289
- 'filename'?: string;
1511
+ 'filename': string;
1290
1512
  /**
1291
1513
  *
1292
1514
  * @type {string}
1293
1515
  * @memberof OpenAIFile
1294
1516
  */
1295
- 'purpose'?: string;
1517
+ 'purpose': string;
1296
1518
  /**
1297
1519
  *
1298
1520
  * @type {string}
@@ -1352,6 +1574,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1352
1574
  * @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).
1353
1575
  * @param {CreateAnswerRequest} createAnswerRequest
1354
1576
  * @param {*} [options] Override http request option.
1577
+ * @deprecated
1355
1578
  * @throws {RequiredError}
1356
1579
  */
1357
1580
  createAnswer: async (createAnswerRequest: CreateAnswerRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1388,6 +1611,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1388
1611
  * @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.
1389
1612
  * @param {CreateClassificationRequest} createClassificationRequest
1390
1613
  * @param {*} [options] Override http request option.
1614
+ * @deprecated
1391
1615
  * @throws {RequiredError}
1392
1616
  */
1393
1617
  createClassification: async (createClassificationRequest: CreateClassificationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1421,54 +1645,14 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1421
1645
  },
1422
1646
  /**
1423
1647
  *
1424
- * @summary Creates a new completion for the provided prompt and parameters
1425
- * @param {string} engineId The ID of the engine to use for this request
1648
+ * @summary Creates a completion for the provided prompt and parameters
1426
1649
  * @param {CreateCompletionRequest} createCompletionRequest
1427
1650
  * @param {*} [options] Override http request option.
1428
1651
  * @throws {RequiredError}
1429
1652
  */
1430
- createCompletion: async (engineId: string, createCompletionRequest: CreateCompletionRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1431
- // verify required parameter 'engineId' is not null or undefined
1432
- assertParamExists('createCompletion', 'engineId', engineId)
1653
+ createCompletion: async (createCompletionRequest: CreateCompletionRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1433
1654
  // verify required parameter 'createCompletionRequest' is not null or undefined
1434
1655
  assertParamExists('createCompletion', 'createCompletionRequest', createCompletionRequest)
1435
- const localVarPath = `/engines/{engine_id}/completions`
1436
- .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
1437
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1438
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1439
- let baseOptions;
1440
- if (configuration) {
1441
- baseOptions = configuration.baseOptions;
1442
- }
1443
-
1444
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1445
- const localVarHeaderParameter = {} as any;
1446
- const localVarQueryParameter = {} as any;
1447
-
1448
-
1449
-
1450
- localVarHeaderParameter['Content-Type'] = 'application/json';
1451
-
1452
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1453
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1454
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1455
- localVarRequestOptions.data = serializeDataIfNeeded(createCompletionRequest, localVarRequestOptions, configuration)
1456
-
1457
- return {
1458
- url: toPathString(localVarUrlObj),
1459
- options: localVarRequestOptions,
1460
- };
1461
- },
1462
- /**
1463
- *
1464
- * @summary Creates a completion using a fine-tuned model
1465
- * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
1466
- * @param {*} [options] Override http request option.
1467
- * @throws {RequiredError}
1468
- */
1469
- createCompletionFromModel: async (createCompletionFromModelRequest: CreateCompletionFromModelRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1470
- // verify required parameter 'createCompletionFromModelRequest' is not null or undefined
1471
- assertParamExists('createCompletionFromModel', 'createCompletionFromModelRequest', createCompletionFromModelRequest)
1472
1656
  const localVarPath = `/completions`;
1473
1657
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1474
1658
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -1488,7 +1672,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1488
1672
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1489
1673
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1490
1674
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1491
- localVarRequestOptions.data = serializeDataIfNeeded(createCompletionFromModelRequest, localVarRequestOptions, configuration)
1675
+ localVarRequestOptions.data = serializeDataIfNeeded(createCompletionRequest, localVarRequestOptions, configuration)
1492
1676
 
1493
1677
  return {
1494
1678
  url: toPathString(localVarUrlObj),
@@ -1498,18 +1682,14 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1498
1682
  /**
1499
1683
  *
1500
1684
  * @summary Creates a new edit for the provided input, instruction, and parameters
1501
- * @param {string} engineId The ID of the engine to use for this request
1502
1685
  * @param {CreateEditRequest} createEditRequest
1503
1686
  * @param {*} [options] Override http request option.
1504
1687
  * @throws {RequiredError}
1505
1688
  */
1506
- createEdit: async (engineId: string, createEditRequest: CreateEditRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1507
- // verify required parameter 'engineId' is not null or undefined
1508
- assertParamExists('createEdit', 'engineId', engineId)
1689
+ createEdit: async (createEditRequest: CreateEditRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1509
1690
  // verify required parameter 'createEditRequest' is not null or undefined
1510
1691
  assertParamExists('createEdit', 'createEditRequest', createEditRequest)
1511
- const localVarPath = `/engines/{engine_id}/edits`
1512
- .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
1692
+ const localVarPath = `/edits`;
1513
1693
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1514
1694
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1515
1695
  let baseOptions;
@@ -1537,19 +1717,15 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1537
1717
  },
1538
1718
  /**
1539
1719
  *
1540
- * @summary Creates an embedding vector representing the input text.
1541
- * @param {string} engineId The ID of the engine to use for this request
1720
+ * @summary Creates an embedding vector representing the input text.
1542
1721
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
1543
1722
  * @param {*} [options] Override http request option.
1544
1723
  * @throws {RequiredError}
1545
1724
  */
1546
- createEmbedding: async (engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1547
- // verify required parameter 'engineId' is not null or undefined
1548
- assertParamExists('createEmbedding', 'engineId', engineId)
1725
+ createEmbedding: async (createEmbeddingRequest: CreateEmbeddingRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1549
1726
  // verify required parameter 'createEmbeddingRequest' is not null or undefined
1550
1727
  assertParamExists('createEmbedding', 'createEmbeddingRequest', createEmbeddingRequest)
1551
- const localVarPath = `/engines/{engine_id}/embeddings`
1552
- .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
1728
+ const localVarPath = `/embeddings`;
1553
1729
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1554
1730
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1555
1731
  let baseOptions;
@@ -1578,12 +1754,12 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1578
1754
  /**
1579
1755
  *
1580
1756
  * @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.
1581
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;search\\\&quot; or \\\&quot;answers\\\&quot;, each line is a JSON record with a \\\&quot;text\\\&quot; field and an optional \\\&quot;metadata\\\&quot; field. Only \\\&quot;text\\\&quot; field will be used for search. Specially, when the &#x60;purpose&#x60; is \\\&quot;answers\\\&quot;, \\\&quot;\\\\n\\\&quot; is used as a delimiter to chunk contents in the \\\&quot;text\\\&quot; field into multiple documents for finer-grained matching. If the &#x60;purpose&#x60; is set to \\\&quot;classifications\\\&quot;, each line is a JSON record representing a single training example with \\\&quot;text\\\&quot; and \\\&quot;label\\\&quot; fields along with an optional \\\&quot;metadata\\\&quot; field. 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).
1582
- * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;search\\\&quot; for [Search](/docs/api-reference/searches), \\\&quot;answers\\\&quot; for [Answers](/docs/api-reference/answers), \\\&quot;classifications\\\&quot; for [Classifications](/docs/api-reference/classifications) and \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
1757
+ * @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).
1758
+ * @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.
1583
1759
  * @param {*} [options] Override http request option.
1584
1760
  * @throws {RequiredError}
1585
1761
  */
1586
- createFile: async (file: any, purpose: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1762
+ createFile: async (file: File, purpose: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1587
1763
  // verify required parameter 'file' is not null or undefined
1588
1764
  assertParamExists('createFile', 'file', file)
1589
1765
  // verify required parameter 'purpose' is not null or undefined
@@ -1659,12 +1835,49 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1659
1835
  options: localVarRequestOptions,
1660
1836
  };
1661
1837
  },
1838
+ /**
1839
+ *
1840
+ * @summary Classifies if text violates OpenAI\'s Content Policy
1841
+ * @param {CreateModerationRequest} createModerationRequest
1842
+ * @param {*} [options] Override http request option.
1843
+ * @throws {RequiredError}
1844
+ */
1845
+ createModeration: async (createModerationRequest: CreateModerationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1846
+ // verify required parameter 'createModerationRequest' is not null or undefined
1847
+ assertParamExists('createModeration', 'createModerationRequest', createModerationRequest)
1848
+ const localVarPath = `/moderations`;
1849
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1850
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1851
+ let baseOptions;
1852
+ if (configuration) {
1853
+ baseOptions = configuration.baseOptions;
1854
+ }
1855
+
1856
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1857
+ const localVarHeaderParameter = {} as any;
1858
+ const localVarQueryParameter = {} as any;
1859
+
1860
+
1861
+
1862
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1863
+
1864
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1865
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1866
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1867
+ localVarRequestOptions.data = serializeDataIfNeeded(createModerationRequest, localVarRequestOptions, configuration)
1868
+
1869
+ return {
1870
+ url: toPathString(localVarUrlObj),
1871
+ options: localVarRequestOptions,
1872
+ };
1873
+ },
1662
1874
  /**
1663
1875
  *
1664
1876
  * @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.
1665
1877
  * @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;.
1666
1878
  * @param {CreateSearchRequest} createSearchRequest
1667
1879
  * @param {*} [options] Override http request option.
1880
+ * @deprecated
1668
1881
  * @throws {RequiredError}
1669
1882
  */
1670
1883
  createSearch: async (engineId: string, createSearchRequest: CreateSearchRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1803,8 +2016,9 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1803
2016
  },
1804
2017
  /**
1805
2018
  *
1806
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
2019
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
1807
2020
  * @param {*} [options] Override http request option.
2021
+ * @deprecated
1808
2022
  * @throws {RequiredError}
1809
2023
  */
1810
2024
  listEngines: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1932,9 +2146,40 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1932
2146
  },
1933
2147
  /**
1934
2148
  *
1935
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
2149
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
2150
+ * @param {*} [options] Override http request option.
2151
+ * @throws {RequiredError}
2152
+ */
2153
+ listModels: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2154
+ const localVarPath = `/models`;
2155
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2156
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2157
+ let baseOptions;
2158
+ if (configuration) {
2159
+ baseOptions = configuration.baseOptions;
2160
+ }
2161
+
2162
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2163
+ const localVarHeaderParameter = {} as any;
2164
+ const localVarQueryParameter = {} as any;
2165
+
2166
+
2167
+
2168
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2169
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2170
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2171
+
2172
+ return {
2173
+ url: toPathString(localVarUrlObj),
2174
+ options: localVarRequestOptions,
2175
+ };
2176
+ },
2177
+ /**
2178
+ *
2179
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
1936
2180
  * @param {string} engineId The ID of the engine to use for this request
1937
2181
  * @param {*} [options] Override http request option.
2182
+ * @deprecated
1938
2183
  * @throws {RequiredError}
1939
2184
  */
1940
2185
  retrieveEngine: async (engineId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -2023,6 +2268,40 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
2023
2268
 
2024
2269
 
2025
2270
 
2271
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2272
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2273
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2274
+
2275
+ return {
2276
+ url: toPathString(localVarUrlObj),
2277
+ options: localVarRequestOptions,
2278
+ };
2279
+ },
2280
+ /**
2281
+ *
2282
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
2283
+ * @param {string} model The ID of the model to use for this request
2284
+ * @param {*} [options] Override http request option.
2285
+ * @throws {RequiredError}
2286
+ */
2287
+ retrieveModel: async (model: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2288
+ // verify required parameter 'model' is not null or undefined
2289
+ assertParamExists('retrieveModel', 'model', model)
2290
+ const localVarPath = `/models/{model}`
2291
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
2292
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2293
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2294
+ let baseOptions;
2295
+ if (configuration) {
2296
+ baseOptions = configuration.baseOptions;
2297
+ }
2298
+
2299
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2300
+ const localVarHeaderParameter = {} as any;
2301
+ const localVarQueryParameter = {} as any;
2302
+
2303
+
2304
+
2026
2305
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2027
2306
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2028
2307
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -2058,6 +2337,7 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2058
2337
  * @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).
2059
2338
  * @param {CreateAnswerRequest} createAnswerRequest
2060
2339
  * @param {*} [options] Override http request option.
2340
+ * @deprecated
2061
2341
  * @throws {RequiredError}
2062
2342
  */
2063
2343
  async createAnswer(createAnswerRequest: CreateAnswerRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateAnswerResponse>> {
@@ -2069,6 +2349,7 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2069
2349
  * @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.
2070
2350
  * @param {CreateClassificationRequest} createClassificationRequest
2071
2351
  * @param {*} [options] Override http request option.
2352
+ * @deprecated
2072
2353
  * @throws {RequiredError}
2073
2354
  */
2074
2355
  async createClassification(createClassificationRequest: CreateClassificationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateClassificationResponse>> {
@@ -2077,60 +2358,46 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2077
2358
  },
2078
2359
  /**
2079
2360
  *
2080
- * @summary Creates a new completion for the provided prompt and parameters
2081
- * @param {string} engineId The ID of the engine to use for this request
2361
+ * @summary Creates a completion for the provided prompt and parameters
2082
2362
  * @param {CreateCompletionRequest} createCompletionRequest
2083
2363
  * @param {*} [options] Override http request option.
2084
2364
  * @throws {RequiredError}
2085
2365
  */
2086
- async createCompletion(engineId: string, createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>> {
2087
- const localVarAxiosArgs = await localVarAxiosParamCreator.createCompletion(engineId, createCompletionRequest, options);
2088
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2089
- },
2090
- /**
2091
- *
2092
- * @summary Creates a completion using a fine-tuned model
2093
- * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
2094
- * @param {*} [options] Override http request option.
2095
- * @throws {RequiredError}
2096
- */
2097
- async createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>> {
2098
- const localVarAxiosArgs = await localVarAxiosParamCreator.createCompletionFromModel(createCompletionFromModelRequest, options);
2366
+ async createCompletion(createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>> {
2367
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createCompletion(createCompletionRequest, options);
2099
2368
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2100
2369
  },
2101
2370
  /**
2102
2371
  *
2103
2372
  * @summary Creates a new edit for the provided input, instruction, and parameters
2104
- * @param {string} engineId The ID of the engine to use for this request
2105
2373
  * @param {CreateEditRequest} createEditRequest
2106
2374
  * @param {*} [options] Override http request option.
2107
2375
  * @throws {RequiredError}
2108
2376
  */
2109
- async createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEditResponse>> {
2110
- const localVarAxiosArgs = await localVarAxiosParamCreator.createEdit(engineId, createEditRequest, options);
2377
+ async createEdit(createEditRequest: CreateEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEditResponse>> {
2378
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEdit(createEditRequest, options);
2111
2379
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2112
2380
  },
2113
2381
  /**
2114
2382
  *
2115
- * @summary Creates an embedding vector representing the input text.
2116
- * @param {string} engineId The ID of the engine to use for this request
2383
+ * @summary Creates an embedding vector representing the input text.
2117
2384
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
2118
2385
  * @param {*} [options] Override http request option.
2119
2386
  * @throws {RequiredError}
2120
2387
  */
2121
- async createEmbedding(engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEmbeddingResponse>> {
2122
- const localVarAxiosArgs = await localVarAxiosParamCreator.createEmbedding(engineId, createEmbeddingRequest, options);
2388
+ async createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEmbeddingResponse>> {
2389
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEmbedding(createEmbeddingRequest, options);
2123
2390
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2124
2391
  },
2125
2392
  /**
2126
2393
  *
2127
2394
  * @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.
2128
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;search\\\&quot; or \\\&quot;answers\\\&quot;, each line is a JSON record with a \\\&quot;text\\\&quot; field and an optional \\\&quot;metadata\\\&quot; field. Only \\\&quot;text\\\&quot; field will be used for search. Specially, when the &#x60;purpose&#x60; is \\\&quot;answers\\\&quot;, \\\&quot;\\\\n\\\&quot; is used as a delimiter to chunk contents in the \\\&quot;text\\\&quot; field into multiple documents for finer-grained matching. If the &#x60;purpose&#x60; is set to \\\&quot;classifications\\\&quot;, each line is a JSON record representing a single training example with \\\&quot;text\\\&quot; and \\\&quot;label\\\&quot; fields along with an optional \\\&quot;metadata\\\&quot; field. 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).
2129
- * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;search\\\&quot; for [Search](/docs/api-reference/searches), \\\&quot;answers\\\&quot; for [Answers](/docs/api-reference/answers), \\\&quot;classifications\\\&quot; for [Classifications](/docs/api-reference/classifications) and \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
2395
+ * @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).
2396
+ * @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.
2130
2397
  * @param {*} [options] Override http request option.
2131
2398
  * @throws {RequiredError}
2132
2399
  */
2133
- async createFile(file: any, purpose: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>> {
2400
+ async createFile(file: File, purpose: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>> {
2134
2401
  const localVarAxiosArgs = await localVarAxiosParamCreator.createFile(file, purpose, options);
2135
2402
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2136
2403
  },
@@ -2145,12 +2412,24 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2145
2412
  const localVarAxiosArgs = await localVarAxiosParamCreator.createFineTune(createFineTuneRequest, options);
2146
2413
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2147
2414
  },
2415
+ /**
2416
+ *
2417
+ * @summary Classifies if text violates OpenAI\'s Content Policy
2418
+ * @param {CreateModerationRequest} createModerationRequest
2419
+ * @param {*} [options] Override http request option.
2420
+ * @throws {RequiredError}
2421
+ */
2422
+ async createModeration(createModerationRequest: CreateModerationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateModerationResponse>> {
2423
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createModeration(createModerationRequest, options);
2424
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2425
+ },
2148
2426
  /**
2149
2427
  *
2150
2428
  * @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.
2151
2429
  * @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;.
2152
2430
  * @param {CreateSearchRequest} createSearchRequest
2153
2431
  * @param {*} [options] Override http request option.
2432
+ * @deprecated
2154
2433
  * @throws {RequiredError}
2155
2434
  */
2156
2435
  async createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateSearchResponse>> {
@@ -2192,8 +2471,9 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2192
2471
  },
2193
2472
  /**
2194
2473
  *
2195
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
2474
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
2196
2475
  * @param {*} [options] Override http request option.
2476
+ * @deprecated
2197
2477
  * @throws {RequiredError}
2198
2478
  */
2199
2479
  async listEngines(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListEnginesResponse>> {
@@ -2234,9 +2514,20 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2234
2514
  },
2235
2515
  /**
2236
2516
  *
2237
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
2517
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
2518
+ * @param {*} [options] Override http request option.
2519
+ * @throws {RequiredError}
2520
+ */
2521
+ async listModels(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListModelsResponse>> {
2522
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listModels(options);
2523
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2524
+ },
2525
+ /**
2526
+ *
2527
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
2238
2528
  * @param {string} engineId The ID of the engine to use for this request
2239
2529
  * @param {*} [options] Override http request option.
2530
+ * @deprecated
2240
2531
  * @throws {RequiredError}
2241
2532
  */
2242
2533
  async retrieveEngine(engineId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Engine>> {
@@ -2265,6 +2556,17 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2265
2556
  const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFineTune(fineTuneId, options);
2266
2557
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2267
2558
  },
2559
+ /**
2560
+ *
2561
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
2562
+ * @param {string} model The ID of the model to use for this request
2563
+ * @param {*} [options] Override http request option.
2564
+ * @throws {RequiredError}
2565
+ */
2566
+ async retrieveModel(model: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Model>> {
2567
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveModel(model, options);
2568
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2569
+ },
2268
2570
  }
2269
2571
  };
2270
2572
 
@@ -2290,6 +2592,7 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2290
2592
  * @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).
2291
2593
  * @param {CreateAnswerRequest} createAnswerRequest
2292
2594
  * @param {*} [options] Override http request option.
2595
+ * @deprecated
2293
2596
  * @throws {RequiredError}
2294
2597
  */
2295
2598
  createAnswer(createAnswerRequest: CreateAnswerRequest, options?: any): AxiosPromise<CreateAnswerResponse> {
@@ -2300,6 +2603,7 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2300
2603
  * @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.
2301
2604
  * @param {CreateClassificationRequest} createClassificationRequest
2302
2605
  * @param {*} [options] Override http request option.
2606
+ * @deprecated
2303
2607
  * @throws {RequiredError}
2304
2608
  */
2305
2609
  createClassification(createClassificationRequest: CreateClassificationRequest, options?: any): AxiosPromise<CreateClassificationResponse> {
@@ -2307,56 +2611,43 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2307
2611
  },
2308
2612
  /**
2309
2613
  *
2310
- * @summary Creates a new completion for the provided prompt and parameters
2311
- * @param {string} engineId The ID of the engine to use for this request
2614
+ * @summary Creates a completion for the provided prompt and parameters
2312
2615
  * @param {CreateCompletionRequest} createCompletionRequest
2313
2616
  * @param {*} [options] Override http request option.
2314
2617
  * @throws {RequiredError}
2315
2618
  */
2316
- createCompletion(engineId: string, createCompletionRequest: CreateCompletionRequest, options?: any): AxiosPromise<CreateCompletionResponse> {
2317
- return localVarFp.createCompletion(engineId, createCompletionRequest, options).then((request) => request(axios, basePath));
2318
- },
2319
- /**
2320
- *
2321
- * @summary Creates a completion using a fine-tuned model
2322
- * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
2323
- * @param {*} [options] Override http request option.
2324
- * @throws {RequiredError}
2325
- */
2326
- createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: any): AxiosPromise<CreateCompletionResponse> {
2327
- return localVarFp.createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(axios, basePath));
2619
+ createCompletion(createCompletionRequest: CreateCompletionRequest, options?: any): AxiosPromise<CreateCompletionResponse> {
2620
+ return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios, basePath));
2328
2621
  },
2329
2622
  /**
2330
2623
  *
2331
2624
  * @summary Creates a new edit for the provided input, instruction, and parameters
2332
- * @param {string} engineId The ID of the engine to use for this request
2333
2625
  * @param {CreateEditRequest} createEditRequest
2334
2626
  * @param {*} [options] Override http request option.
2335
2627
  * @throws {RequiredError}
2336
2628
  */
2337
- createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: any): AxiosPromise<CreateEditResponse> {
2338
- return localVarFp.createEdit(engineId, createEditRequest, options).then((request) => request(axios, basePath));
2629
+ createEdit(createEditRequest: CreateEditRequest, options?: any): AxiosPromise<CreateEditResponse> {
2630
+ return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios, basePath));
2339
2631
  },
2340
2632
  /**
2341
2633
  *
2342
- * @summary Creates an embedding vector representing the input text.
2343
- * @param {string} engineId The ID of the engine to use for this request
2634
+ * @summary Creates an embedding vector representing the input text.
2344
2635
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
2345
2636
  * @param {*} [options] Override http request option.
2346
2637
  * @throws {RequiredError}
2347
2638
  */
2348
- createEmbedding(engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: any): AxiosPromise<CreateEmbeddingResponse> {
2349
- return localVarFp.createEmbedding(engineId, createEmbeddingRequest, options).then((request) => request(axios, basePath));
2639
+ createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: any): AxiosPromise<CreateEmbeddingResponse> {
2640
+ return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios, basePath));
2350
2641
  },
2351
2642
  /**
2352
2643
  *
2353
2644
  * @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.
2354
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;search\\\&quot; or \\\&quot;answers\\\&quot;, each line is a JSON record with a \\\&quot;text\\\&quot; field and an optional \\\&quot;metadata\\\&quot; field. Only \\\&quot;text\\\&quot; field will be used for search. Specially, when the &#x60;purpose&#x60; is \\\&quot;answers\\\&quot;, \\\&quot;\\\\n\\\&quot; is used as a delimiter to chunk contents in the \\\&quot;text\\\&quot; field into multiple documents for finer-grained matching. If the &#x60;purpose&#x60; is set to \\\&quot;classifications\\\&quot;, each line is a JSON record representing a single training example with \\\&quot;text\\\&quot; and \\\&quot;label\\\&quot; fields along with an optional \\\&quot;metadata\\\&quot; field. 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).
2355
- * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;search\\\&quot; for [Search](/docs/api-reference/searches), \\\&quot;answers\\\&quot; for [Answers](/docs/api-reference/answers), \\\&quot;classifications\\\&quot; for [Classifications](/docs/api-reference/classifications) and \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
2645
+ * @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).
2646
+ * @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.
2356
2647
  * @param {*} [options] Override http request option.
2357
2648
  * @throws {RequiredError}
2358
2649
  */
2359
- createFile(file: any, purpose: string, options?: any): AxiosPromise<OpenAIFile> {
2650
+ createFile(file: File, purpose: string, options?: any): AxiosPromise<OpenAIFile> {
2360
2651
  return localVarFp.createFile(file, purpose, options).then((request) => request(axios, basePath));
2361
2652
  },
2362
2653
  /**
@@ -2369,12 +2660,23 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2369
2660
  createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: any): AxiosPromise<FineTune> {
2370
2661
  return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios, basePath));
2371
2662
  },
2663
+ /**
2664
+ *
2665
+ * @summary Classifies if text violates OpenAI\'s Content Policy
2666
+ * @param {CreateModerationRequest} createModerationRequest
2667
+ * @param {*} [options] Override http request option.
2668
+ * @throws {RequiredError}
2669
+ */
2670
+ createModeration(createModerationRequest: CreateModerationRequest, options?: any): AxiosPromise<CreateModerationResponse> {
2671
+ return localVarFp.createModeration(createModerationRequest, options).then((request) => request(axios, basePath));
2672
+ },
2372
2673
  /**
2373
2674
  *
2374
2675
  * @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.
2375
2676
  * @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;.
2376
2677
  * @param {CreateSearchRequest} createSearchRequest
2377
2678
  * @param {*} [options] Override http request option.
2679
+ * @deprecated
2378
2680
  * @throws {RequiredError}
2379
2681
  */
2380
2682
  createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: any): AxiosPromise<CreateSearchResponse> {
@@ -2412,8 +2714,9 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2412
2714
  },
2413
2715
  /**
2414
2716
  *
2415
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
2717
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
2416
2718
  * @param {*} [options] Override http request option.
2719
+ * @deprecated
2417
2720
  * @throws {RequiredError}
2418
2721
  */
2419
2722
  listEngines(options?: any): AxiosPromise<ListEnginesResponse> {
@@ -2450,9 +2753,19 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2450
2753
  },
2451
2754
  /**
2452
2755
  *
2453
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
2756
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
2757
+ * @param {*} [options] Override http request option.
2758
+ * @throws {RequiredError}
2759
+ */
2760
+ listModels(options?: any): AxiosPromise<ListModelsResponse> {
2761
+ return localVarFp.listModels(options).then((request) => request(axios, basePath));
2762
+ },
2763
+ /**
2764
+ *
2765
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
2454
2766
  * @param {string} engineId The ID of the engine to use for this request
2455
2767
  * @param {*} [options] Override http request option.
2768
+ * @deprecated
2456
2769
  * @throws {RequiredError}
2457
2770
  */
2458
2771
  retrieveEngine(engineId: string, options?: any): AxiosPromise<Engine> {
@@ -2478,6 +2791,16 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2478
2791
  retrieveFineTune(fineTuneId: string, options?: any): AxiosPromise<FineTune> {
2479
2792
  return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios, basePath));
2480
2793
  },
2794
+ /**
2795
+ *
2796
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
2797
+ * @param {string} model The ID of the model to use for this request
2798
+ * @param {*} [options] Override http request option.
2799
+ * @throws {RequiredError}
2800
+ */
2801
+ retrieveModel(model: string, options?: any): AxiosPromise<Model> {
2802
+ return localVarFp.retrieveModel(model, options).then((request) => request(axios, basePath));
2803
+ },
2481
2804
  };
2482
2805
  };
2483
2806
 
@@ -2505,6 +2828,7 @@ export class OpenAIApi extends BaseAPI {
2505
2828
  * @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).
2506
2829
  * @param {CreateAnswerRequest} createAnswerRequest
2507
2830
  * @param {*} [options] Override http request option.
2831
+ * @deprecated
2508
2832
  * @throws {RequiredError}
2509
2833
  * @memberof OpenAIApi
2510
2834
  */
@@ -2517,6 +2841,7 @@ export class OpenAIApi extends BaseAPI {
2517
2841
  * @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.
2518
2842
  * @param {CreateClassificationRequest} createClassificationRequest
2519
2843
  * @param {*} [options] Override http request option.
2844
+ * @deprecated
2520
2845
  * @throws {RequiredError}
2521
2846
  * @memberof OpenAIApi
2522
2847
  */
@@ -2526,65 +2851,50 @@ export class OpenAIApi extends BaseAPI {
2526
2851
 
2527
2852
  /**
2528
2853
  *
2529
- * @summary Creates a new completion for the provided prompt and parameters
2530
- * @param {string} engineId The ID of the engine to use for this request
2854
+ * @summary Creates a completion for the provided prompt and parameters
2531
2855
  * @param {CreateCompletionRequest} createCompletionRequest
2532
2856
  * @param {*} [options] Override http request option.
2533
2857
  * @throws {RequiredError}
2534
2858
  * @memberof OpenAIApi
2535
2859
  */
2536
- public createCompletion(engineId: string, createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig) {
2537
- return OpenAIApiFp(this.configuration).createCompletion(engineId, createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
2538
- }
2539
-
2540
- /**
2541
- *
2542
- * @summary Creates a completion using a fine-tuned model
2543
- * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
2544
- * @param {*} [options] Override http request option.
2545
- * @throws {RequiredError}
2546
- * @memberof OpenAIApi
2547
- */
2548
- public createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig) {
2549
- return OpenAIApiFp(this.configuration).createCompletionFromModel(createCompletionFromModelRequest, options).then((request) => request(this.axios, this.basePath));
2860
+ public createCompletion(createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig) {
2861
+ return OpenAIApiFp(this.configuration).createCompletion(createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
2550
2862
  }
2551
2863
 
2552
2864
  /**
2553
2865
  *
2554
2866
  * @summary Creates a new edit for the provided input, instruction, and parameters
2555
- * @param {string} engineId The ID of the engine to use for this request
2556
2867
  * @param {CreateEditRequest} createEditRequest
2557
2868
  * @param {*} [options] Override http request option.
2558
2869
  * @throws {RequiredError}
2559
2870
  * @memberof OpenAIApi
2560
2871
  */
2561
- public createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: AxiosRequestConfig) {
2562
- return OpenAIApiFp(this.configuration).createEdit(engineId, createEditRequest, options).then((request) => request(this.axios, this.basePath));
2872
+ public createEdit(createEditRequest: CreateEditRequest, options?: AxiosRequestConfig) {
2873
+ return OpenAIApiFp(this.configuration).createEdit(createEditRequest, options).then((request) => request(this.axios, this.basePath));
2563
2874
  }
2564
2875
 
2565
2876
  /**
2566
2877
  *
2567
- * @summary Creates an embedding vector representing the input text.
2568
- * @param {string} engineId The ID of the engine to use for this request
2878
+ * @summary Creates an embedding vector representing the input text.
2569
2879
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
2570
2880
  * @param {*} [options] Override http request option.
2571
2881
  * @throws {RequiredError}
2572
2882
  * @memberof OpenAIApi
2573
2883
  */
2574
- public createEmbedding(engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig) {
2575
- return OpenAIApiFp(this.configuration).createEmbedding(engineId, createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
2884
+ public createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig) {
2885
+ return OpenAIApiFp(this.configuration).createEmbedding(createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
2576
2886
  }
2577
2887
 
2578
2888
  /**
2579
2889
  *
2580
2890
  * @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.
2581
- * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;search\\\&quot; or \\\&quot;answers\\\&quot;, each line is a JSON record with a \\\&quot;text\\\&quot; field and an optional \\\&quot;metadata\\\&quot; field. Only \\\&quot;text\\\&quot; field will be used for search. Specially, when the &#x60;purpose&#x60; is \\\&quot;answers\\\&quot;, \\\&quot;\\\\n\\\&quot; is used as a delimiter to chunk contents in the \\\&quot;text\\\&quot; field into multiple documents for finer-grained matching. If the &#x60;purpose&#x60; is set to \\\&quot;classifications\\\&quot;, each line is a JSON record representing a single training example with \\\&quot;text\\\&quot; and \\\&quot;label\\\&quot; fields along with an optional \\\&quot;metadata\\\&quot; field. 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).
2582
- * @param {string} purpose The intended purpose of the uploaded documents. Use \\\&quot;search\\\&quot; for [Search](/docs/api-reference/searches), \\\&quot;answers\\\&quot; for [Answers](/docs/api-reference/answers), \\\&quot;classifications\\\&quot; for [Classifications](/docs/api-reference/classifications) and \\\&quot;fine-tune\\\&quot; for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file.
2891
+ * @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).
2892
+ * @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.
2583
2893
  * @param {*} [options] Override http request option.
2584
2894
  * @throws {RequiredError}
2585
2895
  * @memberof OpenAIApi
2586
2896
  */
2587
- public createFile(file: any, purpose: string, options?: AxiosRequestConfig) {
2897
+ public createFile(file: File, purpose: string, options?: AxiosRequestConfig) {
2588
2898
  return OpenAIApiFp(this.configuration).createFile(file, purpose, options).then((request) => request(this.axios, this.basePath));
2589
2899
  }
2590
2900
 
@@ -2600,12 +2910,25 @@ export class OpenAIApi extends BaseAPI {
2600
2910
  return OpenAIApiFp(this.configuration).createFineTune(createFineTuneRequest, options).then((request) => request(this.axios, this.basePath));
2601
2911
  }
2602
2912
 
2913
+ /**
2914
+ *
2915
+ * @summary Classifies if text violates OpenAI\'s Content Policy
2916
+ * @param {CreateModerationRequest} createModerationRequest
2917
+ * @param {*} [options] Override http request option.
2918
+ * @throws {RequiredError}
2919
+ * @memberof OpenAIApi
2920
+ */
2921
+ public createModeration(createModerationRequest: CreateModerationRequest, options?: AxiosRequestConfig) {
2922
+ return OpenAIApiFp(this.configuration).createModeration(createModerationRequest, options).then((request) => request(this.axios, this.basePath));
2923
+ }
2924
+
2603
2925
  /**
2604
2926
  *
2605
2927
  * @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.
2606
2928
  * @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;.
2607
2929
  * @param {CreateSearchRequest} createSearchRequest
2608
2930
  * @param {*} [options] Override http request option.
2931
+ * @deprecated
2609
2932
  * @throws {RequiredError}
2610
2933
  * @memberof OpenAIApi
2611
2934
  */
@@ -2651,8 +2974,9 @@ export class OpenAIApi extends BaseAPI {
2651
2974
 
2652
2975
  /**
2653
2976
  *
2654
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
2977
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
2655
2978
  * @param {*} [options] Override http request option.
2979
+ * @deprecated
2656
2980
  * @throws {RequiredError}
2657
2981
  * @memberof OpenAIApi
2658
2982
  */
@@ -2697,9 +3021,21 @@ export class OpenAIApi extends BaseAPI {
2697
3021
 
2698
3022
  /**
2699
3023
  *
2700
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
3024
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
3025
+ * @param {*} [options] Override http request option.
3026
+ * @throws {RequiredError}
3027
+ * @memberof OpenAIApi
3028
+ */
3029
+ public listModels(options?: AxiosRequestConfig) {
3030
+ return OpenAIApiFp(this.configuration).listModels(options).then((request) => request(this.axios, this.basePath));
3031
+ }
3032
+
3033
+ /**
3034
+ *
3035
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
2701
3036
  * @param {string} engineId The ID of the engine to use for this request
2702
3037
  * @param {*} [options] Override http request option.
3038
+ * @deprecated
2703
3039
  * @throws {RequiredError}
2704
3040
  * @memberof OpenAIApi
2705
3041
  */
@@ -2730,6 +3066,18 @@ export class OpenAIApi extends BaseAPI {
2730
3066
  public retrieveFineTune(fineTuneId: string, options?: AxiosRequestConfig) {
2731
3067
  return OpenAIApiFp(this.configuration).retrieveFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
2732
3068
  }
3069
+
3070
+ /**
3071
+ *
3072
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
3073
+ * @param {string} model The ID of the model to use for this request
3074
+ * @param {*} [options] Override http request option.
3075
+ * @throws {RequiredError}
3076
+ * @memberof OpenAIApi
3077
+ */
3078
+ public retrieveModel(model: string, options?: AxiosRequestConfig) {
3079
+ return OpenAIApiFp(this.configuration).retrieveModel(model, options).then((request) => request(this.axios, this.basePath));
3080
+ }
2733
3081
  }
2734
3082
 
2735
3083