mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
fix: Reduce chunk returns in dify and Hundred Refining Runner to every 8 chunks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user