Report AI agents into Roost — heartbeat, runs, cost, and human-in-the-loop approvals.
Project description
roost-client (Python)
Report any AI agent into Roost. Standard library only — no dependencies.
pip install roost-client
from roost_client import Roost
roost = Roost(
url="https://xxxx.supabase.co", # your Roost / Supabase project URL
api_key="rsk_...", # from Roost → Settings → API keys
slug="lead-enricher",
)
# 1. Register on boot (idempotent)
roost.register(name="Lead Enricher", job_title="Enrichment", department="Sales", runtime="custom")
# 2. Heartbeat while alive
stop = roost.start_heartbeat(15)
# 3. A run per task
run = roost.start_run(trigger="cron")
try:
roost.log("Enriched 12 leads", run=run)
roost.end_run(run, status="success", cost_usd=0.08, summary="Enriched 12 leads")
except Exception as e:
roost.end_run(run, status="error", error_message=str(e))
# 4. Gate anything irreversible behind a human
if roost.request_approval(action_label="Spend $50 on ads", payload={"budget": 50}):
... # a human clicked Approve
stop()
start_heartbeatruns a daemon thread and returns astop()callable.request_approvalblocks until a human decides, it expires, ortimeoutelapses; returnsTrueonly on an explicit approve.- Pass
on_error=...so transport errors are reported instead of raised (telemetry should never crash your agent).
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
roost_client-0.1.0.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file roost_client-0.1.0.tar.gz.
File metadata
- Download URL: roost_client-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecf5d700b9ef3ea4b7c748c59d76eba3ba985d182d8bcfca3fe87faf0a725e61
|
|
| MD5 |
59182fc9ea0488e8d7111dfb15ed1453
|
|
| BLAKE2b-256 |
4240424ba2d5e9ab5912f0c2405980d3f366d607e0c6bf4828f4d81aaa454648
|
File details
Details for the file roost_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: roost_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
365c74891cad610550f0c2ea5f73ae2e23310fc0685cf17a06854dc454906659
|
|
| MD5 |
542a3b91293c5eacd65586ed014326b2
|
|
| BLAKE2b-256 |
7250b83b624b98f5394ae67e18dde686303e5ed5b1fa2382d9db7144c4836b3d
|