Skip to main content

Python SDK for the Hanzo Agents control plane

Project description

Hanzo Agents Python SDK

The Hanzo Agents SDK provides a production-ready Python interface for registering agents, executing workflows, and integrating with the Hanzo Agents control plane.

Installation

pip install hanzo-agents

To work on the SDK locally:

git clone https://github.com/hanzoai/agents.git
cd hanzo-agents/sdk/python
python -m pip install -e .[dev]

Quick Start

from hanzo-agents import Agent

agent = Agent(
    node_id="example-agent",
    hanzo_agents_server="http://localhost:8080",
    dev_mode=True,
)

@agent.reasoner()
async def summarize(text: str) -> dict:
    result = await agent.ai(
        prompt=f"Summarize: {text}",
        response_model={"summary": "string", "tone": "string"},
    )
    return result

if __name__ == "__main__":
    agent.serve(port=8001)

See docs/DEVELOPMENT.md for instructions on wiring agents to the control plane.

Testing

pytest

To run coverage locally:

pytest --cov=hanzo-agents --cov-report=term-missing

License

Distributed under the Apache 2.0 License. See the project root LICENSE for details.

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

hanzo_agents-0.2.2.tar.gz (181.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hanzo_agents-0.2.2-py3-none-any.whl (204.2 kB view details)

Uploaded Python 3

File details

Details for the file hanzo_agents-0.2.2.tar.gz.

File metadata

  • Download URL: hanzo_agents-0.2.2.tar.gz
  • Upload date:
  • Size: 181.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for hanzo_agents-0.2.2.tar.gz
Algorithm Hash digest
SHA256 bbc0c9464374f213b7b2571bbcc10968892d2061422a6c97ea30d25fdd00b0d1
MD5 947250e08f0dafbef8c7f0343ed34c7b
BLAKE2b-256 3f576ad169d2f47134d422fb6d6831e32952cae3d7ac91ab21be750157159c63

See more details on using hashes here.

File details

Details for the file hanzo_agents-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: hanzo_agents-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 204.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for hanzo_agents-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba1ba5ed2f460b837d0898c5d9247db7f919ab4f6970a8a782d116d6b19bd4a3
MD5 cbc3670b22816eb1812bf3b3a3867e1d
BLAKE2b-256 4e43bcb0c8e273758c97cbff3526597ce62f6a91b2c53e31d0ce67080094a9b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page