Python SDK for Cero Labs — agent-native expert escalation for AI workflows.
Project description
cerolabs
Python SDK for Cero Labs — the agent-native API for on-demand domain expertise.
When your agent hits an edge case, cerolabs routes the case to a verified domain expert and returns a structured, schema-validated response your workflow can use directly.
Install
pip install "git+https://github.com/os1123/cero-labs.git#subdirectory=sdk/python"
Requires Python 3.10+.
Package name for PyPI: cerolabs. The publish workflow is configured in this repo, but the live PyPI project still needs trusted-publisher setup.
Quick start
from cerolabs import Cero
cero = Cero(api_key="cero_...")
schema = {
"type": "object",
"properties": {
"appeal_recommended": {"type": "boolean"},
"reasoning": {"type": "string"},
},
"required": ["appeal_recommended", "reasoning"],
}
resolution = cero.escalate_and_wait(
domain="healthcare.rcm",
query="Should we appeal this CO-50 denial?",
context={"cpt": "93015", "payer": "Blue Cross"},
schema=schema,
)
print(resolution.answer["appeal_recommended"])
print(resolution.answer["reasoning"])
Pydantic models
If you already use Pydantic, pass the model class directly. The SDK will derive output_schema for Cero and validate the expert answer on the way back.
from pydantic import BaseModel
from cerolabs import Cero
class CodingDecision(BaseModel):
cpt_codes: list[str]
icd10_codes: list[str]
notes: str | None = None
cero = Cero(api_key="cero_...")
resolution = cero.escalate_and_wait(
domain="healthcare.coding",
query="Verify the code set for this operative note.",
context={"note_id": "OP-123"},
schema=CodingDecision,
)
assert isinstance(resolution.answer, CodingDecision)
print(resolution.answer.cpt_codes)
Async client
import asyncio
from cerolabs import AsyncCero
async def main() -> None:
async with AsyncCero(api_key="cero_...") as cero:
resolution = await cero.escalate_and_wait(
domain="legal.contract",
query="Is this indemnity clause outside standard policy?",
)
print(resolution.answer)
asyncio.run(main())
API
Cero(api_key, base_url?, timeout_s?): sync clientAsyncCero(api_key, base_url?, timeout_s?): async clientescalate(...): create an escalation and return immediatelywait_for_resolution(escalation_id, ...): long-poll until resolvedescalate_and_wait(...): convenience wrappercheck_escalation(escalation_id): get current statuscancel_escalation(escalation_id): cancel a pending/routed escalationsubmit_feedback(escalation_id, score, comment?): rate the expert answerlist_escalations(...): list recent escalationslist_domains(): live supported domainsusage(): tenant credits, tier, and limits
Machine-readable docs
Publish locally
python -m pip install build twine
python -m build
python -m twine check dist/*
License
MIT
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
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
File details
Details for the file cerolabs-0.1.0.tar.gz.
File metadata
- Download URL: cerolabs-0.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a1a1238e99c0f2aaa775301d752b342b861435d8e3cc0ca128f437d7edaf872
|
|
| MD5 |
35875e7773185ceb3aeccbb682cd2f75
|
|
| BLAKE2b-256 |
523565bc51137cec3337bd76d374024ed5d9a0b73b9703212ec3e8e337e1f99a
|
Provenance
The following attestation bundles were made for cerolabs-0.1.0.tar.gz:
Publisher:
publish-python-sdk.yml on os1123/cero-labs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cerolabs-0.1.0.tar.gz -
Subject digest:
6a1a1238e99c0f2aaa775301d752b342b861435d8e3cc0ca128f437d7edaf872 - Sigstore transparency entry: 1315209834
- Sigstore integration time:
-
Permalink:
os1123/cero-labs@ee748aa79bd2596a9564d25d7cfaf1ad5218263a -
Branch / Tag:
refs/tags/python-sdk-v0.1.0 - Owner: https://github.com/os1123
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@ee748aa79bd2596a9564d25d7cfaf1ad5218263a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cerolabs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cerolabs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
409a78c4193a2e538b7a5232930f321f0186170705c3653736e88cb1eb3cea7f
|
|
| MD5 |
bb45d7773ed26832e7b262aecf973d38
|
|
| BLAKE2b-256 |
c4713c0449459f292d1e402e7953ab59c4b238a7653a410e708d4729e324b101
|
Provenance
The following attestation bundles were made for cerolabs-0.1.0-py3-none-any.whl:
Publisher:
publish-python-sdk.yml on os1123/cero-labs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cerolabs-0.1.0-py3-none-any.whl -
Subject digest:
409a78c4193a2e538b7a5232930f321f0186170705c3653736e88cb1eb3cea7f - Sigstore transparency entry: 1315209945
- Sigstore integration time:
-
Permalink:
os1123/cero-labs@ee748aa79bd2596a9564d25d7cfaf1ad5218263a -
Branch / Tag:
refs/tags/python-sdk-v0.1.0 - Owner: https://github.com/os1123
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@ee748aa79bd2596a9564d25d7cfaf1ad5218263a -
Trigger Event:
push
-
Statement type: