Fix type checks
| @@ -18,6 +18,7 @@ router.post('/models/providers', async (req, res) => { | ||
| 18 | 18 | return res.json([]); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | + /** @type {any} */ | |
| 21 | 22 | const data = await response.json(); |
| 22 | 23 | const endpoints = data?.data?.endpoints || []; |
| 23 | 24 | const providerNames = endpoints.map(e => e.provider_name); |
| @@ -43,6 +44,7 @@ router.post('/models/multimodal', async (_req, res) => { | ||
| 43 | 44 | return res.json([]); |
| 44 | 45 | } |
| 45 | 46 | |
| 47 | + /** @type {any} */ | |
| 46 | 48 | const data = await response.json(); |
| 47 | 49 | const models = data?.data || []; |
| 48 | 50 | const multimodalModels = models.filter(m => m?.architecture?.modality === 'text+image->text').map(m => m.id); |
| @@ -1025,6 +1025,7 @@ router.post('/remote/kobold/count', async function (request, response) { | ||
| 1025 | 1025 | return response.send({ error: true }); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | + /** @type {any} */ | |
| 1028 | 1029 | const data = await result.json(); |
| 1029 | 1030 | const count = data['value']; |
| 1030 | 1031 | const ids = data['ids'] ?? []; |
| @@ -1089,6 +1090,7 @@ router.post('/remote/textgenerationwebui/encode', async function (request, respo | ||
| 1089 | 1090 | return response.send({ error: true }); |
| 1090 | 1091 | } |
| 1091 | 1092 | |
| 1093 | + /** @type {any} */ | |
| 1092 | 1094 | const data = await result.json(); |
| 1093 | 1095 | const count = (data?.length ?? data?.count ?? data?.value ?? data?.tokens?.length); |
| 1094 | 1096 | const ids = (data?.tokens ?? data?.ids ?? []); |