openai 1.1.3 → 2.0.4

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