pub struct ToolPluginExecutor { /* private fields */ }Expand description
Adapter that exposes a ToolPlugin as an LLM ToolExecutor.
This lets LLM agents discover tools directly from a ToolPlugin without manually constructing tool definitions.
Implementations§
Source§impl ToolPluginExecutor
impl ToolPluginExecutor
Sourcepub fn new(tool_plugin: ToolPlugin) -> Self
pub fn new(tool_plugin: ToolPlugin) -> Self
Create a new adapter from an owned ToolPlugin.
Create a new adapter from a shared ToolPlugin handle.
Sourcepub fn tool_plugin(&self) -> Arc<RwLock<ToolPlugin>>
pub fn tool_plugin(&self) -> Arc<RwLock<ToolPlugin>>
Get the underlying ToolPlugin handle.
Sourcepub async fn invalidate_cache(&self)
pub async fn invalidate_cache(&self)
Clear the cached tool list so it will be refreshed on next access.
Sourcepub async fn refresh_tools(&self) -> LLMResult<Vec<Tool>>
pub async fn refresh_tools(&self) -> LLMResult<Vec<Tool>>
Refresh and return the latest tool list from the plugin.
Trait Implementations§
Source§impl ToolExecutor for ToolPluginExecutor
impl ToolExecutor for ToolPluginExecutor
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
arguments: &'life2 str,
) -> Pin<Box<dyn Future<Output = LLMResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
arguments: &'life2 str,
) -> Pin<Box<dyn Future<Output = LLMResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a tool call by name with JSON arguments.
Auto Trait Implementations§
impl Freeze for ToolPluginExecutor
impl !RefUnwindSafe for ToolPluginExecutor
impl Send for ToolPluginExecutor
impl Sync for ToolPluginExecutor
impl Unpin for ToolPluginExecutor
impl UnsafeUnpin for ToolPluginExecutor
impl !UnwindSafe for ToolPluginExecutor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage