Python SDK for AgenTrux — A2A authenticated pub/sub client
Project description
AgenTrux SDK
Python SDK for AgenTrux — A2A authenticated pub/sub client.
Status: Beta (0.4.0b2) — OAuth 2.1 client_credentials + cursor-based pagination + SSE hint-only consumer.
Install
pip install agentrux-sdk
The import name is agentrux_sdk (distinct from the server-internal
agentrux package, so the two never collide):
from agentrux_sdk import AgenTruxClient
Quick Start
from agentrux_sdk import AgenTruxClient
# Confidential client (script credentials issued by Console)
async with AgenTruxClient(
endpoint="https://api.agentrux.com",
client_id="crd_<uuid>", # script credential client_id
client_secret="aks_<base64>", # script credential client_secret
) as client:
# --- Publish ------------------------------------------------------
result = await client.publish(
topic_id="top_<uuid>",
payload={"msg": "Hello!"},
event_type="hello.world",
)
print(result.event_id, result.sequence_number)
# --- Read (cursor-based) ------------------------------------------
async for evt in client.read_pull(topic_id="top_<uuid>"):
print(evt.event_type, evt.payload)
OAuth 2.1
AgenTruxClient uses the client_credentials grant. Pass the script
credentials (client_id="crd_<uuid>", client_secret="aks_<base64>")
issued by Console; the SDK obtains and re-issues access tokens
automatically — there is no refresh token to persist.
For interactive setup (device flow, RFC 8628) the approval step is
delegated to the Console SPA, not the SDK. See install_topology /
device_code_setup for the setup helpers.
Read modes
read_hybrid(topic_id=...): pull-driven, SSE hints accelerate the next pull.read_pull(topic_id=...): pull only; works without SSE reachability.read_sse(topic_id=...): server-sent events with auto-reconnect.
Each returns an async iterator of Event (.event_id, .event_type,
.payload, .sequence_number). Use the last event_id as the after=
cursor to resume.
Used by
This SDK is the shared transport layer for all AgenTrux Python plugins:
agentrux-agent-tools— AI agent toolkit- (Dify Tools / Dify Trigger — once migrated to v0.3)
License
MIT — see LICENSE. Full license text: https://opensource.org/license/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
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 agentrux_sdk-0.4.0b3.tar.gz.
File metadata
- Download URL: agentrux_sdk-0.4.0b3.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8a20c12deb5c6f51af7ac034e1d68ed04c6c0d3b5f3e914feae2460ff728703
|
|
| MD5 |
80a9b328900d0263f22e43d01afc04ac
|
|
| BLAKE2b-256 |
693e98b1ce82ddfbec48603a8bbadb05068faa823340209d23d71af808906fae
|
File details
Details for the file agentrux_sdk-0.4.0b3-py3-none-any.whl.
File metadata
- Download URL: agentrux_sdk-0.4.0b3-py3-none-any.whl
- Upload date:
- Size: 57.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed3c73fcbb30d7dd54b515f5937e8ea6f17921f19d399de2f567f27432318d5c
|
|
| MD5 |
69fbf2934652748ec5b3bf7aefc5250f
|
|
| BLAKE2b-256 |
f4246b948f7b5b62233084776292f9102890a29f87fb2ad32167622b4ad88017
|