From e4ad792d5d51d4ea5ad4483985154bb881c53ef3 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 9 Jul 2024 09:44:18 -0700 Subject: [PATCH] async test assistants --- litellm/tests/test_assistants.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/litellm/tests/test_assistants.py b/litellm/tests/test_assistants.py index 929eafe2df4..e84a4f1acdc 100644 --- a/litellm/tests/test_assistants.py +++ b/litellm/tests/test_assistants.py @@ -62,7 +62,7 @@ async def test_get_assistants(provider, sync_mode): @pytest.mark.parametrize("provider", ["openai"]) @pytest.mark.parametrize( "sync_mode", - [True, False], + [False], ) @pytest.mark.asyncio async def test_create_assistants(provider, sync_mode): @@ -86,8 +86,20 @@ async def test_create_assistants(provider, sync_mode): ) assert assistant.id is not None else: - assistants = await litellm.aget_assistants(**data) - assert isinstance(assistants, AsyncCursorPage) + assistant = await litellm.acreate_assistants( + custom_llm_provider="openai", + model="gpt-4-turbo", + instructions="You are a personal math tutor. When asked a question, write and run Python code to answer the question.", + name="Math Tutor", + tools=[{"type": "code_interpreter"}], + ) + print("New assistants", assistant) + assert isinstance(assistant, Assistant) + assert ( + assistant.instructions + == "You are a personal math tutor. When asked a question, write and run Python code to answer the question." + ) + assert assistant.id is not None @pytest.mark.parametrize("provider", ["openai", "azure"])