From 39b5d8f383dce40ba686abad89209053b5a87a8e Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 27 Sep 2024 20:17:08 -0700 Subject: [PATCH] fix test_vertexai_multimodal_embedding_base64image_in_input --- litellm/tests/test_amazing_vertex_completion.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/litellm/tests/test_amazing_vertex_completion.py b/litellm/tests/test_amazing_vertex_completion.py index f50f0eb25e2..a8706747f10 100644 --- a/litellm/tests/test_amazing_vertex_completion.py +++ b/litellm/tests/test_amazing_vertex_completion.py @@ -2050,12 +2050,19 @@ async def test_vertexai_multimodal_embedding_image_in_input(): @pytest.mark.asyncio async def test_vertexai_multimodal_embedding_base64image_in_input(): + import base64 + + import requests + load_vertex_ai_credentials() mock_response = AsyncMock() - image_path = "../proxy/cached_logo.jpg" - # Getting the base64 string - base64_image = encode_image(image_path) + url = "https://dummyimage.com/100/100/fff&text=Test+image" + response = requests.get(url) + file_data = response.content + + encoded_file = base64.b64encode(file_data).decode("utf-8") + base64_image = f"data:image/png;base64,{encoded_file}" def return_val(): return {