forked from phoenix/litellm-mirror
feat(llm_guard.py): support llm guard for content moderation
https://github.com/BerriAI/litellm/issues/2056
This commit is contained in:
parent
05d8d550f8
commit
14513af2e2
3 changed files with 227 additions and 0 deletions
|
@ -1467,6 +1467,16 @@ class ProxyConfig:
|
|||
_ENTERPRISE_GoogleTextModeration()
|
||||
)
|
||||
imported_list.append(google_text_moderation_obj)
|
||||
elif (
|
||||
isinstance(callback, str)
|
||||
and callback == "llmguard_moderations"
|
||||
):
|
||||
from litellm.proxy.enterprise.enterprise_hooks.llm_guard import (
|
||||
_ENTERPRISE_LLMGuard,
|
||||
)
|
||||
|
||||
llm_guard_moderation_obj = _ENTERPRISE_LLMGuard()
|
||||
imported_list.append(llm_guard_moderation_obj)
|
||||
else:
|
||||
imported_list.append(
|
||||
get_instance_fn(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue