mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:20:43 +00:00
29 lines
906 B
TypeScript
29 lines
906 B
TypeScript
import {
|
|
applyAgentDefaultModelPrimary,
|
|
type OpenClawConfig,
|
|
} from "openclaw/plugin-sdk/provider-onboard";
|
|
|
|
export const GOOGLE_GEMINI_DEFAULT_MODEL = "google/gemini-3.1-pro-preview";
|
|
|
|
export function applyGoogleGeminiModelDefault(cfg: OpenClawConfig): {
|
|
next: OpenClawConfig;
|
|
changed: boolean;
|
|
} {
|
|
const current = cfg.agents?.defaults?.model as unknown;
|
|
const currentPrimary =
|
|
typeof current === "string"
|
|
? current.trim() || undefined
|
|
: current &&
|
|
typeof current === "object" &&
|
|
typeof (current as { primary?: unknown }).primary === "string"
|
|
? ((current as { primary: string }).primary || "").trim() || undefined
|
|
: undefined;
|
|
if (currentPrimary === GOOGLE_GEMINI_DEFAULT_MODEL) {
|
|
return { next: cfg, changed: false };
|
|
}
|
|
return {
|
|
next: applyAgentDefaultModelPrimary(cfg, GOOGLE_GEMINI_DEFAULT_MODEL),
|
|
changed: true,
|
|
};
|
|
}
|