Skip to content

Commit af5680a

Browse files
octo-patchfit2cloud-chenyw
authored andcommitted
feat: add MiniMax as first-class LLM provider
Add MiniMax AI as a built-in LLM supplier alongside existing providers (OpenAI, DeepSeek, Gemini, Kimi, etc.) via OpenAI-compatible API. Changes: - Add MiniMax supplier entry (id=13) in supplier.ts with M2.7, M2.5, M2.5-highspeed models and temperature range [0, 1] - Add MiniMax icon (96x96 PNG) to frontend assets - Add i18n translations for MiniMax in en, zh-CN, ko-KR locales - Add supported LLM providers table to both README files - Add 24 unit tests + 3 integration tests
1 parent 71cbba8 commit af5680a

File tree

9 files changed

+384
-0
lines changed

9 files changed

+384
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,23 @@ SQLBot 是一款基于大语言模型和 RAG 的智能问数系统,由 DataEas
3131
- **易于集成**:支持多种集成方式,提供 Web 嵌入、弹窗嵌入、MCP 调用等能力;能够快速嵌入到 n8n、Dify、MaxKB、DataEase 等应用,让各类应用快速拥有智能问数能力。
3232
- **越问越准**:支持自定义提示词、术语库配置,可维护 SQL 示例校准逻辑,精准匹配业务场景;高效运营,基于用户交互数据持续迭代优化,问数效果随使用逐步提升,越问越准。
3333

34+
## 支持的大模型服务商
35+
36+
| 服务商 | API 兼容 |
37+
|--------|----------|
38+
| 阿里云百炼 | OpenAI 兼容 |
39+
| 千帆大模型 | OpenAI 兼容 |
40+
| DeepSeek | OpenAI 兼容 |
41+
| 腾讯混元 | OpenAI 兼容 |
42+
| 讯飞星火 | OpenAI 兼容 |
43+
| Gemini | OpenAI 兼容 |
44+
| OpenAI | 原生 |
45+
| Kimi | OpenAI 兼容 |
46+
| 腾讯云 | OpenAI 兼容 |
47+
| 火山引擎 | OpenAI 兼容 |
48+
| MiniMax | OpenAI 兼容 |
49+
| 通用 OpenAI 兼容 | 自定义 |
50+
3451
## 快速开始
3552

3653
### 安装部署

docs/README.en.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ SQLBot is an intelligent data query system based on large language models and RA
3030
- **Easy Integration:** Supports multiple integration methods, providing capabilities such as web embedding, pop-up embedding, and MCP invocation. It can be quickly embedded into applications such as n8n, Dify, MaxKB, and DataEase, allowing various applications to quickly acquire intelligent data collection capabilities.
3131
- **Increasingly Accurate with Use:** Supports customizable prompts and terminology library configurations, maintainable SQL example calibration logic, and accurate matching of business scenarios. Efficient operation, based on continuous iteration and optimization using user interaction data, the data collection effect gradually improves with use, becoming more accurate with each use.
3232

33+
## Supported LLM Providers
34+
35+
| Provider | API Compatibility |
36+
|----------|-------------------|
37+
| Alibaba Cloud Bailian | OpenAI Compatible |
38+
| Qianfan Model | OpenAI Compatible |
39+
| DeepSeek | OpenAI Compatible |
40+
| Tencent Hunyuan | OpenAI Compatible |
41+
| iFlytek Spark | OpenAI Compatible |
42+
| Gemini | OpenAI Compatible |
43+
| OpenAI | Native |
44+
| Kimi | OpenAI Compatible |
45+
| Tencent Cloud | OpenAI Compatible |
46+
| Volcano Engine | OpenAI Compatible |
47+
| MiniMax | OpenAI Compatible |
48+
| Generic OpenAI Compatible | Custom |
49+
3350
## Quick Start
3451

3552
### Installation and Deployment
1.18 KB
Loading

frontend/src/entity/supplier.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import icon_txhy_colorful from '@/assets/model/icon_txhy_colorful.png'
1010
import icon_hsyq_colorful from '@/assets/model/icon_hsyq_colorful.png'
1111
// import icon_vllm_colorful from '@/assets/model/icon_vllm_colorful.png'
1212
import icon_common_openai from '@/assets/model/icon_common_openai.png'
13+
import icon_minimax_colorful from '@/assets/model/icon_minimax_colorful.png'
1314
// import icon_azure_openAI_colorful from '@/assets/model/icon_Azure_OpenAI_colorful.png'
1415

1516
type ModelArg = { key: string; val?: string | number; type: string; range?: string }
@@ -276,6 +277,23 @@ export const supplierList: Array<{
276277
},
277278
},
278279
},
280+
{
281+
id: 13,
282+
name: 'MiniMax',
283+
i18nKey: 'supplier.minimax',
284+
icon: icon_minimax_colorful,
285+
model_config: {
286+
0: {
287+
api_domain: 'https://api.minimax.io/v1',
288+
common_args: [{ key: 'temperature', val: 0.7, type: 'number', range: '[0, 1]' }],
289+
model_options: [
290+
{ name: 'MiniMax-M2.7' },
291+
{ name: 'MiniMax-M2.5' },
292+
{ name: 'MiniMax-M2.5-highspeed' },
293+
],
294+
},
295+
},
296+
},
279297
/* {
280298
id: 11,
281299
name: 'vLLM',

frontend/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@
915915
"kimi": "Kimi",
916916
"tencent_cloud": "Tencent Cloud",
917917
"volcano_engine": "Volcano Engine",
918+
"minimax": "MiniMax",
918919
"generic_openai": "Generic OpenAI"
919920
},
920921
"modelType": {

frontend/src/i18n/ko-KR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@
915915
"kimi": "Kimi",
916916
"tencent_cloud": "텐센트 클라우드",
917917
"volcano_engine": "볼케이노 엔진",
918+
"minimax": "MiniMax",
918919
"generic_openai": "범용 OpenAI"
919920
},
920921
"modelType": {

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@
915915
"kimi": "Kimi",
916916
"tencent_cloud": "腾讯云",
917917
"volcano_engine": "火山引擎",
918+
"minimax": "MiniMax",
918919
"generic_openai": "通用OpenAI"
919920
},
920921
"modelType": {

tests/test_minimax_integration.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
"""
2+
Integration tests for MiniMax LLM provider in SQLBot.
3+
4+
These tests validate that the MiniMax API is reachable and functioning
5+
correctly via the OpenAI-compatible protocol.
6+
7+
Requires MINIMAX_API_KEY environment variable to be set.
8+
"""
9+
10+
import json
11+
import os
12+
import unittest
13+
14+
import requests
15+
16+
MINIMAX_API_KEY = os.environ.get("MINIMAX_API_KEY", "")
17+
MINIMAX_BASE_URL = "https://api.minimax.io/v1"
18+
19+
20+
def skip_without_api_key(func):
21+
"""Skip test if MINIMAX_API_KEY is not set."""
22+
return unittest.skipUnless(MINIMAX_API_KEY, "MINIMAX_API_KEY not set")(func)
23+
24+
25+
class TestMiniMaxAPIConnectivity(unittest.TestCase):
26+
"""Test MiniMax API endpoint reachability."""
27+
28+
@skip_without_api_key
29+
def test_api_endpoint_reachable(self):
30+
"""MiniMax API endpoint should be reachable (chat completions)."""
31+
resp = requests.post(
32+
f"{MINIMAX_BASE_URL}/chat/completions",
33+
headers={
34+
"Authorization": f"Bearer {MINIMAX_API_KEY}",
35+
"Content-Type": "application/json",
36+
},
37+
json={
38+
"model": "MiniMax-M2.5-highspeed",
39+
"messages": [{"role": "user", "content": "Hi"}],
40+
"max_tokens": 1,
41+
},
42+
timeout=15,
43+
)
44+
self.assertEqual(resp.status_code, 200)
45+
46+
@skip_without_api_key
47+
def test_chat_completions_basic(self):
48+
"""MiniMax chat completions should return a valid response."""
49+
resp = requests.post(
50+
f"{MINIMAX_BASE_URL}/chat/completions",
51+
headers={
52+
"Authorization": f"Bearer {MINIMAX_API_KEY}",
53+
"Content-Type": "application/json",
54+
},
55+
json={
56+
"model": "MiniMax-M2.5-highspeed",
57+
"messages": [{"role": "user", "content": "Say hello in one word."}],
58+
"temperature": 0.7,
59+
"max_tokens": 10,
60+
},
61+
timeout=30,
62+
)
63+
self.assertEqual(resp.status_code, 200)
64+
data = resp.json()
65+
self.assertIn("choices", data)
66+
self.assertGreater(len(data["choices"]), 0)
67+
content = data["choices"][0]["message"]["content"]
68+
self.assertTrue(len(content) > 0, "Response content should not be empty")
69+
70+
@skip_without_api_key
71+
def test_temperature_zero_accepted(self):
72+
"""MiniMax API should accept temperature=0."""
73+
resp = requests.post(
74+
f"{MINIMAX_BASE_URL}/chat/completions",
75+
headers={
76+
"Authorization": f"Bearer {MINIMAX_API_KEY}",
77+
"Content-Type": "application/json",
78+
},
79+
json={
80+
"model": "MiniMax-M2.5-highspeed",
81+
"messages": [{"role": "user", "content": "Reply with OK."}],
82+
"temperature": 0,
83+
"max_tokens": 5,
84+
},
85+
timeout=30,
86+
)
87+
self.assertEqual(resp.status_code, 200)
88+
89+
90+
if __name__ == "__main__":
91+
unittest.main()

0 commit comments

Comments
 (0)