33import * as Core from 'openai/core' ;
44import { APIResource } from 'openai/resource' ;
55import { isRequestOptions } from 'openai/core' ;
6- import * as Files from 'openai/resources/files' ;
76import * as API from './index' ;
87import { CursorPage , CursorPageParams } from 'openai/pagination' ;
98
@@ -105,10 +104,23 @@ export interface FineTuningJob {
105104 created_at : number ;
106105
107106 /**
108- * The name of the fine-tuned model that is being created.
107+ * For fine-tuning jobs that have `failed`, this will contain more information on
108+ * the cause of the failure.
109+ */
110+ error : FineTuningJob . Error | null ;
111+
112+ /**
113+ * The name of the fine-tuned model that is being created. The value will be null
114+ * if the fine-tuning job is still running.
109115 */
110116 fine_tuned_model : string | null ;
111117
118+ /**
119+ * The Unix timestamp (in seconds) for when the fine-tuning job was finished. The
120+ * value will be null if the fine-tuning job is still running.
121+ */
122+ finished_at : number | null ;
123+
112124 /**
113125 * The hyperparameters used for the fine-tuning job. See the
114126 * [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
@@ -132,38 +144,61 @@ export interface FineTuningJob {
132144 organization_id : string ;
133145
134146 /**
135- * The compiled results files for the fine-tuning job.
147+ * The compiled results file ID(s) for the fine-tuning job. You can retrieve the
148+ * results with the
149+ * [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents).
136150 */
137- result_files : Array < Files . FileObject > ;
151+ result_files : Array < string > ;
138152
139153 /**
140- * The current status of the fine-tuning job, which can be either `created`,
141- * `pending `, `running`, `succeeded`, `failed`, or `cancelled`.
154+ * The current status of the fine-tuning job, which can be either
155+ * `validating_files`, `queued `, `running`, `succeeded`, `failed`, or `cancelled`.
142156 */
143157 status : string ;
144158
145159 /**
146- * The total number of billable tokens processed by this fine tuning job.
160+ * The total number of billable tokens processed by this fine-tuning job. The value
161+ * will be null if the fine-tuning job is still running.
147162 */
148- trained_tokens : number ;
163+ trained_tokens : number | null ;
149164
150165 /**
151- * The file ID used for training.
166+ * The file ID used for training. You can retrieve the training data with the
167+ * [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents).
152168 */
153169 training_file : string ;
154170
155171 /**
156- * The file ID used for validation.
172+ * The file ID used for validation. You can retrieve the validation results with
173+ * the
174+ * [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents).
157175 */
158176 validation_file : string | null ;
177+ }
159178
179+ export namespace FineTuningJob {
160180 /**
161- * The Unix timestamp (in seconds) for when the fine-tuning job was finished.
181+ * For fine-tuning jobs that have `failed`, this will contain more information on
182+ * the cause of the failure.
162183 */
163- finished_at ?: number ;
164- }
184+ export interface Error {
185+ /**
186+ * A machine-readable error code.
187+ */
188+ code : string ;
189+
190+ /**
191+ * A human-readable error message.
192+ */
193+ message : string ;
194+
195+ /**
196+ * The parameter that was invalid, usually `training_file` or `validation_file`.
197+ * This field will be null if the failure was not parameter-specific.
198+ */
199+ param : string | null ;
200+ }
165201
166- export namespace FineTuningJob {
167202 /**
168203 * The hyperparameters used for the fine-tuning job. See the
169204 * [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
@@ -172,11 +207,11 @@ export namespace FineTuningJob {
172207 export interface Hyperparameters {
173208 /**
174209 * The number of epochs to train the model for. An epoch refers to one full cycle
175- * through the training dataset. "Auto " decides the optimal number of epochs based
210+ * through the training dataset. "auto " decides the optimal number of epochs based
176211 * on the size of the dataset. If setting the number manually, we support any
177212 * number between 1 and 50 epochs.
178213 */
179- n_epochs ? : 'auto' | number ;
214+ n_epochs : 'auto' | number ;
180215 }
181216}
182217
@@ -219,7 +254,7 @@ export interface JobCreateParams {
219254 hyperparameters ?: JobCreateParams . Hyperparameters ;
220255
221256 /**
222- * A string of up to 40 characters that will be added to your fine-tuned model
257+ * A string of up to 18 characters that will be added to your fine-tuned model
223258 * name.
224259 *
225260 * For example, a `suffix` of "custom-model-name" would produce a model name like
0 commit comments