mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
fix: removes newline from start of stream response if present
This commit is contained in:
parent
20da895ee7
commit
3038015a5b
1 changed files with 4 additions and 0 deletions
|
@ -77,6 +77,10 @@ router.post('/', async (req, res) => {
|
|||
sendMessage(res, { ...partial, message: true });
|
||||
} else {
|
||||
tokens += partial === text ? '' : partial;
|
||||
if (tokens.match(/^\n/)) {
|
||||
tokens = tokens.replace(/^\n/, '');
|
||||
}
|
||||
|
||||
if (tokens.includes('[DONE]')) {
|
||||
tokens = tokens.replace('[DONE]', '');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue