feat(proxy_server.py): enable admin to set banned keywords on proxy

This commit is contained in:
Krrish Dholakia 2024-02-22 18:30:42 -08:00
parent 6ad450396b
commit acae98fd50
4 changed files with 177 additions and 0 deletions

View file

@ -1489,6 +1489,16 @@ class ProxyConfig:
blocked_user_list = _ENTERPRISE_BlockedUserList()
imported_list.append(blocked_user_list)
elif (
isinstance(callback, str)
and callback == "banned_keywords"
):
from litellm.proxy.enterprise.enterprise_hooks.banned_keywords import (
_ENTERPRISE_BannedKeywords,
)
banned_keywords_obj = _ENTERPRISE_BannedKeywords()
imported_list.append(banned_keywords_obj)
else:
imported_list.append(
get_instance_fn(