mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01: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 });
|
sendMessage(res, { ...partial, message: true });
|
||||||
} else {
|
} else {
|
||||||
tokens += partial === text ? '' : partial;
|
tokens += partial === text ? '' : partial;
|
||||||
|
if (tokens.match(/^\n/)) {
|
||||||
|
tokens = tokens.replace(/^\n/, '');
|
||||||
|
}
|
||||||
|
|
||||||
if (tokens.includes('[DONE]')) {
|
if (tokens.includes('[DONE]')) {
|
||||||
tokens = tokens.replace('[DONE]', '');
|
tokens = tokens.replace('[DONE]', '');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue