mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import type { CliBackendPlugin } from "openclaw/plugin-sdk/cli-backend";
|
|
import {
|
|
CLI_FRESH_WATCHDOG_DEFAULTS,
|
|
CLI_RESUME_WATCHDOG_DEFAULTS,
|
|
} from "openclaw/plugin-sdk/cli-backend";
|
|
|
|
const GEMINI_MODEL_ALIASES: Record<string, string> = {
|
|
pro: "gemini-3.1-pro-preview",
|
|
flash: "gemini-3.1-flash-preview",
|
|
"flash-lite": "gemini-3.1-flash-lite-preview",
|
|
};
|
|
|
|
export function buildGoogleGeminiCliBackend(): CliBackendPlugin {
|
|
return {
|
|
id: "google-gemini-cli",
|
|
config: {
|
|
command: "gemini",
|
|
args: ["--prompt", "--output-format", "json"],
|
|
resumeArgs: ["--resume", "{sessionId}", "--prompt", "--output-format", "json"],
|
|
output: "json",
|
|
input: "arg",
|
|
modelArg: "--model",
|
|
modelAliases: GEMINI_MODEL_ALIASES,
|
|
sessionMode: "existing",
|
|
sessionIdFields: ["session_id", "sessionId"],
|
|
reliability: {
|
|
watchdog: {
|
|
fresh: { ...CLI_FRESH_WATCHDOG_DEFAULTS },
|
|
resume: { ...CLI_RESUME_WATCHDOG_DEFAULTS },
|
|
},
|
|
},
|
|
serialize: true,
|
|
},
|
|
};
|
|
}
|