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:
@@ -240,7 +240,7 @@ provider_server_address = # Typically ignored or can be left blank when is_local
|
|||||||
| Hugging Face | `huggingface` | No | Use models from Hugging Face Inference API. | [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) |
|
| Hugging Face | `huggingface` | No | Use models from Hugging Face Inference API. | [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) |
|
||||||
| TogetherAI | `togetherAI` | No | Use various open-source models via TogetherAI API.| [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) |
|
| TogetherAI | `togetherAI` | No | Use various open-source models via TogetherAI API.| [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) |
|
||||||
| OpenRouter | `openrouter` | No | Use OpenRouter Models| [https://openrouter.ai/](https://openrouter.ai/) |
|
| OpenRouter | `openrouter` | No | Use OpenRouter Models| [https://openrouter.ai/](https://openrouter.ai/) |
|
||||||
| MiniMax | `minimax` | No | Use MiniMax M2.5 series models (e.g., MiniMax-M2.5).| [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
|
| MiniMax | `minimax` | No | Use MiniMax models (e.g., MiniMax-M2.7, MiniMax-M2.5).| [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
|
||||||
|
|
||||||
*Note:*
|
*Note:*
|
||||||
* We advise against using `gpt-4o` or other OpenAI models for complex web browsing and task planning as current prompt optimizations are geared towards models like Deepseek.
|
* We advise against using `gpt-4o` or other OpenAI models for complex web browsing and task planning as current prompt optimizations are geared towards models like Deepseek.
|
||||||
|
|||||||
+1
-1
@@ -230,7 +230,7 @@ provider_server_address = # 当 is_local = False 时,对于大多数 API 通
|
|||||||
| Hugging Face | `huggingface` | 否 | 使用 Hugging Face Inference API 中的模型。 | [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) |
|
| Hugging Face | `huggingface` | 否 | 使用 Hugging Face Inference API 中的模型。 | [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) |
|
||||||
| TogetherAI | `togetherAI` | 否 | 通过 TogetherAI API 使用各种开源模型。| [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) |
|
| TogetherAI | `togetherAI` | 否 | 通过 TogetherAI API 使用各种开源模型。| [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) |
|
||||||
| OpenRouter | `openrouter` | No | 通过 OpenRouter 使用各种开源模型| [https://openrouter.ai/](https://openrouter.ai/) |
|
| OpenRouter | `openrouter` | No | 通过 OpenRouter 使用各种开源模型| [https://openrouter.ai/](https://openrouter.ai/) |
|
||||||
| MiniMax | `minimax` | 否 | 使用 MiniMax 的 M2.5 系列模型(如 MiniMax-M2.5)。 | [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
|
| MiniMax | `minimax` | 否 | 使用 MiniMax 模型(如 MiniMax-M2.7、MiniMax-M2.5)。 | [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
|
||||||
|
|
||||||
*注意:*
|
*注意:*
|
||||||
* 我们不建议将 `gpt-4o` 或其他 OpenAI 模型用于复杂的网页浏览和任务规划,因为当前的提示优化针对 Deepseek 等模型。
|
* 我们不建议将 `gpt-4o` 或其他 OpenAI 模型用于复杂的网页浏览和任务规划,因为当前的提示优化针对 Deepseek 等模型。
|
||||||
|
|||||||
@@ -416,11 +416,13 @@ class Provider:
|
|||||||
def minimax_fn(self, history, verbose=False):
|
def minimax_fn(self, history, verbose=False):
|
||||||
"""
|
"""
|
||||||
Use MiniMax API to generate text via OpenAI-compatible interface.
|
Use MiniMax API to generate text via OpenAI-compatible interface.
|
||||||
|
|
||||||
Supported models:
|
Supported models:
|
||||||
|
- MiniMax-M2.7: Latest flagship model with enhanced reasoning and coding
|
||||||
|
- MiniMax-M2.7-highspeed: High-speed version of M2.7 for low-latency scenarios
|
||||||
- MiniMax-M2.5: Peak performance model (~60 tps), 204,800 context window
|
- MiniMax-M2.5: Peak performance model (~60 tps), 204,800 context window
|
||||||
- MiniMax-M2.5-highspeed: Same performance, faster (~100 tps)
|
- MiniMax-M2.5-highspeed: Same performance, faster (~100 tps)
|
||||||
|
|
||||||
Note: temperature must be in range (0.0, 1.0], default is 1.0
|
Note: temperature must be in range (0.0, 1.0], default is 1.0
|
||||||
"""
|
"""
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|||||||
@@ -155,6 +155,42 @@ class TestMiniMaxProvider(unittest.TestCase):
|
|||||||
class TestMiniMaxProviderModels(unittest.TestCase):
|
class TestMiniMaxProviderModels(unittest.TestCase):
|
||||||
"""Test cases for MiniMax provider model configurations."""
|
"""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('sources.llm_provider.OpenAI')
|
||||||
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
|
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
|
||||||
def test_minimax_m25_model(self, mock_openai_class):
|
def test_minimax_m25_model(self, mock_openai_class):
|
||||||
|
|||||||
Reference in New Issue
Block a user