Skip to content

Commit 336bb8c

Browse files
committed
chore: update tool decorator to handle non-ASCII names
1 parent 78be028 commit 336bb8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/common/utils/tool_code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ def _generate_mcp_server_code(self, _code, params, name=None, description=None):
183183
node.args.defaults = defaults
184184

185185
func_code = ast.unparse(node)
186-
functions.append(f"@mcp.tool(name='{name}', description='{description}')\n{func_code}\n")
186+
# 有些模型不支持name是中文,例如: deepseek, 其他模型未知
187+
functions.append(f"@mcp.tool(name='', description='{description}')\n{func_code}\n")
187188
else:
188189
other_code.append(ast.unparse(node))
189190

0 commit comments

Comments
 (0)