mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
28 lines
703 B
Python
28 lines
703 B
Python
import os
|
|
import sys
|
|
import traceback
|
|
|
|
sys.path.insert(
|
|
0, os.path.abspath("../..")
|
|
) # Adds the parent directory to the system path
|
|
import litellm
|
|
from litellm_proxy.guardrails.init_guardrails import init_guardrails_v2
|
|
|
|
|
|
def test_guardrails_ai():
|
|
litellm.set_verbose = True
|
|
litellm.guardrail_name_config_map = {}
|
|
|
|
init_guardrails_v2(
|
|
all_guardrails=[
|
|
{
|
|
"guardrail_name": "gibberish-guard",
|
|
"litellm_params": {
|
|
"guardrail": "guardrails_ai",
|
|
"guard_name": "gibberish_guard",
|
|
"mode": "post_call",
|
|
},
|
|
}
|
|
],
|
|
config_file_path="",
|
|
)
|