Refactor document handling and update Milvus collection settings
- Removed multiple failed document entries from `documents.json`. - Added a new document entry with updated metadata and changed the index name to `regulations_dense_1024_v2`. - Updated architecture documentation to reflect changes in the Milvus collection name. - Adjusted requirements by removing the sqlalchemy dependency. - Modified test cases to align with new document structure and naming conventions. - Introduced a new test file for Milvus vector index runtime recovery and error handling. - Updated assertions in various test files to ensure compatibility with the new schema.
This commit is contained in:
30
backend/app/shared/errors.py
Normal file
30
backend/app/shared/errors.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""Define shared backend exception types."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
class VectorStoreSchemaError(RuntimeError):
|
||||
"""Signal that the active vector store schema does not match backend expectations."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
message: str,
|
||||
host: str,
|
||||
db_name: str,
|
||||
collection_name: str,
|
||||
expected_fields: list[str],
|
||||
actual_fields: list[str],
|
||||
) -> None:
|
||||
"""Initialize the vector store schema error details."""
|
||||
self.host = host
|
||||
self.db_name = db_name
|
||||
self.collection_name = collection_name
|
||||
self.expected_fields = expected_fields
|
||||
self.actual_fields = actual_fields
|
||||
# Keep the message self-contained so runtime logs show the full mismatch context.
|
||||
details = (
|
||||
f"{message} | host={host} db={db_name} collection={collection_name} "
|
||||
f"expected_fields={expected_fields} actual_fields={actual_fields}"
|
||||
)
|
||||
super().__init__(details)
|
||||
Reference in New Issue
Block a user