mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(ztds): add guardrail_name attribute and standalone fallback handling
This commit is contained in:
parent
7dd8632471
commit
d8aec05451
1 changed files with 3 additions and 1 deletions
|
|
@ -22,7 +22,8 @@ except ImportError:
|
|||
# Standalone fallback when running outside full LiteLLM package
|
||||
class CustomGuardrail:
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
pass
|
||||
for k, v in kwargs.items():
|
||||
setattr(self, k, v)
|
||||
|
||||
|
||||
class ZTDSGuardrail(CustomGuardrail):
|
||||
|
|
@ -52,6 +53,7 @@ class ZTDSGuardrail(CustomGuardrail):
|
|||
**kwargs: Any,
|
||||
):
|
||||
super().__init__(guardrail_name=guardrail_name, **kwargs)
|
||||
self.guardrail_name = guardrail_name or kwargs.get("guardrail_name", "ztds")
|
||||
self.enabled_entities = enabled_entities or list(self.PATTERNS.keys())
|
||||
self.reverse_on_output = reverse_on_output
|
||||
self.enforce_zero_egress = enforce_zero_egress
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue