From 5751a224443709e7987176b67670a2f0f033bcc7 Mon Sep 17 00:00:00 2001 From: buua436 Date: Tue, 16 Jun 2026 13:27:45 +0800 Subject: [PATCH] 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) --- rag/flow/extractor/extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/flow/extractor/extractor.py b/rag/flow/extractor/extractor.py index 8061086a74..07de5d2f6e 100644 --- a/rag/flow/extractor/extractor.py +++ b/rag/flow/extractor/extractor.py @@ -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)}]) -