Calling the System One API
- Async
- Sync
Typed system_one responses
It is possible to provide a response model to system_one to make using the response more type-safe:
Custom response types
It is also possible to define a completely new response model without inheriting fromSystemOneResponse:
Choosing a model
Inspect the available models:Retries
Pass a customRetryPolicy as retry on the client or per call.
- Client
- Per-call
Error handling
Handle exceptions raised by the SDK:Logging
The SDK logs to thetypesafe_sdk logger. Configure it according to standard logging guide:
TYPESAFE_LOG_LEVEL to one of debug, info, warning, error, or off before importing the SDK.
info logs one summary line per request; debug also logs request and response headers and bodies. Secret headers — authorization, API keys, cookies, and any header whose name contains token or secret — are redacted from log output. Request and response bodies are not redacted.
Environment variables
The SDK reads and uses the following environment variables:
See the constants reference for SDK defaults.
Forward compatibility
The SDK keeps working as the CosVec API evolves, so you can adopt new API features before an SDK release adds first-class support for them.Extra request fields
Send request fields this SDK version predates withextra_body:
Raw question dictionaries
Unknown answer kinds
The SDK logs a warning and skips unrecognized answer kinds. Useraw_http_response to inspect the complete API response, including those answers: