class documentation

class TemporalOpenAIRunner(AgentRunner): (source)

Constructor: TemporalOpenAIRunner(model_params)

View In Hierarchy

Temporal Runner for OpenAI agents.

Forwards model calls to a Temporal activity.

Method __init__ Initialize the Temporal OpenAI Runner.
Async Method run Run the agent in a Temporal workflow.
Method run_streamed Run the agent with streaming responses.
Method run_sync Run the agent synchronously (not supported in Temporal workflows).
Instance Variable model_params Undocumented
Method _prepare_workflow_run Workflow-only validation and kwargs rewrite shared by run() and run_streamed().
Instance Variable _runner Undocumented
def __init__(self, model_params: ModelActivityParameters): (source)

Initialize the Temporal OpenAI Runner.

async def run(self, starting_agent: Agent[TContext], input: str | list[TResponseInputItem] | RunState[TContext], **kwargs: Unpack[RunOptions[TContext]]) -> RunResult: (source)

Run the agent in a Temporal workflow.

def run_streamed(self, starting_agent: Agent[TContext], input: str | list[TResponseInputItem] | RunState[TContext], **kwargs: Unpack[RunOptions[TContext]]) -> RunResultStreaming: (source)

Run the agent with streaming responses.

Warning

Streaming inside Temporal workflows is experimental and may change in future versions.

Inside a workflow, model calls execute as the streaming model activity. The workflow consumes events via RunResultStreaming.stream_events() after each activity completes; external clients can subscribe to the configured stream topic to receive events as they arrive.

def run_sync(self, starting_agent: Agent[TContext], input: str | list[TResponseInputItem] | RunState[TContext], **kwargs: Any) -> RunResult: (source)

Run the agent synchronously (not supported in Temporal workflows).

model_params = (source)

Undocumented

def _prepare_workflow_run(self, starting_agent: Agent[TContext], kwargs: RunOptions[TContext]) -> Agent[Any]: (source)

Workflow-only validation and kwargs rewrite shared by run() and run_streamed().

Undocumented