fix(utils.py): add exception mapping for gemini error

This commit is contained in:
Krrish Dholakia 2024-04-30 14:17:10 -07:00
parent 638477a023
commit 3cc82f558e
2 changed files with 6 additions and 1 deletions

View file

@ -394,6 +394,8 @@ async def test_async_vertexai_response():
pass pass
except litellm.Timeout as e: except litellm.Timeout as e:
pass pass
except litellm.APIError as e:
pass
except Exception as e: except Exception as e:
pytest.fail(f"An exception occurred: {e}") pytest.fail(f"An exception occurred: {e}")

View file

@ -8130,7 +8130,10 @@ def exception_type(
llm_provider="vertex_ai", llm_provider="vertex_ai",
response=original_exception.response, response=original_exception.response,
) )
elif "None Unknown Error." in error_str: elif (
"None Unknown Error." in error_str
or "Content has no parts." in error_str
):
exception_mapping_worked = True exception_mapping_worked = True
raise APIError( raise APIError(
message=f"VertexAIException - {error_str}", message=f"VertexAIException - {error_str}",