| 1842 | } | 1842 | } |
| 1843 | | 1843 | |
| 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 | if (model.pricing?.prompt !== undefined && model.pricing?.completion !== undefined) { | 1846 | .filter(model => model?.id) |
| 1847 | return { | 1847 | .map(model => { |
| 1848 | ...model, | 1848 | if (model.pricing?.prompt !== undefined && model.pricing?.completion !== undefined) { |
| 1849 | pricing: { | 1849 | return { |
| 1850 | ...model.pricing, | 1850 | ...model, |
| 1851 | input: model.pricing.prompt, | 1851 | pricing: { |
| 1852 | output: model.pricing.completion, | 1852 | ...model.pricing, |
| 1853 | }, | 1853 | input: model.pricing.prompt, |
| 1854 | }; | 1854 | output: model.pricing.completion, |
| 1855 | } | 1855 | }, |
| 1856 | return model; | 1856 | }; |
| 1857 | }); | 1857 | } |
| | 1858 | return model; |
| | 1859 | }); |
| 1858 | } | 1860 | } |
| 1859 | | 1861 | |
| 1860 | statusResponse.send(data); | 1862 | statusResponse.send(data); |