Metadata-Version: 2.4
Name: getq
Version: 0.1.0
Summary: Official async Python SDK for the Q answer engine (Sonar-compatible + extended APIs).
Project-URL: Homepage, https://github.com/Elementary-Digital/Q
Author: Q
License: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: httpx-sse>=0.4.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0
Description-Content-Type: text/markdown

# getq

Async Python SDK for the [Q](https://getq.ai) HTTP API (`/v1` Sonar-compatible surface plus skills, rules, hooks, and streaming helpers).

## Install

```bash
pip install getq
```

## Quick start

```python
import asyncio
from q_client import Q

async def main():
    q = Q(api_key="q_…")
    ans = await q.sonar.chat(
        model="sonar",
        messages=[{"role": "user", "content": "What is quantum tunneling?"}],
    )
    print(ans.choices[0].message.content)
    await q.aclose()

asyncio.run(main())
```

## Streaming

Use `q.sonar.stream_reader(...)` for normalized SSE events (`text_delta`, `citation`, `tool_use`, `thinking`, `artifact`, `error`, `done`).

```python
reader = await q.sonar.stream_reader(
    model="sonar-pro",
    messages=[{"role": "user", "content": "Hello"}],
)
async for event in reader:
    if event.type == "text_delta":
        print(event.payload.text, end="", flush=True)
await reader.aclose()
```

## License

Apache-2.0
