Merge pull request #2478 from xinnan-tech/fix-mcp

fix:修复部分LLM在工具调用时数据被空字符串覆盖的问题
This commit is contained in:
rainv123 2025-11-06 16:57:44 +08:00 committed by GitHub
commit 2527c16e18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -798,9 +798,9 @@ class ConnectionHandler:
if tools_call is not None and len(tools_call) > 0:
tool_call_flag = True
if tools_call[0].id is not None:
if tools_call[0].id is not None and tools_call[0].id != "":
function_id = tools_call[0].id
if tools_call[0].function.name is not None:
if tools_call[0].function.name is not None and tools_call[0].function.name != "":
function_name = tools_call[0].function.name
if tools_call[0].function.arguments is not None:
function_arguments += tools_call[0].function.arguments