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