AugmentPromptResponse.fromJson constructor
AugmentPromptResponse.fromJson(
- Object? j
Implementation
factory AugmentPromptResponse.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return AugmentPromptResponse(
augmentedPrompt: switch (json['augmentedPrompt']) {
null => [],
List<Object?> $1 => [for (final i in $1) Content.fromJson(i)],
_ => throw const FormatException('"augmentedPrompt" is not a list'),
},
facts: switch (json['facts']) {
null => [],
List<Object?> $1 => [for (final i in $1) Fact.fromJson(i)],
_ => throw const FormatException('"facts" is not a list'),
},
);
}