Skip to content

A programming framework for agentic AI

fix: ensure streaming chunks are immediately flushed to console (#6424)

Zhenyu7c29704525a7
diff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/ui/_console.py b/python/packages/autogen-agentchat/src/autogen_agentchat/ui/_console.py
index 112ddafe4..12fba2b48 100644
--- a/python/packages/autogen-agentchat/src/autogen_agentchat/ui/_console.py
+++ b/python/packages/autogen-agentchat/src/autogen_agentchat/ui/_console.py
@@ -177,7 +177,7 @@ async def Console(
f"{'-' * 10} {message.__class__.__name__} ({message.source}) {'-' * 10}", end="\n", flush=True
)
if isinstance(message, ModelClientStreamingChunkEvent):
- await aprint(message.to_text(), end="")
+ await aprint(message.to_text(), end="", flush=True)
streaming_chunks.append(message.content)
else:
if streaming_chunks: