HelloAgent Python SDK — relay client + channel-link helpers. Install as `helloagentai`, import as `helloagent`.
Project description
helloagentai
Talk to the HelloAgent relay from Python. Pair, send, receive, and stream agent messages over a single long-lived WebSocket.
pip install helloagentai
Install as
helloagentai, import ashelloagent. The PyPI project name ishelloagentai(matching our GitHub org); the import path stayshelloagentfor backward compatibility, similar to howpip install Pillowgives youimport PIL.
Quickstart — Python agent
import asyncio
import os
from helloagent import Agent
async def main():
agent = Agent(
token=os.environ["HELLOAGENT_TOKEN"], # ha_* token
relay_url="wss://api.helloagent.cc/v1/ws",
)
@agent.on_message
async def reply(msg):
print(f"{msg.from_handle}: {msg.text}")
return f"you said: {msg.text}" # simple echo reply
await agent.run() # long-lived; reconnects on drop
asyncio.run(main())
Get an ha_* token from https://app.helloagent.cc/app/agents/new.
Quickstart — user client
from helloagent import UserClient
client = UserClient(
handle="alice",
token=sso_session_token,
relay_url="wss://api.helloagent.cc/v1/ws",
)
@client.on_message
def handle(msg):
... # render in your chat UI
await client.run()
await client.send("alice/jarvis", "what's on my calendar today?")
What you get
Agent— long-lived WebSocket connection authenticated with anha_*token. Auto-reconnects with exponential backoff. Inbound messages are dispatched to a handler that returns astr, an awaitable, or anAsyncIterator[str]for streaming replies.UserClient— same transport,ROLE_USER. For user-facing surfaces.IncomingMessage— dataclass withmessage_id,conversation_id,from_handle,to_handle,text.AuthFailedError— raised when the relay rejects auth (auth_response.ok=false). Treat as terminal: re-pair, don't retry.Tool,ToolRegistry— register tools your agent can invoke.tokens,keystore,channels,discovery— auxiliary modules for token handling, key management, channel-link helpers, and agent discovery.
Reconnect behavior
Agent.run() opens the WebSocket, sends auth_request, awaits auth_response, dispatches incoming messages to your @on_message handler, and reconnects on any disconnect. Exponential backoff: 1s → 30s, doubling on consecutive failures, reset after a successful auth. Terminate the run loop by cancelling the asyncio task.
Authentication
The relay no longer hosts /v1/auth/register or /v1/auth/login — register_user and login_user are kept exported for back-compat but raise NotImplementedError. New code should sign in with supabase-py and pass the access token straight into UserClient(token=..., handle=...). The helper claim_handle(access_token, handle) wraps POST /v1/profile.
Compatibility
- Python ≥ 3.10
- Depends on
websockets>=11andprotobuf>=4.21,<7
Versioning
Follows semver; pre-1.0 the protocol may shift between minor versions. The relay protocol itself is versioned via the /v1/ws URL path — bumping that is reserved for breaking wire-format changes.
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 helloagentai-0.1.0.tar.gz.
File metadata
- Download URL: helloagentai-0.1.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
726c1eb91149b73ffbd5a1c0080c37a5f6ae927da30048c5ae6137285ba8d0d5
|
|
| MD5 |
b59c519e86d62dde79d10d912500bc48
|
|
| BLAKE2b-256 |
4f34b04ddff4422470ddd7fb0f9f4a924afb49bbebb801cc757b366cdf13a1a5
|
Provenance
The following attestation bundles were made for helloagentai-0.1.0.tar.gz:
Publisher:
release.yml on helloagentai/helloagent-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
helloagentai-0.1.0.tar.gz -
Subject digest:
726c1eb91149b73ffbd5a1c0080c37a5f6ae927da30048c5ae6137285ba8d0d5 - Sigstore transparency entry: 1474652809
- Sigstore integration time:
-
Permalink:
helloagentai/helloagent-sdk-python@31fc0cad3197fca74794c7da5097b0e9f7a40425 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/helloagentai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31fc0cad3197fca74794c7da5097b0e9f7a40425 -
Trigger Event:
push
-
Statement type:
File details
Details for the file helloagentai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: helloagentai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6ab279b732fac4bc503549c30b0f52f9545ccb12b728922d532dfb63e162267
|
|
| MD5 |
fab9757338d9f4cf8ebdfde35f76bb2e
|
|
| BLAKE2b-256 |
596be2a8744f397a85d1741724f79bcac109ae4c0cec736445c49301cca1303a
|
Provenance
The following attestation bundles were made for helloagentai-0.1.0-py3-none-any.whl:
Publisher:
release.yml on helloagentai/helloagent-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
helloagentai-0.1.0-py3-none-any.whl -
Subject digest:
b6ab279b732fac4bc503549c30b0f52f9545ccb12b728922d532dfb63e162267 - Sigstore transparency entry: 1474652893
- Sigstore integration time:
-
Permalink:
helloagentai/helloagent-sdk-python@31fc0cad3197fca74794c7da5097b0e9f7a40425 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/helloagentai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31fc0cad3197fca74794c7da5097b0e9f7a40425 -
Trigger Event:
push
-
Statement type: