* MiniMax: add M2.7 models and update default to M2.7 - Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to provider catalog and model definitions - Update default model from MiniMax-M2.5 to MiniMax-M2.7 across onboard, portal, and provider configs - Update isModernMiniMaxModel to recognize M2.7 prefix - Update all test fixtures to reflect M2.7 as default Made-with: Cursor * MiniMax: add extension test for model definitions * update 2.7 * feat: add MiniMax M2.7 models and update default (#49691) (thanks @liyuan97) --------- Co-authored-by: George Zhang <georgezhangtj97@gmail.com>
91 lines
2.2 KiB
TypeScript
91 lines
2.2 KiB
TypeScript
import type {
|
|
ModelDefinitionConfig,
|
|
ModelProviderConfig,
|
|
} from "openclaw/plugin-sdk/provider-models";
|
|
|
|
const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic";
|
|
export const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M2.7";
|
|
const MINIMAX_DEFAULT_VISION_MODEL_ID = "MiniMax-VL-01";
|
|
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 200000;
|
|
const MINIMAX_DEFAULT_MAX_TOKENS = 8192;
|
|
const MINIMAX_API_COST = {
|
|
input: 0.3,
|
|
output: 1.2,
|
|
cacheRead: 0.03,
|
|
cacheWrite: 0.12,
|
|
};
|
|
|
|
function buildMinimaxModel(params: {
|
|
id: string;
|
|
name: string;
|
|
reasoning: boolean;
|
|
input: ModelDefinitionConfig["input"];
|
|
}): ModelDefinitionConfig {
|
|
return {
|
|
id: params.id,
|
|
name: params.name,
|
|
reasoning: params.reasoning,
|
|
input: params.input,
|
|
cost: MINIMAX_API_COST,
|
|
contextWindow: MINIMAX_DEFAULT_CONTEXT_WINDOW,
|
|
maxTokens: MINIMAX_DEFAULT_MAX_TOKENS,
|
|
};
|
|
}
|
|
|
|
function buildMinimaxTextModel(params: {
|
|
id: string;
|
|
name: string;
|
|
reasoning: boolean;
|
|
}): ModelDefinitionConfig {
|
|
return buildMinimaxModel({ ...params, input: ["text"] });
|
|
}
|
|
|
|
function buildMinimaxCatalog(): ModelDefinitionConfig[] {
|
|
return [
|
|
buildMinimaxModel({
|
|
id: MINIMAX_DEFAULT_VISION_MODEL_ID,
|
|
name: "MiniMax VL 01",
|
|
reasoning: false,
|
|
input: ["text", "image"],
|
|
}),
|
|
buildMinimaxTextModel({
|
|
id: MINIMAX_DEFAULT_MODEL_ID,
|
|
name: "MiniMax M2.7",
|
|
reasoning: true,
|
|
}),
|
|
buildMinimaxTextModel({
|
|
id: "MiniMax-M2.7-highspeed",
|
|
name: "MiniMax M2.7 Highspeed",
|
|
reasoning: true,
|
|
}),
|
|
buildMinimaxTextModel({
|
|
id: "MiniMax-M2.5",
|
|
name: "MiniMax M2.5",
|
|
reasoning: true,
|
|
}),
|
|
buildMinimaxTextModel({
|
|
id: "MiniMax-M2.5-highspeed",
|
|
name: "MiniMax M2.5 Highspeed",
|
|
reasoning: true,
|
|
}),
|
|
];
|
|
}
|
|
|
|
export function buildMinimaxProvider(): ModelProviderConfig {
|
|
return {
|
|
baseUrl: MINIMAX_PORTAL_BASE_URL,
|
|
api: "anthropic-messages",
|
|
authHeader: true,
|
|
models: buildMinimaxCatalog(),
|
|
};
|
|
}
|
|
|
|
export function buildMinimaxPortalProvider(): ModelProviderConfig {
|
|
return {
|
|
baseUrl: MINIMAX_PORTAL_BASE_URL,
|
|
api: "anthropic-messages",
|
|
authHeader: true,
|
|
models: buildMinimaxCatalog(),
|
|
};
|
|
}
|