class DeepAgentsPlugin(SimplePlugin): (source)
Constructor: DeepAgentsPlugin(model_provider, model_activity_options, tool_activity_options, streaming_topic, ...)
Temporal plugin that makes LangChain Deep Agents durable.
| Parameters | |
| model | Builds a real chat model from a name string, worker-side. This is where API keys live; only the model name ever crosses the workflow boundary. Defaults to LangChain's init_chat_model with LLM-SDK retries disabled (Temporal owns retries). |
| model | ActivityConfig (or Mapping[model_name, ActivityConfig]) for the model activities — timeouts, retry policy. |
| tool | ActivityConfig (or Mapping[tool_name, ActivityConfig]) default for tools wrapped with tool_as_activity. |
| streaming | When set, model calls stream through the streaming activity and publish chunk batches to this workflow-streams topic. |
| streaming | How long the streaming activity coalesces chunks before publishing a batch. |
| passthrough | Extra sandbox-passthrough modules, merged with the plugin's LangChain/deepagents defaults. |
| data | Override the default LangChain-aware converter. None installs the default; the SDK default is upgraded in place; any other converter raises (fold DeepAgentsPayloadConverter into your own). |
| Method | __init__ |
Configure the plugin; see the class docstring for parameters. |
| Method | configure |
Deduplicate activity registrations after the base configuration. |
| Method | _make |
Undocumented |
| Async Method | _run |
Patch Deep Agents' model resolution seam for the worker's lifetime. |
| Instance Variable | _activities |
Undocumented |
| Instance Variable | _data |
Undocumented |
| Instance Variable | _passthrough |
Undocumented |
| Instance Variable | _tool |
Undocumented |
Inherited from SimplePlugin:
| Method | configure |
See base class. |
| Method | configure |
See base class. |
| Async Method | connect |
See base class. |
| Method | name |
See base class. |
| Async Method | run |
See base class. |
| Async Method | run |
See base class. |
| Instance Variable | activities |
Undocumented |
| Instance Variable | data |
Undocumented |
| Instance Variable | interceptors |
Undocumented |
| Instance Variable | nexus |
Undocumented |
| Instance Variable | run |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflows |
Undocumented |
| Instance Variable | _name |
Undocumented |
Callable[ [ str], Any] | None = None, model_activity_options: Any = None, tool_activity_options: Any = None, streaming_topic: str | None = None, streaming_batch_interval: timedelta = timedelta(Sequence[ str] | None = None, data_converter: Any = None):
(source)
¶
temporalio.plugin.SimplePlugin.__init__Configure the plugin; see the class docstring for parameters.
Patch Deep Agents' model resolution seam for the worker's lifetime.
The patch (on deepagents.graph.resolve_model, the seam create_deep_agent uses for the agent and every sub-agent) only rewrites model= strings when running inside a workflow, so it is inert on plain clients / activity workers. Determinism itself rides on the same mechanism contrib.langgraph uses — the loop is in-workflow and every nondeterministic call is an activity — so no speculative time/uuid shims are installed here.
One shim is required: LangChain's create_agent factory wraps every model node with LangSmith's @traceable, whose async path hops onto a thread via asyncio.run_in_executor — which the deterministic workflow event loop does not implement (it raises NotImplementedError). Tracing is an observability concern that must not run in-workflow, so we install LangSmith's own Temporal escape hatch (set_runtime_overrides) to run that setup inline when in_workflow(), and defer to the default thread hop everywhere else (activities / clients, where tracing is fine).