mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
fix: handle empty output case in PythonTool execution
This commit is contained in:
@@ -62,6 +62,11 @@ class PythonTool(FunctionTool):
|
||||
if text:
|
||||
resp.content.append(mcp.types.TextContent(type="text", text=text))
|
||||
|
||||
if not resp.content:
|
||||
resp.content.append(
|
||||
mcp.types.TextContent(type="text", text="No output.")
|
||||
)
|
||||
|
||||
return resp
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user