From 6e02ac00569d927648742d2b5739232e2e33dea6 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 25 Jun 2024 11:47:39 -0700 Subject: [PATCH] fix(utils.py): add coverage for anthropic content policy error - vertex ai --- litellm/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index 854998901..9f6ebaff0 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -6470,7 +6470,11 @@ def exception_type( ), litellm_debug_info=extra_information, ) - elif "The response was blocked." in error_str: + elif ( + "The response was blocked." in error_str + or "Output blocked by content filtering policy" + in error_str # anthropic on vertex ai + ): exception_mapping_worked = True raise ContentPolicyViolationError( message=f"VertexAIException ContentPolicyViolationError - {error_str}",