pub struct CallbackManager { /* private fields */ }Expand description
Callback manager that handles multiple handlers
Implementations§
Source§impl CallbackManager
impl CallbackManager
Sourcepub fn add_handler(self, handler: Arc<dyn CallbackHandler>) -> Self
pub fn add_handler(self, handler: Arc<dyn CallbackHandler>) -> Self
Add a callback handler
Sourcepub fn handlers(&self) -> &[Arc<dyn CallbackHandler>]
pub fn handlers(&self) -> &[Arc<dyn CallbackHandler>]
Get all handlers
Source§impl CallbackManager
impl CallbackManager
Sourcepub async fn dispatch_chain_start(&self, run: &RunTree, inputs: &Value)
pub async fn dispatch_chain_start(&self, run: &RunTree, inputs: &Value)
Dispatch on_chain_start to all handlers.
Sourcepub async fn dispatch_chain_end(&self, run: &RunTree, outputs: &Value)
pub async fn dispatch_chain_end(&self, run: &RunTree, outputs: &Value)
Dispatch on_chain_end to all handlers.
Sourcepub async fn dispatch_chain_error(&self, run: &RunTree, error: &str)
pub async fn dispatch_chain_error(&self, run: &RunTree, error: &str)
Dispatch on_chain_error to all handlers.
Sourcepub async fn dispatch_llm_start(&self, run: &RunTree, messages: &[Message])
pub async fn dispatch_llm_start(&self, run: &RunTree, messages: &[Message])
Dispatch on_llm_start to all handlers.
Sourcepub async fn dispatch_llm_end(&self, run: &RunTree, response: &str)
pub async fn dispatch_llm_end(&self, run: &RunTree, response: &str)
Dispatch on_llm_end to all handlers.
Sourcepub async fn dispatch_llm_error(&self, run: &RunTree, error: &str)
pub async fn dispatch_llm_error(&self, run: &RunTree, error: &str)
Dispatch on_llm_error to all handlers.
Sourcepub async fn dispatch_llm_new_token(&self, run: &RunTree, token: &str)
pub async fn dispatch_llm_new_token(&self, run: &RunTree, token: &str)
Dispatch on_llm_new_token to all handlers.
Sourcepub async fn dispatch_tool_start(
&self,
run: &RunTree,
tool_name: &str,
input: &str,
)
pub async fn dispatch_tool_start( &self, run: &RunTree, tool_name: &str, input: &str, )
Dispatch on_tool_start to all handlers.
Sourcepub async fn dispatch_tool_end(&self, run: &RunTree, output: &str)
pub async fn dispatch_tool_end(&self, run: &RunTree, output: &str)
Dispatch on_tool_end to all handlers.
Sourcepub async fn dispatch_tool_error(&self, run: &RunTree, error: &str)
pub async fn dispatch_tool_error(&self, run: &RunTree, error: &str)
Dispatch on_tool_error to all handlers.
Sourcepub async fn dispatch_retriever_start(&self, run: &RunTree, query: &str)
pub async fn dispatch_retriever_start(&self, run: &RunTree, query: &str)
Dispatch on_retriever_start to all handlers.
Sourcepub async fn dispatch_retriever_end(&self, run: &RunTree, documents: &[Value])
pub async fn dispatch_retriever_end(&self, run: &RunTree, documents: &[Value])
Dispatch on_retriever_end to all handlers.
Sourcepub async fn dispatch_retriever_error(&self, run: &RunTree, error: &str)
pub async fn dispatch_retriever_error(&self, run: &RunTree, error: &str)
Dispatch on_retriever_error to all handlers.
Trait Implementations§
Source§impl Clone for CallbackManager
impl Clone for CallbackManager
Source§impl Debug for CallbackManager
impl Debug for CallbackManager
Auto Trait Implementations§
impl !RefUnwindSafe for CallbackManager
impl !UnwindSafe for CallbackManager
impl Freeze for CallbackManager
impl Send for CallbackManager
impl Sync for CallbackManager
impl Unpin for CallbackManager
impl UnsafeUnpin 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