From 53e62866225c7e62dbe655d8a55b81a9bdda068b Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 4 Jun 2024 22:11:11 -0700 Subject: [PATCH] fix VertexAIException APIError --- litellm/utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index bb59012d22..a2a2371237 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -9185,7 +9185,14 @@ def exception_type( model=model, llm_provider="vertex_ai", litellm_debug_info=extra_information, - request=original_exception.request, + request=getattr( + original_exception, + "request", + httpx.Request( + method="POST", + url=" https://cloud.google.com/vertex-ai/", + ), + ), ) elif custom_llm_provider == "palm" or custom_llm_provider == "gemini": if "503 Getting metadata" in error_str: