CALIBER Python SDK API reference
Every GA resource module the client exposes, the models they decode into, error types, waiters, and the stability tier each surface carries.
This reference is generated from the SDK source tree at build time. It follows the same pattern as the MLflow Python API docs: start with the top-level package, then drill into resource modules, models, errors, waiters, and the async client.
This page is intentionally about the Python client, not the raw HTTP routes. If you need headers, envelopes, or concrete endpoints, start with the REST API overview and HTTP reference.
Most developers should begin with:
caliber_sdk.CaliberClientfor the synchronous clientcaliber_sdk.aio.AsyncCaliberClientfor async workflows- the SDK guide for setup and common flows
- SDK recipes for full runnable scenarios
The reference below is generated from the current SDK code, so the published HTML stays aligned with the package the tests exercise.
Reference
The most common entry point is caliber_sdk.CaliberClient; the rest of the package fans out into typed resource modules, dataclass models, shared transport and error helpers, and an async client.
The reference tables below are generated directly from the current SDK source. Behavior notes and examples come from the SDK docstrings and the executable example files the test suite runs.
Module index
Symbol index
Every documented class and module-level function, with the module that defines it. Members hang off their class, so start here and follow the link.
A
B
| Symbol | Defined in |
|---|---|
Bucket | caliber_sdk.models.integrations |
C
E
F
| Symbol | Defined in |
|---|---|
FieldError | caliber_sdk.models.errors |
G
| Symbol | Defined in |
|---|---|
GateVerdictsAPI | caliber_sdk.resources.operations |
GatewayAPI | caliber_sdk.resources.integrations |
I
J
| Symbol | Defined in |
|---|---|
Job | caliber_sdk.models.operations |
JobsAPI | caliber_sdk.resources.operations |
Judge | caliber_sdk.models.quality |
JudgeAlignment | caliber_sdk.models.quality |
JudgesAPI | caliber_sdk.resources.quality |
K
| Symbol | Defined in |
|---|---|
KnowledgeBase | caliber_sdk.models.integrations |
KnowledgeBasesAPI | caliber_sdk.resources.integrations |
L
M
| Symbol | Defined in |
|---|---|
McpServer | caliber_sdk.models.integrations |
McpServersAPI | caliber_sdk.resources.integrations |
MeAPI | caliber_sdk.resources.system |
MemoryAPI | caliber_sdk.resources.operations |
N
| Symbol | Defined in |
|---|---|
NoAuth | caliber_sdk.auth |
O
P
Q
| Symbol | Defined in |
|---|---|
QualityReviewsAPI | caliber_sdk.resources.operations |
R
S
T
U
| Symbol | Defined in |
|---|---|
UnsetProjectType | caliber_sdk.transport |
V
| Symbol | Defined in |
|---|---|
VerificationBatchResult | caliber_sdk.models.quality |
VerificationItem | caliber_sdk.models.quality |
VerificationQueueAPI | caliber_sdk.resources.quality |
W
Package index
Module caliber_sdk
caliber-sdk — a typed Python client for the CALIBER management API.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
API_PREFIX, ENV_BASE_URL, ENV_PROJECT, ENV_TOKEN, ENV_USER, FAILURE_STATES, TERMINAL_STATES, UNSET_PROJECT, AuthProvider, CaliberAPIError, CaliberAuthenticationError, CaliberClient, CaliberConfigError, CaliberConflictError, CaliberDecodeError, CaliberError, CaliberNotFoundError, CaliberPermissionError, CaliberPreconditionError, CaliberRateLimitError, CaliberServerError, CaliberTransportError, CaliberValidationError, ErrorBody, FieldError, NoAuth, Page, RawAPI, Response, Stability, TokenAuth, Transport, TrustedHeaderAuth, UnsetProjectType, WaitFailed, WaitTimeout, WorkflowRunFailed, __version__, wait_for, wait_for_terminal_state
Module constants
| Name | Value |
|---|---|
__version__ | '0.1.0.dev0' |
Module caliber_sdk.client
The root client — what a developer constructs first.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
ENV_BASE_URL, ENV_PROJECT, ENV_TOKEN, ENV_USER, CaliberClient
Module constants
| Name | Value |
|---|---|
ENV_BASE_URL | 'CALIBER_BASE_URL' |
ENV_TOKEN | 'CALIBER_TOKEN' |
ENV_PROJECT | 'CALIBER_PROJECT' |
ENV_USER | 'CALIBER_USER' |
Classes
CaliberClient
class CaliberClient(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.Client | None = None)
A connection to one CALIBER deployment.
Usage example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Constructor
__init__(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.Client | None = None) -> None
Operate on the caliber client surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | `str | None` | None |
token | keyword-only | `str | None` | None |
user | keyword-only | `str | None` | None |
proxy_secret | keyword-only | `str | None` | None |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
verify | keyword-only | `bool | str` | True |
http_client | keyword-only | `httpx.Client | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
raw | RawAPI | Low-level route access through the SDK transport. |
auth | AuthAPI | Session inspection plus token and account sub-resources. |
me | MeAPI | The caller identity surface. |
capabilities_info | CapabilitiesAPI | Runtime stability tiers and deployment capabilities. |
settings | SettingsAPI | Runtime and LLM configuration inventory. |
projects | ProjectsAPI | Projects plus the managed file registry. |
workspaces | Any | — |
prompts | PromptsAPI | Prompt registry authoring and promotion. |
skills | SkillsAPI | Skill registry, render tests, selection tests, and versions. |
tools | ToolsAPI | Tool registry, schemas, and deterministic calibration. |
workflows | WorkflowsAPI | Workflow registry plus versions, runs, and services. |
eval_datasets | EvalDatasetsAPI | Evaluation datasets and examples. |
judges | JudgesAPI | Model-backed graders and alignment scoring. |
evaluations | EvaluationsAPI | Scored dataset runs. |
mcp_servers | McpServersAPI | Managed MCP server registry and governed tool invocation. |
openapi_integrations | OpenApiIntegrationsAPI | Governed OpenAPI import, curation, dependency review, and tool-draft publication. |
gateway | GatewayAPI | Gateway discovery, usage, and guardrails. |
knowledge_bases | KnowledgeBasesAPI | RAG corpora, versions, retrieval, and calibration. |
object_store | ObjectStoreAPI | Buckets and objects under the storage substrate. |
jobs | JobsAPI | Long-running background jobs. |
review_queues | ReviewQueuesAPI | Human review queues and queue items. |
rework_tasks | ReworkTasksAPI | Owned, recoverable work auto-created from a rejected refinement job. |
quality_reviews | QualityReviewsAPI | A human go/no-go on a job's candidate, distinct from the machine eval gate. |
verification_queue | VerificationQueueAPI | — |
aria | AriaAPI | The approval-aware plan and interaction loop. |
releases | ReleasesAPI | Release candidates, waivers, signoff, and reports. |
observability | ObservabilityAPI | Traces, experiments, and metrics. |
audit | AuditAPI | The audit log. |
admin | AdminAPI | — |
events | EventsAPI | Server-sent event stream. |
cookbooks | CookbooksAPI | The built-in cookbook catalog and installer. |
secrets | SecretsAPI | Write-only secret references. |
agents | AgentsAPI | — |
gate_verdicts | GateVerdictsAPI | — |
system | SystemAPI | — |
memory | MemoryAPI | — |
llm_pricing | LlmPricingAPI | — |
playground_runs | PlaygroundRunsAPI | — |
Properties
stability() -> dict[str, list[str]]
Tags grouped by `ga / beta / internal`.
This callable takes no public parameters.
Returns: dict[str, list[str]]
capabilities_api() -> CapabilitiesAPI
Deprecated alias for :attr:capabilities_info.
`capabilities_api reads as "the capabilities API resource", which is accurate but indistinguishable from CaliberClient.capabilities() at a glance. capabilities_info` names what it actually returns.
This callable takes no public parameters.
Returns: CapabilitiesAPI
datasets() -> EvalDatasetsAPI
Deprecated alias for :attr:eval_datasets.
`datasets reads as every kind of stored data CALIBER has (prompt datasets, knowledge bases, ...); eval_datasets` names the one this resource actually is.
This callable takes no public parameters.
Returns: EvalDatasetsAPI
Methods
close() -> None
Close the underlying HTTP client or transport owned by this object.
This callable takes no public parameters.
Returns: None
__enter__() -> CaliberClient
Return this instance so it can be used inside a context manager.
This callable takes no public parameters.
Returns: CaliberClient
__exit__(*_: object) -> None
Close any owned resources when leaving the context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
workspace_scope(project_id: str) -> Iterator[CaliberClient]
Temporarily select the workspace sent on subsequent requests.
This is useful when a script creates its own workspace and needs the following prompt, dataset, workflow, or assistant records to belong to that project. The previous selection is restored even when an operation raises, so a reusable client does not silently leak project context into the caller's next task.
Project selection is stored in the current thread/task context, so a concurrent caller gets its own selection. Per-request project pins are still preferred for resource methods whose path names the project.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Iterator[CaliberClient]
Raises:
library_scope() -> Iterator[CaliberClient]
Temporarily omit the project header for a library-scoped call.
`None` is intentionally distinct from an unset scope: it prevents a constructor or outer workspace scope from leaking into a platform or personal-library request. The prior scope is restored on exit.
This callable takes no public parameters.
Returns: Iterator[CaliberClient]
project_scope(project_id: str) -> Iterator[CaliberClient]
Compatibility alias for :meth:workspace_scope.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Iterator[CaliberClient]
Raises:
capabilities() -> Any
Runtime feature flags and the SDK stability tiers.
The cheap half of feature detection: it answers "may I call this?" without downloading the full OpenAPI document.
This callable takes no public parameters.
Returns: Any
Raises:
openapi() -> Any
The management OpenAPI document, generated from the live routes.
This callable takes no public parameters.
Returns: Any
Raises:
whoami() -> Any
The identity and scopes CALIBER resolved for this client's credential.
The first call worth making when a script gets an unexpected 403: it distinguishes "wrong credential" from "right credential, wrong scope".
It reports identity rather than requiring it, so an invalid or revoked credential does not raise here -- it returns `user_id: "anonymous"` with no scopes. Check the value; do not rely on an exception to detect a bad token.
This callable takes no public parameters.
Returns: Any
Raises:
health() -> Any
Fetch the lightweight health/readiness view exposed by the deployment.
This callable takes no public parameters.
Returns: Any
Raises:
readiness() -> Any
Whether CALIBER's configured dependencies (database, object storage, MLflow, ...) are actually reachable -- stronger than :meth:health, which only reports the process is up.
This callable takes no public parameters.
Returns: Any
Raises:
dashboard_summary() -> Any
Aggregate counts and status tiles for the Overview page.
This callable takes no public parameters.
Returns: Any
Raises:
bootstrap_csrf() -> str | None
Fetch a CSRF token up front.
Rarely needed: the transport fetches one automatically when a write is refused for want of it. Exposed for callers who would rather pay that round trip at startup than on their first write.
This callable takes no public parameters.
Returns: str | None
__repr__() -> str
Operate on the caliber client surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: str
Module caliber_sdk.auth
Authentication strategies for the CALIBER management API.
Tested example
def issue_scoped_token(caliber: CaliberClient, *, name: str = "ci") -> dict[str, Any]:
"""Create a token limited to operator scope.
The scope list is a *ceiling*: the effective authority is the intersection
with what the owner holds when the request is made. Requesting more than
you hold is refused outright rather than silently narrowed, so a token
never claims authority it cannot exercise.
"""
issued = caliber.auth.tokens.create(name, scopes=["caliber.operator"])
# The plaintext exists exactly once. There is no endpoint that returns it
# again — store it now or rotate to get a new one.
secret = issued.token
live = [token.token_id for token in caliber.auth.tokens.list() if token.active]
caliber.auth.tokens.revoke(issued.token_id)
return {"token_id": issued.token_id, "secret_len": len(secret), "live_before_revoke": live}sdk/caliber-sdk/examples/tokens.py — executed by the SDK test suite.Public exports
AuthProvider, NoAuth, TokenAuth, TrustedHeaderAuth
Classes
AuthProvider
class AuthProvider()
Bases: Protocol
Supplies per-request auth headers.
A protocol rather than a base class so a caller can plug in their own -- fetching a short-lived token from a secret manager, for instance -- without subclassing anything in this package.
Properties
uses_cookie_auth() -> bool
Whether this credential is cookie-based.
Drives CSRF: CALIBER's protection exists for browser credentials, and a Bearer client should not be forced to bootstrap a token it does not need. See :mod:caliber_sdk.csrf.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Headers to attach to every request.
This callable takes no public parameters.
Returns: dict[str, str]
TokenAuth
class TokenAuth(token: str)
`Authorization: Bearer <token>` — personal access or session token.
Constructor
__init__(token: str) -> None
Operate on the token auth surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
token | positional-or-keyword | str | — |
Returns: None
Raises:
Properties
uses_cookie_auth() -> bool
Report whether this auth strategy relies on cookie-backed authentication.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Build the authentication headers added to outgoing HTTP requests.
This callable takes no public parameters.
Returns: dict[str, str]
__repr__() -> str
Operate on the token auth surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: str
TrustedHeaderAuth
class TrustedHeaderAuth(user: str, *, proxy_secret: str | None = None)
`X-CALIBER-User — only for deployments in trusted_header` mode.
Carries no proof of identity by itself, which is why CALIBER ignores the header entirely in the default `session` mode. Offered because local development and proxy-terminated deployments genuinely use it.
Constructor
__init__(user: str, *, proxy_secret: str | None = None) -> None
Operate on the trusted header auth surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
user | positional-or-keyword | str | — | |
proxy_secret | keyword-only | `str | None` | None |
Returns: None
Raises:
Properties
uses_cookie_auth() -> bool
Report whether this auth strategy relies on cookie-backed authentication.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Build the authentication headers added to outgoing HTTP requests.
This callable takes no public parameters.
Returns: dict[str, str]
__repr__() -> str
Operate on the trusted header auth surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: str
NoAuth
class NoAuth()
Send no credential. Useful for probing an unauthenticated endpoint.
Properties
uses_cookie_auth() -> bool
Report whether this auth strategy relies on cookie-backed authentication.
This callable takes no public parameters.
Returns: bool
Methods
headers() -> dict[str, str]
Build the authentication headers added to outgoing HTTP requests.
This callable takes no public parameters.
Returns: dict[str, str]
Module caliber_sdk.transport
HTTP transport: envelopes, errors, retries, CSRF, and correlation.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
API_PREFIX, UNSET_PROJECT, USER_AGENT, Response, Transport, UnsetProjectType
Module constants
| Name | Value |
|---|---|
USER_AGENT | 'caliber-sdk-python' |
API_PREFIX | '/ajax-api/2.0/mlflow/caliber' |
Classes
UnsetProjectType
class UnsetProjectType()
Sentinel distinguishing "use the ambient project" from an explicit `project=None (deliberately unscoped). A bare default of None` could not tell those apart.
Methods
__repr__() -> str
Operate on the unset project type surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: str
Response
class Response(*, data, status_code: int, headers: Mapping[str, str], request_id: str | None)
A decoded response plus the context needed to debug it.
Constructor
__init__(*, data, status_code: int, headers: Mapping[str, str], request_id: str | None) -> None
Operate on the response surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
data | keyword-only | Any | — | |
status_code | keyword-only | int | — | |
headers | keyword-only | Mapping[str, str] | — | |
request_id | keyword-only | `str | None` | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
data | Any | — |
status_code | Any | — |
headers | Any | — |
request_id | Any | — |
Transport
class Transport(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, client: httpx.Client | None = None, user_agent: str | None = None)
Synchronous HTTP transport against one CALIBER deployment.
The ambient project is context-local. Per-request `project=` pins remain the preferred choice for resource methods whose path names the project.
Constructor
__init__(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, client: httpx.Client | None = None, user_agent: str | None = None) -> None
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | str | — | |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
backoff_factor | keyword-only | float | 0.5 | |
verify | keyword-only | `bool | str` | True |
client | keyword-only | `httpx.Client | None` | None |
user_agent | keyword-only | `str | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
base_url | Any | — |
auth | Any | Session inspection plus token and account sub-resources. |
Properties
project() -> str | None
The ambient project in the current thread/task context.
This callable takes no public parameters.
Returns: str | None
Methods
project(value: str | None) -> None
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
value | positional-or-keyword | `str | None` | — |
Returns: None
close() -> None
Close the underlying HTTP client or transport owned by this object.
This callable takes no public parameters.
Returns: None
__enter__() -> Transport
Return this instance so it can be used inside a context manager.
This callable takes no public parameters.
Returns: Transport
__exit__(*_: object) -> None
Close any owned resources when leaving the context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
url_for(path: str) -> str
Absolute URL for an API path, with or without the prefix.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
Returns: str
bootstrap_csrf() -> str | None
Fetch and cache a CSRF token, returning it.
Idempotent and cheap to call. Returns `None` when the deployment does not issue one, which is not an error: CSRF enforcement is configurable and a Bearer client may not need it.
This callable takes no public parameters.
Returns: str | None
request(method: str, path: str, *, params: Mapping[str, Any] | None = None, json = None, headers: Mapping[str, str] | None = None, files = None, data: Mapping[str, Any] | None = None, timeout: float | None = None, project: str | UnsetProjectType | None = UNSET_PROJECT, _csrf_retry: bool = True) -> Response
Perform one API call, returning the unwrapped payload.
`project, when passed, pins the request's X-CALIBER-Project header regardless of the ambient (constructor/project_scope) scope -- resource modules that build a /projects/{project_id}/... path use this to send that same id, never whatever the client happens to be scoped to. Left at its default (UNSET_PROJECT), the ambient scope applies unchanged; None` deliberately omits the header even if an ambient scope is set.
| Parameter | Kind | Type | Default | ||
|---|---|---|---|---|---|
method | positional-or-keyword | str | — | ||
path | positional-or-keyword | str | — | ||
params | keyword-only | `Mapping[str, Any] | None` | None | |
json | keyword-only | Any | None | ||
headers | keyword-only | `Mapping[str, str] | None` | None | |
files | keyword-only | Any | None | ||
data | keyword-only | `Mapping[str, Any] | None` | None | |
timeout | keyword-only | `float | None` | None | |
project | keyword-only | `str | UnsetProjectType | None` | UNSET_PROJECT |
_csrf_retry | keyword-only | bool | True |
Returns: Response
Raises:
get(path: str, **kwargs) -> Response
Fetch one record from the transport surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
post(path: str, **kwargs) -> Response
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
put(path: str, **kwargs) -> Response
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
patch(path: str, **kwargs) -> Response
Send a prepared request through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
delete(path: str, **kwargs) -> Response
Delete a record on the transport surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
download(path: str, *, project: str | UnsetProjectType | None = UNSET_PROJECT, **kwargs) -> bytes
Fetch raw bytes.
Separate from :meth:request because file content is not JSON: it has no envelope to unwrap and decoding it would corrupt binary data.
`project pins the request the same way it does for :meth:request`.
| Parameter | Kind | Type | Default | ||
|---|---|---|---|---|---|
path | positional-or-keyword | str | — | ||
project | keyword-only | `str | UnsetProjectType | None` | UNSET_PROJECT |
kwargs | var-keyword | Any | — |
Returns: bytes
Raises:
stream_lines(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | None = None) -> Iterator[str]
Yield lines from a server-sent-events endpoint.
Streaming needs its own path: the ordinary request reads the whole body before returning, which for an endpoint that never ends means blocking forever. No default timeout is applied either — a stream staying open is the success case, not a hang.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
timeout | keyword-only | `float | None` | None |
Returns: Iterator[str]
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> Iterator[Any]
Yield items across `limit/offset` pages.
CALIBER's list endpoints are offset-based today. Exposing an iterator rather than the raw pages means the eventual move to cursors does not change this signature.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: Iterator[Any]
Raises:
Module caliber_sdk.errors
Exception hierarchy for the CALIBER SDK.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
CaliberAPIError, CaliberAuthenticationError, CaliberConfigError, CaliberConflictError, CaliberDecodeError, CaliberError, CaliberNotFoundError, CaliberPermissionError, CaliberPreconditionError, CaliberRateLimitError, CaliberServerError, CaliberTransportError, CaliberValidationError, error_for_response
Functions
error_for_response(*, status_code: int, payload, method: str, url: str, request_id: str | None = None) -> CaliberAPIError
Build the right exception for a non-2xx response.
Tolerates a body that is not the documented shape -- an HTML error page from a proxy in front of CALIBER is a realistic response, and it must produce a usable exception rather than a KeyError inside the SDK.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status_code | keyword-only | int | — | |
payload | keyword-only | Any | — | |
method | keyword-only | str | — | |
url | keyword-only | str | — | |
request_id | keyword-only | `str | None` | None |
Returns: CaliberAPIError
Classes
CaliberError
class CaliberError()
Bases: Exception
Base class for everything this SDK raises.
A caller who wants "any SDK failure" catches this and nothing else.
CaliberConfigError
class CaliberConfigError()
Bases: CaliberError
The client was constructed with an unusable configuration.
CaliberTransportError
class CaliberTransportError()
Bases: CaliberError
The request never produced an HTTP response.
Connection refused, DNS failure, timeout. Distinct from :class:CaliberAPIError because there is no server verdict to inspect -- and because retrying is often correct here and often wrong there.
CaliberDecodeError
class CaliberDecodeError(payload)
Bases: CaliberError
A 2xx payload had the wrong shape to decode.
Distinct from :class:CaliberAPIError: the request succeeded and the server is not complaining about anything, but the payload was not the list (or object) this call expected -- an error page from a misconfigured proxy, an envelope from the wrong endpoint, `None where a body was required. Raised only by callers that opt into strict decoding (decode_list(..., strict=True)`); by default a shape mismatch degrades to an empty result instead, per this module's tolerant-decoding principle (S4) -- strict mode exists for the contract tests that must tell "empty" apart from "wrong shape entirely".
Constructor
__init__(payload) -> None
Operate on the caliber decode error surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
payload | Any | — |
CaliberAPIError
class CaliberAPIError(message: str, *, status_code: int, detail: str | None = None, method: str | None = None, url: str | None = None, request_id: str | None = None, payload = None, reason_code: str | None = None)
Bases: CaliberError
The server returned a non-2xx response.
Constructor
__init__(message: str, *, status_code: int, detail: str | None = None, method: str | None = None, url: str | None = None, request_id: str | None = None, payload = None, reason_code: str | None = None) -> None
Operate on the caliber a p i error surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
message | positional-or-keyword | str | — | |
status_code | keyword-only | int | — | |
detail | keyword-only | `str | None` | None |
method | keyword-only | `str | None` | None |
url | keyword-only | `str | None` | None |
request_id | keyword-only | `str | None` | None |
payload | keyword-only | Any | None | |
reason_code | keyword-only | `str | None` | None |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
status_code | Any | — |
detail | Any | — |
method | Any | — |
url | Any | — |
request_id | Any | — |
payload | Any | — |
reason_code | Any | — |
CaliberAuthenticationError
class CaliberAuthenticationError()
Bases: CaliberAPIError
401 — no usable identity. The credential is missing, wrong, or revoked.
CaliberPermissionError
class CaliberPermissionError()
Bases: CaliberAPIError
403 — authenticated, but the identity lacks the required scope.
CaliberNotFoundError
class CaliberNotFoundError()
Bases: CaliberAPIError
404 — no such resource.
CALIBER also returns this for a resource that exists but belongs to another user, deliberately: distinguishing the two would let a caller enumerate ids.
CaliberConflictError
class CaliberConflictError()
Bases: CaliberAPIError
409 — the request conflicts with current state (duplicate name, etc.).
CaliberPreconditionError
class CaliberPreconditionError()
Bases: CaliberAPIError
412 — a stale precondition (e.g. `If-Match`/ETag) failed.
Section 13.6's target design (`docs/workspace-plan.md) reserves 412 for a stale ETag / compare-and-set precondition, distinct from 409's "valid request, but conflicts with current state" -- the caller must re-read the current resource and retry with a fresh precondition rather than simply resubmitting the same request. Carries reason_code when the server sets one so a caller can distinguish *which* precondition failed without parsing detail`.
CaliberValidationError
class CaliberValidationError(message: str, *, errors: list[dict[str, Any]], **kwargs)
Bases: CaliberAPIError
400 with a structured `errors` list.
Constructor
__init__(message: str, *, errors: list[dict[str, Any]], **kwargs) -> None
Operate on the caliber validation error surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
message | positional-or-keyword | str | — |
errors | keyword-only | list[dict[str, Any]] | — |
kwargs | var-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
errors | Any | — |
CaliberRateLimitError
class CaliberRateLimitError()
Bases: CaliberAPIError
429 — too many requests.
CaliberServerError
class CaliberServerError()
Bases: CaliberAPIError
5xx — the server failed. Usually worth retrying; never worth assuming.
Module caliber_sdk.waiters
Polling helpers for CALIBER's long-running operations.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
FAILURE_STATES, TERMINAL_STATES, WaitFailed, WaitTimeout, state_of, wait_for, wait_for_terminal_state
Functions
wait_for(poll: Callable[[], T], *, is_done: Callable[[T], bool], timeout: float = 300.0, interval: float = 2.0, max_interval: float = 15.0, backoff: float = 1.5, sleep: Callable[[float], None] = time.sleep, now: Callable[[], float] = time.monotonic) -> T
Poll until `is_done` or the timeout expires.
The interval grows geometrically to `max_interval. A fixed short interval is what turns a slow job into thousands of requests; a fixed long one makes a fast job feel slow. sleep and now` are injectable so tests do not have to spend real seconds proving this.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], T] | — |
is_done | keyword-only | Callable[[T], bool] | — |
timeout | keyword-only | float | 300.0 |
interval | keyword-only | float | 2.0 |
max_interval | keyword-only | float | 15.0 |
backoff | keyword-only | float | 1.5 |
sleep | keyword-only | Callable[[float], None] | time.sleep |
now | keyword-only | Callable[[], float] | time.monotonic |
Returns: T
Raises:
ValueErrorWaitTimeout
state_of(payload, *, keys: Sequence[str] = ('status', 'state')) -> str
Read a status field from a payload, tolerating either spelling.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
keys | keyword-only | Sequence[str] | ('status', 'state') |
Returns: str
wait_for_terminal_state(poll: Callable[[], Any], *, terminal: frozenset[str] = TERMINAL_STATES, failure: frozenset[str] = FAILURE_STATES, raise_on_failure: bool = True, **kwargs) -> Any
Poll until the payload's status is terminal.
`raise_on_failure` is on by default because the common script wants a failed job to stop it; a caller inspecting the outcome themselves turns it off rather than wrapping every call in a try.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], Any] | — |
terminal | keyword-only | frozenset[str] | TERMINAL_STATES |
failure | keyword-only | frozenset[str] | FAILURE_STATES |
raise_on_failure | keyword-only | bool | True |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
Classes
WaitTimeout
class WaitTimeout(message: str, *, last = None, elapsed: float = 0.0)
Bases: CaliberError
The operation did not reach a terminal state within the budget.
Constructor
__init__(message: str, *, last = None, elapsed: float = 0.0) -> None
Operate on the wait timeout surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
message | positional-or-keyword | str | — |
last | keyword-only | Any | None |
elapsed | keyword-only | float | 0.0 |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
last | Any | — |
elapsed | Any | — |
WaitFailed
class WaitFailed(message: str, *, state: str, last = None)
Bases: CaliberError
The operation reached a terminal state that indicates failure.
Constructor
__init__(message: str, *, state: str, last = None) -> None
Operate on the wait failed surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
message | positional-or-keyword | str | — |
state | keyword-only | str | — |
last | keyword-only | Any | None |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
state | Any | — |
last | Any | — |
Resource modules
Module caliber_sdk.resources
Resource modules — typed façades over route groups.
Public exports
AccountsAPI, AdminAPI, AgentsAPI, AriaAPI, AriaDraftsAPI, AriaSessionsAPI, AuditAPI, AuthAPI, CapabilitiesAPI, CookbooksAPI, EvalDatasetsAPI, EvaluationsAPI, EventsAPI, GateVerdictsAPI, GatewayAPI, JobsAPI, JudgesAPI, KnowledgeBasesAPI, LlmPricingAPI, McpServersAPI, MeAPI, MemoryAPI, ObjectStoreAPI, ObservabilityAPI, OpenApiIntegrationsAPI, PlaygroundRunsAPI, ProjectFilesAPI, ProjectReworkTasksAPI, ProjectsAPI, PromptsAPI, QualityReviewsAPI, RawAPI, ReleasesAPI, Resource, ReviewQueuesAPI, ReworkTasksAPI, SecretsAPI, SettingsAPI, SkillsAPI, SystemAPI, TokensAPI, ToolsAPI, VerificationQueueAPI, WorkflowPromotionsAPI, WorkflowRunFailed, WorkflowRunsAPI, WorkflowServicesAPI, WorkflowVersionsAPI, WorkflowsAPI, WorkspacesAPI
Module caliber_sdk.resources.auth
Authentication, tokens, and accounts.
Tested example
def issue_scoped_token(caliber: CaliberClient, *, name: str = "ci") -> dict[str, Any]:
"""Create a token limited to operator scope.
The scope list is a *ceiling*: the effective authority is the intersection
with what the owner holds when the request is made. Requesting more than
you hold is refused outright rather than silently narrowed, so a token
never claims authority it cannot exercise.
"""
issued = caliber.auth.tokens.create(name, scopes=["caliber.operator"])
# The plaintext exists exactly once. There is no endpoint that returns it
# again — store it now or rotate to get a new one.
secret = issued.token
live = [token.token_id for token in caliber.auth.tokens.list() if token.active]
caliber.auth.tokens.revoke(issued.token_id)
return {"token_id": issued.token_id, "secret_len": len(secret), "live_before_revoke": live}sdk/caliber-sdk/examples/tokens.py — executed by the SDK test suite.Public exports
AccountsAPI, AdminAPI, AuthAPI, TokensAPI
Classes
TokensAPI
class TokensAPI()
Personal access tokens for automation.
Methods
list() -> list[PersonalAccessToken]
Every token belonging to the caller. Never includes a secret.
This callable takes no public parameters.
Returns: list[PersonalAccessToken]
Raises:
create(name: str, *, scopes: Sequence[str] | None = None, expires_at: str | None = None, project_id: str | None = None) -> IssuedToken
Issue a token. The plaintext is returned once — store it now.
`scopes` is a ceiling, not a grant: the effective authority is the intersection with what the owner holds at request time. Omit it to inherit the owner's scopes. Requesting a scope the caller does not hold is refused rather than silently narrowed.
`project_id` optionally binds the token to one project you already hold a role in -- the server refuses to issue a token bound to a project you have no relationship with. A bound token is then refused for any request that names a different project.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
scopes | keyword-only | `Sequence[str] | None` | None |
expires_at | keyword-only | `str | None` | None |
project_id | keyword-only | `str | None` | None |
Returns: IssuedToken
Raises:
revoke(token_id: str) -> bool
Revoke a token. Returns whether a live token was actually revoked.
| Parameter | Kind | Type | Default |
|---|---|---|---|
token_id | positional-or-keyword | str | — |
Returns: bool
Raises:
rotate(token_id: str) -> IssuedToken
Replace a token's secret, preserving its name and scope ceiling.
One transaction on the server: the old token is revoked and the replacement issued together, so a failure cannot leave an account with two live tokens or none.
| Parameter | Kind | Type | Default |
|---|---|---|---|
token_id | positional-or-keyword | str | — |
Returns: IssuedToken
Raises:
AccountsAPI
class AccountsAPI()
User accounts. Admin-only on the server.
Methods
list() -> list[Account]
Return the current collection of user accounts, applying any supported filters.
This callable takes no public parameters.
Returns: list[Account]
Raises:
create(user_id: str, password: str) -> Any
Create a new record on the user accounts surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
user_id | positional-or-keyword | str | — |
password | positional-or-keyword | str | — |
Returns: Any
Raises:
update(user_id: str, *, password: str | None = None, disabled: bool | None = None) -> Any
Reset a password or enable/disable an account.
Both revoke the account's sessions server-side, so they take effect immediately rather than at the next expiry.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
user_id | positional-or-keyword | str | — | |
password | keyword-only | `str | None` | None |
disabled | keyword-only | `bool | None` | None |
Returns: Any
Raises:
revoke_sessions(user_id: str) -> int
Sign an account out everywhere. Returns how many sessions were cut.
| Parameter | Kind | Type | Default |
|---|---|---|---|
user_id | positional-or-keyword | str | — |
Returns: int
Raises:
AuthAPI
class AuthAPI(transport)
Session inspection, plus the token and account sub-resources.
Constructor
__init__(transport) -> None
Operate on the authentication and session state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
tokens | TokensAPI | — |
accounts | AccountsAPI | — |
Methods
session() -> SessionInfo
How this client's identity was established.
This callable takes no public parameters.
Returns: SessionInfo
Raises:
AdminAPI
class AdminAPI()
Platform-wide, admin-only operational surfaces.
Methods
platform_admin_inventory() -> PlatformAdminInventory
Who currently holds each config-driven global scope.
Metadata only -- `caliber.admin-gated, and grants no project or resource access itself. See docs/workspace-plan.md` Phase 1 item 13 for why this exists: a recovery/support aid for "who do I even ask", not a capability.
This callable takes no public parameters.
Returns: PlatformAdminInventory
Raises:
Module caliber_sdk.resources.system
Identity, capabilities, and settings — the deployment-level surfaces.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
CapabilitiesAPI, MeAPI, SettingsAPI
Classes
MeAPI
class MeAPI()
The caller's own identity.
Methods
get() -> Identity
Resolve this client's identity and scopes.
Reports rather than requires: an invalid or revoked credential returns an anonymous identity instead of raising. Check :attr:Identity.is_anonymous; do not rely on an exception.
This callable takes no public parameters.
Returns: Identity
Raises:
CapabilitiesAPI
class CapabilitiesAPI()
Runtime feature flags and API stability tiers.
Methods
get() -> Capabilities
Fetch one record from the runtime capabilities surface identified by id.
This callable takes no public parameters.
Returns: Capabilities
Raises:
SettingsAPI
class SettingsAPI()
Runtime configuration inventory and LLM credential status.
Methods
runtime() -> RuntimeSettings
Return the current runtime settings snapshot for the deployment.
This callable takes no public parameters.
Returns: RuntimeSettings
Raises:
llm() -> LlmSetupStatus
Which LLM credentials are configured.
Presence flags and masked fingerprints only — the endpoint does not disclose key values, deliberately.
This callable takes no public parameters.
Returns: LlmSetupStatus
Raises:
update_llm(**changes) -> Any
Write LLM provider settings. Secrets are write-only on the server.
| Parameter | Kind | Type | Default |
|---|---|---|---|
changes | var-keyword | Any | — |
Returns: Any
Raises:
Module caliber_sdk.resources.projects
Projects and their files — the workspace-scoping surface.
Tested example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Public exports
ProjectChangeRequestsAPI, ProjectFilesAPI, ProjectImportsAPI, ProjectMembersAPI, ProjectReleaseOperationsAPI, ProjectReleasesAPI, ProjectRevisionsAPI, ProjectReworkTasksAPI, ProjectSourceAPI, ProjectVersionTagsAPI, ProjectsAPI, WorkspacesAPI
Classes
ProjectFilesAPI
class ProjectFilesAPI()
Files inside one project.
Methods
list(project_id: str) -> tuple[list[ProjectFile], list[ProjectFolder]]
Files and the directories containing them.
Returned as a pair rather than one flattened list: a directory is not a file, and collapsing them would make an empty folder indistinguishable from a missing one.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: tuple[list[ProjectFile], list[ProjectFolder]] — see ProjectFile, ProjectFolder
Raises:
upload(project_id: str, *, filename: str, content: bytes | BinaryIO, path: str | None = None, kind: str = 'input', media_type: str | None = None) -> ProjectFile
Upload a file. Multipart, so it does not go through the JSON path.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
filename | keyword-only | str | — | |
content | keyword-only | `bytes | BinaryIO` | — |
path | keyword-only | `str | None` | None |
kind | keyword-only | str | 'input' | |
media_type | keyword-only | `str | None` | None |
Returns: ProjectFile
Raises:
create_folder(project_id: str, path: str) -> ProjectFolder
Operate on the project files and folders surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
path | positional-or-keyword | str | — |
Returns: ProjectFolder
Raises:
delete(project_id: str, file_id: str) -> bool
Delete a record on the project files and folders surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bool
Raises:
download(project_id: str, file_id: str) -> bytes
Raw bytes. Not JSON, so it bypasses the envelope entirely.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bytes
Raises:
ProjectSourceAPI
class ProjectSourceAPI()
A project's Git-backed source-control binding (P6-B).
Every mutation is optimistic-concurrency-checked with an `If-Match etag, mirroring the server's own contract: a stale write 412s rather than silently overwriting a change another caller just made. Read the current binding with :meth:get, pass its .source.etag back as if_match`.
Methods
get(project_id: str) -> WorkspaceSourceState
Fetch one record from the project source surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: WorkspaceSourceState
Raises:
configure(project_id: str, *, provider: str, provider_host: str, canonical_repository_id: str, display_path: str, default_branch: str = 'main', root_path: str = '', manifest_path: str = '.caliber/workspace.yaml', import_mode: str = 'push', connection_ref: str | None = None, if_match: str | None = None) -> WorkspaceSourceState
Bind or replace this project's source-of-truth repository.
`if_match must be omitted the first time a project has no source configured yet, and must carry the existing binding's etag to replace one that already exists -- passing one when there is nothing to match, or omitting it when there is, both 412. Replacing an existing binding also requires it to be disabled first (:meth:disable`).
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
provider | keyword-only | str | — | |
provider_host | keyword-only | str | — | |
canonical_repository_id | keyword-only | str | — | |
display_path | keyword-only | str | — | |
default_branch | keyword-only | str | 'main' | |
root_path | keyword-only | str | '' | |
manifest_path | keyword-only | str | '.caliber/workspace.yaml' | |
import_mode | keyword-only | str | 'push' | |
connection_ref | keyword-only | `str | None` | None |
if_match | keyword-only | `str | None` | None |
Returns: WorkspaceSourceState
Raises:
enable(project_id: str, *, if_match: str) -> WorkspaceSourceState
Verify the binding against its provider and make it importable.
Each transition method calls its own literal path (rather than sharing one helper parameterized on the action) so `docs-site/sdk_coverage.py's static source-text scan -- which matches a literal f"...". after self._post(`, not a runtime-built path -- can see it as covered.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
if_match | keyword-only | str | — |
Returns: WorkspaceSourceState
Raises:
disable(project_id: str, *, if_match: str) -> WorkspaceSourceState
Operate on the project source surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
if_match | keyword-only | str | — |
Returns: WorkspaceSourceState
Raises:
reconcile(project_id: str, *, if_match: str) -> WorkspaceSourceState
Re-verify an already-enabled binding against its provider.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
if_match | keyword-only | str | — |
Returns: WorkspaceSourceState
Raises:
capabilities(project_id: str) -> WorkspaceSourceCapabilities
What the bound provider supports, without needing credentials.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: WorkspaceSourceCapabilities
Raises:
ProjectImportsAPI
class ProjectImportsAPI()
Durable source-to-revision import jobs for one project (P6-B).
Usage example
def connect_github_source_and_import_on_push(
caliber: CaliberClient,
*,
project_id: str = "PRJ-1",
repository: str = "octo-org/mortgage-underwriting",
commit_sha: str = "a" * 40,
bundle: bytes = b"PK\x05\x06" + b"\x00" * 18, # minimal empty-ZIP end-of-central-directorysdk/caliber-sdk/examples/workspace_github_source.py — executed by the SDK test suite.Methods
list(project_id: str, *, status: str | None = None, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceImportJob]
Return the current collection of project imports, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceImportJob]
Raises:
get(project_id: str, job_id: str) -> WorkspaceImportJob
Fetch one record from the project imports surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
Returns: WorkspaceImportJob
Raises:
create(project_id: str, *, repository: str, commit_sha: str, bundle: bytes | BinaryIO, idempotency_key: str, filename: str = 'bundle') -> WorkspaceImportJob
Start an import. Multipart, so it does not go through the JSON path.
`idempotency_key` has no default on purpose: the server replays a prior job for a reused key rather than starting a second one, so generating a fresh key on every call here would silently defeat that retry-safety guarantee. Reuse the same key across a retry of the same logical import; the server compares content digests and rejects a key reused for genuinely different content.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
repository | keyword-only | str | — | |
commit_sha | keyword-only | str | — | |
bundle | keyword-only | `bytes | BinaryIO` | — |
idempotency_key | keyword-only | str | — | |
filename | keyword-only | str | 'bundle' |
Returns: WorkspaceImportJob
Raises:
reconcile(project_id: str, job_id: str) -> WorkspaceImportReconciliation
Explicitly observe an import stuck in `reconcile_required`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
Returns: WorkspaceImportReconciliation
Raises:
wait(project_id: str, job_id: str, *, timeout: float = 900.0, **options) -> WorkspaceImportJob
Poll until the import reaches a terminal state.
`reconcile_required counts as terminal here -- it will never advance on its own, so a waiter that only accepted succeeded/ failed would block until timeout on the one outcome that needs a caller to act (:meth:reconcile`), not wait longer.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: WorkspaceImportJob
Raises:
ProjectRevisionsAPI
class ProjectRevisionsAPI()
Immutable, reviewable Workspace revisions for one project (P6-B).
Methods
list(project_id: str, *, status: str | None = None, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceRevision]
Return the current collection of project revisions, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceRevision]
Raises:
get(project_id: str, revision_id: str) -> WorkspaceRevision
Fetch one record from the project revisions surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
revision_id | positional-or-keyword | str | — |
Returns: WorkspaceRevision
Raises:
diff(project_id: str, revision_id: str, *, base: str) -> WorkspaceRevisionDiff
The deterministic pin-level difference from `base to revision_id`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
revision_id | positional-or-keyword | str | — |
base | keyword-only | str | — |
Returns: WorkspaceRevisionDiff
Raises:
snapshot(project_id: str, *, resources: Sequence[dict[str, Any]]) -> WorkspaceRevision
Pin an explicit list of live CALIBER resource versions into a new, immutable, source-less ("managed") revision (P4-B/P4-C).
Unlike a Git-backed import, this never resolves "current" for you -- each entry in `resources names an exact {"resource_type": ..., "resource_id": ..., "version_ref": ...} pin (logical_name/purpose are optional), so the same request always produces the same content. A resource type with no registered adapter, or whose adapter does not yet support managed snapshotting, is refused (409) rather than silently skipped -- today that's only "prompt"`.
Idempotent by content: retrying with the same `resources list returns the already-created revision instead of a duplicate (the resource list's own digest becomes the revision's revision_sha256`, deduplicated server-side), so no separate idempotency key is needed.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
resources | keyword-only | Sequence[dict[str, Any]] | — |
Returns: WorkspaceRevision
Raises:
ProjectChangeRequestsAPI
class ProjectChangeRequestsAPI()
The Change Request review lifecycle for one project (P6-B).
A Change Request proposes a ready revision for review and promotes it through a fixed status machine (`draft -> open -> ... -> accepted/closed). Mutations that touch a specific version of the request (update_head/rebase/close/assign_reviewer/ remove_reviewer) take expected_lock_version rather than an If-Match header -- that is the server's own optimistic-concurrency field here (from a prior get()/list() call's .lock_version), unlike :class:ProjectSourceAPI`'s etag.
Usage example
def promote_a_reviewed_revision(
caliber: CaliberClient,
*,
project_id: str = "PRJ-1",
revision_id: str = "WSR-1",
environment_id: str = "development",sdk/caliber-sdk/examples/workspace_release.py — executed by the SDK test suite.Methods
list(project_id: str, *, status: str | None = None, created_by: str | None = None, reviewer_user_id: str | None = None, semantic_version: str | None = None, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceChangeRequest]
Return the current collection of project change requests, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
created_by | keyword-only | `str | None` | None |
reviewer_user_id | keyword-only | `str | None` | None |
semantic_version | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceChangeRequest]
Raises:
get(project_id: str, change_request_id: str) -> WorkspaceChangeRequest
Fetch one record from the project change requests surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
Returns: WorkspaceChangeRequest
Raises:
create(project_id: str, *, title: str, head_revision_id: str, semantic_version: str, description: str = '', base_revision_id: str | None = None, review_backend: str = 'caliber', reviewer_user_ids: Sequence[str] | None = None) -> WorkspaceChangeRequest
Open a draft Change Request over a ready revision.
Stays `draft until :meth:submit -- creating one does not by itself start review or claim semantic_version`.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
title | keyword-only | str | — | |
head_revision_id | keyword-only | str | — | |
semantic_version | keyword-only | str | — | |
description | keyword-only | str | '' | |
base_revision_id | keyword-only | `str | None` | None |
review_backend | keyword-only | str | 'caliber' | |
reviewer_user_ids | keyword-only | `Sequence[str] | None` | None |
Returns: WorkspaceChangeRequest
Raises:
submit(project_id: str, change_request_id: str, *, idempotency_key: str | None = None) -> WorkspaceChangeRequest
Move a draft to `open, reserving its semantic_version` claim.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
idempotency_key | keyword-only | `str | None` | None |
Returns: WorkspaceChangeRequest
Raises:
update_head(project_id: str, change_request_id: str, *, revision_id: str, expected_lock_version: int, change_summary: str = '') -> WorkspaceChangeRequest
Append a new ready revision as the request's next head generation.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
revision_id | keyword-only | str | — |
expected_lock_version | keyword-only | int | — |
change_summary | keyword-only | str | '' |
Returns: WorkspaceChangeRequest
Raises:
rebase(project_id: str, change_request_id: str, *, revision_id: str, expected_lock_version: int, change_summary: str = '', semantic_version: str | None = None) -> WorkspaceChangeRequest
Bring an `out_of_date` request back onto the current accepted head.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
revision_id | keyword-only | str | — | |
expected_lock_version | keyword-only | int | — | |
change_summary | keyword-only | str | '' | |
semantic_version | keyword-only | `str | None` | None |
Returns: WorkspaceChangeRequest
Raises:
close(project_id: str, change_request_id: str, *, reason: str, expected_lock_version: int) -> WorkspaceChangeRequest
Close the underlying HTTP client or transport owned by this object.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
reason | keyword-only | str | — |
expected_lock_version | keyword-only | int | — |
Returns: WorkspaceChangeRequest
Raises:
accept(project_id: str, change_request_id: str) -> WorkspaceChangeRequest
Accept a Change Request, advancing the project's accepted revision.
Takes no QA-evidence argument by design: the server derives it itself from a durably recorded QA go decision bound to the request's current head (see `caliber.routes.workspace_change_requests's own docstring on the server side) rather than trusting anything this client could send. A 409` means either no qualifying QA decision exists yet for the current head, or a concurrent acceptance already advanced the project's accepted revision out from under this request.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
Returns: WorkspaceChangeRequest
Raises:
list_comments(project_id: str, change_request_id: str, *, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceChangeRequestComment]
Operate on the project change requests surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceChangeRequestComment]
Raises:
add_comment(project_id: str, change_request_id: str, *, body: str, head_id: str | None = None, resource_type: str | None = None, resource_name: str | None = None, source_path: str | None = None) -> WorkspaceChangeRequestComment
Add a comment, optionally anchored to a specific head/resource/path.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
body | keyword-only | str | — | |
head_id | keyword-only | `str | None` | None |
resource_type | keyword-only | `str | None` | None |
resource_name | keyword-only | `str | None` | None |
source_path | keyword-only | `str | None` | None |
Returns: WorkspaceChangeRequestComment
Raises:
list_reviewers(project_id: str, change_request_id: str, *, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceChangeRequestReviewer]
Operate on the project change requests surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceChangeRequestReviewer]
Raises:
assign_reviewer(project_id: str, change_request_id: str, user_id: str, *, expected_lock_version: int) -> WorkspaceChangeRequestReviewer
Operate on the project change requests surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
expected_lock_version | keyword-only | int | — |
Returns: WorkspaceChangeRequestReviewer
Raises:
remove_reviewer(project_id: str, change_request_id: str, user_id: str, *, expected_lock_version: int) -> WorkspaceChangeRequest
Deactivate a reviewer. Returns the Change Request, not the reviewer row -- `active_reviewer_count` is the reason a caller would check.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
expected_lock_version | keyword-only | int | — |
Returns: WorkspaceChangeRequest
Raises:
list_reviews(project_id: str, change_request_id: str, *, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceChangeRequestReview]
Operate on the project change requests surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceChangeRequestReview]
Raises:
submit_review(project_id: str, change_request_id: str, *, head_id: str, decision: str, rationale: str = '') -> WorkspaceChangeRequestReview
Record one reviewer's decision against a specific head.
`decision is "approve" or "request_changes"`; passed through rather than a stricter type so a server that adds a third decision is still reachable without an SDK release.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
head_id | keyword-only | str | — |
decision | keyword-only | str | — |
rationale | keyword-only | str | '' |
Returns: WorkspaceChangeRequestReview
Raises:
list_attestations(project_id: str, change_request_id: str, *, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceExternalReviewAttestation]
Operate on the project change requests surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceExternalReviewAttestation]
Raises:
refresh_external_review(project_id: str, change_request_id: str) -> None
Queue a re-check of this request's external (e.g. GitHub PR) review state.
Fire-and-forget: the server responds `202` with no resource to decode, so there is nothing meaningful to return.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
change_request_id | positional-or-keyword | str | — |
Returns: None
Raises:
list_checks(project_id: str, change_request_id: str, *, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceChangeRequestCheck]
Operate on the project change requests surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
change_request_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceChangeRequestCheck]
Raises:
ProjectVersionTagsAPI
class ProjectVersionTagsAPI()
Immutable semantic-version claims recorded against revisions (P6-B).
Methods
list(project_id: str, *, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceVersionTag]
Return the current collection of project version tags, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceVersionTag]
Raises:
get(project_id: str, tag: str) -> WorkspaceVersionTag
Fetch one record from the project version tags surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
tag | positional-or-keyword | str | — |
Returns: WorkspaceVersionTag
Raises:
ProjectReleaseOperationsAPI
class ProjectReleaseOperationsAPI()
Durable apply/rollback intents against one release (P5-C).
Unlike the cursor-paginated Change-Request/import/revision families, :meth:list uses plain `limit/offset -- this resource's own immediate server-side sibling (release list/evidence/evaluations, see :class:ProjectReleasesAPI`) already established that convention for this release family, and there was no reason to introduce a third pagination style where two already coexist in shipped code.
Usage example
def promote_a_reviewed_revision(
caliber: CaliberClient,
*,
project_id: str = "PRJ-1",
revision_id: str = "WSR-1",
environment_id: str = "development",sdk/caliber-sdk/examples/workspace_release.py — executed by the SDK test suite.Methods
list(project_id: str, release_id: str, *, limit: int | None = None, offset: int | None = None) -> list[WorkspaceReleaseOperation]
Return the current collection of project release operations, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceReleaseOperation]
Raises:
get(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
Fetch one record from the project release operations surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
create(project_id: str, release_id: str, *, kind: str, idempotency_key: str, expected_environment_lock_version: int, expected_current_release_id: str | None = None, target_release_id: str | None = None) -> WorkspaceReleaseOperationResult
Prepare an `"apply" or "rollback"` operation.
`expected_environment_lock_version` is a compare-and-swap against the environment's current lock version -- a stale value 409s rather than racing another operation targeting the same environment.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
kind | keyword-only | str | — | |
idempotency_key | keyword-only | str | — | |
expected_environment_lock_version | keyword-only | int | — | |
expected_current_release_id | keyword-only | `str | None` | None |
target_release_id | keyword-only | `str | None` | None |
Returns: WorkspaceReleaseOperationResult
Raises:
apply(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
Execute a prepared operation through its provider adapter.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
observe(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
Re-check an in-flight or ambiguous operation against its provider.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
cancel_expired(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
Cancel an operation whose lease has expired without ever applying.
The literal path stays one f-string passed straight into `self._post( (rather than split across adjacent literals, or built up in a local variable first) because docs-site/sdk_coverage.py's static source-text scan only matches a single quoted literal immediately following self._post(` -- either alternative would make this exact route silently read as uncovered.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
wait(project_id: str, release_id: str, operation_id: str, *, timeout: float = 900.0, **options) -> WorkspaceReleaseOperationResult
Poll until an apply or rollback operation reaches a terminal state.
`reconcile_required counts as terminal here for the same reason it does for :meth:ProjectImportsAPI.wait -- it will never advance on its own, so a caller who only waited for applied/failed would block until timeout on the one outcome that needs :meth:observe` called, not more waiting.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: WorkspaceReleaseOperationResult
Raises:
ProjectReleasesAPI
class ProjectReleasesAPI()
The Workspace release evaluation/decision/approval lifecycle (P5-F).
A release moves through a fixed state machine (`draft -> evaluating -> {blocked, rejected, approved, awaiting_quality_signoff} -> awaiting_approval -> {approved, rejected}); :class:ProjectReleaseOperationsAPI then executes an *approved* release against an environment. Two authorization shapes coexist here, mirroring the server routes exactly: :meth:create/ :meth:evaluate are plain project-scoped actions, while :meth:quality_signoff/:meth:approve/:meth:break_glass_apply` are identity-specific governance decisions the server authorizes on role (Reviewer vs. Owner) and platform scope, not a single scope check.
Usage example
def promote_a_reviewed_revision(
caliber: CaliberClient,
*,
project_id: str = "PRJ-1",
revision_id: str = "WSR-1",
environment_id: str = "development",sdk/caliber-sdk/examples/workspace_release.py — executed by the SDK test suite.Methods
list(project_id: str, *, status: str | None = None, environment_id: str | None = None, limit: int | None = None, offset: int | None = None) -> list[WorkspaceRelease]
Return the current collection of project releases, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
environment_id | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceRelease]
Raises:
create(project_id: str, *, revision_id: str, environment_id: str, environment_config_sha256: str, runtime_dependencies_sha256: str, policy_sha256: str, request_idempotency_key: str, change_request_id: str | None = None, change_request_head_id: str | None = None, version_tag_id: str | None = None, predecessor_release_id: str | None = None) -> WorkspaceRelease
Capture immutable release coordinates before evaluation dispatch.
The three `*_sha256` digests are pinned here and re-verified at every later decision point -- a release evaluated against one environment config and then approved against a different one is exactly the drift this pinning exists to make impossible.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
revision_id | keyword-only | str | — | |
environment_id | keyword-only | str | — | |
environment_config_sha256 | keyword-only | str | — | |
runtime_dependencies_sha256 | keyword-only | str | — | |
policy_sha256 | keyword-only | str | — | |
request_idempotency_key | keyword-only | str | — | |
change_request_id | keyword-only | `str | None` | None |
change_request_head_id | keyword-only | `str | None` | None |
version_tag_id | keyword-only | `str | None` | None |
predecessor_release_id | keyword-only | `str | None` | None |
Returns: WorkspaceRelease
Raises:
get(project_id: str, release_id: str) -> WorkspaceRelease
Fetch one record from the project releases surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
Returns: WorkspaceRelease
Raises:
list_evidence(project_id: str, release_id: str, *, limit: int | None = None, offset: int | None = None) -> list[WorkspaceReleaseEvidence]
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceReleaseEvidence]
Raises:
evaluate(project_id: str, release_id: str, *, idempotency_key: str, evaluation_plan_sha256: str, input_sha256: str) -> WorkspaceReleaseEvaluation
Request an evaluation attempt; a worker claims and runs it.
Replayed by `idempotency_key`: calling this again with the same key and digests while an attempt is active returns that same attempt rather than starting a second one, but a different key while one is still active is refused (409) rather than running two evaluations concurrently.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
idempotency_key | keyword-only | str | — |
evaluation_plan_sha256 | keyword-only | str | — |
input_sha256 | keyword-only | str | — |
Returns: WorkspaceReleaseEvaluation
Raises:
list_evaluations(project_id: str, release_id: str, *, limit: int | None = None, offset: int | None = None) -> list[WorkspaceReleaseEvaluation]
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceReleaseEvaluation]
Raises:
get_evaluation(project_id: str, release_id: str, evaluation_id: str) -> WorkspaceReleaseEvaluation
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
evaluation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseEvaluation
Raises:
wait_for_evaluation(project_id: str, release_id: str, evaluation_id: str, *, timeout: float = 900.0, **options) -> WorkspaceReleaseEvaluation
Poll until the evaluation attempt reaches `succeeded or failed`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
evaluation_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: WorkspaceReleaseEvaluation
Raises:
quality_signoff(project_id: str, release_id: str, *, decision: str, gate_evidence_sha256: str, rationale: str = '', change_request_head_id: str | None = None) -> WorkspaceReleaseDecision
Record a QA go/no-go decision. Requires the Reviewer project role.
`decision is "go" or "no_go", passed through rather than a stricter type for the same forward-compatibility reason as :meth:ProjectChangeRequestsAPI.submit_review's decision`.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
decision | keyword-only | str | — | |
gate_evidence_sha256 | keyword-only | str | — | |
rationale | keyword-only | str | '' | |
change_request_head_id | keyword-only | `str | None` | None |
Returns: WorkspaceReleaseDecision
Raises:
approve(project_id: str, release_id: str, *, decision: str, gate_evidence_sha256: str, rationale: str = '', change_request_head_id: str | None = None) -> WorkspaceReleaseDecision
Record the final release go/no-go decision. Requires the Owner role.
Refused (409) unless the release already carries a fresh quality signoff bound to this exact head/revision/digests -- an approval does not itself re-run or supersede quality review.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
decision | keyword-only | str | — | |
gate_evidence_sha256 | keyword-only | str | — | |
rationale | keyword-only | str | '' | |
change_request_head_id | keyword-only | `str | None` | None |
Returns: WorkspaceReleaseDecision
Raises:
break_glass_apply(project_id: str, release_id: str, *, reason: str, incident_ref: str, authorization_ref: str, expires_at: str, gate_evidence_sha256: str, expected_current_release_id: str, expected_environment_lock_version: int, idempotency_key: str) -> WorkspaceBreakGlassApplyResult
Interactive production recovery, bypassing the normal apply path.
Requires a real browser session (platform Admin, `credential_kind == "session") -- a personal access token can never call this, by server-side design, not merely by convention. expires_at is an ISO-8601 timestamp string; the authorization is void past it regardless of whether it was ever used. expected_current_release_id` is a compare-and-swap against this release (not the environment's currently-deployed one) -- it fails closed if the release moved on while the authorization was being requested.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
reason | keyword-only | str | — |
incident_ref | keyword-only | str | — |
authorization_ref | keyword-only | str | — |
expires_at | keyword-only | str | — |
gate_evidence_sha256 | keyword-only | str | — |
expected_current_release_id | keyword-only | str | — |
expected_environment_lock_version | keyword-only | int | — |
idempotency_key | keyword-only | str | — |
Returns: WorkspaceBreakGlassApplyResult
Raises:
ProjectReworkTasksAPI
class ProjectReworkTasksAPI()
Rework tasks owned by one project-scoped agent population.
Methods
list(project_id: str, *, status: str | None = None, assigned_to: str | None = None) -> list[ReworkTask]
Return the current collection of project rework tasks, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
assigned_to | keyword-only | `str | None` | None |
Returns: list[ReworkTask]
Raises:
get(project_id: str, task_id: str) -> ReworkTask
Fetch one record from the project rework tasks surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
task_id | positional-or-keyword | str | — |
Returns: ReworkTask
Raises:
claim(project_id: str, task_id: str) -> ReworkTask
Operate on the project rework tasks surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
task_id | positional-or-keyword | str | — |
Returns: ReworkTask
Raises:
resolve(project_id: str, task_id: str, **options) -> ReworkTask
Operate on the project rework tasks surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
task_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReworkTask
Raises:
reassign(project_id: str, task_id: str, assigned_to: str) -> ReworkTask
Operate on the project rework tasks surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
task_id | positional-or-keyword | str | — |
assigned_to | positional-or-keyword | str | — |
Returns: ReworkTask
Raises:
ProjectMembersAPI
class ProjectMembersAPI()
A project's membership, role, and primary-ownership management (P6-B).
Exposed as `ProjectsAPI.members. The equivalent flat methods on ProjectsAPI itself (list_members/add_member/ update_member/remove_member/transfer_ownership`) delegate to this class -- a root convenience for the common case, not a second implementation to keep in sync.
Methods
list(project_id: str) -> list[ProjectMember]
List active members and their effective project roles.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: list[ProjectMember]
Raises:
add(project_id: str, user_id: str, *, role: str = 'viewer') -> ProjectMember
Grant `user_id` a project role; only owners may manage members.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
role | keyword-only | str | 'viewer' |
Returns: ProjectMember
Raises:
update(project_id: str, user_id: str, *, role: str | None = None, status: str | None = None) -> ProjectMember
Change a member's role or active status.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
user_id | positional-or-keyword | str | — | |
role | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: ProjectMember
Raises:
remove(project_id: str, user_id: str) -> bool
Deactivate a member; the project owner cannot be removed.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
Returns: bool
Raises:
transfer_ownership(project_id: str, new_owner_user_id: str) -> Project
Atomically move the primary-owner pointer to another active, eligible `owner`-role (Admin) member.
Only the current primary owner may call this; the target must already hold the `owner role (see :meth:add/:meth:update`) and pass a live scope-eligibility check.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
new_owner_user_id | positional-or-keyword | str | — |
Returns: Project
Raises:
ProjectsAPI
class ProjectsAPI(transport)
Projects, project access, and the file sub-resource.
Related APIs: ProjectFilesAPI
Constructor
__init__(transport) -> None
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
files | ProjectFilesAPI | — |
members | ProjectMembersAPI | — |
rework_tasks | ProjectReworkTasksAPI | Owned, recoverable work auto-created from a rejected refinement job. |
source | ProjectSourceAPI | — |
source_connection | ProjectSourceConnectionAPI | — |
imports | ProjectImportsAPI | — |
revisions | ProjectRevisionsAPI | — |
change_requests | ProjectChangeRequestsAPI | — |
version_tags | ProjectVersionTagsAPI | — |
releases | ProjectReleasesAPI | Release candidates, waivers, signoff, and reports. |
release_operations | ProjectReleaseOperationsAPI | — |
Methods
list(*, status: str | None = None) -> list[Project]
Active projects by default; pass `status="all"` for everything.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Project]
Raises:
get(project_id: str) -> Project
Fetch one record from the projects surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Project
Raises:
create(name: str, *, description: str | None = None) -> Project
Create a new record on the projects surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
description | keyword-only | `str | None` | None |
Returns: Project
Raises:
update(project_id: str, *, name: str | None = None, description: str | None = None, status: str | None = None) -> Project
Rename/redescribe a project, and (deprecated) flip its lifecycle status.
Section 13.3's compatibility contract: `status stays accepted during a deprecation window rather than becoming a hard TypeError (the server itself now rejects a status field on the underlying PATCH route with a 400 -- name/description only). Passing it here still works, emits a DeprecationWarning, and delegates to archive()/restore() -- the new Admin-only lifecycle routes, which also record who made the change and when (archived_at/ archived_by on the returned Project). Passing both status and name/description` together sends two requests and returns the second (name/description) response, which reflects both.
Prefer calling `archive()/restore()` directly in new code.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
name | keyword-only | `str | None` | None |
description | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: Project
Raises:
CaliberAPIErrorCaliberTransportErrorValueError
archive(project_id: str) -> Project
Move a project to the `archived` status, recording who/when.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Project
Raises:
restore(project_id: str) -> Project
Move an archived project back to `active`, clearing provenance.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Project
Raises:
transfer_ownership(project_id: str, new_owner_user_id: str) -> Project
Delegates to :meth:ProjectMembersAPI.transfer_ownership (`self.members`).
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
new_owner_user_id | positional-or-keyword | str | — |
Returns: Project
Raises:
list_members(project_id: str) -> list[ProjectMember]
Delegates to :meth:ProjectMembersAPI.list (`self.members`).
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: list[ProjectMember]
Raises:
add_member(project_id: str, user_id: str, *, role: str = 'viewer') -> ProjectMember
Delegates to :meth:ProjectMembersAPI.add (`self.members`).
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
role | keyword-only | str | 'viewer' |
Returns: ProjectMember
Raises:
update_member(project_id: str, user_id: str, *, role: str | None = None, status: str | None = None) -> ProjectMember
Delegates to :meth:ProjectMembersAPI.update (`self.members`).
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
user_id | positional-or-keyword | str | — | |
role | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: ProjectMember
Raises:
remove_member(project_id: str, user_id: str) -> bool
Delegates to :meth:ProjectMembersAPI.remove (`self.members`).
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
Returns: bool
Raises:
storage() -> Any
Where project files live, and what else the deployment supports.
This callable takes no public parameters.
Returns: Any
Raises:
list_environments(project_id: str) -> list[WorkspaceEnvironment]
The project's four fixed environments, in promotion order.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: list[WorkspaceEnvironment]
Raises:
get_environment(project_id: str, name: str) -> WorkspaceEnvironment
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
Returns: WorkspaceEnvironment
Raises:
update_environment(project_id: str, name: str, *, policy: dict[str, Any], policy_sha256: str, expected_lock_version: int) -> WorkspaceEnvironment
Update an environment's policy configuration.
`policy_sha256 is a caller-supplied digest, trusted the same way the release-lifecycle digests are (environment_config_sha256, runtime_dependencies_sha256, ...) -- the server stores it and policy as given, it does not independently recompute or verify the hash. expected_lock_version is a compare-and-swap against this environment's own lock_version (from a prior :meth:get_environment/:meth:list_environments call); a stale value 409s rather than silently overwriting a change another caller just made. Identity fields (name/environment_class/ promotion_order`) can never be changed here or anywhere else.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
policy | keyword-only | dict[str, Any] | — |
policy_sha256 | keyword-only | str | — |
expected_lock_version | keyword-only | int | — |
Returns: WorkspaceEnvironment
Raises:
enable_environment(project_id: str, name: str) -> WorkspaceEnvironment
Explicit lifecycle transition to `"active"`; Admin-only.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
Returns: WorkspaceEnvironment
Raises:
disable_environment(project_id: str, name: str) -> WorkspaceEnvironment
Explicit lifecycle transition to `"disabled"`; Admin-only.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
Returns: WorkspaceEnvironment
Raises:
Module caliber_sdk.resources.assets
Prompts, skills, and tools — the governed asset families.
Tested example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Public exports
AgentsAPI, PromptsAPI, SkillsAPI, ToolsAPI
Classes
PromptsAPI
class PromptsAPI()
Prompt registry surfaces.
Prompts are MLflow registry objects that CALIBER governs. Versions are immutable and an alias points at one of them, so "update a prompt" is always "register a new version", never an edit in place.
Usage example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Related APIs: EvaluationsAPI, ReviewQueuesAPI
Methods
list() -> list[Prompt]
Return the current collection of prompts and prompt versions, applying any supported filters.
This callable takes no public parameters.
Returns: list[Prompt]
Raises:
get(agent_id: str) -> Prompt
Fetch one record from the prompts and prompt versions surface identified by agent_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Prompt
Raises:
create(name: str, template: str, *, commit_message: str | None = None) -> Any
Register a prompt and its first version.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
template | positional-or-keyword | str | — | |
commit_message | keyword-only | `str | None` | None |
Returns: Any
Raises:
versions(agent_id: str) -> Any
Every registered version, newest first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Any
Raises:
register_version(agent_id: str, template: str, *, commit_message: str | None = None) -> Any
Add a version without touching the live alias.
The alias is rotated separately by :meth:promote, so authoring is never a deployment — the property the whole refinement loop depends on.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
agent_id | positional-or-keyword | str | — | |
template | positional-or-keyword | str | — | |
commit_message | keyword-only | `str | None` | None |
Returns: Any
Raises:
promote(agent_id: str, version: int, *, alias: str = 'prod') -> Any
Point an alias at a version. This is the deployment step.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
version | positional-or-keyword | int | — |
alias | keyword-only | str | 'prod' |
Returns: Any
Raises:
rollback(name: str, *, alias: str = 'prod') -> Any
Rotate the alias back to the version that was live before the current one, read from the promotion audit trail.
Raises :class:~caliber_sdk.CaliberConflictError (409) when there is no recorded prior live version to restore.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
alias | keyword-only | str | 'prod' |
Returns: Any
Raises:
set_baseline(name: str, *, test_run_id: str) -> Any
Pin a prompt test run as the comparison baseline for future runs.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
test_run_id | keyword-only | str | — |
Returns: Any
Raises:
bind(name: str, *, kind: str, **params) -> Any
Record where a prompt is wired in.
`kind is "agent" (requires agent_id=), "workflow_node" (requires workflow_id= and node_id=), or "standalone"`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
kind | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
delete(name: str) -> Any
Delete a prompt registry entry and its CALIBER-side records.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: Any
Raises:
version(name: str, version: int) -> Any
Load the full template for one specific registry version.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
version | positional-or-keyword | int | — |
Returns: Any
Raises:
workspace(name: str) -> Any
Runtime facts + computed lifecycle status (Bound > Calibrated > Tested > Has test set > Draft) for the Prompts-tab workspace view.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: Any
Raises:
test_render(agent_id: str, *, variables: dict[str, Any] | None = None) -> Any
Render a deployed prompt template with caller-supplied variables.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
agent_id | positional-or-keyword | str | — | |
variables | keyword-only | `dict[str, Any] | None` | None |
Returns: Any
Raises:
template_library() -> Any
The prompt-builder catalog (base templates + modifiers) used by the Create Prompt flow.
This callable takes no public parameters.
Returns: Any
Raises:
preview_template(*, base_template_id: str, **params) -> Any
Compile a prompt-builder recipe into a single prompt + validation report, without creating anything. `params may carry modifier_ids, builder_values, preview_variables, runtime_variables, template_override, section_overrides`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
base_template_id | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
calibration_options() -> Any
Optimizer/scorer capabilities for a manual calibration run.
This callable takes no public parameters.
Returns: Any
Raises:
optimization_options() -> Any
Alias of :meth:calibration_options -- the server backs both URLs with the same handler; both are modelled so a caller reaching for either name finds it.
This callable takes no public parameters.
Returns: Any
Raises:
create_calibration_run(**payload) -> Any
Queue a manual prompt calibration run. `payload requires agent_id, eval_dataset_id, optimizer_type, and scorers; see :meth:calibration_options` for what's available.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | var-keyword | Any | — |
Returns: Any
Raises:
create_optimization_run(**payload) -> Any
Alias of :meth:create_calibration_run -- same handler, the other URL.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | var-keyword | Any | — |
Returns: Any
Raises:
create_test_run(*, agent_id: str, results: Sequence[dict[str, Any]], **params) -> Any
Persist a completed prompt-test run. `results` is the per-case list; the server recomputes pass/fail/partial counts and the overall score from it rather than trusting client-supplied aggregates.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | keyword-only | str | — |
results | keyword-only | Sequence[dict[str, Any]] | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
test_runs(**params) -> Any
Run history summaries, newest first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
test_run(test_run_id: str) -> Any
One run's full per-case results.
| Parameter | Kind | Type | Default |
|---|---|---|---|
test_run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
SkillsAPI
class SkillsAPI()
Skill registry, rendering, selection testing, and versions.
Related APIs: JudgesAPI, EvaluationsAPI
Methods
list(*, status: str | None = None, tag: str | None = None) -> list[Skill]
Return the current collection of skills, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
tag | keyword-only | `str | None` | None |
Returns: list[Skill]
Raises:
get(skill_id: str) -> Skill
Fetch one record from the skills surface identified by skill_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: Skill
Raises:
create(name: str, *, content: str, owner: str, summary: str | None = None, description: str | None = None, tags: Sequence[str] | None = None) -> Skill
Create a skill.
`owner` is required by the server and is therefore keyword-required here rather than defaulted to the caller's identity: a skill's owner is a governance field, and quietly inferring it would make authorship an accident of which credential happened to run the script.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
content | keyword-only | str | — | |
owner | keyword-only | str | — | |
summary | keyword-only | `str | None` | None |
description | keyword-only | `str | None` | None |
tags | keyword-only | `Sequence[str] | None` | None |
Returns: Skill
Raises:
update(skill_id: str, **changes) -> Skill
Patch an existing record on the skills surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Skill
Raises:
render(skill_id: str, *, variables: dict[str, Any] | None = None) -> SkillRender
Substitute `{{variables}}` and report what was left unresolved.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
skill_id | positional-or-keyword | str | — | |
variables | keyword-only | `dict[str, Any] | None` | None |
Returns: SkillRender
Raises:
test_selection(skill_id: str, query: str) -> SkillSelection
Would this skill be auto-selected for this query?
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
query | positional-or-keyword | str | — |
Returns: SkillSelection
Raises:
versions(skill_id: str) -> list[SkillVersion]
Operate on the skills surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: list[SkillVersion]
Raises:
rollback(skill_id: str) -> Any
Restore the immediately-prior content snapshot as a new version (skills are forward-only; this never rewrites history). Raises :class:~caliber_sdk.CaliberConflictError (409) when there is no earlier version to restore.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: Any
Raises:
set_baseline(skill_id: str, *, test_run_id: str) -> Any
Pin a skill test run as the comparison baseline for future runs.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
test_run_id | keyword-only | str | — |
Returns: Any
Raises:
bind(skill_id: str, *, kind: str, **params) -> Any
Record where a skill is wired in.
`kind is "agent" (requires agent_id=, adds the skill's name to that agent's referenced skills), "workflow_node", or "standalone"`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
kind | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
calibrate(skill_id: str, **options) -> Any
Agent-free calibration front door: queues a refinement job against a hidden, auto-provisioned target rather than requiring an operator to pick an agent first. `options may carry optimizer_type and notes. Distinct from :meth:ToolsAPI.calibrate -- a skill calibration produces a verification item and refinement job, not a standalone :class:~caliber_sdk.models.CalibrationJob`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
workspace(skill_id: str) -> Any
Runtime facts for the Skills-tab workspace view.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: Any
Raises:
package(skill_id: str) -> Any
Preview the OpenAI-compatible package (`SKILL.md + agents/openai.yaml + bundled resources) generated for a skill. Read-only; malformed resource metadata surfaces as warnings` rather than failing, so the preview still shows what can be generated.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: Any
Raises:
package_zip(skill_id: str) -> bytes
Download the generated package as a ZIP archive.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | positional-or-keyword | str | — |
Returns: bytes
Raises:
import_package(files: Sequence[dict[str, Any]], *, owner: str, **options) -> Any
Create a skill from an OpenAI-style package.
`files is a list of {"path": ..., "content": ...} objects (one SKILL.md with kebab-case name frontmatter, resources only under scripts//references//assets/). options may carry category, tags, skill_metadata, allowed_tools, depends_on -- caller skill_metadata` is merged over the parsed package metadata, never replacing it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
files | positional-or-keyword | Sequence[dict[str, Any]] | — |
owner | keyword-only | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
import_package_zip(filename: str, content: bytes, *, conflict_strategy: str = 'reject', rename_to: str | None = None) -> Any
Import a ZIP package directly. Multipart, so it does not go through the JSON path.
`conflict_strategy is "reject" (default), "rename" (requires rename_to, a kebab-case name), or "merge"` (admin-only, forward-versioned update of an existing skill).
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
filename | positional-or-keyword | str | — | |
content | positional-or-keyword | bytes | — | |
conflict_strategy | keyword-only | str | 'reject' | |
rename_to | keyword-only | `str | None` | None |
Returns: Any
Raises:
create_test_run(*, skill_id: str, results: Sequence[dict[str, Any]], **params) -> Any
Persist a completed skill-test run. `results` is the per-case list; the server recomputes pass/fail/partial counts and the overall score from it rather than trusting client-supplied aggregates.
| Parameter | Kind | Type | Default |
|---|---|---|---|
skill_id | keyword-only | str | — |
results | keyword-only | Sequence[dict[str, Any]] | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
test_runs(**params) -> Any
Run history summaries, newest first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
test_run(test_run_id: str) -> Any
One run's full per-case results.
| Parameter | Kind | Type | Default |
|---|---|---|---|
test_run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
ToolsAPI
class ToolsAPI()
Tool registry, fixtures, and calibration.
Methods
list(*, status: str | None = None) -> list[Tool]
Return the current collection of tools and calibration cases, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Tool]
Raises:
get(tool_id: str) -> Tool
Fetch one record from the tools and calibration cases surface identified by tool_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: Tool
Raises:
register(name: str, *, version: str, module_path: str, callable_name: str, input_schema: dict[str, Any] | None = None, output_schema: dict[str, Any] | None = None, **options) -> Tool
Operate on the tools and calibration cases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
version | keyword-only | str | — | |
module_path | keyword-only | str | — | |
callable_name | keyword-only | str | — | |
input_schema | keyword-only | `dict[str, Any] | None` | None |
output_schema | keyword-only | `dict[str, Any] | None` | None |
options | var-keyword | Any | — |
Returns: Tool
Raises:
update(tool_id: str, **changes) -> Tool
Patch an existing record on the tools and calibration cases surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Tool
Raises:
calibrate(tool_id: str, **options) -> CalibrationJob
Score every saved test case now and return the aggregate.
Synchronous -- this call blocks until all cases finish (the server's own docstring for this route calls it "score saved test cases", not a queue). The response has no `job_id/status, so those fields decode to their defaults; pass_rate is real, and total/passed/cases/ran_at land in .extra. For two hundred cases this holds a connection open for minutes -- use :meth:submit_calibration_job + :meth:wait_for_calibration` for the durable, poll-instead-of-block form.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: CalibrationJob
Raises:
submit_calibration_job(tool_id: str) -> CalibrationJob
Queue a calibration run against the tool's saved test cases.
Returns immediately (202) with a real `job_id to poll via :meth:calibration_job or :meth:wait_for_calibration -- the durable counterpart to :meth:calibrate`, for a case count large enough that holding a connection open is the wrong trade.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: CalibrationJob
Raises:
resolve_calibration_job(tool_id: str, job_id: str, *, action: str, reason: str) -> Any
Abandon or explicitly retry an ambiguously `running` job.
`action is "abandon" or "retry"; reason` is required (a non-empty resolution reason). Automatic requeue is unsafe because an authored tool may have side effects -- this is the operator decision that a stuck job needs.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
action | keyword-only | str | — |
reason | keyword-only | str | — |
Returns: Any
Raises:
calibration_job(tool_id: str, job_id: str) -> CalibrationJob
Operate on the tools and calibration cases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
Returns: CalibrationJob
Raises:
calibration_jobs(tool_id: str) -> list[CalibrationJob]
Operate on the tools and calibration cases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: list[CalibrationJob]
Raises:
wait_for_calibration(tool_id: str, job_id: str, *, timeout: float = 600.0, **options) -> CalibrationJob
Poll a calibration job (from :meth:submit_calibration_job) until it stops.
Returns the terminal job rather than raising on failure: a failed calibration is a result to inspect, not an error in the call.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 600.0 |
options | var-keyword | Any | — |
Returns: CalibrationJob
Raises:
archive(tool_id: str) -> Tool
Retire a tool. Refuses (409) while an active workflow deployment still references it -- undeploy first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: Tool
Raises:
set_baseline(tool_id: str, *, test_run_id: str) -> Any
Pin a persisted tool-test run as the comparison baseline. The run must belong to this tool.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
test_run_id | keyword-only | str | — |
Returns: Any
Raises:
source(tool_id: str) -> Any
The tool callable's real source, signature, and docstring. `available=False (with an error`) for a non-Python-callable execution backend -- there is no source to show.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: Any
Raises:
usage(tool_id: str) -> Any
Workflow versions that reference this tool, scoped to the caller's visible workflows. Meant to warn before deprecate/archive.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: Any
Raises:
versions(tool_id: str) -> list[Tool]
Every version in this tool's family (same `name`), newest first. Tools have no live alias to promote/roll back -- this is a read-only history, not a release surface.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: list[Tool]
Raises:
workspace(tool_id: str) -> Any
Runtime facts + computed lifecycle status (Published > Hardened > Tested > Has fixtures > Draft) for the Tools-tab workspace view.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
Returns: Any
Raises:
save_test_cases(tool_id: str, test_cases: Sequence[dict[str, Any]]) -> Any
Persist the saved fixture set a calibration run scores against. Replaces the whole set (not a merge).
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | positional-or-keyword | str | — |
test_cases | positional-or-keyword | Sequence[dict[str, Any]] | — |
Returns: Any
Raises:
test_invoke(tool_id: str, *, input: dict[str, Any] | None = None) -> Any
Invoke the tool once under preview effect policy: `write/ external_action tools are always mocked; read tools run live only when allow_in_preview is set. Not durable -- for a recorded run, see :meth:create_test_run`.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
tool_id | positional-or-keyword | str | — | |
input | keyword-only | `dict[str, Any] | None` | None |
Returns: Any
Raises:
create_test_run(*, tool_id: str, results: Sequence[dict[str, Any]], **params) -> Any
Persist a completed tool-test run. `results` is the per-case list; the server recomputes pass/fail/partial counts and the overall score from it rather than trusting client-supplied aggregates.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tool_id | keyword-only | str | — |
results | keyword-only | Sequence[dict[str, Any]] | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
test_runs(**params) -> Any
Run history summaries, newest first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
test_run(test_run_id: str) -> Any
One run's full per-case results.
| Parameter | Kind | Type | Default |
|---|---|---|---|
test_run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
AgentsAPI
class AgentsAPI()
The agent record — the anchor a verification item, refinement job, approval, and rollback checkpoint all hang off of.
Methods
list() -> list[Agent]
Return the current collection of agents, applying any supported filters.
This callable takes no public parameters.
Returns: list[Agent]
Raises:
get(agent_id: str) -> Agent
Fetch one record from the agents surface identified by agent_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Agent
Raises:
create(agent_id: str, *, experiment_id: str, name: str, **options) -> Agent
Register a new agent. `agent_id and experiment_id are both one-shot: identity is fixed at registration (re-keying means delete + re-create, so the audit trail stays clean), and a re-used experiment_id` is a 409 (unique per agent).
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
experiment_id | keyword-only | str | — |
name | keyword-only | str | — |
options | var-keyword | Any | — |
Returns: Agent
Raises:
update(agent_id: str, **changes) -> Agent
Partial update. `enabled=False` is the pause lever the refinement worker reads before claiming a queued job for this agent.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Agent
Raises:
delete(agent_id: str) -> bool
Remove an agent and cascade its dependent verification/refinement/ approval/checkpoint/regression rows in one transaction.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: bool
Raises:
skills(agent_id: str) -> Any
Skills this agent references in its `optimizer_config, plus any cited name that didn't resolve (missing) -- e.g. an archived or renamed skill an agent still points at. Left untyped: it nests Skill`-shaped records inside a response envelope this SDK doesn't otherwise model, and the two-key shape is simple enough to read off the dict directly.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Any
Raises:
experiment(agent_id: str) -> Any
Whether this agent's configured MLflow experiment is actually reachable. Left untyped: the server itself keeps this shape open (`ExperimentBindingSchema` allows extra fields) because it reflects whatever MLflow reports, not a fixed CALIBER contract.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Any
Raises:
checkpoints(agent_id: str) -> Any
Rollback checkpoints for this agent, newest first.
Left untyped: the checkpoint shape (`RollbackCheckpointSchema`) is the promoter's internal record, not a governed contract, and every artifact type serializes its own version fields into it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
Returns: Any
Raises:
rollback(agent_id: str, *, checkpoint_id: str | None = None) -> Any
Roll this agent's live artifact back to a prior version.
Without `checkpoint_id, rolls back to the most recent unused checkpoint — the "undo the last promotion" affordance. Raises :class:~caliber_sdk.CaliberConflictError` (409) if the checkpoint was already rolled back or claimed by a concurrent call.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
agent_id | positional-or-keyword | str | — | |
checkpoint_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
Module caliber_sdk.resources.workflows
Workflows, versions, runs, deployments, and services.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
PlaygroundRunsAPI, WorkflowBenchmarkReportsAPI, WorkflowPromotionsAPI, WorkflowRunFailed, WorkflowRunsAPI, WorkflowServicesAPI, WorkflowVersionsAPI, WorkflowsAPI
Classes
WorkflowRunFailed
class WorkflowRunFailed(run: WorkflowRun)
Bases: CaliberError
A run reached a terminal state that is not success.
Constructor
__init__(run: WorkflowRun) -> None
Operate on the workflow run failed surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run | positional-or-keyword | WorkflowRun | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
run | Any | — |
WorkflowVersionsAPI
class WorkflowVersionsAPI()
Immutable manifest snapshots of one workflow.
Related APIs: WorkflowsAPI, WorkflowRunsAPI, WorkflowServicesAPI
Methods
list(workflow_id: str) -> list[WorkflowVersion]
Return the current collection of workflow versions, applying any supported filters.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: list[WorkflowVersion]
Raises:
get(version_id: str) -> WorkflowVersion
Fetch one record from the workflow versions surface identified by version_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: WorkflowVersion
Raises:
create(workflow_id: str, manifest: dict[str, Any]) -> WorkflowVersion
Register a draft version. Drafts are not runnable until published.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
manifest | positional-or-keyword | dict[str, Any] | — |
Returns: WorkflowVersion
Raises:
validate(version_id: str) -> Any
Validation report for a version's manifest.
Returned untyped on purpose: the report is produced by the server's validator, and a schema here would be a second definition of a contract that lives there.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
compile(version_id: str) -> Any
Ask the server to compile the draft workflow or asset into its executable form.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
publish(version_id: str) -> WorkflowVersion
Promote the draft or version into the published state used by operators or runtime callers.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: WorkflowVersion
Raises:
update(version_id: str, *, manifest: dict[str, Any], manifest_hash: str) -> WorkflowVersion
Edit a draft version's manifest. `manifest_hash` must match the version's current hash (optimistic concurrency) -- a mismatch is a 409, meaning reload before editing. Published versions refuse (409): they are immutable.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
manifest | keyword-only | dict[str, Any] | — |
manifest_hash | keyword-only | str | — |
Returns: WorkflowVersion
Raises:
restore(version_id: str) -> WorkflowVersion
Clone any prior version's manifest into a new editable draft. History is preserved -- the source version is untouched.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: WorkflowVersion
Raises:
diff(version_id: str, other_version_id: str) -> Any
Structured, order-independent graph diff. `version_id is the base (older/left); other_version_id` is the candidate (newer/ right) -- oriented so added/removed read naturally comparing v(n-1) -> v(n).
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
other_version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
export_manifest(version_id: str) -> str
The version's manifest as YAML text (not JSON -- the server returns `application/x-yaml` directly, so this downloads raw bytes rather than going through the envelope path).
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: str
Raises:
export_python(version_id: str) -> str
The version compiled to standalone Python source (text, not JSON). Prefers the immutable stored bundle for a published version, so the export is byte-identical to what was compiled/approved.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: str
Raises:
export_deployment_bundle(version_id: str) -> dict[str, Any]
Download and decode the integrity-sealed deployment bundle.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: dict[str, Any]
Raises:
CaliberAPIErrorCaliberTransportErrorValueError
deployment_bundle_status(version_id: str) -> Any
Integrity and dependency-readiness status for one version bundle.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
preview_run(version_id: str, *, input = None, session_id: str | None = None, **params) -> Any
Run the version in preview mode: real tool bindings are not used. For a real, persisted run see :meth:run or `client.workflows.runs. params may carry manifest` to preview an unsaved edit before it is written to a version.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
version_id | positional-or-keyword | str | — | |
input | keyword-only | Any | None | |
session_id | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
run(version_id: str, *, input = None, alias: str | None = None, **params) -> Any
Execute the version as a real, persisted manual run -- real tool bindings and the configured executor, unlike :meth:preview_run.
A `manifest override in params is only accepted when alias is "manual"` (the default): a deployed alias always executes its immutable saved version.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
version_id | positional-or-keyword | str | — | |
input | keyword-only | Any | None | |
alias | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
propose_patch(version_id: str, *, evidence: dict[str, Any], job_id: str | None = None) -> Any
Generate a patch candidate from failure evidence: localizes the failure, generates semantic patch ops, compiles the candidate, and persists it for the approval UI. Returns the diagnosis, patch, graph diff, and candidate validation report -- nothing is applied automatically.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
version_id | positional-or-keyword | str | — | |
evidence | keyword-only | dict[str, Any] | — | |
job_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
copilot_edit(version_id: str, *, instruction: str, manifest: dict[str, Any] | None = None) -> Any
Propose a natural-language edit to the manifest. Nothing is persisted -- apply an accepted proposal through :meth:update. With the default `fake` LLM provider the manifest comes back unchanged (a safe no-op).
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
version_id | positional-or-keyword | str | — | |
instruction | keyword-only | str | — | |
manifest | keyword-only | `dict[str, Any] | None` | None |
Returns: Any
Raises:
plan_build(version_id: str, *, goal: str, manifest: dict[str, Any] | None = None) -> Any
Author a manifest from a plain-language goal -- the blank-slate sibling of :meth:copilot_edit. Nothing is persisted.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
version_id | positional-or-keyword | str | — | |
goal | keyword-only | str | — | |
manifest | keyword-only | `dict[str, Any] | None` | None |
Returns: Any
Raises:
WorkflowRunsAPI
class WorkflowRunsAPI()
Executions, and waiting on them.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Related APIs: WorkflowsAPI, WorkflowVersionsAPI, WorkflowServicesAPI
Methods
list(workflow_id: str, *, status: str | None = None) -> list[WorkflowRun]
Runs of one workflow.
Scoped to a workflow because the server has no unscoped run listing: `/workflow-runs` is POST-only (submission). An SDK method implying otherwise returned 405 at runtime, which is how this was found.
This route's envelope carries pagination metadata alongside the list (`{"data": [...], "next_cursor": ...}), which the transport's generic unwrap deliberately leaves untouched -- it only strips a *bare* {"data": ...} shape, precisely so an unenveloped body (the OpenAPI document) is never mistaken for one. Left to the generic unwrap, this method always decoded an empty list against the real server regardless of how many runs existed -- caught only by an end-to-end test against a real response, since every mocked test supplied the bare shape. payload["data"]` is pulled explicitly here until AD-5's uniform pagination contract lands and gives every list method one shared way to do this.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
Returns: list[WorkflowRun]
Raises:
get(run_id: str) -> WorkflowRun
Fetch one record from the workflow runs surface identified by run_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
submit(*, workflow_version_id: str | None = None, workflow_id: str | None = None, alias: str | None = None, input = None, idempotency_key: str | None = None, **options) -> WorkflowRun
Queue a run. Returns immediately with a run to poll.
A run targets either a specific version or a workflow plus a deployment alias — the server accepts both, and forcing one here would make the alias path unreachable, which is how a deployed workflow is invoked.
`idempotency_key` is passed through because submission is the one mutating call the SDK cannot safely retry on its own.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_version_id | keyword-only | `str | None` | None |
workflow_id | keyword-only | `str | None` | None |
alias | keyword-only | `str | None` | None |
input | keyword-only | Any | None | |
idempotency_key | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
cancel(run_id: str) -> WorkflowRun
Operate on the workflow runs surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
wait(run_id: str, *, timeout: float = 900.0, raise_on_failure: bool = True, **options) -> WorkflowRun
Poll until the run stops.
Raises by default, unlike calibration: a script that submitted work and got a failure almost always wants to stop, whereas a calibration score is the thing being measured. Pass `raise_on_failure=False` to inspect instead.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
raise_on_failure | keyword-only | bool | True |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
by_trace(trace_id: str) -> WorkflowRun
Look up the run that produced a given MLflow trace id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
trace_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
resume_by_event(**payload) -> Any
Resume whichever paused run is waiting on the given external event, without knowing its run id up front.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | var-keyword | Any | — |
Returns: Any
Raises:
resume(run_id: str, **payload) -> Any
Resume a run paused at a checkpoint (e.g. a Human Approval node once :meth:approve has recorded the decision).
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
retry(run_id: str, **payload) -> Any
Retry a failed run from its last durable checkpoint rather than from the start.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
events(run_id: str, **params) -> Any
The run's event tail. `params may carry after/limit` for incremental polling.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
trace(run_id: str) -> Any
The run's full MLflow span tree, left untyped: the node structure is MLflow's, and re-declaring it here would drift from it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
lineage(run_id: str) -> Any
The chain of parent/child runs this run belongs to (resume and retry both create a new run linked back to the original).
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
manifest(run_id: str) -> Any
The exact manifest snapshot this run executed against -- not the version's current manifest, which may have changed since.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
checkpoints(run_id: str, **params) -> Any
Durable checkpoints recorded during this run, newest first. `params may carry after/limit`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
approvals(run_id: str) -> Any
Human Approval checkpoints this run has raised, pending or decided.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
approve(run_id: str, **payload) -> Any
Approve a pending Human Approval checkpoint. The run does not resume automatically -- call :meth:resume after.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
reject(run_id: str, **payload) -> Any
Reject a pending Human Approval checkpoint.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
files(run_id: str, **params) -> Any
Files recorded for this run, hiding pending/rejected/deleted rows. `params may carry kind`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
upload_file(run_id: str, filename: str, content: bytes, *, kind: str = 'output', media_type: str | None = None) -> Any
Upload a file into this run's namespace. Multipart, so it does not go through the JSON path.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
run_id | positional-or-keyword | str | — | |
filename | positional-or-keyword | str | — | |
content | positional-or-keyword | bytes | — | |
kind | keyword-only | str | 'output' | |
media_type | keyword-only | `str | None` | None |
Returns: Any
Raises:
file(run_id: str, file_id: str) -> Any
One file's metadata record (not its bytes -- see :meth:file_content).
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: Any
Raises:
file_content(run_id: str, file_id: str) -> bytes
Download a run file's raw bytes.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bytes
Raises:
register_artifact(run_id: str, *, file_id: str, **params) -> Any
Promote an existing run file to a registered artifact. `params may carry artifact_type, display_name, summary, producer_node_id`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
file_id | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
PlaygroundRunsAPI
class PlaygroundRunsAPI()
Files for an ad-hoc sandbox preview run -- the prompt/skill/tool "try it" playground, not a real persisted workflow run. Same file lifecycle shape as `client.workflows.runs (list/upload/download), a separate class because the server keys the namespace by run_id` outside any workflow.
Methods
files(run_id: str, **params) -> Any
Operate on the playground runs surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
upload_file(run_id: str, filename: str, content: bytes, *, kind: str = 'output', media_type: str | None = None) -> Any
Multipart, so it does not go through the JSON path.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
run_id | positional-or-keyword | str | — | |
filename | positional-or-keyword | str | — | |
content | positional-or-keyword | bytes | — | |
kind | keyword-only | str | 'output' | |
media_type | keyword-only | `str | None` | None |
Returns: Any
Raises:
file_content(run_id: str, file_id: str) -> bytes
Download a playground file's raw bytes.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bytes
Raises:
WorkflowServicesAPI
class WorkflowServicesAPI()
Workflows published as external HTTP services.
The server splits this in two, and so does this class. Management lives under `/workflows/{id}/service — configuring and publishing is a property of the workflow. *Invocation* lives under /services/{id}` — that is the external surface, authenticated by per-service tokens rather than a user credential.
There is no unscoped service listing; a service is reached through its workflow. An earlier version of this class invented `GET /services` and returned 404 at runtime.
Related APIs: WorkflowsAPI, WorkflowVersionsAPI
Methods
get(workflow_id: str) -> WorkflowService
Fetch one record from the workflow services surface identified by workflow_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: WorkflowService
Raises:
publish(workflow_id: str, **options) -> WorkflowService
Promote the draft or version into the published state used by operators or runtime callers.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: WorkflowService
Raises:
unpublish(workflow_id: str) -> bool
Remove the published state from the targeted runtime asset.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: bool
Raises:
openapi(workflow_id: str) -> Any
The per-workflow OpenAPI document the service surface publishes.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
invoke(workflow_id: str, payload = None, **options) -> Any
Call a published service.
The external surface: in production this is authenticated by a per-service token rather than the user credential the rest of this client carries.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
payload | positional-or-keyword | Any | None |
options | var-keyword | Any | — |
Returns: Any
Raises:
management_openapi(workflow_id: str) -> Any
The same OpenAPI spec :meth:openapi serves, but read through CALIBER's own session auth instead of a service token -- for an operator inspecting the contract without minting a token first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
tokens(workflow_id: str) -> Any
Service tokens issued for this workflow's published service.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create_token(workflow_id: str, **options) -> Any
Mint a new service token. The plaintext secret is returned once and never shown again -- store it immediately.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
revoke_token(workflow_id: str, token_id: str) -> Any
Operate on the workflow services surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
token_id | positional-or-keyword | str | — |
Returns: Any
Raises:
run_status(workflow_id: str, run_id: str) -> Any
Poll a run submitted through the external service surface, under the same token-authorization policy as the original invocation.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
WorkflowPromotionsAPI
class WorkflowPromotionsAPI()
Approve or reject a pending deployment-alias promotion.
A promotion is created by `deployments.promote on a gated alias (see ARCHITECTURE.md §4) and sits pending until an approver scope acts on it. There is no listing method here yet -- GET /workflows/{id}/promotions` is covered by a follow-up wave.
Methods
approve(promotion_id: str, *, reason: str | None = None, **params) -> Any
Operate on the workflow promotions surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
promotion_id | positional-or-keyword | str | — | |
reason | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
reject(promotion_id: str, *, reason: str | None = None, **params) -> Any
Operate on the workflow promotions surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
promotion_id | positional-or-keyword | str | — | |
reason | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
WorkflowBenchmarkReportsAPI
class WorkflowBenchmarkReportsAPI()
Saved bakeoff/benchmark scorecards -- an evidence record, not a per-workflow child; reports are not scoped to one workflow's own id.
Methods
list(*, status: str = 'all') -> Any
Return the current collection of workflow benchmark reports, applying any supported filters.
| Parameter | Kind | Type | Default |
|---|---|---|---|
status | keyword-only | str | 'all' |
Returns: Any
Raises:
create(*, name: str, worksheet: dict[str, Any], **options) -> Any
Create a new record on the workflow benchmark reports surface and return the server-normalized result.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | keyword-only | str | — |
worksheet | keyword-only | dict[str, Any] | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
update(report_id: str, **changes) -> Any
Patch an existing record on the workflow benchmark reports surface and return the updated result.
| Parameter | Kind | Type | Default |
|---|---|---|---|
report_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Any
Raises:
delete(report_id: str) -> Any
Delete a record on the workflow benchmark reports surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
report_id | positional-or-keyword | str | — |
Returns: Any
Raises:
WorkflowsAPI
class WorkflowsAPI(transport)
Workflows, plus versions, runs, services, promotions, and benchmark reports as sub-resources.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Related APIs: WorkflowVersionsAPI, WorkflowRunsAPI, WorkflowServicesAPI
Constructor
__init__(transport) -> None
Operate on the workflows surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
versions | WorkflowVersionsAPI | — |
runs | WorkflowRunsAPI | — |
services | WorkflowServicesAPI | — |
promotions | WorkflowPromotionsAPI | — |
benchmark_reports | WorkflowBenchmarkReportsAPI | — |
Methods
list(*, status: str | None = None) -> list[Workflow]
Return the current collection of workflows, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Workflow]
Raises:
get(workflow_id: str) -> Workflow
Fetch one record from the workflows surface identified by workflow_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Workflow
Raises:
create(name: str, *, description: str | None = None, **options) -> Workflow
Create a new record on the workflows surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
description | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: Workflow
Raises:
update(workflow_id: str, **changes) -> Workflow
Patch an existing record on the workflows surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Workflow
Raises:
delete(workflow_id: str) -> Any
Delete a record on the workflows surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
patches(workflow_id: str) -> Any
Proposed patch candidates (from `versions.propose_patch`) for this workflow's approval UI.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
import_workflow(*, manifest: dict[str, Any] | None = None, manifest_yaml: str | None = None, deployment_bundle: dict[str, Any] | None = None, name: str | None = None, owner: str | None = None) -> Workflow
Import a manifest as a new, independently-owned workflow. The source `workflow_id/owner` inside the manifest are never trusted -- a fresh id is generated server-side and the caller's identity becomes the owner. 409 on a name clash; 400 if graph/ dependency preflight fails.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
manifest | keyword-only | `dict[str, Any] | None` | None |
manifest_yaml | keyword-only | `str | None` | None |
deployment_bundle | keyword-only | `dict[str, Any] | None` | None |
name | keyword-only | `str | None` | None |
owner | keyword-only | `str | None` | None |
Returns: Workflow
Raises:
preview_import(*, manifest: dict[str, Any] | None = None, manifest_yaml: str | None = None, deployment_bundle: dict[str, Any] | None = None, name: str | None = None, owner: str | None = None) -> Any
Validate and resolve an import without creating anything -- reports `ready_to_import plus the validation/dependency detail :meth:import_workflow` would otherwise fail on.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
manifest | keyword-only | `dict[str, Any] | None` | None |
manifest_yaml | keyword-only | `str | None` | None |
deployment_bundle | keyword-only | `dict[str, Any] | None` | None |
name | keyword-only | `str | None` | None |
owner | keyword-only | `str | None` | None |
Returns: Any
Raises:
calibration_options(workflow_id: str) -> Any
Objectives, protected-node rules, budgets, and move-set choices available for a manual workflow calibration run.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create_calibration_run(workflow_id: str, *, agent_id: str, **params) -> Any
Queue a manual workflow calibration run. `params may carry objective, protected, budget, dataset, move_set; see :meth:calibration_options` for what's available.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
agent_id | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
deployments(workflow_id: str) -> Any
Active deployment-alias -> version bindings for this workflow.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
promote_deployment(workflow_id: str, alias: str, *, version_id: str, **params) -> Any
Point a deployment alias at a version. On a gated alias this creates a pending promotion instead of rotating immediately -- see `client.workflows.promotions`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
alias | positional-or-keyword | str | — |
version_id | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
rollback_deployment(workflow_id: str, alias: str, **params) -> Any
Pop the deployment's checkpoint stack, restoring the prior version on this alias.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
alias | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
list_promotions(workflow_id: str) -> Any
Pending and historical promotions for this workflow. To act on one, see `client.workflows.promotions.approve/.reject -- named list_promotions (not promotions) because that name is already the WorkflowPromotionsAPI` sub-resource.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
Returns: Any
Raises:
runs_stats(workflow_id: str, **params) -> Any
Aggregate run counts/latencies for this workflow, for the dashboard summary tiles.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
trigger(workflow_id: str, **payload) -> Any
Start a run from an external event (a Start-trigger node in `mode: event). payload may carry alias, event_name, input, idempotency_key`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
workflow_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
session_memory(workflow_id: str, *, session_id: str, node_id: str | None = None) -> Any
Read a session's accumulated workflow memory. `session_id is required; node_id` narrows to one memory-writing node.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_id | positional-or-keyword | str | — | |
session_id | keyword-only | str | — | |
node_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
clear_session_memory(workflow_id: str, *, session_id: str, node_id: str | None = None) -> Any
Operate on the workflows surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_id | positional-or-keyword | str | — | |
session_id | keyword-only | str | — | |
node_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
components() -> Any
The Studio node-palette catalog: every built-in component type and its typed input/output ports.
This callable takes no public parameters.
Returns: Any
Raises:
templates() -> Any
The starter-manifest catalog used by "New workflow from template".
This callable takes no public parameters.
Returns: Any
Raises:
cron_preview(*, expr: str, tz: str = 'UTC', count: int = 5) -> Any
Next fire times for a Start-trigger cron expression. Read-only, no workflow required -- powers the Studio trigger panel's preview.
| Parameter | Kind | Type | Default |
|---|---|---|---|
expr | keyword-only | str | — |
tz | keyword-only | str | 'UTC' |
count | keyword-only | int | 5 |
Returns: Any
Raises:
upload_staging_file(filename: str, content: bytes, *, kind: str = 'input', media_type: str | None = None, session_id: str | None = None) -> Any
Upload a file before any run exists -- a manual-run input staged ahead of :meth:WorkflowVersionsAPI.run, not yet bound to a `workflow_run_id`. Multipart, so it does not go through the JSON path.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
filename | positional-or-keyword | str | — | |
content | positional-or-keyword | bytes | — | |
kind | keyword-only | str | 'input' | |
media_type | keyword-only | `str | None` | None |
session_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
Module caliber_sdk.resources.quality
Datasets, judges, evaluations, and verification — the evidence and scoring surfaces.
Tested example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.eval_datasets.create("intake-golden", owner=owner)
caliber.eval_datasets.add_example(
dataset.dataset_id,
input={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
# A judge is selected as a scorer by name (``Judge.<id>``), not by a bare
# ``judge_id`` field -- the request schema has no such field and rejects it.
evaluation = caliber.evaluations.create(dataset.dataset_id, scorers=[f"Judge.{judge.judge_id}"])
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Public exports
EvalDatasetsAPI, EvaluationsAPI, JudgesAPI, VerificationQueueAPI
Classes
EvalDatasetsAPI
class EvalDatasetsAPI()
Versioned evaluation datasets and their examples.
Usage example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.eval_datasets.create("intake-golden", owner=owner)
caliber.eval_datasets.add_example(
dataset.dataset_id,
input={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
# A judge is selected as a scorer by name (``Judge.<id>``), not by a bare
# ``judge_id`` field -- the request schema has no such field and rejects it.
evaluation = caliber.evaluations.create(dataset.dataset_id, scorers=[f"Judge.{judge.judge_id}"])
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Related APIs: EvaluationsAPI, JudgesAPI, ReviewQueuesAPI
Methods
list(*, status: str | None = None) -> list[EvalDataset]
Return the current collection of evaluation datasets, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[EvalDataset]
Raises:
get(dataset_id: str) -> EvalDataset
Fetch one record from the evaluation datasets surface identified by dataset_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
Returns: EvalDataset
Raises:
create(name: str, *, owner: str, description: str | None = None, **options) -> EvalDataset
Create a dataset.
`owner` is required by the server and kept keyword-required here for the same reason as skills: ownership is a governance field, not something to infer from whichever credential ran the script.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
owner | keyword-only | str | — | |
description | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: EvalDataset
Raises:
add_example(dataset_id: str, *, input, expected = None, **options) -> EvalExample
Append one labeled example row.
The parameter is `input (singular) because that is the server's field name (EvalExampleCreateRequest.input); the request schema forbids extra fields, so an inputs=` (plural) call used to 422 against a real server despite matching every mocked test.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
input | keyword-only | Any | — |
expected | keyword-only | Any | None |
options | var-keyword | Any | — |
Returns: EvalExample
Raises:
examples(dataset_id: str) -> list[EvalExample]
Return the example rows currently stored for the targeted evaluation dataset.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
Returns: list[EvalExample]
Raises:
add_from_trace(dataset_id: str, trace_id: str, **options) -> EvalExample
Capture a production trace as a dataset row.
The path that turns an observed failure into evidence, which is where the refinement loop starts.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
trace_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: EvalExample
Raises:
update(dataset_id: str, **changes) -> EvalDataset
Patch an existing record on the evaluation datasets surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: EvalDataset
Raises:
revise_example(dataset_id: str, example_id: str, *, input: dict[str, Any], expected: dict[str, Any], **params) -> EvalExample
Supersede the old row and append a replacement atomically -- append-only, so history stays reproducible. `params may carry weight, tags`. Returns the new (replacement) example.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
example_id | positional-or-keyword | str | — |
input | keyword-only | dict[str, Any] | — |
expected | keyword-only | dict[str, Any] | — |
params | var-keyword | Any | — |
Returns: EvalExample
Raises:
supersede_example(dataset_id: str, example_id: str) -> EvalExample
Retire an example without replacing it. Idempotent -- superseding an already-superseded row just returns it unchanged.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
example_id | positional-or-keyword | str | — |
Returns: EvalExample
Raises:
restore(dataset_id: str, *, version: int) -> Any
Restore a prior version's example set as a new head version (forward-only; history is preserved, not rewritten).
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
version | keyword-only | int | — |
Returns: Any
Raises:
sync(dataset_id: str, **options) -> Any
Push the dataset's current example set to MLflow's GenAI dataset registry. CALIBER stays the source of truth; this is a one-way push, not a bidirectional sync.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
JudgesAPI
class JudgesAPI()
Model-backed graders and their human alignment.
Usage example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.eval_datasets.create("intake-golden", owner=owner)
caliber.eval_datasets.add_example(
dataset.dataset_id,
input={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
# A judge is selected as a scorer by name (``Judge.<id>``), not by a bare
# ``judge_id`` field -- the request schema has no such field and rejects it.
evaluation = caliber.evaluations.create(dataset.dataset_id, scorers=[f"Judge.{judge.judge_id}"])
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Methods
list() -> list[Judge]
Return the current collection of judges and alignment assets, applying any supported filters.
This callable takes no public parameters.
Returns: list[Judge]
Raises:
get(judge_id: str) -> Judge
Fetch one record from the judges and alignment assets surface identified by judge_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
judge_id | positional-or-keyword | str | — |
Returns: Judge
Raises:
create(name: str, *, instructions: str, feedback_value_type: str = 'bool', model: str | None = None, **options) -> Judge
Create a model-backed grader.
`instructions must reference at least one evaluation variable — {{ inputs }}, {{ outputs }}, {{ expectations }}, {{ conversation }}, or {{ trace }}` — or the server rejects it. The rule exists because a judge with no variable grades nothing: it would return the same verdict for every example.
`feedback_value_type defaults to bool`. A numeric judge is not interchangeable with a boolean one downstream, so scorecards read this field to know which they have.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
instructions | keyword-only | str | — | |
feedback_value_type | keyword-only | str | 'bool' | |
model | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: Judge
Raises:
update(judge_id: str, **changes) -> Judge
Patch an existing record on the judges and alignment assets surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
judge_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Judge
Raises:
test(judge_id: str, **payload) -> Any
Run a judge against sample input (`inputs=, outputs=, expectations=) without recording a scorecard. Returns the raw {"score", "value", "rationale"} — untyped because the judge's value is author-defined (bool, number, or string; see feedback_value_type`), so a fixed model here would either narrow that or duplicate the union for no benefit over reading the dict.
| Parameter | Kind | Type | Default |
|---|---|---|---|
judge_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
alignment(judge_id: str, **payload) -> JudgeAlignment
Agreement with human labels.
Read `kappa, not agreement`: a judge that always answers the same way agrees with a skewed sample while measuring nothing.
| Parameter | Kind | Type | Default |
|---|---|---|---|
judge_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: JudgeAlignment
Raises:
EvaluationsAPI
class EvaluationsAPI()
Scored runs over datasets.
Usage example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.eval_datasets.create("intake-golden", owner=owner)
caliber.eval_datasets.add_example(
dataset.dataset_id,
input={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
# A judge is selected as a scorer by name (``Judge.<id>``), not by a bare
# ``judge_id`` field -- the request schema has no such field and rejects it.
evaluation = caliber.evaluations.create(dataset.dataset_id, scorers=[f"Judge.{judge.judge_id}"])
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Related APIs: EvalDatasetsAPI, JudgesAPI, ReviewQueuesAPI
Methods
list(*, dataset_id: str | None = None) -> list[Evaluation]
Return the current collection of evaluation runs, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
dataset_id | keyword-only | `str | None` | None |
Returns: list[Evaluation]
Raises:
get(evaluation_id: str) -> Evaluation
Fetch one record from the evaluation runs surface identified by evaluation_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
evaluation_id | positional-or-keyword | str | — |
Returns: Evaluation
Raises:
create(dataset_id: str, **options) -> Evaluation
Create a new record on the evaluation runs surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dataset_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Evaluation
Raises:
wait(evaluation_id: str, *, timeout: float = 900.0, **options) -> Evaluation
Poll until the evaluation stops.
Returns the terminal evaluation rather than raising: a low score is the measurement, not an error in the call.
| Parameter | Kind | Type | Default |
|---|---|---|---|
evaluation_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: Evaluation
Raises:
VerificationQueueAPI
class VerificationQueueAPI()
Stage ① Verify — manually-flagged concerns awaiting confirmation.
Verifying or dismissing an item here does not create a refinement job. Building that requires generalizing three separate job-creation paths (prompt/skill/workflow) behind a shared interface, which is adapter-shaped work for a later phase, not this resource. See `docs/workspace-plan.md section 2.2 and caliber/src/caliber/routes/verification.py`'s module docstring.
Methods
list(*, status: str | None = 'pending', severity: str | None = None, agent_id: str | None = None) -> list[VerificationItem]
Return the current collection of verification queue, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | 'pending' |
severity | keyword-only | `str | None` | None |
agent_id | keyword-only | `str | None` | None |
Returns: list[VerificationItem]
Raises:
get(item_id: str) -> VerificationItem
Fetch one record from the verification queue surface identified by item_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
item_id | positional-or-keyword | str | — |
Returns: VerificationItem
Raises:
create(agent_id: str, *, category: str, free_text: str, **options) -> VerificationItem
Manually flag a concern that isn't tied to an already-running job.
| Parameter | Kind | Type | Default |
|---|---|---|---|
agent_id | positional-or-keyword | str | — |
category | keyword-only | str | — |
free_text | keyword-only | str | — |
options | var-keyword | Any | — |
Returns: VerificationItem
Raises:
verify(item_id: str, **options) -> VerificationItem
Confirm the flagged concern is real.
Returns the updated item. The server's response also carries a `job key, which is always None` today — see the class docstring.
| Parameter | Kind | Type | Default |
|---|---|---|---|
item_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: VerificationItem
Raises:
dismiss(item_id: str, **options) -> VerificationItem
Mark the flagged concern as not real (or, with `duplicate_of_id`, as a duplicate of another item).
| Parameter | Kind | Type | Default |
|---|---|---|---|
item_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: VerificationItem
Raises:
mark_duplicate(item_id: str, duplicate_of_id: str, **options) -> VerificationItem
Dedicated route for "this is a duplicate of X" — same mutation as :meth:dismiss with `duplicate_of_id` set, but a distinct call makes the intent unambiguous in audit logs.
| Parameter | Kind | Type | Default |
|---|---|---|---|
item_id | positional-or-keyword | str | — |
duplicate_of_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: VerificationItem
Raises:
batch(action: str, item_ids: list[str], **options) -> VerificationBatchResult
Verify or dismiss several items in one round-trip.
Per-item failures don't fail the whole batch — inspect `result.results` for which items succeeded.
| Parameter | Kind | Type | Default |
|---|---|---|---|
action | positional-or-keyword | str | — |
item_ids | positional-or-keyword | list[str] | — |
options | var-keyword | Any | — |
Returns: VerificationBatchResult
Raises:
Module caliber_sdk.resources.integrations
MCP servers, the LLM gateway, knowledge bases, and object storage.
Tested example
def install_ready_cookbook(caliber: CaliberClient) -> dict[str, Any]:
"""Install the first cookbook whose prerequisites are already satisfied.
Readiness is checked before installing rather than after failing: the
recipe's unmet checks name what is missing, and each one that can be fixed
carries the route that fixes it.
"""
recipes = caliber.cookbooks.list()
ready = [recipe for recipe in recipes if recipe.is_ready]
if not ready:
blocked = {
recipe.id: [check.get("label") for check in recipe.unmet_checks] for recipe in recipes
}
return {"installed": None, "blocked_by": blocked}
recipe = ready[0]
result = caliber.cookbooks.install(recipe.id, name=f"{recipe.title} (SDK)")
# Installed paused, never running: an example manifest can carry model,
# connector, or side-effect bindings an operator should review first.
workflow = result.get("workflow") if isinstance(result, dict) else None
return {
"installed": recipe.id,
"workflow_status": (workflow or {}).get("status"),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
GatewayAPI, KnowledgeBasesAPI, McpServersAPI, ObjectStoreAPI, OpenApiIntegrationsAPI
Classes
McpServersAPI
class McpServersAPI()
Managed MCP server definitions and governed tool use.
Related APIs: ToolsAPI, GatewayAPI
Methods
list() -> list[McpServer]
Return the current collection of MCP servers and governed tools, applying any supported filters.
This callable takes no public parameters.
Returns: list[McpServer]
Raises:
get(server_id: str) -> McpServer
Fetch one record from the MCP servers and governed tools surface identified by server_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: McpServer
Raises:
history(server_id: str) -> Any
Return the recorded history for the targeted managed integration.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create(name: str, **options) -> McpServer
Create a new record on the MCP servers and governed tools surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: McpServer
Raises:
update(server_id: str, **changes) -> McpServer
Patch an existing record on the MCP servers and governed tools surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: McpServer
Raises:
delete(server_id: str) -> Any
Delete a record on the MCP servers and governed tools surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
test_connection(server_id: str) -> Any
Probe the server now, rather than trusting the last known state.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
discover_tools(server_id: str) -> Any
Refresh the tool inventory from the remote server.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
tools(server_id: str) -> Any
The tool inventory as last discovered.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
Returns: Any
Raises:
update_tool_policy(server_id: str, tool_name: str, **policy) -> Any
Write the policy overlay that governs one discovered tool.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
policy | var-keyword | Any | — |
Returns: Any
Raises:
save_test_cases(server_id: str, tool_name: str, test_cases: list[dict[str, Any]]) -> Any
Persist deterministic calibration cases for the targeted integration tool.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
test_cases | positional-or-keyword | list[dict[str, Any]] | — |
Returns: Any
Raises:
calibrate_tool(server_id: str, tool_name: str) -> Any
Start or run the calibration pass for the targeted integration tool.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
Returns: Any
Raises:
invoke_tool(server_id: str, tool_name: str, arguments = None) -> Any
Call a remote tool through CALIBER's governed egress path.
Routed through the server rather than called directly, which is what makes tool policy, secret resolution, and audit apply at all.
| Parameter | Kind | Type | Default |
|---|---|---|---|
server_id | positional-or-keyword | str | — |
tool_name | positional-or-keyword | str | — |
arguments | positional-or-keyword | Any | None |
Returns: Any
Raises:
OpenApiIntegrationsAPI
class OpenApiIntegrationsAPI()
Governed OpenAPI import, curation, and publication.
The control-plane pipeline is: create an integration shell, import a pinned spec version into it, review the normalized operations and detected dependencies, generate tool drafts from selected operations, then publish an approved draft into CALIBER's tool registry. Importing a spec never creates a runtime tool by itself — `generate_tool_drafts and publish_tool_draft` are the two explicit steps that do.
Related APIs: ToolsAPI, McpServersAPI
Methods
list(*, status: str | None = None) -> list[OpenApiIntegration]
Return the current collection of OpenAPI integrations, tool drafts, and dependency graph, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[OpenApiIntegration]
Raises:
get(integration_id: str) -> OpenApiIntegration
Fetch one record from the OpenAPI integrations, tool drafts, and dependency graph surface identified by integration_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: OpenApiIntegration
Raises:
create(name: str, **options) -> OpenApiIntegration
Create a new record on the OpenAPI integrations, tool drafts, and dependency graph surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: OpenApiIntegration
Raises:
update(integration_id: str, **changes) -> OpenApiIntegration
Patch an existing record on the OpenAPI integrations, tool drafts, and dependency graph surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: OpenApiIntegration
Raises:
archive(integration_id: str) -> OpenApiIntegration
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: OpenApiIntegration
Raises:
import_spec(integration_id: str, *, spec_text: str | None = None, spec_base64: str | None = None, spec_url: str | None = None, source_ref: str | None = None) -> OpenApiIntegrationVersion
Import one OpenAPI 3.x document, pinning it as a new version.
Exactly one of `spec_text (pasted JSON/YAML), spec_base64 (an uploaded file), or spec_url` (fetched over CALIBER's guarded egress path) must be given.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
spec_text | keyword-only | `str | None` | None |
spec_base64 | keyword-only | `str | None` | None |
spec_url | keyword-only | `str | None` | None |
source_ref | keyword-only | `str | None` | None |
Returns: OpenApiIntegrationVersion
Raises:
reimport(integration_id: str) -> Any
Re-fetch the last imported version's `url` source and diff it.
Only meaningful when the last imported version came from `spec_url`; an inline or uploaded spec has nothing live to re-fetch.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: Any
Raises:
validate_spec_source(integration_id: str, *, spec_url: str, source_kind: str = 'url') -> Any
Check whether a spec source is reachable and permitted, without importing it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
spec_url | keyword-only | str | — |
source_kind | keyword-only | str | 'url' |
Returns: Any
Raises:
versions(integration_id: str) -> list[OpenApiIntegrationVersion]
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: list[OpenApiIntegrationVersion]
Raises:
version(integration_id: str, version_id: str) -> OpenApiIntegrationVersion
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
version_id | positional-or-keyword | str | — |
Returns: OpenApiIntegrationVersion
Raises:
diff_version(integration_id: str, version_id: str, *, compare_to_version_id: str | None = None) -> Any
Diff one pinned version against another, defaulting to its predecessor.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | positional-or-keyword | str | — | |
compare_to_version_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
list_operations(integration_id: str, *, version_id: str | None = None) -> list[OpenApiOperation]
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | keyword-only | `str | None` | None |
Returns: list[OpenApiOperation]
Raises:
get_operation(integration_id: str, operation_id: str) -> OpenApiOperation
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: OpenApiOperation
Raises:
list_dependencies(integration_id: str, *, version_id: str | None = None, status: str | None = None) -> list[OpenApiOperationDependency]
Canonical dependency rows — the source of truth the API graph derives from.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: list[OpenApiOperationDependency]
Raises:
review_dependency(integration_id: str, dependency_id: str, *, status: str, notes: str | None = None) -> OpenApiOperationDependency
Confirm or reject one suggested/advisory dependency (`status is "confirmed" or "rejected"`). A high-confidence, already auto-wired row cannot be reviewed.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
dependency_id | positional-or-keyword | str | — | |
status | keyword-only | str | — | |
notes | keyword-only | `str | None` | None |
Returns: OpenApiOperationDependency
Raises:
graph(integration_id: str, *, version_id: str | None = None) -> Any
The derived API dependency graph (nodes/edges) for planning and display.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
version_id | keyword-only | `str | None` | None |
Returns: Any
Raises:
generate_tool_drafts(integration_id: str, *, operation_ids: list[str] | None = None, tags: list[str] | None = None, methods: list[str] | None = None, path_prefix: str | None = None, group_as_pack: bool = False, version_id: str | None = None, server_url: str | None = None, auth_binding: dict[str, Any] | None = None, requires_approval: bool = False, allow_in_preview: bool = False) -> list[OpenApiToolDraft]
Generate one or more curated tool drafts from selected operations.
Select operations by id, or by filter (`tags/methods/path_prefix) — useful for a large spec without enumerating every id by hand. With group_as_pack=True` and more than one selected operation, all of them are bound into a single tool-pack draft instead of one draft each.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
operation_ids | keyword-only | `list[str] | None` | None |
tags | keyword-only | `list[str] | None` | None |
methods | keyword-only | `list[str] | None` | None |
path_prefix | keyword-only | `str | None` | None |
group_as_pack | keyword-only | bool | False | |
version_id | keyword-only | `str | None` | None |
server_url | keyword-only | `str | None` | None |
auth_binding | keyword-only | `dict[str, Any] | None` | None |
requires_approval | keyword-only | bool | False | |
allow_in_preview | keyword-only | bool | False |
Returns: list[OpenApiToolDraft]
Raises:
list_tool_drafts(integration_id: str) -> list[OpenApiToolDraft]
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
Returns: list[OpenApiToolDraft]
Raises:
get_tool_draft(integration_id: str, draft_id: str) -> OpenApiToolDraft
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
draft_id | positional-or-keyword | str | — |
Returns: OpenApiToolDraft
Raises:
update_tool_draft(integration_id: str, draft_id: str, **changes) -> OpenApiToolDraft
Operate on the OpenAPI integrations, tool drafts, and dependency graph surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
draft_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: OpenApiToolDraft
Raises:
preview_tool_draft(integration_id: str, draft_id: str, *, input: dict[str, Any] | None = None) -> Any
Run one real upstream call for an unpublished draft.
This is a live effect, not a simulation — refused unless the draft has `allow_in_preview` set, so an approval-gated write cannot be fired through preview before anyone approves it.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
draft_id | positional-or-keyword | str | — | |
input | keyword-only | `dict[str, Any] | None` | None |
Returns: Any
Raises:
publish_tool_draft(integration_id: str, draft_id: str, *, name: str | None = None, description: str | None = None, version: str = '1.0') -> Any
Publish an approved draft into CALIBER's governed tool registry.
Returns `{"draft": ..., "tool": ...} — the tool is now reachable through the standard tool, workflow, and SDK tools` surfaces.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
integration_id | positional-or-keyword | str | — | |
draft_id | positional-or-keyword | str | — | |
name | keyword-only | `str | None` | None |
description | keyword-only | `str | None` | None |
version | keyword-only | str | '1.0' |
Returns: Any
Raises:
validate_credential_binding(integration_id: str, *, auth_binding: dict[str, Any]) -> Any
Check whether an auth binding's secret references resolve, without publishing.
| Parameter | Kind | Type | Default |
|---|---|---|---|
integration_id | positional-or-keyword | str | — |
auth_binding | keyword-only | dict[str, Any] | — |
Returns: Any
Raises:
GatewayAPI
class GatewayAPI()
External LLM gateway discovery, guardrails, and usage.
Methods
get() -> Any
Discovered endpoints and routing visibility.
This callable takes no public parameters.
Returns: Any
Raises:
usage(**params) -> Any
Trace-derived usage. Derived, not metered: it reports what was traced, so untraced calls are absent rather than zero.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
guardrails() -> Any
Return the configured gateway guardrails for the connected deployment.
This callable takes no public parameters.
Returns: Any
Raises:
guardrail_catalog() -> Any
What this deployment can enforce, versus what it does.
This callable takes no public parameters.
Returns: Any
Raises:
create_guardrail(**payload) -> Any
Create a new gateway guardrail from the supplied configuration payload.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | var-keyword | Any | — |
Returns: Any
Raises:
delete_guardrail(guardrail_id: str) -> Any
Delete the targeted gateway guardrail definition.
| Parameter | Kind | Type | Default |
|---|---|---|---|
guardrail_id | positional-or-keyword | str | — |
Returns: Any
Raises:
attach_guardrail(endpoint_id: str, **payload) -> Any
Operate on the gateway policies and usage surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
endpoint_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
update_guardrail_config(endpoint_id: str, guardrail_id: str, **changes) -> Any
Change how an already-attached guardrail behaves on this endpoint (e.g. its enabled state or order) without detaching and reattaching it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
endpoint_id | positional-or-keyword | str | — |
guardrail_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Any
Raises:
detach_guardrail(endpoint_id: str, guardrail_id: str) -> Any
Operate on the gateway policies and usage surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
endpoint_id | positional-or-keyword | str | — |
guardrail_id | positional-or-keyword | str | — |
Returns: Any
Raises:
KnowledgeBasesAPI
class KnowledgeBasesAPI()
Versioned RAG corpora, retrieval, and calibration.
Related APIs: ProjectsAPI, EvaluationsAPI
Methods
list(*, status: str | None = None) -> list[KnowledgeBase]
Return the current collection of knowledge bases, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[KnowledgeBase]
Raises:
get(knowledge_base_id: str) -> KnowledgeBase
Fetch one record from the knowledge bases surface identified by knowledge_base_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: KnowledgeBase
Raises:
create(name: str, **options) -> KnowledgeBase
Create a new record on the knowledge bases surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: KnowledgeBase
Raises:
update(knowledge_base_id: str, **changes) -> KnowledgeBase
Patch an existing record on the knowledge bases surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: KnowledgeBase
Raises:
delete(knowledge_base_id: str) -> Any
Delete a record on the knowledge bases surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: Any
Raises:
options() -> Any
Embedding models and chunking strategies this deployment offers.
This callable takes no public parameters.
Returns: Any
Raises:
versions(knowledge_base_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create_version(knowledge_base_id: str, **payload) -> Any
Create a new version under the targeted top-level asset.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
activate_version(knowledge_base_id: str, version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
runs(knowledge_base_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
Returns: Any
Raises:
run_events(run_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
version(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
sync_version_to_age(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
sources(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
chunks(version_id: str, *, q: str | None = None, source_key: str | None = None, limit: int | None = None) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
version_id | positional-or-keyword | str | — | |
q | keyword-only | `str | None` | None |
source_key | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
Returns: Any
Raises:
entities(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
relationships(version_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
Returns: Any
Raises:
graph(version_id: str, **params) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
version_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
calibrate(knowledge_base_id: str, **options) -> Any
Start the calibration flow exposed by the knowledge bases surface.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
test_runs(knowledge_base_id: str, *, limit: int | None = None) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
Returns: Any
Raises:
test_run(test_run_id: str) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
test_run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
set_baseline(knowledge_base_id: str, **options) -> Any
Operate on the knowledge bases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
rollback(knowledge_base_id: str, **options) -> Any
Roll back to a prior version.
Knowledge bases roll back by activation history, not by an alias restore — the semantics differ per asset family, and the server is the authority on what this one means.
| Parameter | Kind | Type | Default |
|---|---|---|---|
knowledge_base_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
query(**payload) -> Any
Run a query against the server-managed corpus or knowledge surface and return the response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | var-keyword | Any | — |
Returns: Any
Raises:
ObjectStoreAPI
class ObjectStoreAPI()
S3/MinIO console operations.
Distinct from `projects.files`: that is CALIBER's managed file registry with lineage and immutable refs, this is the raw bucket browser underneath.
Methods
status() -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: Any
Raises:
buckets() -> list[Bucket]
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: list[Bucket]
Raises:
create_bucket(bucket: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
Returns: Any
Raises:
delete_bucket(bucket: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
Returns: Any
Raises:
listing(bucket: str, *, prefix: str | None = None, token: str | None = None, recursive: bool = False) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
token | keyword-only | `str | None` | None |
recursive | keyword-only | bool | False |
Returns: Any
Raises:
objects(bucket: str, *, prefix: str | None = None, token: str | None = None, recursive: bool = False) -> list[StoredObject]
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
token | keyword-only | `str | None` | None |
recursive | keyword-only | bool | False |
Returns: list[StoredObject]
Raises:
folders(bucket: str, *, prefix: str | None = None) -> list[str]
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
Returns: list[str]
Raises:
upload(bucket: str, *, filename: str, content: bytes, prefix: str | None = None, key: str | None = None, media_type: str | None = None) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
filename | keyword-only | str | — | |
content | keyword-only | bytes | — | |
prefix | keyword-only | `str | None` | None |
key | keyword-only | `str | None` | None |
media_type | keyword-only | `str | None` | None |
Returns: Any
Raises:
create_folder(bucket: str, name: str, *, prefix: str | None = None) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
name | positional-or-keyword | str | — | |
prefix | keyword-only | `str | None` | None |
Returns: Any
Raises:
delete_objects(bucket: str, *, keys: list[str] | None = None, prefix: str | None = None) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
keys | keyword-only | `list[str] | None` | None |
prefix | keyword-only | `str | None` | None |
Returns: Any
Raises:
download(bucket: str, key: str, *, disposition: str | None = None) -> bytes
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
bucket | positional-or-keyword | str | — | |
key | positional-or-keyword | str | — | |
disposition | keyword-only | `str | None` | None |
Returns: bytes
Raises:
preview(bucket: str, key: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
Returns: Any
Raises:
extract(bucket: str, key: str) -> Any
Extract text/structure from a stored document.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
Returns: Any
Raises:
import_object(bucket: str, key: str, **options) -> Any
Register a stored object as a managed project file.
The bridge from raw storage into the governed registry, where it gains a content hash and lineage.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
delete_object(bucket: str, key: str) -> Any
Operate on the object store buckets and objects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
bucket | positional-or-keyword | str | — |
key | positional-or-keyword | str | — |
Returns: Any
Raises:
Module caliber_sdk.resources.operations
Jobs, review queues, Aria, releases, observability, audit, events, cookbooks.
Tested example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
AriaAPI, AriaDraftsAPI, AriaSessionsAPI, AuditAPI, CookbooksAPI, EventsAPI, GateVerdictsAPI, JobsAPI, LlmPricingAPI, MemoryAPI, ObservabilityAPI, QualityReviewsAPI, ReleasesAPI, ReviewQueuesAPI, ReworkTasksAPI, SecretsAPI, SystemAPI
Classes
JobsAPI
class JobsAPI()
Durable background jobs — refinement, calibration, reporting.
Methods
list(*, status: str | None = None) -> list[Job]
Return the current collection of background jobs, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Job]
Raises:
get(job_id: str) -> Job
Fetch one record from the background jobs surface identified by job_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
Returns: Job
Raises:
targets(job_id: str) -> Any
What applying this job would change.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
Returns: Any
Raises:
apply(job_id: str, **options) -> Any
Apply a job's candidate. This is the human decision, made explicit.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
request_changes(job_id: str, notes: str, **options) -> Any
Send a `candidate_ready` job's candidate back for another pass.
Records `notes as the job's review feedback and returns it to running at the candidate stage rather than ending it — a human collaboration action, distinct from the automatic self-correction loop (refine_iteration` is left untouched).
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
notes | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
wait(job_id: str, *, timeout: float = 900.0, **options) -> Job
Poll until the job stops or stops for a person.
`awaits_human counts as done here on purpose. A refinement job that reaches candidate_ready` will never advance on its own, so a waiter that only accepted terminal states would block until timeout on the expected outcome.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: Job
Raises:
ReviewQueuesAPI
class ReviewQueuesAPI()
Structured human review.
Related APIs: JudgesAPI, ObservabilityAPI, EvalDatasetsAPI
Methods
list() -> list[ReviewQueue]
Return the current collection of review queues and queue items, applying any supported filters.
This callable takes no public parameters.
Returns: list[ReviewQueue]
Raises:
get(queue_id: str) -> ReviewQueue
Fetch one record from the review queues and queue items surface identified by queue_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
Returns: ReviewQueue
Raises:
create(name: str, **options) -> ReviewQueue
Create a new record on the review queues and queue items surface and return the server-normalized result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReviewQueue
Raises:
update(queue_id: str, **changes) -> ReviewQueue
Patch an existing record on the review queues and queue items surface and return the updated result. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: ReviewQueue
Raises:
enqueue(queue_id: str, **payload) -> Any
Add the supplied items to the targeted review queue.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
submit(queue_id: str, item_id: str, **answers) -> Any
Answer a queued item. The write-back that turns review into evidence.
`answers is wrapped in {"answers": ...} because that is the server's actual field (ReviewItemSubmitRequest.answers`); the request schema forbids extra fields, so posting the answer keys unwrapped at the top level used to 422 against a real server despite matching every mocked test.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
item_id | positional-or-keyword | str | — |
answers | var-keyword | Any | — |
Returns: Any
Raises:
alignment_examples(queue_id: str, **params) -> Any
Human labels usable for judge-alignment scoring.
`question_key (required by the server) belongs in params` -- without it the route always 400s, which this method used to make impossible to avoid since it accepted no query parameters at all.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
ReworkTasksAPI
class ReworkTasksAPI()
Owned, recoverable work created when a refinement job is rejected.
Every task originates automatically -- from the machine eval gate, or from a `"no_go" :class:QualityReviewsAPI decision (see :class:~caliber_sdk.models.operations.ReworkTask) -- so there is no create` here by design.
Methods
list(*, status: str | None = None, assigned_to: str | None = None) -> list[ReworkTask]
`status defaults server-side to "open"; pass "all"` for every status.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
assigned_to | keyword-only | `str | None` | None |
Returns: list[ReworkTask]
Raises:
get(task_id: str) -> ReworkTask
Fetch one record from the rework tasks surface identified by task_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
task_id | positional-or-keyword | str | — |
Returns: ReworkTask
Raises:
claim(task_id: str) -> ReworkTask
`open -> in_progress`, assigned to the calling identity.
| Parameter | Kind | Type | Default |
|---|---|---|---|
task_id | positional-or-keyword | str | — |
Returns: ReworkTask
Raises:
resolve(task_id: str, **options) -> ReworkTask
`in_progress -> resolved. options may carry resolution_job_id and resolution_notes`. Only the assignee or an admin may resolve a task.
| Parameter | Kind | Type | Default |
|---|---|---|---|
task_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReworkTask
Raises:
reassign(task_id: str, assigned_to: str) -> ReworkTask
Admin-only: change the assignee of an `open or in_progress task. This also claims it -- the task becomes in_progress`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
task_id | positional-or-keyword | str | — |
assigned_to | positional-or-keyword | str | — |
Returns: ReworkTask
Raises:
QualityReviewsAPI
class QualityReviewsAPI()
A human go/no-go decision on a refinement job's candidate, distinct from the machine eval gate.
Nested under a job (`/jobs/{job_id}/quality-reviews`) rather than its own top-level collection -- a review always belongs to exactly one job, with no independent "list every review" use case.
Methods
create(job_id: str, *, decision: str, rationale: str) -> QualityReview
Record a decision. `decision is "go" or "no_go"`.
`"go" is advisory only -- the job is untouched. "no_go" terminally rejects the job and creates a :class:~caliber_sdk.models.operations.ReworkTask with failure_kind == "quality_no_go" (see :attr:CaliberClient.rework_tasks`).
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
decision | keyword-only | str | — |
rationale | keyword-only | str | — |
Returns: QualityReview
Raises:
list(job_id: str) -> list[QualityReview]
A job's review history, newest first.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
Returns: list[QualityReview]
Raises:
AriaSessionsAPI
class AriaSessionsAPI()
Aria conversational sessions: messages, attachments, the message queue, intent resolution, and the session-scoped plan lifecycle.
Distinct from `client.aria.plans/.create_plan/etc: those are Aria's durable **goal-plans** (/aria/plans/*), while this is the **chat session** surface (/assistant/*) a goal-plan is created from. Both are "Aria" to a user; they are different route families on the server, which is why they are separate classes under one client.aria` tree rather than one flat namespace.
Methods
list(*, owner: str | None = None) -> Any
Return the current collection of Aria sessions, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
owner | keyword-only | `str | None` | None |
Returns: Any
Raises:
create(**options) -> Any
`options may carry title, goal, metadata_, artifact_type, skill_mode, pinned_skill_names`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
options | var-keyword | Any | — |
Returns: Any
Raises:
get(session_id: str) -> Any
Fetch one record from the Aria sessions surface identified by session_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
Returns: Any
Raises:
update(session_id: str, **changes) -> Any
Patch an existing record on the Aria sessions surface and return the updated result.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Any
Raises:
messages(session_id: str) -> Any
Operate on the Aria sessions surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
Returns: Any
Raises:
send_message(session_id: str, content: str, **params) -> Any
`params may carry artifact_type, skill_mode, skill_names, mode, steer`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
content | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
queue(session_id: str) -> Any
Messages queued to send once the current turn finishes.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
Returns: Any
Raises:
enqueue_message(session_id: str, content: str, **params) -> Any
`params may carry mode (queue vs. steer) and kind`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
content | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
cancel_queued(queue_id: str) -> bool
204 on success; the queued message is gone either way once this returns without raising.
| Parameter | Kind | Type | Default |
|---|---|---|---|
queue_id | positional-or-keyword | str | — |
Returns: bool
Raises:
attachments(session_id: str) -> Any
Operate on the Aria sessions surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create_attachment(session_id: str, *, kind: str, **params) -> Any
Attach by reference rather than uploading bytes. `kind is "text_snippet" (requires text=), "library_resource" (requires resource_type=, resource_id=), or "object_file" (requires bucket=, key=). For raw file bytes see :meth:upload_attachment`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
kind | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
upload_attachment(session_id: str, filename: str, content: bytes, *, bucket: str | None = None) -> Any
Upload a file's bytes as an attachment. Multipart, so it does not go through the JSON path. `bucket`, if given, also persists the raw file to that object-store bucket.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
session_id | positional-or-keyword | str | — | |
filename | positional-or-keyword | str | — | |
content | positional-or-keyword | bytes | — | |
bucket | keyword-only | `str | None` | None |
Returns: Any
Raises:
delete_attachment(attachment_id: str) -> bool
Operate on the Aria sessions surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
attachment_id | positional-or-keyword | str | — |
Returns: bool
Raises:
resolve_intent(session_id: str, content: str, **params) -> Any
Classify a free-text message into a known intent + slots before committing to a plan. `params may carry context`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
content | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
create_plan(session_id: str, **params) -> Any
`params may carry content, intent_name, slot_overrides, context`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
latest_plan(session_id: str) -> Any
Operate on the Aria sessions surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
Returns: Any
Raises:
execute_plan(session_id: str, **params) -> Any
Operate on the Aria sessions surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
operation(session_id: str, operation_id: str) -> Any
Poll a long-running plan-execution operation.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: Any
Raises:
drafts(session_id: str) -> Any
Artifact drafts this session has produced. To act on one, see `client.aria.drafts`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
session_id | positional-or-keyword | str | — |
Returns: Any
Raises:
AriaDraftsAPI
class AriaDraftsAPI()
An artifact draft's validate -> test -> approve -> publish lifecycle.
`approve/publish are gated` in Aria's own tool projection -- the autonomous loop cannot call them regardless of build mode -- but both remain ordinary, human-driven HTTP operations reachable here.
Methods
get(draft_id: str) -> Any
Fetch one record from the Aria drafts surface identified by draft_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
draft_id | positional-or-keyword | str | — |
Returns: Any
Raises:
update(draft_id: str, **changes) -> Any
Patch an existing record on the Aria drafts surface and return the updated result.
| Parameter | Kind | Type | Default |
|---|---|---|---|
draft_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Any
Raises:
validate(draft_id: str) -> Any
Run the server-side validation pass against the targeted draft.
| Parameter | Kind | Type | Default |
|---|---|---|---|
draft_id | positional-or-keyword | str | — |
Returns: Any
Raises:
test(draft_id: str) -> Any
Operate on the Aria drafts surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
draft_id | positional-or-keyword | str | — |
Returns: Any
Raises:
approve(draft_id: str) -> Any
Operate on the Aria drafts surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
draft_id | positional-or-keyword | str | — |
Returns: Any
Raises:
publish(draft_id: str) -> Any
A failed publish reports `success: false` in the body (400) rather than raising for every failure mode -- check the report.
| Parameter | Kind | Type | Default |
|---|---|---|---|
draft_id | positional-or-keyword | str | — |
Returns: Any
Raises:
AriaAPI
class AriaAPI(transport)
Aria: conversational sessions (`.sessions), artifact drafts (.drafts`), durable goal-plans, and deployment-wide config.
Usage example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Related APIs: JobsAPI, ReviewQueuesAPI, JudgesAPI, EvalDatasetsAPI
Constructor
__init__(transport) -> None
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | Any | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
sessions | AriaSessionsAPI | — |
drafts | AriaDraftsAPI | — |
Methods
capabilities() -> Any
What Aria is allowed to do in this deployment.
This callable takes no public parameters.
Returns: Any
Raises:
config() -> Any
Deployment-wide assistant settings: engine, model, reasoning effort, enabled intents/domains, autonomy status.
This callable takes no public parameters.
Returns: Any
Raises:
update_config(**changes) -> Any
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
changes | var-keyword | Any | — |
Returns: Any
Raises:
prompt_draft(description: str) -> Any
One-shot prompt draft from a free-text task description -- feeds the manual prompt builder's "Describe it" on-ramp. Not session- scoped and nothing is persisted.
| Parameter | Kind | Type | Default |
|---|---|---|---|
description | positional-or-keyword | str | — |
Returns: Any
Raises:
run(run_id: str) -> Any
One Aria-driven run's detail (a message turn or plan-execution run), for the session transcript's expandable trace.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: Any
Raises:
plans(*, session_id: str | None = None, limit: int | None = None, offset: int | None = None) -> list[AriaPlan]
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
session_id | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[AriaPlan]
Raises:
get_plan(plan_id: str) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
Returns: AriaPlanDetail
Raises:
create_plan(goal: str, **options) -> AriaPlanDetail
State an intent. Aria plans the steps; you approve them.
| Parameter | Kind | Type | Default |
|---|---|---|---|
goal | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
update_plan(plan_id: str, **changes) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
approve_plan(plan_id: str, **options) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
execute_plan(plan_id: str, **options) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
poll_plan(plan_id: str, **options) -> AriaPlanDetail
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
interactions(plan_id: str, *, limit: int | None = None, offset: int | None = None) -> list[AriaInteraction]
Operate on the Aria plans and interaction state surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
plan_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[AriaInteraction]
Raises:
answer(interaction_id: str, **payload) -> AriaPlanDetail
Answer a question Aria paused to ask.
| Parameter | Kind | Type | Default |
|---|---|---|---|
interaction_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
wait_for_plan(plan_id: str, *, timeout: float = 900.0, **options) -> AriaPlanDetail
Poll until the plan finishes or pauses for you.
`paused` is a resting state, not a transient one: the plan makes no further progress until a person answers, so polling past it would burn the whole timeout waiting for something that cannot happen.
| Parameter | Kind | Type | Default |
|---|---|---|---|
plan_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: AriaPlanDetail
Raises:
ReleasesAPI
class ReleasesAPI()
Release candidates, evidence, waivers, and signoff.
Related APIs: EvaluationsAPI, ReviewQueuesAPI, WorkflowsAPI
Methods
candidates() -> list[ReleaseCandidate]
Operate on the release candidates and signoffs surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: list[ReleaseCandidate]
Raises:
get_candidate(candidate_id: str) -> ReleaseCandidate
Operate on the release candidates and signoffs surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
Returns: ReleaseCandidate
Raises:
create_candidate(name: str, **options) -> ReleaseCandidate
Create a release candidate with its decision criteria, evidence, and rollback metadata.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReleaseCandidate
Raises:
evaluate(candidate_id: str, **options) -> ReleaseCandidate
Recompute the weighted score from current evidence.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: ReleaseCandidate
Raises:
add_waiver(candidate_id: str, **payload) -> Any
Record an exception. Admin-only, and audited — a waiver is a decision someone owns, not a way to raise a score.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
payload | var-keyword | Any | — |
Returns: Any
Raises:
generate_report(candidate_id: str, **options) -> Any
Start the durable report-generation job for the targeted release candidate.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
sign(candidate_id: str, *, decision: str, rationale: str, **options) -> Any
Record go / no-go. `rationale` is required by design: a signoff without a reason is not evidence of a decision.
| Parameter | Kind | Type | Default |
|---|---|---|---|
candidate_id | positional-or-keyword | str | — |
decision | keyword-only | str | — |
rationale | keyword-only | str | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
report_job(report_job_id: str) -> Any
Fetch a generated Allure-format report job by id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
report_job_id | positional-or-keyword | str | — |
Returns: Any
Raises:
timeline(**params) -> Any
Recent promotion/rollback/activation events, newest first.
`params: limit (default 50, server-capped at 200) and entity_type (prompt / workflow / knowledge_base / skill`).
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
live() -> Any
What is currently live across artifact types.
Prompt `@prod` liveness lives in the MLflow registry, not here — see the server route's own docstring; this reports DB-backed liveness (workflow deployments, knowledge-base active versions).
This callable takes no public parameters.
Returns: Any
Raises:
operations(**params) -> Any
Durable release intents, including any with an incomplete external effect. `params: status, limit` (default 100, capped 500).
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
reconcile() -> Any
Observe provider alias state and settle incomplete prompt release intents. The operator-triggered half of the intent-first release protocol described in `ARCHITECTURE.md` §8.
This callable takes no public parameters.
Returns: Any
Raises:
resolve_operation(operation_id: str, *, action: str, **params) -> Any
Retry or abandon a `prepared` (pre-effect) release intent.
`action is "retry" or "abandon". Only prepared rows are accepted — once a row reaches applying the provider may already have changed, and reconciliation (:meth:reconcile`), not a blind retry, is the safe next step.
| Parameter | Kind | Type | Default |
|---|---|---|---|
operation_id | positional-or-keyword | str | — |
action | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
GateVerdictsAPI
class GateVerdictsAPI()
Advisory per-version evaluation verdicts (prompt/workflow/skill).
Advisory in v1: a verdict never blocks alias rotation on its own (see `ARCHITECTURE.md` §4) — it is release evidence for the Version panel, not a gate.
Methods
get(artifact_type: str, version_key: str) -> Any
The latest verdict, or `{"state": "none"}` if none was recorded.
| Parameter | Kind | Type | Default |
|---|---|---|---|
artifact_type | positional-or-keyword | str | — |
version_key | positional-or-keyword | str | — |
Returns: Any
Raises:
record(artifact_type: str, version_key: str, *, state: str, **params) -> Any
Upsert a verdict. `state is "pass", "fail", or "none"; params may carry score, baseline_score, min_aggregate_score, worst_regression, max_regression_delta, and eval_run_id`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
artifact_type | positional-or-keyword | str | — |
version_key | positional-or-keyword | str | — |
state | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
SystemAPI
class SystemAPI()
Operational surfaces: effect-ledger and webhook recovery (both "CALIBER could not complete something outward-facing, and only a person can decide what happens next" -- see `routes/system_effects.py` for the full rationale), plus service health, the background-loop queue, and the incident/alert surface.
Methods
effects(**params) -> Any
Indeterminate effect-ledger claims. Defaults to `status=in_progress server-side -- the set that actually needs a decision. params: status, workflow_run_id, limit`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
resolve_effect(effect_key: str, *, resolution: str, **params) -> Any
Record whether an indeterminate effect happened. `resolution is "skip" (it did happen; do not repeat it) or "retry"` (it did not). Admin-scoped and audited -- this asserts something about the outside world CALIBER cannot verify on its own.
| Parameter | Kind | Type | Default |
|---|---|---|---|
effect_key | positional-or-keyword | str | — |
resolution | keyword-only | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
webhook_dead_letters(**params) -> Any
Outbound events that were never delivered. Defaults to `status=open server-side. params: status, kind, limit`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
acknowledge_dead_letter(dead_letter_id: str, **params) -> Any
Mark a dead letter handled without resending it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dead_letter_id | positional-or-keyword | str | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
replay_dead_letter(dead_letter_id: str) -> Any
Re-send a lost event. A failed replay leaves the row open (not acknowledged) and records why, so a failed recovery never looks like a completed one.
| Parameter | Kind | Type | Default |
|---|---|---|---|
dead_letter_id | positional-or-keyword | str | — |
Returns: Any
Raises:
services() -> Any
Live health probes for CALIBER's own backing services (database, object storage, MLflow, ...) -- the Settings page's service-status panel.
This callable takes no public parameters.
Returns: Any
Raises:
queue() -> Any
Depth and health of the in-process background-loop queues (refinement, calibration, workflow runs, ...).
This callable takes no public parameters.
Returns: Any
Raises:
alerts() -> Any
Active operational alerts (a queue backed up, a loop stalled).
This callable takes no public parameters.
Returns: Any
Raises:
incidents() -> Any
Durable incident records -- distinct from :meth:alerts, which is live/transient; an incident persists once opened.
This callable takes no public parameters.
Returns: Any
Raises:
acknowledge_incident(incident_id: str) -> Any
Take ownership. Deliberately not the same as resolving: "someone is looking at this" and "it stopped" are different facts.
| Parameter | Kind | Type | Default |
|---|---|---|---|
incident_id | positional-or-keyword | str | — |
Returns: Any
Raises:
silence_incident(incident_id: str, *, minutes: int = 60) -> Any
Mute routing for `minutes` (default 60) while keeping the record -- the incident is not resolved, just not paging anyone.
| Parameter | Kind | Type | Default |
|---|---|---|---|
incident_id | positional-or-keyword | str | — |
minutes | keyword-only | int | 60 |
Returns: Any
Raises:
ObservabilityAPI
class ObservabilityAPI()
Traces, experiments, and metrics.
Methods
traces(**params) -> list[Trace]
Operate on the observability traces and metrics surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: list[Trace]
Raises:
trace(trace_id: str) -> Any
One trace with its full span tree, left untyped: the node structure is MLflow's, and re-declaring it here would drift from it.
| Parameter | Kind | Type | Default |
|---|---|---|---|
trace_id | positional-or-keyword | str | — |
Returns: Any
Raises:
experiments() -> Any
Operate on the observability traces and metrics surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: Any
Raises:
metrics(**params) -> Any
Operate on the observability traces and metrics surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Any
Raises:
record_feedback(trace_id: str, *, value, **params) -> Any
Attach a human feedback assessment to a trace (`mlflow.log_feedback). value is a bool, number, or string; params may carry name (default "feedback") and rationale`. Returns the trace's refreshed assessments.
| Parameter | Kind | Type | Default |
|---|---|---|---|
trace_id | positional-or-keyword | str | — |
value | keyword-only | Any | — |
params | var-keyword | Any | — |
Returns: Any
Raises:
AuditAPI
class AuditAPI()
The audit log.
Methods
list(**params) -> list[AuditEntry]
Return the current collection of audit log entries, applying any supported filters.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: list[AuditEntry]
Raises:
export(*, format: str = 'csv', **params) -> bytes
Raw export bytes. CSV by default; JSON is admin-only on the server.
| Parameter | Kind | Type | Default |
|---|---|---|---|
format | keyword-only | str | 'csv' |
params | var-keyword | Any | — |
Returns: bytes
Raises:
EventsAPI
class EventsAPI()
Server-sent events.
Methods
stream(**params) -> Iterator[str]
Yield raw SSE lines.
Deliberately unparsed. The event vocabulary is a live surface, and a client that decoded into fixed types would reject events added after it shipped — the opposite of what a stream consumer wants.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: Iterator[str]
Raises:
CookbooksAPI
class CookbooksAPI()
Built-in, installable examples.
Usage example
def install_ready_cookbook(caliber: CaliberClient) -> dict[str, Any]:
"""Install the first cookbook whose prerequisites are already satisfied.
Readiness is checked before installing rather than after failing: the
recipe's unmet checks name what is missing, and each one that can be fixed
carries the route that fixes it.
"""
recipes = caliber.cookbooks.list()
ready = [recipe for recipe in recipes if recipe.is_ready]
if not ready:
blocked = {
recipe.id: [check.get("label") for check in recipe.unmet_checks] for recipe in recipes
}
return {"installed": None, "blocked_by": blocked}
recipe = ready[0]
result = caliber.cookbooks.install(recipe.id, name=f"{recipe.title} (SDK)")
# Installed paused, never running: an example manifest can carry model,
# connector, or side-effect bindings an operator should review first.
workflow = result.get("workflow") if isinstance(result, dict) else None
return {
"installed": recipe.id,
"workflow_status": (workflow or {}).get("status"),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Related APIs: WorkflowsAPI, ProjectsAPI, ReviewQueuesAPI, AriaAPI
Methods
list() -> list[CookbookRecipe]
Return the current collection of built-in cookbook recipes, applying any supported filters.
This callable takes no public parameters.
Returns: list[CookbookRecipe]
Raises:
install(cookbook_id: str, *, name: str | None = None, **options) -> Any
Install a recipe as a paused workflow plus an editable draft.
Paused on purpose: an example manifest can carry model, connector, or side-effect bindings that an operator should review before anything runs.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
cookbook_id | positional-or-keyword | str | — | |
name | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: Any
Raises:
SecretsAPI
class SecretsAPI()
Secret references. Write-only: values are never returned.
Methods
list() -> Any
Names and metadata only — no values, by design.
This callable takes no public parameters.
Returns: Any
Raises:
put(name: str, value: str) -> Any
Operate on the secret references surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
value | positional-or-keyword | str | — |
Returns: Any
Raises:
revoke(name: str) -> Any
Operate on the secret references surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: Any
Raises:
delete(name: str) -> Any
Delete a record on the secret references surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: Any
Raises:
LlmPricingAPI
class LlmPricingAPI()
Per-model token pricing (USD per 1K), used to cost out gateway usage.
Methods
list(*, status: str | None = None) -> Any
Return the current collection of llm pricing, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: Any
Raises:
get(pricing_id: str) -> Any
Fetch one record from the llm pricing surface identified by pricing_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
pricing_id | positional-or-keyword | str | — |
Returns: Any
Raises:
create(*, provider: str, model_id: str, prompt_price: float, completion_price: float, **options) -> Any
`options may carry cached_prompt_price, tags`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
provider | keyword-only | str | — |
model_id | keyword-only | str | — |
prompt_price | keyword-only | float | — |
completion_price | keyword-only | float | — |
options | var-keyword | Any | — |
Returns: Any
Raises:
update(pricing_id: str, **changes) -> Any
Patch an existing record on the llm pricing surface and return the updated result.
| Parameter | Kind | Type | Default |
|---|---|---|---|
pricing_id | positional-or-keyword | str | — |
changes | var-keyword | Any | — |
Returns: Any
Raises:
MemoryAPI
class MemoryAPI()
Direct add/search/list/delete over agent long-term memory (mem0).
Every operation is scoped by `agent_id/user_id/run_id -- at least one is required -- so the shared team store stays partitioned. 503s when memory is disabled or the [memory]` extra is absent on the server.
Methods
add(text: str, *, agent_id: str | None = None, **params) -> Any
`params may carry user_id, run_id, metadata, infer. At least one of agent_id/user_id/run_id` is required.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
text | positional-or-keyword | str | — | |
agent_id | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
search(query: str, *, agent_id: str | None = None, **params) -> Any
`params may carry user_id, run_id, top_k` (default 10 server-side).
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
query | positional-or-keyword | str | — | |
agent_id | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
list(*, agent_id: str | None = None, **params) -> Any
`params may carry user_id, run_id, top_k` (default 50 server-side). Sent as query parameters, not a JSON body.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
agent_id | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
delete_all(*, agent_id: str | None = None, **params) -> Any
Delete every memory in the given scope. Irreversible.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
agent_id | keyword-only | `str | None` | None |
params | var-keyword | Any | — |
Returns: Any
Raises:
Module caliber_sdk.resources.raw
Untyped access to any management endpoint.
Tested example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
RawAPI
Classes
RawAPI
class RawAPI()
Call any path under `/ajax-api/2.0/mlflow/caliber`.
Methods
get(path: str, **kwargs) -> Any
Fetch one record from the low-level management API routes surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
post(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
put(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
patch(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
delete(path: str, **kwargs) -> Any
Delete a record on the low-level management API routes surface and return the server acknowledgement. Validation and permission failures are surfaced through the standard CALIBER error hierarchy.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> Iterator[Any]
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: Iterator[Any]
Raises:
Model modules
Module caliber_sdk.models
Shared models for the CALIBER SDK.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
FAILED_RUN_STATES, IMPORT_JOB_TERMINAL_STATES, RELEASE_EVALUATION_TERMINAL_STATES, RELEASE_OPERATION_TERMINAL_STATES, STABILITY_BETA, STABILITY_GA, STABILITY_INTERNAL, TERMINAL_RUN_STATES, Account, Agent, AriaInteraction, AriaPlan, AriaPlanDetail, AriaPlanStep, AuditEntry, Bucket, CalibrationJob, Capabilities, CookbookRecipe, CursorPage, ErrorBody, EvalDataset, EvalExample, Evaluation, Extensibility, FieldError, Identity, IssuedToken, Job, Judge, JudgeAlignment, KnowledgeBase, LlmSetupStatus, McpServer, OpenApiIntegration, OpenApiIntegrationVersion, OpenApiOperation, OpenApiOperationDependency, OpenApiToolDraft, OptimizerPlugin, Page, PersonalAccessToken, PlatformAdminInventory, Project, ProjectFile, ProjectFolder, ProjectMember, Prompt, QualityReview, RegisteredOptimizer, ReleaseCandidate, ReviewQueue, ReworkTask, RuntimeSettings, RuntimeSettingsSummary, SessionInfo, Skill, SkillRender, SkillSelection, SkillVersion, Stability, StoredObject, Tool, Trace, VerificationBatchResult, VerificationItem, Workflow, WorkflowRun, WorkflowRunCapabilities, WorkflowService, WorkflowVersion, WorkspaceBreakGlassApplyResult, WorkspaceChangeRequest, WorkspaceChangeRequestCheck, WorkspaceChangeRequestComment, WorkspaceChangeRequestHead, WorkspaceChangeRequestReview, WorkspaceChangeRequestReviewer, WorkspaceEnvironment, WorkspaceExternalReviewAttestation, WorkspaceImportJob, WorkspaceImportReconciliation, WorkspaceRelease, WorkspaceReleaseDecision, WorkspaceReleaseEvaluation, WorkspaceReleaseEvidence, WorkspaceReleaseOperation, WorkspaceReleaseOperationItem, WorkspaceReleaseOperationResult, WorkspaceRevision, WorkspaceRevisionDiff, WorkspaceRevisionResource, WorkspaceSource, WorkspaceSourceCapabilities, WorkspaceSourceConnection, WorkspaceSourceReconciliationResult, WorkspaceSourceState, WorkspaceVersionTag, decode, decode_list
Module caliber_sdk.models.common
Shapes shared across the API, independent of any one resource.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
STABILITY_BETA, STABILITY_GA, STABILITY_INTERNAL, CursorPage, Page, Stability
Module constants
| Name | Value |
|---|---|
STABILITY_GA | 'ga' |
STABILITY_BETA | 'beta' |
STABILITY_INTERNAL | 'internal' |
Classes
CursorPage
class CursorPage()
Bases: Generic[T]
One page of a cursor-paginated list.
Unlike :class:Page's `limit/offset, the cursor is an opaque, server-issued token: a caller resumes by passing next_cursor straight back as the next request's cursor` parameter, never by computing an offset itself. Workspace's import/revision/Change-Request list endpoints use this scheme because their rows can be deleted or reordered between pages in a way a numeric offset would silently skip or repeat.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
items | list[T] | field(default_factory=list) | |
next_cursor | `str | None` | None |
Properties
has_more() -> bool
Operate on the cursor page surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
Page
class Page()
One page of an offset-paginated list.
Kept even though :meth:Transport.paginate hides pagination from most callers: a caller who needs to checkpoint and resume needs the offset, and reconstructing it from a flat iterator is not possible.
Dataclass fields
| Field | Type | Default |
|---|---|---|
items | list[Any] | field(default_factory=list) |
limit | int | 0 |
offset | int | 0 |
Properties
is_last() -> bool
Whether this looks like the final page.
A short page ends the sequence. A full page might too -- the only way to know is to ask for the next one and get nothing.
This callable takes no public parameters.
Returns: bool
next_offset() -> int
Operate on the page surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: int
Stability
class Stability()
Which API tags fall in which tier.
Dataclass fields
| Field | Type | Default |
|---|---|---|
ga | tuple[str, ...] | () |
beta | tuple[str, ...] | () |
internal | tuple[str, ...] | () |
Methods
from_payload(payload) -> Stability
Operate on the stability surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
Returns: Stability
tier_of(tag: str) -> str | None
Operate on the stability surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tag | positional-or-keyword | str | — |
Returns: str | None
Module caliber_sdk.models.core
Typed models for the core admin surfaces: auth, identity, capabilities, settings.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
Account, Capabilities, Extensibility, Identity, IssuedToken, LlmSetupStatus, OptimizerPlugin, PersonalAccessToken, PlatformAdminInventory, Project, ProjectFile, ProjectFolder, ProjectMember, RegisteredOptimizer, RuntimeSettings, RuntimeSettingsSummary, SessionInfo, WorkflowRunCapabilities, WorkspaceEnvironment
Classes
Identity
class Identity()
Who the caller is, from `GET /me`.
Note the server reports identity rather than requiring it: an invalid or revoked credential yields `user_id == "anonymous" with no scopes rather than an error. :meth:is_anonymous` is the check to make.
Dataclass fields
| Field | Type | Default |
|---|---|---|
user_id | str | '' |
scopes | list[str] | field(default_factory=list) |
is_admin | bool | False |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_anonymous() -> bool
Operate on the identity surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
SessionInfo
class SessionInfo()
How the caller's identity was established, from `GET /auth/session`.
Dataclass fields
| Field | Type | Default |
|---|---|---|
user_id | str | '' |
scopes | list[str] | field(default_factory=list) |
is_admin | bool | False |
auth_mode | str | '' |
authenticated_by | str | '' |
login_required | bool | False |
extra | dict[str, Any] | field(default_factory=dict) |
Account
class Account()
A user account. Never carries a password hash.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
user_id | str | '' | |
disabled | bool | False | |
created_at | `str | None` | None |
password_updated_at | `str | None` | None |
last_login_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
PersonalAccessToken
class PersonalAccessToken()
Token metadata. Never carries the secret.
The plaintext lives on :class:IssuedToken, which only the issue and rotate calls return — mirroring the server, where a listed token has no `token` key at all rather than a null one.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
token_id | str | '' | |
user_id | str | '' | |
name | str | '' | |
scopes | list[str] | field(default_factory=list) | |
created_at | `str | None` | None |
created_by | `str | None` | None |
expires_at | `str | None` | None |
last_used_at | `str | None` | None |
revoked_at | `str | None` | None |
revoked_reason | `str | None` | None |
rotated_from | `str | None` | None |
active | bool | True | |
extra | dict[str, Any] | field(default_factory=dict) | |
project_id | `str | None` | None |
IssuedToken
class IssuedToken()
Bases: PersonalAccessToken
A freshly issued token. `token` is returned exactly once, ever.
`token is keyword-only (field(kw_only=True)), not merely last by position: it is appended after every inherited PersonalAccessToken field, so a future field added to that base class would otherwise shift token's positional slot without any signal at the call site -- the same defect class this file's own Project/PersonalAccessToken` field-order fixes (#297, and this PR) exist to prevent, closed here permanently rather than re-litigated on every future base-class field.
Dataclass fields
| Field | Type | Default |
|---|---|---|
token | str | field(default='', kw_only=True) |
PlatformAdminInventory
class PlatformAdminInventory()
Who currently holds each config-driven global scope. Metadata only -- granting nothing beyond knowing who to ask or recover through.
Dataclass fields
| Field | Type | Default |
|---|---|---|
admin_users | list[str] | field(default_factory=list) |
approver_users | list[str] | field(default_factory=list) |
operator_users | list[str] | field(default_factory=list) |
extra | dict[str, Any] | field(default_factory=dict) |
WorkflowRunCapabilities
class WorkflowRunCapabilities()
Which workflow-run features the deployment has switched on.
Dataclass fields
| Field | Type | Default |
|---|---|---|
queue_enabled | bool | False |
supports_async_submit | bool | False |
supports_cancel | bool | False |
supports_retry | bool | False |
supports_resume | bool | False |
runtime_approvals_enabled | bool | False |
checkpointing_enabled | bool | False |
event_backend | str | '' |
approval_readiness | dict[str, Any] | field(default_factory=dict) |
extra | dict[str, Any] | field(default_factory=dict) |
RegisteredOptimizer
class RegisteredOptimizer()
One optimizer the deployment can run, with its provenance.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
name | str | '' | |
summary | str | '' | |
artifact_types | list[str] | field(default_factory=list) | |
source | str | 'builtin' | |
requires | `str | None` | None |
distribution | `str | None` | None |
explicit_only | bool | False | |
experimental | bool | False | |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_third_party() -> bool
True when a distribution other than CALIBER registered this.
Worth checking before pinning an agent to an optimizer: a third-party optimizer authors the artifact that gets promoted to production, and it is only present because the deployment allowlisted its distribution.
This callable takes no public parameters.
Returns: bool
Methods
can_target(artifact_type: str) -> bool
Operate on the registered optimizer surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
artifact_type | positional-or-keyword | str | — |
Returns: bool
OptimizerPlugin
class OptimizerPlugin()
An installed optimizer plugin and whether the deployment enabled it.
An entry with `allowlisted=False` is installed and inert. That is the normal state for a freshly installed plugin, not an error — CALIBER discovers plugins automatically and enables none of them automatically.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
name | str | '' | |
distribution | `str | None` | None |
value | str | '' | |
allowlisted | bool | False | |
error | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_active() -> bool
Operate on the optimizer plugin surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
Extensibility
class Extensibility()
What this deployment can run, and what it has been permitted to run.
Dataclass fields
| Field | Type | Default |
|---|---|---|
optimizers | list[RegisteredOptimizer] | field(default_factory=list) |
plugins | list[OptimizerPlugin] | field(default_factory=list) |
allowlist_env_var | str | 'CALIBER_PLUGIN_ALLOWLIST' |
extra | dict[str, Any] | field(default_factory=dict) |
Methods
optimizers_for(artifact_type: str) -> list[RegisteredOptimizer]
Optimizers that can target one artifact kind.
Filtering matters because the artifact kinds are not interchangeable: submitting a skill job with a prompt-only optimizer is rejected by the server, and asking here is how a caller avoids finding out that way.
| Parameter | Kind | Type | Default |
|---|---|---|---|
artifact_type | positional-or-keyword | str | — |
Returns: list[RegisteredOptimizer]
optimizer(name: str) -> RegisteredOptimizer | None
Operate on the extensibility surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
name | positional-or-keyword | str | — |
Returns: RegisteredOptimizer | None
Capabilities
class Capabilities()
Runtime feature flags plus the SDK stability tiers.
`artifact_families is deliberately left as a mapping: the server documents that each family means something different by the same key (rollback` in particular), so flattening it here would imply a uniformity the platform does not have.
Dataclass fields
| Field | Type | Default |
|---|---|---|
workflow_runs | WorkflowRunCapabilities | field(default_factory=WorkflowRunCapabilities) |
sync_workflow_version_run | bool | True |
artifact_families | dict[str, Any] | field(default_factory=dict) |
sdk_stability | dict[str, list[str]] | field(default_factory=dict) |
extensibility | Extensibility | field(default_factory=Extensibility) |
extra | dict[str, Any] | field(default_factory=dict) |
Methods
tier_of(tag: str) -> str | None
Which stability tier an API tag falls in, or `None` if unknown.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tag | positional-or-keyword | str | — |
Returns: str | None
is_ga(tag: str) -> bool
Operate on the capabilities surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
tag | positional-or-keyword | str | — |
Returns: bool
LlmSetupStatus
class LlmSetupStatus()
Which LLM credentials are configured — presence, never values.
The server returns masked fingerprints only. A field here that looked like a key would misrepresent what the endpoint is willing to disclose.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
llm_provider | str | '' | |
gateway_url | str | '' | |
openai_key_env | `str | None` | None |
openai_key_present | bool | False | |
anthropic_key_present | bool | False | |
assistant_engine | str | '' | |
openai_key_fingerprint | `str | None` | None |
anthropic_key_fingerprint | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
RuntimeSettingsSummary
class RuntimeSettingsSummary()
Data model returned by the SDK for runtime settings summary records.
Dataclass fields
| Field | Type | Default |
|---|---|---|
total | int | 0 |
live_editable | int | 0 |
environment_managed | int | 0 |
configured | int | 0 |
defaults | int | 0 |
secret_sources | int | 0 |
extra | dict[str, Any] | field(default_factory=dict) |
RuntimeSettings
class RuntimeSettings()
Grouped inventory of runtime configuration knobs.
Dataclass fields
| Field | Type | Default |
|---|---|---|
summary | RuntimeSettingsSummary | field(default_factory=RuntimeSettingsSummary) |
groups | list[dict[str, Any]] | field(default_factory=list) |
extra | dict[str, Any] | field(default_factory=dict) |
Project
class Project()
A project/workspace.
`file_count is present on list responses and absent on detail ones — the server computes it with one grouped query for the list only. None` means "not reported here", which is why it is not defaulted to 0.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
project_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | str | '' | |
status | str | '' | |
storage_backend | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
file_count | `int | None` | None |
access_role | `str | None` | None |
permissions | list[str] | field(default_factory=list) | |
extra | dict[str, Any] | field(default_factory=dict) | |
archived_at | `str | None` | None |
archived_by | `str | None` | None |
WorkspaceEnvironment
class WorkspaceEnvironment()
One of a project's four fixed environments (dev/qa/staging/ prod). `access_role/permissions` mirror the caller's project-wide role exactly -- an environment carries no separate per-environment role in this MVP.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
environment_id | str | '' | |
project_id | str | '' | |
name | str | '' | |
environment_class | str | '' | |
promotion_order | int | 0 | |
status | str | '' | |
recovery_policy_enabled | bool | False | |
current_release_id | `str | None` | None |
pending_operation_id | `str | None` | None |
operation_state | str | 'idle' | |
policy_sha256 | str | '' | |
lock_version | int | 1 | |
created_by | str | '' | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
access_role | `str | None` | None |
permissions | list[str] | field(default_factory=list) | |
extra | dict[str, Any] | field(default_factory=dict) |
ProjectMember
class ProjectMember()
A user's active or inactive membership in a project.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
member_id | str | '' | |
project_id | str | '' | |
user_id | str | '' | |
role | str | 'viewer' | |
status | str | 'active' | |
created_by | str | '' | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) | |
deactivated_at | `str | None` | None |
deactivated_by | `str | None` | None |
ProjectFile
class ProjectFile()
One stored file.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
file_id | str | '' | |
file_ref | `str | None` | None |
name | str | '' | |
kind | `str | None` | None |
relative_path | `str | None` | None |
media_type | `str | None` | None |
size_bytes | `int | None` | None |
sha256 | `str | None` | None |
etag | `str | None` | None |
object_version_id | `str | None` | None |
version | `int | None` | None |
status | `str | None` | None |
storage_backend | `str | None` | None |
producer_node_id | `str | None` | None |
project_id | `str | None` | None |
workflow_run_id | `str | None` | None |
playground_run_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
immutable_ref | `dict[str, Any] | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
ProjectFolder
class ProjectFolder()
Data model returned by the SDK for project folder records.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
path | str | '' | |
name | `str | None` | None |
file_ref | `str | None` | None |
storage_backend | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Module caliber_sdk.models.assets
Typed models for the governed asset families: agents, prompts, skills, tools.
Tested example
def prompt_lifecycle(
caliber: CaliberClient, *, agent_id: str = "intake-classifier"sdk/caliber-sdk/examples/prompt_lifecycle.py — executed by the SDK test suite.Public exports
CalibrationJob, Prompt, Skill, SkillRender, SkillSelection, SkillVersion, Tool
Classes
Prompt
class Prompt()
A prompt as the list/detail routes report it.
Prompts live in MLflow's registry, not CALIBER's database, so this carries a registry coordinate (`prompt_name, version, alias) rather than a CALIBER row id. template_preview` is truncated by the server; fetch the version to read the whole template.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
agent_id | str | '' | |
prompt_name | str | '' | |
version | `int | None` | None |
alias | `str | None` | None |
template_preview | `str | None` | None |
template_length | int | 0 | |
approval_id | `str | None` | None |
artifact_ref | `str | None` | None |
agent_name | `str | None` | None |
agent_enabled | `bool | None` | None |
has_prompt | `bool | None` | None |
source | `str | None` | None |
description | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Skill
class Skill()
A reusable instruction asset.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
skill_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
summary | `str | None` | None |
content | `str | None` | None |
owner | `str | None` | None |
category | `str | None` | None |
tags | list[str] | field(default_factory=list) | |
skill_metadata | dict[str, Any] | field(default_factory=dict) | |
allowed_tools | list[str] | field(default_factory=list) | |
depends_on | list[str] | field(default_factory=list) | |
status | str | '' | |
version | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
SkillRender
class SkillRender()
A skill's content with variables substituted.
Dataclass fields
| Field | Type | Default |
|---|---|---|
skill_id | str | '' |
skill_name | str | '' |
rendered_content | str | '' |
original_content | str | '' |
detected_variables | list[str] | field(default_factory=list) |
unresolved_variables | list[str] | field(default_factory=list) |
variables_applied | dict[str, Any] | field(default_factory=dict) |
summary | str | '' |
word_count | int | 0 |
char_count | int | 0 |
extra | dict[str, Any] | field(default_factory=dict) |
SkillSelection
class SkillSelection()
Whether a skill would be auto-selected for a query, and why.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
skill_id | str | '' | |
skill_name | str | '' | |
is_selected | bool | False | |
selection_score | float | 0.0 | |
selection_reason | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
SkillVersion
class SkillVersion()
One immutable skill snapshot.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
skill_id | str | '' | |
version_number | int | 0 | |
content | `str | None` | None |
summary | `str | None` | None |
created_by | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Tool
class Tool()
A registered callable.
`input_schema and output_schema` stay open mappings: they are JSON Schema documents describing the caller's own function, and CALIBER stores them rather than defining them.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
tool_id | str | '' | |
name | str | '' | |
version | `str | None` | None |
description | `str | None` | None |
module_path | `str | None` | None |
callable_name | `str | None` | None |
input_schema | dict[str, Any] | field(default_factory=dict) | |
output_schema | dict[str, Any] | field(default_factory=dict) | |
side_effect_level | `str | None` | None |
requires_approval | bool | False | |
allow_in_preview | bool | True | |
secret_refs | list[str] | field(default_factory=list) | |
owner | `str | None` | None |
status | str | '' | |
deprecated_at | `str | None` | None |
successor_tool_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
CalibrationJob
class CalibrationJob()
One tool calibration job.
`result` is left open: it carries scorer output whose keys vary by suite, and the server is the authority on what a run measured.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
job_id | str | '' | |
tool_id | `str | None` | None |
status | str | '' | |
requested_by | `str | None` | None |
result | `dict[str, Any] | None` | None |
error | `str | None` | None |
created_at | `str | None` | None |
claimed_at | `str | None` | None |
claimed_by | `str | None` | None |
finished_at | `str | None` | None |
pass_rate | `float | None` | None |
retry_of_job_id | `str | None` | None |
resolution | `str | None` | None |
resolution_reason | `str | None` | None |
resolved_by | `str | None` | None |
resolved_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Whether the job has stopped, successfully or not.
This callable takes no public parameters.
Returns: bool
Module caliber_sdk.models.quality
Typed models for the quality surfaces: datasets, judges, evaluations.
Tested example
def build_and_score(caliber: CaliberClient, *, owner: str = "@you") -> dict[str, Any]:
"""Create a dataset, add a row, define a judge, and run an evaluation."""
dataset = caliber.eval_datasets.create("intake-golden", owner=owner)
caliber.eval_datasets.add_example(
dataset.dataset_id,
input={"ticket": "I was charged twice"},
expected={"intent": "billing"},
)
# Instructions must reference an evaluation variable. A judge with no
# variable grades nothing — it returns the same verdict every time — so
# the server rejects it rather than letting you collect meaningless scores.
judge = caliber.judges.create(
"valid-intent",
instructions="Given {{ inputs }} and {{ outputs }}, return true if intent is allowed.",
feedback_value_type="bool",
)
# A judge is selected as a scorer by name (``Judge.<id>``), not by a bare
# ``judge_id`` field -- the request schema has no such field and rejects it.
evaluation = caliber.evaluations.create(dataset.dataset_id, scorers=[f"Judge.{judge.judge_id}"])
return {
"dataset_id": dataset.dataset_id,
"judge_id": judge.judge_id,
"evaluation_id": evaluation.evaluation_id,
}sdk/caliber-sdk/examples/evaluation.py — executed by the SDK test suite.Public exports
EvalDataset, EvalExample, Evaluation, Judge, JudgeAlignment, VerificationBatchResult, VerificationItem
Classes
EvalDataset
class EvalDataset()
A versioned evaluation dataset.
The `mlflow_*` fields record the last sync to MLflow's dataset registry. They are reported rather than owned: the dataset lives here, and the sync is a separate, possibly stale, fact.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
dataset_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
tags | list[str] | field(default_factory=list) | |
status | str | '' | |
version | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
mlflow_dataset_id | `str | None` | None |
mlflow_synced_at | `str | None` | None |
mlflow_synced_version | `int | None` | None |
mlflow_record_count | `int | None` | None |
mlflow_digest | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_synced() -> bool
Whether the dataset has ever been pushed to MLflow.
Not whether it is currently in sync — `mlflow_synced_version can lag version`, and conflating the two would let a caller trust stale evidence.
This callable takes no public parameters.
Returns: bool
EvalExample
class EvalExample()
One row of a dataset.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
example_id | str | '' | |
dataset_id | str | '' | |
inputs | Any | None | |
expected | Any | None | |
example_metadata | dict[str, Any] | field(default_factory=dict) | |
source_trace_id | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Judge
class Judge()
A model-backed grader.
`feedback_value_type` is what a scorecard reads: a bool judge and a numeric one are not interchangeable, and the field is how a caller knows which they have.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
judge_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
instructions | `str | None` | None |
model | `str | None` | None |
feedback_value_type | `str | None` | None |
owner | `str | None` | None |
tags | list[str] | field(default_factory=list) | |
status | str | '' | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Evaluation
class Evaluation()
One scored run over a dataset.
`metrics and results` stay open: which scorers ran is a property of the evaluation, not of this type, and enumerating them here would go stale the first time a scorer is added.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
evaluation_id | str | '' | |
dataset_id | `str | None` | None |
name | `str | None` | None |
status | str | '' | |
target_type | `str | None` | None |
target_ref | `str | None` | None |
metrics | dict[str, Any] | field(default_factory=dict) | |
results | Any | None | |
created_by | `str | None` | None |
created_at | `str | None` | None |
completed_at | `str | None` | None |
error | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the evaluation surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
JudgeAlignment
class JudgeAlignment()
Agreement between a judge and human reviewers.
Cohen's kappa matters more than raw agreement: a judge that always says "pass" agrees with a mostly-passing sample while measuring nothing.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
judge_id | str | '' | |
agreement | `float | None` | None |
kappa | `float | None` | None |
sample_size | int | 0 | |
per_example | list[dict[str, Any]] | field(default_factory=list) | |
extra | dict[str, Any] | field(default_factory=dict) |
VerificationItem
class VerificationItem()
A manually-flagged concern awaiting Stage ① Verify.
`duplicate_of_id and the duplicate status exist because dismissing a report as "already seen" is common enough to deserve its own outcome, distinct from "not real" — see :meth:VerificationQueueAPI.mark_duplicate`.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
item_id | str | '' | |
agent_id | str | '' | |
project_id | `str | None` | None |
assessment_id | `str | None` | None |
trace_id | `str | None` | None |
experiment_id | `str | None` | None |
session_id | `str | None` | None |
workflow_id | `str | None` | None |
category | str | '' | |
free_text | str | '' | |
severity | str | '' | |
artifact_type_hint | `str | None` | None |
artifact_ref | `str | None` | None |
submitted_context | `dict[str, Any] | None` | None |
status | str | '' | |
priority | int | 0 | |
assigned_to | `str | None` | None |
verified_by | `str | None` | None |
verified_at | `str | None` | None |
verification_notes | `str | None` | None |
refinement_target | `str | None` | None |
duplicate_of_id | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
VerificationBatchResult
class VerificationBatchResult()
Response envelope for :meth:VerificationQueueAPI.batch.
`results stays a list of raw dicts ({item_id, status, reason, linked_job_id} per row) rather than a nested dataclass — the same choice :class:JudgeAlignment.per_example makes, since :func:decode only maps top-level fields and per-item failures are meant to be inspected, not modeled deeply. linked_job_id is always None today: verifying an item does not create a job. See caliber/src/caliber/routes/verification.py`'s module docstring.
Dataclass fields
| Field | Type | Default |
|---|---|---|
action | str | '' |
requested | int | 0 |
succeeded | int | 0 |
failed | int | 0 |
results | list[dict[str, Any]] | field(default_factory=list) |
extra | dict[str, Any] | field(default_factory=dict) |
Module caliber_sdk.models.integrations
Typed models for the integration and data surfaces (beta tier).
Tested example
def install_ready_cookbook(caliber: CaliberClient) -> dict[str, Any]:
"""Install the first cookbook whose prerequisites are already satisfied.
Readiness is checked before installing rather than after failing: the
recipe's unmet checks name what is missing, and each one that can be fixed
carries the route that fixes it.
"""
recipes = caliber.cookbooks.list()
ready = [recipe for recipe in recipes if recipe.is_ready]
if not ready:
blocked = {
recipe.id: [check.get("label") for check in recipe.unmet_checks] for recipe in recipes
}
return {"installed": None, "blocked_by": blocked}
recipe = ready[0]
result = caliber.cookbooks.install(recipe.id, name=f"{recipe.title} (SDK)")
# Installed paused, never running: an example manifest can carry model,
# connector, or side-effect bindings an operator should review first.
workflow = result.get("workflow") if isinstance(result, dict) else None
return {
"installed": recipe.id,
"workflow_status": (workflow or {}).get("status"),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
Bucket, KnowledgeBase, McpServer, StoredObject
Classes
McpServer
class McpServer()
A managed MCP server definition.
`discovered_tools is what the server reported at last connection, not a contract: an MCP server can change its tool list, and a stale entry here means "we saw this once", which is why last_connected_at` sits beside it.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
server_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
transport | `str | None` | None |
uri | `str | None` | None |
command | `str | None` | None |
args | list[str] | field(default_factory=list) | |
env | dict[str, Any] | field(default_factory=dict) | |
headers | dict[str, Any] | field(default_factory=dict) | |
auth_type | `str | None` | None |
auth_config | dict[str, Any] | field(default_factory=dict) | |
tool_policies | dict[str, Any] | field(default_factory=dict) | |
icon | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
connection_error | `str | None` | None |
discovered_tools | list[dict[str, Any]] | field(default_factory=list) | |
last_connected_at | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_connected() -> bool
Whether the last connection attempt succeeded.
Not whether it is reachable now — that would require a probe, and :meth:McpServersAPI.test_connection is how you ask.
This callable takes no public parameters.
Returns: bool
KnowledgeBase
class KnowledgeBase()
A versioned RAG corpus.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
knowledge_base_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
active_version_id | `str | None` | None |
embedding_model | `str | None` | None |
chunking_strategy | `str | None` | None |
document_count | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Bucket
class Bucket()
One object-store bucket.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
name | str | '' | |
creation_date | `str | None` | None |
object_count | `int | None` | None |
size_bytes | `int | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
StoredObject
class StoredObject()
One object inside a bucket.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
key | str | '' | |
size | `int | None` | None |
last_modified | `str | None` | None |
etag | `str | None` | None |
content_type | `str | None` | None |
is_directory | bool | False |
Module caliber_sdk.models.operations
Typed models for the operational and agentic surfaces (beta tier).
Tested example
def plan_from_intent(caliber: CaliberClient, goal: str) -> dict[str, Any]:
"""State an intent, wait for Aria to plan it, and approve if it asks.
``wait_for_plan`` returns as soon as the plan pauses, because a paused plan
makes no further progress on its own — polling past it would burn the whole
timeout on the expected outcome.
"""
detail = caliber.aria.create_plan(goal)
settled = caliber.aria.wait_for_plan(detail.plan.plan_id, timeout=120)
if settled.plan.needs_you:
# The plan is waiting on a human decision. Approving is that decision,
# made explicitly rather than inferred from the script continuing.
caliber.aria.approve_plan(settled.plan.plan_id)
settled = caliber.aria.execute_plan(settled.plan.plan_id)
return {
"plan_id": settled.plan.plan_id,
"status": settled.plan.status,
"steps": len(settled.steps),
}sdk/caliber-sdk/examples/agentic.py — executed by the SDK test suite.Public exports
AriaInteraction, AriaPlan, AriaPlanDetail, AriaPlanStep, AuditEntry, CookbookRecipe, Job, ReleaseCandidate, ReviewQueue, Trace
Classes
Job
class Job()
A durable background job (refinement, calibration, reporting).
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
job_id | str | '' | |
status | str | '' | |
kind | `str | None` | None |
agent_id | `str | None` | None |
optimizer | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
error | `str | None` | None |
result | `dict[str, Any] | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the job surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
awaits_human() -> bool
Whether the job stopped for a person rather than finishing.
A refinement job that reaches `candidate_ready` is not done — it is waiting for an operator to apply it. Treating that as terminal is how a script silently drops the human decision the loop exists for.
This callable takes no public parameters.
Returns: bool
ReviewQueue
class ReviewQueue()
A structured human-review queue.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
queue_id | str | '' | |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
review_questions | list[dict[str, Any]] | field(default_factory=list) | |
item_count | `int | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
AriaPlan
class AriaPlan()
An Aria goal-plan: a sequence of steps awaiting approval or execution.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
plan_id | str | '' | |
session_id | `str | None` | None |
goal | str | '' | |
status | str | '' | |
autonomy | `str | None` | None |
owner | `str | None` | None |
step_count | int | 0 | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
needs_you() -> bool
Paused awaiting a human decision — a gate, approval, or confirm.
The state the SPA badges, and the one a script must not poll past: a paused plan makes no further progress until someone answers.
This callable takes no public parameters.
Returns: bool
AriaPlanStep
class AriaPlanStep()
One step inside an Aria plan detail response.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
step_id | str | '' | |
plan_id | str | '' | |
title | str | '' | |
capability_key | `str | None` | None |
depends_on | list[str] | field(default_factory=list) | |
status | str | '' | |
result | dict[str, Any] | field(default_factory=dict) | |
evidence | dict[str, Any] | field(default_factory=dict) | |
error | `str | None` | None |
draft_id | `str | None` | None |
job_id | `str | None` | None |
approval_id | `str | None` | None |
checkpoint_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
AriaPlanDetail
class AriaPlanDetail()
A plan plus its steps.
Dataclass fields
| Field | Type | Default |
|---|---|---|
plan | AriaPlan | field(default_factory=AriaPlan) |
steps | list[AriaPlanStep] | field(default_factory=list) |
extra | dict[str, Any] | field(default_factory=dict) |
AriaInteraction
class AriaInteraction()
One pause/question inside an Aria plan.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
interaction_id | str | '' | |
plan_id | str | '' | |
step_id | str | '' | |
kind | str | '' | |
prompt | str | '' | |
options | list[dict[str, Any]] | field(default_factory=list) | |
evidence | dict[str, Any] | field(default_factory=dict) | |
required_scope | `str | None` | None |
status | str | '' | |
response | dict[str, Any] | field(default_factory=dict) | |
responded_by | `str | None` | None |
responded_at | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
ReleaseCandidate
class ReleaseCandidate()
A release candidate with weighted criteria and signoff.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
candidate_id | str | '' | |
name | str | '' | |
artifact_type | `str | None` | None |
artifact_ref | `str | None` | None |
version_ref | `str | None` | None |
status | str | '' | |
weighted_score | `float | None` | None |
criteria | list[dict[str, Any]] | field(default_factory=list) | |
created_by | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Trace
class Trace()
One MLflow trace as observability reports it.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
trace_id | str | '' | |
request_id | `str | None` | None |
status | `str | None` | None |
timestamp_ms | `int | None` | None |
execution_time_ms | `float | None` | None |
tags | dict[str, Any] | field(default_factory=dict) | |
extra | dict[str, Any] | field(default_factory=dict) |
AuditEntry
class AuditEntry()
One audit-log row.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
audit_id | str | '' | |
actor | str | '' | |
action | str | '' | |
entity_type | `str | None` | None |
entity_id | `str | None` | None |
details | dict[str, Any] | field(default_factory=dict) | |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
CookbookRecipe
class CookbookRecipe()
A built-in, installable example.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
id | str | '' | |
slug | str | '' | |
title | str | '' | |
summary | str | '' | |
icon | `str | None` | None |
capabilities | list[str] | field(default_factory=list) | |
prerequisites | list[str] | field(default_factory=list) | |
activation_requires_review | bool | True | |
steps | list[dict[str, Any]] | field(default_factory=list) | |
readiness | dict[str, Any] | field(default_factory=dict) | |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_ready() -> bool
Operate on the cookbook recipe surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
unmet_checks() -> list[dict[str, Any]]
Checks standing between this recipe and a clean install.
This callable takes no public parameters.
Returns: list[dict[str, Any]]
Module caliber_sdk.models.workflows
Typed models for workflows, versions, runs, deployments, and services.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
FAILED_RUN_STATES, TERMINAL_RUN_STATES, Workflow, WorkflowRun, WorkflowService, WorkflowVersion
Classes
Workflow
class Workflow()
The container. Versions hold the manifest; this holds identity and status.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
workflow_id | str | '' | |
project_id | `str | None` | None |
name | str | '' | |
description | `str | None` | None |
owner | `str | None` | None |
status | str | '' | |
default_experiment_id | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkflowVersion
class WorkflowVersion()
One immutable manifest snapshot.
`manifest and validation_report` stay open: the manifest is a structured-but-extensible document the server validates, and the report is produced by the validator rather than defined here.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
version_id | str | '' | |
workflow_id | str | '' | |
version_number | int | 0 | |
status | str | '' | |
manifest | dict[str, Any] | field(default_factory=dict) | |
manifest_hash | `str | None` | None |
compiler_version | `str | None` | None |
compiled_artifact_uri | `str | None` | None |
validation_report | `dict[str, Any] | None` | None |
compiled_bundle | Any | None | |
created_by | `str | None` | None |
created_at | `str | None` | None |
published_by | `str | None` | None |
published_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_draft() -> bool
Operate on the workflow version surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
WorkflowRun
class WorkflowRun()
One execution.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
workflow_run_id | str | '' | |
workflow_id | str | '' | |
project_id | `str | None` | None |
workflow_version_id | `str | None` | None |
deployment_alias | `str | None` | None |
mlflow_run_id | `str | None` | None |
trace_id | `str | None` | None |
session_id | `str | None` | None |
status | str | '' | |
source | `str | None` | None |
priority | `int | None` | None |
queued_at | `str | None` | None |
started_at | `str | None` | None |
completed_at | `str | None` | None |
claimed_by | `str | None` | None |
error | `str | None` | None |
output | Any | None | |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the workflow run surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
succeeded() -> bool
Operate on the workflow run surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
WorkflowService
class WorkflowService()
A workflow published as an externally invocable HTTP service.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
service_id | str | '' | |
workflow_id | str | '' | |
alias | `str | None` | None |
input_schema | dict[str, Any] | field(default_factory=dict) | |
output_schema | dict[str, Any] | field(default_factory=dict) | |
enabled | bool | False | |
auth_required | bool | True | |
rate_limit_per_minute | `int | None` | None |
cors_allowed_origins | list[str] | field(default_factory=list) | |
endpoint | `str | None` | None |
created_by | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
token_count | int | 0 | |
extra | dict[str, Any] | field(default_factory=dict) |
Module caliber_sdk.models.workspace
Typed models for the Workspace revision/import lifecycle (P6-B).
Public exports
IMPORT_JOB_TERMINAL_STATES, RELEASE_EVALUATION_TERMINAL_STATES, RELEASE_OPERATION_TERMINAL_STATES, WorkspaceBreakGlassApplyResult, WorkspaceChangeRequest, WorkspaceChangeRequestCheck, WorkspaceChangeRequestComment, WorkspaceChangeRequestHead, WorkspaceChangeRequestReview, WorkspaceChangeRequestReviewer, WorkspaceExternalReviewAttestation, WorkspaceImportJob, WorkspaceImportReconciliation, WorkspaceRelease, WorkspaceReleaseDecision, WorkspaceReleaseEvaluation, WorkspaceReleaseEvidence, WorkspaceReleaseOperation, WorkspaceReleaseOperationItem, WorkspaceReleaseOperationResult, WorkspaceRevision, WorkspaceRevisionDiff, WorkspaceRevisionResource, WorkspaceSource, WorkspaceSourceCapabilities, WorkspaceSourceState, WorkspaceVersionTag
Classes
WorkspaceImportJob
class WorkspaceImportJob()
Durable source-to-revision import intent.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
import_job_id | str | '' | |
project_id | str | '' | |
source_id | str | '' | |
repository | str | '' | |
commit_sha | str | '' | |
upload_sha256 | `str | None` | None |
source_bundle_sha256 | `str | None` | None |
source_snapshot_file_id | `str | None` | None |
manifest_sha256 | `str | None` | None |
status | str | '' | |
revision_id | `str | None` | None |
idempotency_key | str | '' | |
attempt_count | int | 0 | |
max_attempts | int | 0 | |
claimed_by | `str | None` | None |
claimed_at | `str | None` | None |
lease_expires_at | `str | None` | None |
last_heartbeat_at | `str | None` | None |
error_code | `str | None` | None |
error_summary | `str | None` | None |
created_by | str | '' | |
updated_by | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
completed_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the workspace import job surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
WorkspaceSource
class WorkspaceSource()
A project's configured Git-backed source-control binding.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
source_id | str | '' | |
project_id | str | '' | |
provider | str | '' | |
provider_host | str | '' | |
canonical_repository_id | str | '' | |
display_path | str | '' | |
default_branch | str | '' | |
root_path | str | '' | |
manifest_path | str | '' | |
import_mode | str | '' | |
status | str | '' | |
has_connection | bool | False | |
external_review_policy_version | str | '' | |
provider_ruleset_sha256 | `str | None` | None |
last_verified_at | `str | None` | None |
last_reconciled_at | `str | None` | None |
updated_at | `str | None` | None |
etag | str | '' | |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceSourceState
class WorkspaceSourceState()
Source mode plus its optional configured binding.
`source is None for a caliber_managed project -- one that has never called :meth:~caliber_sdk.resources.projects.ProjectSourceAPI.configure`.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
source_mode | str | 'caliber_managed' | |
source | `WorkspaceSource | None` | None |
WorkspaceSourceCapabilities
class WorkspaceSourceCapabilities()
Provider-neutral capability snapshot; never includes credentials.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
source_id | str | '' | |
provider | str | '' | |
provider_host | str | '' | |
available | bool | False | |
capabilities | dict[str, Any] | field(default_factory=dict) | |
reason | `str | None` | None |
last_verified_at | `str | None` | None |
WorkspaceImportReconciliation
class WorkspaceImportReconciliation()
An explicit observation of an ambiguous local import snapshot.
Dataclass fields
| Field | Type | Default |
|---|---|---|
job | WorkspaceImportJob | field(default_factory=WorkspaceImportJob) |
observed | bool | False |
observation | str | '' |
WorkspaceRevisionResource
class WorkspaceRevisionResource()
One exact resource pin in an immutable revision.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
resource_pin_id | str | '' | |
revision_id | str | '' | |
resource_type | str | '' | |
logical_name | str | '' | |
resource_id | str | '' | |
version_ref | str | '' | |
content_sha256 | str | '' | |
source_path | `str | None` | None |
source_sha256 | `str | None` | None |
provider_ref | `str | None` | None |
snapshot_file_id | `str | None` | None |
snapshot_sha256 | `str | None` | None |
purpose | str | '' | |
resolution | dict[str, Any] | field(default_factory=dict) | |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceRevision
class WorkspaceRevision()
Revision metadata and its exact resource pins.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
revision_id | str | '' | |
project_id | str | '' | |
revision_number | int | 0 | |
source_id | `str | None` | None |
source_commit_sha | `str | None` | None |
source_kind | str | 'git' | |
manifest | dict[str, Any] | field(default_factory=dict) | |
manifest_sha256 | `str | None` | None |
source_bundle_sha256 | `str | None` | None |
source_snapshot_file_id | `str | None` | None |
source_attestation | str | '' | |
revision_sha256 | str | '' | |
status | str | '' | |
validation_report | `dict[str, Any] | None` | None |
created_by | str | '' | |
validated_by | `str | None` | None |
validated_at | `str | None` | None |
created_at | `str | None` | None |
resources | list[WorkspaceRevisionResource] | field(default_factory=list) | |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceRevisionDiff
class WorkspaceRevisionDiff()
Deterministic base-to-candidate revision difference.
Dataclass fields
| Field | Type | Default |
|---|---|---|
base_revision_id | str | '' |
revision_id | str | '' |
manifest_changed | bool | False |
source_bundle_changed | bool | False |
source_commit_changed | bool | False |
added | list[WorkspaceRevisionResource] | field(default_factory=list) |
removed | list[WorkspaceRevisionResource] | field(default_factory=list) |
changed | list[WorkspaceRevisionResource] | field(default_factory=list) |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceChangeRequestHead
class WorkspaceChangeRequestHead()
One generation of a Change Request's reviewed revision pointer.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
head_id | str | '' | |
change_request_id | str | '' | |
generation | int | 0 | |
revision_id | str | '' | |
revision_sha256 | str | '' | |
review_policy_version | str | '' | |
review_policy_sha256 | str | '' | |
changed_by | str | '' | |
change_summary | str | '' | |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceChangeRequest
class WorkspaceChangeRequest()
A revision proposed for review, promotion through a fixed status machine (`draft -> open -> ... -> accepted/closed`).
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
change_request_id | str | '' | |
project_id | str | '' | |
base_revision_id | `str | None` | None |
current_head_revision_id | str | '' | |
created_by | str | '' | |
title | str | '' | |
description | str | '' | |
head_generation | int | 0 | |
status | str | '' | |
review_backend | str | '' | |
accepted_at | `str | None` | None |
accepted_by | `str | None` | None |
closed_reason | `str | None` | None |
lock_version | int | 0 | |
created_at | `str | None` | None |
updated_at | `str | None` | None |
current_head | WorkspaceChangeRequestHead | field(default_factory=WorkspaceChangeRequestHead) | |
version_claim | `dict[str, Any] | None` | None |
active_reviewer_count | int | 0 | |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceChangeRequestReviewer
class WorkspaceChangeRequestReviewer()
One user assigned to review a Change Request.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
reviewer_id | str | '' | |
change_request_id | str | '' | |
user_id | str | '' | |
assigned_by | str | '' | |
assigned_at | `str | None` | None |
removed_by | `str | None` | None |
removed_at | `str | None` | None |
active | bool | False | |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceChangeRequestComment
class WorkspaceChangeRequestComment()
One comment on a Change Request, optionally anchored to a resource.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
comment_id | str | '' | |
change_request_id | str | '' | |
head_id | `str | None` | None |
resource_type | `str | None` | None |
resource_name | `str | None` | None |
source_path | `str | None` | None |
body | str | '' | |
author | str | '' | |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceChangeRequestCheck
class WorkspaceChangeRequestCheck()
One automated check run against a Change Request head.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
check_id | str | '' | |
head_id | str | '' | |
check_name | str | '' | |
attempt_number | int | 0 | |
implementation_version | str | '' | |
input_digest | str | '' | |
evidence_ref | `str | None` | None |
evidence_digest | `str | None` | None |
status | str | '' | |
claimed_by | `str | None` | None |
claimed_at | `str | None` | None |
lease_expires_at | `str | None` | None |
completed_at | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceChangeRequestReview
class WorkspaceChangeRequestReview()
One reviewer's approve/request-changes decision on a specific head.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
review_id | str | '' | |
change_request_id | str | '' | |
head_id | str | '' | |
reviewer_id | str | '' | |
decision | str | '' | |
rationale | str | '' | |
actor_role | str | '' | |
actor_scopes | list[str] | field(default_factory=list) | |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceExternalReviewAttestation
class WorkspaceExternalReviewAttestation()
A verified provider-side (e.g. GitHub PR) review, mapped onto a head.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
attestation_id | str | '' | |
change_request_id | str | '' | |
head_id | str | '' | |
source_id | str | '' | |
provider_change_request_id | str | '' | |
provider_url | `str | None` | None |
provider_head_commit | str | '' | |
provider_resulting_commit | str | '' | |
source_tree_sha256 | str | '' | |
workspace_revision_sha256 | str | '' | |
policy_version | str | '' | |
policy_sha256 | str | '' | |
provider_ruleset_sha256 | `str | None` | None |
required_checks | list[str] | field(default_factory=list) | |
trusted_check_sources | list[str] | field(default_factory=list) | |
check_conclusions | dict[str, Any] | field(default_factory=dict) | |
review_actors | list[dict[str, Any]] | field(default_factory=list) | |
merge_method | `str | None` | None |
merge_actor | `str | None` | None |
merged_at | `str | None` | None |
provider_event_ids | list[str] | field(default_factory=list) | |
adapter_version | str | '' | |
verified_at | `str | None` | None |
status | str | '' | |
reason | str | '' | |
verification_input_digest | str | '' | |
coverage_digest | `str | None` | None |
uncovered_commits | list[str] | field(default_factory=list) | |
uncovered_paths | list[str] | field(default_factory=list) | |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceVersionTag
class WorkspaceVersionTag()
An immutable semantic-version claim recorded against a revision.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
tag_id | str | '' | |
project_id | str | '' | |
revision_id | str | '' | |
change_request_id | str | '' | |
tag | str | '' | |
kind | str | '' | |
created_by | str | '' | |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceRelease
class WorkspaceRelease()
A Workspace release's evaluation/decision state machine record (P5-A through P5-F) -- `draft -> evaluating -> {blocked, rejected, approved, awaiting_quality_signoff} -> awaiting_approval -> {approved, rejected}`.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
release_id | str | '' | |
project_id | str | '' | |
revision_id | str | '' | |
environment_id | str | '' | |
change_request_id | `str | None` | None |
change_request_head_id | `str | None` | None |
version_tag_id | `str | None` | None |
predecessor_release_id | `str | None` | None |
environment_config_sha256 | str | '' | |
runtime_dependencies_sha256 | str | '' | |
policy_sha256 | str | '' | |
request_idempotency_key | str | '' | |
evaluation_evidence_sha256 | `str | None` | None |
decision_set_sha256 | `str | None` | None |
status | str | '' | |
requested_by | str | '' | |
requested_at | `str | None` | None |
evaluated_by | `str | None` | None |
evaluated_at | `str | None` | None |
lock_version | int | 0 | |
error_code | `str | None` | None |
error_summary | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceReleaseEvaluation
class WorkspaceReleaseEvaluation()
One durable evaluation attempt against a release's pinned digests.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
evaluation_id | str | '' | |
runtime_lineage_id | `str | None` | None |
project_id | str | '' | |
workspace_release_id | str | '' | |
idempotency_key | str | '' | |
evaluation_plan_sha256 | str | '' | |
input_sha256 | str | '' | |
status | str | '' | |
attempt_number | int | 0 | |
claimed_by | `str | None` | None |
lease_expires_at | `str | None` | None |
heartbeat_at | `str | None` | None |
linked_evaluation_run_ids | list[str] | field(default_factory=list) | |
gate_verdict_id | `str | None` | None |
error_code | `str | None` | None |
error_summary | `str | None` | None |
requested_by | str | '' | |
requested_at | `str | None` | None |
started_by | `str | None` | None |
started_at | `str | None` | None |
completed_by | `str | None` | None |
completed_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the workspace release evaluation surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
WorkspaceReleaseEvidence
class WorkspaceReleaseEvidence()
One piece of evidence (an evaluation run, a gate verdict, ...) recorded against a release, some of which a decision must reference to be valid.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
evidence_id | str | '' | |
workspace_release_id | str | '' | |
runtime_lineage_id | `str | None` | None |
kind | str | '' | |
evidence_ref | str | '' | |
evidence_sha256 | str | '' | |
required | bool | False | |
recorded_by | str | '' | |
recorded_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceReleaseDecision
class WorkspaceReleaseDecision()
A digest-bound quality or release go/no-go decision, snapshotting the deciding actor's role and scopes at decision time.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
decision_id | str | '' | |
workspace_release_id | str | '' | |
kind | str | '' | |
decision | str | '' | |
change_request_head_id | `str | None` | None |
rationale | str | '' | |
decided_by | str | '' | |
actor_role_snapshot | dict[str, Any] | field(default_factory=dict) | |
effective_scope_snapshot | dict[str, Any] | field(default_factory=dict) | |
revision_sha256 | str | '' | |
environment_config_sha256 | str | '' | |
runtime_dependencies_sha256 | str | '' | |
gate_evidence_sha256 | str | '' | |
policy_sha256 | str | '' | |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceBreakGlassApplyResult
class WorkspaceBreakGlassApplyResult()
What a break-glass apply call actually returns.
Deliberately thin: the server hands back only enough to look up the resulting authorization and operation (`authorization_id, operation_id`), not the full authorization record -- fetch that separately if needed rather than expecting it to ride along here.
Dataclass fields
| Field | Type | Default |
|---|---|---|
authorization_id | str | '' |
operation_id | str | '' |
WorkspaceReleaseOperation
class WorkspaceReleaseOperation()
One durable apply-or-rollback intent against a release (P5-C), executed and reconciled through :class:ProjectReleaseOperationsAPI.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
operation_id | str | '' | |
project_id | str | '' | |
workspace_release_id | str | '' | |
environment_id | str | '' | |
runtime_lineage_id | `str | None` | None |
kind | str | '' | |
target_release_id | `str | None` | None |
idempotency_key | str | '' | |
expected_current_release_id | `str | None` | None |
expected_environment_lock_version | int | 0 | |
status | str | '' | |
lock_version | int | 0 | |
requested_by | str | '' | |
requested_at | `str | None` | None |
applied_by | `str | None` | None |
applied_at | `str | None` | None |
completed_by | `str | None` | None |
completed_at | `str | None` | None |
observation_count | int | 0 | |
last_observed_at | `str | None` | None |
break_glass_authorization_id | `str | None` | None |
error_code | `str | None` | None |
error_summary | `str | None` | None |
created_at | `str | None` | None |
updated_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
Properties
is_terminal() -> bool
Operate on the workspace release operation surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
WorkspaceReleaseOperationItem
class WorkspaceReleaseOperationItem()
One resource-level step (bind/promote/activate/publish/verify) within a release operation, tracked separately since a partial failure leaves some items applied and others not.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
operation_item_id | str | '' | |
workspace_release_operation_id | str | '' | |
revision_resource_id | str | '' | |
action | str | '' | |
target_ref | str | '' | |
before_ref | `str | None` | None |
after_ref | `str | None` | None |
status | str | '' | |
provider_operation_ref | `str | None` | None |
provider_result | `dict[str, Any] | None` | None |
started_at | `str | None` | None |
completed_at | `str | None` | None |
error_code | `str | None` | None |
error_summary | `str | None` | None |
created_at | `str | None` | None |
extra | dict[str, Any] | field(default_factory=dict) |
WorkspaceReleaseOperationResult
class WorkspaceReleaseOperationResult()
An operation plus its per-resource items, the shape every create/get/apply/observe/cancel-expired call on :class:ProjectReleaseOperationsAPI returns.
Dataclass fields
| Field | Type | Default |
|---|---|---|
operation | WorkspaceReleaseOperation | field(default_factory=WorkspaceReleaseOperation) |
items | list[WorkspaceReleaseOperationItem] | field(default_factory=list) |
Properties
is_terminal() -> bool
Operate on the workspace release operation result surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: bool
Module caliber_sdk.models.errors
Typed views over CALIBER's two error body shapes.
Tested example
def quickstart(caliber: CaliberClient) -> dict[str, Any]:
"""Report who you are and which API surfaces are GA on this deployment."""
identity = caliber.me.get()
if identity.is_anonymous:
# /me answers "who am I" rather than requiring a credential, so an
# invalid token shows up here as anonymous instead of an exception.
raise SystemExit("no usable credential — check CALIBER_TOKEN")
capabilities = caliber.capabilities_info.get()
return {
"user_id": identity.user_id,
"scopes": identity.scopes,
"ga_surfaces": sorted(capabilities.sdk_stability.get("ga", [])),
"queue_enabled": capabilities.workflow_runs.queue_enabled,
}sdk/caliber-sdk/examples/quickstart.py — executed by the SDK test suite.Public exports
ErrorBody, FieldError
Classes
FieldError
class FieldError()
One entry of a structured validation failure.
Dataclass fields
| Field | Type | Default |
|---|---|---|
loc | tuple[Any, ...] | () |
msg | str | '' |
type | str | '' |
Properties
field() -> str
Dotted path of the offending field, or `<body>` for whole-body errors.
This callable takes no public parameters.
Returns: str
Methods
from_payload(payload) -> FieldError
Operate on the field error surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
Returns: FieldError
ErrorBody
class ErrorBody()
`{"detail", "status_code"}, plus errors and/or reason_code` when present.
Dataclass fields
| Field | Type | Default | |
|---|---|---|---|
detail | str | '' | |
status_code | int | 0 | |
errors | list[FieldError] | field(default_factory=list) | |
reason_code | `str | None` | None |
Methods
from_payload(payload) -> ErrorBody
Operate on the error body surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
payload | positional-or-keyword | Any | — |
Returns: ErrorBody
Async client
Module caliber_sdk.aio
Asynchronous client for the CALIBER management API.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
AsyncCaliberClient, AsyncProjectFilesAPI, AsyncProjectImportsAPI, AsyncProjectReleaseOperationsAPI, AsyncProjectReleasesAPI, AsyncProjectsAPI, AsyncTransport, AsyncWorkspacesAPI, wait_for, wait_for_terminal_state
Module caliber_sdk.aio.client
The async client, and an honest statement of what it covers.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
AsyncCaliberClient, AsyncCapabilitiesAPI, AsyncEventsAPI, AsyncJobsAPI, AsyncMeAPI, AsyncRawAPI, AsyncWorkflowRunsAPI
Classes
AsyncCaliberClient
class AsyncCaliberClient(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.AsyncClient | None = None)
An asynchronous connection to one CALIBER deployment.
Constructed exactly like :class:caliber_sdk.CaliberClient, including the same environment fallbacks and the same credential precedence -- a token beats a trusted header, because the token is a real credential and the header is only an assertion.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Constructor
__init__(base_url: str | None = None, *, token: str | None = None, user: str | None = None, proxy_secret: str | None = None, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, verify: bool | str = True, http_client: httpx.AsyncClient | None = None) -> None
Operate on the caliber client surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | `str | None` | None |
token | keyword-only | `str | None` | None |
user | keyword-only | `str | None` | None |
proxy_secret | keyword-only | `str | None` | None |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
verify | keyword-only | `bool | str` | True |
http_client | keyword-only | `httpx.AsyncClient | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
raw | AsyncRawAPI | Low-level route access through the SDK transport. |
me | AsyncMeAPI | The caller identity surface. |
capabilities_info | AsyncCapabilitiesAPI | Runtime stability tiers and deployment capabilities. |
projects | AsyncProjectsAPI | Projects plus the managed file registry. |
workspaces | Any | — |
workflows | AsyncWorkflowRunsAPI | Workflow registry plus versions, runs, and services. |
jobs | AsyncJobsAPI | Long-running background jobs. |
events | AsyncEventsAPI | Server-sent event stream. |
Properties
capabilities_api() -> AsyncCapabilitiesAPI
Deprecated alias for :attr:capabilities_info.
This callable takes no public parameters.
Returns: AsyncCapabilitiesAPI
Methods
aclose() -> None
Operate on the caliber client surface with the supplied arguments and return the server response.
This callable takes no public parameters.
Returns: None
__aenter__() -> AsyncCaliberClient
Return this instance so it can be used inside an async context manager.
This callable takes no public parameters.
Returns: AsyncCaliberClient
__aexit__(*_: object) -> None
Close any owned resources when leaving the async context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
workspace_scope(project_id: str) -> AsyncIterator[AsyncCaliberClient]
Temporarily select a context-local workspace for async requests.
The selection follows the current task across `await` points and is restored even when the scoped operation raises. Other tasks sharing the client keep their own project selection.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: AsyncIterator[AsyncCaliberClient]
Raises:
library_scope() -> AsyncIterator[AsyncCaliberClient]
Temporarily omit the project header for library-scoped calls.
This callable takes no public parameters.
Returns: AsyncIterator[AsyncCaliberClient]
project_scope(project_id: str) -> AsyncIterator[AsyncCaliberClient]
Compatibility alias for :meth:workspace_scope.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: AsyncIterator[AsyncCaliberClient]
AsyncRawAPI
class AsyncRawAPI()
Any endpoint, with the SDK's auth, retries, and typed errors.
The reason the typed coverage here can stay narrow without the client being limiting: nothing in CALIBER is unreachable from an async caller.
Methods
get(path: str, **kwargs) -> Any
Fetch one record from the low-level management API routes surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
post(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
put(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
patch(path: str, **kwargs) -> Any
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
delete(path: str, **kwargs) -> Any
Delete a record on the low-level management API routes surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Any
Raises:
download(path: str, **kwargs) -> bytes
Operate on the low-level management API routes surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: bytes
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> AsyncIterator[Any]
Not a coroutine: an async generator, so it is iterated rather than awaited.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: AsyncIterator[Any]
Raises:
AsyncMeAPI
class AsyncMeAPI()
Typed access to the caller identity surface.
Methods
get() -> Identity
Reports identity rather than requiring it: a bad credential returns an anonymous identity, not an exception.
This callable takes no public parameters.
Returns: Identity
Raises:
AsyncCapabilitiesAPI
class AsyncCapabilitiesAPI()
Typed access to the runtime capabilities surface.
Methods
get() -> Capabilities
Fetch one record from the runtime capabilities surface identified by id.
This callable takes no public parameters.
Returns: Capabilities
Raises:
AsyncWorkflowRunsAPI
class AsyncWorkflowRunsAPI()
Submit runs and await them.
The surface async is for on the request side: forty concurrent `submit_and_wait` calls are forty coroutines rather than forty threads.
Related APIs: WorkflowsAPI, WorkflowVersionsAPI, WorkflowServicesAPI
Methods
submit(*, workflow_version_id: str | None = None, workflow_id: str | None = None, alias: str | None = None, input = None, idempotency_key: str | None = None, **options) -> WorkflowRun
Create a new execution run on the server and return its initial state.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_version_id | keyword-only | `str | None` | None |
workflow_id | keyword-only | `str | None` | None |
alias | keyword-only | `str | None` | None |
input | keyword-only | Any | None | |
idempotency_key | keyword-only | `str | None` | None |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
get(run_id: str) -> WorkflowRun
Fetch one record from the workflow runs surface identified by run_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
list(workflow_id: str, *, status: str | None = None) -> list[WorkflowRun]
Runs of one workflow.
Scoped because the server has no unscoped listing: `/workflow-runs` is POST-only. An earlier SDK method implying otherwise returned 405.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
workflow_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
Returns: list[WorkflowRun]
Raises:
cancel(run_id: str) -> WorkflowRun
Operate on the workflow runs surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
Returns: WorkflowRun
Raises:
wait(run_id: str, *, timeout: float = 900.0, raise_on_failure: bool = True, **options) -> WorkflowRun
Poll until the targeted run or job reaches a terminal state, then return the final record.
| Parameter | Kind | Type | Default |
|---|---|---|---|
run_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
raise_on_failure | keyword-only | bool | True |
options | var-keyword | Any | — |
Returns: WorkflowRun
Raises:
AsyncJobsAPI
class AsyncJobsAPI()
Background jobs, and waiting on ones that stop for a person.
Methods
get(job_id: str) -> Job
Fetch one record from the background jobs surface identified by job_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
Returns: Job
Raises:
list(*, status: str | None = None) -> list[Job]
Return the current collection of background jobs, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Job]
Raises:
wait(job_id: str, *, timeout: float = 900.0, **options) -> Job
Return when the job finishes or stops for a human.
`candidate_ready` is a resting state: applying the candidate is a person's decision, so the job will never advance on its own and polling past it would spend the whole timeout on the expected outcome.
| Parameter | Kind | Type | Default |
|---|---|---|---|
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: Job
Raises:
AsyncEventsAPI
class AsyncEventsAPI()
The reason this module exists.
Methods
stream(**params) -> AsyncIterator[str]
Yield raw server-sent-event lines as they arrive.
Unparsed on purpose: the event vocabulary grows with the server, and a decoder compiled into this SDK would reject events added after it shipped -- exactly when a consumer most needs to see them.
Returns an async iterator rather than a coroutine, so it is used with `async for` and never awaited.
| Parameter | Kind | Type | Default |
|---|---|---|---|
params | var-keyword | Any | — |
Returns: AsyncIterator[str]
Raises:
Module caliber_sdk.aio.projects
Asynchronous project, workspace, and project-file operations.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
AsyncProjectFilesAPI, AsyncProjectImportsAPI, AsyncProjectReleaseOperationsAPI, AsyncProjectReleasesAPI, AsyncProjectsAPI, AsyncWorkspacesAPI
Classes
AsyncProjectFilesAPI
class AsyncProjectFilesAPI()
Files inside one project.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Methods
list(project_id: str) -> tuple[list[ProjectFile], list[ProjectFolder]]
Return files and directories separately.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: tuple[list[ProjectFile], list[ProjectFolder]] — see ProjectFile, ProjectFolder
Raises:
upload(project_id: str, *, filename: str, content: bytes | BinaryIO, path: str | None = None, kind: str = 'input', media_type: str | None = None) -> ProjectFile
Upload a project file using the async transport's multipart path.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
filename | keyword-only | str | — | |
content | keyword-only | `bytes | BinaryIO` | — |
path | keyword-only | `str | None` | None |
kind | keyword-only | str | 'input' | |
media_type | keyword-only | `str | None` | None |
Returns: ProjectFile
Raises:
create_folder(project_id: str, path: str) -> ProjectFolder
Operate on the project files and folders surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
path | positional-or-keyword | str | — |
Returns: ProjectFolder
Raises:
delete(project_id: str, file_id: str) -> bool
Delete a record on the project files and folders surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bool
Raises:
download(project_id: str, file_id: str) -> bytes
Download raw file bytes without JSON envelope handling.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
file_id | positional-or-keyword | str | — |
Returns: bytes
Raises:
AsyncProjectImportsAPI
class AsyncProjectImportsAPI()
Durable source-to-revision import jobs for one project (P6-C), awaited.
Async parity for this resource -- unlike most of P6-B's other grouped resources -- earns its complexity under :mod:caliber_sdk.aio.client's own stated criteria: :meth:wait is exactly the "long-running work you poll" category that module names as where async changes the outcome.
Methods
list(project_id: str, *, status: str | None = None, limit: int | None = None, cursor: str | None = None) -> CursorPage[WorkspaceImportJob]
Return the current collection of project imports, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
cursor | keyword-only | `str | None` | None |
Returns: CursorPage[WorkspaceImportJob]
Raises:
get(project_id: str, job_id: str) -> WorkspaceImportJob
Fetch one record from the project imports surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
Returns: WorkspaceImportJob
Raises:
create(project_id: str, *, repository: str, commit_sha: str, bundle: bytes | BinaryIO, idempotency_key: str, filename: str = 'bundle') -> WorkspaceImportJob
Start an import. See the sync `create's docstring for why idempotency_key` has no default.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
repository | keyword-only | str | — | |
commit_sha | keyword-only | str | — | |
bundle | keyword-only | `bytes | BinaryIO` | — |
idempotency_key | keyword-only | str | — | |
filename | keyword-only | str | 'bundle' |
Returns: WorkspaceImportJob
Raises:
reconcile(project_id: str, job_id: str) -> WorkspaceImportReconciliation
Explicitly observe an import stuck in `reconcile_required`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
Returns: WorkspaceImportReconciliation
Raises:
wait(project_id: str, job_id: str, *, timeout: float = 900.0, **options) -> WorkspaceImportJob
Poll until the import reaches a terminal state; see the sync `wait's docstring for why reconcile_required` counts as one.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
job_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: WorkspaceImportJob
Raises:
AsyncProjectReleasesAPI
class AsyncProjectReleasesAPI()
The Workspace release evaluation/decision/approval lifecycle (P5-F), awaited.
Async parity here earns its complexity two ways :mod:caliber_sdk.aio.client names: :meth:wait_for_evaluation is long-running work you poll, and awaiting many projects' releases concurrently is the same "forty workflow runs" case that module cites for :class:AsyncWorkflowRunsAPI.
Methods
list(project_id: str, *, status: str | None = None, environment_id: str | None = None, limit: int | None = None, offset: int | None = None) -> list[WorkspaceRelease]
Return the current collection of project releases, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
status | keyword-only | `str | None` | None |
environment_id | keyword-only | `str | None` | None |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceRelease]
Raises:
create(project_id: str, *, revision_id: str, environment_id: str, environment_config_sha256: str, runtime_dependencies_sha256: str, policy_sha256: str, request_idempotency_key: str, change_request_id: str | None = None, change_request_head_id: str | None = None, version_tag_id: str | None = None, predecessor_release_id: str | None = None) -> WorkspaceRelease
Create a new record on the project releases surface and return the server-normalized result.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
revision_id | keyword-only | str | — | |
environment_id | keyword-only | str | — | |
environment_config_sha256 | keyword-only | str | — | |
runtime_dependencies_sha256 | keyword-only | str | — | |
policy_sha256 | keyword-only | str | — | |
request_idempotency_key | keyword-only | str | — | |
change_request_id | keyword-only | `str | None` | None |
change_request_head_id | keyword-only | `str | None` | None |
version_tag_id | keyword-only | `str | None` | None |
predecessor_release_id | keyword-only | `str | None` | None |
Returns: WorkspaceRelease
Raises:
get(project_id: str, release_id: str) -> WorkspaceRelease
Fetch one record from the project releases surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
Returns: WorkspaceRelease
Raises:
list_evidence(project_id: str, release_id: str, *, limit: int | None = None, offset: int | None = None) -> list[WorkspaceReleaseEvidence]
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceReleaseEvidence]
Raises:
evaluate(project_id: str, release_id: str, *, idempotency_key: str, evaluation_plan_sha256: str, input_sha256: str) -> WorkspaceReleaseEvaluation
Recompute the current release or evaluation verdict from the latest stored evidence.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
idempotency_key | keyword-only | str | — |
evaluation_plan_sha256 | keyword-only | str | — |
input_sha256 | keyword-only | str | — |
Returns: WorkspaceReleaseEvaluation
Raises:
list_evaluations(project_id: str, release_id: str, *, limit: int | None = None, offset: int | None = None) -> list[WorkspaceReleaseEvaluation]
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceReleaseEvaluation]
Raises:
get_evaluation(project_id: str, release_id: str, evaluation_id: str) -> WorkspaceReleaseEvaluation
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
evaluation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseEvaluation
Raises:
wait_for_evaluation(project_id: str, release_id: str, evaluation_id: str, *, timeout: float = 900.0, **options) -> WorkspaceReleaseEvaluation
Poll until the evaluation attempt reaches `succeeded or failed`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
evaluation_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: WorkspaceReleaseEvaluation
Raises:
quality_signoff(project_id: str, release_id: str, *, decision: str, gate_evidence_sha256: str, rationale: str = '', change_request_head_id: str | None = None) -> WorkspaceReleaseDecision
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
decision | keyword-only | str | — | |
gate_evidence_sha256 | keyword-only | str | — | |
rationale | keyword-only | str | '' | |
change_request_head_id | keyword-only | `str | None` | None |
Returns: WorkspaceReleaseDecision
Raises:
approve(project_id: str, release_id: str, *, decision: str, gate_evidence_sha256: str, rationale: str = '', change_request_head_id: str | None = None) -> WorkspaceReleaseDecision
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
decision | keyword-only | str | — | |
gate_evidence_sha256 | keyword-only | str | — | |
rationale | keyword-only | str | '' | |
change_request_head_id | keyword-only | `str | None` | None |
Returns: WorkspaceReleaseDecision
Raises:
break_glass_apply(project_id: str, release_id: str, *, reason: str, incident_ref: str, authorization_ref: str, expires_at: str, gate_evidence_sha256: str, expected_current_release_id: str, expected_environment_lock_version: int, idempotency_key: str) -> WorkspaceBreakGlassApplyResult
Operate on the project releases surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
reason | keyword-only | str | — |
incident_ref | keyword-only | str | — |
authorization_ref | keyword-only | str | — |
expires_at | keyword-only | str | — |
gate_evidence_sha256 | keyword-only | str | — |
expected_current_release_id | keyword-only | str | — |
expected_environment_lock_version | keyword-only | int | — |
idempotency_key | keyword-only | str | — |
Returns: WorkspaceBreakGlassApplyResult
Raises:
AsyncProjectReleaseOperationsAPI
class AsyncProjectReleaseOperationsAPI()
Durable apply/rollback intents against one release (P5-C), awaited.
Async parity here earns its complexity the same way :class:AsyncProjectReleasesAPI does: :meth:wait is long-running work you poll.
Methods
list(project_id: str, release_id: str, *, limit: int | None = None, offset: int | None = None) -> list[WorkspaceReleaseOperation]
Return the current collection of project release operations, applying any supported filters.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
limit | keyword-only | `int | None` | None |
offset | keyword-only | `int | None` | None |
Returns: list[WorkspaceReleaseOperation]
Raises:
get(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
Fetch one record from the project release operations surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
create(project_id: str, release_id: str, *, kind: str, idempotency_key: str, expected_environment_lock_version: int, expected_current_release_id: str | None = None, target_release_id: str | None = None) -> WorkspaceReleaseOperationResult
Create a new record on the project release operations surface and return the server-normalized result.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
release_id | positional-or-keyword | str | — | |
kind | keyword-only | str | — | |
idempotency_key | keyword-only | str | — | |
expected_environment_lock_version | keyword-only | int | — | |
expected_current_release_id | keyword-only | `str | None` | None |
target_release_id | keyword-only | `str | None` | None |
Returns: WorkspaceReleaseOperationResult
Raises:
apply(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
Operate on the project release operations surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
observe(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
Operate on the project release operations surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
cancel_expired(project_id: str, release_id: str, operation_id: str) -> WorkspaceReleaseOperationResult
See the sync `cancel_expired's docstring for why the literal path stays one f-string passed straight into self._post(`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
Returns: WorkspaceReleaseOperationResult
Raises:
wait(project_id: str, release_id: str, operation_id: str, *, timeout: float = 900.0, **options) -> WorkspaceReleaseOperationResult
Poll until an apply or rollback operation reaches a terminal state; see the sync `wait's docstring for why reconcile_required` counts as one.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
release_id | positional-or-keyword | str | — |
operation_id | positional-or-keyword | str | — |
timeout | keyword-only | float | 900.0 |
options | var-keyword | Any | — |
Returns: WorkspaceReleaseOperationResult
Raises:
AsyncProjectsAPI
class AsyncProjectsAPI(transport: AsyncTransport)
Projects, project access, environments, and their file sub-resource.
Usage example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Related APIs: ProjectFilesAPI
Constructor
__init__(transport: AsyncTransport) -> None
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
transport | positional-or-keyword | AsyncTransport | — |
Returns: None
Attributes
| Attribute | Type | Notes |
|---|---|---|
files | AsyncProjectFilesAPI | — |
imports | AsyncProjectImportsAPI | — |
releases | AsyncProjectReleasesAPI | Release candidates, waivers, signoff, and reports. |
release_operations | AsyncProjectReleaseOperationsAPI | — |
Methods
list(*, status: str | None = None) -> list[Project]
Active projects by default; pass `status="all"` for everything.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
status | keyword-only | `str | None` | None |
Returns: list[Project]
Raises:
get(project_id: str) -> Project
Fetch one record from the projects surface identified by project_id.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Project
Raises:
create(name: str, *, description: str | None = None) -> Project
Create a new record on the projects surface and return the server-normalized result.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
name | positional-or-keyword | str | — | |
description | keyword-only | `str | None` | None |
Returns: Project
Raises:
update(project_id: str, *, name: str | None = None, description: str | None = None, status: str | None = None) -> Project
Update metadata, retaining sync compatibility for `status`.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
name | keyword-only | `str | None` | None |
description | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: Project
Raises:
CaliberAPIErrorCaliberTransportErrorValueError
archive(project_id: str) -> Project
Move a project to `archived` and record transition provenance.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Project
Raises:
restore(project_id: str) -> Project
Move an archived project back to `active`.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: Project
Raises:
transfer_ownership(project_id: str, new_owner_user_id: str) -> Project
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
new_owner_user_id | positional-or-keyword | str | — |
Returns: Project
Raises:
list_members(project_id: str) -> list[ProjectMember]
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: list[ProjectMember]
Raises:
add_member(project_id: str, user_id: str, *, role: str = 'viewer') -> ProjectMember
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
role | keyword-only | str | 'viewer' |
Returns: ProjectMember
Raises:
update_member(project_id: str, user_id: str, *, role: str | None = None, status: str | None = None) -> ProjectMember
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
project_id | positional-or-keyword | str | — | |
user_id | positional-or-keyword | str | — | |
role | keyword-only | `str | None` | None |
status | keyword-only | `str | None` | None |
Returns: ProjectMember
Raises:
remove_member(project_id: str, user_id: str) -> bool
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
user_id | positional-or-keyword | str | — |
Returns: bool
Raises:
storage() -> Any
Return deployment storage capabilities.
This callable takes no public parameters.
Returns: Any
Raises:
list_environments(project_id: str) -> list[WorkspaceEnvironment]
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
Returns: list[WorkspaceEnvironment]
Raises:
get_environment(project_id: str, name: str) -> WorkspaceEnvironment
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
Returns: WorkspaceEnvironment
Raises:
update_environment(project_id: str, name: str, *, policy: dict[str, Any], policy_sha256: str, expected_lock_version: int) -> WorkspaceEnvironment
Update an environment's policy configuration.
See :meth:caliber_sdk.resources.projects.ProjectsAPI.update_environment for the CAS/digest semantics -- identical here, just awaited.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
policy | keyword-only | dict[str, Any] | — |
policy_sha256 | keyword-only | str | — |
expected_lock_version | keyword-only | int | — |
Returns: WorkspaceEnvironment
Raises:
enable_environment(project_id: str, name: str) -> WorkspaceEnvironment
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
Returns: WorkspaceEnvironment
Raises:
disable_environment(project_id: str, name: str) -> WorkspaceEnvironment
Operate on the projects surface with the supplied arguments and return the server response.
| Parameter | Kind | Type | Default |
|---|---|---|---|
project_id | positional-or-keyword | str | — |
name | positional-or-keyword | str | — |
Returns: WorkspaceEnvironment
Raises:
Module caliber_sdk.aio.transport
Asynchronous transport, sharing every decision with the synchronous one.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
AsyncTransport
Classes
AsyncTransport
class AsyncTransport(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, user_agent: str | None = None, http_client: httpx.AsyncClient | None = None)
Asynchronous HTTP transport against one CALIBER deployment.
Constructor
__init__(base_url: str, *, auth: AuthProvider | None = None, project: str | None = None, timeout: float = 30.0, max_retries: int = 2, backoff_factor: float = 0.5, verify: bool | str = True, user_agent: str | None = None, http_client: httpx.AsyncClient | None = None) -> None
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
base_url | positional-or-keyword | str | — | |
auth | keyword-only | `AuthProvider | None` | None |
project | keyword-only | `str | None` | None |
timeout | keyword-only | float | 30.0 | |
max_retries | keyword-only | int | 2 | |
backoff_factor | keyword-only | float | 0.5 | |
verify | keyword-only | `bool | str` | True |
user_agent | keyword-only | `str | None` | None |
http_client | keyword-only | `httpx.AsyncClient | None` | None |
Returns: None
Raises:
Attributes
| Attribute | Type | Notes |
|---|---|---|
base_url | Any | — |
auth | Any | Session inspection plus token and account sub-resources. |
max_retries | Any | — |
backoff_factor | Any | — |
Properties
project() -> str | None
The ambient project in the current task/thread context.
This callable takes no public parameters.
Returns: str | None
Methods
project(value: str | None) -> None
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
value | positional-or-keyword | `str | None` | — |
Returns: None
aclose() -> None
Close the underlying client, but only one we created.
A caller who passed their own client owns its lifetime; closing it here would break the next thing that used it.
This callable takes no public parameters.
Returns: None
__aenter__() -> AsyncTransport
Return this instance so it can be used inside an async context manager.
This callable takes no public parameters.
Returns: AsyncTransport
__aexit__(*_: object) -> None
Close any owned resources when leaving the async context manager.
| Parameter | Kind | Type | Default |
|---|---|---|---|
_ | var-positional | object | — |
Returns: None
url_for(path: str) -> str
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
Returns: str
bootstrap_csrf() -> str | None
Fetch a CSRF token up front so browser-style authenticated writes can reuse it.
This callable takes no public parameters.
Returns: str | None
request(method: str, path: str, *, params: Mapping[str, Any] | None = None, json = None, headers: Mapping[str, str] | None = None, files = None, data: Mapping[str, Any] | None = None, timeout: float | None = None, project: str | UnsetProjectType | None = UNSET_PROJECT, _csrf_retry: bool = True) -> Response
Perform one API call, returning the unwrapped payload.
`project pins the request's X-CALIBER-Project header the same way it does on the synchronous :class:~caliber_sdk.transport.Transport -- see its request()` docstring.
| Parameter | Kind | Type | Default | ||
|---|---|---|---|---|---|
method | positional-or-keyword | str | — | ||
path | positional-or-keyword | str | — | ||
params | keyword-only | `Mapping[str, Any] | None` | None | |
json | keyword-only | Any | None | ||
headers | keyword-only | `Mapping[str, str] | None` | None | |
files | keyword-only | Any | None | ||
data | keyword-only | `Mapping[str, Any] | None` | None | |
timeout | keyword-only | `float | None` | None | |
project | keyword-only | `str | UnsetProjectType | None` | UNSET_PROJECT |
_csrf_retry | keyword-only | bool | True |
Returns: Response
Raises:
get(path: str, **kwargs) -> Response
Fetch one record from the transport surface identified by path.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
post(path: str, **kwargs) -> Response
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
put(path: str, **kwargs) -> Response
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
patch(path: str, **kwargs) -> Response
Send a prepared request asynchronously through the shared transport and decode the typed response wrapper.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
delete(path: str, **kwargs) -> Response
Delete a record on the transport surface and return the server acknowledgement.
| Parameter | Kind | Type | Default |
|---|---|---|---|
path | positional-or-keyword | str | — |
kwargs | var-keyword | Any | — |
Returns: Response
Raises:
download(path: str, *, project: str | UnsetProjectType | None = UNSET_PROJECT, **kwargs) -> bytes
Fetch raw bytes: no envelope, no decoding.
| Parameter | Kind | Type | Default | ||
|---|---|---|---|---|---|
path | positional-or-keyword | str | — | ||
project | keyword-only | `str | UnsetProjectType | None` | UNSET_PROJECT |
kwargs | var-keyword | Any | — |
Returns: bytes
Raises:
stream_lines(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | None = None) -> AsyncIterator[str]
Yield lines from a server-sent-events endpoint.
The method this whole module exists for. No default timeout: a stream staying open is the success case, not a hang.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
timeout | keyword-only | `float | None` | None |
Returns: AsyncIterator[str]
Raises:
paginate(path: str, *, params: Mapping[str, Any] | None = None, limit: int = 100) -> AsyncIterator[Any]
Yield items across `limit/offset` pages.
| Parameter | Kind | Type | Default | |
|---|---|---|---|---|
path | positional-or-keyword | str | — | |
params | keyword-only | `Mapping[str, Any] | None` | None |
limit | keyword-only | int | 100 |
Returns: AsyncIterator[Any]
Raises:
Module caliber_sdk.aio.waiters
Async waiters, holding the same polling policy as the synchronous ones.
Tested example
def run_and_wait(
caliber: CaliberClient, *, workflow_id: str, alias: str = "prod"sdk/caliber-sdk/examples/workflow_run.py — executed by the SDK test suite.Public exports
DEFAULT_BACKOFF, DEFAULT_INTERVAL, DEFAULT_MAX_INTERVAL, DEFAULT_TIMEOUT, WaitFailed, WaitTimeout, wait_for, wait_for_terminal_state
Functions
wait_for(poll: Callable[[], Awaitable[T]], *, is_done: Callable[[T], bool], timeout: float = DEFAULT_TIMEOUT, interval: float = DEFAULT_INTERVAL, max_interval: float = DEFAULT_MAX_INTERVAL, backoff: float = DEFAULT_BACKOFF) -> T
Poll until `is_done` or the timeout expires.
A waiter never decides what "finished" means -- the caller supplies the predicate, because only they know whether a `failed` run is a successful outcome for their script.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], Awaitable[T]] | — |
is_done | keyword-only | Callable[[T], bool] | — |
timeout | keyword-only | float | DEFAULT_TIMEOUT |
interval | keyword-only | float | DEFAULT_INTERVAL |
max_interval | keyword-only | float | DEFAULT_MAX_INTERVAL |
backoff | keyword-only | float | DEFAULT_BACKOFF |
Returns: T
Raises:
ValueErrorWaitTimeout
wait_for_terminal_state(poll: Callable[[], Awaitable[Any]], *, terminal: frozenset[str] = TERMINAL_STATES, failure: frozenset[str] = FAILURE_STATES, raise_on_failure: bool = True, **options) -> Any
Poll until a payload reports a terminal status.
`raise_on_failure` defaults to True because a script that waited for work and got a failure almost always wants to stop there.
| Parameter | Kind | Type | Default |
|---|---|---|---|
poll | positional-or-keyword | Callable[[], Awaitable[Any]] | — |
terminal | keyword-only | frozenset[str] | TERMINAL_STATES |
failure | keyword-only | frozenset[str] | FAILURE_STATES |
raise_on_failure | keyword-only | bool | True |
options | var-keyword | Any | — |
Returns: Any
Raises: