package documentation

Support for using the OpenAI Agents SDK as part of Temporal workflows.

This module provides compatibility between the OpenAI Agents SDK and Temporal workflows.

Package sandbox Sandbox support for Temporal OpenAI Agents plugin.
Module testing Testing utilities for OpenAI agents.
Module workflow Workflow-specific primitives for working with the OpenAI Agents SDK in a workflow context
Module _errors Error types for the OpenAI Agents SDK Temporal integration.
Module _heartbeat_decorator No module docstring; 0/1 type variable, 1/2 function documented
Module _invoke_model_activity A temporal activity that invokes a LLM model.
Module _mcp Undocumented
Module _model_parameters Parameters for configuring Temporal activity execution for model calls.
Module _openai_runner No module docstring; 3/5 functions, 1/1 class documented
Module _otel_trace_interceptor OTEL-aware variant of OpenAI Agents trace interceptor.
Module _temporal_model_stub No module docstring; 1/1 class documented
Module _temporal_openai_agents Initialize Temporal OpenAI Agents overrides.
Module _temporal_trace_provider Provides support for integration with OpenAI Agents SDK tracing across workflows
Module _temporal_worker_env_ref Worker-environment secrets: the reference form, and the allowlist both forms share.
Module _trace_interceptor Adds OpenAI Agents traces and spans to Temporal workflows and activities.

From __init__.py:

Class AllowAllWorkerEnvVars Make every environment variable on the worker resolvable.
Class ModelActivityParameters Parameters for configuring Temporal activity execution for model calls.
Class OpenAIAgentsPlugin Temporal plugin for integrating OpenAI agents with Temporal workflows.
Class OpenAIPayloadConverter PayloadConverter for OpenAI agents.
Class SandboxClientProvider A named sandbox client provider for Temporal workflows.
Class StatefulMCPServerProvider A stateful MCP server implementation for Temporal workflows.
Class StatelessMCPServerProvider A stateless MCP server implementation for Temporal workflows.
Class TemporalWorkerEnvValue A sandbox environment variable whose value is read on the Temporal Worker.
Exception AgentsWorkflowError Error that terminates the calling workflow or update.
Function temporal_worker_env_ref Refer to a secret held in the Temporal Worker's environment.
def temporal_worker_env_ref(name: str) -> str: (source) ΒΆ

Refer to a secret held in the Temporal Worker's environment.

Warning

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

Use it for a hosted tool credential that should come from the worker's environment rather than being written into your workflow. Put the returned reference in a HostedMCPTool's authorization or header value, or in the value of a domain_secrets entry under a ShellTool or CodeInterpreterTool. The reference carries only the variable's name, never its value.

Every worker that runs model activities must set the variable and name it in OpenAIAgentsPlugin(resolvable_worker_env_vars=[...]). A name the worker allows but has not set resolves to an empty value.

Parameters
name:strName of the environment variable to read on the worker.
Returns
strA reference string to use in place of the secret.