From cca9c99e222a2e14483c8ab0191553b6dc58ca35 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 6 May 2026 16:46:58 +0800 Subject: [PATCH] fix: tool calling by mapping tools and tool_choice to root payload instead of toolConfig --- app/lingma_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/lingma_client.py b/app/lingma_client.py index 4b3f41c..e50631d 100644 --- a/app/lingma_client.py +++ b/app/lingma_client.py @@ -971,7 +971,10 @@ class LingmaGatewayClient: }, } 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( "lingma payload request_id=%s session_id=%s mode=%s tool_config=%s", request_id,