fix: Reduce chunk returns in dify and Hundred Refining Runner to every 8 chunks

This commit is contained in:
fdc
2025-08-04 16:39:38 +08:00
committed by Junyan Qin
parent 8adc88a8c0
commit 4a1d033ee9
3 changed files with 3 additions and 3 deletions

View File

@@ -55,6 +55,6 @@ class MoonshotChatCompletions(chatcmpl.OpenAIChatCompletions):
resp = await self._req(args, extra_body=extra_args)
# 处理请求结果
message = await self._make_msg(resp,remove_think)
message = await self._make_msg(resp, remove_think)
return message

View File

@@ -148,7 +148,7 @@ class DashScopeAPIRunner(runner.RequestRunner):
# 将参考资料替换到文本中
pending_content = self._replace_references(pending_content, references_dict)
if idx_chunk % 64 == 0 or is_final:
if idx_chunk % 8 == 0 or is_final:
yield llm_entities.MessageChunk(
role='assistant',
content=pending_content,

View File

@@ -115,7 +115,7 @@ class DifyServiceAPIRunner(runner.RequestRunner):
stream_output_pending_chunk = ''
batch_pending_max_size = 64 # 积累一定量的消息更新消息一次
batch_pending_max_size = 8 # 积累一定量的消息更新消息一次
batch_pending_index = 0