Typed async client for the Hermes Agent API Server
Project description
Hermes Agent API Client
Hermes Agent API Client is a typed async Python client for authenticated capability discovery and streaming Chat Completions from the Hermes Agent API Server. Version 0.1.0 requires Python 3.13 or later.
Installation
Install the package from PyPI:
uv add hermes-agent-api-client
Usage
HermesAgentApiClient is a single-use async context manager. Without an
injected HTTP client, it creates and closes its own httpx.AsyncClient:
from hermes_agent_api_client import HermesAgentApiClient, TerminalEvent
async def ask_hermes(request: dict[str, object]) -> None:
async with HermesAgentApiClient(
"https://hermes.example",
"bearer-key",
) as client:
capabilities = await client.probe_capabilities()
assert capabilities.chat_completions_streaming
async for event in client.stream_chat_events(request):
if isinstance(event, TerminalEvent):
print(event.outcome)
The default verify=None uses httpx's verified TLS default. An owned client may
instead receive verify=False or an ssl.SSLContext. Disabling certificate
verification weakens transport security and should be limited to controlled
environments.
To share a caller-managed client, inject it explicitly:
import httpx
from hermes_agent_api_client import HermesAgentApiClient
async def probe_with_shared_transport() -> None:
async with httpx.AsyncClient(verify=True) as http_client:
async with HermesAgentApiClient(
"https://hermes.example",
"bearer-key",
http_client=http_client,
) as client:
await client.probe_capabilities()
The caller owns an injected client, so exiting HermesAgentApiClient does not
close it. TLS verification must be configured on the injected client; passing
both http_client and a non-None verify value is rejected.
Supported contract
Version 0.1.0 supports only these Hermes operations:
GET /v1/capabilitiesthroughprobe_capabilities().- Streaming
POST /v1/chat/completionsthroughstream_chat_events().
The exact OpenAI-compatible request document remains a caller-owned mapping; version 0.1.0 does not define additional request-model semantics.
The stream yields immutable AssistantDeltaEvent, ToolProgressEvent,
UsageEvent, KeepaliveEvent, and TerminalEvent values. Terminal outcomes
are success, length, or upstream_error.
Public failures derive from HermesContractError and expose only safe
category, status_code, and retryable metadata. Authentication, HTTP
status, transport, and protocol failures are represented by distinct public
exception types. Callers should not expect upstream response bodies, bearer
credentials, request payloads, or URLs in public error text.
Compatibility targets Hermes v2026.7.7.2. Evidence is derived from captured Hermes fixtures for that version and local protocol/transport tests; it is not evidence from a live Hermes server.
Security: Hermes API access exposes the configured agent toolset. Protect the bearer key, restrict network access, and grant the Hermes agent only the tools appropriate for the calling application.
Development
Install the exact locked development environment and run all local gates:
uv sync --locked --all-groups
uv run ruff format --check .
uv run ruff check .
uv run coverage run -m pytest
uv run coverage report
npx --yes pyright@1.1.411
uv run npx --yes pyright@1.1.411 --verifytypes hermes_agent_api_client --ignoreexternal
uv build
uv run python scripts/verify_dist.py dist/*.whl dist/*.tar.gz
License
Licensed under the Universal Permissive License 1.0 (UPL-1.0). See LICENSE.
Project details
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 hermes_agent_api_client-0.1.0.tar.gz.
File metadata
- Download URL: hermes_agent_api_client-0.1.0.tar.gz
- Upload date:
- Size: 47.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d508bb96f9c0cca86ca1b6dff6d5296ab6739f855373fdf66a0274ad1efe6be
|
|
| MD5 |
14880f859b1ae11e4fd46c067b85ebc8
|
|
| BLAKE2b-256 |
04b933086e01d664172abbcb34f51004c0bd05025883a06f39a71e01315c5d41
|
Provenance
The following attestation bundles were made for hermes_agent_api_client-0.1.0.tar.gz:
Publisher:
release.yml on Djelibeybi/hermes-agent-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hermes_agent_api_client-0.1.0.tar.gz -
Subject digest:
2d508bb96f9c0cca86ca1b6dff6d5296ab6739f855373fdf66a0274ad1efe6be - Sigstore transparency entry: 2170862576
- Sigstore integration time:
-
Permalink:
Djelibeybi/hermes-agent-api-client@42c9347b6cf45cda03380eab99c51ba93e9346da -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Djelibeybi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42c9347b6cf45cda03380eab99c51ba93e9346da -
Trigger Event:
push
-
Statement type:
File details
Details for the file hermes_agent_api_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hermes_agent_api_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8748e449c0036b0eb98e931902e31705f03a54e0c128645b27770548a36033ba
|
|
| MD5 |
1ee8219453acf51344ce665e0856a4b3
|
|
| BLAKE2b-256 |
3d5880b1926e23c3bbdaf833130eebc07929a5b950757fc2d62406e378882086
|
Provenance
The following attestation bundles were made for hermes_agent_api_client-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Djelibeybi/hermes-agent-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hermes_agent_api_client-0.1.0-py3-none-any.whl -
Subject digest:
8748e449c0036b0eb98e931902e31705f03a54e0c128645b27770548a36033ba - Sigstore transparency entry: 2170862602
- Sigstore integration time:
-
Permalink:
Djelibeybi/hermes-agent-api-client@42c9347b6cf45cda03380eab99c51ba93e9346da -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Djelibeybi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42c9347b6cf45cda03380eab99c51ba93e9346da -
Trigger Event:
push
-
Statement type: