class documentation
class TemporalSandbox(Sandbox): (source)
Constructor: TemporalSandbox(name, task_queue, schedule_to_close_timeout, schedule_to_start_timeout, ...)
Workflow-side sandbox that dispatches operations as Temporal activities.
| Method | __init__ |
Configure a registered sandbox name and its activity options. |
| Async Method | execute |
Execute code in the registered worker-side sandbox. |
| Async Method | execute |
Execute a command in the registered worker-side sandbox. |
| Method | get |
Vend Strands' standard shell and file-editor sandbox tools. |
| Async Method | list |
List a directory in the registered worker-side sandbox. |
| Async Method | read |
Read bytes from the registered worker-side sandbox. |
| Async Method | remove |
Remove a file from the registered worker-side sandbox. |
| Async Method | write |
Write bytes to the registered worker-side sandbox. |
| Async Method | _execute |
Undocumented |
| Instance Variable | _name |
Undocumented |
| Instance Variable | _options |
Undocumented |
| Instance Variable | _streaming |
Undocumented |
| Instance Variable | _streaming |
Undocumented |
def __init__(self, name: milliseconds=100)):
(source)
¶
str, *, task_queue: str | None = None, schedule_to_close_timeout: timedelta | None = None, schedule_to_start_timeout: timedelta | None = None, start_to_close_timeout: timedelta | None = None, heartbeat_timeout: timedelta | None = None, retry_policy: RetryPolicy | None = None, cancellation_type: ActivityCancellationType = ActivityCancellationType.TRY_CANCEL, versioning_intent: VersioningIntent | None = None, summary: str | None = None, priority: Priority = Priority.default, streaming_topic: str | None = None, streaming_batch_interval: timedelta = timedelta(Configure a registered sandbox name and its activity options.
async def execute_code_streaming(self, code:
str, language: str, *, timeout: float | None = None, cwd: str | None = None, env: dict[ str, str] | None = None, **kwargs: Any) -> AsyncGenerator[ StreamChunk | ExecutionResult, None]:
(source)
¶
Execute code in the registered worker-side sandbox.
async def execute_streaming(self, command:
str, *, timeout: float | None = None, cwd: str | None = None, env: dict[ str, str] | None = None, **kwargs: Any) -> AsyncGenerator[ StreamChunk | ExecutionResult, None]:
(source)
¶
Execute a command in the registered worker-side sandbox.