Install
pip install shannon-sdk
git clone https://github.com/Kocoro-lab/Shannon.git
cd Shannon/clients/python
pip install -e .
pip install websockets
Quick Verify
from shannon import ShannonClient
client = ShannonClient(base_url="http://localhost:8080")
print("✓ SDK ready")
Auth
from shannon import ShannonClient
client = ShannonClient(
base_url="http://localhost:8080",
api_key="sk_test_123"
)
import os
from shannon import ShannonClient
client = ShannonClient(
base_url=os.getenv("SHANNON_BASE_URL", "http://localhost:8080"),
api_key=os.getenv("SHANNON_API_KEY"),
)
Client Options
| Param | Type | Default | Notes |
|---|---|---|---|
base_url | str | http://localhost:8080 | Gateway HTTP URL |
api_key | str | None | Sent as X-API-Key |
bearer_token | str | None | Alternative Authorization: Bearer |
default_timeout | float | 30.0 | Seconds |
Async Client
import asyncio
from shannon import AsyncShannonClient
async def main():
async with AsyncShannonClient(base_url="http://localhost:8080") as client:
h = await client.submit_task("Analyze data")
s = await client.wait(h.task_id)
print(s.result)
asyncio.run(main())
CLI
python -m shannon.cli --base-url http://localhost:8080 submit "What is 2+2?" --wait