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

@@ -260,8 +260,8 @@ class TaskHandler:
run_wiki_incremental,
)
# Parse plan: yes/no from the template config (default no-plan)
plan_enabled = False
# Parse the Wiki mode from the template config.
wiki_mode = None
try:
from api.db.services.compilation_template_service import (
CompilationTemplateService,
@@ -274,17 +274,17 @@ class TaskHandler:
for tid in _parser_config_compilation_template_ids(pc, self._task_context.tenant_id):
tpl = CompilationTemplateService.get_saved(tid, self._task_context.tenant_id)
cfg = (tpl.get("config") or {}) if tpl else {}
if isinstance(cfg, dict) and cfg.get("plan") in (True, "yes", "true"):
plan_enabled = True
if isinstance(cfg, dict) and cfg.get("mode") in ("entity", "topic"):
wiki_mode = cfg["mode"]
break
except Exception:
pass # default to no-plan
pass
await run_wiki_incremental(
self._task_context,
embedding_model,
self._load_chunks_for_doc,
plan=plan_enabled,
mode=wiki_mode,
)
elif task_type == "skill":
from rag.svr.task_executor_refactor.dataset_skill_generator import (