feat(config): 新增最大并发分发数配置项

在 `ChatConfig` 中引入了 `max_concurrent_distributions` 配置,允许用户自定义最大并发处理的消息流数量。

此举旨在提供更灵活的性能调优选项,帮助用户根据服务器负载和API速率限制来控制资源消耗,防止系统过载。该配置的默认值为10。
This commit is contained in:
tt-P607
2025-09-30 20:04:04 +08:00
committed by Windpicker-owo
parent 797432147c
commit ac73994847
3 changed files with 7 additions and 3 deletions

View File

@@ -34,8 +34,8 @@ class StreamLoopManager:
}
# 配置参数
self.max_concurrent_streams = max_concurrent_streams or getattr(
global_config.chat, "max_concurrent_distributions", 10
self.max_concurrent_streams = (
max_concurrent_streams or global_config.chat.max_concurrent_distributions
)
# 强制分发策略