From 96da618b6a6f6bf7b0cb4c4b3d8e73cf58709922 Mon Sep 17 00:00:00 2001 From: devMls <12745675+devMls@users.noreply.github.com> Date: Mon, 23 Dec 2024 03:22:57 +0100 Subject: [PATCH] Fix bug over chunks classification by document in the promp (#4156) The refactor in 0.15 contains a small bug that eliminate the classification ### What problem does this PR solve ### Type of change - [X] Bug Fix (non-breaking change which fixes an issue) --- api/db/services/dialog_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py index ef86d763c..73f8ff481 100644 --- a/api/db/services/dialog_service.py +++ b/api/db/services/dialog_service.py @@ -124,7 +124,7 @@ def kb_prompt(kbinfos, max_tokens): for i, ck in enumerate(kbinfos["chunks"]): if i >= chunks_num: break - doc2chunks["docnm_kwd"].append(ck["content_with_weight"]) + doc2chunks[ck["docnm_kwd"]].append(ck["content_with_weight"]) knowledges = [] for nm, chunks in doc2chunks.items():