@@ -22,7 +22,6 @@ def __init__(self, console: Console, message_handler: MessageHandler):
2222 """Initialize UI effects with a console instance."""
2323 self .console = console
2424 self .live = None
25- self ._live_text_data = ""
2625 self ._loading_stop_event = None
2726 self ._loading_thread = None
2827 self .message_handler = message_handler
@@ -75,10 +74,10 @@ def stop_loading_animation(self):
7574 """Stop the loading animation."""
7675 if self ._loading_stop_event :
7776 self ._loading_stop_event .set ()
77+ self ._loading_stop_event = None
7878 if self ._loading_thread and self ._loading_thread .is_alive ():
7979 self ._loading_thread .join (timeout = 0.5 )
80- self ._loading_stop_event = None
81- self ._loading_thread = None
80+ self ._loading_thread = None
8281
8382 def start_streaming_response (self , agent_name : str ):
8483 """Start streaming the assistant's response."""
@@ -88,9 +87,7 @@ def start_streaming_response(self, agent_name: str):
8887 self .console .print (
8988 Text (f"🤖 { agent_name .upper ()} :" , style = RICH_STYLE_GREEN_BOLD )
9089 )
91- self .live = Live (
92- "" , console = self .console , refresh_per_second = 24 , vertical_overflow = "crop"
93- )
90+ self .live = Live ("" , console = self .console , vertical_overflow = "crop" )
9491 self .live .start ()
9592
9693 def update_live_display (self , chunk : str ):
@@ -99,10 +96,6 @@ def update_live_display(self, chunk: str):
9996 self .start_streaming_response (self .message_handler .agent .name )
10097
10198 updated_text = chunk
102- if self ._live_text_data == updated_text :
103- # Skip if no change
104- return
105- self ._live_text_data = updated_text
10699
107100 # Only show the last part that fits in the console
108101 lines = updated_text .split ("\n " )
0 commit comments