mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-06-07 23:06:34 +08:00
Major upgrade from e26988a38 to upstream v2026.3.28 (f9b107928).
Key changes:
- Upstream src/, ui/, extensions/ (89 bundled extensions)
- Zero-token web providers preserved in src/zero-token/
- AskOnce plugin restored and registered as CLI command
- Added missing packages: @anthropic-ai/vertex-sdk, @modelcontextprotocol/sdk
- Fixed tsconfig rootDir, skipLibCheck for plugin-sdk DTS build
- Added askonce to bundled plugin metadata and package.json exports
- Fixed AskOnce CLI command registration (missing commands metadata)
- Restored AskOnce adapter imports (correct 5-level relative paths)
- Removed stale migration artifacts from root directory
74 lines
1.7 KiB
TypeScript
74 lines
1.7 KiB
TypeScript
import type {
|
|
ModelDefinitionConfig,
|
|
ModelProviderConfig,
|
|
} from "openclaw/plugin-sdk/provider-model-shared";
|
|
import {
|
|
MINIMAX_DEFAULT_MODEL_ID,
|
|
MINIMAX_TEXT_MODEL_CATALOG,
|
|
MINIMAX_TEXT_MODEL_ORDER,
|
|
} from "./provider-models.js";
|
|
|
|
const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic";
|
|
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 204800;
|
|
const MINIMAX_DEFAULT_MAX_TOKENS = 131072;
|
|
const MINIMAX_API_COST = {
|
|
input: 0.3,
|
|
output: 1.2,
|
|
cacheRead: 0.06,
|
|
cacheWrite: 0.375,
|
|
};
|
|
|
|
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 MINIMAX_TEXT_MODEL_ORDER.map((id) => {
|
|
const model = MINIMAX_TEXT_MODEL_CATALOG[id];
|
|
return buildMinimaxTextModel({
|
|
id,
|
|
name: model.name,
|
|
reasoning: model.reasoning,
|
|
});
|
|
});
|
|
}
|
|
|
|
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(),
|
|
};
|
|
}
|