CreateTunedModelMetadata.fromJson constructor
CreateTunedModelMetadata.fromJson(
- Object? j
Implementation
factory CreateTunedModelMetadata.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return CreateTunedModelMetadata(
tunedModel: switch (json['tunedModel']) {
null => '',
Object $1 => decodeString($1),
},
totalSteps: switch (json['totalSteps']) {
null => 0,
Object $1 => decodeInt($1),
},
completedSteps: switch (json['completedSteps']) {
null => 0,
Object $1 => decodeInt($1),
},
completedPercent: switch (json['completedPercent']) {
null => 0,
Object $1 => decodeDouble($1),
},
snapshots: switch (json['snapshots']) {
null => [],
List<Object?> $1 => [for (final i in $1) TuningSnapshot.fromJson(i)],
_ => throw const FormatException('"snapshots" is not a list'),
},
);
}