mindnet/tests/test_edges_defaults_smoke.py
Lars e93bab6ea7
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 4s
Fassadenauflösung unter app/core
2025-12-28 11:04:40 +01:00

26 lines
870 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
tests/test_edges_defaults_smoke.py
Aggregiert Edges je Relation (kind) in Qdrant zur schnellen Sichtprüfung.
Zeigt, ob typenbasierte edge_defaults-Relationen (z. B. depends_on/related_to) auftauchen.
"""
from __future__ import annotations
from collections import Counter
import json
from app.core.database.qdrant import QdrantConfig, get_client
def main():
cfg = QdrantConfig.from_env()
cl = get_client(cfg)
col = f"{cfg.prefix}_edges"
pts, _ = cl.scroll(collection_name=col, with_payload=True, with_vectors=False, limit=10000)
by_rel = Counter()
for p in pts:
rel = p.payload.get("kind") or p.payload.get("relation") or "edge"
by_rel[rel] += 1
print(json.dumps({"prefix": cfg.prefix, "relations": dict(by_rel)}, ensure_ascii=False))
if __name__ == "__main__":
main()