mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
add TestInsultsContentFilter eval class
This commit is contained in:
parent
21e2eeb714
commit
1ac191bff8
1 changed files with 19 additions and 0 deletions
|
|
@ -227,6 +227,25 @@ def _content_filter(category: str):
|
|||
return _ContentFilterChecker(guardrail)
|
||||
|
||||
|
||||
class TestInsultsContentFilter:
|
||||
"""Insults eval with production ContentFilterGuardrail + denied_insults.yaml."""
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def blocker(self):
|
||||
return _content_filter("denied_insults")
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def cases(self):
|
||||
return _load_jsonl("block_insults.jsonl")
|
||||
|
||||
def test_confusion_matrix(self, blocker, cases):
|
||||
_confusion_matrix(
|
||||
blocker,
|
||||
cases,
|
||||
"Block Insults — ContentFilter (denied_insults.yaml)",
|
||||
)
|
||||
|
||||
|
||||
class TestInvestmentContentFilter:
|
||||
"""Investment eval with production ContentFilterGuardrail + denied_financial_advice.yaml."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue