( provider: string, apiKey?: string, apiBase?: string, )
| 239 | } |
| 240 | |
| 241 | export async function fetchModels( |
| 242 | provider: string, |
| 243 | apiKey?: string, |
| 244 | apiBase?: string, |
| 245 | ): Promise<FetchedModel[]> { |
| 246 | switch (provider) { |
| 247 | case "ollama": |
| 248 | return fetchOllamaModels(); |
| 249 | case "openrouter": |
| 250 | return fetchOpenRouterModels(); |
| 251 | case "anthropic": |
| 252 | return fetchAnthropicModels(apiKey); |
| 253 | case "gemini": |
| 254 | return fetchGeminiModels(apiKey, apiBase); |
| 255 | default: |
| 256 | return fetchProviderModelsViaListModels(provider, apiKey, apiBase); |
| 257 | } |
| 258 | } |
no test coverage detected