fix: add 'block' to on_violation Literal type in BaseLitellmParams

Fixes BerriAI/litellm#23624. The on_violation field only allowed 'warn' and
'end_session', but 'block' is a valid value used in guardrail configs. This
caused a pydantic validation error when loading guardrails from the database.
This commit is contained in:
Alvin Tang 2026-03-14 20:47:08 +08:00
parent 25ee2fb3f9
commit 6adb6a632d

View file

@ -656,7 +656,7 @@ class BaseLitellmParams(
default=None,
description="For /v1/realtime sessions: automatically close the session after this many guardrail violations.",
)
on_violation: Optional[Literal["warn", "end_session"]] = Field(
on_violation: Optional[Literal["warn", "end_session", "block"]] = Field(
default=None,
description="For /v1/realtime sessions: 'warn' speaks the violation message and continues; 'end_session' speaks the message and closes the connection.",
)