From ec68ab1c8c05dc1b4b92c2b04487efcfc44f07e2 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Wed, 5 Mar 2025 17:25:47 +0800 Subject: [PATCH] Fix: search citation issue. (#5657) ### What problem does this PR solve? #5649 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/db/services/dialog_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py index 338d67106..8c23d1a1f 100644 --- a/api/db/services/dialog_service.py +++ b/api/db/services/dialog_service.py @@ -513,7 +513,8 @@ def ask(question, kb_ids, tenant_id): if answer.lower().find("invalid key") >= 0 or answer.lower().find("invalid api") >= 0: answer += " Please set LLM API-Key in 'User Setting -> Model Providers -> API-Key'" - return {"answer": answer, "reference": chunks_format(refs)} + refs["chunks"] = chunks_format(refs) + return {"answer": answer, "reference": refs} answer = "" for ans in chat_mdl.chat_streamly(prompt, msg, {"temperature": 0.1}):