File tree Expand file tree Collapse file tree
astrbot/core/computer/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111from astrbot .core .computer .tools .permissions import check_admin_permission
1212from astrbot .core .message .message_event_result import MessageChain
1313
14+ _OS_NAME = platform .system ()
15+
1416param_schema = {
1517 "type" : "object" ,
1618 "properties" : {
@@ -62,9 +64,7 @@ async def handle_result(result: dict, event: AstrMessageEvent) -> ToolExecResult
6264@dataclass
6365class PythonTool (FunctionTool ):
6466 name : str = "astrbot_execute_ipython"
65- description : str = (
66- f"Run codes in an IPython shell. Current OS: { platform .system ()} ."
67- )
67+ description : str = f"Run codes in an IPython shell. Current OS: { _OS_NAME } ."
6868 parameters : dict = field (default_factory = lambda : param_schema )
6969
7070 async def call (
@@ -86,7 +86,10 @@ async def call(
8686@dataclass
8787class LocalPythonTool (FunctionTool ):
8888 name : str = "astrbot_execute_python"
89- description : str = f"Execute codes in a Python environment. Current OS: { platform .system ()} . Use system-compatible commands."
89+ description : str = (
90+ f"Execute codes in a Python environment. Current OS: { _OS_NAME } . "
91+ "Use system-compatible commands."
92+ )
9093
9194 parameters : dict = field (default_factory = lambda : param_schema )
9295
You can’t perform that action at this time.
0 commit comments