Skip to content

Commit f974700

Browse files
authored
Merge pull request #71 from rmusser01/dev
Should fix the imports
2 parents a74dbef + 819faec commit f974700

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tldw_chatbook/UI/SearchWindow.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
#
44
# Imports
5+
from __future__ import annotations
56
from rich.markup import escape
67
from textual import on
78
from textual.app import ComposeResult
@@ -338,6 +339,8 @@ def compose(self) -> ComposeResult:
338339

339340
async def _get_chroma_manager(self) -> "ChromaDBManager":
340341
"""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.")
341344
if self._chroma_manager is None:
342345
logger.info("ChromaDBManager instance not found, creating a new one.")
343346
try:
@@ -1237,6 +1240,10 @@ async def _create_embeddings(self, db_type: str, db_path: str, # db_path is conc
12371240
"""
12381241
Loads data based on db_type and selection, then creates and stores embeddings.
12391242
"""
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
12401247
logger.info(f"_create_embeddings: Starting embedding creation for {db_type}, collection '{collection_name}', model '{embedding_model_id_override}', mode '{selection_mode}'")
12411248
logger.debug(f"_create_embeddings: Parameters - db_type={db_type}, db_path={db_path}, collection_name={collection_name}, " +
12421249
f"embedding_model_id_override={embedding_model_id_override}, selection_mode={selection_mode}, " +

0 commit comments

Comments
 (0)