in pkgs/google_generative_ai/lib/src/api.dart [743:756]
CitationSource _parseCitationSource(Object? jsonObject) {
if (jsonObject is! Map) {
throw unhandledFormat('CitationSource', jsonObject);
}
final uriString = jsonObject['uri'] as String?;
return CitationSource(
jsonObject['startIndex'] as int?,
jsonObject['endIndex'] as int?,
uriString != null ? Uri.parse(uriString) : null,
jsonObject['license'] as String?,
);
}