fix(vertex_ai_anthropic.py): fix import

This commit is contained in:
Krrish Dholakia 2024-04-05 13:37:39 -07:00
parent 54e4326a92
commit 00c0a0c209
2 changed files with 4 additions and 1 deletions

View file

@ -148,6 +148,7 @@ def completion(
): ):
try: try:
import vertexai import vertexai
from anthropic import AnthropicVertex
except: except:
raise VertexAIError( raise VertexAIError(
status_code=400, status_code=400,
@ -162,7 +163,6 @@ def completion(
message="""Upgrade vertex ai. Run `pip install "google-cloud-aiplatform>=1.38"`""", message="""Upgrade vertex ai. Run `pip install "google-cloud-aiplatform>=1.38"`""",
) )
try: try:
from anthropic import AnthropicVertex
## Load Config ## Load Config
config = litellm.VertexAIAnthropicConfig.get_config() config = litellm.VertexAIAnthropicConfig.get_config()

View file

@ -85,6 +85,9 @@ async def get_response():
pytest.fail(f"An error occurred - {str(e)}") pytest.fail(f"An error occurred - {str(e)}")
@pytest.mark.skip(
reason="Local test. Vertex AI Quota is low. Leads to rate limit errors on ci/cd."
)
def test_vertex_ai_anthropic(): def test_vertex_ai_anthropic():
load_vertex_ai_credentials() load_vertex_ai_credentials()