class documentation

class ModelActivityParameters: (source)

View In Hierarchy

Parameters for configuring Temporal activity execution for model calls.

This class encapsulates all the parameters that can be used to configure how Temporal activities are executed when making model calls through the OpenAI Agents integration.

Class Variable heartbeat_timeout Maximum time between heartbeats. For streaming (Runner.run_streamed), set this lower than start_to_close_timeout so a stuck model call is detected before the overall activity timeout fires.
Class Variable retry_policy Policy for retrying failed activities.
Class Variable schedule_to_close_timeout Maximum time from scheduling to completion.
Class Variable schedule_to_start_timeout Maximum time from scheduling to starting.
Class Variable start_to_close_timeout Maximum time for the activity to complete.
Class Variable streaming_batch_interval Interval between automatic flushes for the stream publisher used by the streaming activity.
Class Variable streaming_topic Stream topic to publish raw model stream events to when the workflow calls Runner.run_streamed. Required for Runner.run_streamed; if left as None, run_streamed raises before scheduling any activity. The workflow must host a ...
Class Variable summary_override Summary for the activity execution.
Class Variable task_queue Specific task queue to use for model activities.
Class Variable use_local_activity Whether to use a local activity. If changed during a workflow execution, that would break determinism.
Class Variable versioning_intent Versioning intent for the activity.
heartbeat_timeout: timedelta | None = (source)

Maximum time between heartbeats. For streaming (Runner.run_streamed), set this lower than start_to_close_timeout so a stuck model call is detected before the overall activity timeout fires.

retry_policy: RetryPolicy | None = (source)

Policy for retrying failed activities.

schedule_to_close_timeout: timedelta | None = (source)

Maximum time from scheduling to completion.

schedule_to_start_timeout: timedelta | None = (source)

Maximum time from scheduling to starting.

start_to_close_timeout: timedelta | None = (source)

Maximum time for the activity to complete.

streaming_batch_interval: timedelta = (source)

Interval between automatic flushes for the stream publisher used by the streaming activity.

Warning

Streaming support is experimental and may change in future versions.

streaming_topic: str | None = (source)

Stream topic to publish raw model stream events to when the workflow calls Runner.run_streamed. Required for Runner.run_streamed; if left as None, run_streamed raises before scheduling any activity. The workflow must host a temporalio.contrib.workflow_streams.WorkflowStream to receive the publishes; otherwise the signals are unhandled and dropped.

Streaming is incompatible with use_local_activity (local activities do not support heartbeats or the workflow stream signal channel).

Warning

Streaming support is experimental and may change in future versions.

summary_override: None | str | ModelSummaryProvider = (source)

Summary for the activity execution.

task_queue: str | None = (source)

Specific task queue to use for model activities.

use_local_activity: bool = (source)

Whether to use a local activity. If changed during a workflow execution, that would break determinism.

versioning_intent: VersioningIntent | None = (source)

Versioning intent for the activity.