From 379cb6ff990b0136630a7de7b87dff2cf299ef13 Mon Sep 17 00:00:00 2001 From: Lars Date: Thu, 4 Sep 2025 08:25:34 +0200 Subject: [PATCH] app/core/qdrant_points.py aktualisiert --- app/core/qdrant_points.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/core/qdrant_points.py b/app/core/qdrant_points.py index 4fe5290..3e62c6a 100644 --- a/app/core/qdrant_points.py +++ b/app/core/qdrant_points.py @@ -56,8 +56,8 @@ def points_for_chunks( def points_for_edges(prefix: str, edge_payloads: List[dict]) -> Tuple[str, List[rest.PointStruct]]: """ Edges-Collection ohne Vektor. - Robustheit: - - Fehlt 'edge_id', dann konstruiere aus (kind, source_id, target_id, seq) eine stabile ID. + - Pydantic/Qdrant-Client erwartet trotzdem ein 'vector'-Feld → wir setzen vector=None. + - Fehlt 'edge_id', konstruieren wir eine stabile ID aus (kind, source_id, target_id, seq). """ _, _, edges_col = _names(prefix) points: List[rest.PointStruct] = [] @@ -71,10 +71,12 @@ def points_for_edges(prefix: str, edge_payloads: List[dict]) -> Tuple[str, List[ edge_id = f"{kind}:{s}->{t}#{seq}" pl["edge_id"] = edge_id point_id = _to_uuid(edge_id) - points.append(rest.PointStruct(id=point_id, payload=pl)) + # WICHTIG: vector=None, damit der Client das Feld hat, die Collection aber vektorlos bleibt + points.append(rest.PointStruct(id=point_id, vector=None, payload=pl)) return edges_col, points + def upsert_batch(client, collection: str, points: List[rest.PointStruct]) -> None: if not points: return