openai 4.8.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +4 -0
- 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
|
@@ -1,206 +1,200 @@
|
|
|
1
1
|
import * as Core from 'openai/core';
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
3
|
import * as Files from 'openai/resources/files';
|
|
4
|
-
import * as API from
|
|
4
|
+
import * as API from "./index.js";
|
|
5
5
|
import { CursorPage, CursorPageParams } from 'openai/pagination';
|
|
6
6
|
export declare class Jobs extends APIResource {
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
fineTuningJobId: string,
|
|
39
|
-
query?: JobListEventsParams,
|
|
40
|
-
options?: Core.RequestOptions,
|
|
41
|
-
): Core.PagePromise<FineTuningJobEventsPage, FineTuningJobEvent>;
|
|
42
|
-
listEvents(
|
|
43
|
-
fineTuningJobId: string,
|
|
44
|
-
options?: Core.RequestOptions,
|
|
45
|
-
): Core.PagePromise<FineTuningJobEventsPage, FineTuningJobEvent>;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a job that fine-tunes a specified model from a given dataset.
|
|
9
|
+
*
|
|
10
|
+
* Response includes details of the enqueued job including job status and the name
|
|
11
|
+
* of the fine-tuned models once complete.
|
|
12
|
+
*
|
|
13
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
14
|
+
*/
|
|
15
|
+
create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob>;
|
|
16
|
+
/**
|
|
17
|
+
* Get info about a fine-tuning job.
|
|
18
|
+
*
|
|
19
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
20
|
+
*/
|
|
21
|
+
retrieve(fineTuningJobId: string, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob>;
|
|
22
|
+
/**
|
|
23
|
+
* List your organization's fine-tuning jobs
|
|
24
|
+
*/
|
|
25
|
+
list(query?: JobListParams, options?: Core.RequestOptions): Core.PagePromise<FineTuningJobsPage, FineTuningJob>;
|
|
26
|
+
list(options?: Core.RequestOptions): Core.PagePromise<FineTuningJobsPage, FineTuningJob>;
|
|
27
|
+
/**
|
|
28
|
+
* Immediately cancel a fine-tune job.
|
|
29
|
+
*/
|
|
30
|
+
cancel(fineTuningJobId: string, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob>;
|
|
31
|
+
/**
|
|
32
|
+
* Get status updates for a fine-tuning job.
|
|
33
|
+
*/
|
|
34
|
+
listEvents(fineTuningJobId: string, query?: JobListEventsParams, options?: Core.RequestOptions): Core.PagePromise<FineTuningJobEventsPage, FineTuningJobEvent>;
|
|
35
|
+
listEvents(fineTuningJobId: string, options?: Core.RequestOptions): Core.PagePromise<FineTuningJobEventsPage, FineTuningJobEvent>;
|
|
36
|
+
}
|
|
37
|
+
export declare class FineTuningJobsPage extends CursorPage<FineTuningJob> {
|
|
46
38
|
}
|
|
47
|
-
export declare class FineTuningJobsPage extends CursorPage<FineTuningJob> {}
|
|
48
39
|
type _FineTuningJobsPage = FineTuningJobsPage;
|
|
49
|
-
export declare class FineTuningJobEventsPage extends CursorPage<FineTuningJobEvent> {
|
|
40
|
+
export declare class FineTuningJobEventsPage extends CursorPage<FineTuningJobEvent> {
|
|
41
|
+
}
|
|
50
42
|
type _FineTuningJobEventsPage = FineTuningJobEventsPage;
|
|
51
43
|
/**
|
|
52
44
|
* The `fine_tuning.job` object represents a fine-tuning job that has been created
|
|
53
45
|
* through the API.
|
|
54
46
|
*/
|
|
55
47
|
export interface FineTuningJob {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The object identifier, which can be referenced in the API endpoints.
|
|
50
|
+
*/
|
|
51
|
+
id: string;
|
|
52
|
+
/**
|
|
53
|
+
* The Unix timestamp (in seconds) for when the fine-tuning job was created.
|
|
54
|
+
*/
|
|
55
|
+
created_at: number;
|
|
56
|
+
/**
|
|
57
|
+
* The name of the fine-tuned model that is being created.
|
|
58
|
+
*/
|
|
59
|
+
fine_tuned_model: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* The hyperparameters used for the fine-tuning job. See the
|
|
62
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
|
|
63
|
+
* more details.
|
|
64
|
+
*/
|
|
65
|
+
hyperparameters: FineTuningJob.Hyperparameters;
|
|
66
|
+
/**
|
|
67
|
+
* The base model that is being fine-tuned.
|
|
68
|
+
*/
|
|
69
|
+
model: string;
|
|
70
|
+
/**
|
|
71
|
+
* The object type, which is always "fine_tuning.job".
|
|
72
|
+
*/
|
|
73
|
+
object: string;
|
|
74
|
+
/**
|
|
75
|
+
* The organization that owns the fine-tuning job.
|
|
76
|
+
*/
|
|
77
|
+
organization_id: string;
|
|
78
|
+
/**
|
|
79
|
+
* The compiled results files for the fine-tuning job.
|
|
80
|
+
*/
|
|
81
|
+
result_files: Array<Files.FileObject>;
|
|
82
|
+
/**
|
|
83
|
+
* The current status of the fine-tuning job, which can be either `created`,
|
|
84
|
+
* `pending`, `running`, `succeeded`, `failed`, or `cancelled`.
|
|
85
|
+
*/
|
|
86
|
+
status: string;
|
|
87
|
+
/**
|
|
88
|
+
* The total number of billable tokens processed by this fine tuning job.
|
|
89
|
+
*/
|
|
90
|
+
trained_tokens: number;
|
|
91
|
+
/**
|
|
92
|
+
* The file ID used for training.
|
|
93
|
+
*/
|
|
94
|
+
training_file: string;
|
|
95
|
+
/**
|
|
96
|
+
* The file ID used for validation.
|
|
97
|
+
*/
|
|
98
|
+
validation_file: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* The Unix timestamp (in seconds) for when the fine-tuning job was finished.
|
|
101
|
+
*/
|
|
102
|
+
finished_at?: number;
|
|
111
103
|
}
|
|
112
104
|
export declare namespace FineTuningJob {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
105
|
+
/**
|
|
106
|
+
* The hyperparameters used for the fine-tuning job. See the
|
|
107
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
|
|
108
|
+
* more details.
|
|
109
|
+
*/
|
|
110
|
+
interface Hyperparameters {
|
|
111
|
+
/**
|
|
112
|
+
* The number of epochs to train the model for. An epoch refers to one full cycle
|
|
113
|
+
* through the training dataset. "Auto" decides the optimal number of epochs based
|
|
114
|
+
* on the size of the dataset. If setting the number manually, we support any
|
|
115
|
+
* number between 1 and 50 epochs.
|
|
116
|
+
*/
|
|
117
|
+
n_epochs?: 'auto' | number;
|
|
118
|
+
}
|
|
127
119
|
}
|
|
128
120
|
export interface FineTuningJobEvent {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
id: string;
|
|
122
|
+
created_at: number;
|
|
123
|
+
level: 'info' | 'warn' | 'error';
|
|
124
|
+
message: string;
|
|
125
|
+
object: string;
|
|
134
126
|
}
|
|
135
127
|
export interface JobCreateParams {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
128
|
+
/**
|
|
129
|
+
* The name of the model to fine-tune. You can select one of the
|
|
130
|
+
* [supported models](https://platform.openai.com/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
|
|
131
|
+
*/
|
|
132
|
+
model: (string & {}) | 'babbage-002' | 'davinci-002' | 'gpt-3.5-turbo';
|
|
133
|
+
/**
|
|
134
|
+
* The ID of an uploaded file that contains training data.
|
|
135
|
+
*
|
|
136
|
+
* See [upload file](https://platform.openai.com/docs/api-reference/files/upload)
|
|
137
|
+
* for how to upload a file.
|
|
138
|
+
*
|
|
139
|
+
* Your dataset must be formatted as a JSONL file. Additionally, you must upload
|
|
140
|
+
* your file with the purpose `fine-tune`.
|
|
141
|
+
*
|
|
142
|
+
* See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
|
|
143
|
+
* for more details.
|
|
144
|
+
*/
|
|
145
|
+
training_file: string;
|
|
146
|
+
/**
|
|
147
|
+
* The hyperparameters used for the fine-tuning job.
|
|
148
|
+
*/
|
|
149
|
+
hyperparameters?: JobCreateParams.Hyperparameters;
|
|
150
|
+
/**
|
|
151
|
+
* A string of up to 40 characters that will be added to your fine-tuned model
|
|
152
|
+
* name.
|
|
153
|
+
*
|
|
154
|
+
* For example, a `suffix` of "custom-model-name" would produce a model name like
|
|
155
|
+
* `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`.
|
|
156
|
+
*/
|
|
157
|
+
suffix?: string | null;
|
|
158
|
+
/**
|
|
159
|
+
* The ID of an uploaded file that contains validation data.
|
|
160
|
+
*
|
|
161
|
+
* If you provide this file, the data is used to generate validation metrics
|
|
162
|
+
* periodically during fine-tuning. These metrics can be viewed in the fine-tuning
|
|
163
|
+
* results file. The same data should not be present in both train and validation
|
|
164
|
+
* files.
|
|
165
|
+
*
|
|
166
|
+
* Your dataset must be formatted as a JSONL file. You must upload your file with
|
|
167
|
+
* the purpose `fine-tune`.
|
|
168
|
+
*
|
|
169
|
+
* See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
|
|
170
|
+
* for more details.
|
|
171
|
+
*/
|
|
172
|
+
validation_file?: string | null;
|
|
181
173
|
}
|
|
182
174
|
export declare namespace JobCreateParams {
|
|
183
|
-
/**
|
|
184
|
-
* The hyperparameters used for the fine-tuning job.
|
|
185
|
-
*/
|
|
186
|
-
interface Hyperparameters {
|
|
187
175
|
/**
|
|
188
|
-
* The
|
|
189
|
-
* through the training dataset.
|
|
176
|
+
* The hyperparameters used for the fine-tuning job.
|
|
190
177
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
178
|
+
interface Hyperparameters {
|
|
179
|
+
/**
|
|
180
|
+
* The number of epochs to train the model for. An epoch refers to one full cycle
|
|
181
|
+
* through the training dataset.
|
|
182
|
+
*/
|
|
183
|
+
n_epochs?: 'auto' | number;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
export interface JobListParams extends CursorPageParams {
|
|
187
|
+
}
|
|
188
|
+
export interface JobListEventsParams extends CursorPageParams {
|
|
193
189
|
}
|
|
194
|
-
export interface JobListParams extends CursorPageParams {}
|
|
195
|
-
export interface JobListEventsParams extends CursorPageParams {}
|
|
196
190
|
export declare namespace Jobs {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
191
|
+
export import FineTuningJob = API.FineTuningJob;
|
|
192
|
+
export import FineTuningJobEvent = API.FineTuningJobEvent;
|
|
193
|
+
type FineTuningJobsPage = _FineTuningJobsPage;
|
|
194
|
+
type FineTuningJobEventsPage = _FineTuningJobEventsPage;
|
|
195
|
+
export import JobCreateParams = API.JobCreateParams;
|
|
196
|
+
export import JobListParams = API.JobListParams;
|
|
197
|
+
export import JobListEventsParams = API.JobListEventsParams;
|
|
204
198
|
}
|
|
205
199
|
export {};
|
|
206
|
-
//# sourceMappingURL=jobs.d.ts.map
|
|
200
|
+
//# sourceMappingURL=jobs.d.ts.map
|
|
@@ -1,56 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.FineTuningJobEventsPage = exports.FineTuningJobsPage = exports.Jobs = void 0;
|
|
5
|
-
const resource_1 = require(
|
|
6
|
-
const core_1 = require(
|
|
7
|
-
const pagination_1 = require(
|
|
5
|
+
const resource_1 = require("openai/resource");
|
|
6
|
+
const core_1 = require("openai/core");
|
|
7
|
+
const pagination_1 = require("openai/pagination");
|
|
8
8
|
class Jobs extends resource_1.APIResource {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get info about a fine-tuning job.
|
|
22
|
-
*
|
|
23
|
-
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
24
|
-
*/
|
|
25
|
-
retrieve(fineTuningJobId, options) {
|
|
26
|
-
return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options);
|
|
27
|
-
}
|
|
28
|
-
list(query = {}, options) {
|
|
29
|
-
if ((0, core_1.isRequestOptions)(query)) {
|
|
30
|
-
return this.list({}, query);
|
|
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/fine-tuning)
|
|
16
|
+
*/
|
|
17
|
+
create(body, options) {
|
|
18
|
+
return this.post('/fine_tuning/jobs', { body, ...options });
|
|
31
19
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Get info about a fine-tuning job.
|
|
22
|
+
*
|
|
23
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
24
|
+
*/
|
|
25
|
+
retrieve(fineTuningJobId, options) {
|
|
26
|
+
return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options);
|
|
27
|
+
}
|
|
28
|
+
list(query = {}, options) {
|
|
29
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
30
|
+
return this.list({}, query);
|
|
31
|
+
}
|
|
32
|
+
return this.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options });
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Immediately cancel a fine-tune job.
|
|
36
|
+
*/
|
|
37
|
+
cancel(fineTuningJobId, options) {
|
|
38
|
+
return this.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options);
|
|
39
|
+
}
|
|
40
|
+
listEvents(fineTuningJobId, query = {}, options) {
|
|
41
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
42
|
+
return this.listEvents(fineTuningJobId, {}, query);
|
|
43
|
+
}
|
|
44
|
+
return this.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, {
|
|
45
|
+
query,
|
|
46
|
+
...options,
|
|
47
|
+
});
|
|
43
48
|
}
|
|
44
|
-
return this.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, {
|
|
45
|
-
query,
|
|
46
|
-
...options,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
49
|
}
|
|
50
50
|
exports.Jobs = Jobs;
|
|
51
|
-
class FineTuningJobsPage extends pagination_1.CursorPage {
|
|
51
|
+
class FineTuningJobsPage extends pagination_1.CursorPage {
|
|
52
|
+
}
|
|
52
53
|
exports.FineTuningJobsPage = FineTuningJobsPage;
|
|
53
|
-
class FineTuningJobEventsPage extends pagination_1.CursorPage {
|
|
54
|
+
class FineTuningJobEventsPage extends pagination_1.CursorPage {
|
|
55
|
+
}
|
|
54
56
|
exports.FineTuningJobEventsPage = FineTuningJobEventsPage;
|
|
55
|
-
(function (Jobs) {
|
|
56
|
-
|
|
57
|
+
(function (Jobs) {
|
|
58
|
+
})(Jobs = exports.Jobs || (exports.Jobs = {}));
|
|
59
|
+
//# sourceMappingURL=jobs.js.map
|
|
@@ -3,48 +3,51 @@ import { APIResource } from 'openai/resource';
|
|
|
3
3
|
import { isRequestOptions } from 'openai/core';
|
|
4
4
|
import { CursorPage } from 'openai/pagination';
|
|
5
5
|
export class Jobs extends APIResource {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Get info about a fine-tuning job.
|
|
19
|
-
*
|
|
20
|
-
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
21
|
-
*/
|
|
22
|
-
retrieve(fineTuningJobId, options) {
|
|
23
|
-
return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options);
|
|
24
|
-
}
|
|
25
|
-
list(query = {}, options) {
|
|
26
|
-
if (isRequestOptions(query)) {
|
|
27
|
-
return this.list({}, query);
|
|
6
|
+
/**
|
|
7
|
+
* Creates a job that fine-tunes a specified model from a given dataset.
|
|
8
|
+
*
|
|
9
|
+
* Response includes details of the enqueued job including job status and the name
|
|
10
|
+
* of the fine-tuned models once complete.
|
|
11
|
+
*
|
|
12
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
13
|
+
*/
|
|
14
|
+
create(body, options) {
|
|
15
|
+
return this.post('/fine_tuning/jobs', { body, ...options });
|
|
28
16
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
listEvents(fineTuningJobId, query = {}, options) {
|
|
38
|
-
if (isRequestOptions(query)) {
|
|
39
|
-
return this.listEvents(fineTuningJobId, {}, query);
|
|
17
|
+
/**
|
|
18
|
+
* Get info about a fine-tuning job.
|
|
19
|
+
*
|
|
20
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
21
|
+
*/
|
|
22
|
+
retrieve(fineTuningJobId, options) {
|
|
23
|
+
return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options);
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
25
|
+
list(query = {}, options) {
|
|
26
|
+
if (isRequestOptions(query)) {
|
|
27
|
+
return this.list({}, query);
|
|
28
|
+
}
|
|
29
|
+
return this.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Immediately cancel a fine-tune job.
|
|
33
|
+
*/
|
|
34
|
+
cancel(fineTuningJobId, options) {
|
|
35
|
+
return this.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options);
|
|
36
|
+
}
|
|
37
|
+
listEvents(fineTuningJobId, query = {}, options) {
|
|
38
|
+
if (isRequestOptions(query)) {
|
|
39
|
+
return this.listEvents(fineTuningJobId, {}, query);
|
|
40
|
+
}
|
|
41
|
+
return this.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, {
|
|
42
|
+
query,
|
|
43
|
+
...options,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export class FineTuningJobsPage extends CursorPage {
|
|
48
|
+
}
|
|
49
|
+
export class FineTuningJobEventsPage extends CursorPage {
|
|
46
50
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=jobs.mjs.map
|
|
51
|
+
(function (Jobs) {
|
|
52
|
+
})(Jobs || (Jobs = {}));
|
|
53
|
+
//# sourceMappingURL=jobs.mjs.map
|