Don't send streaming request if generation was aborted before the streaming processor creation
This commit is contained in:
parent
6dbbf89d65
commit
57175b4229
|
@ -5020,6 +5020,10 @@ async function sendGenerationRequest(type, data) {
|
|||
* @returns {Promise<any>} Streaming generator
|
||||
*/
|
||||
async function sendStreamingRequest(type, data) {
|
||||
if (abortController?.signal?.aborted) {
|
||||
throw new Error('Generation was aborted.');
|
||||
}
|
||||
|
||||
switch (main_api) {
|
||||
case 'openai':
|
||||
return await sendOpenAIRequest(type, data.prompt, streamingProcessor.abortController.signal);
|
||||
|
|
Loading…
Reference in New Issue