From 454febf7f343ab44d4dd41459eac4e5d399437e7 Mon Sep 17 00:00:00 2001 From: Tian jianyong <11429339@qq.com> Date: Wed, 24 Dec 2025 19:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=93=E5=AD=98=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module_admin/controller/ragflow_controller.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py b/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py index 6106e23..f0381f5 100644 --- a/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py +++ b/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py @@ -218,6 +218,9 @@ async def converse_with_chat_assistant( # 流式响应 if converse_params.stream: + # 注意:存储时使用清理后的问题(与查找时保持一致) + cache_question = cleaned_question if style_removed else converse_params.question + # 创建缓存存储回调函数 async def make_cache_store(chat_id: str, question: str): async def store_answer(answer: str): @@ -229,7 +232,7 @@ async def converse_with_chat_assistant( logger.warning(f'语义缓存存储失败: {e}') return store_answer - cache_store = await make_cache_store(converse_params.chat_id, converse_params.question) + cache_store = await make_cache_store(converse_params.chat_id, cache_question) return StreamingResponse( stream_ragflow_response(result, converse_params.chat_id, start_time, cache_store_func=cache_store),