@@ -903,7 +903,11 @@ class Agent_Agentflow implements INode {
903
903
}
904
904
} else if ( ! humanInput && ! isStreamable && isLastNode && sseStreamer ) {
905
905
// Stream whole response back to UI if not streaming and no tool calls
906
- sseStreamer . streamTokenEvent ( chatId , JSON . stringify ( response , null , 2 ) )
906
+ let responseContent = JSON . stringify ( response , null , 2 )
907
+ if ( typeof response . content === 'string' ) {
908
+ responseContent = response . content
909
+ }
910
+ sseStreamer . streamTokenEvent ( chatId , responseContent )
907
911
}
908
912
909
913
// Calculate execution time
@@ -1473,7 +1477,11 @@ class Agent_Agentflow implements INode {
1473
1477
1474
1478
// Stream non-streaming response if this is the last node
1475
1479
if ( isLastNode && sseStreamer ) {
1476
- sseStreamer . streamTokenEvent ( chatId , JSON . stringify ( newResponse , null , 2 ) )
1480
+ let responseContent = JSON . stringify ( newResponse , null , 2 )
1481
+ if ( typeof newResponse . content === 'string' ) {
1482
+ responseContent = newResponse . content
1483
+ }
1484
+ sseStreamer . streamTokenEvent ( chatId , responseContent )
1477
1485
}
1478
1486
}
1479
1487
@@ -1715,7 +1723,11 @@ class Agent_Agentflow implements INode {
1715
1723
1716
1724
// Stream non-streaming response if this is the last node
1717
1725
if ( isLastNode && sseStreamer ) {
1718
- sseStreamer . streamTokenEvent ( chatId , JSON . stringify ( newResponse , null , 2 ) )
1726
+ let responseContent = JSON . stringify ( newResponse , null , 2 )
1727
+ if ( typeof newResponse . content === 'string' ) {
1728
+ responseContent = newResponse . content
1729
+ }
1730
+ sseStreamer . streamTokenEvent ( chatId , responseContent )
1719
1731
}
1720
1732
}
1721
1733
0 commit comments