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_system_message_with_no_user_message

Ishaan Jaffc9b86775a76b
diff --git a/tests/llm_translation/base_llm_unit_tests.py b/tests/llm_translation/base_llm_unit_tests.py
index 9e2af871787..d36ed944292 100644
--- a/tests/llm_translation/base_llm_unit_tests.py
+++ b/tests/llm_translation/base_llm_unit_tests.py
@@ -120,28 +120,6 @@ class BaseLLMChatTest(ABC):
assert response.choices[0].message.content is not None
- def test_system_message_with_no_user_message(self):
- """
- Test that the system message is translated correctly for non-OpenAI providers.
- """
- base_completion_call_args = self.get_base_completion_call_args()
- messages = [
- {
- "role": "system",
- "content": "Be a good bot!",
- },
- ]
- try:
- response = self.completion_function(
- **base_completion_call_args,
- messages=messages,
- )
- assert response is not None
- except litellm.InternalServerError:
- pytest.skip("Model is overloaded")
-
- assert response.choices[0].message.content is not None
-
def test_content_list_handling(self):
"""Check if content list is supported by LLM API"""
base_completion_call_args = self.get_base_completion_call_args()
diff --git a/tests/llm_translation/test_gemini.py b/tests/llm_translation/test_gemini.py
index 08caf5b6147..22a54b8a56b 100644
--- a/tests/llm_translation/test_gemini.py
+++ b/tests/llm_translation/test_gemini.py
@@ -624,3 +624,22 @@ async def test_gemini_image_generation_async_stream():
assert model_response_image is not None
assert model_response_image["url"].startswith("data:image/png;base64,")
+
+def test_system_message_with_no_user_message():
+ """
+ Test that the system message is translated correctly for non-OpenAI providers.
+ """
+ messages = [
+ {
+ "role": "system",
+ "content": "Be a good bot!",
+ },
+ ]
+
+ response = litellm.completion(
+ model="gemini/gemini-2.5-flash",
+ messages=messages,
+ )
+ assert response is not None
+
+ assert response.choices[0].message.content is not None
\ No newline at end of file