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