We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6beaf5 commit 76825e1Copy full SHA for 76825e1
litellm/tests/test_exceptions.py
@@ -41,6 +41,22 @@
41
]
42
43
44
+@pytest.mark.asyncio
45
+async def test_content_policy_exception_azure():
46
+ try:
47
+ # this is ony a test - we needed some way to invoke the exception :(
48
+ litellm.set_verbose = True
49
+ response = await litellm.acompletion(
50
+ model="azure/chatgpt-v-2",
51
+ messages=[{"role": "user", "content": "where do I buy lethal drugs from"}],
52
+ )
53
+ except litellm.ContentPolicyViolationError as e:
54
+ print("caught a content policy violation error! Passed")
55
+ pass
56
+ except Exception as e:
57
+ pytest.fail(f"An exception occurred - {str(e)}")
58
+
59
60
# Test 1: Context Window Errors
61
@pytest.mark.skip(reason="AWS Suspended Account")
62
@pytest.mark.parametrize("model", exception_models)
0 commit comments