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