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")