Skip to content

Commit

Permalink
fix: improve import error message, and check run test earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed Dec 20, 2024
1 parent 7bc84da commit 80f1d7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions litellm/llms/vertex_ai/vertex_ai_partner_models/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def completion(
from litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (
VertexLLM,
)
except Exception:
except Exception as e:

Check warning on line 99 in litellm/llms/vertex_ai/vertex_ai_partner_models/main.py

View check run for this annotation

Codecov / codecov/patch

litellm/llms/vertex_ai/vertex_ai_partner_models/main.py#L99

Added line #L99 was not covered by tests
raise VertexAIError(
status_code=400,
message="""vertexai import failed please run `pip install -U "google-cloud-aiplatform>=1.38"`""",
message=f"""vertexai import failed please run `pip install -U "google-cloud-aiplatform>=1.38"`. Got error: {e}""",
)

if not (
Expand Down
4 changes: 2 additions & 2 deletions litellm/llms/vertex_ai/vertex_model_garden/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def completion(
from litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (
VertexLLM,
)
except Exception:
except Exception as e:

Check warning on line 78 in litellm/llms/vertex_ai/vertex_model_garden/main.py

View check run for this annotation

Codecov / codecov/patch

litellm/llms/vertex_ai/vertex_model_garden/main.py#L78

Added line #L78 was not covered by tests

raise VertexAIError(
status_code=400,
message="""vertexai import failed please run `pip install -U "google-cloud-aiplatform>=1.38"`""",
message=f"""vertexai import failed please run `pip install -U "google-cloud-aiplatform>=1.38"`. Got error: {e}""",
)

if not (
Expand Down
4 changes: 2 additions & 2 deletions tests/local_testing/test_amazing_vertex_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"gemini-1.5-flash-exp-0827",
"gemini-pro-flash",
"gemini-1.5-flash-exp-0827",
"gemini-2.0-flash-exp"
"gemini-2.0-flash-exp",
]


Expand Down Expand Up @@ -308,7 +308,7 @@ async def test_vertex_ai_anthropic_async():
# )
@pytest.mark.asyncio
@pytest.mark.flaky(retries=3, delay=1)
async def test_vertex_ai_anthropic_async_streaming():
async def test_aaavertex_ai_anthropic_async_streaming():
# load_vertex_ai_credentials()
try:
litellm.set_verbose = True
Expand Down

0 comments on commit 80f1d7a

Please sign in to comment.