Python SDK for Hail — universal communication platform for AI agents.
Project description
hail-sdk
Python SDK for Hail — universal communication platform for AI agents.
Install
pip install hail-sdk
Requires Python 3.11+.
Quickstart
import asyncio
from hail import Client
async def main():
async with Client(api_key="sk-...") as client:
call = await client.calls.create(
to="+15551234567",
system_prompt="You are calling to confirm a reschedule.",
)
print("queued", call.id)
async for event in client.events.tail(id=f"call:{call.id}"):
print(event.kind, event.payload)
asyncio.run(main())
api_key defaults to $HAIL_API_KEY; base_url defaults to $HAIL_API_URL
(falling back to https://api.hail.so).
API surface
client.calls.create(*, to, system_prompt=None, llm=None, from_=None, first_message=None, metadata=None, idempotency_key=None)— originate an outbound call. Pass eithersystem_prompt(mode A) or a fullllmblock (mode B).idempotency_keydefaults to a fresh UUIDv4.client.calls.get(call_id)— fetch a single call.client.calls.list(*, cursor=None, limit=50, status=None, to=None)— cursor-paginated org list.client.events.list(*, id=None, kind=None, cursor=None, limit=100)— one-shot fetch ofGET /events.idis a typed<type>:<uuid>string (v1 only supportscall:).client.events.tail(*, id=None, kind=None, interval_seconds=0.5, follow=True)— async-iterator tail; auto-exits on terminal call status when narrowed toid=call:<uuid>.
Errors
All SDK errors derive from hail.HailError. HTTP-status-coded errors carry .status_code, .detail, and .response_text:
HailAuthError(401)HailNotFoundError(404)HailIdempotencyConflict(409)HailValidationError(422)HailServerError(5xx, after retry budget)HailClientError(other 4xx)HailMalformedResourceId— local validation of<type>:<uuid>stringsHailConfigError— no API key supplied or discoverable
Retries
GET/HEAD/PUT/DELETE — and any POST/PATCH carrying an Idempotency-Key — are retried up to 3 times on 5xx with exponential backoff (0.5s, 1.0s, 2.0s) plus jitter, honoring Retry-After when present. Mutating verbs without an idempotency key fail fast on 5xx so a duplicate side effect can't be silently introduced.
License
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 hail_sdk-0.1.0.tar.gz.
File metadata
- Download URL: hail_sdk-0.1.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b92e1e5f64ae54e9f35ad60409d5097c58cc521d2174f762207c19a73829eb6
|
|
| MD5 |
fbbe1ac75b51f9e13782e76cc9c96547
|
|
| BLAKE2b-256 |
679ac3b69dfe803a37fd0302c139c63dc88f460eb5f8ebea1c44521f3127956d
|
Provenance
The following attestation bundles were made for hail_sdk-0.1.0.tar.gz:
Publisher:
release-sdk.yml on hail-hq/hail
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hail_sdk-0.1.0.tar.gz -
Subject digest:
6b92e1e5f64ae54e9f35ad60409d5097c58cc521d2174f762207c19a73829eb6 - Sigstore transparency entry: 1399410515
- Sigstore integration time:
-
Permalink:
hail-hq/hail@f29dd40bbae79d5c71d1f36f883b909afa2140e2 -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/hail-hq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk.yml@f29dd40bbae79d5c71d1f36f883b909afa2140e2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hail_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hail_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.6 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 |
f27816668615c09ba31fe00fdcd3e35060ea70d7ed73ce44e02b78d3666f67f4
|
|
| MD5 |
3bc651fc36b2c2ddb0acf9aed6e4c2d0
|
|
| BLAKE2b-256 |
6891bb62f5e2abc7a520d46ca7ded247b916963a8a21253463b2f98ae6932ea2
|
Provenance
The following attestation bundles were made for hail_sdk-0.1.0-py3-none-any.whl:
Publisher:
release-sdk.yml on hail-hq/hail
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hail_sdk-0.1.0-py3-none-any.whl -
Subject digest:
f27816668615c09ba31fe00fdcd3e35060ea70d7ed73ce44e02b78d3666f67f4 - Sigstore transparency entry: 1399410525
- Sigstore integration time:
-
Permalink:
hail-hq/hail@f29dd40bbae79d5c71d1f36f883b909afa2140e2 -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/hail-hq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk.yml@f29dd40bbae79d5c71d1f36f883b909afa2140e2 -
Trigger Event:
push
-
Statement type: