diff --git a/litellm/assistants/main.py b/litellm/assistants/main.py index 28f4518f15..928b6e8ac2 100644 --- a/litellm/assistants/main.py +++ b/litellm/assistants/main.py @@ -304,6 +304,11 @@ def create_assistants( "response_format": response_format, } + # only send params that are not None + create_assistant_data = { + k: v for k, v in create_assistant_data.items() if v is not None + } + response: Optional[Union[Coroutine[Any, Any, Assistant], Assistant]] = None if custom_llm_provider == "openai": api_base = ( diff --git a/tests/local_testing/test_assistants.py b/tests/local_testing/test_assistants.py index 8d10668720..592e692b88 100644 --- a/tests/local_testing/test_assistants.py +++ b/tests/local_testing/test_assistants.py @@ -74,9 +74,10 @@ async def test_get_assistants(provider, sync_mode): @pytest.mark.flaky(retries=3, delay=1) async def test_create_delete_assistants(provider, sync_mode): litellm.ssl_verify = False + litellm._turn_on_debug() data = { "custom_llm_provider": provider, - "model": "gpt-4-turbo", + "model": "gpt-4.5-preview", "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"}], @@ -106,10 +107,7 @@ async def test_create_delete_assistants(provider, sync_mode): print("Response deleting assistant", response) assert response.id == assistant.id else: - assistant = await litellm.acreate_assistants( - custom_llm_provider=provider, - **data, - ) + assistant = await litellm.acreate_assistants(**data) print("New assistants", assistant) assert isinstance(assistant, Assistant) assert (