From d79c55fc64a19aa407c80515a4956d0391e6f08c Mon Sep 17 00:00:00 2001 From: Lars Date: Sat, 8 Nov 2025 17:12:03 +0100 Subject: [PATCH] Dateien nach "scripts" hochladen --- scripts/import_markdown.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/import_markdown.py b/scripts/import_markdown.py index 9df1e25..4f44f46 100644 --- a/scripts/import_markdown.py +++ b/scripts/import_markdown.py @@ -356,8 +356,26 @@ def main() -> None: chunk_pls: List[Dict[str, Any]] = [] try: body_text = getattr(parsed, "body", "") or "" - chunks = assemble_chunks(fm["id"], body_text, fm.get("type", "concept")) - chunk_pls = make_chunk_payloads(fm, note_pl["path"], chunks, note_text=body_text) + # ---- Type-Registry integration ---- + try: + note_type = resolve_note_type(fm.get("type"), reg) + except Exception: + note_type = (fm.get("type") or "concept") + fm["type"] = note_type or "concept" + try: + cfg_type = get_type_config(note_type, reg) + except Exception: + cfg_type = {} + prof = effective_chunk_profile(note_type, reg) + if prof: + fm["chunk_profile"] = prof + weight = cfg_type.get("retriever_weight") + if weight is not None: + # note_pl exists later; we set it after creation as well + fm["retriever_weight"] = float(weight) + + chunks = assemble_chunks(fm["id"], body_text, fm.get("type", "concept")) + chunk_pls = make_chunk_payloads(fm, note_pl["path"], chunks, note_text=body_text) except Exception as e: print(json.dumps({"path": path, "note_id": note_id, "error": f"chunk build failed: {type(e).__name__}: {e}"})) continue