UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

20 lines (19 loc) • 822 B
//#region extensions/requesty/provider-policy-api.ts const DATED_SNAPSHOT_SUFFIX = /^-(?:\d{4}-\d{2}-\d{2}|\d{8})$/u; /** * Requesty echoes the upstream lab's response id (`claude-sonnet-4-6`, * `gpt-5.5-2026-04-23`) while the requested id may carry an operator-authored * hosting prefix (`vertex/claude-sonnet-4-6`), so those reports name the same route. */ function isResponseModelEquivalent({ provider: e, requestedModelId: t, responseModelId: n }) { if (e.trim().toLowerCase() !== "requesty") return; const r = t.trim(); const i = n.trim(); if (!i) return; if (r === i || r.endsWith(`/${i}`)) return true; const a = r.indexOf("/"); const o = a === -1 ? r : r.slice(a + 1); return o === i || i.startsWith(o) && DATED_SNAPSHOT_SUFFIX.test(i.slice(o.length)); } //#endregion export { isResponseModelEquivalent };