Skip to main content

AgentRunner

Swarmauri

Downloads Hits Python License Release

Run model tool calls and resume checkpointed human interactions.

Features

  • Run model tool calls and resume checkpointed human interactions.
  • Supports Python 3.10 through 3.12.

Installation

uv add swarmauri_agent_runner
pip install swarmauri_agent_runner

Usage

from swarmauri_agent_runner import AgentRunner
from swarmauri_runstore_sqlite import SqliteRunStore
from swarmauri_standard.tool_llms.OpenAIToolModel import OpenAIToolModel

model = OpenAIToolModel(api_key="your-api-key")
runner = AgentRunner(model, SqliteRunStore(path="runs.db"))
state = runner.start("Ask me which package to inspect.")
if state.status == "input_required":
    from swarmauri_standard.messages.AnswerMessage import AnswerMessage

    question = state.event().question
    reply = AnswerMessage(question_id=question.question_id, answer=input(question.content))
    state = runner.resume(state.run_id, reply)

Reopen the same SQLite database and configure the same model and tools to resume a pending question or approval in another process. The application authenticates the caller before exposing a run or accepting a decision. Set a stable approval scope that identifies the workspace and permissions. A run interrupted during tool dispatch records that state for reconciliation. Runtime tool instances and open process handles live in the application process.

Execution controller integration

AgentRunnerExecutionDriver(runner=runner) adapts the existing runner to IExecutionDriver. initialize(prompt) creates a checkpoint without running work; advance(run_id, max_steps=1) yields after one runner step. Existing start, resume and approval APIs remain supported. Pause/stop acknowledge between steps, not in the middle of an external tool effect. See the composition guide.

Tool approvals and run stores

Install swarmauri-runstore-sqlite to run the SQLite example. The runner accepts an IRunStore and an OpenAI or Gemini tool model. Existing OpenAI-shaped model callables and legacy typed run stores remain supported.

Set approval_policy(tool, arguments) to return "ask" for calls that need review and configure an approval_scope. Render state.event() in your application, then submit the authorized reviewer’s decision.

from swarmauri_agent_runner import ApprovalDecision

state = runner.decide(
    run_id,
    ApprovalDecision(approval_id=approval_id, approved=True),
)

Use runner.load(run_id) to retrieve typed state from a reopened database. state.approval_requests and state.approval_decisions retain the information needed to render resolved approval cards. Tool execution status is separate. When a process stops during tool dispatch, reconcile the external side effect before recovering the run.

Existing SQLite databases work with the standalone adapter. The old swarmauri_agent_runner.SqliteRunStore import accepts and returns typed RunState objects. Install swarmauri_agent_runner[sqlite] to use that compatibility wrapper.

Metadata

Release files for swarmauri_agent_runner 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swarmauri_agent_runner 0.1.2
File Size Uploaded Provenance Actions
swarmauri_agent_runner-0.1.2.tar.gz 12.8 kB Without provenance Details for swarmauri_agent_runner-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_agent_runner 0.1.2
File Interpreter ABI Platform Actions
swarmauri_agent_runner-0.1.2-py3-none-any.whl Python 3 none any Details for swarmauri_agent_runner-0.1.2-py3-none-any.whl

Total release size: 28.7 kB

Release files / swarmauri_agent_runner-0.1.2.tar.gz

Download URL swarmauri_agent_runner-0.1.2.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2664e814604e0056e9794cb596ce17f636a740a5a4e9f7745ca6fd2d0c6d759c
BLAKE2b-256 checksum
How to use checksums
bb46bc5c2d20603b933ad1dd9e240cfcae835ec5ee11398e2ea30087d86ea448
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / swarmauri_agent_runner-0.1.2-py3-none-any.whl

Download URL swarmauri_agent_runner-0.1.2-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a02beffec4530c3a3455a1ace29b2c8e33a024aeefbe0c9f64600f1218160bc
BLAKE2b-256 checksum
How to use checksums
6b2cd37cbe8441147f40e8d37591ccec4854f553f7ff42374e17b9c724962a0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 swarmauri_agent_runner 0.1.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page