payload angepasst
This commit is contained in:
parent
765fad6a8d
commit
8639791914
|
|
@ -5,6 +5,7 @@ app/core/chunk_payload.py (Mindnet V2 — types.yaml authoritative)
|
||||||
- neighbors_prev / neighbors_next sind Listen ([], [id]).
|
- neighbors_prev / neighbors_next sind Listen ([], [id]).
|
||||||
- retriever_weight / chunk_profile kommen aus types.yaml (Frontmatter wird ignoriert).
|
- retriever_weight / chunk_profile kommen aus types.yaml (Frontmatter wird ignoriert).
|
||||||
- Fallbacks: defaults.* in types.yaml; sonst 1.0 / "default".
|
- 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 __future__ import annotations
|
||||||
from typing import Any, Dict, List, Optional
|
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]]:
|
file_path: Optional[str] = None) -> List[Dict[str, Any]]:
|
||||||
fm = (note or {}).get("frontmatter", {}) or {}
|
fm = (note or {}).get("frontmatter", {}) or {}
|
||||||
note_type = fm.get("type") or note.get("type") or "concept"
|
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()
|
reg = types_cfg if isinstance(types_cfg, dict) else _load_types()
|
||||||
|
|
||||||
# types.yaml authoritative
|
# types.yaml authoritative
|
||||||
|
|
@ -106,6 +112,7 @@ def make_chunk_payloads(note: Dict[str, Any],
|
||||||
pl: Dict[str, Any] = {
|
pl: Dict[str, Any] = {
|
||||||
"note_id": nid,
|
"note_id": nid,
|
||||||
"chunk_id": cid,
|
"chunk_id": cid,
|
||||||
|
"title": title, # <--- HIER: Titel in Payload einfügen
|
||||||
"index": int(index),
|
"index": int(index),
|
||||||
"ord": int(index) + 1,
|
"ord": int(index) + 1,
|
||||||
"type": note_type,
|
"type": note_type,
|
||||||
|
|
@ -126,4 +133,4 @@ def make_chunk_payloads(note: Dict[str, Any],
|
||||||
|
|
||||||
out.append(pl)
|
out.append(pl)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
Loading…
Reference in New Issue
Block a user