fix: expand short sections (<100 chars) with LLM even if not bullet-only

This commit is contained in:
Yuzhiran Dev
2026-05-26 18:31:43 +08:00
parent 80023bbd6c
commit 29d97b5f1a
+2 -2
View File
@@ -146,8 +146,8 @@ class Writer:
def _expand_section(self, section: Dict) -> str: def _expand_section(self, section: Dict) -> str:
content = section.get('content', '').strip() content = section.get('content', '').strip()
# 大纲要点格式(>40% 行以 -/*/** 开头)应始终由 LLM 展开为连贯段落 # 大纲要点格式(>40% 行以 -/*/** 开头)或内容过短(<100字)应由 LLM 展开为连贯段落
if HAVE_LLM and self._is_bullet_only(content): if HAVE_LLM and (self._is_bullet_only(content) or (content and len(content) < 100)):
logger.info(f"使用 LLM 扩写章节(要点→段落): {section['title']}") logger.info(f"使用 LLM 扩写章节(要点→段落): {section['title']}")
prompt = get_prompt("section_expansion", prompt = get_prompt("section_expansion",
topic_title=self.topic['title'], topic_title=self.topic['title'],