openai 2.0.5 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * OpenAI API
5
5
  * APIs for sampling from and fine-tuning language models
6
6
  *
7
- * The version of the OpenAPI document: 1.0.4
7
+ * The version of the OpenAPI document: 1.0.5
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
  */
@@ -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
  */
@@ -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}
@@ -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
@@ -602,70 +513,70 @@ export interface CreateCompletionResponse {
602
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>;
609
520
  }
610
521
  /**
611
522
  *
612
523
  * @export
613
- * @interface CreateCompletionResponseChoices
524
+ * @interface CreateCompletionResponseChoicesInner
614
525
  */
615
- export interface CreateCompletionResponseChoices {
526
+ export interface CreateCompletionResponseChoicesInner {
616
527
  /**
617
528
  *
618
529
  * @type {string}
619
- * @memberof CreateCompletionResponseChoices
530
+ * @memberof CreateCompletionResponseChoicesInner
620
531
  */
621
532
  'text'?: string;
622
533
  /**
623
534
  *
624
535
  * @type {number}
625
- * @memberof CreateCompletionResponseChoices
536
+ * @memberof CreateCompletionResponseChoicesInner
626
537
  */
627
538
  'index'?: number;
628
539
  /**
629
540
  *
630
- * @type {CreateCompletionResponseLogprobs}
631
- * @memberof CreateCompletionResponseChoices
541
+ * @type {CreateCompletionResponseChoicesInnerLogprobs}
542
+ * @memberof CreateCompletionResponseChoicesInner
632
543
  */
633
- 'logprobs'?: CreateCompletionResponseLogprobs | null;
544
+ 'logprobs'?: CreateCompletionResponseChoicesInnerLogprobs | null;
634
545
  /**
635
546
  *
636
547
  * @type {string}
637
- * @memberof CreateCompletionResponseChoices
548
+ * @memberof CreateCompletionResponseChoicesInner
638
549
  */
639
550
  'finish_reason'?: string;
640
551
  }
641
552
  /**
642
553
  *
643
554
  * @export
644
- * @interface CreateCompletionResponseLogprobs
555
+ * @interface CreateCompletionResponseChoicesInnerLogprobs
645
556
  */
646
- export interface CreateCompletionResponseLogprobs {
557
+ export interface CreateCompletionResponseChoicesInnerLogprobs {
647
558
  /**
648
559
  *
649
560
  * @type {Array<string>}
650
- * @memberof CreateCompletionResponseLogprobs
561
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
651
562
  */
652
563
  'tokens'?: Array<string>;
653
564
  /**
654
565
  *
655
566
  * @type {Array<number>}
656
- * @memberof CreateCompletionResponseLogprobs
567
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
657
568
  */
658
569
  'token_logprobs'?: Array<number>;
659
570
  /**
660
571
  *
661
572
  * @type {Array<object>}
662
- * @memberof CreateCompletionResponseLogprobs
573
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
663
574
  */
664
575
  'top_logprobs'?: Array<object>;
665
576
  /**
666
577
  *
667
578
  * @type {Array<number>}
668
- * @memberof CreateCompletionResponseLogprobs
579
+ * @memberof CreateCompletionResponseChoicesInnerLogprobs
669
580
  */
670
581
  'text_offset'?: Array<number>;
671
582
  }
@@ -675,6 +586,12 @@ export interface CreateCompletionResponseLogprobs {
675
586
  * @interface CreateEditRequest
676
587
  */
677
588
  export interface CreateEditRequest {
589
+ /**
590
+ * 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.
591
+ * @type {string}
592
+ * @memberof CreateEditRequest
593
+ */
594
+ 'model': string;
678
595
  /**
679
596
  * The input text to use as a starting point for the edit.
680
597
  * @type {string}
@@ -687,6 +604,12 @@ export interface CreateEditRequest {
687
604
  * @memberof CreateEditRequest
688
605
  */
689
606
  'instruction': string;
607
+ /**
608
+ * How many edits to generate for the input and instruction.
609
+ * @type {number}
610
+ * @memberof CreateEditRequest
611
+ */
612
+ 'n'?: number | null;
690
613
  /**
691
614
  * 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
615
  * @type {number}
@@ -732,10 +655,10 @@ export interface CreateEditResponse {
732
655
  'model'?: string;
733
656
  /**
734
657
  *
735
- * @type {Array<CreateCompletionResponseChoices>}
658
+ * @type {Array<CreateCompletionResponseChoicesInner>}
736
659
  * @memberof CreateEditResponse
737
660
  */
738
- 'choices'?: Array<CreateCompletionResponseChoices>;
661
+ 'choices'?: Array<CreateCompletionResponseChoicesInner>;
739
662
  }
740
663
  /**
741
664
  *
@@ -744,11 +667,17 @@ export interface CreateEditResponse {
744
667
  */
745
668
  export interface CreateEmbeddingRequest {
746
669
  /**
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>}
670
+ * 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.
671
+ * @type {string}
672
+ * @memberof CreateEmbeddingRequest
673
+ */
674
+ 'model': string;
675
+ /**
676
+ *
677
+ * @type {CreateEmbeddingRequestInput}
749
678
  * @memberof CreateEmbeddingRequest
750
679
  */
751
- 'input': string | Array<string> | Array<number> | Array<any>;
680
+ 'input': CreateEmbeddingRequestInput;
752
681
  /**
753
682
  * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
754
683
  * @type {string}
@@ -756,6 +685,13 @@ export interface CreateEmbeddingRequest {
756
685
  */
757
686
  'user'?: string;
758
687
  }
688
+ /**
689
+ * @type CreateEmbeddingRequestInput
690
+ * Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 2048 tokens in length. Unless your are embedding code, we suggest replacing newlines (`\\n`) in your input with a single space, as we have observed inferior results when newlines are present.
691
+ * @export
692
+ */
693
+ export type CreateEmbeddingRequestInput = Array<any> | Array<number> | Array<string> | string;
694
+
759
695
  /**
760
696
  *
761
697
  * @export
@@ -776,33 +712,33 @@ export interface CreateEmbeddingResponse {
776
712
  'model'?: string;
777
713
  /**
778
714
  *
779
- * @type {Array<CreateEmbeddingResponseData>}
715
+ * @type {Array<CreateEmbeddingResponseDataInner>}
780
716
  * @memberof CreateEmbeddingResponse
781
717
  */
782
- 'data'?: Array<CreateEmbeddingResponseData>;
718
+ 'data'?: Array<CreateEmbeddingResponseDataInner>;
783
719
  }
784
720
  /**
785
721
  *
786
722
  * @export
787
- * @interface CreateEmbeddingResponseData
723
+ * @interface CreateEmbeddingResponseDataInner
788
724
  */
789
- export interface CreateEmbeddingResponseData {
725
+ export interface CreateEmbeddingResponseDataInner {
790
726
  /**
791
727
  *
792
728
  * @type {number}
793
- * @memberof CreateEmbeddingResponseData
729
+ * @memberof CreateEmbeddingResponseDataInner
794
730
  */
795
731
  'index'?: number;
796
732
  /**
797
733
  *
798
734
  * @type {string}
799
- * @memberof CreateEmbeddingResponseData
735
+ * @memberof CreateEmbeddingResponseDataInner
800
736
  */
801
737
  'object'?: string;
802
738
  /**
803
739
  *
804
740
  * @type {Array<number>}
805
- * @memberof CreateEmbeddingResponseData
741
+ * @memberof CreateEmbeddingResponseDataInner
806
742
  */
807
743
  'embedding'?: Array<number>;
808
744
  }
@@ -825,7 +761,7 @@ export interface CreateFineTuneRequest {
825
761
  */
826
762
  'validation_file'?: string | null;
827
763
  /**
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.
764
+ * The name of the base model to fine-tune. You can select one of \"ada\", \"babbage\", \"curie\", or \"davinci\". To learn more about these models, see the [Models](https://beta.openai.com/docs/models) documentation.
829
765
  * @type {string}
830
766
  * @memberof CreateFineTuneRequest
831
767
  */
@@ -948,33 +884,33 @@ export interface CreateSearchResponse {
948
884
  'model'?: string;
949
885
  /**
950
886
  *
951
- * @type {Array<CreateSearchResponseData>}
887
+ * @type {Array<CreateSearchResponseDataInner>}
952
888
  * @memberof CreateSearchResponse
953
889
  */
954
- 'data'?: Array<CreateSearchResponseData>;
890
+ 'data'?: Array<CreateSearchResponseDataInner>;
955
891
  }
956
892
  /**
957
893
  *
958
894
  * @export
959
- * @interface CreateSearchResponseData
895
+ * @interface CreateSearchResponseDataInner
960
896
  */
961
- export interface CreateSearchResponseData {
897
+ export interface CreateSearchResponseDataInner {
962
898
  /**
963
899
  *
964
900
  * @type {string}
965
- * @memberof CreateSearchResponseData
901
+ * @memberof CreateSearchResponseDataInner
966
902
  */
967
903
  'object'?: string;
968
904
  /**
969
905
  *
970
906
  * @type {number}
971
- * @memberof CreateSearchResponseData
907
+ * @memberof CreateSearchResponseDataInner
972
908
  */
973
909
  'document'?: number;
974
910
  /**
975
911
  *
976
912
  * @type {number}
977
- * @memberof CreateSearchResponseData
913
+ * @memberof CreateSearchResponseDataInner
978
914
  */
979
915
  'score'?: number;
980
916
  }
@@ -1251,6 +1187,56 @@ export interface ListFineTunesResponse {
1251
1187
  */
1252
1188
  'data'?: Array<FineTune>;
1253
1189
  }
1190
+ /**
1191
+ *
1192
+ * @export
1193
+ * @interface ListModelsResponse
1194
+ */
1195
+ export interface ListModelsResponse {
1196
+ /**
1197
+ *
1198
+ * @type {string}
1199
+ * @memberof ListModelsResponse
1200
+ */
1201
+ 'object'?: string;
1202
+ /**
1203
+ *
1204
+ * @type {Array<Model>}
1205
+ * @memberof ListModelsResponse
1206
+ */
1207
+ 'data'?: Array<Model>;
1208
+ }
1209
+ /**
1210
+ *
1211
+ * @export
1212
+ * @interface Model
1213
+ */
1214
+ export interface Model {
1215
+ /**
1216
+ *
1217
+ * @type {string}
1218
+ * @memberof Model
1219
+ */
1220
+ 'id'?: string;
1221
+ /**
1222
+ *
1223
+ * @type {string}
1224
+ * @memberof Model
1225
+ */
1226
+ 'object'?: string;
1227
+ /**
1228
+ *
1229
+ * @type {number}
1230
+ * @memberof Model
1231
+ */
1232
+ 'created'?: number;
1233
+ /**
1234
+ *
1235
+ * @type {string}
1236
+ * @memberof Model
1237
+ */
1238
+ 'owned_by'?: string;
1239
+ }
1254
1240
  /**
1255
1241
  *
1256
1242
  * @export
@@ -1352,6 +1338,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1352
1338
  * @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
1339
  * @param {CreateAnswerRequest} createAnswerRequest
1354
1340
  * @param {*} [options] Override http request option.
1341
+ * @deprecated
1355
1342
  * @throws {RequiredError}
1356
1343
  */
1357
1344
  createAnswer: async (createAnswerRequest: CreateAnswerRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1388,6 +1375,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1388
1375
  * @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
1376
  * @param {CreateClassificationRequest} createClassificationRequest
1390
1377
  * @param {*} [options] Override http request option.
1378
+ * @deprecated
1391
1379
  * @throws {RequiredError}
1392
1380
  */
1393
1381
  createClassification: async (createClassificationRequest: CreateClassificationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1421,54 +1409,14 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1421
1409
  },
1422
1410
  /**
1423
1411
  *
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
1412
+ * @summary Creates a completion for the provided prompt and parameters
1426
1413
  * @param {CreateCompletionRequest} createCompletionRequest
1427
1414
  * @param {*} [options] Override http request option.
1428
1415
  * @throws {RequiredError}
1429
1416
  */
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)
1417
+ createCompletion: async (createCompletionRequest: CreateCompletionRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1433
1418
  // verify required parameter 'createCompletionRequest' is not null or undefined
1434
1419
  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
1420
  const localVarPath = `/completions`;
1473
1421
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1474
1422
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -1488,7 +1436,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1488
1436
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1489
1437
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1490
1438
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1491
- localVarRequestOptions.data = serializeDataIfNeeded(createCompletionFromModelRequest, localVarRequestOptions, configuration)
1439
+ localVarRequestOptions.data = serializeDataIfNeeded(createCompletionRequest, localVarRequestOptions, configuration)
1492
1440
 
1493
1441
  return {
1494
1442
  url: toPathString(localVarUrlObj),
@@ -1498,18 +1446,14 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1498
1446
  /**
1499
1447
  *
1500
1448
  * @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
1449
  * @param {CreateEditRequest} createEditRequest
1503
1450
  * @param {*} [options] Override http request option.
1504
1451
  * @throws {RequiredError}
1505
1452
  */
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)
1453
+ createEdit: async (createEditRequest: CreateEditRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1509
1454
  // verify required parameter 'createEditRequest' is not null or undefined
1510
1455
  assertParamExists('createEdit', 'createEditRequest', createEditRequest)
1511
- const localVarPath = `/engines/{engine_id}/edits`
1512
- .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
1456
+ const localVarPath = `/edits`;
1513
1457
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1514
1458
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1515
1459
  let baseOptions;
@@ -1537,19 +1481,15 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1537
1481
  },
1538
1482
  /**
1539
1483
  *
1540
- * @summary Creates an embedding vector representing the input text.
1541
- * @param {string} engineId The ID of the engine to use for this request
1484
+ * @summary Creates an embedding vector representing the input text.
1542
1485
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
1543
1486
  * @param {*} [options] Override http request option.
1544
1487
  * @throws {RequiredError}
1545
1488
  */
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)
1489
+ createEmbedding: async (createEmbeddingRequest: CreateEmbeddingRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1549
1490
  // verify required parameter 'createEmbeddingRequest' is not null or undefined
1550
1491
  assertParamExists('createEmbedding', 'createEmbeddingRequest', createEmbeddingRequest)
1551
- const localVarPath = `/engines/{engine_id}/embeddings`
1552
- .replace(`{${"engine_id"}}`, encodeURIComponent(String(engineId)));
1492
+ const localVarPath = `/embeddings`;
1553
1493
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1554
1494
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1555
1495
  let baseOptions;
@@ -1578,8 +1518,8 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1578
1518
  /**
1579
1519
  *
1580
1520
  * @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.
1521
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
1522
+ * @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
1523
  * @param {*} [options] Override http request option.
1584
1524
  * @throws {RequiredError}
1585
1525
  */
@@ -1665,6 +1605,7 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1665
1605
  * @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
1606
  * @param {CreateSearchRequest} createSearchRequest
1667
1607
  * @param {*} [options] Override http request option.
1608
+ * @deprecated
1668
1609
  * @throws {RequiredError}
1669
1610
  */
1670
1611
  createSearch: async (engineId: string, createSearchRequest: CreateSearchRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1803,8 +1744,9 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1803
1744
  },
1804
1745
  /**
1805
1746
  *
1806
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1747
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
1807
1748
  * @param {*} [options] Override http request option.
1749
+ * @deprecated
1808
1750
  * @throws {RequiredError}
1809
1751
  */
1810
1752
  listEngines: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -1932,9 +1874,40 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
1932
1874
  },
1933
1875
  /**
1934
1876
  *
1935
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1877
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
1878
+ * @param {*} [options] Override http request option.
1879
+ * @throws {RequiredError}
1880
+ */
1881
+ listModels: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1882
+ const localVarPath = `/models`;
1883
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1884
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1885
+ let baseOptions;
1886
+ if (configuration) {
1887
+ baseOptions = configuration.baseOptions;
1888
+ }
1889
+
1890
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
1891
+ const localVarHeaderParameter = {} as any;
1892
+ const localVarQueryParameter = {} as any;
1893
+
1894
+
1895
+
1896
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1897
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1898
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1899
+
1900
+ return {
1901
+ url: toPathString(localVarUrlObj),
1902
+ options: localVarRequestOptions,
1903
+ };
1904
+ },
1905
+ /**
1906
+ *
1907
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
1936
1908
  * @param {string} engineId The ID of the engine to use for this request
1937
1909
  * @param {*} [options] Override http request option.
1910
+ * @deprecated
1938
1911
  * @throws {RequiredError}
1939
1912
  */
1940
1913
  retrieveEngine: async (engineId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
@@ -2023,6 +1996,40 @@ export const OpenAIApiAxiosParamCreator = function (configuration?: Configuratio
2023
1996
 
2024
1997
 
2025
1998
 
1999
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2000
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2001
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2002
+
2003
+ return {
2004
+ url: toPathString(localVarUrlObj),
2005
+ options: localVarRequestOptions,
2006
+ };
2007
+ },
2008
+ /**
2009
+ *
2010
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
2011
+ * @param {string} model The ID of the model to use for this request
2012
+ * @param {*} [options] Override http request option.
2013
+ * @throws {RequiredError}
2014
+ */
2015
+ retrieveModel: async (model: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
2016
+ // verify required parameter 'model' is not null or undefined
2017
+ assertParamExists('retrieveModel', 'model', model)
2018
+ const localVarPath = `/models/{model}`
2019
+ .replace(`{${"model"}}`, encodeURIComponent(String(model)));
2020
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2021
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2022
+ let baseOptions;
2023
+ if (configuration) {
2024
+ baseOptions = configuration.baseOptions;
2025
+ }
2026
+
2027
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
2028
+ const localVarHeaderParameter = {} as any;
2029
+ const localVarQueryParameter = {} as any;
2030
+
2031
+
2032
+
2026
2033
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2027
2034
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2028
2035
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -2058,6 +2065,7 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2058
2065
  * @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
2066
  * @param {CreateAnswerRequest} createAnswerRequest
2060
2067
  * @param {*} [options] Override http request option.
2068
+ * @deprecated
2061
2069
  * @throws {RequiredError}
2062
2070
  */
2063
2071
  async createAnswer(createAnswerRequest: CreateAnswerRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateAnswerResponse>> {
@@ -2069,6 +2077,7 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2069
2077
  * @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
2078
  * @param {CreateClassificationRequest} createClassificationRequest
2071
2079
  * @param {*} [options] Override http request option.
2080
+ * @deprecated
2072
2081
  * @throws {RequiredError}
2073
2082
  */
2074
2083
  async createClassification(createClassificationRequest: CreateClassificationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateClassificationResponse>> {
@@ -2077,56 +2086,42 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2077
2086
  },
2078
2087
  /**
2079
2088
  *
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
2089
+ * @summary Creates a completion for the provided prompt and parameters
2082
2090
  * @param {CreateCompletionRequest} createCompletionRequest
2083
2091
  * @param {*} [options] Override http request option.
2084
2092
  * @throws {RequiredError}
2085
2093
  */
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);
2094
+ async createCompletion(createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>> {
2095
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createCompletion(createCompletionRequest, options);
2099
2096
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2100
2097
  },
2101
2098
  /**
2102
2099
  *
2103
2100
  * @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
2101
  * @param {CreateEditRequest} createEditRequest
2106
2102
  * @param {*} [options] Override http request option.
2107
2103
  * @throws {RequiredError}
2108
2104
  */
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);
2105
+ async createEdit(createEditRequest: CreateEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEditResponse>> {
2106
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEdit(createEditRequest, options);
2111
2107
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2112
2108
  },
2113
2109
  /**
2114
2110
  *
2115
- * @summary Creates an embedding vector representing the input text.
2116
- * @param {string} engineId The ID of the engine to use for this request
2111
+ * @summary Creates an embedding vector representing the input text.
2117
2112
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
2118
2113
  * @param {*} [options] Override http request option.
2119
2114
  * @throws {RequiredError}
2120
2115
  */
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);
2116
+ async createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEmbeddingResponse>> {
2117
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createEmbedding(createEmbeddingRequest, options);
2123
2118
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2124
2119
  },
2125
2120
  /**
2126
2121
  *
2127
2122
  * @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.
2123
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2124
+ * @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
2125
  * @param {*} [options] Override http request option.
2131
2126
  * @throws {RequiredError}
2132
2127
  */
@@ -2151,6 +2146,7 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2151
2146
  * @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
2147
  * @param {CreateSearchRequest} createSearchRequest
2153
2148
  * @param {*} [options] Override http request option.
2149
+ * @deprecated
2154
2150
  * @throws {RequiredError}
2155
2151
  */
2156
2152
  async createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateSearchResponse>> {
@@ -2192,8 +2188,9 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2192
2188
  },
2193
2189
  /**
2194
2190
  *
2195
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
2191
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
2196
2192
  * @param {*} [options] Override http request option.
2193
+ * @deprecated
2197
2194
  * @throws {RequiredError}
2198
2195
  */
2199
2196
  async listEngines(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListEnginesResponse>> {
@@ -2234,9 +2231,20 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2234
2231
  },
2235
2232
  /**
2236
2233
  *
2237
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
2234
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
2235
+ * @param {*} [options] Override http request option.
2236
+ * @throws {RequiredError}
2237
+ */
2238
+ async listModels(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListModelsResponse>> {
2239
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listModels(options);
2240
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2241
+ },
2242
+ /**
2243
+ *
2244
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
2238
2245
  * @param {string} engineId The ID of the engine to use for this request
2239
2246
  * @param {*} [options] Override http request option.
2247
+ * @deprecated
2240
2248
  * @throws {RequiredError}
2241
2249
  */
2242
2250
  async retrieveEngine(engineId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Engine>> {
@@ -2265,6 +2273,17 @@ export const OpenAIApiFp = function(configuration?: Configuration) {
2265
2273
  const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFineTune(fineTuneId, options);
2266
2274
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2267
2275
  },
2276
+ /**
2277
+ *
2278
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
2279
+ * @param {string} model The ID of the model to use for this request
2280
+ * @param {*} [options] Override http request option.
2281
+ * @throws {RequiredError}
2282
+ */
2283
+ async retrieveModel(model: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Model>> {
2284
+ const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveModel(model, options);
2285
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2286
+ },
2268
2287
  }
2269
2288
  };
2270
2289
 
@@ -2290,6 +2309,7 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2290
2309
  * @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
2310
  * @param {CreateAnswerRequest} createAnswerRequest
2292
2311
  * @param {*} [options] Override http request option.
2312
+ * @deprecated
2293
2313
  * @throws {RequiredError}
2294
2314
  */
2295
2315
  createAnswer(createAnswerRequest: CreateAnswerRequest, options?: any): AxiosPromise<CreateAnswerResponse> {
@@ -2300,6 +2320,7 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2300
2320
  * @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
2321
  * @param {CreateClassificationRequest} createClassificationRequest
2302
2322
  * @param {*} [options] Override http request option.
2323
+ * @deprecated
2303
2324
  * @throws {RequiredError}
2304
2325
  */
2305
2326
  createClassification(createClassificationRequest: CreateClassificationRequest, options?: any): AxiosPromise<CreateClassificationResponse> {
@@ -2307,52 +2328,39 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2307
2328
  },
2308
2329
  /**
2309
2330
  *
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
2331
+ * @summary Creates a completion for the provided prompt and parameters
2312
2332
  * @param {CreateCompletionRequest} createCompletionRequest
2313
2333
  * @param {*} [options] Override http request option.
2314
2334
  * @throws {RequiredError}
2315
2335
  */
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));
2336
+ createCompletion(createCompletionRequest: CreateCompletionRequest, options?: any): AxiosPromise<CreateCompletionResponse> {
2337
+ return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios, basePath));
2328
2338
  },
2329
2339
  /**
2330
2340
  *
2331
2341
  * @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
2342
  * @param {CreateEditRequest} createEditRequest
2334
2343
  * @param {*} [options] Override http request option.
2335
2344
  * @throws {RequiredError}
2336
2345
  */
2337
- createEdit(engineId: string, createEditRequest: CreateEditRequest, options?: any): AxiosPromise<CreateEditResponse> {
2338
- return localVarFp.createEdit(engineId, createEditRequest, options).then((request) => request(axios, basePath));
2346
+ createEdit(createEditRequest: CreateEditRequest, options?: any): AxiosPromise<CreateEditResponse> {
2347
+ return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios, basePath));
2339
2348
  },
2340
2349
  /**
2341
2350
  *
2342
- * @summary Creates an embedding vector representing the input text.
2343
- * @param {string} engineId The ID of the engine to use for this request
2351
+ * @summary Creates an embedding vector representing the input text.
2344
2352
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
2345
2353
  * @param {*} [options] Override http request option.
2346
2354
  * @throws {RequiredError}
2347
2355
  */
2348
- createEmbedding(engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: any): AxiosPromise<CreateEmbeddingResponse> {
2349
- return localVarFp.createEmbedding(engineId, createEmbeddingRequest, options).then((request) => request(axios, basePath));
2356
+ createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: any): AxiosPromise<CreateEmbeddingResponse> {
2357
+ return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios, basePath));
2350
2358
  },
2351
2359
  /**
2352
2360
  *
2353
2361
  * @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.
2362
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2363
+ * @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
2364
  * @param {*} [options] Override http request option.
2357
2365
  * @throws {RequiredError}
2358
2366
  */
@@ -2375,6 +2383,7 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2375
2383
  * @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
2384
  * @param {CreateSearchRequest} createSearchRequest
2377
2385
  * @param {*} [options] Override http request option.
2386
+ * @deprecated
2378
2387
  * @throws {RequiredError}
2379
2388
  */
2380
2389
  createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: any): AxiosPromise<CreateSearchResponse> {
@@ -2412,8 +2421,9 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2412
2421
  },
2413
2422
  /**
2414
2423
  *
2415
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
2424
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
2416
2425
  * @param {*} [options] Override http request option.
2426
+ * @deprecated
2417
2427
  * @throws {RequiredError}
2418
2428
  */
2419
2429
  listEngines(options?: any): AxiosPromise<ListEnginesResponse> {
@@ -2450,9 +2460,19 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2450
2460
  },
2451
2461
  /**
2452
2462
  *
2453
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
2463
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
2464
+ * @param {*} [options] Override http request option.
2465
+ * @throws {RequiredError}
2466
+ */
2467
+ listModels(options?: any): AxiosPromise<ListModelsResponse> {
2468
+ return localVarFp.listModels(options).then((request) => request(axios, basePath));
2469
+ },
2470
+ /**
2471
+ *
2472
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
2454
2473
  * @param {string} engineId The ID of the engine to use for this request
2455
2474
  * @param {*} [options] Override http request option.
2475
+ * @deprecated
2456
2476
  * @throws {RequiredError}
2457
2477
  */
2458
2478
  retrieveEngine(engineId: string, options?: any): AxiosPromise<Engine> {
@@ -2478,6 +2498,16 @@ export const OpenAIApiFactory = function (configuration?: Configuration, basePat
2478
2498
  retrieveFineTune(fineTuneId: string, options?: any): AxiosPromise<FineTune> {
2479
2499
  return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios, basePath));
2480
2500
  },
2501
+ /**
2502
+ *
2503
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
2504
+ * @param {string} model The ID of the model to use for this request
2505
+ * @param {*} [options] Override http request option.
2506
+ * @throws {RequiredError}
2507
+ */
2508
+ retrieveModel(model: string, options?: any): AxiosPromise<Model> {
2509
+ return localVarFp.retrieveModel(model, options).then((request) => request(axios, basePath));
2510
+ },
2481
2511
  };
2482
2512
  };
2483
2513
 
@@ -2505,6 +2535,7 @@ export class OpenAIApi extends BaseAPI {
2505
2535
  * @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
2536
  * @param {CreateAnswerRequest} createAnswerRequest
2507
2537
  * @param {*} [options] Override http request option.
2538
+ * @deprecated
2508
2539
  * @throws {RequiredError}
2509
2540
  * @memberof OpenAIApi
2510
2541
  */
@@ -2517,6 +2548,7 @@ export class OpenAIApi extends BaseAPI {
2517
2548
  * @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
2549
  * @param {CreateClassificationRequest} createClassificationRequest
2519
2550
  * @param {*} [options] Override http request option.
2551
+ * @deprecated
2520
2552
  * @throws {RequiredError}
2521
2553
  * @memberof OpenAIApi
2522
2554
  */
@@ -2526,60 +2558,45 @@ export class OpenAIApi extends BaseAPI {
2526
2558
 
2527
2559
  /**
2528
2560
  *
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
2561
+ * @summary Creates a completion for the provided prompt and parameters
2531
2562
  * @param {CreateCompletionRequest} createCompletionRequest
2532
2563
  * @param {*} [options] Override http request option.
2533
2564
  * @throws {RequiredError}
2534
2565
  * @memberof OpenAIApi
2535
2566
  */
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));
2567
+ public createCompletion(createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig) {
2568
+ return OpenAIApiFp(this.configuration).createCompletion(createCompletionRequest, options).then((request) => request(this.axios, this.basePath));
2550
2569
  }
2551
2570
 
2552
2571
  /**
2553
2572
  *
2554
2573
  * @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
2574
  * @param {CreateEditRequest} createEditRequest
2557
2575
  * @param {*} [options] Override http request option.
2558
2576
  * @throws {RequiredError}
2559
2577
  * @memberof OpenAIApi
2560
2578
  */
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));
2579
+ public createEdit(createEditRequest: CreateEditRequest, options?: AxiosRequestConfig) {
2580
+ return OpenAIApiFp(this.configuration).createEdit(createEditRequest, options).then((request) => request(this.axios, this.basePath));
2563
2581
  }
2564
2582
 
2565
2583
  /**
2566
2584
  *
2567
- * @summary Creates an embedding vector representing the input text.
2568
- * @param {string} engineId The ID of the engine to use for this request
2585
+ * @summary Creates an embedding vector representing the input text.
2569
2586
  * @param {CreateEmbeddingRequest} createEmbeddingRequest
2570
2587
  * @param {*} [options] Override http request option.
2571
2588
  * @throws {RequiredError}
2572
2589
  * @memberof OpenAIApi
2573
2590
  */
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));
2591
+ public createEmbedding(createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig) {
2592
+ return OpenAIApiFp(this.configuration).createEmbedding(createEmbeddingRequest, options).then((request) => request(this.axios, this.basePath));
2576
2593
  }
2577
2594
 
2578
2595
  /**
2579
2596
  *
2580
2597
  * @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.
2598
+ * @param {any} file Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. If the &#x60;purpose&#x60; is set to \\\&quot;fine-tune\\\&quot;, each line is a JSON record with \\\&quot;prompt\\\&quot; and \\\&quot;completion\\\&quot; fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
2599
+ * @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
2600
  * @param {*} [options] Override http request option.
2584
2601
  * @throws {RequiredError}
2585
2602
  * @memberof OpenAIApi
@@ -2606,6 +2623,7 @@ export class OpenAIApi extends BaseAPI {
2606
2623
  * @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
2624
  * @param {CreateSearchRequest} createSearchRequest
2608
2625
  * @param {*} [options] Override http request option.
2626
+ * @deprecated
2609
2627
  * @throws {RequiredError}
2610
2628
  * @memberof OpenAIApi
2611
2629
  */
@@ -2651,8 +2669,9 @@ export class OpenAIApi extends BaseAPI {
2651
2669
 
2652
2670
  /**
2653
2671
  *
2654
- * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
2672
+ * @summary Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
2655
2673
  * @param {*} [options] Override http request option.
2674
+ * @deprecated
2656
2675
  * @throws {RequiredError}
2657
2676
  * @memberof OpenAIApi
2658
2677
  */
@@ -2697,9 +2716,21 @@ export class OpenAIApi extends BaseAPI {
2697
2716
 
2698
2717
  /**
2699
2718
  *
2700
- * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
2719
+ * @summary Lists the currently available models, and provides basic information about each one such as the owner and availability.
2720
+ * @param {*} [options] Override http request option.
2721
+ * @throws {RequiredError}
2722
+ * @memberof OpenAIApi
2723
+ */
2724
+ public listModels(options?: AxiosRequestConfig) {
2725
+ return OpenAIApiFp(this.configuration).listModels(options).then((request) => request(this.axios, this.basePath));
2726
+ }
2727
+
2728
+ /**
2729
+ *
2730
+ * @summary Retrieves a model instance, providing basic information about it such as the owner and availability.
2701
2731
  * @param {string} engineId The ID of the engine to use for this request
2702
2732
  * @param {*} [options] Override http request option.
2733
+ * @deprecated
2703
2734
  * @throws {RequiredError}
2704
2735
  * @memberof OpenAIApi
2705
2736
  */
@@ -2730,6 +2761,18 @@ export class OpenAIApi extends BaseAPI {
2730
2761
  public retrieveFineTune(fineTuneId: string, options?: AxiosRequestConfig) {
2731
2762
  return OpenAIApiFp(this.configuration).retrieveFineTune(fineTuneId, options).then((request) => request(this.axios, this.basePath));
2732
2763
  }
2764
+
2765
+ /**
2766
+ *
2767
+ * @summary Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
2768
+ * @param {string} model The ID of the model to use for this request
2769
+ * @param {*} [options] Override http request option.
2770
+ * @throws {RequiredError}
2771
+ * @memberof OpenAIApi
2772
+ */
2773
+ public retrieveModel(model: string, options?: AxiosRequestConfig) {
2774
+ return OpenAIApiFp(this.configuration).retrieveModel(model, options).then((request) => request(this.axios, this.basePath));
2775
+ }
2733
2776
  }
2734
2777
 
2735
2778