openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
17 lines (16 loc) • 720 B
JavaScript
import { l as normalizeOptionalString } from "./string-coerce-CCIiB4H7.mjs";
import "./string-coerce-runtime-BwAZZDf5.mjs";
import { n as parseGoogleOauthApiKey } from "./oauth-token-shared-CMNaYFOD.mjs";
//#region extensions/google/gemini-auth.ts
function parseGeminiAuth(e) {
const t = e.startsWith("{") ? parseGoogleOauthApiKey(e) : null;
return { headers: {
...t?.token ? { Authorization: `Bearer ${t.token}` } : { "x-goog-api-key": e },
"Content-Type": "application/json"
} };
}
function resolveGoogleEnvApiKey() {
return normalizeOptionalString(process.env.GEMINI_API_KEY) ?? normalizeOptionalString(process.env.GOOGLE_API_KEY);
}
//#endregion
export { resolveGoogleEnvApiKey as n, parseGeminiAuth as t };