UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

40 lines (39 loc) • 1.73 kB
import { i as OMLX_PROVIDER_ID, r as OMLX_LOCAL_API_KEY, t as OMLX_API_KEY_ENV_VAR } from "./.setup/defaults-CsYyfrvv.mjs"; //#region extensions/omlx/provider-discovery.ts var provider_discovery_default = { id: OMLX_PROVIDER_ID, label: "oMLX", docsPath: "/providers/omlx", envVars: [OMLX_API_KEY_ENV_VAR], auth: [], catalog: { order: "late", run: async (e) => { const { discoverOmlxProvider: t } = await import("./.setup/setup-BwFSOxis.mjs"); return t(e); } }, resolveSyntheticAuth: ({ providerConfig: e }) => { if (e?.apiKey && e.apiKey !== "omlx-local") return; return { apiKey: OMLX_LOCAL_API_KEY, source: "oMLX local server", mode: "api-key" }; }, prepareRuntimeAuthV2: async ({ config: e, provider: t, model: n, apiKey: r }) => { const [{ CUSTOM_LOCAL_AUTH_MARKER: i, findNormalizedProviderValue: a }, { getModelProviderRequestTransport: o }] = await Promise.all([import("openclaw/plugin-sdk/provider-auth"), import("openclaw/plugin-sdk/agent-harness-runtime")]); const s = a(e?.models?.providers, t); const c = o(n) ?? s?.request; if (s?.apiKey && s.apiKey !== "omlx-local" && c?.auth?.mode !== "header") return; const l = c?.auth; if (l?.mode === "authorization-bearer" || (l?.mode === "header" ? l.headerName.trim().toLowerCase() === "authorization" : [ s?.headers, c?.headers, n.headers ].some((e) => Object.entries(e ?? {}).some(([e, t]) => e.trim().toLowerCase() === "authorization" && Boolean(typeof t === "string" ? t.trim() : t))))) return { apiKey: OMLX_LOCAL_API_KEY }; if (s?.apiKey === "omlx-local" || r === "omlx-local" || r === i || c?.auth?.mode === "header") return { apiKey: i }; } }; //#endregion export { provider_discovery_default as default };