mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
21 lines
400 B
Python
21 lines
400 B
Python
"""
|
|
Python/IPython component
|
|
"""
|
|
|
|
from typing import Any, Protocol
|
|
|
|
|
|
class PythonComponent(Protocol):
|
|
"""Python/IPython operations component"""
|
|
|
|
async def exec(
|
|
self,
|
|
code: str,
|
|
kernel_id: str | None = None,
|
|
timeout: int = 30,
|
|
silent: bool = False,
|
|
cwd: str | None = None,
|
|
) -> dict[str, Any]:
|
|
"""Execute Python code"""
|
|
...
|