mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-25 17:22:55 +00:00
chore: update tool decorator to handle non-ASCII names
This commit is contained in:
parent
78be028a0f
commit
336bb8cc2d
|
|
@ -183,7 +183,8 @@ sys.stdout.flush()
|
|||
node.args.defaults = defaults
|
||||
|
||||
func_code = ast.unparse(node)
|
||||
functions.append(f"@mcp.tool(name='{name}', description='{description}')\n{func_code}\n")
|
||||
# 有些模型不支持name是中文,例如: deepseek, 其他模型未知
|
||||
functions.append(f"@mcp.tool(name='', description='{description}')\n{func_code}\n")
|
||||
else:
|
||||
other_code.append(ast.unparse(node))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue