listFineTuneEvents method
Get fine-grained status updates for a fine-tune job.
Parameters:
-
String fineTuneId (required): The ID of the fine-tune job to get events for.
-
bool stream: Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only server-sent events as they become available. The stream will terminate with a
data: [DONE]message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned.
Implementation
Future<ListFineTuneEventsResponse?> listFineTuneEvents(String fineTuneId, { bool? stream, }) async {
final response = await listFineTuneEventsWithHttpInfo(fineTuneId, stream: stream, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ListFineTuneEventsResponse',) as ListFineTuneEventsResponse;
}
return null;
}