feat: support entity and topic wiki modes (#18216)

This commit is contained in:
buua436
2026-08-13 19:03:24 +08:00
committed by GitHub
parent 8f6b5d0e99
commit a4e819504c
21 changed files with 278 additions and 153 deletions

View File

@@ -57,6 +57,8 @@ def validate_template_payload(req: dict, require_all: bool = True) -> str:
if len(str((field or {}).get("rule") or "")) > 1024:
return f"{section.capitalize()} field rule is too long."
if config.get("kind") == "wiki" or req.get("kind") == "wiki":
if config.get("mode") not in ("entity", "topic"):
return "Wiki mode must be either 'entity' or 'topic'."
for field in (config.get("claim") or {}).get("fields") or []:
if not str((field or {}).get("statement") or "").strip():
return "Claim statement is required."

View File

@@ -2,7 +2,7 @@ kind: wiki
display_name: Wiki — Graph-based wiki
config:
kind: wiki
plan: yes
mode: entity
instruction: |
- Each page must be a proper encyclopedic article, NOT a flat bullet list:
- 1. Opening paragraph (2-4 sentences defining what this is). No heading.