From 81841242172df4875f131a969deb4e3b363b51c8 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 23 Apr 2025 11:21:50 -0700 Subject: [PATCH] test: update testing --- .../test_amazing_vertex_completion.py | 53 +------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.py index f3c8e32dc1..97528132c9 100644 --- a/tests/local_testing/test_amazing_vertex_completion.py +++ b/tests/local_testing/test_amazing_vertex_completion.py @@ -147,7 +147,7 @@ async def test_get_response(): prompt = '\ndef count_nums(arr):\n """\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n """\n' try: response = await acompletion( - model="gemini-pro", + model="gemini-1.5-flash", messages=[ { "role": "system", @@ -1844,57 +1844,6 @@ async def test_gemini_pro_function_calling_streaming(sync_mode): pass -@pytest.mark.asyncio -@pytest.mark.flaky(retries=3, delay=1) -async def test_gemini_pro_async_function_calling(): - load_vertex_ai_credentials() - litellm.set_verbose = True - try: - tools = [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location.", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA", - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"], - }, - }, - "required": ["location"], - }, - }, - } - ] - messages = [ - { - "role": "user", - "content": "What's the weather like in Boston today in fahrenheit?", - } - ] - completion = await litellm.acompletion( - model="gemini-pro", messages=messages, tools=tools, tool_choice="auto" - ) - print(f"completion: {completion}") - print(f"message content: {completion.choices[0].message.content}") - assert completion.choices[0].message.content is None - assert len(completion.choices[0].message.tool_calls) == 1 - - # except litellm.APIError as e: - # pass - except litellm.RateLimitError as e: - pass - except Exception as e: - pytest.fail(f"An exception occurred - {str(e)}") - # raise Exception("it worked!") - # asyncio.run(gemini_pro_async_function_calling())