Files
openclaw/extensions/google/provider-contract-api.ts
2026-07-30 16:33:33 +08:00

58 lines
1.5 KiB
TypeScript

// Google API module exposes the plugin public contract.
import type { ProviderPlugin } from "openclaw/plugin-sdk/provider-model-shared";
const noopAuth = async () => ({ profiles: [] });
export function createGoogleProvider(): ProviderPlugin {
return {
id: "google",
label: "Google AI Studio",
docsPath: "/providers/models",
hookAliases: ["google-antigravity", "google-vertex"],
envVars: ["GEMINI_API_KEY", "GOOGLE_API_KEY"],
auth: [
{
id: "api-key",
kind: "api_key",
label: "Google AI Studio API key",
hint: "Supported API-key access from aistudio.google.com/apikey",
run: noopAuth,
wizard: {
choiceId: "gemini-api-key",
choiceLabel: "Google AI Studio API key",
groupId: "google",
groupLabel: "Google",
groupHint: "Supported API-key setup",
},
},
],
};
}
export function createGoogleVertexProvider(): ProviderPlugin {
return {
id: "google-vertex",
label: "Google Vertex AI",
docsPath: "/providers/models",
envVars: [
"GOOGLE_CLOUD_API_KEY",
"GOOGLE_CLOUD_PROJECT",
"GCLOUD_PROJECT",
"GOOGLE_CLOUD_LOCATION",
"GOOGLE_APPLICATION_CREDENTIALS",
],
auth: [],
};
}
export function createGoogleGeminiCliProvider(): ProviderPlugin {
return {
id: "google-gemini-cli",
label: "Gemini CLI runtime",
docsPath: "/providers/models",
aliases: ["gemini-cli"],
envVars: [],
auth: [],
};
}