mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
feat: Abort AI builder requests on chat stop (#17854)
This commit is contained in:
@@ -219,6 +219,7 @@ export async function streamRequest<T extends object>(
|
||||
onDone?: () => void,
|
||||
onError?: (e: Error) => void,
|
||||
separator = STREAM_SEPERATOR,
|
||||
abortSignal?: AbortSignal,
|
||||
): Promise<void> {
|
||||
const headers: Record<string, string> = {
|
||||
'browser-id': getBrowserId(),
|
||||
@@ -229,6 +230,7 @@ export async function streamRequest<T extends object>(
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
body: JSON.stringify(payload),
|
||||
signal: abortSignal,
|
||||
};
|
||||
try {
|
||||
const response = await fetch(`${context.baseUrl}${apiEndpoint}`, assistantRequest);
|
||||
|
||||
Reference in New Issue
Block a user