You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thanks for great library! Is there any way to stop the response using this lib? We are low on resources, so we want when user clicks stop button on our frontend (or closes the page) to stop generating response. We've tried this, but it didn't end the response flow:
try{forawait(constpartofresponse){if(clientDisconnected){break;// Stop sending data if the client disconnects}res.write(`${JSON.stringify(part)}`);}}catch(err){console.error('Error while streaming response:',err);}finally{console.log("Response ended");res.end();}
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi! Thanks for great library! Is there any way to stop the response using this lib? We are low on resources, so we want when user clicks stop button on our frontend (or closes the page) to stop generating response. We've tried this, but it didn't end the response flow:
Thanks in advance!
The text was updated successfully, but these errors were encountered: