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)
This commit is contained in:
Kevin Hu 2025-03-05 17:25:47 +08:00 committed by GitHub
parent e5041749a2
commit ec68ab1c8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}):