mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-19 10:22:04 +08:00
ruff check --fix --select ALL
This commit is contained in:
@@ -46,8 +46,8 @@ async def handle_result(result: dict, event: AstrMessageEvent) -> ToolExecResult
|
||||
for img in images:
|
||||
resp.content.append(
|
||||
mcp.types.ImageContent(
|
||||
type="image", data=img["image/png"], mimeType="image/png"
|
||||
)
|
||||
type="image", data=img["image/png"], mimeType="image/png",
|
||||
),
|
||||
)
|
||||
|
||||
if event.get_platform_name() == "webchat":
|
||||
@@ -68,7 +68,7 @@ class PythonTool(FunctionTool):
|
||||
parameters: dict = field(default_factory=lambda: param_schema)
|
||||
|
||||
async def call( # type: ignore[override]
|
||||
self, context: ContextWrapper[AstrAgentContext], code: str, silent: bool = False
|
||||
self, context: ContextWrapper[AstrAgentContext], code: str, silent: bool = False,
|
||||
) -> ToolExecResult:
|
||||
if permission_error := check_admin_permission(context, "Python execution"):
|
||||
return permission_error
|
||||
@@ -94,7 +94,7 @@ class LocalPythonTool(FunctionTool):
|
||||
parameters: dict = field(default_factory=lambda: param_schema)
|
||||
|
||||
async def call( # type: ignore[override]
|
||||
self, context: ContextWrapper[AstrAgentContext], code: str, silent: bool = False
|
||||
self, context: ContextWrapper[AstrAgentContext], code: str, silent: bool = False,
|
||||
) -> ToolExecResult:
|
||||
if permission_error := check_admin_permission(context, "Python execution"):
|
||||
return permission_error
|
||||
|
||||
Reference in New Issue
Block a user