modularisierung

This commit is contained in:
Lars committed 2025-12-27 20:26:00 +01:00
1 parent 19d899b277
commit 8490911958
6 files changed
+491 -424

No files matched your search

+10 -3
View File
@@ -1,11 +1,14 @@
"""
FILE: app/core/graph/graph_db_adapter.py
DESCRIPTION: Datenbeschaffung aus Qdrant für den Graphen.
AUDIT v1.1.0: Nutzt nun die zentrale database-Infrastruktur für Namen.
"""
from typing import List, Dict, Optional
from qdrant_client import QdrantClient
from qdrant_client.http import models as rest
from app.core.qdrant import collection_names
# ENTSCHEIDENDER FIX: Nutzt die neue Infrastruktur für konsistente Collection-Namen
from app.core.database import collection_names
def fetch_edges_from_qdrant(
client: QdrantClient,
@@ -21,6 +24,7 @@ def fetch_edges_from_qdrant(
if not seeds or limit <= 0:
return []
# Konsistente Namensauflösung via database-Paket
_, _, edges_col = collection_names(prefix)
seed_conditions = []
@@ -40,11 +44,14 @@ def fetch_edges_from_qdrant(
type_filter = rest.Filter(should=type_conds)
must = []
if seeds_filter: must.append(seeds_filter)
if type_filter: must.append(type_filter)
if seeds_filter:
must.append(seeds_filter)
if type_filter:
must.append(type_filter)
flt = rest.Filter(must=must) if must else None
# Abfrage via Qdrant Scroll API
pts, _ = client.scroll(
collection_name=edges_col,
scroll_filter=flt,