diff --git a/api/server/routes/ask.js b/api/server/routes/ask.js index 23ed20ba85..6fa1589fbd 100644 --- a/api/server/routes/ask.js +++ b/api/server/routes/ask.js @@ -18,7 +18,7 @@ router.use('/sydney', askSydney); router.post('/', async (req, res) => { let { model, text, parentMessageId, conversationId, chatGptLabel, promptPrefix } = req.body; - if (!text.trim().includes(' ') && text.length < 5) { + if (text.length === 0) { return handleError(res, 'Prompt empty or too short'); } diff --git a/api/server/routes/askBing.js b/api/server/routes/askBing.js index 42718b9d91..76c39f6804 100644 --- a/api/server/routes/askBing.js +++ b/api/server/routes/askBing.js @@ -8,7 +8,7 @@ const citationRegex = /\[\^\d+?\^]/g; router.post('/', async (req, res) => { const { model, text, ...convo } = req.body; - if (!text.trim().includes(' ') && text.length < 5) { + if (text.length === 0) { return handleError(res, 'Prompt empty or too short'); } diff --git a/api/server/routes/askSydney.js b/api/server/routes/askSydney.js index 149b8b1c45..219f9b2437 100644 --- a/api/server/routes/askSydney.js +++ b/api/server/routes/askSydney.js @@ -8,7 +8,7 @@ const citationRegex = /\[\^\d+?\^]/g; router.post('/', async (req, res) => { const { model, text, ...convo } = req.body; - if (!text.trim().includes(' ') && text.length < 5) { + if (text.length === 0) { return handleError(res, 'Prompt empty or too short'); }