mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix import error guardrails
This commit is contained in:
parent
027eab5dfd
commit
b919a1a42e
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
import litellm
|
import litellm
|
||||||
|
@ -5,6 +7,10 @@ from litellm._logging import verbose_proxy_logger
|
||||||
from litellm.proxy.proxy_server import LiteLLM_TeamTable, UserAPIKeyAuth
|
from litellm.proxy.proxy_server import LiteLLM_TeamTable, UserAPIKeyAuth
|
||||||
from litellm.types.guardrails import *
|
from litellm.types.guardrails import *
|
||||||
|
|
||||||
|
sys.path.insert(
|
||||||
|
0, os.path.abspath("../..")
|
||||||
|
) # Adds the parent directory to the system path
|
||||||
|
|
||||||
|
|
||||||
def can_modify_guardrails(team_obj: Optional[LiteLLM_TeamTable]) -> bool:
|
def can_modify_guardrails(team_obj: Optional[LiteLLM_TeamTable]) -> bool:
|
||||||
if team_obj is None:
|
if team_obj is None:
|
||||||
|
|
|
@ -113,7 +113,9 @@ def init_guardrails_v2(all_guardrails: dict):
|
||||||
|
|
||||||
# Init guardrail CustomLoggerClass
|
# Init guardrail CustomLoggerClass
|
||||||
if litellm_params["guardrail"] == "aporia":
|
if litellm_params["guardrail"] == "aporia":
|
||||||
from guardrail_hooks.aporia_ai import _ENTERPRISE_Aporia
|
from litellm.proxy.guardrails.guardrail_hooks.aporia_ai import (
|
||||||
|
_ENTERPRISE_Aporia,
|
||||||
|
)
|
||||||
|
|
||||||
_aporia_callback = _ENTERPRISE_Aporia(
|
_aporia_callback = _ENTERPRISE_Aporia(
|
||||||
api_base=litellm_params["api_base"],
|
api_base=litellm_params["api_base"],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue