openai 4.5.0 → 4.7.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 +22 -0
- package/README.md +2 -2
- package/core.d.ts.map +1 -1
- package/core.js +4 -2
- package/core.js.map +1 -1
- package/core.mjs +4 -2
- package/core.mjs.map +1 -1
- package/package.json +8 -26
- package/resources/audio/audio.js +1 -1
- package/resources/audio/audio.mjs +1 -1
- package/resources/audio/transcriptions.d.ts +3 -2
- package/resources/audio/transcriptions.d.ts.map +1 -1
- package/resources/audio/transcriptions.js +2 -2
- package/resources/audio/transcriptions.js.map +1 -1
- package/resources/audio/transcriptions.mjs +2 -2
- package/resources/audio/transcriptions.mjs.map +1 -1
- package/resources/audio/translations.d.ts +3 -2
- package/resources/audio/translations.d.ts.map +1 -1
- package/resources/audio/translations.js +2 -2
- package/resources/audio/translations.js.map +1 -1
- package/resources/audio/translations.mjs +2 -2
- package/resources/audio/translations.mjs.map +1 -1
- package/resources/chat/chat.d.ts +1 -0
- package/resources/chat/chat.d.ts.map +1 -1
- package/resources/chat/chat.js +1 -1
- package/resources/chat/chat.js.map +1 -1
- package/resources/chat/chat.mjs +1 -1
- package/resources/chat/chat.mjs.map +1 -1
- package/resources/chat/completions.d.ts +15 -8
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js +1 -1
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs +1 -1
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/chat/index.d.ts +1 -0
- package/resources/chat/index.d.ts.map +1 -1
- package/resources/chat/index.js.map +1 -1
- package/resources/chat/index.mjs.map +1 -1
- package/resources/completions.d.ts +8 -6
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js +1 -1
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs +1 -1
- package/resources/completions.mjs.map +1 -1
- package/resources/edits.js +1 -1
- package/resources/edits.mjs +1 -1
- package/resources/embeddings.d.ts +8 -5
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +1 -1
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +1 -1
- package/resources/embeddings.mjs.map +1 -1
- package/resources/files.d.ts +3 -2
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +5 -5
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +5 -5
- package/resources/files.mjs.map +1 -1
- package/resources/fine-tunes.d.ts +16 -15
- package/resources/fine-tunes.d.ts.map +1 -1
- package/resources/fine-tunes.js +4 -4
- package/resources/fine-tunes.js.map +1 -1
- package/resources/fine-tunes.mjs +4 -4
- package/resources/fine-tunes.mjs.map +1 -1
- package/resources/fine-tuning/fine-tuning.js +1 -1
- package/resources/fine-tuning/fine-tuning.mjs +1 -1
- package/resources/fine-tuning/jobs.d.ts +13 -8
- package/resources/fine-tuning/jobs.d.ts.map +1 -1
- package/resources/fine-tuning/jobs.js +5 -5
- package/resources/fine-tuning/jobs.js.map +1 -1
- package/resources/fine-tuning/jobs.mjs +5 -5
- package/resources/fine-tuning/jobs.mjs.map +1 -1
- package/resources/images.d.ts +6 -3
- package/resources/images.d.ts.map +1 -1
- package/resources/images.js +2 -2
- package/resources/images.js.map +1 -1
- package/resources/images.mjs +2 -2
- package/resources/images.mjs.map +1 -1
- package/resources/models.js +2 -2
- package/resources/models.mjs +2 -2
- package/resources/moderations.js +1 -1
- package/resources/moderations.mjs +1 -1
- package/src/core.ts +3 -0
- package/src/resources/audio/transcriptions.ts +3 -2
- package/src/resources/audio/translations.ts +3 -2
- package/src/resources/chat/chat.ts +1 -0
- package/src/resources/chat/completions.ts +16 -8
- package/src/resources/chat/index.ts +1 -0
- package/src/resources/completions.ts +8 -6
- package/src/resources/embeddings.ts +8 -5
- package/src/resources/files.ts +3 -2
- package/src/resources/fine-tunes.ts +16 -15
- package/src/resources/fine-tuning/jobs.ts +13 -8
- package/src/resources/images.ts +6 -3
- package/src/version.ts +1 -1
- package/uploads.js +4 -4
- package/uploads.mjs +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -15,7 +15,7 @@ export class FineTunes extends APIResource {
|
|
|
15
15
|
* Response includes details of the enqueued job including job status and the name
|
|
16
16
|
* of the fine-tuned models once complete.
|
|
17
17
|
*
|
|
18
|
-
* [Learn more about fine-tuning](/docs/guides/legacy-fine-tuning)
|
|
18
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
|
|
19
19
|
*/
|
|
20
20
|
create(body: FineTuneCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTune> {
|
|
21
21
|
return this.post('/fine-tunes', { body, ...options });
|
|
@@ -24,7 +24,7 @@ export class FineTunes extends APIResource {
|
|
|
24
24
|
/**
|
|
25
25
|
* Gets info about the fine-tune job.
|
|
26
26
|
*
|
|
27
|
-
* [Learn more about fine-tuning](/docs/guides/legacy-fine-tuning)
|
|
27
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
|
|
28
28
|
*/
|
|
29
29
|
retrieve(fineTuneId: string, options?: Core.RequestOptions): Core.APIPromise<FineTune> {
|
|
30
30
|
return this.get(`/fine-tunes/${fineTuneId}`, options);
|
|
@@ -105,8 +105,8 @@ export interface FineTune {
|
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* The hyperparameters used for the fine-tuning job. See the
|
|
108
|
-
* [fine-tuning guide](/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
109
|
-
* details.
|
|
108
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
109
|
+
* for more details.
|
|
110
110
|
*/
|
|
111
111
|
hyperparams: FineTune.Hyperparams;
|
|
112
112
|
|
|
@@ -160,8 +160,8 @@ export interface FineTune {
|
|
|
160
160
|
export namespace FineTune {
|
|
161
161
|
/**
|
|
162
162
|
* The hyperparameters used for the fine-tuning job. See the
|
|
163
|
-
* [fine-tuning guide](/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
164
|
-
* details.
|
|
163
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/hyperparameters)
|
|
164
|
+
* for more details.
|
|
165
165
|
*/
|
|
166
166
|
export interface Hyperparams {
|
|
167
167
|
/**
|
|
@@ -224,15 +224,16 @@ export interface FineTuneCreateParams {
|
|
|
224
224
|
/**
|
|
225
225
|
* The ID of an uploaded file that contains training data.
|
|
226
226
|
*
|
|
227
|
-
* See [upload file](/docs/api-reference/files/upload)
|
|
227
|
+
* See [upload file](https://platform.openai.com/docs/api-reference/files/upload)
|
|
228
|
+
* for how to upload a file.
|
|
228
229
|
*
|
|
229
230
|
* Your dataset must be formatted as a JSONL file, where each training example is a
|
|
230
231
|
* JSON object with the keys "prompt" and "completion". Additionally, you must
|
|
231
232
|
* upload your file with the purpose `fine-tune`.
|
|
232
233
|
*
|
|
233
234
|
* See the
|
|
234
|
-
* [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data)
|
|
235
|
-
* more details.
|
|
235
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/creating-training-data)
|
|
236
|
+
* for more details.
|
|
236
237
|
*/
|
|
237
238
|
training_file: string;
|
|
238
239
|
|
|
@@ -276,7 +277,7 @@ export interface FineTuneCreateParams {
|
|
|
276
277
|
* If set, we calculate classification-specific metrics such as accuracy and F-1
|
|
277
278
|
* score using the validation set at the end of every epoch. These metrics can be
|
|
278
279
|
* viewed in the
|
|
279
|
-
* [results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).
|
|
280
|
+
* [results file](https://platform.openai.com/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).
|
|
280
281
|
*
|
|
281
282
|
* In order to compute classification metrics, you must provide a
|
|
282
283
|
* `validation_file`. Additionally, you must specify `classification_n_classes` for
|
|
@@ -299,8 +300,8 @@ export interface FineTuneCreateParams {
|
|
|
299
300
|
/**
|
|
300
301
|
* The name of the base model to fine-tune. You can select one of "ada", "babbage",
|
|
301
302
|
* "curie", "davinci", or a fine-tuned model created after 2022-04-21 and before
|
|
302
|
-
* 2023-08-22. To learn more about these models, see the
|
|
303
|
-
* documentation.
|
|
303
|
+
* 2023-08-22. To learn more about these models, see the
|
|
304
|
+
* [Models](https://platform.openai.com/docs/models) documentation.
|
|
304
305
|
*/
|
|
305
306
|
model?: (string & {}) | 'ada' | 'babbage' | 'curie' | 'davinci' | null;
|
|
306
307
|
|
|
@@ -335,7 +336,7 @@ export interface FineTuneCreateParams {
|
|
|
335
336
|
*
|
|
336
337
|
* If you provide this file, the data is used to generate validation metrics
|
|
337
338
|
* periodically during fine-tuning. These metrics can be viewed in the
|
|
338
|
-
* [fine-tuning results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).
|
|
339
|
+
* [fine-tuning results file](https://platform.openai.com/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).
|
|
339
340
|
* Your train and validation data should be mutually exclusive.
|
|
340
341
|
*
|
|
341
342
|
* Your dataset must be formatted as a JSONL file, where each validation example is
|
|
@@ -343,8 +344,8 @@ export interface FineTuneCreateParams {
|
|
|
343
344
|
* upload your file with the purpose `fine-tune`.
|
|
344
345
|
*
|
|
345
346
|
* See the
|
|
346
|
-
* [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data)
|
|
347
|
-
* more details.
|
|
347
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/legacy-fine-tuning/creating-training-data)
|
|
348
|
+
* for more details.
|
|
348
349
|
*/
|
|
349
350
|
validation_file?: string | null;
|
|
350
351
|
}
|
|
@@ -14,7 +14,7 @@ export class Jobs extends APIResource {
|
|
|
14
14
|
* Response includes details of the enqueued job including job status and the name
|
|
15
15
|
* of the fine-tuned models once complete.
|
|
16
16
|
*
|
|
17
|
-
* [Learn more about fine-tuning](/docs/guides/fine-tuning)
|
|
17
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
18
18
|
*/
|
|
19
19
|
create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> {
|
|
20
20
|
return this.post('/fine_tuning/jobs', { body, ...options });
|
|
@@ -23,7 +23,7 @@ export class Jobs extends APIResource {
|
|
|
23
23
|
/**
|
|
24
24
|
* Get info about a fine-tuning job.
|
|
25
25
|
*
|
|
26
|
-
* [Learn more about fine-tuning](/docs/guides/fine-tuning)
|
|
26
|
+
* [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
|
|
27
27
|
*/
|
|
28
28
|
retrieve(fineTuningJobId: string, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> {
|
|
29
29
|
return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options);
|
|
@@ -111,7 +111,8 @@ export interface FineTuningJob {
|
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
113
|
* The hyperparameters used for the fine-tuning job. See the
|
|
114
|
-
* [fine-tuning guide](/docs/guides/fine-tuning) for
|
|
114
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
|
|
115
|
+
* more details.
|
|
115
116
|
*/
|
|
116
117
|
hyperparameters: FineTuningJob.Hyperparameters;
|
|
117
118
|
|
|
@@ -165,7 +166,8 @@ export interface FineTuningJob {
|
|
|
165
166
|
export namespace FineTuningJob {
|
|
166
167
|
/**
|
|
167
168
|
* The hyperparameters used for the fine-tuning job. See the
|
|
168
|
-
* [fine-tuning guide](/docs/guides/fine-tuning) for
|
|
169
|
+
* [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
|
|
170
|
+
* more details.
|
|
169
171
|
*/
|
|
170
172
|
export interface Hyperparameters {
|
|
171
173
|
/**
|
|
@@ -193,19 +195,21 @@ export interface FineTuningJobEvent {
|
|
|
193
195
|
export interface JobCreateParams {
|
|
194
196
|
/**
|
|
195
197
|
* The name of the model to fine-tune. You can select one of the
|
|
196
|
-
* [supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
|
|
198
|
+
* [supported models](https://platform.openai.com/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
|
|
197
199
|
*/
|
|
198
200
|
model: (string & {}) | 'babbage-002' | 'davinci-002' | 'gpt-3.5-turbo';
|
|
199
201
|
|
|
200
202
|
/**
|
|
201
203
|
* The ID of an uploaded file that contains training data.
|
|
202
204
|
*
|
|
203
|
-
* See [upload file](/docs/api-reference/files/upload)
|
|
205
|
+
* See [upload file](https://platform.openai.com/docs/api-reference/files/upload)
|
|
206
|
+
* for how to upload a file.
|
|
204
207
|
*
|
|
205
208
|
* Your dataset must be formatted as a JSONL file. Additionally, you must upload
|
|
206
209
|
* your file with the purpose `fine-tune`.
|
|
207
210
|
*
|
|
208
|
-
* See the [fine-tuning guide](/docs/guides/fine-tuning)
|
|
211
|
+
* See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
|
|
212
|
+
* for more details.
|
|
209
213
|
*/
|
|
210
214
|
training_file: string;
|
|
211
215
|
|
|
@@ -234,7 +238,8 @@ export interface JobCreateParams {
|
|
|
234
238
|
* Your dataset must be formatted as a JSONL file. You must upload your file with
|
|
235
239
|
* the purpose `fine-tune`.
|
|
236
240
|
*
|
|
237
|
-
* See the [fine-tuning guide](/docs/guides/fine-tuning)
|
|
241
|
+
* See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
|
|
242
|
+
* for more details.
|
|
238
243
|
*/
|
|
239
244
|
validation_file?: string | null;
|
|
240
245
|
}
|
package/src/resources/images.ts
CHANGED
|
@@ -79,7 +79,8 @@ export interface ImageCreateVariationParams {
|
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
82
|
-
* and detect abuse.
|
|
82
|
+
* and detect abuse.
|
|
83
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
|
|
83
84
|
*/
|
|
84
85
|
user?: string;
|
|
85
86
|
}
|
|
@@ -123,7 +124,8 @@ export interface ImageEditParams {
|
|
|
123
124
|
|
|
124
125
|
/**
|
|
125
126
|
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
126
|
-
* and detect abuse.
|
|
127
|
+
* and detect abuse.
|
|
128
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
|
|
127
129
|
*/
|
|
128
130
|
user?: string;
|
|
129
131
|
}
|
|
@@ -154,7 +156,8 @@ export interface ImageGenerateParams {
|
|
|
154
156
|
|
|
155
157
|
/**
|
|
156
158
|
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
157
|
-
* and detect abuse.
|
|
159
|
+
* and detect abuse.
|
|
160
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
|
|
158
161
|
*/
|
|
159
162
|
user?: string;
|
|
160
163
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.7.0'; // x-release-please-version
|
package/uploads.js
CHANGED
|
@@ -12,16 +12,16 @@ exports.createForm =
|
|
|
12
12
|
exports.isResponseLike =
|
|
13
13
|
exports.fileFromPath =
|
|
14
14
|
void 0;
|
|
15
|
-
const form_data_1 = require('openai/_shims/form-data
|
|
16
|
-
const getMultipartRequestOptions_1 = require('openai/_shims/getMultipartRequestOptions
|
|
17
|
-
const fileFromPath_1 = require('openai/_shims/fileFromPath
|
|
15
|
+
const form_data_1 = require('openai/_shims/form-data');
|
|
16
|
+
const getMultipartRequestOptions_1 = require('openai/_shims/getMultipartRequestOptions');
|
|
17
|
+
const fileFromPath_1 = require('openai/_shims/fileFromPath');
|
|
18
18
|
Object.defineProperty(exports, 'fileFromPath', {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
21
|
return fileFromPath_1.fileFromPath;
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
-
const node_readable_1 = require('openai/_shims/node-readable
|
|
24
|
+
const node_readable_1 = require('openai/_shims/node-readable');
|
|
25
25
|
const isResponseLike = (value) =>
|
|
26
26
|
value != null &&
|
|
27
27
|
typeof value === 'object' &&
|
package/uploads.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormData, File } from 'openai/_shims/form-data
|
|
2
|
-
import { getMultipartRequestOptions } from 'openai/_shims/getMultipartRequestOptions
|
|
3
|
-
import { fileFromPath } from 'openai/_shims/fileFromPath
|
|
4
|
-
import { isFsReadStream } from 'openai/_shims/node-readable
|
|
1
|
+
import { FormData, File } from 'openai/_shims/form-data';
|
|
2
|
+
import { getMultipartRequestOptions } from 'openai/_shims/getMultipartRequestOptions';
|
|
3
|
+
import { fileFromPath } from 'openai/_shims/fileFromPath';
|
|
4
|
+
import { isFsReadStream } from 'openai/_shims/node-readable';
|
|
5
5
|
export { fileFromPath };
|
|
6
6
|
export const isResponseLike = (value) =>
|
|
7
7
|
value != null &&
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = '4.
|
|
1
|
+
export declare const VERSION = '4.7.0';
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.7.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|