class documentation
class TemporalAgent(Agent): (source)
Constructor: TemporalAgent(model, task_queue, schedule_to_close_timeout, schedule_to_start_timeout, ...)
A Strands Agent that routes model calls through a Temporal activity.
model is the name of a factory registered in StrandsPlugin(models={...}). The activity options apply to every model invocation this agent makes. All other keyword arguments are forwarded to Strands' Agent (tools, hooks, system_prompt, structured_output_model, messages, etc.).
Strands' retry_strategy is disabled; configure retries via retry_policy here and on the activity options accepted by activity_as_tool, activity_as_hook, and TemporalMCPClient.
| Method | __init__ |
Build a TemporalAgent from a registered model name and activity options. |
| Method | load |
Disabled; Temporal's event history is the source of truth. |
| Method | take |
Disabled; Temporal's event history is the source of truth. |
def __init__(self, *, model: milliseconds=100), **agent_kwargs:
str | None = None, task_queue: str | None = None, schedule_to_close_timeout: timedelta | None = None, schedule_to_start_timeout: timedelta | None = None, start_to_close_timeout: timedelta | None = None, heartbeat_timeout: timedelta | None = None, retry_policy: RetryPolicy | None = None, cancellation_type: ActivityCancellationType = ActivityCancellationType.TRY_CANCEL, versioning_intent: VersioningIntent | None = None, summary: str | None = None, priority: Priority = Priority.default, streaming_topic: str | None = None, streaming_batch_interval: timedelta = timedelta(Any):
(source)
¶
Build a TemporalAgent from a registered model name and activity options.