fix: add toc field to extractor output (#16059)

### What problem does this PR solve?
TOC chunks now include a toc field so the agent pipeline logs expose the
data the frontend expects.

### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
buua436
2026-06-16 13:27:45 +08:00
committed by GitHub
parent b4a161b50e
commit 5751a22444

View File

@@ -62,6 +62,7 @@ class Extractor(ProcessBase, LLM):
if toc:
d = deepcopy(docs[-1])
d["doc_id"] = self._canvas._doc_id
d["toc"] = json.dumps(toc, ensure_ascii=False)
d["content_with_weight"] = json.dumps(toc, ensure_ascii=False)
d["toc_kwd"] = "toc"
d["available_int"] = 0
@@ -108,4 +109,3 @@ class Extractor(ProcessBase, LLM):
msg.insert(0, {"role": "system", "content": sys_prompt})
self.set_output("chunks", [{self._param.field_name: await self._generate_async(msg)}])