pub struct CallbackManager { /* private fields */ }Implementations§
Source§impl CallbackManager
impl CallbackManager
pub fn new(handlers: Vec<Arc<dyn CallbackHandler>>) -> Self
pub fn noop() -> Self
pub fn is_noop(&self) -> bool
pub fn add_handler(&mut self, handler: Arc<dyn CallbackHandler>)
pub async fn on_start(&self, ctx: &RunContext, inputs: &Value)
pub async fn on_end(&self, ctx: &RunContext, outputs: &Value, duration_ms: u128)
pub async fn on_error(&self, ctx: &RunContext, error: &Value, duration_ms: u128)
pub async fn on_stream_chunk(&self, ctx: &RunContext, chunk: &Value)
pub async fn on_llm_start(&self, ctx: &RunContext, input: &LlmInput)
pub async fn on_llm_end( &self, ctx: &RunContext, result: &LlmResult, duration_ms: u128, )
pub async fn on_event(&self, ctx: &RunContext, event: &str, data: &Value)
Trait Implementations§
Source§impl Clone for CallbackManager
impl Clone for CallbackManager
Source§fn clone(&self) -> CallbackManager
fn clone(&self) -> CallbackManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CallbackManager
impl Debug for CallbackManager
Source§impl Default for CallbackManager
impl Default for CallbackManager
Source§fn default() -> CallbackManager
fn default() -> CallbackManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CallbackManager
impl !RefUnwindSafe for CallbackManager
impl Send for CallbackManager
impl Sync for CallbackManager
impl Unpin for CallbackManager
impl UnsafeUnpin for CallbackManager
impl !UnwindSafe for CallbackManager
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