UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

21 lines (20 loc) • 1.08 kB
import { l as normalizeOptionalString } from "./string-coerce-6kR-86XC.mjs"; import { a as resolveAgentDir } from "./agent-scope-config-BU4qc9bA.mjs"; import "./string-coerce-runtime-B1b8UNzb.mjs"; import "./agent-scope-runtime-kyXy8x5x.mjs"; import { a as resolveApiKeyForProvider } from "./provider-auth-runtime-CdsNdEp6.mjs"; //#region extensions/xai/realtime-voice-auth.runtime.ts async function resolveXaiRealtimeApiKey(configApiKey, cfg, agentId) { const direct = normalizeOptionalString(configApiKey) ?? normalizeOptionalString(process.env.XAI_API_KEY); if (direct) return direct; const auth = await resolveApiKeyForProvider({ provider: "xai", cfg, ...cfg && agentId ? { agentDir: resolveAgentDir(cfg, agentId) } : {} }); const oauthKey = normalizeOptionalString(auth?.apiKey); if (oauthKey) return oauthKey; throw new Error("xAI credentials missing for realtime voice. Sign in with `openclaw onboard --auth-choice xai-oauth`, run `openclaw onboard --auth-choice xai-api-key`, or set XAI_API_KEY."); } //#endregion export { resolveXaiRealtimeApiKey as t };