(modelName: string)
| 49 | }; |
| 50 | |
| 51 | function getOllamaIcon(modelName: string): string { |
| 52 | if (OLLAMA_ICON_MAP[modelName]) { |
| 53 | return OLLAMA_ICON_MAP[modelName]; |
| 54 | } |
| 55 | let bestMatch = ""; |
| 56 | for (const prefix of Object.keys(OLLAMA_ICON_MAP)) { |
| 57 | if (modelName.startsWith(prefix) && prefix.length > bestMatch.length) { |
| 58 | bestMatch = prefix; |
| 59 | } |
| 60 | } |
| 61 | return bestMatch ? OLLAMA_ICON_MAP[bestMatch] : "ollama.png"; |
| 62 | } |
| 63 | |
| 64 | async function fetchOllamaModels(): Promise<FetchedModel[]> { |
| 65 | try { |