diff --git a/services/ppt_generator.py b/services/ppt_generator.py index ec41f58..ffa166d 100644 --- a/services/ppt_generator.py +++ b/services/ppt_generator.py @@ -43,7 +43,7 @@ REPORTS_DIR.mkdir(parents=True, exist_ok=True) TEMPLATE_VERSIONS = { 'daily': 'v3.0.2', # 2026-05-02 折線稀疏資料防呆:N<=2 時 inset legend、加「資料不足」提示 'weekly': 'v3.0.2', # 2026-05-02 同上 - 'monthly': 'v3.1.2', # 2026-05-02 同上(雖月報通常 30 點不會踩到,仍 bump 統一) + 'monthly': 'v3.1.3', # 2026-05-03 AI 段落 parser:丟棄空 body 段、上限 6→10 容納 SMART 框架 9 段 'strategy': 'v3.0', # 2026-05-02 AI 頁去黑改暖紙 + 附錄頁 'competitor': 'v3.0', # 2026-05-02 AI 頁去黑改暖紙 + 附錄頁 'promo': 'v3.0', # 2026-05-02 AI 頁去黑改暖紙 + 附錄頁 @@ -2173,7 +2173,13 @@ def _parse_ai_sections(ai_text: str) -> list: if not sections and ai_text.strip(): sections.append(("💡", "AI 月度策略洞察", ai_text.strip())) - return sections[:6] + # 過濾「空 body」段(如 SMART 框架主標題下接續是 ■ 子段,主標題自己沒內容) + # 這些「空殼」section 占版面但無資訊,丟掉避免顯示「(本段無內容)」 + sections = [(i, t, b) for (i, t, b) in sections if b and len(b.strip()) >= 5] + + # 上限放寬 6 → 10(升級 prompt 後最多 9 段:整體/市場/品類/熱銷/MCP/ + # 本週/本月/下月/風險),仍會自動分頁(每頁 4 卡,最多 3 頁) + return sections[:10] def _ai_insight_slide(prs, ai_text: str, W: float = 33.87):