UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

42 lines (41 loc) • 1.69 kB
import { h as runLiveProviderCatalog } from "../../provider-catalog-live-runtime-Cii7Axx2.mjs"; import { t as defineSingleProviderPluginEntry } from "../../provider-entry-B6zHcYqA.mjs"; import { o as openclaw_plugin_default } from "../../models-DTlFq2iI.mjs"; import { r as applyHuggingfaceConnectionConfig, t as HUGGINGFACE_DEFAULT_MODEL_REF } from "../../onboard-H3OCKsAs.mjs"; import { t as buildHuggingfaceProvider } from "../../provider-catalog-Mz29_tMF.mjs"; //#region extensions/huggingface/index.ts const PROVIDER_ID = "huggingface"; var huggingface_default = defineSingleProviderPluginEntry({ id: PROVIDER_ID, name: "Hugging Face Provider", description: "Bundled Hugging Face provider plugin", manifest: openclaw_plugin_default, provider: { label: "Hugging Face", docsPath: "/providers/huggingface", envVars: ["HUGGINGFACE_HUB_TOKEN", "HF_TOKEN"], manifestAuth: { defaultModel: HUGGINGFACE_DEFAULT_MODEL_REF, applyConfig: applyHuggingfaceConnectionConfig }, catalog: { run: async (ctx) => { if ((ctx.config?.plugins?.entries?.[PROVIDER_ID]?.config)?.discovery?.enabled === false) return null; const { apiKey, discoveryApiKey, profileId } = ctx.resolveProviderApiKey(PROVIDER_ID); if (!apiKey) return null; const run = async () => ({ provider: { ...await buildHuggingfaceProvider(discoveryApiKey, { discoveryMode: "strict" }), apiKey } }); return discoveryApiKey ? await runLiveProviderCatalog({ providerId: PROVIDER_ID, profileId, run }) : await run(); }, staticRun: async () => ({ provider: await buildHuggingfaceProvider() }) } } }); //#endregion export { huggingface_default as default };