autogen icon indicating copy to clipboard operation
autogen copied to clipboard

fix: ensure streaming chunks are immediately flushed to console

Open Dormiveglia-elf opened this issue 9 months ago • 0 comments

Added flush=True to the aprint call when handling ModelClientStreamingChunkEvent message to ensure each chunk is immediately displayed as it arrives.

Why are these changes needed?

When handling ModelClientStreamingChunkEvent message, streaming chunks weren't guaranteed to be displayed immediately, as Python's stdout might buffer output without an explicit flush instruction. This could cause visual delays between when chunk_event objects are added to the message queue and when users actually see the content rendered in the console.

Related issue number

None

Checks

Dormiveglia-elf avatar Apr 29 '25 07:04 Dormiveglia-elf