From 20ae67a3ba36b1dc7e8d67c638762d013596c7ee Mon Sep 17 00:00:00 2001 From: Cesar Garcia <128240629+Chesars@users.noreply.github.com> Date: Fri, 13 Feb 2026 01:39:55 -0300 Subject: [PATCH] fix(vertex): map IMAGE_PROHIBITED_CONTENT finish reason to content_filter (#20524) Closes #20357 --- .../llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py index 04ae4b6beb8..ad046cf7109 100644 --- a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py +++ b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py @@ -1196,6 +1196,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): "PROHIBITED_CONTENT": "The token generation was stopped as the response was flagged for the prohibited contents.", "SPII": "The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents.", "IMAGE_SAFETY": "The token generation was stopped as the response was flagged for image safety reasons.", + "IMAGE_PROHIBITED_CONTENT": "The token generation was stopped as the response was flagged for prohibited image content.", } @staticmethod @@ -1218,6 +1219,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): "SPII": "content_filter", "MALFORMED_FUNCTION_CALL": "malformed_function_call", # openai doesn't have a way of representing this "IMAGE_SAFETY": "content_filter", + "IMAGE_PROHIBITED_CONTENT": "content_filter", } def translate_exception_str(self, exception_string: str):