openai 4.8.0 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +13 -9
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/{src/_shims/ReadableStream-node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +99 -0
- package/_shims/{ReadableStream.js → auto/types.js} +0 -2
- package/{src/_shims/ReadableStream.js → _shims/auto/types.mjs} +0 -2
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +79 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +87 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +54 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +35 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +39 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +35 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +70 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +63 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +82 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +170 -218
- package/core.d.ts.map +1 -1
- package/core.js +679 -737
- package/core.js.map +1 -1
- package/core.mjs +673 -688
- package/core.mjs.map +1 -1
- package/error.d.ts +32 -34
- package/error.js +95 -109
- package/error.mjs +92 -94
- package/index.d.mts +164 -175
- package/index.d.ts +164 -175
- package/index.d.ts.map +1 -1
- package/index.js +110 -161
- package/index.mjs +88 -109
- package/package.json +31 -58
- package/pagination.d.ts +31 -41
- package/pagination.js +52 -48
- package/pagination.mjs +50 -46
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/audio/audio.d.ts +12 -12
- package/resources/audio/audio.js +33 -50
- package/resources/audio/audio.mjs +11 -11
- package/resources/audio/index.d.ts +4 -4
- package/resources/audio/index.js +9 -24
- package/resources/audio/index.mjs +4 -4
- package/resources/audio/transcriptions.d.ts +44 -44
- package/resources/audio/transcriptions.js +13 -12
- package/resources/audio/transcriptions.mjs +9 -8
- package/resources/audio/translations.d.ts +38 -38
- package/resources/audio/translations.js +13 -12
- package/resources/audio/translations.mjs +9 -8
- package/resources/chat/chat.d.ts +17 -17
- package/resources/chat/chat.js +30 -47
- package/resources/chat/chat.mjs +8 -8
- package/resources/chat/completions.d.ts +330 -353
- package/resources/chat/completions.js +10 -13
- package/resources/chat/completions.mjs +7 -10
- package/resources/chat/index.d.ts +3 -17
- package/resources/chat/index.js +7 -17
- package/resources/chat/index.mjs +3 -3
- package/resources/completions.d.ts +216 -232
- package/resources/completions.js +10 -13
- package/resources/completions.mjs +7 -10
- package/resources/edits.d.ts +73 -73
- package/resources/edits.js +16 -15
- package/resources/edits.mjs +13 -12
- package/resources/embeddings.d.ts +73 -76
- package/resources/embeddings.js +12 -11
- package/resources/embeddings.mjs +9 -8
- package/resources/files.d.ts +91 -96
- package/resources/files.js +64 -65
- package/resources/files.mjs +57 -58
- package/resources/fine-tunes.d.ts +277 -290
- package/resources/fine-tunes.js +49 -50
- package/resources/fine-tunes.mjs +45 -46
- package/resources/fine-tuning/fine-tuning.d.ts +12 -12
- package/resources/fine-tuning/fine-tuning.js +32 -49
- package/resources/fine-tuning/fine-tuning.mjs +10 -10
- package/resources/fine-tuning/index.d.ts +3 -12
- package/resources/fine-tuning/index.js +9 -29
- package/resources/fine-tuning/index.mjs +3 -3
- package/resources/fine-tuning/jobs.d.ts +173 -179
- package/resources/fine-tuning/jobs.js +50 -47
- package/resources/fine-tuning/jobs.mjs +45 -42
- package/resources/images.d.ts +116 -119
- package/resources/images.js +25 -24
- package/resources/images.mjs +21 -20
- package/resources/index.d.ts +12 -37
- package/resources/index.js +29 -113
- package/resources/index.mjs +12 -12
- package/resources/models.d.ts +41 -40
- package/resources/models.js +30 -28
- package/resources/models.mjs +26 -24
- package/resources/moderations.d.ts +153 -156
- package/resources/moderations.js +12 -11
- package/resources/moderations.mjs +9 -8
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +99 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +79 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +79 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +62 -0
- package/src/_shims/web-runtime.ts +91 -0
- package/src/_shims/web-types.d.ts +82 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +34 -17
- package/src/error.ts +1 -1
- package/src/index.ts +6 -6
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/audio/audio.ts +4 -4
- package/src/resources/audio/index.ts +3 -3
- package/src/resources/audio/transcriptions.ts +4 -4
- package/src/resources/audio/translations.ts +4 -4
- package/src/resources/chat/chat.ts +3 -3
- package/src/resources/chat/completions.ts +6 -6
- package/src/resources/chat/index.ts +2 -2
- package/src/resources/completions.ts +5 -5
- package/src/resources/edits.ts +4 -4
- package/src/resources/embeddings.ts +3 -3
- package/src/resources/files.ts +7 -7
- package/src/resources/fine-tunes.ts +7 -7
- package/src/resources/fine-tuning/fine-tuning.ts +3 -3
- package/src/resources/fine-tuning/index.ts +2 -2
- package/src/resources/fine-tuning/jobs.ts +6 -6
- package/src/resources/images.ts +4 -4
- package/src/resources/index.ts +11 -11
- package/src/resources/models.ts +4 -4
- package/src/resources/moderations.ts +3 -3
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/streaming.ts +1 -1
- package/src/uploads.ts +12 -16
- package/src/version.ts +1 -1
- package/streaming.d.ts +9 -8
- package/streaming.d.ts.map +1 -1
- package/streaming.js +194 -185
- package/streaming.mjs +192 -183
- package/uploads.d.ts +23 -39
- package/uploads.d.ts.map +1 -1
- package/uploads.js +115 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +111 -133
- package/uploads.mjs.map +1 -1
- package/version.d.ts +2 -2
- package/version.js +4 -4
- package/version.mjs +2 -2
- package/_shims/ReadableStream-node.d.ts +0 -6
- package/_shims/ReadableStream-node.d.ts.map +0 -1
- package/_shims/ReadableStream-node.js +0 -14
- package/_shims/ReadableStream-node.js.map +0 -1
- package/_shims/ReadableStream-node.mjs +0 -3
- package/_shims/ReadableStream-node.mjs.map +0 -1
- package/_shims/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- package/_shims/agent-node.d.ts +0 -7
- package/_shims/agent-node.d.ts.map +0 -1
- package/_shims/agent-node.js +0 -28
- package/_shims/agent-node.js.map +0 -1
- package/_shims/agent-node.mjs +0 -16
- package/_shims/agent-node.mjs.map +0 -1
- package/_shims/agent.d.ts +0 -9
- package/_shims/agent.d.ts.map +0 -1
- package/_shims/agent.js +0 -14
- package/_shims/agent.js.map +0 -1
- package/_shims/agent.mjs +0 -10
- package/_shims/agent.mjs.map +0 -1
- package/_shims/fetch-node.d.ts +0 -64
- package/_shims/fetch-node.js +0 -12
- package/_shims/fetch-node.mjs +0 -14
- package/_shims/fetch.d.ts +0 -60
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- package/_shims/fileFromPath-node.d.ts +0 -17
- package/_shims/fileFromPath-node.d.ts.map +0 -1
- package/_shims/fileFromPath-node.js +0 -17
- package/_shims/fileFromPath-node.js.map +0 -1
- package/_shims/fileFromPath-node.mjs +0 -13
- package/_shims/fileFromPath-node.mjs.map +0 -1
- package/_shims/fileFromPath.d.ts +0 -22
- package/_shims/fileFromPath.d.ts.map +0 -1
- package/_shims/fileFromPath.js +0 -16
- package/_shims/fileFromPath.js.map +0 -1
- package/_shims/fileFromPath.mjs +0 -12
- package/_shims/fileFromPath.mjs.map +0 -1
- package/_shims/form-data-node.d.ts +0 -45
- package/_shims/form-data-node.js +0 -11
- package/_shims/form-data-node.mjs +0 -9
- package/_shims/form-data.d.ts +0 -43
- package/_shims/form-data.js +0 -17
- package/_shims/form-data.mjs +0 -20
- package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
- package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions-node.js +0 -22
- package/_shims/getMultipartRequestOptions-node.js.map +0 -1
- package/_shims/getMultipartRequestOptions-node.mjs +0 -18
- package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
- package/_shims/getMultipartRequestOptions.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.js +0 -12
- package/_shims/getMultipartRequestOptions.js.map +0 -1
- package/_shims/getMultipartRequestOptions.mjs +0 -8
- package/_shims/getMultipartRequestOptions.mjs.map +0 -1
- package/_shims/node-readable-node.d.ts +0 -8
- package/_shims/node-readable-node.d.ts.map +0 -1
- package/_shims/node-readable-node.js +0 -9
- package/_shims/node-readable-node.js.map +0 -1
- package/_shims/node-readable-node.mjs +0 -5
- package/_shims/node-readable-node.mjs.map +0 -1
- package/_shims/node-readable.d.ts +0 -23
- package/_shims/node-readable.d.ts.map +0 -1
- package/_shims/node-readable.js +0 -11
- package/_shims/node-readable.js.map +0 -1
- package/_shims/node-readable.mjs +0 -7
- package/_shims/node-readable.mjs.map +0 -1
- package/src/_shims/ReadableStream.d.ts +0 -38
- package/src/_shims/ReadableStream.mjs +0 -7
- package/src/_shims/agent-node.ts +0 -22
- package/src/_shims/agent.ts +0 -12
- package/src/_shims/fetch-node.d.ts +0 -64
- package/src/_shims/fetch-node.js +0 -12
- package/src/_shims/fetch-node.mjs +0 -14
- package/src/_shims/fetch.d.ts +0 -60
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fileFromPath-node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/form-data-node.d.ts +0 -45
- package/src/_shims/form-data-node.js +0 -11
- package/src/_shims/form-data-node.mjs +0 -9
- package/src/_shims/form-data.d.ts +0 -43
- package/src/_shims/form-data.js +0 -17
- package/src/_shims/form-data.mjs +0 -20
- package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
- package/src/_shims/getMultipartRequestOptions.ts +0 -14
- package/src/_shims/node-readable-node.ts +0 -10
- package/src/_shims/node-readable.ts +0 -30
|
@@ -2,338 +2,325 @@ import * as Core from 'openai/core';
|
|
|
2
2
|
import { APIPromise } from 'openai/core';
|
|
3
3
|
import { APIResource } from 'openai/resource';
|
|
4
4
|
import * as Files from 'openai/resources/files';
|
|
5
|
-
import * as API from
|
|
5
|
+
import * as API from "./index.js";
|
|
6
6
|
import { Page } from 'openai/pagination';
|
|
7
7
|
import { Stream } from 'openai/streaming';
|
|
8
8
|
export declare class FineTunes extends APIResource {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fineTuneId: string,
|
|
37
|
-
query?:
|
|
38
|
-
options?: Core.RequestOptions,
|
|
39
|
-
): APIPromise<FineTuneEventsListResponse>;
|
|
40
|
-
listEvents(
|
|
41
|
-
fineTuneId: string,
|
|
42
|
-
query: FineTuneListEventsParamsStreaming,
|
|
43
|
-
options?: Core.RequestOptions,
|
|
44
|
-
): APIPromise<Stream<FineTuneEvent>>;
|
|
45
|
-
listEvents(
|
|
46
|
-
fineTuneId: string,
|
|
47
|
-
query?: FineTuneListEventsParamsBase | undefined,
|
|
48
|
-
options?: Core.RequestOptions,
|
|
49
|
-
): APIPromise<Stream<FineTuneEvent> | FineTuneEventsListResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a job that fine-tunes a specified model from a given dataset.
|
|
11
|
+
*
|
|
12
|
+
* Response includes details of the enqueued job including job status and the name
|
|
13
|
+
* of the fine-tuned models once complete.
|
|
14
|
+
*
|
|
15
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
|
|
16
|
+
*/
|
|
17
|
+
create(body: FineTuneCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTune>;
|
|
18
|
+
/**
|
|
19
|
+
* Gets info about the fine-tune job.
|
|
20
|
+
*
|
|
21
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
|
|
22
|
+
*/
|
|
23
|
+
retrieve(fineTuneId: string, options?: Core.RequestOptions): Core.APIPromise<FineTune>;
|
|
24
|
+
/**
|
|
25
|
+
* List your organization's fine-tuning jobs
|
|
26
|
+
*/
|
|
27
|
+
list(options?: Core.RequestOptions): Core.PagePromise<FineTunesPage, FineTune>;
|
|
28
|
+
/**
|
|
29
|
+
* Immediately cancel a fine-tune job.
|
|
30
|
+
*/
|
|
31
|
+
cancel(fineTuneId: string, options?: Core.RequestOptions): Core.APIPromise<FineTune>;
|
|
32
|
+
/**
|
|
33
|
+
* Get fine-grained status updates for a fine-tune job.
|
|
34
|
+
*/
|
|
35
|
+
listEvents(fineTuneId: string, query?: FineTuneListEventsParamsNonStreaming, options?: Core.RequestOptions): APIPromise<FineTuneEventsListResponse>;
|
|
36
|
+
listEvents(fineTuneId: string, query: FineTuneListEventsParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<FineTuneEvent>>;
|
|
37
|
+
listEvents(fineTuneId: string, query?: FineTuneListEventsParamsBase | undefined, options?: Core.RequestOptions): APIPromise<Stream<FineTuneEvent> | FineTuneEventsListResponse>;
|
|
50
38
|
}
|
|
51
39
|
/**
|
|
52
40
|
* Note: no pagination actually occurs yet, this is for forwards-compatibility.
|
|
53
41
|
*/
|
|
54
|
-
export declare class FineTunesPage extends Page<FineTune> {
|
|
42
|
+
export declare class FineTunesPage extends Page<FineTune> {
|
|
43
|
+
}
|
|
55
44
|
type _FineTunesPage = FineTunesPage;
|
|
56
45
|
/**
|
|
57
46
|
* The `FineTune` object represents a legacy fine-tune job that has been created
|
|
58
47
|
* through the API.
|
|
59
48
|
*/
|
|
60
49
|
export interface FineTune {
|
|
61
|
-
/**
|
|
62
|
-
* The object identifier, which can be referenced in the API endpoints.
|
|
63
|
-
*/
|
|
64
|
-
id: string;
|
|
65
|
-
/**
|
|
66
|
-
* The Unix timestamp (in seconds) for when the fine-tuning job was created.
|
|
67
|
-
*/
|
|
68
|
-
created_at: number;
|
|
69
|
-
/**
|
|
70
|
-
* The name of the fine-tuned model that is being created.
|
|
71
|
-
*/
|
|
72
|
-
fine_tuned_model: string | null;
|
|
73
|
-
/**
|
|
74
|
-
* The hyperparameters used for the fine-tuning job. See the
|
|
75
|
-
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
76
|
-
* for more details.
|
|
77
|
-
*/
|
|
78
|
-
hyperparams: FineTune.Hyperparams;
|
|
79
|
-
/**
|
|
80
|
-
* The base model that is being fine-tuned.
|
|
81
|
-
*/
|
|
82
|
-
model: string;
|
|
83
|
-
/**
|
|
84
|
-
* The object type, which is always "fine-tune".
|
|
85
|
-
*/
|
|
86
|
-
object: string;
|
|
87
|
-
/**
|
|
88
|
-
* The organization that owns the fine-tuning job.
|
|
89
|
-
*/
|
|
90
|
-
organization_id: string;
|
|
91
|
-
/**
|
|
92
|
-
* The compiled results files for the fine-tuning job.
|
|
93
|
-
*/
|
|
94
|
-
result_files: Array<Files.FileObject>;
|
|
95
|
-
/**
|
|
96
|
-
* The current status of the fine-tuning job, which can be either `created`,
|
|
97
|
-
* `running`, `succeeded`, `failed`, or `cancelled`.
|
|
98
|
-
*/
|
|
99
|
-
status: string;
|
|
100
|
-
/**
|
|
101
|
-
* The list of files used for training.
|
|
102
|
-
*/
|
|
103
|
-
training_files: Array<Files.FileObject>;
|
|
104
|
-
/**
|
|
105
|
-
* The Unix timestamp (in seconds) for when the fine-tuning job was last updated.
|
|
106
|
-
*/
|
|
107
|
-
updated_at: number;
|
|
108
|
-
/**
|
|
109
|
-
* The list of files used for validation.
|
|
110
|
-
*/
|
|
111
|
-
validation_files: Array<Files.FileObject>;
|
|
112
|
-
/**
|
|
113
|
-
* The list of events that have been observed in the lifecycle of the FineTune job.
|
|
114
|
-
*/
|
|
115
|
-
events?: Array<FineTuneEvent>;
|
|
116
|
-
}
|
|
117
|
-
export declare namespace FineTune {
|
|
118
|
-
/**
|
|
119
|
-
* The hyperparameters used for the fine-tuning job. See the
|
|
120
|
-
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
121
|
-
* for more details.
|
|
122
|
-
*/
|
|
123
|
-
interface Hyperparams {
|
|
124
50
|
/**
|
|
125
|
-
* The
|
|
126
|
-
* examples used to train a single forward and backward pass.
|
|
51
|
+
* The object identifier, which can be referenced in the API endpoints.
|
|
127
52
|
*/
|
|
128
|
-
|
|
53
|
+
id: string;
|
|
129
54
|
/**
|
|
130
|
-
* The
|
|
55
|
+
* The Unix timestamp (in seconds) for when the fine-tuning job was created.
|
|
131
56
|
*/
|
|
132
|
-
|
|
57
|
+
created_at: number;
|
|
133
58
|
/**
|
|
134
|
-
* The
|
|
135
|
-
* through the training dataset.
|
|
59
|
+
* The name of the fine-tuned model that is being created.
|
|
136
60
|
*/
|
|
137
|
-
|
|
61
|
+
fine_tuned_model: string | null;
|
|
138
62
|
/**
|
|
139
|
-
* The
|
|
63
|
+
* The hyperparameters used for the fine-tuning job. See the
|
|
64
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
65
|
+
* for more details.
|
|
140
66
|
*/
|
|
141
|
-
|
|
67
|
+
hyperparams: FineTune.Hyperparams;
|
|
142
68
|
/**
|
|
143
|
-
* The
|
|
69
|
+
* The base model that is being fine-tuned.
|
|
144
70
|
*/
|
|
145
|
-
|
|
71
|
+
model: string;
|
|
146
72
|
/**
|
|
147
|
-
* The
|
|
73
|
+
* The object type, which is always "fine-tune".
|
|
148
74
|
*/
|
|
149
|
-
|
|
75
|
+
object: string;
|
|
150
76
|
/**
|
|
151
|
-
* The
|
|
152
|
-
* every epoch.
|
|
77
|
+
* The organization that owns the fine-tuning job.
|
|
153
78
|
*/
|
|
154
|
-
|
|
155
|
-
|
|
79
|
+
organization_id: string;
|
|
80
|
+
/**
|
|
81
|
+
* The compiled results files for the fine-tuning job.
|
|
82
|
+
*/
|
|
83
|
+
result_files: Array<Files.FileObject>;
|
|
84
|
+
/**
|
|
85
|
+
* The current status of the fine-tuning job, which can be either `created`,
|
|
86
|
+
* `running`, `succeeded`, `failed`, or `cancelled`.
|
|
87
|
+
*/
|
|
88
|
+
status: string;
|
|
89
|
+
/**
|
|
90
|
+
* The list of files used for training.
|
|
91
|
+
*/
|
|
92
|
+
training_files: Array<Files.FileObject>;
|
|
93
|
+
/**
|
|
94
|
+
* The Unix timestamp (in seconds) for when the fine-tuning job was last updated.
|
|
95
|
+
*/
|
|
96
|
+
updated_at: number;
|
|
97
|
+
/**
|
|
98
|
+
* The list of files used for validation.
|
|
99
|
+
*/
|
|
100
|
+
validation_files: Array<Files.FileObject>;
|
|
101
|
+
/**
|
|
102
|
+
* The list of events that have been observed in the lifecycle of the FineTune job.
|
|
103
|
+
*/
|
|
104
|
+
events?: Array<FineTuneEvent>;
|
|
105
|
+
}
|
|
106
|
+
export declare namespace FineTune {
|
|
107
|
+
/**
|
|
108
|
+
* The hyperparameters used for the fine-tuning job. See the
|
|
109
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
110
|
+
* for more details.
|
|
111
|
+
*/
|
|
112
|
+
interface Hyperparams {
|
|
113
|
+
/**
|
|
114
|
+
* The batch size to use for training. The batch size is the number of training
|
|
115
|
+
* examples used to train a single forward and backward pass.
|
|
116
|
+
*/
|
|
117
|
+
batch_size: number;
|
|
118
|
+
/**
|
|
119
|
+
* The learning rate multiplier to use for training.
|
|
120
|
+
*/
|
|
121
|
+
learning_rate_multiplier: number;
|
|
122
|
+
/**
|
|
123
|
+
* The number of epochs to train the model for. An epoch refers to one full cycle
|
|
124
|
+
* through the training dataset.
|
|
125
|
+
*/
|
|
126
|
+
n_epochs: number;
|
|
127
|
+
/**
|
|
128
|
+
* The weight to use for loss on the prompt tokens.
|
|
129
|
+
*/
|
|
130
|
+
prompt_loss_weight: number;
|
|
131
|
+
/**
|
|
132
|
+
* The number of classes to use for computing classification metrics.
|
|
133
|
+
*/
|
|
134
|
+
classification_n_classes?: number;
|
|
135
|
+
/**
|
|
136
|
+
* The positive class to use for computing classification metrics.
|
|
137
|
+
*/
|
|
138
|
+
classification_positive_class?: string;
|
|
139
|
+
/**
|
|
140
|
+
* The classification metrics to compute using the validation dataset at the end of
|
|
141
|
+
* every epoch.
|
|
142
|
+
*/
|
|
143
|
+
compute_classification_metrics?: boolean;
|
|
144
|
+
}
|
|
156
145
|
}
|
|
157
146
|
export interface FineTuneEvent {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
147
|
+
created_at: number;
|
|
148
|
+
level: string;
|
|
149
|
+
message: string;
|
|
150
|
+
object: string;
|
|
162
151
|
}
|
|
163
152
|
export interface FineTuneEventsListResponse {
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
data: Array<FineTuneEvent>;
|
|
154
|
+
object: string;
|
|
166
155
|
}
|
|
167
156
|
export interface FineTuneCreateParams {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
157
|
+
/**
|
|
158
|
+
* The ID of an uploaded file that contains training data.
|
|
159
|
+
*
|
|
160
|
+
* See [upload file](https://platform.openai.com/docs/api-reference/files/upload)
|
|
161
|
+
* for how to upload a file.
|
|
162
|
+
*
|
|
163
|
+
* Your dataset must be formatted as a JSONL file, where each training example is a
|
|
164
|
+
* JSON object with the keys "prompt" and "completion". Additionally, you must
|
|
165
|
+
* upload your file with the purpose `fine-tune`.
|
|
166
|
+
*
|
|
167
|
+
* See the
|
|
168
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/creating-training-data)
|
|
169
|
+
* for more details.
|
|
170
|
+
*/
|
|
171
|
+
training_file: string;
|
|
172
|
+
/**
|
|
173
|
+
* The batch size to use for training. The batch size is the number of training
|
|
174
|
+
* examples used to train a single forward and backward pass.
|
|
175
|
+
*
|
|
176
|
+
* By default, the batch size will be dynamically configured to be ~0.2% of the
|
|
177
|
+
* number of examples in the training set, capped at 256 - in general, we've found
|
|
178
|
+
* that larger batch sizes tend to work better for larger datasets.
|
|
179
|
+
*/
|
|
180
|
+
batch_size?: number | null;
|
|
181
|
+
/**
|
|
182
|
+
* If this is provided, we calculate F-beta scores at the specified beta values.
|
|
183
|
+
* The F-beta score is a generalization of F-1 score. This is only used for binary
|
|
184
|
+
* classification.
|
|
185
|
+
*
|
|
186
|
+
* With a beta of 1 (i.e. the F-1 score), precision and recall are given the same
|
|
187
|
+
* weight. A larger beta score puts more weight on recall and less on precision. A
|
|
188
|
+
* smaller beta score puts more weight on precision and less on recall.
|
|
189
|
+
*/
|
|
190
|
+
classification_betas?: Array<number> | null;
|
|
191
|
+
/**
|
|
192
|
+
* The number of classes in a classification task.
|
|
193
|
+
*
|
|
194
|
+
* This parameter is required for multiclass classification.
|
|
195
|
+
*/
|
|
196
|
+
classification_n_classes?: number | null;
|
|
197
|
+
/**
|
|
198
|
+
* The positive class in binary classification.
|
|
199
|
+
*
|
|
200
|
+
* This parameter is needed to generate precision, recall, and F1 metrics when
|
|
201
|
+
* doing binary classification.
|
|
202
|
+
*/
|
|
203
|
+
classification_positive_class?: string | null;
|
|
204
|
+
/**
|
|
205
|
+
* If set, we calculate classification-specific metrics such as accuracy and F-1
|
|
206
|
+
* score using the validation set at the end of every epoch. These metrics can be
|
|
207
|
+
* viewed in the
|
|
208
|
+
* [results file](https://platform.openai.com/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).
|
|
209
|
+
*
|
|
210
|
+
* In order to compute classification metrics, you must provide a
|
|
211
|
+
* `validation_file`. Additionally, you must specify `classification_n_classes` for
|
|
212
|
+
* multiclass classification or `classification_positive_class` for binary
|
|
213
|
+
* classification.
|
|
214
|
+
*/
|
|
215
|
+
compute_classification_metrics?: boolean | null;
|
|
216
|
+
/**
|
|
217
|
+
* The learning rate multiplier to use for training. The fine-tuning learning rate
|
|
218
|
+
* is the original learning rate used for pretraining multiplied by this value.
|
|
219
|
+
*
|
|
220
|
+
* By default, the learning rate multiplier is the 0.05, 0.1, or 0.2 depending on
|
|
221
|
+
* final `batch_size` (larger learning rates tend to perform better with larger
|
|
222
|
+
* batch sizes). We recommend experimenting with values in the range 0.02 to 0.2 to
|
|
223
|
+
* see what produces the best results.
|
|
224
|
+
*/
|
|
225
|
+
learning_rate_multiplier?: number | null;
|
|
226
|
+
/**
|
|
227
|
+
* The name of the base model to fine-tune. You can select one of "ada", "babbage",
|
|
228
|
+
* "curie", "davinci", or a fine-tuned model created after 2022-04-21 and before
|
|
229
|
+
* 2023-08-22. To learn more about these models, see the
|
|
230
|
+
* [Models](https://platform.openai.com/docs/models) documentation.
|
|
231
|
+
*/
|
|
232
|
+
model?: (string & {}) | 'ada' | 'babbage' | 'curie' | 'davinci' | null;
|
|
233
|
+
/**
|
|
234
|
+
* The number of epochs to train the model for. An epoch refers to one full cycle
|
|
235
|
+
* through the training dataset.
|
|
236
|
+
*/
|
|
237
|
+
n_epochs?: number | null;
|
|
238
|
+
/**
|
|
239
|
+
* The weight to use for loss on the prompt tokens. This controls how much the
|
|
240
|
+
* model tries to learn to generate the prompt (as compared to the completion which
|
|
241
|
+
* always has a weight of 1.0), and can add a stabilizing effect to training when
|
|
242
|
+
* completions are short.
|
|
243
|
+
*
|
|
244
|
+
* If prompts are extremely long (relative to completions), it may make sense to
|
|
245
|
+
* reduce this weight so as to avoid over-prioritizing learning the prompt.
|
|
246
|
+
*/
|
|
247
|
+
prompt_loss_weight?: number | null;
|
|
248
|
+
/**
|
|
249
|
+
* A string of up to 40 characters that will be added to your fine-tuned model
|
|
250
|
+
* name.
|
|
251
|
+
*
|
|
252
|
+
* For example, a `suffix` of "custom-model-name" would produce a model name like
|
|
253
|
+
* `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`.
|
|
254
|
+
*/
|
|
255
|
+
suffix?: string | null;
|
|
256
|
+
/**
|
|
257
|
+
* The ID of an uploaded file that contains validation data.
|
|
258
|
+
*
|
|
259
|
+
* If you provide this file, the data is used to generate validation metrics
|
|
260
|
+
* periodically during fine-tuning. These metrics can be viewed in the
|
|
261
|
+
* [fine-tuning results file](https://platform.openai.com/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).
|
|
262
|
+
* Your train and validation data should be mutually exclusive.
|
|
263
|
+
*
|
|
264
|
+
* Your dataset must be formatted as a JSONL file, where each validation example is
|
|
265
|
+
* a JSON object with the keys "prompt" and "completion". Additionally, you must
|
|
266
|
+
* upload your file with the purpose `fine-tune`.
|
|
267
|
+
*
|
|
268
|
+
* See the
|
|
269
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/creating-training-data)
|
|
270
|
+
* for more details.
|
|
271
|
+
*/
|
|
272
|
+
validation_file?: string | null;
|
|
284
273
|
}
|
|
285
|
-
export type FineTuneListEventsParams =
|
|
286
|
-
| FineTuneListEventsParamsNonStreaming
|
|
287
|
-
| FineTuneListEventsParamsStreaming;
|
|
274
|
+
export type FineTuneListEventsParams = FineTuneListEventsParamsNonStreaming | FineTuneListEventsParamsStreaming;
|
|
288
275
|
export interface FineTuneListEventsParamsBase {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
276
|
+
/**
|
|
277
|
+
* Whether to stream events for the fine-tune job. If set to true, events will be
|
|
278
|
+
* sent as data-only
|
|
279
|
+
* [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
280
|
+
* as they become available. The stream will terminate with a `data: [DONE]`
|
|
281
|
+
* message when the job is finished (succeeded, cancelled, or failed).
|
|
282
|
+
*
|
|
283
|
+
* If set to false, only events generated so far will be returned.
|
|
284
|
+
*/
|
|
285
|
+
stream?: boolean;
|
|
299
286
|
}
|
|
300
287
|
export declare namespace FineTuneListEventsParams {
|
|
301
|
-
|
|
302
|
-
|
|
288
|
+
type FineTuneListEventsParamsNonStreaming = API.FineTuneListEventsParamsNonStreaming;
|
|
289
|
+
type FineTuneListEventsParamsStreaming = API.FineTuneListEventsParamsStreaming;
|
|
303
290
|
}
|
|
304
291
|
export interface FineTuneListEventsParamsNonStreaming extends FineTuneListEventsParamsBase {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
292
|
+
/**
|
|
293
|
+
* Whether to stream events for the fine-tune job. If set to true, events will be
|
|
294
|
+
* sent as data-only
|
|
295
|
+
* [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
296
|
+
* as they become available. The stream will terminate with a `data: [DONE]`
|
|
297
|
+
* message when the job is finished (succeeded, cancelled, or failed).
|
|
298
|
+
*
|
|
299
|
+
* If set to false, only events generated so far will be returned.
|
|
300
|
+
*/
|
|
301
|
+
stream?: false;
|
|
315
302
|
}
|
|
316
303
|
export interface FineTuneListEventsParamsStreaming extends FineTuneListEventsParamsBase {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
304
|
+
/**
|
|
305
|
+
* Whether to stream events for the fine-tune job. If set to true, events will be
|
|
306
|
+
* sent as data-only
|
|
307
|
+
* [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
308
|
+
* as they become available. The stream will terminate with a `data: [DONE]`
|
|
309
|
+
* message when the job is finished (succeeded, cancelled, or failed).
|
|
310
|
+
*
|
|
311
|
+
* If set to false, only events generated so far will be returned.
|
|
312
|
+
*/
|
|
313
|
+
stream: true;
|
|
327
314
|
}
|
|
328
315
|
export declare namespace FineTunes {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
316
|
+
export import FineTune = API.FineTune;
|
|
317
|
+
export import FineTuneEvent = API.FineTuneEvent;
|
|
318
|
+
export import FineTuneEventsListResponse = API.FineTuneEventsListResponse;
|
|
319
|
+
type FineTunesPage = _FineTunesPage;
|
|
320
|
+
export import FineTuneCreateParams = API.FineTuneCreateParams;
|
|
321
|
+
export import FineTuneListEventsParams = API.FineTuneListEventsParams;
|
|
322
|
+
export import FineTuneListEventsParamsNonStreaming = API.FineTuneListEventsParamsNonStreaming;
|
|
323
|
+
export import FineTuneListEventsParamsStreaming = API.FineTuneListEventsParamsStreaming;
|
|
337
324
|
}
|
|
338
325
|
export {};
|
|
339
|
-
//# sourceMappingURL=fine-tunes.d.ts.map
|
|
326
|
+
//# sourceMappingURL=fine-tunes.d.ts.map
|