pub struct AgentUI { /* private fields */ }Expand description
Terminal UI handler for the agent
Implementations§
Source§impl AgentUI
impl AgentUI
pub fn new() -> Self
Sourcepub fn pause_spinner(&mut self)
pub fn pause_spinner(&mut self)
Pause the current spinner temporarily
Sourcepub fn print_welcome(&self, provider: &str, model: &str)
pub fn print_welcome(&self, provider: &str, model: &str)
Print the welcome banner
Sourcepub fn print_prompt(&self)
pub fn print_prompt(&self)
Print the prompt
Sourcepub fn start_thinking(&mut self)
pub fn start_thinking(&mut self)
Start a thinking spinner
Sourcepub fn show_tool_call(&mut self, tool_name: &str)
pub fn show_tool_call(&mut self, tool_name: &str)
Update spinner with tool call info
Sourcepub fn stop_thinking(&mut self)
pub fn stop_thinking(&mut self)
Stop the spinner
Sourcepub fn print_assistant_header(&self)
pub fn print_assistant_header(&self)
Print the assistant header for streaming response
Sourcepub fn start_streaming(&mut self)
pub fn start_streaming(&mut self)
Start a streaming indicator
Sourcepub fn update_streaming(&mut self, char_count: usize)
pub fn update_streaming(&mut self, char_count: usize)
Update streaming progress
Sourcepub fn finish_streaming_and_render(&mut self, response: &str)
pub fn finish_streaming_and_render(&mut self, response: &str)
Stop streaming and print the response
Sourcepub fn print_stream_chunk(&self, text: &str)
pub fn print_stream_chunk(&self, text: &str)
Print streaming text chunk (no newline) - real-time output
Sourcepub fn print_tool_call_notification(&self, tool_name: &str)
pub fn print_tool_call_notification(&self, tool_name: &str)
Print tool call notification during streaming
Sourcepub fn print_tool_call_complete(&self, tool_name: &str)
pub fn print_tool_call_complete(&self, tool_name: &str)
Print tool call completion
Sourcepub fn end_stream(&self)
pub fn end_stream(&self)
End the streaming response
Sourcepub fn print_response(&self, response: &str)
pub fn print_response(&self, response: &str)
Print the assistant’s response with markdown rendering
Sourcepub fn print_error(&self, message: &str)
pub fn print_error(&self, message: &str)
Print an error message
Sourcepub fn print_success(&self, message: &str)
pub fn print_success(&self, message: &str)
Print a success message
Sourcepub fn print_tool_result(&self, tool_name: &str, success: bool)
pub fn print_tool_result(&self, tool_name: &str, success: bool)
Print tool execution result summary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentUI
impl RefUnwindSafe for AgentUI
impl Send for AgentUI
impl Sync for AgentUI
impl Unpin for AgentUI
impl UnwindSafe for AgentUI
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more