Best practices
Operational checklist for keys, logging, module flags, and catalogue alignment.
- Keep API keys in secure server environments only.
- Log request_id for production troubleshooting.
- Use explicit module flags for predictable behavior.
- Align thresholds and pii_options / rag_options with what you validate in the console.
- Use HISTORY_SERVER when several workers share one transcript; pair with attach_knowledge to mirror console document attachment (SDK ≥ 0.1.9).
- Catch typed SDK exceptions instead of relying on raw HTTP status.
- Sync provider / model with GET /api/v1/llm-reference/models (or console selectors) before shipping to avoid LLM_MODEL_NOT_SUPPORTED.
- Omit base_url for the default production API; set it only for staging, self-hosted, or local backends. NETWORK_ERROR often means the host is wrong or unreachable.
- Optional provider_api_key on ask / run_pipeline (or on TokenSaver(...)) overrides organisation keys for that run only; it is never stored. The console UI does not use this field.
