pub struct StaticToolProvider<E: StaticToolExecute> { /* private fields */ }Expand description
A ToolProvider that serves a fixed set of ToolDefinitions from a
cache, delegating execution to an StaticToolExecute.
Implementations§
Source§impl<E: StaticToolExecute> StaticToolProvider<E>
impl<E: StaticToolExecute> StaticToolProvider<E>
Sourcepub fn new(definitions: Vec<ToolDefinition>, executor: E) -> Self
pub fn new(definitions: Vec<ToolDefinition>, executor: E) -> Self
Build a provider from a fixed set of definitions and an executor.
Manifests and contracts are derived once, here, and reused for the life of the provider.
Trait Implementations§
Source§impl<E: StaticToolExecute> ToolProvider for StaticToolProvider<E>
impl<E: StaticToolExecute> ToolProvider for StaticToolProvider<E>
fn tool_manifests(&self) -> Vec<ToolManifest>
fn resolve_manifest(&self, name: &str) -> Option<ToolManifest>
fn resolve_contract(&self, name: &str) -> Option<Arc<ToolContract>>
fn prepare_tool_call<'life0, 'life1, 'async_trait>(
&'life0 self,
call: ToolPrepareCall<'life1>,
) -> Pin<Box<dyn Future<Output = Result<PreparedToolCall, ToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
call: ToolCall<'life1>,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl<E> Freeze for StaticToolProvider<E>where
E: Freeze,
impl<E> RefUnwindSafe for StaticToolProvider<E>where
E: RefUnwindSafe,
impl<E> Send for StaticToolProvider<E>
impl<E> Sync for StaticToolProvider<E>
impl<E> Unpin for StaticToolProvider<E>where
E: Unpin,
impl<E> UnsafeUnpin for StaticToolProvider<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for StaticToolProvider<E>where
E: UnwindSafe,
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