修复延时问题尝试
This commit is contained in:
parent
c293e43281
commit
2bd083c09f
@ -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:
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user