mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-18 05:20:48 +00:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { applyAgentDefaultModelPrimary } from "../../src/commands/onboard-auth.config-shared.js";
|
|
import { OPENCODE_GO_DEFAULT_MODEL_REF } from "../../src/commands/opencode-go-model-default.js";
|
|
import type { OpenClawConfig } from "../../src/config/config.js";
|
|
|
|
export { OPENCODE_GO_DEFAULT_MODEL_REF };
|
|
|
|
const OPENCODE_GO_ALIAS_DEFAULTS: Record<string, string> = {
|
|
"opencode-go/kimi-k2.5": "Kimi",
|
|
"opencode-go/glm-5": "GLM",
|
|
"opencode-go/minimax-m2.5": "MiniMax",
|
|
};
|
|
|
|
export function applyOpencodeGoProviderConfig(cfg: OpenClawConfig): OpenClawConfig {
|
|
const models = { ...cfg.agents?.defaults?.models };
|
|
for (const [modelRef, alias] of Object.entries(OPENCODE_GO_ALIAS_DEFAULTS)) {
|
|
models[modelRef] = {
|
|
...models[modelRef],
|
|
alias: models[modelRef]?.alias ?? alias,
|
|
};
|
|
}
|
|
|
|
return {
|
|
...cfg,
|
|
agents: {
|
|
...cfg.agents,
|
|
defaults: {
|
|
...cfg.agents?.defaults,
|
|
models,
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
export function applyOpencodeGoConfig(cfg: OpenClawConfig): OpenClawConfig {
|
|
return applyAgentDefaultModelPrimary(
|
|
applyOpencodeGoProviderConfig(cfg),
|
|
OPENCODE_GO_DEFAULT_MODEL_REF,
|
|
);
|
|
}
|