diff --git a/src/rag_engine.py b/src/rag_engine.py index 350b0130..f90523e7 100644 --- a/src/rag_engine.py +++ b/src/rag_engine.py @@ -204,6 +204,10 @@ class RAGEngine: db_path = os.path.abspath(os.path.join(self.base_dir, ".slop_cache", f"chroma_{self.collection.name}")) if os.path.exists(db_path): shutil.rmtree(db_path, ignore_errors=True) + chroma_module = _get_chromadb() + if chroma_module is None: + return Result(data=None, errors=[ErrorInfo(kind=ErrorKind.CONFIG, message="chromadb is not installed", source="rag._validate_collection_dim")]) + chromadb, _ = chroma_module self.client = chromadb.PersistentClient(path=os.path.dirname(db_path)) self.collection = self.client.get_or_create_collection(name=self.collection.name) return Result(data=None)