feat: add MiniMax as LLM provider (M3 default, M2.7, M2.7-highspeed) - #1076
feat: add MiniMax as LLM provider (M3 default, M2.7, M2.7-highspeed)#1076octo-patch wants to merge 3 commits into
Conversation
Add MiniMax as a new API-based LLM provider in ChatALL, supporting two models: MiniMax-M2.5 (default) and MiniMax-M2.5-highspeed. Uses the OpenAI-compatible API via @langchain/openai ChatOpenAI with a custom base URL (https://api.minimax.io/v1). Changes: - New bot files: MiniMaxAPIBot, MiniMaxM25Bot, MiniMaxM25HighspeedBot - Settings component with API key, temperature (0.1-1.0), past rounds, and custom API URL support - Store state and mutation for minimaxApi configuration - Bot registration in index.js with api and madeInChina tags - i18n entries for all 11 locales - MiniMax logo (SVG) - README updates (EN and ZH-CN) - Unit tests (42 assertions) and integration tests (17 assertions)
📝 WalkthroughWalkthroughThis PR adds complete MiniMax bot support to ChatALL, including three model variants (M27, M27-highspeed, M3), API configuration state, a Vue settings component, localized UI strings across 11 languages, and comprehensive unit and integration tests. ChangesMiniMax Bot Support Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances ChatALL's capabilities by integrating MiniMax as a new LLM provider. This addition allows users to leverage MiniMax's M2.5 and M2.5-highspeed models, providing more options for diverse conversational needs. The implementation efficiently reuses existing OpenAI API compatibility, minimizing overhead while ensuring robust functionality and user configurability. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for the MiniMax LLM provider, including two models: MiniMax-M2.5 and MiniMax-M2.5-highspeed. The changes are comprehensive, adding new bot classes, settings components, store configurations, i18n entries, and both unit and integration tests. My review includes suggestions for code simplification, adherence to best practices, and fixing a duplicate key issue in a localization file.
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" | ||
| } |
There was a problem hiding this comment.
The minimaxApi key is duplicated in this file. Another definition exists at lines 320-330. JSON objects cannot have duplicate keys; the last one will overwrite the previous ones. Please remove this duplicate block. The other block at lines 320-330 seems to have more descriptive and user-friendly English text, so that one should probably be kept.
| basePath: store.state.minimaxApi.alterUrl | ||
| ? store.state.minimaxApi.alterUrl | ||
| : "https://api.minimax.io/v1", | ||
| }, | ||
| openAIApiKey: store.state.minimaxApi.apiKey, | ||
| modelName: this.constructor._model ? this.constructor._model : "", |
There was a problem hiding this comment.
For conciseness and improved readability, you can simplify the ternary expressions for basePath and modelName by using the logical OR (||) operator to provide default values.
| basePath: store.state.minimaxApi.alterUrl | |
| ? store.state.minimaxApi.alterUrl | |
| : "https://api.minimax.io/v1", | |
| }, | |
| openAIApiKey: store.state.minimaxApi.apiKey, | |
| modelName: this.constructor._model ? this.constructor._model : "", | |
| basePath: store.state.minimaxApi.alterUrl || "https://api.minimax.io/v1", | |
| }, | |
| openAIApiKey: store.state.minimaxApi.apiKey, | |
| modelName: this.constructor._model || "", |
| constructor() { | ||
| super(); | ||
| } |
| constructor() { | ||
| super(); | ||
| } |
| watcher() { | ||
| _bots.all | ||
| .filter((bot) => bot instanceof Bot) | ||
| .map((bot) => bot.setupModel()); |
There was a problem hiding this comment.
For code clarity and semantic correctness, it's better to use .forEach() here instead of .map(). The .map() method is intended for creating a new array by transforming elements, but here you are only performing a side effect (calling setupModel) for each element. Using .forEach() makes the intent of the code clearer.
.forEach((bot) => bot.setupModel());
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (7)
src/i18n/locales/de.json (1)
397-407: Missing German translations for MiniMax API strings.The
minimaxApisection contains English text instead of German translations. For consistency with other sections in this locale (e.g.,openaiApi.temperatureis "Temperatur",openaiApi.alterUrlis "Alternative Basis-URL"), these strings should be translated to German.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/locales/de.json` around lines 397 - 407, The minimaxApi block contains English values; update the keys inside minimaxApi (name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl, alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) with German translations to match the locale (e.g., "name": "MiniMax-API", "MiniMax-M25": "MiniMax-M2.5", "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", "alterUrl": "API-URL", "alterUrlPrompt": "Benutzerdefinierte API-Endpunkt-URL (Standard: https://api.minimax.io/v1)", "temperature": "Temperatur", "temperaturePrompt": "Sampling-Temperatur zwischen 0.1 und 1", "temperature01": "Präzise", "temperature1": "Kreativ"); ensure punctuation and casing follow existing locale style.src/i18n/locales/ko.json (1)
400-410: Missing Korean translations for MiniMax API strings.The
minimaxApisection contains English text instead of Korean translations. For consistency with other sections in this locale (e.g.,openaiApi.temperatureis "온도",openaiApi.alterUrlis "대체 기본 URL"), these strings should be translated to Korean.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/locales/ko.json` around lines 400 - 410, The minimaxApi localization block contains English values; update the minimaxApi object (keys: name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl, alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) with Korean translations consistent with the surrounding locale (e.g., mirror openaiApi style: "온도", "대체 기본 URL") and translate prompts/labels into natural Korean while preserving any default URL or numeric ranges in the alterUrlPrompt/temperaturePrompt strings.src/i18n/locales/vi.json (1)
376-386: Missing Vietnamese translations for MiniMax API strings.The
minimaxApisection contains English text instead of Vietnamese translations. For consistency with other sections in this locale file (e.g.,openaiApi.alterUrlis "API URL thay thế"), these strings should be translated to Vietnamese.Compare with existing Vietnamese translations in this file:
openaiApi.alterUrlPrompt: "Nếu bạn đang dùng API URL tùy chỉnh, bạn có thể nhập ở đây"openaiApi.temperaturePrompt: "Temperature càng cao, văn bản càng sáng tạo..."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/locales/vi.json` around lines 376 - 386, Translate the English values under the minimaxApi object into Vietnamese (keys: name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl, alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) so they match the locale style used elsewhere (e.g., openaiApi.alterUrl -> "API URL thay thế", openaiApi.alterUrlPrompt and openaiApi.temperaturePrompt). Update each string value with proper Vietnamese translations while preserving the same keys and JSON structure.src/i18n/locales/en.json (1)
411-421: This is the second (winning)minimaxApiblock.Since JSON uses the last occurrence of duplicate keys, this block's values will be used at runtime. The translations here are consistent with other locale files in this PR.
However, note that the
en.jsonshould serve as the reference for English translations. You may want to consider whether the values from the first block (lines 320-330) were more descriptive:
"temperaturePrompt": "Must be between 0.1 and 1.0. Higher values produce more creative but less deterministic responses"(first block) is more detailed than"What sampling temperature to use, between 0.1 and 1"(this block).After removing the duplicate, consider keeping the more descriptive prompts from the first block if they better serve users.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/locales/en.json` around lines 411 - 421, There are two duplicate "minimaxApi" blocks in en.json causing the second to override the first; remove the duplicate block and ensure only one "minimaxApi" object remains, preserving the more descriptive "temperaturePrompt" value from the first occurrence ("Must be between 0.1 and 1.0. Higher values produce more creative but less deterministic responses") and keep the rest of the keys (name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl, alterUrlPrompt, temperature, temperature01, temperature1) intact under that single "minimaxApi" entry.src/components/BotSettings/MiniMaxAPIBotSettings.vue (1)
67-70: UseforEachinstead ofmapfor side effects.At Line 69,
.map()is only used to callsetupModel()and discards the returned array.♻️ Suggested cleanup
watcher() { _bots.all .filter((bot) => bot instanceof Bot) - .map((bot) => bot.setupModel()); + .forEach((bot) => bot.setupModel()); },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/BotSettings/MiniMaxAPIBotSettings.vue` around lines 67 - 70, The code is using .map on _bots.all to call setupModel purely for side effects; replace the .map call with .forEach to avoid creating and discarding an unused array. Locate the expression "_bots.all.filter((bot) => bot instanceof Bot).map((bot) => bot.setupModel())" and change the terminal .map to .forEach so each Bot instance calls setupModel() without allocating an unnecessary array.src/bots/index.js (1)
69-70: Prefer project alias imports for new bot entries.For consistency with current project conventions, switch these new relative imports to
@/aliases.Based on learnings, in ChatALL the preferred import style is to use project aliases (e.g., `"@/..."`) instead of relative paths.♻️ Suggested import update
-import MiniMaxM25Bot from "./minimax/MiniMaxM25Bot"; -import MiniMaxM25HighspeedBot from "./minimax/MiniMaxM25HighspeedBot"; +import MiniMaxM25Bot from "@/bots/minimax/MiniMaxM25Bot"; +import MiniMaxM25HighspeedBot from "@/bots/minimax/MiniMaxM25HighspeedBot";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/bots/index.js` around lines 69 - 70, The imports for the new bots use relative paths; update them to use the project alias style used elsewhere (change the import sources for MiniMaxM25Bot and MiniMaxM25HighspeedBot from "./minimax/..." to "@/minimax/..." so the module specifiers match the project's alias convention), ensure the imported identifiers MiniMaxM25Bot and MiniMaxM25HighspeedBot are unchanged and the build/ESLint passes after replacing the paths.src/bots/minimax/MiniMaxAPIBot.js (1)
1-1: Prefer@/alias for the LangChainBot import.Use a project alias here for consistency with src import conventions.
As per coding guidelines, “Use the `@/` alias instead of deep relative paths for imports from `src/`.”♻️ Suggested import change
-import LangChainBot from "../LangChainBot"; +import LangChainBot from "@/bots/LangChainBot";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/bots/minimax/MiniMaxAPIBot.js` at line 1, The import in MiniMaxAPIBot.js uses a relative path; update the LangChainBot import to use the project alias (prefixed with "@/") to match src import conventions—replace the current import of LangChainBot with an aliased import like import LangChainBot from "@/.../LangChainBot" (adjust the alias path so it resolves to the LangChainBot module) so the MiniMaxAPIBot references the same module via the "@/..." alias.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/i18n/locales/en.json`:
- Around line 320-330: The JSON file contains a duplicated top-level
"minimaxApi" object causing one to silently override the other; remove the first
occurrence (the block containing keys "MiniMax-M25", "MiniMax-M25-highspeed",
"alterUrl", "alterUrlPrompt", "temperature", "temperaturePrompt",
"temperature01", "temperature1") and keep the later "minimaxApi" block (which
uses the consistent labels like "MiniMax-M2.5", "API URL", "Precise"/"Creative")
so translations remain consistent with other locale files.
In `@src/i18n/locales/es.json`:
- Around line 396-407: In the minimaxApi translation block, replace the English
values with Spanish equivalents: update "temperature01" to "Preciso",
"temperature1" to "Creativo", and change "alterUrlPrompt" to "URL del endpoint
API personalizado (por defecto: https://api.minimax.io/v1)"; ensure you edit the
keys inside the minimaxApi object (minimaxApi.name, MiniMax-M25,
MiniMax-M25-highspeed, alterUrl, alterUrlPrompt, temperature, temperaturePrompt,
temperature01, temperature1) so all user-facing strings are consistently
translated into Spanish.
In `@src/i18n/locales/fr.json`:
- Around line 397-407: The minimaxApi translation entries are still in English;
update the keys inside the minimaxApi object (e.g., "name", "MiniMax-M25",
"MiniMax-M25-highspeed", "alterUrl", "alterUrlPrompt", "temperature",
"temperaturePrompt", "temperature01", "temperature1") with appropriate French
strings — for example change "alterUrl" to "URL de l'API", "alterUrlPrompt" to
"URL du point d'accès API personnalisé (par défaut :
https://api.minimax.io/v1)", "temperature01" to "Précis" and "temperature1" to
"Créatif" — ensuring all values are translated to French to match the rest of
the locale file.
In `@src/i18n/locales/it.json`:
- Around line 399-409: Translate the English strings in the minimaxApi locale
object to Italian: replace the value for "alterUrlPrompt" with "URL endpoint API
personalizzato (predefinito: https://api.minimax.io/v1)", change "temperature01"
from "Precise" to "Preciso", and change "temperature1" from "Creative" to
"Creativo"; update these keys inside the minimaxApi block so the it.json file
remains consistent.
In `@src/i18n/locales/ja.json`:
- Around line 401-406: The JA locale contains English strings for keys alterUrl,
alterUrlPrompt, temperature, temperaturePrompt, temperature01, and temperature1;
update ja.json to provide proper Japanese translations for those keys (e.g.,
translate "API URL", "Custom API endpoint URL (default:
https://api.minimax.io/v1)", "Temperature", "What sampling temperature to use,
between 0.1 and 1", "Precise", and "Creative") so the Japanese locale is fully
localized while preserving the same keys and default URL text where applicable.
In `@src/i18n/locales/ru.json`:
- Around line 397-407: The minimaxApi block contains English strings that must
be translated into Russian; update the keys inside the minimaxApi object (e.g.,
"name", "MiniMax-M25", "MiniMax-M25-highspeed", "alterUrl", "alterUrlPrompt",
"temperature", "temperaturePrompt", "temperature01", "temperature1") with proper
Russian translations (for instance "Температура" for "temperature", "Точный" for
"temperature01", "Креативный" for "temperature1") and translate the
alterUrlPrompt and temperaturePrompt strings to Russian while preserving any
URLs and placeholders.
In `@src/i18n/locales/zhtw.json`:
- Around line 397-407: The minimaxApi translations in the zhtw locale use
Simplified Chinese; update the values for keys inside "minimaxApi" (alterUrl,
alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) to
Traditional Chinese by replacing "自定义"→"自訂", "默认"→"預設", "温度"→"溫度",
"采样温度"→"取樣溫度", "范围"→"範圍", "精确"→"精確", and "创意"→"創意" so the strings under the
minimaxApi object are consistent with Traditional Chinese.
In `@tests/minimax-integration.test.js`:
- Around line 39-40: Replace the logical-OR defaults for numeric options so
explicit zeros are preserved: in the assignments using options.temperature and
options.max_tokens (in tests/minimax-integration.test.js) swap the `||` fallback
to the nullish coalescing operator `??` so only null/undefined trigger the
defaults (e.g., change `options.temperature || 1.0` and `options.max_tokens ||
100` to use `options.temperature ?? 1.0` and `options.max_tokens ?? 100`).
---
Nitpick comments:
In `@src/bots/index.js`:
- Around line 69-70: The imports for the new bots use relative paths; update
them to use the project alias style used elsewhere (change the import sources
for MiniMaxM25Bot and MiniMaxM25HighspeedBot from "./minimax/..." to
"@/minimax/..." so the module specifiers match the project's alias convention),
ensure the imported identifiers MiniMaxM25Bot and MiniMaxM25HighspeedBot are
unchanged and the build/ESLint passes after replacing the paths.
In `@src/bots/minimax/MiniMaxAPIBot.js`:
- Line 1: The import in MiniMaxAPIBot.js uses a relative path; update the
LangChainBot import to use the project alias (prefixed with "@/") to match src
import conventions—replace the current import of LangChainBot with an aliased
import like import LangChainBot from "@/.../LangChainBot" (adjust the alias path
so it resolves to the LangChainBot module) so the MiniMaxAPIBot references the
same module via the "@/..." alias.
In `@src/components/BotSettings/MiniMaxAPIBotSettings.vue`:
- Around line 67-70: The code is using .map on _bots.all to call setupModel
purely for side effects; replace the .map call with .forEach to avoid creating
and discarding an unused array. Locate the expression "_bots.all.filter((bot) =>
bot instanceof Bot).map((bot) => bot.setupModel())" and change the terminal .map
to .forEach so each Bot instance calls setupModel() without allocating an
unnecessary array.
In `@src/i18n/locales/de.json`:
- Around line 397-407: The minimaxApi block contains English values; update the
keys inside minimaxApi (name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl,
alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1)
with German translations to match the locale (e.g., "name": "MiniMax-API",
"MiniMax-M25": "MiniMax-M2.5", "MiniMax-M25-highspeed":
"MiniMax-M2.5-highspeed", "alterUrl": "API-URL", "alterUrlPrompt":
"Benutzerdefinierte API-Endpunkt-URL (Standard: https://api.minimax.io/v1)",
"temperature": "Temperatur", "temperaturePrompt": "Sampling-Temperatur zwischen
0.1 und 1", "temperature01": "Präzise", "temperature1": "Kreativ"); ensure
punctuation and casing follow existing locale style.
In `@src/i18n/locales/en.json`:
- Around line 411-421: There are two duplicate "minimaxApi" blocks in en.json
causing the second to override the first; remove the duplicate block and ensure
only one "minimaxApi" object remains, preserving the more descriptive
"temperaturePrompt" value from the first occurrence ("Must be between 0.1 and
1.0. Higher values produce more creative but less deterministic responses") and
keep the rest of the keys (name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl,
alterUrlPrompt, temperature, temperature01, temperature1) intact under that
single "minimaxApi" entry.
In `@src/i18n/locales/ko.json`:
- Around line 400-410: The minimaxApi localization block contains English
values; update the minimaxApi object (keys: name, MiniMax-M25,
MiniMax-M25-highspeed, alterUrl, alterUrlPrompt, temperature, temperaturePrompt,
temperature01, temperature1) with Korean translations consistent with the
surrounding locale (e.g., mirror openaiApi style: "온도", "대체 기본 URL") and
translate prompts/labels into natural Korean while preserving any default URL or
numeric ranges in the alterUrlPrompt/temperaturePrompt strings.
In `@src/i18n/locales/vi.json`:
- Around line 376-386: Translate the English values under the minimaxApi object
into Vietnamese (keys: name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl,
alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) so
they match the locale style used elsewhere (e.g., openaiApi.alterUrl -> "API URL
thay thế", openaiApi.alterUrlPrompt and openaiApi.temperaturePrompt). Update
each string value with proper Vietnamese translations while preserving the same
keys and JSON structure.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 24f273ae-218a-475a-88e1-ad96e09e354b
⛔ Files ignored due to path filters (3)
public/bots/minimax-logo.svgis excluded by!**/*.svgpublic/bots/minimax-m25-highspeed-logo.pngis excluded by!**/*.pngpublic/bots/minimax-m25-logo.pngis excluded by!**/*.png
📒 Files selected for processing (22)
README.mdREADME_ZH-CN.mdsrc/bots/index.jssrc/bots/minimax/MiniMaxAPIBot.jssrc/bots/minimax/MiniMaxM25Bot.jssrc/bots/minimax/MiniMaxM25HighspeedBot.jssrc/components/BotSettings/MiniMaxAPIBotSettings.vuesrc/components/SettingsModal.vuesrc/i18n/locales/de.jsonsrc/i18n/locales/en.jsonsrc/i18n/locales/es.jsonsrc/i18n/locales/fr.jsonsrc/i18n/locales/it.jsonsrc/i18n/locales/ja.jsonsrc/i18n/locales/ko.jsonsrc/i18n/locales/ru.jsonsrc/i18n/locales/vi.jsonsrc/i18n/locales/zh.jsonsrc/i18n/locales/zhtw.jsonsrc/store/index.jstests/minimax-integration.test.jstests/minimax-unit.test.js
| "100": "100", | ||
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" | ||
| } |
There was a problem hiding this comment.
Missing Spanish translations for MiniMax API settings.
The minimaxApi block contains English text instead of Spanish translations. Consider translating for consistency:
"temperature01": "Precise"→ could be "Preciso""temperature1": "Creative"→ could be "Creativo""alterUrlPrompt"→ could be "URL del endpoint API personalizado (por defecto: https://api.minimax.io/v1)"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/es.json` around lines 396 - 407, In the minimaxApi
translation block, replace the English values with Spanish equivalents: update
"temperature01" to "Preciso", "temperature1" to "Creativo", and change
"alterUrlPrompt" to "URL del endpoint API personalizado (por defecto:
https://api.minimax.io/v1)"; ensure you edit the keys inside the minimaxApi
object (minimaxApi.name, MiniMax-M25, MiniMax-M25-highspeed, alterUrl,
alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) so
all user-facing strings are consistently translated into Spanish.
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" | ||
| } |
There was a problem hiding this comment.
Missing French translations for MiniMax API settings.
The minimaxApi block contains English text instead of French translations. Consider translating to maintain consistency with the rest of this locale file.
For example:
"alterUrl": "API URL"→ could be "URL de l'API""alterUrlPrompt"→ could be "URL du point d'accès API personnalisé (par défaut : https://api.minimax.io/v1)""temperature01": "Precise"→ could be "Précis""temperature1": "Creative"→ could be "Créatif"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/fr.json` around lines 397 - 407, The minimaxApi translation
entries are still in English; update the keys inside the minimaxApi object
(e.g., "name", "MiniMax-M25", "MiniMax-M25-highspeed", "alterUrl",
"alterUrlPrompt", "temperature", "temperaturePrompt", "temperature01",
"temperature1") with appropriate French strings — for example change "alterUrl"
to "URL de l'API", "alterUrlPrompt" to "URL du point d'accès API personnalisé
(par défaut : https://api.minimax.io/v1)", "temperature01" to "Précis" and
"temperature1" to "Créatif" — ensuring all values are translated to French to
match the rest of the locale file.
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" | ||
| } |
There was a problem hiding this comment.
Missing Italian translations for MiniMax API settings.
The minimaxApi block contains English text instead of Italian translations. Consider translating for consistency with the rest of the file:
"temperature01": "Precise"→ could be "Preciso""temperature1": "Creative"→ could be "Creativo""alterUrlPrompt"→ could be "URL endpoint API personalizzato (predefinito: https://api.minimax.io/v1)"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/it.json` around lines 399 - 409, Translate the English
strings in the minimaxApi locale object to Italian: replace the value for
"alterUrlPrompt" with "URL endpoint API personalizzato (predefinito:
https://api.minimax.io/v1)", change "temperature01" from "Precise" to "Preciso",
and change "temperature1" from "Creative" to "Creativo"; update these keys
inside the minimaxApi block so the it.json file remains consistent.
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" |
There was a problem hiding this comment.
JA locale strings are untranslated English text.
Lines 401–406 introduce English UI copy in ja.json, which creates mixed-language UX in Japanese settings.
🌐 Suggested JA localization
"minimaxApi": {
"name": "MiniMax API",
"MiniMax-M25": "MiniMax-M2.5",
"MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed",
"alterUrl": "API URL",
- "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)",
- "temperature": "Temperature",
- "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1",
- "temperature01": "Precise",
- "temperature1": "Creative"
+ "alterUrlPrompt": "カスタム API エンドポイント URL(既定: https://api.minimax.io/v1)",
+ "temperature": "温度",
+ "temperaturePrompt": "0.1〜1 の範囲でサンプリング温度を設定します",
+ "temperature01": "正確寄り",
+ "temperature1": "創造的"
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "alterUrl": "API URL", | |
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | |
| "temperature": "Temperature", | |
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | |
| "temperature01": "Precise", | |
| "temperature1": "Creative" | |
| "alterUrl": "API URL", | |
| "alterUrlPrompt": "カスタム API エンドポイント URL(既定: https://api.minimax.io/v1)", | |
| "temperature": "温度", | |
| "temperaturePrompt": "0.1〜1 の範囲でサンプリング温度を設定します", | |
| "temperature01": "正確寄り", | |
| "temperature1": "創造的" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/ja.json` around lines 401 - 406, The JA locale contains
English strings for keys alterUrl, alterUrlPrompt, temperature,
temperaturePrompt, temperature01, and temperature1; update ja.json to provide
proper Japanese translations for those keys (e.g., translate "API URL", "Custom
API endpoint URL (default: https://api.minimax.io/v1)", "Temperature", "What
sampling temperature to use, between 0.1 and 1", "Precise", and "Creative") so
the Japanese locale is fully localized while preserving the same keys and
default URL text where applicable.
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" | ||
| } |
There was a problem hiding this comment.
Missing Russian translations for MiniMax API settings.
The minimaxApi block contains English text instead of Russian translations. This is inconsistent with the rest of the locale file and will result in a mixed-language UI for Russian users.
For example:
"alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)"should be translated to Russian"temperature": "Temperature"→ could be "Температура""temperature01": "Precise"→ could be "Точный""temperature1": "Creative"→ could be "Креативный"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/ru.json` around lines 397 - 407, The minimaxApi block
contains English strings that must be translated into Russian; update the keys
inside the minimaxApi object (e.g., "name", "MiniMax-M25",
"MiniMax-M25-highspeed", "alterUrl", "alterUrlPrompt", "temperature",
"temperaturePrompt", "temperature01", "temperature1") with proper Russian
translations (for instance "Температура" for "temperature", "Точный" for
"temperature01", "Креативный" for "temperature1") and translate the
alterUrlPrompt and temperaturePrompt strings to Russian while preserving any
URLs and placeholders.
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "alterUrl": "API 地址", | ||
| "alterUrlPrompt": "自定义 API 端点地址(默认:https://api.minimax.io/v1)", | ||
| "temperature": "温度", | ||
| "temperaturePrompt": "采样温度,范围 0.1 到 1", | ||
| "temperature01": "精确", | ||
| "temperature1": "创意" | ||
| } |
There was a problem hiding this comment.
Simplified Chinese characters used instead of Traditional Chinese.
This is the Traditional Chinese (zhtw) locale file, but the minimaxApi translations use Simplified Chinese characters. For consistency with the rest of this file, please convert to Traditional Chinese:
| Current (Simplified) | Should be (Traditional) |
|---|---|
| 自定义 | 自訂 |
| 默认 | 預設 |
| 温度 | 溫度 |
| 采样温度 | 取樣溫度 |
| 范围 | 範圍 |
| 精确 | 精確 |
| 创意 | 創意 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/zhtw.json` around lines 397 - 407, The minimaxApi
translations in the zhtw locale use Simplified Chinese; update the values for
keys inside "minimaxApi" (alterUrl, alterUrlPrompt, temperature,
temperaturePrompt, temperature01, temperature1) to Traditional Chinese by
replacing "自定义"→"自訂", "默认"→"預設", "温度"→"溫度", "采样温度"→"取樣溫度", "范围"→"範圍", "精确"→"精確",
and "创意"→"創意" so the strings under the minimaxApi object are consistent with
Traditional Chinese.
| temperature: options.temperature || 1.0, | ||
| max_tokens: options.max_tokens || 100, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify numeric-option defaulting patterns in this file.
rg -n 'temperature:\s*options\.temperature\s*\|\||max_tokens:\s*options\.max_tokens\s*\|\|' tests/minimax-integration.test.jsRepository: ai-shifu/ChatALL
Length of output: 157
Use nullish coalescing for numeric option defaults.
Lines 39–40 use || which treats 0 as unset. Use ?? instead so only null/undefined trigger defaults, allowing explicit 0 values to be preserved.
♻️ Suggested fix
- temperature: options.temperature || 1.0,
- max_tokens: options.max_tokens || 100,
+ temperature: options.temperature ?? 1.0,
+ max_tokens: options.max_tokens ?? 100,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| temperature: options.temperature || 1.0, | |
| max_tokens: options.max_tokens || 100, | |
| temperature: options.temperature ?? 1.0, | |
| max_tokens: options.max_tokens ?? 100, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/minimax-integration.test.js` around lines 39 - 40, Replace the
logical-OR defaults for numeric options so explicit zeros are preserved: in the
assignments using options.temperature and options.max_tokens (in
tests/minimax-integration.test.js) swap the `||` fallback to the nullish
coalescing operator `??` so only null/undefined trigger the defaults (e.g.,
change `options.temperature || 1.0` and `options.max_tokens || 100` to use
`options.temperature ?? 1.0` and `options.max_tokens ?? 100`).
Add MiniMax-M2.7 and MiniMax-M2.7-highspeed as new bot options alongside existing M2.5 models. Both models share the same OpenAI-compatible API configuration via MiniMaxAPIBot base class. Changes: - Add MiniMaxM27Bot.js and MiniMaxM27HighspeedBot.js - Register M2.7 bots in index.js (all, api, madeInChina tags) - Add i18n entries for M2.7 models across all 11 locale files - Update unit tests (58 pass) and integration tests (28 pass) Co-Authored-By: Octopus <liyuan851277048@icloud.com>
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (2)
src/i18n/locales/zhtw.json (1)
403-408:⚠️ Potential issue | 🟡 MinorUse Traditional Chinese in the new
zhtwMiniMax strings.These values are still in Simplified Chinese (
自定义,默认,温度,采样,范围,精确,创意), which is inconsistent with the rest of this locale file. Please convert them to the Traditional forms (自訂,預設,溫度,取樣,範圍,精確,創意).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/locales/zhtw.json` around lines 403 - 408, Convert the Simplified Chinese strings to Traditional Chinese for the zhtw locale keys: update "alterUrl" value to use Traditional characters, change "alterUrlPrompt" from "自定义 API 端点地址(默认:https://api.minimax.io/v1)" to use Traditional forms ("自訂", "預設"), change "temperature" to the Traditional form of "温度" ("溫度"), change "temperaturePrompt" to use Traditional forms for "采样"/"范围" ("取樣"/"範圍"), and ensure "temperature01" and "temperature1" use the Traditional terms ("精確" and "創意"); modify the values for the keys alterUrl, alterUrlPrompt, temperature, temperaturePrompt, temperature01, and temperature1 accordingly.src/i18n/locales/en.json (1)
320-332:⚠️ Potential issue | 🔴 CriticalRemove the duplicate top-level
minimaxApiobject.This block is declared again at lines 413-425. The later object wins during parse, so the earlier one becomes dead data, and Biome already flags the file for duplicate keys. That also means the current unit test can still pass because
JSON.parsekeeps the last block.Expected result: exactly one
minimaxApideclaration in this file.#!/bin/bash rg -n '"minimaxApi"\s*:' src/i18n/locales/en.json🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/locales/en.json` around lines 320 - 332, There are two top-level "minimaxApi" objects in the JSON; remove the earlier duplicate block (the one in the shown diff) so only a single "minimaxApi" declaration remains, ensuring keys like "name", "MiniMax-M25", "alterUrl", and "temperaturePrompt" exist only once and the later definition is kept; update the file so JSON.parse returns the intended object and re-run the duplicate-key check (search for "minimaxApi") to verify only one occurrence remains.
🧹 Nitpick comments (3)
src/bots/index.js (1)
69-72: Prefer the@/alias for the new MiniMax imports.These new relative imports add another exception in a file where new code is supposed to use the project alias. Keep the additions aligned with the repo convention.
♻️ Proposed fix
-import MiniMaxM25Bot from "./minimax/MiniMaxM25Bot"; -import MiniMaxM25HighspeedBot from "./minimax/MiniMaxM25HighspeedBot"; -import MiniMaxM27Bot from "./minimax/MiniMaxM27Bot"; -import MiniMaxM27HighspeedBot from "./minimax/MiniMaxM27HighspeedBot"; +import MiniMaxM25Bot from "@/bots/minimax/MiniMaxM25Bot"; +import MiniMaxM25HighspeedBot from "@/bots/minimax/MiniMaxM25HighspeedBot"; +import MiniMaxM27Bot from "@/bots/minimax/MiniMaxM27Bot"; +import MiniMaxM27HighspeedBot from "@/bots/minimax/MiniMaxM27HighspeedBot";As per coding guidelines, "Use the
@/alias instead of deep relative paths for imports fromsrc/".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/bots/index.js` around lines 69 - 72, Replace the deep relative imports for the new MiniMax bots with the project alias: update the import statements that reference MiniMaxM25Bot, MiniMaxM25HighspeedBot, MiniMaxM27Bot, and MiniMaxM27HighspeedBot to use the "@/..." alias path pointing into the src/minimax module instead of the current relative paths so they follow the repo convention for imports.tests/minimax-unit.test.js (1)
328-366: Cover the rest of the touched locale packs too.This block only checks
en.jsonandzh.json. Since this PR adds MiniMax strings across 11 locales, regressions in files likezhtw.jsoncan slip through while the suite still passes. Iterating the touched locale files and asserting theminimaxApikeys exist in each one would make this test much more useful.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/minimax-unit.test.js` around lines 328 - 366, The test currently only reads en.json and zh.json (variables enLocale and zhLocale) and asserts minimaxApi keys; update the test to iterate over the full set of locale filenames touched by this PR (e.g., an array of the 11 locale short names), for each file read it with fs.readFileSync/path.join, parse JSON into a locale variable, and assert that locale.minimaxApi exists and contains the expected model keys (e.g., "MiniMax-M25", "MiniMax-M25-highspeed", "MiniMax-M27", "MiniMax-M27-highspeed"); reference the existing enLocale/zhLocale usage and replace the two standalone checks with a loop over the locales array to make the assertions for every locale file.tests/minimax-integration.test.js (1)
249-263: Assert the system instruction, not just a non-empty reply.This still passes even if the provider ignores the
systemmessage entirely. The test name says “System message support”, so it should verify thePINEAPPLEsuffix.♻️ Proposed fix
assert(result.status === 200, `Status code is 200 (got ${result.status})`); + const content = result.body?.choices?.[0]?.message?.content ?? ""; assert( - result.body.choices[0].message.content.length > 0, - `Got response with system message: "${result.body.choices[0].message.content.substring(0, 100)}"`, + content.length > 0, + `Got response with system message: "${content.substring(0, 100)}"`, + ); + assert( + content.trim().endsWith("PINEAPPLE"), + `System instruction was honored: "${content.substring(0, 100)}"`, );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/minimax-integration.test.js` around lines 249 - 263, The test currently only checks for a non-empty reply but must assert the system instruction was applied; update the "System message support" test (in tests/minimax-integration.test.js around the chatCompletion call) to assert that result.body.choices[0].message.content includes or endsWith the required "PINEAPPLE." suffix (e.g., trim the content and verify it endsWith "PINEAPPLE."); keep the existing status === 200 assertion and replace or add the length check with a check that the returned message enforces the system instruction.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/i18n/locales/de.json`:
- Around line 397-409: Translate the English strings in the minimaxApi
localization object into German: update the keys "alterUrlPrompt" to a German
sentence such as "Benutzerdefinierte API-Endpunkt-URL (Standard:
https://api.minimax.io/v1)", "temperature" to "Temperatur", "temperaturePrompt"
to something like "Sampling-Temperatur zwischen 0,1 und 1", "temperature01" to
"Präzise", and "temperature1" to "Kreativ" so the minimaxApi block matches the
rest of de.json and existing terminology used elsewhere.
In `@src/i18n/locales/ko.json`:
- Around line 400-412: The minimaxApi localization block contains English
strings; replace the user-facing values under the "minimaxApi" object (keys like
"alterUrl", "alterUrlPrompt", "temperature", "temperaturePrompt",
"temperature01", "temperature1") with Korean translations (for example:
"alterUrl" → "API URL" if desired in Korean, "alterUrlPrompt" → "사용자 정의 API
엔드포인트 URL (기본값: https://api.minimax.io/v1)", "temperature" → "온도",
"temperaturePrompt" → "0.1에서 1 사이의 샘플링 온도", "temperature01" → "정밀",
"temperature1" → "창의적") so the entire minimaxApi block matches the rest of
ko.json.
In `@tests/minimax-integration.test.js`:
- Around line 32-74: The test currently uses the helper chatCompletion() which
issues a raw HTTPS POST and bypasses MiniMax code; replace the direct HTTPS call
so the test instantiates and exercises the real MiniMax integration (the
MiniMaxAPIBot class in src/bots/minimax/MiniMaxAPIBot.js or the concrete MiniMax
bot) and calls its public production method that produces completions (e.g., the
send/handle/sendMessage/chat method used in runtime) so the test flows through
ChatOpenAI construction, store-backed alterUrl/temperature/apiKey, and streaming
configuration; ensure the test sets up the store/state or injects configuration
values (alterUrl, temperature, apiKey, streaming flag) used by MiniMaxAPIBot so
those code paths are exercised instead of the hand-rolled chatCompletion().
- Around line 89-105: The test currently dereferences
result.body.choices[0].message without stopping execution on failure; update the
checks around result, result.body.choices, and result.body.choices[0].message so
you guard existence before accessing message.content (e.g., assert that
result.body && result.body.choices && result.body.choices[0] &&
result.body.choices[0].message are truthy), and when a guard fails include the
full result (or result.body) in the assertion/error message to surface the
actual API response; apply the same pattern to the later suites that read
result.body.choices[0].message.content to avoid hidden dereference exceptions.
---
Duplicate comments:
In `@src/i18n/locales/en.json`:
- Around line 320-332: There are two top-level "minimaxApi" objects in the JSON;
remove the earlier duplicate block (the one in the shown diff) so only a single
"minimaxApi" declaration remains, ensuring keys like "name", "MiniMax-M25",
"alterUrl", and "temperaturePrompt" exist only once and the later definition is
kept; update the file so JSON.parse returns the intended object and re-run the
duplicate-key check (search for "minimaxApi") to verify only one occurrence
remains.
In `@src/i18n/locales/zhtw.json`:
- Around line 403-408: Convert the Simplified Chinese strings to Traditional
Chinese for the zhtw locale keys: update "alterUrl" value to use Traditional
characters, change "alterUrlPrompt" from "自定义 API
端点地址(默认:https://api.minimax.io/v1)" to use Traditional forms ("自訂", "預設"),
change "temperature" to the Traditional form of "温度" ("溫度"), change
"temperaturePrompt" to use Traditional forms for "采样"/"范围" ("取樣"/"範圍"), and
ensure "temperature01" and "temperature1" use the Traditional terms ("精確" and
"創意"); modify the values for the keys alterUrl, alterUrlPrompt, temperature,
temperaturePrompt, temperature01, and temperature1 accordingly.
---
Nitpick comments:
In `@src/bots/index.js`:
- Around line 69-72: Replace the deep relative imports for the new MiniMax bots
with the project alias: update the import statements that reference
MiniMaxM25Bot, MiniMaxM25HighspeedBot, MiniMaxM27Bot, and MiniMaxM27HighspeedBot
to use the "@/..." alias path pointing into the src/minimax module instead of
the current relative paths so they follow the repo convention for imports.
In `@tests/minimax-integration.test.js`:
- Around line 249-263: The test currently only checks for a non-empty reply but
must assert the system instruction was applied; update the "System message
support" test (in tests/minimax-integration.test.js around the chatCompletion
call) to assert that result.body.choices[0].message.content includes or endsWith
the required "PINEAPPLE." suffix (e.g., trim the content and verify it endsWith
"PINEAPPLE."); keep the existing status === 200 assertion and replace or add the
length check with a check that the returned message enforces the system
instruction.
In `@tests/minimax-unit.test.js`:
- Around line 328-366: The test currently only reads en.json and zh.json
(variables enLocale and zhLocale) and asserts minimaxApi keys; update the test
to iterate over the full set of locale filenames touched by this PR (e.g., an
array of the 11 locale short names), for each file read it with
fs.readFileSync/path.join, parse JSON into a locale variable, and assert that
locale.minimaxApi exists and contains the expected model keys (e.g.,
"MiniMax-M25", "MiniMax-M25-highspeed", "MiniMax-M27", "MiniMax-M27-highspeed");
reference the existing enLocale/zhLocale usage and replace the two standalone
checks with a loop over the locales array to make the assertions for every
locale file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4a31b744-1ff5-4b43-b20f-cb8ed70e34ca
📒 Files selected for processing (16)
src/bots/index.jssrc/bots/minimax/MiniMaxM27Bot.jssrc/bots/minimax/MiniMaxM27HighspeedBot.jssrc/i18n/locales/de.jsonsrc/i18n/locales/en.jsonsrc/i18n/locales/es.jsonsrc/i18n/locales/fr.jsonsrc/i18n/locales/it.jsonsrc/i18n/locales/ja.jsonsrc/i18n/locales/ko.jsonsrc/i18n/locales/ru.jsonsrc/i18n/locales/vi.jsonsrc/i18n/locales/zh.jsonsrc/i18n/locales/zhtw.jsontests/minimax-integration.test.jstests/minimax-unit.test.js
🚧 Files skipped from review as they are similar to previous changes (3)
- src/i18n/locales/ru.json
- src/i18n/locales/es.json
- src/i18n/locales/vi.json
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "MiniMax-M27": "MiniMax-M2.7", | ||
| "MiniMax-M27-highspeed": "MiniMax-M2.7-highspeed", | ||
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" | ||
| } |
There was a problem hiding this comment.
Missing German translations for MiniMax API settings.
The minimaxApi block contains English text instead of German translations. For consistency with the rest of de.json, consider translating:
"alterUrlPrompt"→ e.g., "Benutzerdefinierte API-Endpunkt-URL (Standard: https://api.minimax.io/v1)""temperature"→ "Temperatur" (already used elsewhere in this file, e.g., line 111)"temperaturePrompt"→ e.g., "Sampling-Temperatur zwischen 0,1 und 1""temperature01"→ e.g., "Präzise""temperature1"→ e.g., "Kreativ"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/de.json` around lines 397 - 409, Translate the English
strings in the minimaxApi localization object into German: update the keys
"alterUrlPrompt" to a German sentence such as "Benutzerdefinierte
API-Endpunkt-URL (Standard: https://api.minimax.io/v1)", "temperature" to
"Temperatur", "temperaturePrompt" to something like "Sampling-Temperatur
zwischen 0,1 und 1", "temperature01" to "Präzise", and "temperature1" to
"Kreativ" so the minimaxApi block matches the rest of de.json and existing
terminology used elsewhere.
| "minimaxApi": { | ||
| "name": "MiniMax API", | ||
| "MiniMax-M25": "MiniMax-M2.5", | ||
| "MiniMax-M25-highspeed": "MiniMax-M2.5-highspeed", | ||
| "MiniMax-M27": "MiniMax-M2.7", | ||
| "MiniMax-M27-highspeed": "MiniMax-M2.7-highspeed", | ||
| "alterUrl": "API URL", | ||
| "alterUrlPrompt": "Custom API endpoint URL (default: https://api.minimax.io/v1)", | ||
| "temperature": "Temperature", | ||
| "temperaturePrompt": "What sampling temperature to use, between 0.1 and 1", | ||
| "temperature01": "Precise", | ||
| "temperature1": "Creative" | ||
| } |
There was a problem hiding this comment.
Missing Korean translations for MiniMax API settings.
The minimaxApi block contains English text instead of Korean translations. For consistency with the rest of ko.json, consider translating the user-facing strings:
"alterUrlPrompt"→ e.g., "사용자 정의 API 엔드포인트 URL (기본값: https://api.minimax.io/v1)""temperature"→ "온도" (already used elsewhere in this file)"temperaturePrompt"→ e.g., "0.1에서 1 사이의 샘플링 온도""temperature01"→ e.g., "정밀""temperature1"→ e.g., "창의적"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/i18n/locales/ko.json` around lines 400 - 412, The minimaxApi localization
block contains English strings; replace the user-facing values under the
"minimaxApi" object (keys like "alterUrl", "alterUrlPrompt", "temperature",
"temperaturePrompt", "temperature01", "temperature1") with Korean translations
(for example: "alterUrl" → "API URL" if desired in Korean, "alterUrlPrompt" →
"사용자 정의 API 엔드포인트 URL (기본값: https://api.minimax.io/v1)", "temperature" → "온도",
"temperaturePrompt" → "0.1에서 1 사이의 샘플링 온도", "temperature01" → "정밀",
"temperature1" → "창의적") so the entire minimaxApi block matches the rest of
ko.json.
| function chatCompletion(model, messages, options = {}) { | ||
| return new Promise((resolve, reject) => { | ||
| const url = new URL(`${BASE_URL}/chat/completions`); | ||
|
|
||
| const body = JSON.stringify({ | ||
| model, | ||
| messages, | ||
| temperature: options.temperature || 1.0, | ||
| max_tokens: options.max_tokens || 100, | ||
| stream: false, | ||
| }); | ||
|
|
||
| const req = https.request( | ||
| url, | ||
| { | ||
| method: "POST", | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| Authorization: `Bearer ${API_KEY}`, | ||
| }, | ||
| }, | ||
| (res) => { | ||
| let data = ""; | ||
| res.on("data", (chunk) => (data += chunk)); | ||
| res.on("end", () => { | ||
| try { | ||
| resolve({ status: res.statusCode, body: JSON.parse(data) }); | ||
| } catch (e) { | ||
| resolve({ status: res.statusCode, body: data }); | ||
| } | ||
| }); | ||
| }, | ||
| ); | ||
|
|
||
| req.on("error", reject); | ||
| req.setTimeout(60000, () => { | ||
| req.destroy(); | ||
| reject(new Error("Request timed out")); | ||
| }); | ||
| req.write(body); | ||
| req.end(); | ||
| }); | ||
| } |
There was a problem hiding this comment.
This “integration” test bypasses ChatALL’s MiniMax integration.
chatCompletion() hand-rolls an HTTPS POST to MiniMax, so regressions in src/bots/minimax/MiniMaxAPIBot.js—ChatOpenAI construction, store-backed alterUrl / temperature / apiKey, and the production streaming config—would still pass here. Please drive these cases through MiniMaxAPIBot or a concrete MiniMax bot so the test actually covers the code being shipped.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/minimax-integration.test.js` around lines 32 - 74, The test currently
uses the helper chatCompletion() which issues a raw HTTPS POST and bypasses
MiniMax code; replace the direct HTTPS call so the test instantiates and
exercises the real MiniMax integration (the MiniMaxAPIBot class in
src/bots/minimax/MiniMaxAPIBot.js or the concrete MiniMax bot) and calls its
public production method that produces completions (e.g., the
send/handle/sendMessage/chat method used in runtime) so the test flows through
ChatOpenAI construction, store-backed alterUrl/temperature/apiKey, and streaming
configuration; ensure the test sets up the store/state or injects configuration
values (alterUrl, temperature, apiKey, streaming flag) used by MiniMaxAPIBot so
those code paths are exercised instead of the hand-rolled chatCompletion().
| assert(result.status === 200, `Status code is 200 (got ${result.status})`); | ||
| assert(result.body.choices, "Response has choices array"); | ||
| assert( | ||
| result.body.choices.length > 0, | ||
| "Response has at least one choice", | ||
| ); | ||
| assert( | ||
| result.body.choices[0].message, | ||
| "First choice has a message", | ||
| ); | ||
| assert( | ||
| typeof result.body.choices[0].message.content === "string", | ||
| "Message content is a string", | ||
| ); | ||
| assert( | ||
| result.body.choices[0].message.content.length > 0, | ||
| `Got response: "${result.body.choices[0].message.content.substring(0, 50)}"`, |
There was a problem hiding this comment.
Guard choices[0].message before reading it.
assert(...) only records a failure; it does not stop execution. If the API returns an error payload or raw text, the next dereference throws and hides the actual response body. The same pattern repeats in later suites.
♻️ Proposed fix
assert(result.status === 200, `Status code is 200 (got ${result.status})`);
- assert(result.body.choices, "Response has choices array");
+ assert(Array.isArray(result.body?.choices), "Response has choices array");
+ const message = result.body?.choices?.[0]?.message;
+ if (!message) {
+ assert(false, `Unexpected response body: ${JSON.stringify(result.body)}`);
+ return;
+ }
assert(
result.body.choices.length > 0,
"Response has at least one choice",
);
assert(
- result.body.choices[0].message,
+ message,
"First choice has a message",
);
assert(
- typeof result.body.choices[0].message.content === "string",
+ typeof message.content === "string",
"Message content is a string",
);
assert(
- result.body.choices[0].message.content.length > 0,
- `Got response: "${result.body.choices[0].message.content.substring(0, 50)}"`,
+ message.content.length > 0,
+ `Got response: "${message.content.substring(0, 50)}"`,
);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| assert(result.status === 200, `Status code is 200 (got ${result.status})`); | |
| assert(result.body.choices, "Response has choices array"); | |
| assert( | |
| result.body.choices.length > 0, | |
| "Response has at least one choice", | |
| ); | |
| assert( | |
| result.body.choices[0].message, | |
| "First choice has a message", | |
| ); | |
| assert( | |
| typeof result.body.choices[0].message.content === "string", | |
| "Message content is a string", | |
| ); | |
| assert( | |
| result.body.choices[0].message.content.length > 0, | |
| `Got response: "${result.body.choices[0].message.content.substring(0, 50)}"`, | |
| assert(result.status === 200, `Status code is 200 (got ${result.status})`); | |
| assert(Array.isArray(result.body?.choices), "Response has choices array"); | |
| const message = result.body?.choices?.[0]?.message; | |
| if (!message) { | |
| assert(false, `Unexpected response body: ${JSON.stringify(result.body)}`); | |
| return; | |
| } | |
| assert( | |
| result.body.choices.length > 0, | |
| "Response has at least one choice", | |
| ); | |
| assert( | |
| message, | |
| "First choice has a message", | |
| ); | |
| assert( | |
| typeof message.content === "string", | |
| "Message content is a string", | |
| ); | |
| assert( | |
| message.content.length > 0, | |
| `Got response: "${message.content.substring(0, 50)}"`, | |
| ); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/minimax-integration.test.js` around lines 89 - 105, The test currently
dereferences result.body.choices[0].message without stopping execution on
failure; update the checks around result, result.body.choices, and
result.body.choices[0].message so you guard existence before accessing
message.content (e.g., assert that result.body && result.body.choices &&
result.body.choices[0] && result.body.choices[0].message are truthy), and when a
guard fails include the full result (or result.body) in the assertion/error
message to surface the actual API response; apply the same pattern to the later
suites that read result.body.choices[0].message.content to avoid hidden
dereference exceptions.
- Add MiniMax-M3 as new default model via MiniMaxM3Bot - Remove MiniMax-M2.5 and MiniMax-M2.5-highspeed models - Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed - Update 11 i18n locale files to add M3 and drop M2.5 entries - Update unit and integration tests to reference M3
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/i18n/locales/vi.json (1)
381-386:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMiniMax strings left in English in the Vietnamese locale.
alterUrl,alterUrlPrompt,temperature,temperaturePrompt,temperature01, andtemperature1are untranslated here, unlike the rest of this file (e.g.,openaiApi.temperaturePrompt). Please localize these to Vietnamese for consistency.As per coding guidelines: "Update
src/i18n/localeslanguage packs when introducing new user-facing text or actions".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/i18n/locales/vi.json` around lines 381 - 386, The listed MiniMax strings (alterUrl, alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) are still in English; update their values to Vietnamese so the locale is consistent — replace "API URL" with "URL API", "Custom API endpoint URL (default: https://api.minimax.io/v1)" with "URL endpoint API tùy chỉnh (mặc định: https://api.minimax.io/v1)", "Temperature" with "Nhiệt độ", "What sampling temperature to use, between 0.1 and 1" with "Chọn nhiệt độ lấy mẫu, từ 0.1 đến 1", "Precise" with "Chính xác" and "Creative" with "Sáng tạo" by editing those keys (alterUrl, alterUrlPrompt, temperature, temperaturePrompt, temperature01, temperature1) in the locale JSON.
♻️ Duplicate comments (2)
src/i18n/locales/zhtw.json (1)
402-407:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winSimplified Chinese used instead of Traditional Chinese.
The
minimaxApivalues still use Simplified Chinese (e.g., 自定义→自訂, 默认→預設, 温度→溫度, 采样温度→取樣溫度, 范围→範圍, 精确→精確, 创意→創意) in this Traditional Chinese (zhtw) locale.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/i18n/locales/zhtw.json` around lines 402 - 407, The strings for the minimaxApi keys are in Simplified Chinese; update the Traditional Chinese translations for the keys "alterUrl", "alterUrlPrompt", "temperature", "temperaturePrompt", "temperature01", and "temperature1" in src/i18n/locales/zhtw.json by replacing Simplified terms with their Traditional counterparts (例如: 自定义→自訂, 默认→預設, 温度→溫度, 采样温度→取樣溫度, 范围→範圍, 精确→精確, 创意→創意) so the zhtw locale uses proper Traditional Chinese.tests/minimax-integration.test.js (1)
90-110:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winGuard
choices[0].messagebefore dereferencing in the new M3 suite.
assert(...)only records a failure; it does not halt execution. If MiniMax-M3 returns an error payload or raw text, line 100/104 throws and hides the actual response body. Same pattern as the other suites.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/minimax-integration.test.js` around lines 90 - 110, The test dereferences result.body.choices[0].message before guaranteeing it exists, which can throw and hide the real response; add an explicit guard/assert for result.body.choices[0].message (e.g., assert(result.body.choices[0].message, "First choice has a message")) before any use of choices[0].message.content, and reorder the checks in tests/minimax-integration.test.js so checks of choices[0].message run prior to accessing choices[0].message.content and choices[0].message.content.length.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/bots/index.js`:
- Around line 69-71: Update the three import statements that currently use
relative paths to use the project alias: replace "./minimax/MiniMaxM27Bot",
"./minimax/MiniMaxM27HighspeedBot", and "./minimax/MiniMaxM3Bot" with
"`@/minimax/MiniMaxM27Bot`", "`@/minimax/MiniMaxM27HighspeedBot`", and
"`@/minimax/MiniMaxM3Bot`" respectively so that the symbols MiniMaxM27Bot,
MiniMaxM27HighspeedBot, and MiniMaxM3Bot are imported via the alias consistent
with the src/* import guideline.
---
Outside diff comments:
In `@src/i18n/locales/vi.json`:
- Around line 381-386: The listed MiniMax strings (alterUrl, alterUrlPrompt,
temperature, temperaturePrompt, temperature01, temperature1) are still in
English; update their values to Vietnamese so the locale is consistent — replace
"API URL" with "URL API", "Custom API endpoint URL (default:
https://api.minimax.io/v1)" with "URL endpoint API tùy chỉnh (mặc định:
https://api.minimax.io/v1)", "Temperature" with "Nhiệt độ", "What sampling
temperature to use, between 0.1 and 1" with "Chọn nhiệt độ lấy mẫu, từ 0.1 đến
1", "Precise" with "Chính xác" and "Creative" with "Sáng tạo" by editing those
keys (alterUrl, alterUrlPrompt, temperature, temperaturePrompt, temperature01,
temperature1) in the locale JSON.
---
Duplicate comments:
In `@src/i18n/locales/zhtw.json`:
- Around line 402-407: The strings for the minimaxApi keys are in Simplified
Chinese; update the Traditional Chinese translations for the keys "alterUrl",
"alterUrlPrompt", "temperature", "temperaturePrompt", "temperature01", and
"temperature1" in src/i18n/locales/zhtw.json by replacing Simplified terms with
their Traditional counterparts (例如: 自定义→自訂, 默认→預設, 温度→溫度, 采样温度→取樣溫度, 范围→範圍,
精确→精確, 创意→創意) so the zhtw locale uses proper Traditional Chinese.
In `@tests/minimax-integration.test.js`:
- Around line 90-110: The test dereferences result.body.choices[0].message
before guaranteeing it exists, which can throw and hide the real response; add
an explicit guard/assert for result.body.choices[0].message (e.g.,
assert(result.body.choices[0].message, "First choice has a message")) before any
use of choices[0].message.content, and reorder the checks in
tests/minimax-integration.test.js so checks of choices[0].message run prior to
accessing choices[0].message.content and choices[0].message.content.length.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1e5bb11a-f341-40cf-92db-e6152f2c536f
📒 Files selected for processing (15)
src/bots/index.jssrc/bots/minimax/MiniMaxM3Bot.jssrc/i18n/locales/de.jsonsrc/i18n/locales/en.jsonsrc/i18n/locales/es.jsonsrc/i18n/locales/fr.jsonsrc/i18n/locales/it.jsonsrc/i18n/locales/ja.jsonsrc/i18n/locales/ko.jsonsrc/i18n/locales/ru.jsonsrc/i18n/locales/vi.jsonsrc/i18n/locales/zh.jsonsrc/i18n/locales/zhtw.jsontests/minimax-integration.test.jstests/minimax-unit.test.js
✅ Files skipped from review due to trivial changes (1)
- src/bots/minimax/MiniMaxM3Bot.js
🚧 Files skipped from review as they are similar to previous changes (2)
- src/i18n/locales/ko.json
- src/i18n/locales/fr.json
| import MiniMaxM27Bot from "./minimax/MiniMaxM27Bot"; | ||
| import MiniMaxM27HighspeedBot from "./minimax/MiniMaxM27HighspeedBot"; | ||
| import MiniMaxM3Bot from "./minimax/MiniMaxM3Bot"; |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Use @/ alias for MiniMax bot imports.
Lines 69-71 use relative import paths (./minimax/...) instead of the @/ alias. As per coding guidelines, imports from src/ should use the @/ alias for consistency and clarity.
♻️ Proposed fix
-import MiniMaxM27Bot from "./minimax/MiniMaxM27Bot";
-import MiniMaxM27HighspeedBot from "./minimax/MiniMaxM27HighspeedBot";
-import MiniMaxM3Bot from "./minimax/MiniMaxM3Bot";
+import MiniMaxM27Bot from "`@/bots/minimax/MiniMaxM27Bot`";
+import MiniMaxM27HighspeedBot from "`@/bots/minimax/MiniMaxM27HighspeedBot`";
+import MiniMaxM3Bot from "`@/bots/minimax/MiniMaxM3Bot`";As per coding guidelines for src/**/*.{js,ts,vue}: Use the @/ alias instead of deep relative paths for imports from src/.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import MiniMaxM27Bot from "./minimax/MiniMaxM27Bot"; | |
| import MiniMaxM27HighspeedBot from "./minimax/MiniMaxM27HighspeedBot"; | |
| import MiniMaxM3Bot from "./minimax/MiniMaxM3Bot"; | |
| import MiniMaxM27Bot from "`@/bots/minimax/MiniMaxM27Bot`"; | |
| import MiniMaxM27HighspeedBot from "`@/bots/minimax/MiniMaxM27HighspeedBot`"; | |
| import MiniMaxM3Bot from "`@/bots/minimax/MiniMaxM3Bot`"; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/bots/index.js` around lines 69 - 71, Update the three import statements
that currently use relative paths to use the project alias: replace
"./minimax/MiniMaxM27Bot", "./minimax/MiniMaxM27HighspeedBot", and
"./minimax/MiniMaxM3Bot" with "`@/minimax/MiniMaxM27Bot`",
"`@/minimax/MiniMaxM27HighspeedBot`", and "`@/minimax/MiniMaxM3Bot`" respectively so
that the symbols MiniMaxM27Bot, MiniMaxM27HighspeedBot, and MiniMaxM3Bot are
imported via the alias consistent with the src/* import guideline.
Summary
@langchain/openaiChatOpenAI)Changes
New files
src/bots/minimax/MiniMaxAPIBot.js— Base class extending LangChainBot with OpenAI-compatible configurationsrc/bots/minimax/MiniMaxM27Bot.js— MiniMax-M2.7 model botsrc/bots/minimax/MiniMaxM27HighspeedBot.js— MiniMax-M2.7-highspeed model botsrc/bots/minimax/MiniMaxM3Bot.js— MiniMax-M3 (default) model botsrc/components/BotSettings/MiniMaxAPIBotSettings.vue— Settings UI componentpublic/bots/minimax-logo.svg— MiniMax logotests/minimax-unit.test.js— 50 unit teststests/minimax-integration.test.js— Integration testsModified files
src/bots/index.js— Register MiniMax bots (all, api, madeInChina tags)src/store/index.js— Add minimaxApi state + setMiniMaxApi mutationsrc/components/SettingsModal.vue— Register MiniMaxAPIBotSettings componentsrc/i18n/locales/*.json— Add MiniMax model display names (11 locales)README.md/README_ZH-CN.md— Add MiniMax to supported providers listTest plan
node tests/minimax-unit.test.js)Summary by CodeRabbit
New Features
Documentation
Tests