refactor(cli): remove obsolete workflow commands
This commit is contained in:
@@ -4,7 +4,7 @@ from pathlib import Path
|
||||
|
||||
import typer
|
||||
|
||||
from tht.cli._guards import require_server_profile, require_vector_write_allowed
|
||||
from tht.cli._guards import require_vector_write_allowed
|
||||
from tht.cli.config_cmd import CONFIG_OPT
|
||||
from tht.cli.schema_cmd import _load_config_or_exit, annotations_path, physical_path
|
||||
from tht.ports.vector import VectorWriteRecord
|
||||
@@ -97,40 +97,6 @@ def _print_stats(stats) -> None:
|
||||
)
|
||||
|
||||
|
||||
@vector_app.command("init")
|
||||
def init_cmd(
|
||||
config: Path = CONFIG_OPT,
|
||||
skip_ollama_check: bool = typer.Option(
|
||||
False, "--skip-ollama-check", help="Non verificare la raggiungibilita' di Ollama."
|
||||
),
|
||||
) -> None:
|
||||
"""Verifica il runtime Qdrant e la raggiungibilita' dell'embedder configurato."""
|
||||
from tht.adapters.factory import build_vector_store
|
||||
from tht.vectorstore.embeddings import EmbeddingsError
|
||||
|
||||
cfg = _load_config_or_exit(config)
|
||||
require_server_profile(cfg, "vector init")
|
||||
require_vector_cfg(cfg)
|
||||
health = build_vector_store(cfg, require_write=True).health()
|
||||
if not health.ok:
|
||||
typer.secho(
|
||||
f"ERRORE runtime vettoriale: {health.detail or 'Qdrant non raggiungibile o incompatibile'}",
|
||||
fg=typer.colors.RED,
|
||||
err=True,
|
||||
)
|
||||
raise typer.Exit(code=1)
|
||||
if not skip_ollama_check:
|
||||
try:
|
||||
make_embedder(cfg.embeddings).embed_query("ping")
|
||||
except EmbeddingsError as e:
|
||||
typer.secho(f"ERRORE: {e}", fg=typer.colors.RED, err=True)
|
||||
raise typer.Exit(code=1)
|
||||
typer.secho(
|
||||
f"OK: runtime Qdrant pronto per la collezione {cfg.vectors.collection}",
|
||||
fg=typer.colors.GREEN,
|
||||
)
|
||||
|
||||
|
||||
@vector_app.command("index-schema")
|
||||
def index_schema_cmd(
|
||||
config: Path = CONFIG_OPT,
|
||||
|
||||
Reference in New Issue
Block a user