Metadata-Version: 2.4
Name: qubac
Version: 1.1.0
Summary: Qubac SDK — Python client for SAM, the governed agentic AI runtime
Project-URL: Homepage, https://qubac.com
Project-URL: Documentation, https://docs.qubac.com/sdk/python
Project-URL: Repository, https://github.com/QubacLtd/sdk
Project-URL: Bug Tracker, https://github.com/QubacLtd/sdk/issues
Author-email: Qubac Ltd <dev@qubac.com>
License: MIT
Keywords: agentic,agents,ai,automation,llm,qubac,sam
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: mypy>=1.9.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# Qubac SDK

Python client for [SAM](https://qubac.com) — the governed agentic AI runtime.

## Installation

```bash
pip install qubac
```

## Quick start

```python
from qubac import SAM

sam = SAM(api_key="sk-...")
task = sam.tasks.run("What is the capital of Pakistan?")
print(task.output)  # "The capital of Pakistan is Islamabad."
```

## Multi-user applications

```python
# Client configured once with tools and persona
sam = SAM(
    api_key="sk-...",
    system_prompt="You are a customer support agent for Acme Corp.",
    tools="./tools/",   # auto-discovered Python functions
)

# Per-user tasks
task = sam.tasks.run("Check order #1234", end_user_id=user.id)

# User-scoped client — recommended for multiple operations per user
user_sam = sam.with_user(user.id)
task = user_sam.tasks.run("Process refund for order #1234")
code = user_sam.agents.connect_code(label="Alice's MacBook")
```

## Async

```python
from qubac import AsyncSAM

async with AsyncSAM(api_key="sk-...") as sam:
    task = await sam.tasks.run("Analyse Q3 pipeline", end_user_id=user.id)
    print(task.output)
```

## Error handling

```python
from qubac import QubacRateLimitError, QubacAuthError, QubacServerError

try:
    task = sam.tasks.run("...")
except QubacRateLimitError as e:
    time.sleep(e.retry_after or 60)
except QubacAuthError:
    # Key revoked — check console.qubac.com
    ...
except QubacServerError as e:
    logger.error("SAM error", request_id=e.request_id)
    raise
```

## Documentation

[docs.qubac.com/sdk/python](https://docs.qubac.com/sdk/python)
