chore: centralize embedding errors, retrieval strategy, and test DB helpers.

Replace anyhow in embedding production code with EmbeddingError, move
RetrievalStrategy into common config, and deduplicate Surreal test setup
via common::test_utils.
This commit is contained in:
Per Stark
2026-05-29 14:35:07 +02:00
parent e3bb2935d0
commit d3443d4153
17 changed files with 366 additions and 304 deletions
@@ -158,10 +158,7 @@ async fn create_single_entity(
);
let embedding = if let Some(provider) = embedding_provider {
provider
.embed(&embedding_input)
.await
.map_err(|e| AppError::InternalError(format!("FastEmbed embedding for entity failed: {e}")))?
provider.embed(&embedding_input).await?
} else {
generate_embedding(openai_client, &embedding_input, db_client).await?
};