Qubac SDK — Python client for SAM, the governed agentic AI runtime
Project description
Qubac SDK
Python client for SAM — the governed agentic AI runtime.
Installation
pip install qubac
Quick start
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
# 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
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qubac-1.2.0.tar.gz
(16.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
qubac-1.2.0-py3-none-any.whl
(21.0 kB
view details)
File details
Details for the file qubac-1.2.0.tar.gz.
File metadata
- Download URL: qubac-1.2.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc28ea4f47144290e3673da7048e1ffa5988e216d8bc5a5e880f76c477685868
|
|
| MD5 |
8fd4487c331e1579162649f2bd302288
|
|
| BLAKE2b-256 |
1358a5b046ed913862aef91c5e87bd89266db657552c76c792e561297b1ff1be
|
File details
Details for the file qubac-1.2.0-py3-none-any.whl.
File metadata
- Download URL: qubac-1.2.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ea896a7799a6b0c249c04a34ec44b558a2ae0abc6a6bc5a3d902707a5d17c05
|
|
| MD5 |
f7cdf3d27b8d6f87ccc3fb93c4e40229
|
|
| BLAKE2b-256 |
ccf2a1c1838bf46c5f35707171bc033308ed348ff1985a1ad4c9b64f27be58d5
|