mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-17 07:23:30 +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
86
openclaw/extensions/minimax/provider-catalog.ts
Normal file
86
openclaw/extensions/minimax/provider-catalog.ts
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
import type {
|
||||
ModelDefinitionConfig,
|
||||
ModelProviderConfig,
|
||||
} from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import {
|
||||
DEFAULT_MINIMAX_CONTEXT_WINDOW,
|
||||
DEFAULT_MINIMAX_MAX_TOKENS,
|
||||
MINIMAX_API_BASE_URL,
|
||||
resolveMinimaxApiCost,
|
||||
} from "./model-definitions.js";
|
||||
import { MINIMAX_TEXT_MODEL_CATALOG, MINIMAX_TEXT_MODEL_ORDER } from "./provider-models.js";
|
||||
|
||||
function resolveMinimaxCatalogBaseUrl(env: NodeJS.ProcessEnv = process.env): string {
|
||||
const rawHost = env.MINIMAX_API_HOST?.trim();
|
||||
if (!rawHost) {
|
||||
return MINIMAX_API_BASE_URL;
|
||||
}
|
||||
|
||||
try {
|
||||
const url = new URL(rawHost);
|
||||
const basePath = url.pathname.replace(/\/+$/, "");
|
||||
if (basePath.endsWith("/anthropic")) {
|
||||
return `${url.origin}${basePath}`;
|
||||
}
|
||||
return `${url.origin}/anthropic`;
|
||||
} catch {
|
||||
return MINIMAX_API_BASE_URL;
|
||||
}
|
||||
}
|
||||
|
||||
function buildMinimaxModel(params: {
|
||||
id: string;
|
||||
name: string;
|
||||
reasoning: boolean;
|
||||
input: ModelDefinitionConfig["input"];
|
||||
cost: ModelDefinitionConfig["cost"];
|
||||
}): ModelDefinitionConfig {
|
||||
return {
|
||||
id: params.id,
|
||||
name: params.name,
|
||||
reasoning: params.reasoning,
|
||||
input: params.input,
|
||||
cost: params.cost,
|
||||
contextWindow: DEFAULT_MINIMAX_CONTEXT_WINDOW,
|
||||
maxTokens: DEFAULT_MINIMAX_MAX_TOKENS,
|
||||
};
|
||||
}
|
||||
|
||||
function buildMinimaxTextModel(params: {
|
||||
id: string;
|
||||
name: string;
|
||||
reasoning: boolean;
|
||||
cost: ModelDefinitionConfig["cost"];
|
||||
}): ModelDefinitionConfig {
|
||||
return buildMinimaxModel({ ...params, input: ["text"] });
|
||||
}
|
||||
|
||||
function buildMinimaxCatalog(): ModelDefinitionConfig[] {
|
||||
return MINIMAX_TEXT_MODEL_ORDER.map((id) => {
|
||||
const model = MINIMAX_TEXT_MODEL_CATALOG[id];
|
||||
return buildMinimaxTextModel({
|
||||
id,
|
||||
name: model.name,
|
||||
reasoning: model.reasoning,
|
||||
cost: resolveMinimaxApiCost(id),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function buildMinimaxProvider(env?: NodeJS.ProcessEnv): ModelProviderConfig {
|
||||
return {
|
||||
baseUrl: resolveMinimaxCatalogBaseUrl(env),
|
||||
api: "anthropic-messages",
|
||||
authHeader: true,
|
||||
models: buildMinimaxCatalog(),
|
||||
};
|
||||
}
|
||||
|
||||
export function buildMinimaxPortalProvider(env?: NodeJS.ProcessEnv): ModelProviderConfig {
|
||||
return {
|
||||
baseUrl: resolveMinimaxCatalogBaseUrl(env),
|
||||
api: "anthropic-messages",
|
||||
authHeader: true,
|
||||
models: buildMinimaxCatalog(),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue