mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Bugfix/ui streaming when model streaming is off (#4424)
fix ui streaming when model streaming is off
This commit is contained in:
@@ -903,7 +903,11 @@ class Agent_Agentflow implements INode {
|
||||
}
|
||||
} else if (!humanInput && !isStreamable && isLastNode && sseStreamer) {
|
||||
// Stream whole response back to UI if not streaming and no tool calls
|
||||
sseStreamer.streamTokenEvent(chatId, JSON.stringify(response, null, 2))
|
||||
let responseContent = JSON.stringify(response, null, 2)
|
||||
if (typeof response.content === 'string') {
|
||||
responseContent = response.content
|
||||
}
|
||||
sseStreamer.streamTokenEvent(chatId, responseContent)
|
||||
}
|
||||
|
||||
// Calculate execution time
|
||||
@@ -1473,7 +1477,11 @@ class Agent_Agentflow implements INode {
|
||||
|
||||
// Stream non-streaming response if this is the last node
|
||||
if (isLastNode && sseStreamer) {
|
||||
sseStreamer.streamTokenEvent(chatId, JSON.stringify(newResponse, null, 2))
|
||||
let responseContent = JSON.stringify(newResponse, null, 2)
|
||||
if (typeof newResponse.content === 'string') {
|
||||
responseContent = newResponse.content
|
||||
}
|
||||
sseStreamer.streamTokenEvent(chatId, responseContent)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1715,7 +1723,11 @@ class Agent_Agentflow implements INode {
|
||||
|
||||
// Stream non-streaming response if this is the last node
|
||||
if (isLastNode && sseStreamer) {
|
||||
sseStreamer.streamTokenEvent(chatId, JSON.stringify(newResponse, null, 2))
|
||||
let responseContent = JSON.stringify(newResponse, null, 2)
|
||||
if (typeof newResponse.content === 'string') {
|
||||
responseContent = newResponse.content
|
||||
}
|
||||
sseStreamer.streamTokenEvent(chatId, responseContent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user