From 40d9167caef906bd5ec6194ead868dbb10d91a64 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 15 Apr 2024 14:37:22 -0700 Subject: [PATCH] test(test_amazing_vertex_completion.py): fix vertex anthropic streaming text --- litellm/tests/test_amazing_vertex_completion.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/litellm/tests/test_amazing_vertex_completion.py b/litellm/tests/test_amazing_vertex_completion.py index 16bddf44f2..f923339c09 100644 --- a/litellm/tests/test_amazing_vertex_completion.py +++ b/litellm/tests/test_amazing_vertex_completion.py @@ -145,7 +145,7 @@ def test_vertex_ai_anthropic(): # reason="Local test. Vertex AI Quota is low. Leads to rate limit errors on ci/cd." # ) def test_vertex_ai_anthropic_streaming(): - load_vertex_ai_credentials() + # load_vertex_ai_credentials() # litellm.set_verbose = True @@ -153,6 +153,8 @@ def test_vertex_ai_anthropic_streaming(): vertex_ai_project = "adroit-crow-413218" vertex_ai_location = "asia-southeast1" + json_obj = get_vertex_ai_creds_json() + vertex_credentials = json.dumps(json_obj) response = completion( model="vertex_ai/" + model, @@ -205,12 +207,14 @@ async def test_vertex_ai_anthropic_async(): # ) @pytest.mark.asyncio async def test_vertex_ai_anthropic_async_streaming(): - load_vertex_ai_credentials() - + # load_vertex_ai_credentials() + litellm.set_verbose = True model = "claude-3-sonnet@20240229" vertex_ai_project = "adroit-crow-413218" vertex_ai_location = "asia-southeast1" + json_obj = get_vertex_ai_creds_json() + vertex_credentials = json.dumps(json_obj) response = await acompletion( model="vertex_ai/" + model, @@ -218,6 +222,8 @@ async def test_vertex_ai_anthropic_async_streaming(): temperature=0.7, vertex_ai_project=vertex_ai_project, vertex_ai_location=vertex_ai_location, + vertex_credentials=vertex_credentials, + stream=True, ) async for chunk in response: