fix: 修复 v4.0.0 版本下可能无法得到 LLM 的响应的问题

closes: #2622
This commit is contained in:
Soulter
2025-09-05 17:20:29 +08:00
parent e50e7ad3d5
commit 5082876de3
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -1929,7 +1929,7 @@ CONFIG_METADATA_3 = {
},
"provider_settings.max_agent_step": {
"description": "工具调用轮数上限",
"type": "bool",
"type": "int",
},
"provider_settings.streaming_response": {
"description": "流式回复",
@@ -299,7 +299,9 @@ class LLMRequestSubStage(Stage):
self.max_context_length - 1,
)
self.streaming_response: bool = settings["streaming_response"]
self.max_step: int = settings.get("max_agent_step", 10)
self.max_step: int = settings.get("max_agent_step", 30)
if isinstance(self.max_step, bool): # workaround: #2622
self.max_step = 30
self.show_tool_use: bool = settings.get("show_tool_use_status", True)
for bwp in self.bot_wake_prefixs:
@@ -434,7 +436,9 @@ class LLMRequestSubStage(Stage):
provider_cfg = provider.provider_config.get("modalities", ["tool_use"])
# 如果模型不支持工具使用,但请求中包含工具列表,则清空。
if "tool_use" not in provider_cfg:
logger.debug(f"用户设置提供商 {provider} 不支持工具使用,清空工具列表。")
logger.debug(
f"用户设置提供商 {provider} 不支持工具使用,清空工具列表。"
)
req.func_tool = None
# 插件可用性设置
if event.plugins_name is not None and req.func_tool: