@scout9/admin 1.0.0 → 1.0.2

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