马一丁
Committed by GitHub

Merge pull request #491 from 666ghj/Blocked-HTML

Fix error "文档设计 缺少预期的键: toc"
... ... @@ -483,7 +483,8 @@ class ReportAgent:
query,
template_overview,
),
expected_keys=["title", "hero", "toc", "tocPlan"],
# toc 字段已被 tocPlan 取代,这里按最新Schema挑选/校验
expected_keys=["title", "hero", "tocPlan", "tocTitle"],
)
emit('stage', {
'stage': 'layout_designed',
... ...
... ... @@ -108,7 +108,8 @@ class DocumentLayoutNode(BaseNode):
result = self.json_parser.parse(
raw,
context_name="文档设计",
expected_keys=["title", "toc", "hero"],
# 目录字段已更名为 tocPlan,这里跟随最新Schema校验
expected_keys=["title", "tocPlan", "hero"],
)
# 验证关键字段的类型
if not isinstance(result.get("title"), str):
... ...