UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

25 lines (24 loc) 925 B
import { y as uniqueStrings } from "./string-normalization-DsCfAx8q.js"; import "./string-coerce-runtime-GQa0ehRA.js"; import { d as normalizeProviderId } from "./provider-model-shared-fX-Ywqb3.js"; //#region extensions/ollama/src/model-id.ts const OLLAMA_PROVIDER_ID = "ollama"; function uniqueModelPrefixCandidates(providerId) { const candidates = [ providerId, normalizeProviderId(providerId ?? ""), OLLAMA_PROVIDER_ID ].map((candidate) => candidate?.trim()).filter((candidate) => Boolean(candidate)); return uniqueStrings(candidates); } function normalizeOllamaWireModelId(modelId, providerId) { const trimmed = modelId.trim(); if (!trimmed) return trimmed; for (const candidate of uniqueModelPrefixCandidates(providerId)) { const prefix = `${candidate}/`; if (trimmed.startsWith(prefix)) return trimmed.slice(prefix.length); } return trimmed; } //#endregion export { normalizeOllamaWireModelId as t };