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.
Files changed (100) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +2 -2
  3. package/core.d.ts.map +1 -1
  4. package/core.js +4 -2
  5. package/core.js.map +1 -1
  6. package/core.mjs +4 -2
  7. package/core.mjs.map +1 -1
  8. package/package.json +8 -26
  9. package/resources/audio/audio.js +1 -1
  10. package/resources/audio/audio.mjs +1 -1
  11. package/resources/audio/transcriptions.d.ts +3 -2
  12. package/resources/audio/transcriptions.d.ts.map +1 -1
  13. package/resources/audio/transcriptions.js +2 -2
  14. package/resources/audio/transcriptions.js.map +1 -1
  15. package/resources/audio/transcriptions.mjs +2 -2
  16. package/resources/audio/transcriptions.mjs.map +1 -1
  17. package/resources/audio/translations.d.ts +3 -2
  18. package/resources/audio/translations.d.ts.map +1 -1
  19. package/resources/audio/translations.js +2 -2
  20. package/resources/audio/translations.js.map +1 -1
  21. package/resources/audio/translations.mjs +2 -2
  22. package/resources/audio/translations.mjs.map +1 -1
  23. package/resources/chat/chat.d.ts +1 -0
  24. package/resources/chat/chat.d.ts.map +1 -1
  25. package/resources/chat/chat.js +1 -1
  26. package/resources/chat/chat.js.map +1 -1
  27. package/resources/chat/chat.mjs +1 -1
  28. package/resources/chat/chat.mjs.map +1 -1
  29. package/resources/chat/completions.d.ts +15 -8
  30. package/resources/chat/completions.d.ts.map +1 -1
  31. package/resources/chat/completions.js +1 -1
  32. package/resources/chat/completions.js.map +1 -1
  33. package/resources/chat/completions.mjs +1 -1
  34. package/resources/chat/completions.mjs.map +1 -1
  35. package/resources/chat/index.d.ts +1 -0
  36. package/resources/chat/index.d.ts.map +1 -1
  37. package/resources/chat/index.js.map +1 -1
  38. package/resources/chat/index.mjs.map +1 -1
  39. package/resources/completions.d.ts +8 -6
  40. package/resources/completions.d.ts.map +1 -1
  41. package/resources/completions.js +1 -1
  42. package/resources/completions.js.map +1 -1
  43. package/resources/completions.mjs +1 -1
  44. package/resources/completions.mjs.map +1 -1
  45. package/resources/edits.js +1 -1
  46. package/resources/edits.mjs +1 -1
  47. package/resources/embeddings.d.ts +8 -5
  48. package/resources/embeddings.d.ts.map +1 -1
  49. package/resources/embeddings.js +1 -1
  50. package/resources/embeddings.js.map +1 -1
  51. package/resources/embeddings.mjs +1 -1
  52. package/resources/embeddings.mjs.map +1 -1
  53. package/resources/files.d.ts +3 -2
  54. package/resources/files.d.ts.map +1 -1
  55. package/resources/files.js +5 -5
  56. package/resources/files.js.map +1 -1
  57. package/resources/files.mjs +5 -5
  58. package/resources/files.mjs.map +1 -1
  59. package/resources/fine-tunes.d.ts +16 -15
  60. package/resources/fine-tunes.d.ts.map +1 -1
  61. package/resources/fine-tunes.js +4 -4
  62. package/resources/fine-tunes.js.map +1 -1
  63. package/resources/fine-tunes.mjs +4 -4
  64. package/resources/fine-tunes.mjs.map +1 -1
  65. package/resources/fine-tuning/fine-tuning.js +1 -1
  66. package/resources/fine-tuning/fine-tuning.mjs +1 -1
  67. package/resources/fine-tuning/jobs.d.ts +13 -8
  68. package/resources/fine-tuning/jobs.d.ts.map +1 -1
  69. package/resources/fine-tuning/jobs.js +5 -5
  70. package/resources/fine-tuning/jobs.js.map +1 -1
  71. package/resources/fine-tuning/jobs.mjs +5 -5
  72. package/resources/fine-tuning/jobs.mjs.map +1 -1
  73. package/resources/images.d.ts +6 -3
  74. package/resources/images.d.ts.map +1 -1
  75. package/resources/images.js +2 -2
  76. package/resources/images.js.map +1 -1
  77. package/resources/images.mjs +2 -2
  78. package/resources/images.mjs.map +1 -1
  79. package/resources/models.js +2 -2
  80. package/resources/models.mjs +2 -2
  81. package/resources/moderations.js +1 -1
  82. package/resources/moderations.mjs +1 -1
  83. package/src/core.ts +3 -0
  84. package/src/resources/audio/transcriptions.ts +3 -2
  85. package/src/resources/audio/translations.ts +3 -2
  86. package/src/resources/chat/chat.ts +1 -0
  87. package/src/resources/chat/completions.ts +16 -8
  88. package/src/resources/chat/index.ts +1 -0
  89. package/src/resources/completions.ts +8 -6
  90. package/src/resources/embeddings.ts +8 -5
  91. package/src/resources/files.ts +3 -2
  92. package/src/resources/fine-tunes.ts +16 -15
  93. package/src/resources/fine-tuning/jobs.ts +13 -8
  94. package/src/resources/images.ts +6 -3
  95. package/src/version.ts +1 -1
  96. package/uploads.js +4 -4
  97. package/uploads.mjs +4 -4
  98. package/version.d.ts +1 -1
  99. package/version.js +1 -1
  100. 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) for more
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) for more
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) for how to upload a file.
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) for
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 [Models](/docs/models)
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) for
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 more details.
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 more details.
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) for how to upload a file.
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) for more details.
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) for more details.
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
  }
@@ -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. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
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. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
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. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
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.5.0'; // x-release-please-version
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.js');
16
- const getMultipartRequestOptions_1 = require('openai/_shims/getMultipartRequestOptions.js');
17
- const fileFromPath_1 = require('openai/_shims/fileFromPath.js');
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.js');
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.mjs';
2
- import { getMultipartRequestOptions } from 'openai/_shims/getMultipartRequestOptions.mjs';
3
- import { fileFromPath } from 'openai/_shims/fileFromPath.mjs';
4
- import { isFsReadStream } from 'openai/_shims/node-readable.mjs';
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.5.0';
1
+ export declare const VERSION = '4.7.0';
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '4.5.0'; // x-release-please-version
4
+ exports.VERSION = '4.7.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.5.0'; // x-release-please-version
1
+ export const VERSION = '4.7.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map