filter out models that don't have a valid id (#4920)

3668e95d9513f7732d52201210601896ddadba43

Ben <44178664+cxmplex@users.noreply.github.com>

Signed
1 files changed, +3 -1Showing whitespace changes
src/endpoints/backends/chat-completions.js+3 -1
@@ -1842,7 +1842,9 @@ router.post('/status', async function (request, statusResponse) {
1842 }1842 }
18431843
1844 if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CHUTES && Array.isArray(data?.data)) {1844 if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CHUTES && Array.isArray(data?.data)) {
1845 data.data = data.data.map(model => {1845 data.data = data.data
1846 .filter(model => model?.id)
1847 .map(model => {
1846 if (model.pricing?.prompt !== undefined && model.pricing?.completion !== undefined) {1848 if (model.pricing?.prompt !== undefined && model.pricing?.completion !== undefined) {
1847 return {1849 return {
1848 ...model,1850 ...model,