La documentation est disponible en anglais.

Documentation / Python SDK deep dive

Governance policies

Module on/off (cache, RAG, compression, PII) is policy-driven. SDK helpers wrap GET/POST/PATCH/DELETE /sdk/governance/policies and GET /sdk/pipeline-settings.

from tokensaver_sdk import TokenSaver

ts = TokenSaver(api_key="ts_...")

# Read plan + effective modules
settings = ts.get_pipeline_settings()
print(settings["plan_features"]["has_cache"])
print(ts.effective_modules())

# Enable cache on this key
policy = ts.create_governance_policy(
    "Production cache",
    kind="cache",
    config={
        "exact_cache": True,
        "semantic_cache": True,
        "similarity_threshold": 0.85,
    },
)

# Disable later
ts.update_governance_policy(policy["id"], enabled=False)
# or: ts.delete_governance_policy(policy["id"])

List inherited org/workspace policies: list_governance_policies(). Filter: list_governance_policies(kind="rag"). Thresholds without toggling modules: patch_pipeline_settings.

HTTP reference (curl, no SDK): native/governance-policies, native/pipeline-settings. Full method cards: Governance section in the complete reference.