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]

Revert "test_completion_mistral_api_mistral_large_function_call"

Ishaan Jaffb30e05b54fd9
diff --git a/litellm/litellm_core_utils/llm_request_utils.py b/litellm/litellm_core_utils/llm_request_utils.py
index b322d598caa..50dbdc5536e 100644
--- a/litellm/litellm_core_utils/llm_request_utils.py
+++ b/litellm/litellm_core_utils/llm_request_utils.py
@@ -27,10 +27,6 @@ def _ensure_extra_body_is_safe(extra_body: Optional[Dict]) -> Optional[Dict]:
if _prompt is not None and hasattr(_prompt, "__dict__"):
extra_body["metadata"]["prompt"] = _prompt.__dict__
- if len(extra_body) == 0:
- # don't send empty extra_body, providers like mistral will throw an error
- return None
-
return extra_body
diff --git a/litellm/utils.py b/litellm/utils.py
index 12192fc8db4..3893f947ec6 100644
--- a/litellm/utils.py
+++ b/litellm/utils.py
@@ -3470,10 +3470,6 @@ def get_optional_params( # noqa: PLR0915
optional_params["extra_body"] = _ensure_extra_body_is_safe(
extra_body=optional_params["extra_body"]
)
-
- if optional_params["extra_body"] is None:
- # don't pass extra_body if it's empty/None
- optional_params.pop("extra_body", None)
else:
# if user passed in non-default kwargs for specific providers/models, pass them along
for k in passed_params.keys():
diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.py
index 6da4a6cf6be..42e79a59e67 100644
--- a/tests/local_testing/test_completion.py
+++ b/tests/local_testing/test_completion.py
@@ -16,7 +16,7 @@ sys.path.insert(
import os
from unittest.mock import AsyncMock, MagicMock, patch
-from litellm._logging import verbose_logger
+
import pytest
import litellm
@@ -976,10 +976,6 @@ async def test_completion_codestral_chat_api():
def test_completion_mistral_api_mistral_large_function_call():
litellm.set_verbose = True
- import logging
-
- logging.basicConfig(level=logging.DEBUG)
- verbose_logger.setLevel(logging.DEBUG)
tools = [
{
"type": "function",