Check for errors on the `stream_end` event

This commit is contained in:
50h100a 2023-10-10 18:04:28 -04:00
parent 7be3718a36
commit 6e78ec11fb
1 changed files with 3 additions and 0 deletions

View File

@ -627,6 +627,9 @@ app.post("/generate_textgenerationwebui", jsonParser, async function (request, r
yield message.text;
break;
case 'stream_end':
if (message.error) {
yield `\n[API Error] ${message.error}\n`
}
websocket.close();
return;
}