Dateien nach "scripts" hochladen
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s

This commit is contained in:
Lars 2025-11-08 15:29:32 +01:00
parent c0b96f7c05
commit 7cde2462ec

View File

@ -2,18 +2,13 @@
# -*- coding: utf-8 -*-
"""
Script: scripts/import_markdown.py Markdown Qdrant (Notes, Chunks, Edges)
Version: 3.8.0
Version: 3.8.1
Datum: 2025-11-08
Erweiterung (WP-03 Type-Registry)
---------------------------------
- Lädt optional config/types.yaml.
- Unbekannte/fehlende Typen Fallback "concept" (Warnung, kein Abbruch).
- chunk_profile des Typs wird an make_chunk_payloads(...) übergeben (optional).
- retriever_weight wird falls vorhanden als Feld im Note-Payload gespeichert.
- edge_defaults["references"] aktiviert *additiv* Note-Scope-References/Backlinks.
Abwärtskompatibel: Ohne Registry/Typ bleibt das Verhalten identisch zum Stand 20251105.
Änderung in 3.8.1
------------------
- Abwärtskompatibler Import von `ensure_payload_indexes`:
Fallback auf `ensure_payload_indices` oder No-Op, falls beides fehlt.
"""
from __future__ import annotations
@ -38,12 +33,25 @@ try:
from app.core.derive_edges import build_edges_for_note
except Exception: # pragma: no cover
from app.core.edges import build_edges_for_note # type: ignore
# Qdrant-Basics
from app.core.qdrant import (
QdrantConfig,
get_client,
ensure_collections,
ensure_payload_indexes,
)
# Abwärtskompatibler Import für Payload-Index-Erzeugung
try:
from app.core.qdrant import ensure_payload_indexes as _ensure_payload_indexes
except Exception:
try:
from app.core.qdrant import ensure_payload_indices as _ensure_payload_indexes # älterer Funktionsname
except Exception:
def _ensure_payload_indexes(*_args, **_kwargs):
# No-Op: ältere Releases ohne dedizierte Index-Funktion
return None
from app.core.qdrant_points import (
points_for_chunks,
points_for_note,
@ -214,7 +222,8 @@ def main() -> None:
cfg.prefix = args.prefix.strip()
client = get_client(cfg)
ensure_collections(client, cfg.prefix, cfg.dim)
ensure_payload_indexes(client, cfg.prefix)
# abwärtskompatible Index-Erstellung
_ensure_payload_indexes(client, cfg.prefix)
# Type-Registry laden (optional)
reg = None
@ -414,7 +423,7 @@ def main() -> None:
merged_hashes = {}
merged_hashes.update(old_hashes)
merged_hashes.update(note_pl.get("hashes") or {})
if old_payload:
if has_old and old_payload:
note_pl["hash_fulltext"] = old_payload.get("hash_fulltext", note_pl.get("hash_fulltext"))
note_pl["hash_signature"] = old_payload.get("hash_signature", note_pl.get("hash_signature"))
note_pl["hashes"] = merged_hashes