From 5d1fcc545b071b39b867994f52e1682a81c20aa7 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 16 Aug 2024 15:06:12 -0700 Subject: [PATCH] fix predictions image generation response --- litellm/llms/vertex_httpx.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litellm/llms/vertex_httpx.py b/litellm/llms/vertex_httpx.py index ce6a31d7b..b92730613 100644 --- a/litellm/llms/vertex_httpx.py +++ b/litellm/llms/vertex_httpx.py @@ -1499,6 +1499,14 @@ class VertexLLM(BaseLLM): """ _json_response = response.json() + + if "predictions" not in _json_response: + raise litellm.InternalServerError( + message=f"image generation response does not contain 'predictions', got {_json_response}", + llm_provider="vertex_ai", + model=model, + ) + _predictions = _json_response["predictions"] _response_data: List[Image] = []