Skip to content

v0.32.0 - June 30, 2026

Choose a tag to compare

@NicoleMGomes NicoleMGomes released this 30 Jun 17:52
· 107 commits to main since this release
6c042e1

What's New

  • Content filtering and Prompt Shield module (sap_cloud_sdk.aicore.filtering): New subpackage that applies SAP AI Core Orchestration v2 content filtering to every sap/* LiteLLM model call. Filtering is enabled by default when set_aicore_config() is called.

    New public types:

    • Severity — Azure Content Safety threshold enum (STRICT=0, LOW=2, MEDIUM=4, OFF=6).
    • AzureContentFilter — configures per-category thresholds (hate, violence, sexual, self_harm) plus optional prompt_shield (jailbreak + indirect-injection detection).
    • LlamaGuard38bFilter — opt-in Llama Guard 3 8B filter with per-category boolean toggles.
    • ContentFilter — abstract base for custom provider implementations.
    • InputFiltering / OutputFiltering — direction-specific filter stacks.
    • ContentFiltering — top-level configuration container passed to set_filtering().

    New exception types:

    • ContentFilteredError — raised when a filter blocks input or output; exposes direction ("input" or "output"), details (severity scores), and request_id.
    • OrchestrationError — base class for all orchestration-module errors.
  • set_filtering(config?) and disable_filtering() (sap_cloud_sdk.aicore): New public functions to install or remove a ContentFiltering configuration at runtime. set_filtering() with no argument re-applies env-var-driven defaults.

  • completion() and acompletion() (sap_cloud_sdk.aicore): Thin sync/async wrappers around litellm.completion / litellm.acompletion that normalise input-filter rejections (HTTP 400) and output-filter rejections (finish_reason="content_filter") into a single ContentFilteredError type, so callers need only one except clause.

  • set_aicore_config() now auto-activates filtering: After loading credentials, set_aicore_config() automatically calls set_filtering() to install filtering at Severity.MEDIUM on all categories with Prompt Shield enabled. Set AICORE_FILTER_ENABLED=false before calling set_aicore_config() to opt out.

Contributors