修复延时问题尝试

This commit is contained in:
Tian jianyong 2025-12-17 14:47:10 +08:00
parent c293e43281
commit 2bd083c09f
3 changed files with 6 additions and 6 deletions

View File

@ -230,8 +230,8 @@ async def converse_with_chat_assistant(
# Revert to Native RAGFlow Service (OpenAI endpoint failed with Auth error)
t1 = time.perf_counter()
# 修复:直接获取AsyncGenerator不使用await消费
result = RAGFlowService.converse_with_chat_assistant_services(converse_params)
# 修复:await async方法获取AsyncGenerator
result = await RAGFlowService.converse_with_chat_assistant_services(converse_params)
logger.info(f"[RAG_PROFILE] RAG Init/Connect ({converse_params.chat_id}): {time.perf_counter() - t1:.3f}s")
if converse_params.stream:

View File

@ -189,8 +189,8 @@ class SearchService:
except SearchServiceError as exc:
logger.warning('搜索服务失败降级到RAGFlow: %s', exc)
# Fallback to normal flow
# 修复:直接获取AsyncGenerator不使用await消费
result = RAGFlowService.converse_with_chat_assistant_services(converse_params)
# 修复:await async方法获取AsyncGenerator
result = await RAGFlowService.converse_with_chat_assistant_services(converse_params)
if converse_params.stream:
async def stream_response():

View File

@ -107,8 +107,8 @@ async def test_new_implementation():
print("="*60)
try:
# 修复:直接获取AsyncGenerator不使用await消费
generator = MockRAGFlowServiceNew.converse_with_chat_assistant_services(
# 修复:await async方法获取AsyncGenerator
generator = await MockRAGFlowServiceNew.converse_with_chat_assistant_services(
chat_id="test_chat_123",
question="你好",
stream=True