class documentation

class SandboxClientProvider: (source)

Constructor: SandboxClientProvider(name, client)

View In Hierarchy

A named sandbox client provider for Temporal workflows.

Warning

This class is experimental and may change in future versions. Use with caution in production environments.

Wraps a BaseSandboxClient with a unique name so that multiple sandbox backends can be registered on a single Temporal worker. Each provider gets its own set of Temporal activities whose names are prefixed with the provider name, allowing them to coexist on the same task queue.

On the worker side, pass one or more providers to the plugin:

plugin = OpenAIAgentsPlugin(
    sandbox_clients=[
        SandboxClientProvider("daytona", DaytonaSandboxClient()),
        SandboxClientProvider("local", UnixLocalSandboxClient()),
    ],
)

On the workflow side, reference a provider by name via temporalio.contrib.openai_agents.workflow.temporal_sandbox_client:

run_config = RunConfig(
    sandbox=SandboxRunConfig(
        client=temporal_sandbox_client("daytona"),
        ...
    ),
)
Parameters
nameA unique name for this sandbox backend (e.g. "daytona", "local"). Must match the name used on the workflow side.
clientThe real BaseSandboxClient that performs sandbox lifecycle and I/O operations on the worker.
Method __init__ Initialize the provider.
Property name The provider name used as an activity-name prefix.
Method _get_activities Return all activity callables for registration with a Temporal Worker.
Async Method _session Undocumented
Instance Variable _client Undocumented
Instance Variable _name Undocumented
Instance Variable _sessions Undocumented
def __init__(self, name: str, client: BaseSandboxClient[Any]): (source)

Initialize the provider.

The provider name used as an activity-name prefix.

def _get_activities(self) -> Sequence[Callable[..., Any]]: (source)

Return all activity callables for registration with a Temporal Worker.

async def _session(self, args: _HasState) -> SandboxSession: (source)

Undocumented

Undocumented

Undocumented

_sessions: dict[str, SandboxSession] = (source)

Undocumented