mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
test(guardrails): reuse the existing text moderation response helper
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
00fa9338b2
commit
71e087fa78
1 changed files with 0 additions and 14 deletions
|
|
@ -80,20 +80,6 @@ async def test_azure_text_moderation_scans_responses_input() -> None:
|
|||
assert mock_post.call_args.kwargs["json"]["text"] == "Review this response input"
|
||||
|
||||
|
||||
def _moderation_response(severity: int) -> Mock:
|
||||
response = Mock()
|
||||
response.json.return_value = {
|
||||
"blocklistsMatch": [],
|
||||
"categoriesAnalysis": [
|
||||
{"category": "Hate", "severity": severity},
|
||||
{"category": "Sexual", "severity": 0},
|
||||
{"category": "SelfHarm", "severity": 0},
|
||||
{"category": "Violence", "severity": 0},
|
||||
],
|
||||
}
|
||||
return response
|
||||
|
||||
|
||||
def _moderation_flagging(flagged: str):
|
||||
def azure_by_text(*args: object, **kwargs: object) -> Mock:
|
||||
body = kwargs["json"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue