File tree Expand file tree Collapse file tree 2 files changed +7
-16
lines changed
Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -314,22 +314,9 @@ export function useChatStreaming() {
314314 let finalContent = accumulatedText
315315
316316 if ( formattedOutputs . length > 0 ) {
317- const trimmedStreamingContent = accumulatedText . trim ( )
318-
319- const uniqueOutputs = formattedOutputs . filter ( ( output ) => {
320- const trimmedOutput = output . trim ( )
321- if ( ! trimmedOutput ) return false
322-
323- // Skip outputs that are already in the streamed content to avoid duplication
324- if ( trimmedStreamingContent ?. includes ( trimmedOutput ) ) {
325- return false
326- }
327-
328- return true
329- } )
330-
331- if ( uniqueOutputs . length > 0 ) {
332- const combinedOutputs = uniqueOutputs . join ( '\n\n' )
317+ const nonEmptyOutputs = formattedOutputs . filter ( ( output ) => output . trim ( ) )
318+ if ( nonEmptyOutputs . length > 0 ) {
319+ const combinedOutputs = nonEmptyOutputs . join ( '\n\n' )
333320 finalContent = finalContent
334321 ? `${ finalContent . trim ( ) } \n\n${ combinedOutputs } `
335322 : combinedOutputs
Original file line number Diff line number Diff line change @@ -203,6 +203,10 @@ export async function createStreamingResponse(
203203
204204 for ( const outputId of streamConfig . selectedOutputs ) {
205205 const blockId = extractBlockIdFromOutputId ( outputId )
206+ if ( streamedContent . has ( blockId ) ) {
207+ continue
208+ }
209+
206210 const path = extractPathFromOutputId ( outputId , blockId )
207211
208212 if ( result . logs ) {
You can’t perform that action at this time.
0 commit comments