fix: support qdrant-only vector maintenance

This commit is contained in:
2026-08-08 18:14:03 +02:00
parent 5e39cfa347
commit 32cd2165eb
9 changed files with 261 additions and 28 deletions
+19 -2
View File
@@ -5,9 +5,10 @@ Endpoint dedicato (es. https://host/vector/v1/), distinto dal DWH. La lettura us
Errori in italiano e azionabili, stile `rest/client.py`.
"""
import requests
import re
import requests
from tht.config import RestConfig
@@ -46,7 +47,7 @@ class VectorRestClient:
try:
body = resp.json()
detail = body.get("message") or body.get("details") or resp.text
except Exception:
except ValueError:
detail = resp.text
return f"Vector REST rpc {fn} → HTTP {resp.status_code}: {detail}"
@@ -149,6 +150,22 @@ class VectorRestClient:
return int(payload.get("deleted", 0))
return 0
def delete_kinds(self, table_name: str, kinds: list[str]) -> int:
try:
payload = self._call(
"delete_vector_kinds",
{"table_name": table_name, "kinds": kinds},
)
except VectorRestError as error:
if "HTTP 404" in str(error):
raise VectorRestError(
"delete_vector_kinds RPC is unavailable; deploy the cleanup migration"
) from None
raise
if isinstance(payload, dict):
return int(payload.get("deleted", 0))
return 0
def list_evidence_generations(self, table_name: str, workspace_id: str) -> list[str]:
if re.fullmatch(r"[a-z][a-z0-9_-]{0,63}", workspace_id) is None:
raise ValueError("workspace namespace must be canonical")