db/report/server/UI updates

This commit is contained in:
Stefano Zini
2026-11-04 14:14:26 +01:00
parent a741859140
commit c1fbcc1688
6 changed files with 52 additions and 17 deletions
+12
View File
@@ -332,6 +332,18 @@ def run(name, window_words=3000):
db.replace_topics(name, topics)
def retitle(name):
"""Regenerate the meeting title from the saved topics (LLM overview pass); drops the manual title. Render is done by the caller."""
p = db.out_dir(name) / "report.json"
rep = json.loads(p.read_text(encoding="utf-8"))
ov = chat(SYS_B, json.dumps([{"title": t["title"], "summary": [x["text"] for x in t["summary"]], "shown": t["shown"], "decisions": t["decisions"], "actions": t["actions"]} for t in rep["topics"]], ensure_ascii=False), 800, think=True) or {}
t = str(ov.get("title") or "").strip()
if not t: raise RuntimeError("title: nessun titolo generato")
db.set_meta(name, title="")
rep["meeting_title"] = t
p.write_text(json.dumps(rep, ensure_ascii=False, indent=1), encoding="utf-8")
def _head(i, t): return f"{i}. {t['title']} ({mmss(t['start_s'])}–{mmss(t['end_s'])})"