@@ -144,6 +144,23 @@ export class FineTuning extends APIResource {
144144 listEvents ( id : string , options ?: RequestOptions ) : APIPromise < FineTuningListEventsResponse > {
145145 return this . _client . get ( path `/fine-tunes/${ id } /events` , options ) ;
146146 }
147+
148+ /**
149+ * Retrieves recorded training metrics for a fine-tuning job in chronological
150+ * order. All query parameters are optional: omit them to retrieve all metrics.
151+ *
152+ * @example
153+ * ```ts
154+ * const response = await client.fineTuning.listMetrics('id');
155+ * ```
156+ */
157+ listMetrics (
158+ id : string ,
159+ query : FineTuningListMetricsParams | null | undefined = { } ,
160+ options ?: RequestOptions ,
161+ ) : APIPromise < FineTuningListMetricsResponse > {
162+ return this . _client . get ( path `/fine-tunes/${ id } /metrics` , { query, ...options } ) ;
163+ }
147164}
148165
149166export interface FinetuneEvent {
@@ -1269,6 +1286,10 @@ export interface FineTuningListEventsResponse {
12691286 data : Array < FinetuneEvent > ;
12701287}
12711288
1289+ export interface FineTuningListMetricsResponse {
1290+ metrics ?: Array < { [ key : string ] : number } > ;
1291+ }
1292+
12721293export interface FineTuningCreateParams {
12731294 /**
12741295 * Name of the base model to run fine-tune job on
@@ -1646,6 +1667,33 @@ export namespace FineTuningEstimatePriceParams {
16461667 }
16471668}
16481669
1670+ export interface FineTuningListMetricsParams {
1671+ /**
1672+ * Return only metrics with global_step >= this value.
1673+ */
1674+ global_step_from ?: number ;
1675+
1676+ /**
1677+ * Return only metrics with global_step <= this value.
1678+ */
1679+ global_step_to ?: number ;
1680+
1681+ /**
1682+ * Return only metrics logged at or after this ISO-8601 timestamp.
1683+ */
1684+ logged_at_from ?: string ;
1685+
1686+ /**
1687+ * Return only metrics logged at or before this ISO-8601 timestamp.
1688+ */
1689+ logged_at_to ?: string ;
1690+
1691+ /**
1692+ * Number of (uniformly sampled) train metrics to return.
1693+ */
1694+ resolution ?: number ;
1695+ }
1696+
16491697export declare namespace FineTuning {
16501698 export {
16511699 type FinetuneEvent as FinetuneEvent ,
@@ -1658,9 +1706,11 @@ export declare namespace FineTuning {
16581706 type FineTuningEstimatePriceResponse as FineTuningEstimatePriceResponse ,
16591707 type FineTuningListCheckpointsResponse as FineTuningListCheckpointsResponse ,
16601708 type FineTuningListEventsResponse as FineTuningListEventsResponse ,
1709+ type FineTuningListMetricsResponse as FineTuningListMetricsResponse ,
16611710 type FineTuningCreateParams as FineTuningCreateParams ,
16621711 type FineTuningDeleteParams as FineTuningDeleteParams ,
16631712 type FineTuningContentParams as FineTuningContentParams ,
16641713 type FineTuningEstimatePriceParams as FineTuningEstimatePriceParams ,
1714+ type FineTuningListMetricsParams as FineTuningListMetricsParams ,
16651715 } ;
16661716}
0 commit comments