forked from phoenix/litellm-mirror
fix(proxy_server.py): fix import
This commit is contained in:
parent
3bb0e24cb7
commit
f24d3ffdb6
2 changed files with 5 additions and 5 deletions
|
@ -70,8 +70,8 @@ class _OPTIONAL_PromptInjectionDetection(CustomLogger):
|
||||||
for prep in self.prepositions:
|
for prep in self.prepositions:
|
||||||
phrase = " ".join(filter(None, [verb, adj, prep])).strip()
|
phrase = " ".join(filter(None, [verb, adj, prep])).strip()
|
||||||
if (
|
if (
|
||||||
len(phrase.split()) > 1
|
len(phrase.split()) > 2
|
||||||
): # additional check to ensure more than 1 word
|
): # additional check to ensure more than 2 words
|
||||||
combinations.append(phrase.lower())
|
combinations.append(phrase.lower())
|
||||||
return combinations
|
return combinations
|
||||||
|
|
||||||
|
|
|
@ -1818,12 +1818,12 @@ class ProxyConfig:
|
||||||
isinstance(callback, str)
|
isinstance(callback, str)
|
||||||
and callback == "detect_prompt_injection"
|
and callback == "detect_prompt_injection"
|
||||||
):
|
):
|
||||||
from enterprise.enterprise_hooks.prompt_injection_detection import (
|
from litellm.proxy.hooks.prompt_injection_detection import (
|
||||||
_ENTERPRISE_PromptInjectionDetection,
|
_OPTIONAL_PromptInjectionDetection,
|
||||||
)
|
)
|
||||||
|
|
||||||
prompt_injection_detection_obj = (
|
prompt_injection_detection_obj = (
|
||||||
_ENTERPRISE_PromptInjectionDetection()
|
_OPTIONAL_PromptInjectionDetection()
|
||||||
)
|
)
|
||||||
imported_list.append(prompt_injection_detection_obj)
|
imported_list.append(prompt_injection_detection_obj)
|
||||||
elif (
|
elif (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue