openai 1.1.1 → 2.0.2

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/dist/api.d.ts ADDED
@@ -0,0 +1,1780 @@
1
+ /**
2
+ * OpenAI API
3
+ * APIs for sampling from and fine-tuning language models
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { Configuration } from './configuration';
13
+ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
14
+ import { RequestArgs, BaseAPI } from './base';
15
+ /**
16
+ *
17
+ * @export
18
+ * @interface CreateAnswerRequest
19
+ */
20
+ export interface CreateAnswerRequest {
21
+ /**
22
+ * ID of the engine to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
23
+ * @type {string}
24
+ * @memberof CreateAnswerRequest
25
+ */
26
+ 'model'?: string;
27
+ /**
28
+ * Question to get answered.
29
+ * @type {string}
30
+ * @memberof CreateAnswerRequest
31
+ */
32
+ 'question'?: string;
33
+ /**
34
+ * List of (question, answer) pairs that will help steer the model towards the tone and answer format you\'d like. We recommend adding 2 to 3 examples.
35
+ * @type {Array<any>}
36
+ * @memberof CreateAnswerRequest
37
+ */
38
+ 'examples'?: Array<any>;
39
+ /**
40
+ * A text snippet containing the contextual information used to generate the answers for the `examples` you provide.
41
+ * @type {string}
42
+ * @memberof CreateAnswerRequest
43
+ */
44
+ 'examples_context'?: string;
45
+ /**
46
+ * List of documents from which the answer for the input `question` should be derived. If this is an empty list, the question will be answered based on the question-answer examples. You should specify either `documents` or a `file`, but not both.
47
+ * @type {Array<string>}
48
+ * @memberof CreateAnswerRequest
49
+ */
50
+ 'documents'?: Array<string> | null;
51
+ /**
52
+ * The ID of an uploaded file that contains documents to search over. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose. You should specify either `documents` or a `file`, but not both.
53
+ * @type {string}
54
+ * @memberof CreateAnswerRequest
55
+ */
56
+ 'file'?: string | null;
57
+ /**
58
+ * ID of the engine to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
59
+ * @type {string}
60
+ * @memberof CreateAnswerRequest
61
+ */
62
+ 'search_model'?: string | null;
63
+ /**
64
+ * The maximum number of documents to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost.
65
+ * @type {number}
66
+ * @memberof CreateAnswerRequest
67
+ */
68
+ 'max_rerank'?: number | null;
69
+ /**
70
+ * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values mean the model will take more risks and value 0 (argmax sampling) works better for scenarios with a well-defined answer.
71
+ * @type {number}
72
+ * @memberof CreateAnswerRequest
73
+ */
74
+ 'temperature'?: number | null;
75
+ /**
76
+ * 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.
77
+ * @type {number}
78
+ * @memberof CreateAnswerRequest
79
+ */
80
+ 'logprobs'?: number | null;
81
+ /**
82
+ * The maximum number of tokens allowed for the generated answer
83
+ * @type {number}
84
+ * @memberof CreateAnswerRequest
85
+ */
86
+ 'max_tokens'?: number | null;
87
+ /**
88
+ * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
89
+ * @type {string | Array<string>}
90
+ * @memberof CreateAnswerRequest
91
+ */
92
+ 'stop'?: string | Array<string> | null;
93
+ /**
94
+ * How many answers to generate for each question.
95
+ * @type {number}
96
+ * @memberof CreateAnswerRequest
97
+ */
98
+ 'n'?: number | null;
99
+ /**
100
+ * 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.
101
+ * @type {object}
102
+ * @memberof CreateAnswerRequest
103
+ */
104
+ 'logit_bias'?: object | null;
105
+ /**
106
+ * A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a \"metadata\" field. This flag only takes effect when `file` is set.
107
+ * @type {boolean}
108
+ * @memberof CreateAnswerRequest
109
+ */
110
+ 'return_metadata'?: boolean | null;
111
+ /**
112
+ * If set to `true`, the returned JSON will include a \"prompt\" field containing the final prompt that was used to request a completion. This is mainly useful for debugging purposes.
113
+ * @type {boolean}
114
+ * @memberof CreateAnswerRequest
115
+ */
116
+ 'return_prompt'?: boolean | null;
117
+ /**
118
+ * If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID. Currently we support `completion` and `file` objects for expansion.
119
+ * @type {Array<any>}
120
+ * @memberof CreateAnswerRequest
121
+ */
122
+ 'expand'?: Array<any> | null;
123
+ }
124
+ /**
125
+ *
126
+ * @export
127
+ * @interface CreateAnswerResponse
128
+ */
129
+ export interface CreateAnswerResponse {
130
+ /**
131
+ *
132
+ * @type {string}
133
+ * @memberof CreateAnswerResponse
134
+ */
135
+ 'object'?: string;
136
+ /**
137
+ *
138
+ * @type {string}
139
+ * @memberof CreateAnswerResponse
140
+ */
141
+ 'model'?: string;
142
+ /**
143
+ *
144
+ * @type {string}
145
+ * @memberof CreateAnswerResponse
146
+ */
147
+ 'search_model'?: string;
148
+ /**
149
+ *
150
+ * @type {string}
151
+ * @memberof CreateAnswerResponse
152
+ */
153
+ 'completion'?: string;
154
+ /**
155
+ *
156
+ * @type {Array<string>}
157
+ * @memberof CreateAnswerResponse
158
+ */
159
+ 'answers'?: Array<string>;
160
+ /**
161
+ *
162
+ * @type {Array<CreateAnswerResponseSelectedDocuments>}
163
+ * @memberof CreateAnswerResponse
164
+ */
165
+ 'selected_documents'?: Array<CreateAnswerResponseSelectedDocuments>;
166
+ }
167
+ /**
168
+ *
169
+ * @export
170
+ * @interface CreateAnswerResponseSelectedDocuments
171
+ */
172
+ export interface CreateAnswerResponseSelectedDocuments {
173
+ /**
174
+ *
175
+ * @type {number}
176
+ * @memberof CreateAnswerResponseSelectedDocuments
177
+ */
178
+ 'document'?: number;
179
+ /**
180
+ *
181
+ * @type {string}
182
+ * @memberof CreateAnswerResponseSelectedDocuments
183
+ */
184
+ 'text'?: string;
185
+ }
186
+ /**
187
+ *
188
+ * @export
189
+ * @interface CreateClassificationRequest
190
+ */
191
+ export interface CreateClassificationRequest {
192
+ /**
193
+ * ID of the engine to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`.
194
+ * @type {string}
195
+ * @memberof CreateClassificationRequest
196
+ */
197
+ 'model'?: string;
198
+ /**
199
+ * Query to be classified.
200
+ * @type {string}
201
+ * @memberof CreateClassificationRequest
202
+ */
203
+ 'query'?: string;
204
+ /**
205
+ * A list of examples with labels, in the following format: `[[\"The movie is so interesting.\", \"Positive\"], [\"It is quite boring.\", \"Negative\"], ...]` All the label strings will be normalized to be capitalized. You should specify either `examples` or `file`, but not both.
206
+ * @type {Array<any>}
207
+ * @memberof CreateClassificationRequest
208
+ */
209
+ 'examples'?: Array<any> | null;
210
+ /**
211
+ * The ID of the uploaded file that contains training examples. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose. You should specify either `examples` or `file`, but not both.
212
+ * @type {string}
213
+ * @memberof CreateClassificationRequest
214
+ */
215
+ 'file'?: string | null;
216
+ /**
217
+ * The set of categories being classified. If not specified, candidate labels will be automatically collected from the examples you provide. All the label strings will be normalized to be capitalized.
218
+ * @type {Array<string>}
219
+ * @memberof CreateClassificationRequest
220
+ */
221
+ 'labels'?: Array<string> | null;
222
+ /**
223
+ * ID of the engine to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`.
224
+ * @type {string}
225
+ * @memberof CreateClassificationRequest
226
+ */
227
+ 'search_model'?: string | null;
228
+ /**
229
+ * What sampling `temperature` to use. Higher values mean the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.
230
+ * @type {number}
231
+ * @memberof CreateClassificationRequest
232
+ */
233
+ 'temperature'?: number | null;
234
+ /**
235
+ * 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.
236
+ * @type {number}
237
+ * @memberof CreateClassificationRequest
238
+ */
239
+ 'logprobs'?: number | null;
240
+ /**
241
+ * The maximum number of examples to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost.
242
+ * @type {number}
243
+ * @memberof CreateClassificationRequest
244
+ */
245
+ 'max_examples'?: number | null;
246
+ /**
247
+ * 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.
248
+ * @type {object}
249
+ * @memberof CreateClassificationRequest
250
+ */
251
+ 'logit_bias'?: object | null;
252
+ /**
253
+ * If set to `true`, the returned JSON will include a \"prompt\" field containing the final prompt that was used to request a completion. This is mainly useful for debugging purposes.
254
+ * @type {boolean}
255
+ * @memberof CreateClassificationRequest
256
+ */
257
+ 'return_prompt'?: boolean | null;
258
+ /**
259
+ * A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a \"metadata\" field. This flag only takes effect when `file` is set.
260
+ * @type {boolean}
261
+ * @memberof CreateClassificationRequest
262
+ */
263
+ 'return_metadata'?: boolean | null;
264
+ /**
265
+ * If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID. Currently we support `completion` and `file` objects for expansion.
266
+ * @type {Array<any>}
267
+ * @memberof CreateClassificationRequest
268
+ */
269
+ 'expand'?: Array<any> | null;
270
+ }
271
+ /**
272
+ *
273
+ * @export
274
+ * @interface CreateClassificationResponse
275
+ */
276
+ export interface CreateClassificationResponse {
277
+ /**
278
+ *
279
+ * @type {string}
280
+ * @memberof CreateClassificationResponse
281
+ */
282
+ 'object'?: string;
283
+ /**
284
+ *
285
+ * @type {string}
286
+ * @memberof CreateClassificationResponse
287
+ */
288
+ 'model'?: string;
289
+ /**
290
+ *
291
+ * @type {string}
292
+ * @memberof CreateClassificationResponse
293
+ */
294
+ 'search_model'?: string;
295
+ /**
296
+ *
297
+ * @type {string}
298
+ * @memberof CreateClassificationResponse
299
+ */
300
+ 'completion'?: string;
301
+ /**
302
+ *
303
+ * @type {string}
304
+ * @memberof CreateClassificationResponse
305
+ */
306
+ 'label'?: string;
307
+ /**
308
+ *
309
+ * @type {Array<CreateClassificationResponseSelectedExamples>}
310
+ * @memberof CreateClassificationResponse
311
+ */
312
+ 'selected_examples'?: Array<CreateClassificationResponseSelectedExamples>;
313
+ }
314
+ /**
315
+ *
316
+ * @export
317
+ * @interface CreateClassificationResponseSelectedExamples
318
+ */
319
+ export interface CreateClassificationResponseSelectedExamples {
320
+ /**
321
+ *
322
+ * @type {number}
323
+ * @memberof CreateClassificationResponseSelectedExamples
324
+ */
325
+ 'document'?: number;
326
+ /**
327
+ *
328
+ * @type {string}
329
+ * @memberof CreateClassificationResponseSelectedExamples
330
+ */
331
+ 'text'?: string;
332
+ /**
333
+ *
334
+ * @type {string}
335
+ * @memberof CreateClassificationResponseSelectedExamples
336
+ */
337
+ 'label'?: string;
338
+ }
339
+ /**
340
+ *
341
+ * @export
342
+ * @interface CreateCompletionFromModelRequest
343
+ */
344
+ export interface CreateCompletionFromModelRequest {
345
+ /**
346
+ * 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.
347
+ * @type {string | Array<string> | Array<number> | Array<any>}
348
+ * @memberof CreateCompletionFromModelRequest
349
+ */
350
+ 'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
351
+ /**
352
+ * 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 `code-davinci-001`, which supports 4096).
353
+ * @type {number}
354
+ * @memberof CreateCompletionFromModelRequest
355
+ */
356
+ 'max_tokens'?: number | null;
357
+ /**
358
+ * 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.
359
+ * @type {number}
360
+ * @memberof CreateCompletionFromModelRequest
361
+ */
362
+ 'temperature'?: number | null;
363
+ /**
364
+ * 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.
365
+ * @type {number}
366
+ * @memberof CreateCompletionFromModelRequest
367
+ */
368
+ 'top_p'?: number | null;
369
+ /**
370
+ * 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`.
371
+ * @type {number}
372
+ * @memberof CreateCompletionFromModelRequest
373
+ */
374
+ 'n'?: number | null;
375
+ /**
376
+ * 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.
377
+ * @type {boolean}
378
+ * @memberof CreateCompletionFromModelRequest
379
+ */
380
+ 'stream'?: boolean | null;
381
+ /**
382
+ * 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.
383
+ * @type {number}
384
+ * @memberof CreateCompletionFromModelRequest
385
+ */
386
+ 'logprobs'?: number | null;
387
+ /**
388
+ * Echo back the prompt in addition to the completion
389
+ * @type {boolean}
390
+ * @memberof CreateCompletionFromModelRequest
391
+ */
392
+ 'echo'?: boolean | null;
393
+ /**
394
+ * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
395
+ * @type {string | Array<string>}
396
+ * @memberof CreateCompletionFromModelRequest
397
+ */
398
+ 'stop'?: string | Array<string> | null;
399
+ /**
400
+ * 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)
401
+ * @type {number}
402
+ * @memberof CreateCompletionFromModelRequest
403
+ */
404
+ 'presence_penalty'?: number | null;
405
+ /**
406
+ * 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)
407
+ * @type {number}
408
+ * @memberof CreateCompletionFromModelRequest
409
+ */
410
+ 'frequency_penalty'?: number | null;
411
+ /**
412
+ * 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`.
413
+ * @type {number}
414
+ * @memberof CreateCompletionFromModelRequest
415
+ */
416
+ 'best_of'?: number | null;
417
+ /**
418
+ * 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.
419
+ * @type {object}
420
+ * @memberof CreateCompletionFromModelRequest
421
+ */
422
+ 'logit_bias'?: object | null;
423
+ /**
424
+ * ID of the model to use for completion.
425
+ * @type {string}
426
+ * @memberof CreateCompletionFromModelRequest
427
+ */
428
+ 'model'?: string;
429
+ }
430
+ /**
431
+ *
432
+ * @export
433
+ * @interface CreateCompletionFromModelRequestAllOf
434
+ */
435
+ export interface CreateCompletionFromModelRequestAllOf {
436
+ /**
437
+ * ID of the model to use for completion.
438
+ * @type {string}
439
+ * @memberof CreateCompletionFromModelRequestAllOf
440
+ */
441
+ 'model'?: string;
442
+ }
443
+ /**
444
+ *
445
+ * @export
446
+ * @interface CreateCompletionRequest
447
+ */
448
+ export interface CreateCompletionRequest {
449
+ /**
450
+ * 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.
451
+ * @type {string | Array<string> | Array<number> | Array<any>}
452
+ * @memberof CreateCompletionRequest
453
+ */
454
+ 'prompt'?: string | Array<string> | Array<number> | Array<any> | null;
455
+ /**
456
+ * 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 `code-davinci-001`, which supports 4096).
457
+ * @type {number}
458
+ * @memberof CreateCompletionRequest
459
+ */
460
+ 'max_tokens'?: number | null;
461
+ /**
462
+ * 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.
463
+ * @type {number}
464
+ * @memberof CreateCompletionRequest
465
+ */
466
+ 'temperature'?: number | null;
467
+ /**
468
+ * 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.
469
+ * @type {number}
470
+ * @memberof CreateCompletionRequest
471
+ */
472
+ 'top_p'?: number | null;
473
+ /**
474
+ * 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`.
475
+ * @type {number}
476
+ * @memberof CreateCompletionRequest
477
+ */
478
+ 'n'?: number | null;
479
+ /**
480
+ * 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.
481
+ * @type {boolean}
482
+ * @memberof CreateCompletionRequest
483
+ */
484
+ 'stream'?: boolean | null;
485
+ /**
486
+ * 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.
487
+ * @type {number}
488
+ * @memberof CreateCompletionRequest
489
+ */
490
+ 'logprobs'?: number | null;
491
+ /**
492
+ * Echo back the prompt in addition to the completion
493
+ * @type {boolean}
494
+ * @memberof CreateCompletionRequest
495
+ */
496
+ 'echo'?: boolean | null;
497
+ /**
498
+ * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
499
+ * @type {string | Array<string>}
500
+ * @memberof CreateCompletionRequest
501
+ */
502
+ 'stop'?: string | Array<string> | null;
503
+ /**
504
+ * 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)
505
+ * @type {number}
506
+ * @memberof CreateCompletionRequest
507
+ */
508
+ 'presence_penalty'?: number | null;
509
+ /**
510
+ * 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)
511
+ * @type {number}
512
+ * @memberof CreateCompletionRequest
513
+ */
514
+ 'frequency_penalty'?: number | null;
515
+ /**
516
+ * 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`.
517
+ * @type {number}
518
+ * @memberof CreateCompletionRequest
519
+ */
520
+ 'best_of'?: number | null;
521
+ /**
522
+ * 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.
523
+ * @type {object}
524
+ * @memberof CreateCompletionRequest
525
+ */
526
+ 'logit_bias'?: object | null;
527
+ }
528
+ /**
529
+ *
530
+ * @export
531
+ * @interface CreateCompletionResponse
532
+ */
533
+ export interface CreateCompletionResponse {
534
+ /**
535
+ *
536
+ * @type {string}
537
+ * @memberof CreateCompletionResponse
538
+ */
539
+ 'id'?: string;
540
+ /**
541
+ *
542
+ * @type {string}
543
+ * @memberof CreateCompletionResponse
544
+ */
545
+ 'object'?: string;
546
+ /**
547
+ *
548
+ * @type {number}
549
+ * @memberof CreateCompletionResponse
550
+ */
551
+ 'created'?: number;
552
+ /**
553
+ *
554
+ * @type {string}
555
+ * @memberof CreateCompletionResponse
556
+ */
557
+ 'model'?: string;
558
+ /**
559
+ *
560
+ * @type {Array<CreateCompletionResponseChoices>}
561
+ * @memberof CreateCompletionResponse
562
+ */
563
+ 'choices'?: Array<CreateCompletionResponseChoices>;
564
+ }
565
+ /**
566
+ *
567
+ * @export
568
+ * @interface CreateCompletionResponseChoices
569
+ */
570
+ export interface CreateCompletionResponseChoices {
571
+ /**
572
+ *
573
+ * @type {string}
574
+ * @memberof CreateCompletionResponseChoices
575
+ */
576
+ 'text'?: string;
577
+ /**
578
+ *
579
+ * @type {number}
580
+ * @memberof CreateCompletionResponseChoices
581
+ */
582
+ 'index'?: number;
583
+ /**
584
+ *
585
+ * @type {CreateCompletionResponseLogprobs}
586
+ * @memberof CreateCompletionResponseChoices
587
+ */
588
+ 'logprobs'?: CreateCompletionResponseLogprobs | null;
589
+ /**
590
+ *
591
+ * @type {string}
592
+ * @memberof CreateCompletionResponseChoices
593
+ */
594
+ 'finish_reason'?: string;
595
+ }
596
+ /**
597
+ *
598
+ * @export
599
+ * @interface CreateCompletionResponseLogprobs
600
+ */
601
+ export interface CreateCompletionResponseLogprobs {
602
+ /**
603
+ *
604
+ * @type {Array<string>}
605
+ * @memberof CreateCompletionResponseLogprobs
606
+ */
607
+ 'tokens'?: Array<string>;
608
+ /**
609
+ *
610
+ * @type {Array<number>}
611
+ * @memberof CreateCompletionResponseLogprobs
612
+ */
613
+ 'token_logprobs'?: Array<number>;
614
+ /**
615
+ *
616
+ * @type {Array<object>}
617
+ * @memberof CreateCompletionResponseLogprobs
618
+ */
619
+ 'top_logprobs'?: Array<object>;
620
+ /**
621
+ *
622
+ * @type {Array<number>}
623
+ * @memberof CreateCompletionResponseLogprobs
624
+ */
625
+ 'text_offset'?: Array<number>;
626
+ }
627
+ /**
628
+ *
629
+ * @export
630
+ * @interface CreateEmbeddingRequest
631
+ */
632
+ export interface CreateEmbeddingRequest {
633
+ /**
634
+ * 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. We suggest replacing newlines (`\\n`) in your input with a single space, as we have observed inferior results when newlines are present.
635
+ * @type {string | Array<string> | Array<number> | Array<any>}
636
+ * @memberof CreateEmbeddingRequest
637
+ */
638
+ 'input'?: string | Array<string> | Array<number> | Array<any>;
639
+ }
640
+ /**
641
+ *
642
+ * @export
643
+ * @interface CreateEmbeddingResponse
644
+ */
645
+ export interface CreateEmbeddingResponse {
646
+ /**
647
+ *
648
+ * @type {string}
649
+ * @memberof CreateEmbeddingResponse
650
+ */
651
+ 'object'?: string;
652
+ /**
653
+ *
654
+ * @type {string}
655
+ * @memberof CreateEmbeddingResponse
656
+ */
657
+ 'model'?: string;
658
+ /**
659
+ *
660
+ * @type {Array<CreateEmbeddingResponseData>}
661
+ * @memberof CreateEmbeddingResponse
662
+ */
663
+ 'data'?: Array<CreateEmbeddingResponseData>;
664
+ }
665
+ /**
666
+ *
667
+ * @export
668
+ * @interface CreateEmbeddingResponseData
669
+ */
670
+ export interface CreateEmbeddingResponseData {
671
+ /**
672
+ *
673
+ * @type {number}
674
+ * @memberof CreateEmbeddingResponseData
675
+ */
676
+ 'index'?: number;
677
+ /**
678
+ *
679
+ * @type {string}
680
+ * @memberof CreateEmbeddingResponseData
681
+ */
682
+ 'object'?: string;
683
+ /**
684
+ *
685
+ * @type {Array<number>}
686
+ * @memberof CreateEmbeddingResponseData
687
+ */
688
+ 'embedding'?: Array<number>;
689
+ }
690
+ /**
691
+ *
692
+ * @export
693
+ * @interface CreateFineTuneRequest
694
+ */
695
+ export interface CreateFineTuneRequest {
696
+ /**
697
+ * The ID of an uploaded file that contains training data. See [upload file](/docs/api-reference/files/upload) for how to upload a file. Your dataset must be formatted as a JSONL file, where each training example is a JSON object with the keys \"prompt\" and \"completion\". Additionally, you must upload your file with the purpose `fine-tune`. See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details.
698
+ * @type {string}
699
+ * @memberof CreateFineTuneRequest
700
+ */
701
+ 'training_file'?: string;
702
+ /**
703
+ * The ID of an uploaded file that contains validation data. If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the [fine-tuning results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model). Your train and validation data should be mutually exclusive. Your dataset must be formatted as a JSONL file, where each validation example is a JSON object with the keys \"prompt\" and \"completion\". Additionally, you must upload your file with the purpose `fine-tune`. See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details.
704
+ * @type {string}
705
+ * @memberof CreateFineTuneRequest
706
+ */
707
+ 'validation_file'?: string | null;
708
+ /**
709
+ * 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.
710
+ * @type {string}
711
+ * @memberof CreateFineTuneRequest
712
+ */
713
+ 'model'?: string | null;
714
+ /**
715
+ * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
716
+ * @type {number}
717
+ * @memberof CreateFineTuneRequest
718
+ */
719
+ 'n_epochs'?: number | null;
720
+ /**
721
+ * The batch size to use for training. The batch size is the number of training examples used to train a single forward and backward pass. By default, the batch size will be dynamically configured to be ~0.2% of the number of examples in the training set, capped at 256 - in general, we\'ve found that larger batch sizes tend to work better for larger datasets.
722
+ * @type {number}
723
+ * @memberof CreateFineTuneRequest
724
+ */
725
+ 'batch_size'?: number | null;
726
+ /**
727
+ * The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pretraining multiplied by this value. By default, the learning rate multiplier is the 0.05, 0.1, or 0.2 depending on final `batch_size` (larger learning rates tend to perform better with larger batch sizes). We recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results.
728
+ * @type {number}
729
+ * @memberof CreateFineTuneRequest
730
+ */
731
+ 'learning_rate_multiplier'?: number | null;
732
+ /**
733
+ * The weight to use for loss on the prompt tokens. This controls how much the model tries to learn to generate the prompt (as compared to the completion which always has a weight of 1.0), and can add a stabilizing effect to training when completions are short. If prompts are extremely long (relative to completions), it may make sense to reduce this weight so as to avoid over-prioritizing learning the prompt.
734
+ * @type {number}
735
+ * @memberof CreateFineTuneRequest
736
+ */
737
+ 'prompt_loss_weight'?: number | null;
738
+ /**
739
+ * If set, we calculate classification-specific metrics such as accuracy and F-1 score using the validation set at the end of every epoch. These metrics can be viewed in the [results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model). In order to compute classification metrics, you must provide a `validation_file`. Additionally, you must specify `classification_n_classes` for multiclass classification or `classification_positive_class` for binary classification.
740
+ * @type {boolean}
741
+ * @memberof CreateFineTuneRequest
742
+ */
743
+ 'compute_classification_metrics'?: boolean | null;
744
+ /**
745
+ * The number of classes in a classification task. This parameter is required for multiclass classification.
746
+ * @type {number}
747
+ * @memberof CreateFineTuneRequest
748
+ */
749
+ 'classification_n_classes'?: number | null;
750
+ /**
751
+ * The positive class in binary classification. This parameter is needed to generate precision, recall, and F1 metrics when doing binary classification.
752
+ * @type {string}
753
+ * @memberof CreateFineTuneRequest
754
+ */
755
+ 'classification_positive_class'?: string | null;
756
+ /**
757
+ * If this is provided, we calculate F-beta scores at the specified beta values. The F-beta score is a generalization of F-1 score. This is only used for binary classification. With a beta of 1 (i.e. the F-1 score), precision and recall are given the same weight. A larger beta score puts more weight on recall and less on precision. A smaller beta score puts more weight on precision and less on recall.
758
+ * @type {Array<number>}
759
+ * @memberof CreateFineTuneRequest
760
+ */
761
+ 'classification_betas'?: Array<number> | null;
762
+ }
763
+ /**
764
+ *
765
+ * @export
766
+ * @interface CreateSearchRequest
767
+ */
768
+ export interface CreateSearchRequest {
769
+ /**
770
+ * Up to 200 documents to search over, provided as a list of strings. The maximum document length (in tokens) is 2034 minus the number of tokens in the query. You should specify either `documents` or a `file`, but not both.
771
+ * @type {Array<string>}
772
+ * @memberof CreateSearchRequest
773
+ */
774
+ 'documents'?: Array<string> | null;
775
+ /**
776
+ * The ID of an uploaded file that contains documents to search over. You should specify either `documents` or a `file`, but not both.
777
+ * @type {string}
778
+ * @memberof CreateSearchRequest
779
+ */
780
+ 'file'?: string | null;
781
+ /**
782
+ * Query to search against the documents.
783
+ * @type {string}
784
+ * @memberof CreateSearchRequest
785
+ */
786
+ 'query'?: string;
787
+ /**
788
+ * The maximum number of documents to be re-ranked and returned by search. This flag only takes effect when `file` is set.
789
+ * @type {number}
790
+ * @memberof CreateSearchRequest
791
+ */
792
+ 'max_rerank'?: number | null;
793
+ /**
794
+ * A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a \"metadata\" field. This flag only takes effect when `file` is set.
795
+ * @type {boolean}
796
+ * @memberof CreateSearchRequest
797
+ */
798
+ 'return_metadata'?: boolean | null;
799
+ }
800
+ /**
801
+ *
802
+ * @export
803
+ * @interface CreateSearchResponse
804
+ */
805
+ export interface CreateSearchResponse {
806
+ /**
807
+ *
808
+ * @type {string}
809
+ * @memberof CreateSearchResponse
810
+ */
811
+ 'object'?: string;
812
+ /**
813
+ *
814
+ * @type {string}
815
+ * @memberof CreateSearchResponse
816
+ */
817
+ 'model'?: string;
818
+ /**
819
+ *
820
+ * @type {Array<CreateSearchResponseData>}
821
+ * @memberof CreateSearchResponse
822
+ */
823
+ 'data'?: Array<CreateSearchResponseData>;
824
+ }
825
+ /**
826
+ *
827
+ * @export
828
+ * @interface CreateSearchResponseData
829
+ */
830
+ export interface CreateSearchResponseData {
831
+ /**
832
+ *
833
+ * @type {string}
834
+ * @memberof CreateSearchResponseData
835
+ */
836
+ 'object'?: string;
837
+ /**
838
+ *
839
+ * @type {number}
840
+ * @memberof CreateSearchResponseData
841
+ */
842
+ 'document'?: number;
843
+ /**
844
+ *
845
+ * @type {number}
846
+ * @memberof CreateSearchResponseData
847
+ */
848
+ 'score'?: number;
849
+ }
850
+ /**
851
+ *
852
+ * @export
853
+ * @interface DeleteFileResponse
854
+ */
855
+ export interface DeleteFileResponse {
856
+ /**
857
+ *
858
+ * @type {string}
859
+ * @memberof DeleteFileResponse
860
+ */
861
+ 'id'?: string;
862
+ /**
863
+ *
864
+ * @type {string}
865
+ * @memberof DeleteFileResponse
866
+ */
867
+ 'object'?: string;
868
+ /**
869
+ *
870
+ * @type {boolean}
871
+ * @memberof DeleteFileResponse
872
+ */
873
+ 'deleted'?: boolean;
874
+ }
875
+ /**
876
+ *
877
+ * @export
878
+ * @interface Engine
879
+ */
880
+ export interface Engine {
881
+ /**
882
+ *
883
+ * @type {string}
884
+ * @memberof Engine
885
+ */
886
+ 'id'?: string;
887
+ /**
888
+ *
889
+ * @type {string}
890
+ * @memberof Engine
891
+ */
892
+ 'object'?: string;
893
+ /**
894
+ *
895
+ * @type {number}
896
+ * @memberof Engine
897
+ */
898
+ 'created'?: number;
899
+ /**
900
+ *
901
+ * @type {boolean}
902
+ * @memberof Engine
903
+ */
904
+ 'ready'?: boolean;
905
+ }
906
+ /**
907
+ *
908
+ * @export
909
+ * @interface FineTune
910
+ */
911
+ export interface FineTune {
912
+ /**
913
+ *
914
+ * @type {string}
915
+ * @memberof FineTune
916
+ */
917
+ 'id'?: string;
918
+ /**
919
+ *
920
+ * @type {string}
921
+ * @memberof FineTune
922
+ */
923
+ 'object'?: string;
924
+ /**
925
+ *
926
+ * @type {number}
927
+ * @memberof FineTune
928
+ */
929
+ 'created_at'?: number;
930
+ /**
931
+ *
932
+ * @type {number}
933
+ * @memberof FineTune
934
+ */
935
+ 'updated_at'?: number;
936
+ /**
937
+ *
938
+ * @type {string}
939
+ * @memberof FineTune
940
+ */
941
+ 'model'?: string;
942
+ /**
943
+ *
944
+ * @type {string}
945
+ * @memberof FineTune
946
+ */
947
+ 'fine_tuned_model'?: string | null;
948
+ /**
949
+ *
950
+ * @type {string}
951
+ * @memberof FineTune
952
+ */
953
+ 'organization_id'?: string;
954
+ /**
955
+ *
956
+ * @type {string}
957
+ * @memberof FineTune
958
+ */
959
+ 'status'?: string;
960
+ /**
961
+ *
962
+ * @type {object}
963
+ * @memberof FineTune
964
+ */
965
+ 'hyperparams'?: object;
966
+ /**
967
+ *
968
+ * @type {Array<OpenAIFile>}
969
+ * @memberof FineTune
970
+ */
971
+ 'training_files'?: Array<OpenAIFile>;
972
+ /**
973
+ *
974
+ * @type {Array<OpenAIFile>}
975
+ * @memberof FineTune
976
+ */
977
+ 'validation_files'?: Array<OpenAIFile>;
978
+ /**
979
+ *
980
+ * @type {Array<OpenAIFile>}
981
+ * @memberof FineTune
982
+ */
983
+ 'result_files'?: Array<OpenAIFile>;
984
+ /**
985
+ *
986
+ * @type {Array<FineTuneEvent>}
987
+ * @memberof FineTune
988
+ */
989
+ 'events'?: Array<FineTuneEvent>;
990
+ }
991
+ /**
992
+ *
993
+ * @export
994
+ * @interface FineTuneEvent
995
+ */
996
+ export interface FineTuneEvent {
997
+ /**
998
+ *
999
+ * @type {string}
1000
+ * @memberof FineTuneEvent
1001
+ */
1002
+ 'object'?: string;
1003
+ /**
1004
+ *
1005
+ * @type {number}
1006
+ * @memberof FineTuneEvent
1007
+ */
1008
+ 'created_at'?: number;
1009
+ /**
1010
+ *
1011
+ * @type {string}
1012
+ * @memberof FineTuneEvent
1013
+ */
1014
+ 'level'?: string;
1015
+ /**
1016
+ *
1017
+ * @type {string}
1018
+ * @memberof FineTuneEvent
1019
+ */
1020
+ 'message'?: string;
1021
+ }
1022
+ /**
1023
+ *
1024
+ * @export
1025
+ * @interface ListEnginesResponse
1026
+ */
1027
+ export interface ListEnginesResponse {
1028
+ /**
1029
+ *
1030
+ * @type {string}
1031
+ * @memberof ListEnginesResponse
1032
+ */
1033
+ 'object'?: string;
1034
+ /**
1035
+ *
1036
+ * @type {Array<Engine>}
1037
+ * @memberof ListEnginesResponse
1038
+ */
1039
+ 'data'?: Array<Engine>;
1040
+ }
1041
+ /**
1042
+ *
1043
+ * @export
1044
+ * @interface ListFilesResponse
1045
+ */
1046
+ export interface ListFilesResponse {
1047
+ /**
1048
+ *
1049
+ * @type {string}
1050
+ * @memberof ListFilesResponse
1051
+ */
1052
+ 'object'?: string;
1053
+ /**
1054
+ *
1055
+ * @type {Array<OpenAIFile>}
1056
+ * @memberof ListFilesResponse
1057
+ */
1058
+ 'data'?: Array<OpenAIFile>;
1059
+ }
1060
+ /**
1061
+ *
1062
+ * @export
1063
+ * @interface ListFineTuneEventsResponse
1064
+ */
1065
+ export interface ListFineTuneEventsResponse {
1066
+ /**
1067
+ *
1068
+ * @type {string}
1069
+ * @memberof ListFineTuneEventsResponse
1070
+ */
1071
+ 'object'?: string;
1072
+ /**
1073
+ *
1074
+ * @type {Array<FineTuneEvent>}
1075
+ * @memberof ListFineTuneEventsResponse
1076
+ */
1077
+ 'data'?: Array<FineTuneEvent>;
1078
+ }
1079
+ /**
1080
+ *
1081
+ * @export
1082
+ * @interface ListFineTunesResponse
1083
+ */
1084
+ export interface ListFineTunesResponse {
1085
+ /**
1086
+ *
1087
+ * @type {string}
1088
+ * @memberof ListFineTunesResponse
1089
+ */
1090
+ 'object'?: string;
1091
+ /**
1092
+ *
1093
+ * @type {Array<FineTune>}
1094
+ * @memberof ListFineTunesResponse
1095
+ */
1096
+ 'data'?: Array<FineTune>;
1097
+ }
1098
+ /**
1099
+ *
1100
+ * @export
1101
+ * @interface OpenAIFile
1102
+ */
1103
+ export interface OpenAIFile {
1104
+ /**
1105
+ *
1106
+ * @type {string}
1107
+ * @memberof OpenAIFile
1108
+ */
1109
+ 'id'?: string;
1110
+ /**
1111
+ *
1112
+ * @type {string}
1113
+ * @memberof OpenAIFile
1114
+ */
1115
+ 'object'?: string;
1116
+ /**
1117
+ *
1118
+ * @type {number}
1119
+ * @memberof OpenAIFile
1120
+ */
1121
+ 'bytes'?: number;
1122
+ /**
1123
+ *
1124
+ * @type {number}
1125
+ * @memberof OpenAIFile
1126
+ */
1127
+ 'created_at'?: number;
1128
+ /**
1129
+ *
1130
+ * @type {string}
1131
+ * @memberof OpenAIFile
1132
+ */
1133
+ 'filename'?: string;
1134
+ /**
1135
+ *
1136
+ * @type {string}
1137
+ * @memberof OpenAIFile
1138
+ */
1139
+ 'purpose'?: string;
1140
+ /**
1141
+ *
1142
+ * @type {string}
1143
+ * @memberof OpenAIFile
1144
+ */
1145
+ 'status'?: string;
1146
+ /**
1147
+ *
1148
+ * @type {object}
1149
+ * @memberof OpenAIFile
1150
+ */
1151
+ 'status_details'?: object | null;
1152
+ }
1153
+ /**
1154
+ * OpenAIApi - axios parameter creator
1155
+ * @export
1156
+ */
1157
+ export declare const OpenAIApiAxiosParamCreator: (configuration?: Configuration) => {
1158
+ /**
1159
+ *
1160
+ * @summary Immediately cancel a fine-tune job.
1161
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1162
+ * @param {*} [options] Override http request option.
1163
+ * @throws {RequiredError}
1164
+ */
1165
+ cancelFineTune: (fineTuneId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1166
+ /**
1167
+ *
1168
+ * @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).
1169
+ * @param {CreateAnswerRequest} createAnswerRequest
1170
+ * @param {*} [options] Override http request option.
1171
+ * @throws {RequiredError}
1172
+ */
1173
+ createAnswer: (createAnswerRequest: CreateAnswerRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1174
+ /**
1175
+ *
1176
+ * @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.
1177
+ * @param {CreateClassificationRequest} createClassificationRequest
1178
+ * @param {*} [options] Override http request option.
1179
+ * @throws {RequiredError}
1180
+ */
1181
+ createClassification: (createClassificationRequest: CreateClassificationRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1182
+ /**
1183
+ *
1184
+ * @summary Creates a new completion for the provided prompt and parameters
1185
+ * @param {string} engineId The ID of the engine to use for this request
1186
+ * @param {CreateCompletionRequest} createCompletionRequest
1187
+ * @param {*} [options] Override http request option.
1188
+ * @throws {RequiredError}
1189
+ */
1190
+ createCompletion: (engineId: string, createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1191
+ /**
1192
+ *
1193
+ * @summary Creates a completion using a fine-tuned model
1194
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
1195
+ * @param {*} [options] Override http request option.
1196
+ * @throws {RequiredError}
1197
+ */
1198
+ createCompletionFromModel: (createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1199
+ /**
1200
+ *
1201
+ * @summary Creates an embedding vector representing the input text.
1202
+ * @param {string} engineId The ID of the engine to use for this request
1203
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1204
+ * @param {*} [options] Override http request option.
1205
+ * @throws {RequiredError}
1206
+ */
1207
+ createEmbedding: (engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1208
+ /**
1209
+ *
1210
+ * @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.
1211
+ * @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).
1212
+ * @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.
1213
+ * @param {*} [options] Override http request option.
1214
+ * @throws {RequiredError}
1215
+ */
1216
+ createFile: (file: any, purpose: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1217
+ /**
1218
+ *
1219
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1220
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1221
+ * @param {*} [options] Override http request option.
1222
+ * @throws {RequiredError}
1223
+ */
1224
+ createFineTune: (createFineTuneRequest: CreateFineTuneRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1225
+ /**
1226
+ *
1227
+ * @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.
1228
+ * @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;.
1229
+ * @param {CreateSearchRequest} createSearchRequest
1230
+ * @param {*} [options] Override http request option.
1231
+ * @throws {RequiredError}
1232
+ */
1233
+ createSearch: (engineId: string, createSearchRequest: CreateSearchRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1234
+ /**
1235
+ *
1236
+ * @summary Delete a file.
1237
+ * @param {string} fileId The ID of the file to use for this request
1238
+ * @param {*} [options] Override http request option.
1239
+ * @throws {RequiredError}
1240
+ */
1241
+ deleteFile: (fileId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1242
+ /**
1243
+ *
1244
+ * @summary Returns the contents of the specified file
1245
+ * @param {string} fileId The ID of the file to use for this request
1246
+ * @param {*} [options] Override http request option.
1247
+ * @throws {RequiredError}
1248
+ */
1249
+ downloadFile: (fileId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1250
+ /**
1251
+ *
1252
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1253
+ * @param {*} [options] Override http request option.
1254
+ * @throws {RequiredError}
1255
+ */
1256
+ listEngines: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
1257
+ /**
1258
+ *
1259
+ * @summary Returns a list of files that belong to the user\'s organization.
1260
+ * @param {*} [options] Override http request option.
1261
+ * @throws {RequiredError}
1262
+ */
1263
+ listFiles: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
1264
+ /**
1265
+ *
1266
+ * @summary Get fine-grained status updates for a fine-tune job.
1267
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1268
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
1269
+ * @param {*} [options] Override http request option.
1270
+ * @throws {RequiredError}
1271
+ */
1272
+ listFineTuneEvents: (fineTuneId: string, stream?: boolean, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1273
+ /**
1274
+ *
1275
+ * @summary List your organization\'s fine-tuning jobs
1276
+ * @param {*} [options] Override http request option.
1277
+ * @throws {RequiredError}
1278
+ */
1279
+ listFineTunes: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
1280
+ /**
1281
+ *
1282
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1283
+ * @param {string} engineId The ID of the engine to use for this request
1284
+ * @param {*} [options] Override http request option.
1285
+ * @throws {RequiredError}
1286
+ */
1287
+ retrieveEngine: (engineId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1288
+ /**
1289
+ *
1290
+ * @summary Returns information about a specific file.
1291
+ * @param {string} fileId The ID of the file to use for this request
1292
+ * @param {*} [options] Override http request option.
1293
+ * @throws {RequiredError}
1294
+ */
1295
+ retrieveFile: (fileId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1296
+ /**
1297
+ *
1298
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1299
+ * @param {string} fineTuneId The ID of the fine-tune job
1300
+ * @param {*} [options] Override http request option.
1301
+ * @throws {RequiredError}
1302
+ */
1303
+ retrieveFineTune: (fineTuneId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1304
+ };
1305
+ /**
1306
+ * OpenAIApi - functional programming interface
1307
+ * @export
1308
+ */
1309
+ export declare const OpenAIApiFp: (configuration?: Configuration) => {
1310
+ /**
1311
+ *
1312
+ * @summary Immediately cancel a fine-tune job.
1313
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1314
+ * @param {*} [options] Override http request option.
1315
+ * @throws {RequiredError}
1316
+ */
1317
+ cancelFineTune(fineTuneId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FineTune>>;
1318
+ /**
1319
+ *
1320
+ * @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).
1321
+ * @param {CreateAnswerRequest} createAnswerRequest
1322
+ * @param {*} [options] Override http request option.
1323
+ * @throws {RequiredError}
1324
+ */
1325
+ createAnswer(createAnswerRequest: CreateAnswerRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateAnswerResponse>>;
1326
+ /**
1327
+ *
1328
+ * @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.
1329
+ * @param {CreateClassificationRequest} createClassificationRequest
1330
+ * @param {*} [options] Override http request option.
1331
+ * @throws {RequiredError}
1332
+ */
1333
+ createClassification(createClassificationRequest: CreateClassificationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateClassificationResponse>>;
1334
+ /**
1335
+ *
1336
+ * @summary Creates a new completion for the provided prompt and parameters
1337
+ * @param {string} engineId The ID of the engine to use for this request
1338
+ * @param {CreateCompletionRequest} createCompletionRequest
1339
+ * @param {*} [options] Override http request option.
1340
+ * @throws {RequiredError}
1341
+ */
1342
+ createCompletion(engineId: string, createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>>;
1343
+ /**
1344
+ *
1345
+ * @summary Creates a completion using a fine-tuned model
1346
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
1347
+ * @param {*} [options] Override http request option.
1348
+ * @throws {RequiredError}
1349
+ */
1350
+ createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCompletionResponse>>;
1351
+ /**
1352
+ *
1353
+ * @summary Creates an embedding vector representing the input text.
1354
+ * @param {string} engineId The ID of the engine to use for this request
1355
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1356
+ * @param {*} [options] Override http request option.
1357
+ * @throws {RequiredError}
1358
+ */
1359
+ createEmbedding(engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEmbeddingResponse>>;
1360
+ /**
1361
+ *
1362
+ * @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.
1363
+ * @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).
1364
+ * @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.
1365
+ * @param {*} [options] Override http request option.
1366
+ * @throws {RequiredError}
1367
+ */
1368
+ createFile(file: any, purpose: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>>;
1369
+ /**
1370
+ *
1371
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1372
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1373
+ * @param {*} [options] Override http request option.
1374
+ * @throws {RequiredError}
1375
+ */
1376
+ createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FineTune>>;
1377
+ /**
1378
+ *
1379
+ * @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.
1380
+ * @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;.
1381
+ * @param {CreateSearchRequest} createSearchRequest
1382
+ * @param {*} [options] Override http request option.
1383
+ * @throws {RequiredError}
1384
+ */
1385
+ createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateSearchResponse>>;
1386
+ /**
1387
+ *
1388
+ * @summary Delete a file.
1389
+ * @param {string} fileId The ID of the file to use for this request
1390
+ * @param {*} [options] Override http request option.
1391
+ * @throws {RequiredError}
1392
+ */
1393
+ deleteFile(fileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteFileResponse>>;
1394
+ /**
1395
+ *
1396
+ * @summary Returns the contents of the specified file
1397
+ * @param {string} fileId The ID of the file to use for this request
1398
+ * @param {*} [options] Override http request option.
1399
+ * @throws {RequiredError}
1400
+ */
1401
+ downloadFile(fileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>>;
1402
+ /**
1403
+ *
1404
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1405
+ * @param {*} [options] Override http request option.
1406
+ * @throws {RequiredError}
1407
+ */
1408
+ listEngines(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListEnginesResponse>>;
1409
+ /**
1410
+ *
1411
+ * @summary Returns a list of files that belong to the user\'s organization.
1412
+ * @param {*} [options] Override http request option.
1413
+ * @throws {RequiredError}
1414
+ */
1415
+ listFiles(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListFilesResponse>>;
1416
+ /**
1417
+ *
1418
+ * @summary Get fine-grained status updates for a fine-tune job.
1419
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1420
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
1421
+ * @param {*} [options] Override http request option.
1422
+ * @throws {RequiredError}
1423
+ */
1424
+ listFineTuneEvents(fineTuneId: string, stream?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListFineTuneEventsResponse>>;
1425
+ /**
1426
+ *
1427
+ * @summary List your organization\'s fine-tuning jobs
1428
+ * @param {*} [options] Override http request option.
1429
+ * @throws {RequiredError}
1430
+ */
1431
+ listFineTunes(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListFineTunesResponse>>;
1432
+ /**
1433
+ *
1434
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1435
+ * @param {string} engineId The ID of the engine to use for this request
1436
+ * @param {*} [options] Override http request option.
1437
+ * @throws {RequiredError}
1438
+ */
1439
+ retrieveEngine(engineId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Engine>>;
1440
+ /**
1441
+ *
1442
+ * @summary Returns information about a specific file.
1443
+ * @param {string} fileId The ID of the file to use for this request
1444
+ * @param {*} [options] Override http request option.
1445
+ * @throws {RequiredError}
1446
+ */
1447
+ retrieveFile(fileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OpenAIFile>>;
1448
+ /**
1449
+ *
1450
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1451
+ * @param {string} fineTuneId The ID of the fine-tune job
1452
+ * @param {*} [options] Override http request option.
1453
+ * @throws {RequiredError}
1454
+ */
1455
+ retrieveFineTune(fineTuneId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FineTune>>;
1456
+ };
1457
+ /**
1458
+ * OpenAIApi - factory interface
1459
+ * @export
1460
+ */
1461
+ export declare const OpenAIApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
1462
+ /**
1463
+ *
1464
+ * @summary Immediately cancel a fine-tune job.
1465
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1466
+ * @param {*} [options] Override http request option.
1467
+ * @throws {RequiredError}
1468
+ */
1469
+ cancelFineTune(fineTuneId: string, options?: any): AxiosPromise<FineTune>;
1470
+ /**
1471
+ *
1472
+ * @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).
1473
+ * @param {CreateAnswerRequest} createAnswerRequest
1474
+ * @param {*} [options] Override http request option.
1475
+ * @throws {RequiredError}
1476
+ */
1477
+ createAnswer(createAnswerRequest: CreateAnswerRequest, options?: any): AxiosPromise<CreateAnswerResponse>;
1478
+ /**
1479
+ *
1480
+ * @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.
1481
+ * @param {CreateClassificationRequest} createClassificationRequest
1482
+ * @param {*} [options] Override http request option.
1483
+ * @throws {RequiredError}
1484
+ */
1485
+ createClassification(createClassificationRequest: CreateClassificationRequest, options?: any): AxiosPromise<CreateClassificationResponse>;
1486
+ /**
1487
+ *
1488
+ * @summary Creates a new completion for the provided prompt and parameters
1489
+ * @param {string} engineId The ID of the engine to use for this request
1490
+ * @param {CreateCompletionRequest} createCompletionRequest
1491
+ * @param {*} [options] Override http request option.
1492
+ * @throws {RequiredError}
1493
+ */
1494
+ createCompletion(engineId: string, createCompletionRequest: CreateCompletionRequest, options?: any): AxiosPromise<CreateCompletionResponse>;
1495
+ /**
1496
+ *
1497
+ * @summary Creates a completion using a fine-tuned model
1498
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
1499
+ * @param {*} [options] Override http request option.
1500
+ * @throws {RequiredError}
1501
+ */
1502
+ createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: any): AxiosPromise<CreateCompletionResponse>;
1503
+ /**
1504
+ *
1505
+ * @summary Creates an embedding vector representing the input text.
1506
+ * @param {string} engineId The ID of the engine to use for this request
1507
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1508
+ * @param {*} [options] Override http request option.
1509
+ * @throws {RequiredError}
1510
+ */
1511
+ createEmbedding(engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: any): AxiosPromise<CreateEmbeddingResponse>;
1512
+ /**
1513
+ *
1514
+ * @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.
1515
+ * @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).
1516
+ * @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.
1517
+ * @param {*} [options] Override http request option.
1518
+ * @throws {RequiredError}
1519
+ */
1520
+ createFile(file: any, purpose: string, options?: any): AxiosPromise<OpenAIFile>;
1521
+ /**
1522
+ *
1523
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1524
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1525
+ * @param {*} [options] Override http request option.
1526
+ * @throws {RequiredError}
1527
+ */
1528
+ createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: any): AxiosPromise<FineTune>;
1529
+ /**
1530
+ *
1531
+ * @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.
1532
+ * @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;.
1533
+ * @param {CreateSearchRequest} createSearchRequest
1534
+ * @param {*} [options] Override http request option.
1535
+ * @throws {RequiredError}
1536
+ */
1537
+ createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: any): AxiosPromise<CreateSearchResponse>;
1538
+ /**
1539
+ *
1540
+ * @summary Delete a file.
1541
+ * @param {string} fileId The ID of the file to use for this request
1542
+ * @param {*} [options] Override http request option.
1543
+ * @throws {RequiredError}
1544
+ */
1545
+ deleteFile(fileId: string, options?: any): AxiosPromise<DeleteFileResponse>;
1546
+ /**
1547
+ *
1548
+ * @summary Returns the contents of the specified file
1549
+ * @param {string} fileId The ID of the file to use for this request
1550
+ * @param {*} [options] Override http request option.
1551
+ * @throws {RequiredError}
1552
+ */
1553
+ downloadFile(fileId: string, options?: any): AxiosPromise<string>;
1554
+ /**
1555
+ *
1556
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1557
+ * @param {*} [options] Override http request option.
1558
+ * @throws {RequiredError}
1559
+ */
1560
+ listEngines(options?: any): AxiosPromise<ListEnginesResponse>;
1561
+ /**
1562
+ *
1563
+ * @summary Returns a list of files that belong to the user\'s organization.
1564
+ * @param {*} [options] Override http request option.
1565
+ * @throws {RequiredError}
1566
+ */
1567
+ listFiles(options?: any): AxiosPromise<ListFilesResponse>;
1568
+ /**
1569
+ *
1570
+ * @summary Get fine-grained status updates for a fine-tune job.
1571
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1572
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
1573
+ * @param {*} [options] Override http request option.
1574
+ * @throws {RequiredError}
1575
+ */
1576
+ listFineTuneEvents(fineTuneId: string, stream?: boolean, options?: any): AxiosPromise<ListFineTuneEventsResponse>;
1577
+ /**
1578
+ *
1579
+ * @summary List your organization\'s fine-tuning jobs
1580
+ * @param {*} [options] Override http request option.
1581
+ * @throws {RequiredError}
1582
+ */
1583
+ listFineTunes(options?: any): AxiosPromise<ListFineTunesResponse>;
1584
+ /**
1585
+ *
1586
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1587
+ * @param {string} engineId The ID of the engine to use for this request
1588
+ * @param {*} [options] Override http request option.
1589
+ * @throws {RequiredError}
1590
+ */
1591
+ retrieveEngine(engineId: string, options?: any): AxiosPromise<Engine>;
1592
+ /**
1593
+ *
1594
+ * @summary Returns information about a specific file.
1595
+ * @param {string} fileId The ID of the file to use for this request
1596
+ * @param {*} [options] Override http request option.
1597
+ * @throws {RequiredError}
1598
+ */
1599
+ retrieveFile(fileId: string, options?: any): AxiosPromise<OpenAIFile>;
1600
+ /**
1601
+ *
1602
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1603
+ * @param {string} fineTuneId The ID of the fine-tune job
1604
+ * @param {*} [options] Override http request option.
1605
+ * @throws {RequiredError}
1606
+ */
1607
+ retrieveFineTune(fineTuneId: string, options?: any): AxiosPromise<FineTune>;
1608
+ };
1609
+ /**
1610
+ * OpenAIApi - object-oriented interface
1611
+ * @export
1612
+ * @class OpenAIApi
1613
+ * @extends {BaseAPI}
1614
+ */
1615
+ export declare class OpenAIApi extends BaseAPI {
1616
+ /**
1617
+ *
1618
+ * @summary Immediately cancel a fine-tune job.
1619
+ * @param {string} fineTuneId The ID of the fine-tune job to cancel
1620
+ * @param {*} [options] Override http request option.
1621
+ * @throws {RequiredError}
1622
+ * @memberof OpenAIApi
1623
+ */
1624
+ cancelFineTune(fineTuneId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<FineTune, any>>;
1625
+ /**
1626
+ *
1627
+ * @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).
1628
+ * @param {CreateAnswerRequest} createAnswerRequest
1629
+ * @param {*} [options] Override http request option.
1630
+ * @throws {RequiredError}
1631
+ * @memberof OpenAIApi
1632
+ */
1633
+ createAnswer(createAnswerRequest: CreateAnswerRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateAnswerResponse, any>>;
1634
+ /**
1635
+ *
1636
+ * @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.
1637
+ * @param {CreateClassificationRequest} createClassificationRequest
1638
+ * @param {*} [options] Override http request option.
1639
+ * @throws {RequiredError}
1640
+ * @memberof OpenAIApi
1641
+ */
1642
+ createClassification(createClassificationRequest: CreateClassificationRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateClassificationResponse, any>>;
1643
+ /**
1644
+ *
1645
+ * @summary Creates a new completion for the provided prompt and parameters
1646
+ * @param {string} engineId The ID of the engine to use for this request
1647
+ * @param {CreateCompletionRequest} createCompletionRequest
1648
+ * @param {*} [options] Override http request option.
1649
+ * @throws {RequiredError}
1650
+ * @memberof OpenAIApi
1651
+ */
1652
+ createCompletion(engineId: string, createCompletionRequest: CreateCompletionRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCompletionResponse, any>>;
1653
+ /**
1654
+ *
1655
+ * @summary Creates a completion using a fine-tuned model
1656
+ * @param {CreateCompletionFromModelRequest} createCompletionFromModelRequest
1657
+ * @param {*} [options] Override http request option.
1658
+ * @throws {RequiredError}
1659
+ * @memberof OpenAIApi
1660
+ */
1661
+ createCompletionFromModel(createCompletionFromModelRequest: CreateCompletionFromModelRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCompletionResponse, any>>;
1662
+ /**
1663
+ *
1664
+ * @summary Creates an embedding vector representing the input text.
1665
+ * @param {string} engineId The ID of the engine to use for this request
1666
+ * @param {CreateEmbeddingRequest} createEmbeddingRequest
1667
+ * @param {*} [options] Override http request option.
1668
+ * @throws {RequiredError}
1669
+ * @memberof OpenAIApi
1670
+ */
1671
+ createEmbedding(engineId: string, createEmbeddingRequest: CreateEmbeddingRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEmbeddingResponse, any>>;
1672
+ /**
1673
+ *
1674
+ * @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.
1675
+ * @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).
1676
+ * @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.
1677
+ * @param {*} [options] Override http request option.
1678
+ * @throws {RequiredError}
1679
+ * @memberof OpenAIApi
1680
+ */
1681
+ createFile(file: any, purpose: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<OpenAIFile, any>>;
1682
+ /**
1683
+ *
1684
+ * @summary Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1685
+ * @param {CreateFineTuneRequest} createFineTuneRequest
1686
+ * @param {*} [options] Override http request option.
1687
+ * @throws {RequiredError}
1688
+ * @memberof OpenAIApi
1689
+ */
1690
+ createFineTune(createFineTuneRequest: CreateFineTuneRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<FineTune, any>>;
1691
+ /**
1692
+ *
1693
+ * @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.
1694
+ * @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;.
1695
+ * @param {CreateSearchRequest} createSearchRequest
1696
+ * @param {*} [options] Override http request option.
1697
+ * @throws {RequiredError}
1698
+ * @memberof OpenAIApi
1699
+ */
1700
+ createSearch(engineId: string, createSearchRequest: CreateSearchRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateSearchResponse, any>>;
1701
+ /**
1702
+ *
1703
+ * @summary Delete a file.
1704
+ * @param {string} fileId The ID of the file to use for this request
1705
+ * @param {*} [options] Override http request option.
1706
+ * @throws {RequiredError}
1707
+ * @memberof OpenAIApi
1708
+ */
1709
+ deleteFile(fileId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DeleteFileResponse, any>>;
1710
+ /**
1711
+ *
1712
+ * @summary Returns the contents of the specified file
1713
+ * @param {string} fileId The ID of the file to use for this request
1714
+ * @param {*} [options] Override http request option.
1715
+ * @throws {RequiredError}
1716
+ * @memberof OpenAIApi
1717
+ */
1718
+ downloadFile(fileId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<string, any>>;
1719
+ /**
1720
+ *
1721
+ * @summary Lists the currently available engines, and provides basic information about each one such as the owner and availability.
1722
+ * @param {*} [options] Override http request option.
1723
+ * @throws {RequiredError}
1724
+ * @memberof OpenAIApi
1725
+ */
1726
+ listEngines(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListEnginesResponse, any>>;
1727
+ /**
1728
+ *
1729
+ * @summary Returns a list of files that belong to the user\'s organization.
1730
+ * @param {*} [options] Override http request option.
1731
+ * @throws {RequiredError}
1732
+ * @memberof OpenAIApi
1733
+ */
1734
+ listFiles(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListFilesResponse, any>>;
1735
+ /**
1736
+ *
1737
+ * @summary Get fine-grained status updates for a fine-tune job.
1738
+ * @param {string} fineTuneId The ID of the fine-tune job to get events for.
1739
+ * @param {boolean} [stream] Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available. The stream will terminate with a &#x60;data: [DONE]&#x60; message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
1740
+ * @param {*} [options] Override http request option.
1741
+ * @throws {RequiredError}
1742
+ * @memberof OpenAIApi
1743
+ */
1744
+ listFineTuneEvents(fineTuneId: string, stream?: boolean, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListFineTuneEventsResponse, any>>;
1745
+ /**
1746
+ *
1747
+ * @summary List your organization\'s fine-tuning jobs
1748
+ * @param {*} [options] Override http request option.
1749
+ * @throws {RequiredError}
1750
+ * @memberof OpenAIApi
1751
+ */
1752
+ listFineTunes(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListFineTunesResponse, any>>;
1753
+ /**
1754
+ *
1755
+ * @summary Retrieves an engine instance, providing basic information about the engine such as the owner and availability.
1756
+ * @param {string} engineId The ID of the engine to use for this request
1757
+ * @param {*} [options] Override http request option.
1758
+ * @throws {RequiredError}
1759
+ * @memberof OpenAIApi
1760
+ */
1761
+ retrieveEngine(engineId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<Engine, any>>;
1762
+ /**
1763
+ *
1764
+ * @summary Returns information about a specific file.
1765
+ * @param {string} fileId The ID of the file to use for this request
1766
+ * @param {*} [options] Override http request option.
1767
+ * @throws {RequiredError}
1768
+ * @memberof OpenAIApi
1769
+ */
1770
+ retrieveFile(fileId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<OpenAIFile, any>>;
1771
+ /**
1772
+ *
1773
+ * @summary Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning)
1774
+ * @param {string} fineTuneId The ID of the fine-tune job
1775
+ * @param {*} [options] Override http request option.
1776
+ * @throws {RequiredError}
1777
+ * @memberof OpenAIApi
1778
+ */
1779
+ retrieveFineTune(fineTuneId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<FineTune, any>>;
1780
+ }