restore comment
This commit is contained in:
@@ -128,6 +128,18 @@ class RAGEngine:
|
||||
return Result(data=None, errors=[ErrorInfo(kind=ErrorKind.CONFIG, message=f"Unknown vector store provider: {vs_config.provider}", source="rag._init_vector_store")])
|
||||
|
||||
def _validate_collection_dim_result(self) -> Result[None]:
|
||||
"""
|
||||
Detect dimension mismatch between an existing collection's vectors and
|
||||
the current embedding provider's output. When mismatched (e.g. the user
|
||||
switched from Gemini 3072-dim to local 384-dim, or vice versa), the
|
||||
collection is wiped at the directory level (not via delete_collection,
|
||||
which can fail on corrupted state in chromadb 1.5.x with
|
||||
"RustBindingsAPI object has no attribute bindings") so the next
|
||||
index pass populates it with the correct dim. Prevents silent
|
||||
corruption that would later surface as a search error
|
||||
("Collection expecting embedding with dimension of X, got Y") and
|
||||
hang live_gui tests.
|
||||
"""
|
||||
if self.collection is None or self.collection == "mock" or self.embedding_provider is None:
|
||||
return Result(data=None)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user