From 60486ecde5d99099df9548561e48428cdb4eeae6 Mon Sep 17 00:00:00 2001 From: so95 Date: Tue, 10 Dec 2024 08:04:24 +0700 Subject: [PATCH] api http return error (#3941) api http return error when content is not found - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Kevin Hu --- api/db/services/conversation_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/db/services/conversation_service.py b/api/db/services/conversation_service.py index 03092ece5..3cfa42a6b 100644 --- a/api/db/services/conversation_service.py +++ b/api/db/services/conversation_service.py @@ -58,7 +58,7 @@ def structure_answer(conv, ans, message_id, session_id): chunk_list = [{ "id": chunk["chunk_id"], - "content": chunk["content"], + "content": chunk.get("content") if chunk.get("content") else chunk.get("content_with_content"), "document_id": chunk["doc_id"], "document_name": chunk["docnm_kwd"], "dataset_id": chunk["kb_id"],