99import queue
1010from threading import Thread , Event
1111from typing import Dict , Any , List
12- from rich .console import Console
12+ from rich .console import Console , Group
1313from rich .markdown import Markdown
1414from rich .text import Text
15+ from rich .panel import Panel
1516from rich .live import Live
1617from rich .style import Style
1718from prompt_toolkit import PromptSession
@@ -605,8 +606,9 @@ def display_message(self, message: Text):
605606
606607 def display_divider (self ):
607608 """Display a divider line."""
608- divider = "─" * self .console .size .width
609- self .console .print (divider , style = RICH_STYLE_GRAY )
609+ pass
610+ # divider = "─" * self.console.size.width
611+ # self.console.print(divider, style=RICH_STYLE_GRAY)
610612
611613 def copy_to_clipboard (self , text : str ):
612614 """Copy text to clipboard and show confirmation."""
@@ -869,11 +871,9 @@ def _input_thread_worker(self):
869871 self ._current_prompt_session = session
870872
871873 # Create a dynamic prompt that includes agent and model info using HTML formatting
872- prompt_text = HTML (
873- f"[<ansired>{ self .message_handler .agent .name } </ansired>:<ansiblue>{ self .message_handler .agent .get_model ()} </ansiblue>] > "
874- )
874+ prompt_text = HTML ("<ansiblue>👤 YOU:</ansiblue> " )
875875
876- user_input = session .prompt (prompt_text , multiline = True )
876+ user_input = session .prompt (prompt_text )
877877
878878 # Reset history position after submission
879879 self .message_handler .history_manager .reset_position ()
@@ -965,9 +965,14 @@ def get_user_input(self):
965965 Returns:
966966 The user input as a string.
967967 """
968- title = Text ("👤 YOU:" , style = RICH_STYLE_BLUE_BOLD )
968+ title = Text (f"\n [{ self .message_handler .agent .name } " , style = RICH_STYLE_RED )
969+ title .append (":" )
970+ title .append (
971+ f"{ self .message_handler .agent .get_model ()} ]" ,
972+ style = RICH_STYLE_BLUE ,
973+ )
969974 title .append (
970- "\n (Press Enter for new line, Ctrl+S/Alt+Enter to submit, Up/Down for history)" ,
975+ "\n (Press Enter for new line, Ctrl+S/Alt+Enter to submit, Up/Down for history)\n " ,
971976 style = RICH_STYLE_YELLOW ,
972977 )
973978 self .console .print (title )
@@ -1044,13 +1049,8 @@ def start_streaming_response(self, agent_name: str):
10441049 self .live .start ()
10451050
10461051 def _print_prompt_prefix (self ):
1047- agent_info = Text (f"[{ self .message_handler .agent .name } " , style = RICH_STYLE_RED )
1048- agent_info .append (":" )
1049- agent_info .append (
1050- f"{ self .message_handler .agent .get_model ()} ] > " ,
1051- style = RICH_STYLE_BLUE ,
1052- )
1053- self .console .print (agent_info , end = "" )
1052+ prompt = Text ("👤 YOU: " , style = RICH_STYLE_BLUE_BOLD )
1053+ self .console .print (prompt , end = "" )
10541054
10551055 def _setup_key_bindings (self ):
10561056 """Set up key bindings for multiline input."""
@@ -1149,9 +1149,9 @@ def print_welcome_message(self):
11491149 # Get version information
11501150 version = getattr (AgentCrew , "__version__" , "Unknown" )
11511151
1152- welcome_messages = [
1152+ welcome_messages = Group (
11531153 Text (
1154- "\n 🎮 Welcome to AgentCrew v" + version + " interactive chat!" ,
1154+ "🎮 Welcome to AgentCrew v" + version + " interactive chat!" ,
11551155 style = RICH_STYLE_YELLOW_BOLD ,
11561156 ),
11571157 Text ("Press Ctrl+C twice to exit." , style = RICH_STYLE_YELLOW ),
@@ -1202,10 +1202,9 @@ def print_welcome_message(self):
12021202 "Use 'y' to approve once, 'n' to deny, 'all' to approve future calls to the same tool." ,
12031203 style = RICH_STYLE_YELLOW ,
12041204 ),
1205- ]
1205+ )
12061206
1207- for message in welcome_messages :
1208- self .console .print (message )
1207+ self .console .print (Panel (welcome_messages ))
12091208 self .display_divider ()
12101209
12111210 def display_token_usage (
@@ -1227,7 +1226,7 @@ def display_token_usage(
12271226 f"Total: { input_tokens + output_tokens :,} | Cost: ${ total_cost :.4f} | Total: { session_cost :.4f} " ,
12281227 style = RICH_STYLE_YELLOW ,
12291228 )
1230- self .console .print (token_info )
1229+ self .console .print (Panel ( token_info ) )
12311230 self .display_divider ()
12321231
12331232 def _calculate_token_usage (self , input_tokens : int , output_tokens : int ):
0 commit comments