|
2 | 2 | #
|
3 | 3 | #
|
4 | 4 | # Imports
|
| 5 | +from __future__ import annotations |
5 | 6 | from rich.markup import escape
|
6 | 7 | from textual import on
|
7 | 8 | from textual.app import ComposeResult
|
@@ -338,6 +339,8 @@ def compose(self) -> ComposeResult:
|
338 | 339 |
|
339 | 340 | async def _get_chroma_manager(self) -> "ChromaDBManager":
|
340 | 341 | """Get or create a ChromaDBManager instance using the app's configuration."""
|
| 342 | + if not VECTORDB_AVAILABLE: |
| 343 | + raise RuntimeError("Vector-database functionality is disabled in this environment.") |
341 | 344 | if self._chroma_manager is None:
|
342 | 345 | logger.info("ChromaDBManager instance not found, creating a new one.")
|
343 | 346 | try:
|
@@ -1237,6 +1240,10 @@ async def _create_embeddings(self, db_type: str, db_path: str, # db_path is conc
|
1237 | 1240 | """
|
1238 | 1241 | Loads data based on db_type and selection, then creates and stores embeddings.
|
1239 | 1242 | """
|
| 1243 | + if not EMBEDDINGS_GENERATION_AVAILABLE: |
| 1244 | + await self.query_one("#creation-status-output", Markdown).update( |
| 1245 | + "⚠️ Embedding generation is disabled because dependencies are missing.") |
| 1246 | + return |
1240 | 1247 | logger.info(f"_create_embeddings: Starting embedding creation for {db_type}, collection '{collection_name}', model '{embedding_model_id_override}', mode '{selection_mode}'")
|
1241 | 1248 | logger.debug(f"_create_embeddings: Parameters - db_type={db_type}, db_path={db_path}, collection_name={collection_name}, " +
|
1242 | 1249 | f"embedding_model_id_override={embedding_model_id_override}, selection_mode={selection_mode}, " +
|
|
0 commit comments