Handle missing textual dependencies
This commit is contained in:
parent
8450c07085
commit
59eba31267
3 changed files with 11 additions and 7 deletions
|
|
@ -420,7 +420,11 @@ def inspect(
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
"""Launch the inspector TUI for browsing documents and chunks."""
|
"""Launch the inspector TUI for browsing documents and chunks."""
|
||||||
|
try:
|
||||||
from haiku.rag.inspector import run_inspector
|
from haiku.rag.inspector import run_inspector
|
||||||
|
except ImportError as e:
|
||||||
|
typer.echo(f"Error: {e}", err=True)
|
||||||
|
raise typer.Exit(1) from e
|
||||||
|
|
||||||
db_path = db if db else get_config().storage.data_dir / "haiku.rag.lancedb"
|
db_path = db if db else get_config().storage.data_dir / "haiku.rag.lancedb"
|
||||||
run_inspector(db_path)
|
run_inspector(db_path)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
try:
|
||||||
from haiku.rag.inspector.app import run_inspector
|
from haiku.rag.inspector.app import run_inspector
|
||||||
|
except ImportError as e:
|
||||||
|
raise ImportError(
|
||||||
|
"textual is not installed. Please install it with `pip install 'haiku.rag-slim[inspector]'` or use the full haiku.rag package."
|
||||||
|
) from e
|
||||||
|
|
||||||
__all__ = ["run_inspector"]
|
__all__ = ["run_inspector"]
|
||||||
|
|
|
||||||
|
|
@ -229,11 +229,6 @@ def run_inspector(db_path: Path | None = None) -> None:
|
||||||
Args:
|
Args:
|
||||||
db_path: Path to the LanceDB database. If None, uses default from config.
|
db_path: Path to the LanceDB database. If None, uses default from config.
|
||||||
"""
|
"""
|
||||||
if not TEXTUAL_AVAILABLE:
|
|
||||||
raise ImportError(
|
|
||||||
"Textual is not installed. Install it with: pip install 'haiku.rag-slim[inspector]'"
|
|
||||||
)
|
|
||||||
|
|
||||||
config = get_config()
|
config = get_config()
|
||||||
if db_path is None:
|
if db_path is None:
|
||||||
db_path = config.storage.data_dir / "haiku.rag.lancedb"
|
db_path = config.storage.data_dir / "haiku.rag.lancedb"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue