The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fixes for assistans API tests
Ishaan Jaffa62805f98f8a
diff --git a/litellm/assistants/main.py b/litellm/assistants/main.pyindex 28f4518f152..928b6e8ac2d 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]] = Noneif custom_llm_provider == "openai":api_base = (diff --git a/tests/local_testing/test_assistants.py b/tests/local_testing/test_assistants.pyindex 8d10668720a..592e692b880 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.idelse:- 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 (