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}",