Files
AstrBot/astrbot/core/sandbox/olayer/python.py
T
2026-01-13 19:29:22 +08:00

20 lines
368 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,
) -> dict[str, Any]:
"""Execute Python code"""
...