(
category: str,
section_body: str,
*,
user_profile: Optional[Dict[str, Any]] = None,
)
| 2380 | |
| 2381 | def _daily_note_topic_summary( |
| 2382 | category: str, |
| 2383 | section_body: str, |
| 2384 | *, |
| 2385 | user_profile: Optional[Dict[str, Any]] = None, |
| 2386 | ) -> str: |
| 2387 | titles = re.findall(r"^##\s+(.+)$", section_body, flags=re.MULTILINE) |
| 2388 | method_terms = _daily_note_topic_methods(section_body, user_profile) |
| 2389 | paper_lines = "\n".join(f"- {title}" for title in titles[:8]) or "- 暂无精读论文" |
| 2390 | return "\n".join( |
| 2391 | [ |
| 2392 | "<!-- paperflow-topic-summary:start -->", |
| 2393 | "## PaperFlow Summary", |
| 2394 | f"- 概念:{category}", |
| 2395 | f"- 方法:{', '.join(method_terms[:8]) if method_terms else '待从后续精读中沉淀'}", |
| 2396 | f"- 论文/报告:{len(titles)} 篇", |
| 2397 | paper_lines, |
| 2398 | "- 画像/前沿:该主题来自当前精读论文与研究画像的交集,供 Wiki 可视化和后续检索使用。", |
| 2399 | "<!-- paperflow-topic-summary:end -->", |
| 2400 | ] |
| 2401 | ) |
| 2402 | |
| 2403 | |
| 2404 | def _extract_daily_note_paper_blocks(content: str) -> List[Dict[str, str]]: |
| 2405 | text = re.sub( |
no test coverage detected