确保流式响应
This commit is contained in:
parent
57406f922e
commit
0272372b44
@ -251,6 +251,9 @@ async def stream_ragflow_response(result: Generator, chat_id: str, start_time: f
|
||||
chunk_time = time.time()
|
||||
chunk_count += 1
|
||||
|
||||
# 让出控制权,确保流式响应
|
||||
await asyncio.sleep(0)
|
||||
|
||||
# 检查第一个token的延迟
|
||||
if not first_token_received:
|
||||
first_token_received = True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user