Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 2.51 KB

File metadata and controls

82 lines (59 loc) · 2.51 KB

Hawk SDK for Python

Official Python client for the Hawk daemon API

Python License CI


The Hawk SDK for Python provides an idiomatic client for interacting with the Hawk daemon API. It supports both synchronous and async operations, including streaming.

Features

  • Sync and async - Use HawkClient or AsyncHawkClient
  • Streaming support - Real-time response streaming
  • Context managers - Automatic resource cleanup
  • Type hints - Full type annotations for IDE support
  • Error handling - Detailed exception types

Installation

pip install hawk-sdk

Quick Start

from hawk import HawkClient

with HawkClient() as client:
    # Health check
    health = client.health()
    print(f"Version: {health.version}")

    # Chat
    response = client.chat("Explain decorators in Python")
    print(response.response)

Async Usage

from hawk import AsyncHawkClient

async with AsyncHawkClient() as client:
    response = await client.chat("Hello!")
    print(response.response)

Streaming

with HawkClient() as client:
    with client.chat_stream("Write a haiku") as stream:
        for event in stream.events():
            print(event.data, end="", flush=True)

Examples

See the examples/ directory for complete runnable examples.

Ecosystem Boundaries

  • hawk-sdk-python is a consumer of Hawk public APIs and contracts.
  • Do not couple the SDK to support engine repos such as eyrie, yaad, tok, trace, sight, or inspect.
  • Do not reference hawk/internal/* or removed legacy path hawk/shared/types.
  • If a capability is needed across repos, expose it through Hawk or hawk-core-contracts, not engine internals.

Contributing

Contributions are welcome — please read CONTRIBUTING.md before opening a pull request.

License

MIT - see LICENSE for details.