EmbedContentResponse parseEmbedContentResponse()

in pkgs/google_generative_ai/lib/src/api.dart [617:624]


EmbedContentResponse parseEmbedContentResponse(Object jsonObject) {
  return switch (jsonObject) {
    {'embedding': final Object embedding} =>
      EmbedContentResponse(_parseContentEmbedding(embedding)),
    {'error': final Object error} => throw parseError(error),
    _ => throw unhandledFormat('EmbedContentResponse', jsonObject)
  };
}