feat: upgrade MiniMax default model to M2.7

- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to supported models list
- Update docstring to list M2.7 models before M2.5
- Update README/README_CHS model references
- Add unit tests for M2.7 and M2.7-highspeed models
- Keep all previous models as alternatives
This commit is contained in:
PR Bot
2026-03-18 16:33:04 +08:00
parent 1036c5fbc1
commit 1432266694
4 changed files with 42 additions and 4 deletions
+36
View File
@@ -155,6 +155,42 @@ class TestMiniMaxProvider(unittest.TestCase):
class TestMiniMaxProviderModels(unittest.TestCase):
"""Test cases for MiniMax provider model configurations."""
@patch('sources.llm_provider.OpenAI')
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
def test_minimax_m27_model(self, mock_openai_class):
"""Test MiniMax-M2.7 model."""
mock_client = MagicMock()
mock_openai_class.return_value = mock_client
mock_response = MagicMock()
mock_response.choices = [MagicMock(message=MagicMock(content="Response"))]
mock_client.chat.completions.create.return_value = mock_response
with patch.object(Provider, 'get_api_key', return_value='test-key'):
provider = Provider("minimax", "MiniMax-M2.7", is_local=False)
history = [{"role": "user", "content": "Hello"}]
provider.minimax_fn(history)
call_kwargs = mock_client.chat.completions.create.call_args[1]
self.assertEqual(call_kwargs['model'], "MiniMax-M2.7")
@patch('sources.llm_provider.OpenAI')
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
def test_minimax_m27_highspeed_model(self, mock_openai_class):
"""Test MiniMax-M2.7-highspeed model."""
mock_client = MagicMock()
mock_openai_class.return_value = mock_client
mock_response = MagicMock()
mock_response.choices = [MagicMock(message=MagicMock(content="Response"))]
mock_client.chat.completions.create.return_value = mock_response
with patch.object(Provider, 'get_api_key', return_value='test-key'):
provider = Provider("minimax", "MiniMax-M2.7-highspeed", is_local=False)
history = [{"role": "user", "content": "Hello"}]
provider.minimax_fn(history)
call_kwargs = mock_client.chat.completions.create.call_args[1]
self.assertEqual(call_kwargs['model'], "MiniMax-M2.7-highspeed")
@patch('sources.llm_provider.OpenAI')
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
def test_minimax_m25_model(self, mock_openai_class):