UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

32 lines (31 loc) • 1.29 kB
import { r as normalizeProviderId } from "./provider-id-b5XGSf9C.mjs"; import { n as createBundledStaticCatalogModelResolver } from "./model.static-catalog-BYAE0w4W.mjs"; //#region src/agents/bundled-model-identity-facts.ts /** * Looks up model-identity facts for rows that reach a bundled provider's model through * another route. Matching is exact: aliases, unknown and future ids inherit nothing. * Plugin enablement does not matter; the manifest describes the upstream model. */ function createBundledModelIdentityFactsResolver() { const e = createBundledStaticCatalogModelResolver({ includeRuntimeDiscovery: true }); return ({ provider: t, api: n, modelId: r }) => { const i = e({ provider: t, modelId: r }); if (!i || i.provider !== normalizeProviderId(t) || i.id !== r || i.api !== n) return; const { codeMode: a, supportsTemperature: o } = i.compat ?? {}; const s = { ...a !== void 0 ? { codeMode: a } : {}, ...o !== void 0 ? { supportsTemperature: o } : {} }; const c = { ...Object.keys(s).length > 0 ? { compat: s } : {}, ...i.mediaInput ? { mediaInput: i.mediaInput } : {}, ...i.family ? { family: i.family } : {} }; return Object.keys(c).length > 0 ? c : void 0; }; } //#endregion export { createBundledModelIdentityFactsResolver };