Class: TemporalOpenAIRunner
openaiAgentsWorkflow.TemporalOpenAIRunner
A Temporal-aware agent runner that delegates model calls to Activities.
Use run(agent, input) for request-response runs. Pass { stream: true } to
stream incremental events as the model responds — the returned
StreamedRunResult is async-iterable. Streaming requires a streamingTopic
(set via the plugin's modelParams or the runner's defaultModelParams) and a
hosted WorkflowStream in the Workflow.
Constructors
constructor
• new TemporalOpenAIRunner(options?): TemporalOpenAIRunner
Parameters
| Name | Type |
|---|---|
options? | TemporalOpenAIRunnerOptions |
Returns
Methods
run
▸ run<TAgent, TContext>(agent, input, options?): Promise<RunResult<any, TAgent>>
input accepts a prompt string, structured AgentInputItem[], or a
deserialized RunState to resume a previous run across continueAsNew.
Capture the current RunState via result.state.toString().
Type parameters
| Name | Type |
|---|---|
TAgent | extends Agent<any, any> |
TContext | undefined |
Parameters
| Name | Type |
|---|---|
agent | TAgent |
input | string | AgentInputItem[] | RunState<TContext, TAgent> |
options? | TemporalRunOptions<TContext> & { stream?: false } |
Returns
Promise<RunResult<any, TAgent>>
▸ run<TAgent, TContext>(agent, input, options): Promise<StreamedRunResult<TContext, TAgent>>
Type parameters
| Name | Type |
|---|---|
TAgent | extends Agent<any, any> |
TContext | undefined |
Parameters
| Name | Type |
|---|---|
agent | TAgent |
input | string | AgentInputItem[] | RunState<TContext, TAgent> |
options | TemporalRunOptions<TContext> & { stream: true } |
Returns
Promise<StreamedRunResult<TContext, TAgent>>