UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

29 lines (28 loc) • 999 B
//#region src/agents/image-compression-policy.ts /** Resolves the authoritative image limits for one selected provider/model. */ async function resolveImageCompressionModelPolicy(e) { async function resolvePolicyWithHooks(t) { try { const { resolveModelAsync: n } = await import("./model-BGxC_MMq.mjs"); return (await n(e.provider, e.model, e.agentDir, e.cfg, { abortSignal: e.abortSignal, allowBundledStaticCatalogFallback: true, skipProviderRuntimeHooks: t, skipAgentDiscovery: true, workspaceDir: e.workspaceDir, ...e.preparedModelRuntime ? { preparedModelRuntime: e.preparedModelRuntime } : {} })).model?.mediaInput?.image ?? {}; } catch { e.abortSignal?.throwIfAborted(); return {}; } } const t = await resolvePolicyWithHooks(true); if (typeof t.maxSidePx === "number" || typeof t.maxPixels === "number") return t; return { ...await resolvePolicyWithHooks(false), ...t }; } //#endregion export { resolveImageCompressionModelPolicy as t };