feat:add dashscopeapi stream

fix:dify 64chunk yield
This commit is contained in:
Dong_master
2025-07-21 18:45:45 +08:00
committed by Junyan Qin
parent 7728b4262b
commit 074d359c8e
2 changed files with 147 additions and 53 deletions
+1 -1
View File
@@ -259,7 +259,7 @@ class DifyServiceAPIRunner(runner.RequestRunner):
is_final = False
pending_agent_message += chunk['answer']
if is_stream:
if batch_pending_index % 32 == 0 or is_final:
if batch_pending_index % 64 == 0 or is_final:
yield llm_entities.MessageChunk(
role='assistant',
content=self._try_convert_thinking(pending_agent_message),