Skip to content

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]

test fix azure deprecated mistral ai

Ishaan Jaffb3f37b860d5a
diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.py
index ed07331f1d8..b8999a7d442 100644
--- a/tests/local_testing/test_completion.py
+++ b/tests/local_testing/test_completion.py
@@ -132,36 +132,6 @@ def test_null_role_response():
assert response.choices[0].message.role == "assistant"
[email protected]("sync_mode", [True, False])
-async def test_completion_azure_ai_mistral_invalid_params(sync_mode):
- try:
- import os
-
- litellm.set_verbose = True
-
- os.environ["AZURE_AI_API_BASE"] = os.getenv("AZURE_MISTRAL_API_BASE", "")
- os.environ["AZURE_AI_API_KEY"] = os.getenv("AZURE_MISTRAL_API_KEY", "")
-
- data = {
- "model": "azure_ai/mistral",
- "messages": [{"role": "user", "content": "What is the meaning of life?"}],
- "frequency_penalty": 0.1,
- "presence_penalty": 0.1,
- "drop_params": True,
- }
- if sync_mode:
- response: litellm.ModelResponse = completion(**data) # type: ignore
- else:
- response: litellm.ModelResponse = await litellm.acompletion(**data) # type: ignore
-
- assert "azure_ai" in response.model
- except litellm.Timeout as e:
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
def test_completion_azure_command_r():
try:
litellm.set_verbose = True
diff --git a/tests/local_testing/test_streaming.py b/tests/local_testing/test_streaming.py
index 90fe334a652..1f0730ef290 100644
--- a/tests/local_testing/test_streaming.py
+++ b/tests/local_testing/test_streaming.py
@@ -2948,48 +2948,6 @@ def test_azure_streaming_and_function_calling():
pytest.fail(f"Error occurred: {e}")
raise e
-
[email protected]("sync_mode", [True, False])
-async def test_completion_azure_ai_mistral_invalid_params(sync_mode):
- try:
- import os
- from litellm import stream_chunk_builder
-
- litellm.set_verbose = True
-
- os.environ["AZURE_AI_API_BASE"] = os.getenv("AZURE_MISTRAL_API_BASE", "")
- os.environ["AZURE_AI_API_KEY"] = os.getenv("AZURE_MISTRAL_API_KEY", "")
-
- data = {
- "model": "azure_ai/mistral",
- "messages": [{"role": "user", "content": "What is the meaning of life?"}],
- "frequency_penalty": 0.1,
- "presence_penalty": 0.1,
- "drop_params": True,
- "stream": True,
- }
- chunks = []
- if sync_mode:
- response = completion(**data) # type: ignore
- for chunk in response:
- print(chunk)
- chunks.append(chunk)
- else:
- response = await litellm.acompletion(**data) # type: ignore
-
- async for chunk in response:
- print(chunk)
- chunks.append(chunk)
- print(f"chunks: {chunks}")
- response = stream_chunk_builder(chunks=chunks)
- assert response.choices[0].message.content is not None
- except litellm.Timeout as e:
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
@pytest.mark.asyncio
async def test_azure_astreaming_and_function_calling():
import uuid