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.1.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.1.0-py3-none-any.whl
(21.0 kB
view details)
File details
Details for the file qubac-1.1.0.tar.gz.
File metadata
- Download URL: qubac-1.1.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 |
28349dd5f87be6823d7d352b61f00d8c971d48955d67fc7cd53a2f42a9f20108
|
|
| MD5 |
721ba6f16b16cde721be560279ce70e2
|
|
| BLAKE2b-256 |
00b25e227ab335aedf2968133b23d30280ce27efb0ccbf79a8566222856ba46e
|
File details
Details for the file qubac-1.1.0-py3-none-any.whl.
File metadata
- Download URL: qubac-1.1.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 |
a6bfcf3a5df6cb460179bbc9d52835e0067ddc0c6731420db3549746faf8f1a4
|
|
| MD5 |
45314f2dd6fd7fa14bd11175e349a143
|
|
| BLAKE2b-256 |
0690bafb8d3d1e4854148306ce87d51d294531601367b14da6cb017a12a55e67
|