MCPcopy Create free account
hub / github.com/AICoderTudou/claude-code-tudou / normalizeModelEntries

Function normalizeModelEntries

desktop/main.cjs:214–225  ·  view source on GitHub ↗
(list, provider)

Source from the content-addressed store, hash-verified

212}
213
214function normalizeModelEntries(list, provider) {
215 if (!Array.isArray(list)) return [];
216 return list
217 .map((item) => {
218 const id = `${item?.id || ""}`.trim();
219 if (!id) return null;
220 const name = `${item?.name || item?.display_name || id}`.trim();
221 return { id, name, provider };
222 })
223 .filter(Boolean)
224 .slice(0, 120);
225}
226
227async function listOpenRouterModels(timeoutMs) {
228 const result = await fetchJsonWithTimeout("https://openrouter.ai/api/v1/models", { timeoutMs });

Callers 2

listOpenRouterModelsFunction · 0.85
listAnthropicModelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected