fix: tool calling by mapping tools and tool_choice to root payload instead of toolConfig

This commit is contained in:
GitHub Actions
2026-05-06 16:46:58 +08:00
parent 26858e1aba
commit cca9c99e22

View File

@@ -971,7 +971,10 @@ class LingmaGatewayClient:
}, },
} }
if tool_config is not None: if tool_config is not None:
payload["toolConfig"] = tool_config if "tools" in tool_config and tool_config["tools"]:
payload["tools"] = tool_config["tools"]
if "tool_choice" in tool_config and tool_config["tool_choice"]:
payload["tool_choice"] = tool_config["tool_choice"]
logger.info( logger.info(
"lingma payload request_id=%s session_id=%s mode=%s tool_config=%s", "lingma payload request_id=%s session_id=%s mode=%s tool_config=%s",
request_id, request_id,