From db188507b9f7b0a5ecb732a430d572d156254241 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Sat, 16 Dec 2023 18:31:55 +0530 Subject: [PATCH] (test) gemini pro vision --- .../tests/test_amazing_vertex_completion.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/litellm/tests/test_amazing_vertex_completion.py b/litellm/tests/test_amazing_vertex_completion.py index debf8832e..8b6768541 100644 --- a/litellm/tests/test_amazing_vertex_completion.py +++ b/litellm/tests/test_amazing_vertex_completion.py @@ -192,3 +192,34 @@ async def test_async_vertexai_streaming_response(): pytest.fail(f"An exception occurred: {e}") # asyncio.run(test_async_vertexai_streaming_response()) + +def test_gemini_pro_vision(): + try: + litellm.set_verbose = True + litellm.num_retries=0 + resp = litellm.completion( + model = "vertex_ai/gemini-pro-vision", + messages=[ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Whats in this image?" + }, + { + "type": "image_url", + "image_url": { + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" + } + } + ] + } + ], + ) + print(resp) + except Exception as e: + import traceback + traceback.print_exc() + raise e +test_gemini_pro_vision() \ No newline at end of file