pub struct ToolInvocableAdapter { /* private fields */ }Expand description
Wraps a Tool as an Invocable so it can be surfaced through the
agentkit capability layer.
Created automatically by ToolCapabilityProvider::from_registry; you
rarely need to construct one yourself.
Implementations§
Source§impl ToolInvocableAdapter
impl ToolInvocableAdapter
Sourcepub fn new(
tool: Arc<dyn Tool>,
permissions: Arc<dyn PermissionChecker>,
resources: Arc<dyn ToolResources>,
) -> Option<Self>
pub fn new( tool: Arc<dyn Tool>, permissions: Arc<dyn PermissionChecker>, resources: Arc<dyn ToolResources>, ) -> Option<Self>
Creates a new adapter that wraps tool with the given permission
checker and shared resources.
Trait Implementations§
Source§impl Invocable for ToolInvocableAdapter
impl Invocable for ToolInvocableAdapter
Source§fn spec(&self) -> &InvocableSpec
fn spec(&self) -> &InvocableSpec
Returns the specification that describes this capability to the model.
Source§fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: InvocableRequest,
ctx: &'life1 mut CapabilityContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<InvocableResult, CapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: InvocableRequest,
ctx: &'life1 mut CapabilityContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<InvocableResult, CapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Executes the capability with the given request and context. Read more
Auto Trait Implementations§
impl !Freeze for ToolInvocableAdapter
impl !RefUnwindSafe for ToolInvocableAdapter
impl Send for ToolInvocableAdapter
impl Sync for ToolInvocableAdapter
impl Unpin for ToolInvocableAdapter
impl UnsafeUnpin for ToolInvocableAdapter
impl !UnwindSafe for ToolInvocableAdapter
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