Skip to content

Commit c9b8677

Browse files
committed
test_system_message_with_no_user_message
1 parent 7ff93cd commit c9b8677

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

tests/llm_translation/base_llm_unit_tests.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,28 +120,6 @@ def test_developer_role_translation(self):
120120

121121
assert response.choices[0].message.content is not None
122122

123-
def test_system_message_with_no_user_message(self):
124-
"""
125-
Test that the system message is translated correctly for non-OpenAI providers.
126-
"""
127-
base_completion_call_args = self.get_base_completion_call_args()
128-
messages = [
129-
{
130-
"role": "system",
131-
"content": "Be a good bot!",
132-
},
133-
]
134-
try:
135-
response = self.completion_function(
136-
**base_completion_call_args,
137-
messages=messages,
138-
)
139-
assert response is not None
140-
except litellm.InternalServerError:
141-
pytest.skip("Model is overloaded")
142-
143-
assert response.choices[0].message.content is not None
144-
145123
def test_content_list_handling(self):
146124
"""Check if content list is supported by LLM API"""
147125
base_completion_call_args = self.get_base_completion_call_args()

tests/llm_translation/test_gemini.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,3 +624,22 @@ async def test_gemini_image_generation_async_stream():
624624
assert model_response_image is not None
625625
assert model_response_image["url"].startswith("data:image/png;base64,")
626626

627+
628+
def test_system_message_with_no_user_message():
629+
"""
630+
Test that the system message is translated correctly for non-OpenAI providers.
631+
"""
632+
messages = [
633+
{
634+
"role": "system",
635+
"content": "Be a good bot!",
636+
},
637+
]
638+
639+
response = litellm.completion(
640+
model="gemini/gemini-2.5-flash",
641+
messages=messages,
642+
)
643+
assert response is not None
644+
645+
assert response.choices[0].message.content is not None

0 commit comments

Comments
 (0)