smooai-smooth-operator-temporal (Python)
Optional Temporal durable-execution backend for the
smooai-smooth-operator-core
Python agent engine (ADR-030). The Python sibling of the
smooai-smooth-operator-temporal
Rust crate.
An agent turn runs as a Temporal workflow whose side-effects — the model call
and each tool invocation — are Temporal activities. The workflow drives the
engine's deterministic drive_turn orchestration unchanged, so the durable path
and the in-process path are the same loop. That buys crash-safe resume, durable
human-in-the-loop, and durable timers without a second implementation of the agent
loop to keep in sync.
Optionality
The serde DTO boundary (smooth_operator_temporal.dto) imports no Temporal
SDK and is always available. The workflow/activity wiring
(smooth_operator_temporal.temporal) imports temporalio, provided by the
optional temporal extra — mirroring the Rust crate's off-by-default temporal
cargo feature:
pip install 'smooai-smooth-operator-temporal[temporal]'
What it gives you
- Crash-safe resume — the workflow's event history is the checkpoint, so a worker restart mid-turn resumes rather than restarting the turn.
- Durable human-in-the-loop — a tool named in
approval_required_toolsblocks onworkflow.wait_conditionuntil anapprove_tool/deny_toolsignal names its call id. The pending decision lives in workflow history, so it survives a disconnected client and can resolve hours later. A denial returns a tool-error result to the model without ever executing the tool. - Durable timers — a call to the configured
wait_toolsleeps the workflow on a Temporal timer, a pause that can span days.
Usage
Register the workflow and activities on a worker, injecting the engine handles the activities run against:
from temporalio.client import Client
from temporalio.worker import Worker
from smooth_operator_temporal.temporal import AgentTurnActivities, AgentTurnWorkflow, HealthWorkflow
activities = AgentTurnActivities.from_engine(my_llm_provider) # AgentOptions optional
client = await Client.connect("localhost:7233")
worker = Worker(
client,
task_queue="smooth-operator-agent-turn",
workflows=[AgentTurnWorkflow, HealthWorkflow],
activities=[activities.health_echo, activities.model_call, activities.tool_invoke],
)
Start a turn:
from smooth_operator_temporal.dto import AgentTurnInput
messages = await client.execute_workflow(
AgentTurnWorkflow.run,
AgentTurnInput(system_prompt="You are a test agent", user_message="what is the durable answer?"),
id="agent-turn-1",
task_queue="smooth-operator-agent-turn",
)
Unlike the Rust reference — whose activities are free functions fed by a
process-global init_engine — Python holds the engine handles on the
AgentTurnActivities instance (plain dependency injection).
Status
The durable backend (workflow + activities + durable timer + HITL signals) is
implemented and covered by skip-gated e2e tests. Adapting it behind the engine's
streaming AgentExecutor protocol — so a server can select it per turn — is
deferred for the same reason the Rust server defers it: a workflow-backed turn has
no token-delta stream to feed the runner's event translator. The server-side
selection seam (env-gated, injected) lands separately in the smooth-operator
server repo.
License
MIT
Metadata
Release files for smooai-smooth-operator-temporal 1.14.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smooai_smooth_operator_temporal-1.14.2.tar.gz | 39.0 kB | Without provenance | Details for smooai_smooth_operator_temporal-1.14.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smooai_smooth_operator_temporal-1.14.2-py3-none-any.whl | Python 3 | none | any | Details for smooai_smooth_operator_temporal-1.14.2-py3-none-any.whl |
Total release size: 47.8 kB
Release files / smooai_smooth_operator_temporal-1.14.2.tar.gz
| Download URL | smooai_smooth_operator_temporal-1.14.2.tar.gz |
|---|---|
| Size | 39.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03bbec36005996350a66e14d0c7eb3013b3a9df38a08c369009d0c4d4b3de9c1
|
|
BLAKE2b-256 checksum How to use checksums |
fbf5af1c25dd48f09ecfc49ce05a05e5a17433119a9fbb19b6b6d41c7a64eacf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / smooai_smooth_operator_temporal-1.14.2-py3-none-any.whl
| Download URL | smooai_smooth_operator_temporal-1.14.2-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf882d11fec397043747375c030ad84bc5c47341771048627f250cf19a1cf45a
|
|
BLAKE2b-256 checksum How to use checksums |
5d020bf0f864baf2a15c7a189f282bb36e44f173aaf911774948ea5318dc07fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for smooai-smooth-operator-temporal 1.14.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.