Skip to main content

Class: SandboxClientProvider

openaiAgents.SandboxClientProvider

A named sandbox client provider for Temporal Workflows.

Wraps a real SandboxClient with a unique name so multiple sandbox backends can be registered on a single Temporal Worker. Each provider gets its own set of Activities whose names are prefixed with the provider name. Live sessions are cached by session id; any Worker can serve any session's Activities because a cache miss is self-healed via client.resume().

On the Worker side, pass providers to the plugin:

const plugin = new OpenAIAgentsPlugin({
modelProvider,
sandboxClientProviders: [new SandboxClientProvider('local', new UnixLocalSandboxClient())],
});

On the Workflow side, reference a provider by name via temporalSandboxClient from @temporalio/openai-agents/workflow:

runConfig: { sandbox: { client: temporalSandboxClient('local') } }

Sandbox support is experimental and may change without notice.

Constructors​

constructor​

• new SandboxClientProvider(name, client): SandboxClientProvider

Parameters​

NameType
namestring
clientSandboxClient<SandboxClientOptions, SandboxSessionState>

Returns​

SandboxClientProvider

Properties​

name​

• Readonly name: string

Methods​

_getActivities​

▸ _getActivities(): Record<string, ActivityFunction>

Returns​

Record<string, ActivityFunction>


_setResolvableWorkerEnvVars​

▸ _setResolvableWorkerEnvVars(names): void

Parameters​

NameType
namesreadonly string[]

Returns​

void