mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-31 11:35:37 +01:00
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…
x
Reference in New Issue
Block a user