pub struct BasicToolset { /* private fields */ }Available on crate feature
tools only.Expand description
A simple toolset that wraps a static list of tools with optional filtering.
Implementations§
Source§impl BasicToolset
impl BasicToolset
Sourcepub fn new(name: impl Into<String>, tools: Vec<Arc<dyn Tool>>) -> BasicToolset
pub fn new(name: impl Into<String>, tools: Vec<Arc<dyn Tool>>) -> BasicToolset
Create a new BasicToolset with the given name and tools.
Sourcepub fn with_predicate(
self,
predicate: Box<dyn Fn(&dyn Tool) -> bool + Send + Sync>,
) -> BasicToolset
pub fn with_predicate( self, predicate: Box<dyn Fn(&dyn Tool) -> bool + Send + Sync>, ) -> BasicToolset
Set a predicate to filter which tools are returned.
Trait Implementations§
Source§impl Toolset for BasicToolset
impl Toolset for BasicToolset
Source§fn tools<'life0, 'async_trait>(
&'life0 self,
_ctx: Arc<dyn ReadonlyContext>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn Tool>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BasicToolset: 'async_trait,
fn tools<'life0, 'async_trait>(
&'life0 self,
_ctx: Arc<dyn ReadonlyContext>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn Tool>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BasicToolset: 'async_trait,
Returns the tools available in this toolset for the given context.
Auto Trait Implementations§
impl Freeze for BasicToolset
impl !RefUnwindSafe for BasicToolset
impl Send for BasicToolset
impl Sync for BasicToolset
impl Unpin for BasicToolset
impl UnsafeUnpin for BasicToolset
impl !UnwindSafe for BasicToolset
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