mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-16 03:10:47 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
93
openclaw/extensions/minimax/model-definitions.ts
Normal file
93
openclaw/extensions/minimax/model-definitions.ts
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import { MINIMAX_DEFAULT_MODEL_ID, MINIMAX_TEXT_MODEL_CATALOG } from "./provider-models.js";
|
||||
|
||||
export const DEFAULT_MINIMAX_BASE_URL = "https://api.minimax.io/v1";
|
||||
export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic";
|
||||
export const MINIMAX_CN_API_BASE_URL = "https://api.minimaxi.com/anthropic";
|
||||
export const MINIMAX_HOSTED_MODEL_ID = MINIMAX_DEFAULT_MODEL_ID;
|
||||
export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`;
|
||||
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800;
|
||||
export const DEFAULT_MINIMAX_MAX_TOKENS = 131072;
|
||||
|
||||
export const MINIMAX_API_COST = {
|
||||
input: 0.3,
|
||||
output: 1.2,
|
||||
cacheRead: 0.06,
|
||||
cacheWrite: 0.375,
|
||||
};
|
||||
export const MINIMAX_API_HIGHSPEED_COST = {
|
||||
input: 0.6,
|
||||
output: 2.4,
|
||||
cacheRead: 0.06,
|
||||
cacheWrite: 0.375,
|
||||
};
|
||||
export const MINIMAX_M25_API_COST = {
|
||||
input: 0.3,
|
||||
output: 1.2,
|
||||
cacheRead: 0.03,
|
||||
cacheWrite: 0.375,
|
||||
};
|
||||
export const MINIMAX_M25_API_HIGHSPEED_COST = {
|
||||
input: 0.6,
|
||||
output: 2.4,
|
||||
cacheRead: 0.03,
|
||||
cacheWrite: 0.375,
|
||||
};
|
||||
export const MINIMAX_HOSTED_COST = {
|
||||
input: 0,
|
||||
output: 0,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
};
|
||||
export const MINIMAX_LM_STUDIO_COST = {
|
||||
input: 0,
|
||||
output: 0,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
};
|
||||
|
||||
type MinimaxCatalogId = keyof typeof MINIMAX_TEXT_MODEL_CATALOG;
|
||||
|
||||
export function resolveMinimaxApiCost(modelId: string): ModelDefinitionConfig["cost"] {
|
||||
if (modelId === "MiniMax-M2.5-highspeed") {
|
||||
return MINIMAX_M25_API_HIGHSPEED_COST;
|
||||
}
|
||||
if (modelId === "MiniMax-M2.5") {
|
||||
return MINIMAX_M25_API_COST;
|
||||
}
|
||||
if (modelId === "MiniMax-M2.7-highspeed") {
|
||||
return MINIMAX_API_HIGHSPEED_COST;
|
||||
}
|
||||
return MINIMAX_API_COST;
|
||||
}
|
||||
|
||||
export function buildMinimaxModelDefinition(params: {
|
||||
id: string;
|
||||
name?: string;
|
||||
reasoning?: boolean;
|
||||
cost: ModelDefinitionConfig["cost"];
|
||||
contextWindow: number;
|
||||
maxTokens: number;
|
||||
}): ModelDefinitionConfig {
|
||||
const catalog = MINIMAX_TEXT_MODEL_CATALOG[params.id as MinimaxCatalogId];
|
||||
// MiniMax-M2.7 supports image input
|
||||
const isImageCapable = params.id === "MiniMax-M2.7" || params.id.startsWith("MiniMax-M2.7-");
|
||||
return {
|
||||
id: params.id,
|
||||
name: params.name ?? catalog?.name ?? `MiniMax ${params.id}`,
|
||||
reasoning: params.reasoning ?? catalog?.reasoning ?? false,
|
||||
input: isImageCapable ? ["text", "image"] : ["text"],
|
||||
cost: params.cost,
|
||||
contextWindow: params.contextWindow,
|
||||
maxTokens: params.maxTokens,
|
||||
};
|
||||
}
|
||||
|
||||
export function buildMinimaxApiModelDefinition(modelId: string): ModelDefinitionConfig {
|
||||
return buildMinimaxModelDefinition({
|
||||
id: modelId,
|
||||
cost: resolveMinimaxApiCost(modelId),
|
||||
contextWindow: DEFAULT_MINIMAX_CONTEXT_WINDOW,
|
||||
maxTokens: DEFAULT_MINIMAX_MAX_TOKENS,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue