RubricGenerationSpec.fromJson constructor

RubricGenerationSpec.fromJson(
  1. Object? j
)

Implementation

factory RubricGenerationSpec.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return RubricGenerationSpec(
    promptTemplate: switch (json['promptTemplate']) {
      null => '',
      Object $1 => decodeString($1),
    },
    modelConfig: switch (json['modelConfig']) {
      null => null,
      Object $1 => AutoraterConfig.fromJson($1),
    },
    rubricContentType: switch (json['rubricContentType']) {
      null => RubricGenerationSpec_RubricContentType.$default,
      Object $1 => RubricGenerationSpec_RubricContentType.fromJson($1),
    },
    rubricTypeOntology: switch (json['rubricTypeOntology']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"rubricTypeOntology" is not a list'),
    },
  );
}