diff --git a/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py b/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py index 3338e4ea8eb..8414db46134 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py +++ b/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py @@ -41,6 +41,10 @@ SUPPORTED_EVENT_HOOKS: Final = (GuardrailEventHooks.pre_call, GuardrailEventHook class AiriaGuardrail(CustomGuardrail): """Evaluates prompts and responses against your Airia guardrail policy.""" + @classmethod + def get_supported_event_hooks(cls) -> list[GuardrailEventHooks]: + return [*SUPPORTED_EVENT_HOOKS] + def __init__( self, api_base: str | None = None, diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_airia.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_airia.py index d331c9e200d..5c37b3bdbb6 100644 --- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_airia.py +++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_airia.py @@ -85,6 +85,13 @@ def test_during_call_is_not_a_supported_event_hook() -> None: assert list(hooks) == [GuardrailEventHooks.pre_call, GuardrailEventHooks.post_call] +def test_supported_event_hooks_are_exposed_for_ui() -> None: + assert AiriaGuardrail.get_supported_event_hooks() == [ + GuardrailEventHooks.pre_call, + GuardrailEventHooks.post_call, + ] + + @pytest.mark.parametrize("missing", ["api_base", "api_key"]) def test_missing_credentials_raise_at_construction(missing: str, monkeypatch: pytest.MonkeyPatch) -> None: """Fail at startup rather than on the first request."""