core: refactor modules & fix typing/runtime issues

This commit is contained in:
LIghtJUNction
2026-03-19 23:06:27 +08:00
parent 8184e20850
commit a3371ad6c8
45 changed files with 818 additions and 532 deletions

View File

@@ -80,7 +80,7 @@ class PythonTool(FunctionTool):
result = await sb.python.exec(code, silent=silent)
return await handle_result(result, context.context.event)
except Exception as e:
return f"Error executing code: {str(e)}"
return f"Error executing code: {e!s}"
@dataclass
@@ -103,4 +103,4 @@ class LocalPythonTool(FunctionTool):
result = await sb.python.exec(code, silent=silent)
return await handle_result(result, context.context.event)
except Exception as e:
return f"Error executing code: {str(e)}"
return f"Error executing code: {e!s}"