mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01: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
|
|
@ -3,7 +3,7 @@ const crypto = require('crypto');
|
|||
const router = express.Router();
|
||||
const { titleConvo, getCitations, citeText, askSydney } = require('../../app/');
|
||||
const { saveMessage, saveConvo, getConvoTitle } = require('../../models');
|
||||
const { handleError, sendMessage, createOnProgress } = require('./handlers');
|
||||
const { handleError, sendMessage, createOnProgress, handleText } = require('./handlers');
|
||||
const citationRegex = /\[\^\d+?\^]/g;
|
||||
|
||||
router.post('/', async (req, res) => {
|
||||
|
|
@ -114,6 +114,7 @@ const ask = async ({
|
|||
response.text =
|
||||
citeText(response) +
|
||||
(links?.length > 0 && hasCitations ? `\n<small>${links}</small>` : '');
|
||||
response.text = await handleText(response.text);
|
||||
|
||||
// Save user message
|
||||
userMessage.conversationId = response.conversationId || conversationId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue