(apiKey)
| 86276 | } |
| 86277 | const data = await response.json(); |
| 86278 | const models = data.data?.map((m5) => m5.id).filter((id) => id.startsWith("claude-")).sort(); |
| 86279 | return models && models.length > 0 ? models : MODEL_LIST.anthropic; |
| 86280 | } catch { |
| 86281 | return MODEL_LIST.anthropic; |
| 86282 | } |
| 86283 | } |
| 86284 | async function fetchMistralModels(apiKey) { |
| 86285 | try { |
| 86286 | const response = await fetch("https://api.mistral.ai/v1/models", { |
| 86287 | headers: { |
| 86288 | Authorization: `Bearer ${apiKey}` |
| 86289 | } |
| 86290 | }); |
| 86291 | if (!response.ok) { |
| 86292 | return MODEL_LIST.mistral; |
| 86293 | } |
| 86294 | const data = await response.json(); |
| 86295 | const models = data.data?.map((m5) => m5.id).sort(); |
| 86296 | return models && models.length > 0 ? models : MODEL_LIST.mistral; |
| 86297 | } catch { |
no test coverage detected