mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
* test: move key-gated tests/test_litellm SDK tests into tests/llm_translation and drop empty folders * test: make token counter and health check unit tests run offline * ci: point unit shards, rust path filter, Makefile and docs at tests/unit * docs: fix stale test_litellm run paths in moved llm_translation tests * fix: correct databricks e2e sys.path depth and contributing example path --------- Co-authored-by: yuneng <yuneng@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
56 lines
1.7 KiB
Python
56 lines
1.7 KiB
Python
"""
|
|
Tests for Xiaomi MiMo provider configuration and integration.
|
|
Related to issue #18794
|
|
"""
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
import litellm
|
|
|
|
|
|
class TestXiaomiMiMoIntegration:
|
|
"""Integration tests for Xiaomi MiMo provider"""
|
|
|
|
def test_xiaomi_mimo_completion_basic(self):
|
|
"""Test basic completion call to Xiaomi MiMo"""
|
|
# Skip test if API key not set in environment
|
|
if not os.environ.get("XIAOMI_MIMO_API_KEY"):
|
|
if pytest:
|
|
pytest.skip("XIAOMI_MIMO_API_KEY not set")
|
|
return
|
|
|
|
try:
|
|
response = litellm.completion(
|
|
model="xiaomi_mimo/mimo-v2-flash",
|
|
messages=[
|
|
{
|
|
"role": "user",
|
|
"content": "Say 'test successful' and nothing else",
|
|
}
|
|
],
|
|
max_tokens=10,
|
|
)
|
|
|
|
# Verify response structure
|
|
assert response is not None
|
|
assert hasattr(response, "choices")
|
|
assert len(response.choices) > 0
|
|
assert hasattr(response.choices[0], "message")
|
|
assert hasattr(response.choices[0].message, "content")
|
|
assert response.choices[0].message.content is not None
|
|
|
|
# Check that we got a response
|
|
content = response.choices[0].message.content.lower()
|
|
assert len(content) > 0
|
|
|
|
print(
|
|
f"✓ Xiaomi MiMo completion successful: {response.choices[0].message.content}"
|
|
)
|
|
|
|
except Exception as e:
|
|
if pytest:
|
|
pytest.fail(f"Xiaomi MiMo completion failed: {str(e)}")
|
|
else:
|
|
raise
|