Refactor: refine wiki plan procedure. (#17579)

### Summary

Refine wiki plan procedure.

---------

Co-authored-by: Yingfeng Zhang <yingfeng.zhang@gmail.com>
Co-authored-by: buua436 <sz_buua@foxmail.com>
This commit is contained in:
Kevin Hu
2026-08-03 16:03:17 +08:00
committed by GitHub
parent 51af9e2eae
commit 3b4a96d421
25 changed files with 6175 additions and 114 deletions

View File

@@ -257,13 +257,34 @@ class TaskHandler:
ctx.progress_cb(1, "place holder")
elif task_type == "wiki":
from rag.svr.task_executor_refactor.dataset_wiki_generator import (
run_wiki,
run_wiki_incremental,
)
await run_wiki(
# Parse plan: yes/no from the template config (default no-plan)
plan_enabled = False
try:
from api.db.services.compilation_template_service import (
CompilationTemplateService,
)
from rag.svr.task_executor_refactor.dataset_wiki_generator import (
_parser_config_compilation_template_ids,
)
pc = self._task_context.parser_config or {}
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
break
except Exception:
pass # default to no-plan
await run_wiki_incremental(
self._task_context,
embedding_model,
self._load_chunks_for_doc,
plan=plan_enabled,
)
elif task_type == "skill":
from rag.svr.task_executor_refactor.dataset_skill_generator import (