Skip to main content

rugbe-client (Python)

Typed HTTP + SSE client for rugbe-agent-runtime, sync and async. Backend subset of @bhanux/rugbe-client: workflows, runs (streaming), sessions, files, skills, models, me, node types, health.

from rugbe_client import RuntimeClient

with RuntimeClient(
    "https://runtime.example.com",
    get_auth_headers=lambda: {"Authorization": f"Bearer {key}"},
    on_auth_error=lambda: refresh_key(),  # optional: called once on 401
) as rt:
    session = rt.sessions.create(subject="user-42")
    for event in rt.runs.stream(session.workflow_id, input={"message": "hi"}, view="chat"):
        if event.type == "text":
            print(event.content, end="")

AsyncRuntimeClient has the same surface with async/await (async for on runs.stream); its credential hooks may be coroutines.

  • Errors: every non-2xx raises RuntimeApiError (status, kind, issues, detail). to_draft_conflict(err) reads a lost-update 409 on workflows.save_draft.
  • Only 401 triggers on_auth_error, once; a refreshed credential that is refused again surfaces. 403 is never retried.
  • Unknown stream event types arrive as UnknownEvent instead of raising.

Development

uv sync
uv run pytest
uv run ruff check . --fix && uv run ruff format src tests

tests/test_conformance.py compares model fields to packages/rugbe-client/openapi.json (refresh with bun run generate-types there).

Release files for rugbe-client 0.1.0

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

Source distribution (sdist)

Source distribution for rugbe-client 0.1.0
File Size Uploaded
rugbe_client-0.1.0.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rugbe-client 0.1.0
File Interpreter ABI Platform
rugbe_client-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / rugbe_client-0.1.0.tar.gz

Download URL rugbe_client-0.1.0.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cc9528052db296c5330d4bee9bd8a4a3d490595f81ae252e5f45dae1431a0cfc
BLAKE2b-256 checksum
How to use checksums
66a2f285e8ca8872ac66fd0478ab0d707f520787ab0b352e461b0a96c87f0959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.5

Release files / rugbe_client-0.1.0-py3-none-any.whl

Download URL rugbe_client-0.1.0-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8aef1c3ad0bd7509f20586aa27533d5610b4713e70dfbc113f6b417d9c9b754d
BLAKE2b-256 checksum
How to use checksums
8a93c965edcc154df157e13049e88dbe75ff7b8d597014046174badba6dc8c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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