class DaytonaRuntime(BaseRuntime):
A runtime that executes functions in a Daytona sandbox environment. Requires the Daytona server to be running and an API key configured.
Parameters:
None
)None
)"python"
)def __init__(
self,
api_key: Optional[str] = None,
api_url: Optional[str] = None,
language: Optional[str] = 'python'
):
def build(self):
Returns:
DaytonaRuntime: The current runtime.
def _cleanup(self):
Clean up the sandbox when exiting.
def add(
self,
funcs: Union[FunctionTool, List[FunctionTool]],
entrypoint: str,
arguments: Optional[Dict[str, Any]] = None
):
Add a function or list of functions to the runtime.
Parameters:
None
)Returns:
DaytonaRuntime: The current runtime.
def info(self):
Returns:
str: Information about the sandbox.
def __del__(self):
Clean up the sandbox when the object is deleted.
def stop(self):
Returns:
DaytonaRuntime: The current runtime.
def reset(self):
Returns:
DaytonaRuntime: The current runtime.
def docs(self):
Returns:
str: The URL for the API documentation.