DatasetStats.fromJson constructor

DatasetStats.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DatasetStats.fromJson(Map<String, dynamic> json) {
  return DatasetStats(
    tuningDatasetExampleCount:
        decodeInt64(json['tuningDatasetExampleCount']) ?? 0,
    totalTuningCharacterCount:
        decodeInt64(json['totalTuningCharacterCount']) ?? 0,
    totalBillableCharacterCount:
        decodeInt64(json['totalBillableCharacterCount']) ?? 0,
    tuningStepCount: decodeInt64(json['tuningStepCount']) ?? 0,
    userInputTokenDistribution: decode(
      json['userInputTokenDistribution'],
      DatasetDistribution.fromJson,
    ),
    userOutputTokenDistribution: decode(
      json['userOutputTokenDistribution'],
      DatasetDistribution.fromJson,
    ),
    userMessagePerExampleDistribution: decode(
      json['userMessagePerExampleDistribution'],
      DatasetDistribution.fromJson,
    ),
    userDatasetExamples:
        decodeListMessage(json['userDatasetExamples'], Content.fromJson) ??
        [],
  );
}