Metadata-Version: 2.4
Name: asu-sovereign
Version: 1.0.0
Summary: Official Python SDK for ASU Sovereign Workspace (Uganda AI Studio)
Author-email: AI Studio Uganda Core Team <dev@asu.ug>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0.0

# `asu-sovereign` — Official Python SDK for ASU Sovereign Workspace

Official type-safe Python client for querying the **ASU Sovereign Workspace** in Uganda.

---

## 📦 Installation

```bash
pip install asu-sovereign
```

---

## 🚀 Quick Start

### 1. Synchronous Client

```python
from asu import AsuClient

client = AsuClient(
    base_url="http://localhost:8000/api/v1",
    api_key="your_sovereign_key",
    org_tenant="moh.asu.ug"
)

# Stream token completions
stream = client.chat.stream(
    model="llama-3.1-70b",
    messages=[{"role": "user", "content": "Summarize Q3 URA tax bulletin."}],
)

for chunk in stream:
    token = chunk.choices[0].get("delta", {}).get("content", "")
    print(token, end="", flush=True)
```

### 2. Asynchronous Client (FastAPI / asyncio)

```python
import asyncio
from asu import AsyncAsuClient

async def main():
    client = AsyncAsuClient(base_url="http://localhost:8000/api/v1")
    
    # Query Document Vault
    result = await client.documents.query(
        query="Luweero clinic intake trends in Q2",
        workspace="health"
    )
    
    print(f"Grounded: {result.grounded}")
    for cite in result.citations:
        print(f"[{cite.citation_id}] Page {cite.page}: {cite.text}")

asyncio.run(main())
```

### 3. Upload & Ingest Documents

```python
with open("MAAIF_Crop_Report_2024.pdf", "rb") as f:
    upload = client.documents.upload(
        file_obj=f,
        filename="MAAIF_Crop_Report_2024.pdf",
        classification="OFFICIAL // SENSITIVE"
    )

print("Ingested Chunks:", upload.chunks_indexed)
print("SHA-256 Hash:", upload.sha256_checksum)
```
