From 48da46c9e908a458dae2c515be3aa2916f22b82f Mon Sep 17 00:00:00 2001 From: Tian jianyong <11429339@qq.com> Date: Wed, 24 Dec 2025 18:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module_admin/controller/ragflow_controller.py | 4 ++++ ruoyi-fastapi-backend/test/test_sse.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py b/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py index 659ef19..639bf4d 100644 --- a/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py +++ b/ruoyi-fastapi-backend/module_admin/controller/ragflow_controller.py @@ -88,7 +88,9 @@ async def converse_with_chat_assistant( # ========== 1. 静态问答匹配 ========== try: static_qa_service = get_static_qa_service() + logger.info(f'[StaticQA] 开始匹配 | chat_id={converse_params.chat_id} | question={converse_params.question} | threshold=0.70') static_match, static_sim = static_qa_service.find_match(converse_params.question, threshold=0.70) + logger.info(f'[StaticQA] 匹配结果 | similarity={static_sim:.2f} | matched={static_match is not None}') if static_match: cached_answer = static_match.get('answer', '') @@ -118,11 +120,13 @@ async def converse_with_chat_assistant( # ========== 2. RAG历史缓存查找 ========== if redis: + logger.info(f'[SemanticCache] 开始查找 | chat_id={converse_params.chat_id} | question={converse_params.question} | threshold=0.60') cache_result = await lookup_question( converse_params.chat_id, converse_params.question, redis ) + logger.info(f'[SemanticCache] 查找结果 | found={cache_result is not None}') if cache_result: cached_answer, cache_similarity = cache_result cache_source = 'rag_history' diff --git a/ruoyi-fastapi-backend/test/test_sse.py b/ruoyi-fastapi-backend/test/test_sse.py index 1c0fd0d..a7b66ac 100644 --- a/ruoyi-fastapi-backend/test/test_sse.py +++ b/ruoyi-fastapi-backend/test/test_sse.py @@ -155,10 +155,10 @@ async def stream_chat_async( timer.restart() payload = { - "chat_id": chat_id, + "chatId": chat_id, "question": question, "stream": True, - "session_id": session_id, + "sessionId": session_id, } headers = { "Authorization": f"Bearer {token}",