Metadata-Version: 2.4
Name: asahio
Version: 0.1.0
Summary: Enterprise LLM agent control plane SDK for routing, caching, and observability
Project-URL: Homepage, https://asahio.dev
Project-URL: Documentation, https://docs.asahio.dev
Project-URL: Repository, https://github.com/asahio-ai/asahio-python
Author-email: ASAHIO <eng@asahio.dev>
License: MIT
Keywords: agents,ai,caching,hallucination,llm,observability,routing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: anyio<5,>=3.5.0
Requires-Dist: httpx<1,>=0.25.0
Requires-Dist: pydantic<3,>=2.0.0
Provides-Extra: dev
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: respx; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

﻿# ASAHIO Python SDK

Python client for the ASAHIO gateway and agent control plane.

## Install

```bash
cd sdk
pip install -e .
```

## Quick start

```python
from asahio import Asahio

client = Asahio(
    api_key="asahio_live_your_key",
    org_slug="your-org-slug",
)

response = client.chat.completions.create(
    messages=[{"role": "user", "content": "Summarize the incident timeline."}],
    routing_mode="AUTO",
    intervention_mode="OBSERVE",
)

print(response.choices[0].message.content)
print(response.asahio.model_used)
print(response.asahio.savings_usd)
```

## Compatibility aliases

The SDK still supports one deprecation window for older imports:

```python
from asahi import Asahi
from acorn import Acorn
```

Both aliases forward to the canonical ASAHIO client.

## Client options

- `routing_mode`: `AUTO`, `GUIDED`, or `EXPLICIT`
- `intervention_mode`: `OBSERVE`, `ASSISTED`, or `AUTONOMOUS`
- `agent_id`: bind a call to a registered agent
- `session_id`: bind a call to an agent session
- `model_endpoint_id`: target a BYOM endpoint
- `org_slug`: sends `X-Org-Slug` for multi-tenant dashboard setups

## Response metadata

Canonical metadata lives at `response.asahio`.

Legacy code can still read `response.asahi` during the migration window.

## Streaming

```python
stream = client.chat.completions.create(
    messages=[{"role": "user", "content": "Count to five."}],
    stream=True,
)

for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")
```

The streaming parser ignores the gateway's trailing `event: asahio` metadata event so chunk iteration stays OpenAI-compatible.
