pub struct FilteredToolset { /* private fields */ }Available on crate feature
tools only.Expand description
A toolset wrapper that filters tools from an inner toolset using a predicate.
Works with any Toolset implementation. Tools that do not satisfy the
predicate are excluded from the resolved tool list.
§Example
ⓘ
use adk_tool::toolset::{FilteredToolset, string_predicate};
let browser = BrowserToolset::new(session);
let filtered = FilteredToolset::new(
Arc::new(browser),
string_predicate(vec!["navigate".into(), "click".into()]),
);
// Only "navigate" and "click" tools will be exposedImplementations§
Trait Implementations§
Source§impl Toolset for FilteredToolset
impl Toolset for FilteredToolset
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,
FilteredToolset: '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,
FilteredToolset: 'async_trait,
Returns the tools available in this toolset for the given context.
Auto Trait Implementations§
impl Freeze for FilteredToolset
impl !RefUnwindSafe for FilteredToolset
impl Send for FilteredToolset
impl Sync for FilteredToolset
impl Unpin for FilteredToolset
impl UnsafeUnpin for FilteredToolset
impl !UnwindSafe for FilteredToolset
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