summaryrefslogtreecommitdiffstats
path: root/src/rag/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rag/mod.rs')
-rw-r--r--src/rag/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rag/mod.rs b/src/rag/mod.rs
index 266a859..6dbb6be 100644
--- a/src/rag/mod.rs
+++ b/src/rag/mod.rs
@@ -371,6 +371,10 @@ impl Rag {
self.data.add(next_file_id, files, document_ids, embeddings);
self.data.document_paths = document_paths;
+ if self.data.files.is_empty() {
+ bail!("No RAG files");
+ }
+
progress(&spinner, "Building store".into());
self.hnsw = self.data.build_hnsw();
self.bm25 = self.data.build_bm25();