RagModelPackManifest.fromJsonString constructor
RagModelPackManifest.fromJsonString(
- String source
Implementation
factory RagModelPackManifest.fromJsonString(String source) {
try {
final decoded = jsonDecode(source);
if (decoded is! Map<String, dynamic>) {
throw const RagModelPackException(
RagModelPackErrorCode.invalidManifest,
'The model-pack manifest must be a JSON object.',
);
}
return RagModelPackManifest.fromJson(decoded);
} on FormatException catch (_) {
throw const RagModelPackException(
RagModelPackErrorCode.invalidManifest,
'The model-pack manifest is not valid JSON.',
);
}
}