scripts/import_markdown.py aktualisiert
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s
This commit is contained in:
parent
3282f85007
commit
6c62f64784
|
|
@ -2,13 +2,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Script: scripts/import_markdown.py — Markdown → Qdrant (Notes, Chunks, Edges)
|
Script: scripts/import_markdown.py — Markdown → Qdrant (Notes, Chunks, Edges)
|
||||||
Version: 3.8.1
|
Version: 3.8.2
|
||||||
Datum: 2025-11-08
|
Datum: 2025-11-08
|
||||||
|
|
||||||
Änderung in 3.8.1
|
Änderungen gegenüber 3.8.1
|
||||||
------------------
|
--------------------------
|
||||||
- Abwärtskompatibler Import von `ensure_payload_indexes`:
|
- Behebt IndentationError bei der vorherigen Patch-Einfügung.
|
||||||
Fallback auf `ensure_payload_indices` oder No-Op, falls beides fehlt.
|
- Konsolidiert alle Abwärtskompatibilitäten (Qdrant-Indices, qdrant_points, dim-Ermittlung).
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
@ -103,8 +103,6 @@ except Exception:
|
||||||
return
|
return
|
||||||
client.upsert(collection_name=collection_name, points=points, wait=True)
|
client.upsert(collection_name=collection_name, points=points, wait=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# NEU: Type-Registry (optional)
|
# NEU: Type-Registry (optional)
|
||||||
try:
|
try:
|
||||||
from app.core.type_registry import load_type_registry, resolve_note_type, get_type_config, effective_chunk_profile
|
from app.core.type_registry import load_type_registry, resolve_note_type, get_type_config, effective_chunk_profile
|
||||||
|
|
@ -219,6 +217,8 @@ def _resolve_mode(val: Optional[str]) -> str:
|
||||||
|
|
||||||
|
|
||||||
def _env(key: str, default: str) -> str:
|
def _env(key: str, default: str) -> str:
|
||||||
|
return (os.environ.get(key) or default).strip().lower()
|
||||||
|
|
||||||
|
|
||||||
def _resolve_dim(cfg) -> int:
|
def _resolve_dim(cfg) -> int:
|
||||||
# Try common attribute names on QdrantConfig
|
# Try common attribute names on QdrantConfig
|
||||||
|
|
@ -239,7 +239,6 @@ def _resolve_dim(cfg) -> int:
|
||||||
continue
|
continue
|
||||||
# Conservative default: MiniLM 384d (im Projekt üblich)
|
# Conservative default: MiniLM 384d (im Projekt üblich)
|
||||||
return 384
|
return 384
|
||||||
return (os.environ.get(key) or default).strip().lower()
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
|
|
@ -501,7 +500,7 @@ def main() -> None:
|
||||||
note_pl["hash_fulltext"] = old_payload.get("hash_fulltext", note_pl.get("hash_fulltext"))
|
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["hash_signature"] = old_payload.get("hash_signature", note_pl.get("hash_signature"))
|
||||||
note_pl["hashes"] = merged_hashes
|
note_pl["hashes"] = merged_hashes
|
||||||
notes_name, note_pts = points_for_note(cfg.prefix, note_pl, None, dim)
|
notes_name, note_pts = _points_for_note(cfg.prefix, note_pl, None, dim)
|
||||||
_upsert_batch(client, notes_name, note_pts)
|
_upsert_batch(client, notes_name, note_pts)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -514,7 +513,7 @@ def main() -> None:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(json.dumps({"path": path, "note_id": note_id, "warn": f"purge failed: {e}"}))
|
print(json.dumps({"path": path, "note_id": note_id, "warn": f"purge failed: {e}"}))
|
||||||
|
|
||||||
notes_name, note_pts = points_for_note(cfg.prefix, note_pl, None, dim)
|
notes_name, note_pts = _points_for_note(cfg.prefix, note_pl, None, dim)
|
||||||
_upsert_batch(client, notes_name, note_pts)
|
_upsert_batch(client, notes_name, note_pts)
|
||||||
if chunk_pls:
|
if chunk_pls:
|
||||||
chunks_name, chunk_pts = _points_for_chunks(cfg.prefix, chunk_pls, vecs)
|
chunks_name, chunk_pts = _points_for_chunks(cfg.prefix, chunk_pls, vecs)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user