(apiKey)
| 86329 | const models = data.data?.filter( |
| 86330 | (m5) => m5.context_length && m5.context_length > 0 |
| 86331 | ).map((m5) => m5.id).sort(); |
| 86332 | return models && models.length > 0 ? models : MODEL_LIST.openrouter; |
| 86333 | } catch { |
| 86334 | return MODEL_LIST.openrouter; |
| 86335 | } |
| 86336 | } |
| 86337 | async function fetchDeepSeekModels(apiKey) { |
| 86338 | try { |
| 86339 | const response = await fetch("https://api.deepseek.com/v1/models", { |
| 86340 | headers: { |
| 86341 | Authorization: `Bearer ${apiKey}` |
| 86342 | } |
| 86343 | }); |
| 86344 | if (!response.ok) { |
| 86345 | return MODEL_LIST.deepseek; |
| 86346 | } |
| 86347 | const data = await response.json(); |
| 86348 | const models = data.data?.map((m5) => m5.id).sort(); |
| 86349 | return models && models.length > 0 ? models : MODEL_LIST.deepseek; |
| 86350 | } catch { |
no test coverage detected
searching dependent graphs…