payload angepasst

This commit is contained in:
Lars 2025-12-11 07:34:31 +01:00
parent 765fad6a8d
commit 8639791914

View File

@ -5,6 +5,7 @@ app/core/chunk_payload.py (Mindnet V2 — types.yaml authoritative)
- neighbors_prev / neighbors_next sind Listen ([], [id]).
- retriever_weight / chunk_profile kommen aus types.yaml (Frontmatter wird ignoriert).
- Fallbacks: defaults.* in types.yaml; sonst 1.0 / "default".
- WP-11 Update: Injects 'title' into chunk payload for Discovery Service.
"""
from __future__ import annotations
from typing import Any, Dict, List, Optional
@ -82,6 +83,11 @@ def make_chunk_payloads(note: Dict[str, Any],
file_path: Optional[str] = None) -> List[Dict[str, Any]]:
fm = (note or {}).get("frontmatter", {}) or {}
note_type = fm.get("type") or note.get("type") or "concept"
# WP-11 FIX: Title Extraction für Discovery Service
# Wir holen den Titel aus Frontmatter oder Fallback ID/Untitled
title = fm.get("title") or note.get("title") or fm.get("id") or "Untitled"
reg = types_cfg if isinstance(types_cfg, dict) else _load_types()
# types.yaml authoritative
@ -106,6 +112,7 @@ def make_chunk_payloads(note: Dict[str, Any],
pl: Dict[str, Any] = {
"note_id": nid,
"chunk_id": cid,
"title": title, # <--- HIER: Titel in Payload einfügen
"index": int(index),
"ord": int(index) + 1,
"type": note_type,
@ -126,4 +133,4 @@ def make_chunk_payloads(note: Dict[str, Any],
out.append(pl)
return out
return out