pub async fn get_or_compute<F, Fut>(
db: &MemoryDatabase,
text: &str,
compute_fn: F,
) -> Result<Vec<f32>, Error>Expand description
Get or compute an embedding, using the cache.
If the embedding is cached, returns it directly.
Otherwise, calls compute_fn, caches the result, and returns it.