mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
feat(guardrails.py): return specific litellm params in /guardrails/list
endpoint
support returning mode, default_on and guardrail name on `/guardrails/list` endpoint
This commit is contained in:
parent
93595826fb
commit
e9a861ec32
4 changed files with 54 additions and 5 deletions
|
@ -90,3 +90,24 @@ def test_guardrail_list_of_event_hooks():
|
|||
assert not cg.should_run_guardrail(
|
||||
data=data, event_type=GuardrailEventHooks.during_call
|
||||
)
|
||||
|
||||
|
||||
def test_guardrail_info_response():
|
||||
from litellm.types.guardrails import GuardrailInfoResponse, LitellmParams
|
||||
|
||||
guardrail_info = GuardrailInfoResponse(
|
||||
guardrail_name="aporia-pre-guard",
|
||||
litellm_params=LitellmParams(
|
||||
guardrail="aporia",
|
||||
mode="pre_call",
|
||||
),
|
||||
guardrail_info={
|
||||
"guardrail_name": "aporia-pre-guard",
|
||||
"litellm_params": {
|
||||
"guardrail": "aporia",
|
||||
"mode": "always_on",
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
assert guardrail_info.litellm_params.default_on == False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue