From 9b9265b46ad04744887086218e9c4ebb44a2a2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A6=82=E5=A8=81?= Date: Wed, 9 Jul 2025 00:57:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/rag_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/rag_service.py b/services/rag_service.py index 6b973c4..e519940 100644 --- a/services/rag_service.py +++ b/services/rag_service.py @@ -33,7 +33,7 @@ class AsyncRAGService: 答案:""", ) - + self.logger.info("RAG服务初始化完成") async def add_document_async(self, content: str, filename: str) -> str: @@ -58,7 +58,7 @@ class AsyncRAGService: try: self.logger.info(f"开始处理问答: {question[:50]}...") - + # 异步检索相关文档 search_results = await self.vector_store.search_async(question, top_k) self.logger.debug(f"检索到 {len(search_results)} 个相关文档") @@ -95,7 +95,7 @@ class AsyncRAGService: "sources": sources, "processing_time": duration, } - + except Exception as e: duration = time.time() - start_time self.logger.error(f"问答处理失败: {str(e)}, 耗时: {duration:.2f}s")