mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
chore: delegate text handling to one place, html sanitization in progress
This commit is contained in:
parent
2e20b28c4d
commit
d0ef0f84c8
4 changed files with 27 additions and 10 deletions
|
@ -8,10 +8,10 @@ const {
|
|||
askClient,
|
||||
browserClient,
|
||||
customClient,
|
||||
detectCode
|
||||
// detectCode
|
||||
} = require('../../app/');
|
||||
const { getConvo, saveMessage, getConvoTitle, saveConvo } = require('../../models');
|
||||
const { handleError, sendMessage, createOnProgress } = require('./handlers');
|
||||
const { handleError, sendMessage, createOnProgress, handleText } = require('./handlers');
|
||||
const { getMessages } = require('../../models/Message');
|
||||
|
||||
router.use('/bing', askBing);
|
||||
|
@ -177,7 +177,8 @@ const ask = async ({
|
|||
|
||||
gptResponse.sender = model === 'chatgptCustom' ? convo.chatGptLabel : model;
|
||||
// gptResponse.final = true;
|
||||
gptResponse.text = await detectCode(gptResponse.text);
|
||||
// gptResponse.text = await detectCode(gptResponse.text);
|
||||
gptResponse.text = await handleText(gptResponse.text);
|
||||
|
||||
if (convo.chatGptLabel?.length > 0 && model === 'chatgptCustom') {
|
||||
gptResponse.chatGptLabel = convo.chatGptLabel;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue