pub struct CallbackManagerForToolRun { /* private fields */ }Expand description
Callback manager for tool run.
Implementations§
Source§impl CallbackManagerForToolRun
impl CallbackManagerForToolRun
Sourcepub fn new(
run_id: Uuid,
handlers: Vec<Arc<dyn BaseCallbackHandler>>,
inheritable_handlers: Vec<Arc<dyn BaseCallbackHandler>>,
parent_run_id: Option<Uuid>,
tags: Option<Vec<String>>,
inheritable_tags: Option<Vec<String>>,
metadata: Option<HashMap<String, Value>>,
inheritable_metadata: Option<HashMap<String, Value>>,
) -> Self
pub fn new( run_id: Uuid, handlers: Vec<Arc<dyn BaseCallbackHandler>>, inheritable_handlers: Vec<Arc<dyn BaseCallbackHandler>>, parent_run_id: Option<Uuid>, tags: Option<Vec<String>>, inheritable_tags: Option<Vec<String>>, metadata: Option<HashMap<String, Value>>, inheritable_metadata: Option<HashMap<String, Value>>, ) -> Self
Create a new callback manager for tool run.
Sourcepub fn parent_run_id(&self) -> Option<Uuid>
pub fn parent_run_id(&self) -> Option<Uuid>
Get the parent run ID.
Sourcepub fn handlers(&self) -> &[Arc<dyn BaseCallbackHandler>]
pub fn handlers(&self) -> &[Arc<dyn BaseCallbackHandler>]
Get the handlers.
Get the tags.
Sourcepub fn get_child(&self, tag: Option<&str>) -> CallbackManager
pub fn get_child(&self, tag: Option<&str>) -> CallbackManager
Get a child callback manager.
Sourcepub fn on_tool_end(&self, output: &str)
pub fn on_tool_end(&self, output: &str)
Run when tool ends running.
Sourcepub fn on_tool_error(&self, error: &dyn Error)
pub fn on_tool_error(&self, error: &dyn Error)
Run when tool errors.
Sourcepub fn get_noop_manager() -> Self
pub fn get_noop_manager() -> Self
Return a noop manager.
Trait Implementations§
Source§impl Clone for CallbackManagerForToolRun
impl Clone for CallbackManagerForToolRun
Source§fn clone(&self) -> CallbackManagerForToolRun
fn clone(&self) -> CallbackManagerForToolRun
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 moreAuto Trait Implementations§
impl Freeze for CallbackManagerForToolRun
impl !RefUnwindSafe for CallbackManagerForToolRun
impl Send for CallbackManagerForToolRun
impl Sync for CallbackManagerForToolRun
impl Unpin for CallbackManagerForToolRun
impl !UnwindSafe for CallbackManagerForToolRun
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