Support for using the OpenAI Agents SDK as part of Temporal workflows.
This module provides compatibility between the OpenAI Agents SDK and Temporal workflows.
Warning
This module is experimental and may change in future versions. Use with caution in production environments.
Module | temporal |
Initialize Temporal OpenAI Agents overrides. |
Module | workflow |
Workflow-specific primitives for working with the OpenAI Agents SDK in a workflow context |
Module | _heartbeat |
No module docstring; 0/1 type variable, 1/2 function documented |
Module | _invoke |
A temporal activity that invokes a LLM model. |
Module | _model |
Parameters for configuring Temporal activity execution for model calls. |
Module | _openai |
No module docstring; 1/1 class documented |
Module | _temporal |
No module docstring; 0/1 variable, 1/1 class documented |
Module | _temporal |
Provides support for integration with OpenAI Agents SDK tracing across workflows |
Module | _trace |
Adds OpenAI Agents traces and spans to Temporal workflows and activities. |
From __init__.py
:
Class |
|
Class wrapper for model invocation activities to allow model customization. |
Class |
|
Parameters for configuring Temporal activity execution for model calls. |
Class |
|
Interceptor that propagates OpenAI agent tracing context through Temporal workflows and activities. |
Class |
|
Test model for use mocking model responses. |
Class |
|
Test model provider which simply returns the given module. |
Function | set |
Configure Temporal-specific overrides for OpenAI agents. |
def set_open_ai_agent_temporal_overrides(model_params:
ModelActivityParameters | None
= None, auto_close_tracing_in_workflows: bool
= False):
(source)
ΒΆ
Configure Temporal-specific overrides for OpenAI agents.
Warning
This API is experimental and may change in future versions. Use with caution in production environments. Future versions may wrap the worker directly instead of requiring this context manager.
This context manager sets up the necessary Temporal-specific runners and trace providers for running OpenAI agents within Temporal workflows. It should be called in the main entry point of your application before initializing the Temporal client and worker.
The context manager handles: 1. Setting up a Temporal-specific runner for OpenAI agents 2. Configuring a Temporal-aware trace provider 3. Restoring previous settings when the context exits
Parameters | |
modelModelActivityParameters | None | Configuration parameters for Temporal activity execution of model calls. |
autobool | If set to true, close tracing spans immediately. |
Returns | |
A context manager that yields the configured TemporalTraceProvider. |