pub struct ConsoleCallbackHandler {
pub verbose: bool,
pub color: Option<String>,
}
Expand description
A console callback handler that prints run information to stdout
Fields§
§verbose: bool
Whether to print detailed information
color: Option<String>
The color to use for text output (matching LangChain’s color scheme)
Implementations§
Source§impl ConsoleCallbackHandler
impl ConsoleCallbackHandler
Sourcepub fn new_with_verbose(verbose: bool) -> Self
pub fn new_with_verbose(verbose: bool) -> Self
Create a new console callback handler with verbosity setting
Sourcepub fn new_with_color(color: impl Into<String>) -> Self
pub fn new_with_color(color: impl Into<String>) -> Self
Create a new console callback handler with color
Sourcepub fn new_with_verbose_and_color(
verbose: bool,
color: impl Into<String>,
) -> Self
pub fn new_with_verbose_and_color( verbose: bool, color: impl Into<String>, ) -> Self
Create a new console callback handler with verbosity and color
Trait Implementations§
Source§impl CallbackHandler for ConsoleCallbackHandler
impl CallbackHandler for ConsoleCallbackHandler
Source§fn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when a run starts
Source§fn on_run_success<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_success<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when a run completes successfully
Source§fn on_run_error<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_error<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when a run fails
Source§fn on_run_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_run_info: &'life1 RunInfo,
chunk: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_run_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_run_info: &'life1 RunInfo,
chunk: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called when a run produces streaming output
Auto Trait Implementations§
impl Freeze for ConsoleCallbackHandler
impl RefUnwindSafe for ConsoleCallbackHandler
impl Send for ConsoleCallbackHandler
impl Sync for ConsoleCallbackHandler
impl Unpin for ConsoleCallbackHandler
impl UnwindSafe for ConsoleCallbackHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more