From 29d97b5f1a2120d24339d8f973f7e45502fb783c Mon Sep 17 00:00:00 2001 From: Yuzhiran Dev Date: Tue, 26 May 2026 18:31:43 +0800 Subject: [PATCH] fix: expand short sections (<100 chars) with LLM even if not bullet-only --- scripts/writer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/writer.py b/scripts/writer.py index e68aedf..846b325 100644 --- a/scripts/writer.py +++ b/scripts/writer.py @@ -146,8 +146,8 @@ class Writer: def _expand_section(self, section: Dict) -> str: content = section.get('content', '').strip() - # 大纲要点格式(>40% 行以 -/*/** 开头)应始终由 LLM 展开为连贯段落 - if HAVE_LLM and self._is_bullet_only(content): + # 大纲要点格式(>40% 行以 -/*/** 开头)或内容过短(<100字)应由 LLM 展开为连贯段落 + if HAVE_LLM and (self._is_bullet_only(content) or (content and len(content) < 100)): logger.info(f"使用 LLM 扩写章节(要点→段落): {section['title']}") prompt = get_prompt("section_expansion", topic_title=self.topic['title'],