feat(google_text_moderation.py): allow user to use google text moderation for content mod on proxy

This commit is contained in:
Krrish Dholakia 2024-02-17 18:36:29 -08:00
parent 73acdf3736
commit ddf0911c46
4 changed files with 122 additions and 19 deletions

View file

@ -1427,6 +1427,18 @@ class ProxyConfig:
llama_guard_object = _ENTERPRISE_LlamaGuard()
imported_list.append(llama_guard_object)
elif (
isinstance(callback, str)
and callback == "google_text_moderation"
):
from litellm.proxy.enterprise.enterprise_hooks.google_text_moderation import (
_ENTERPRISE_GoogleTextModeration,
)
google_text_moderation_obj = (
_ENTERPRISE_GoogleTextModeration()
)
imported_list.append(google_text_moderation_obj)
else:
imported_list.append(
get_instance_fn(