Health¶
Raw provider health/availability signals. See the Provider health guide for how to compose your own "available" predicate.
check_providers¶
check_providers
¶
check_providers(names: list[str] | None = None, *, live: bool = False, model: str | None = None) -> list[ProviderHealth]
Return ProviderHealth for each registered provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
list[str] | None
|
Provider names/aliases to check, or |
None
|
live
|
bool
|
If True, run the live probe per provider (costs a request each). |
False
|
model
|
str | None
|
Optional model string passed through to the live probe. |
None
|
Returns:
| Type | Description |
|---|---|
list[ProviderHealth]
|
One |
list[ProviderHealth]
|
(or registration order when |
Source code in caw/health.py
ProviderHealth¶
ProviderHealth
dataclass
¶
ProviderHealth(provider: str, installed: bool, binary_path: str | None = None, auth: AuthSignal | None = None, probed: bool = False, rate_limited: bool | None = None, wait_minutes: int | None = None, error: str | None = None)
Raw health signals for a single provider. No 'available' verdict.
AuthSignal¶
AuthSignal
dataclass
¶
AuthSignal(present: bool, detail: str, credentials_path: str | None = None, token_expires_at: datetime | None = None, token_expired: bool | None = None)
Best-effort, non-authoritative view of a provider's credentials.
Every field is a raw signal; None means "could not determine" rather
than a negative result. Detection is intentionally cheap and may miss
valid setups (e.g. credentials supplied by an env var we don't know about),
so callers should treat a falsy present as a hint, not a verdict.