pub struct ToolUsePlugin { /* private fields */ }Expand description
Tool use plugin
Implementations§
Source§impl ToolUsePlugin
impl ToolUsePlugin
Sourcepub fn new(registry: Arc<ToolRegistry>) -> Self
pub fn new(registry: Arc<ToolRegistry>) -> Self
Create a new tool use plugin
Sourcepub fn with_config(
registry: Arc<ToolRegistry>,
config: ToolUsePluginConfig,
) -> Self
pub fn with_config( registry: Arc<ToolRegistry>, config: ToolUsePluginConfig, ) -> Self
Create with custom configuration
Trait Implementations§
Source§impl Debug for ToolUsePlugin
impl Debug for ToolUsePlugin
Source§impl Plugin for ToolUsePlugin
impl Plugin for ToolUsePlugin
Source§fn enforce(&self) -> PluginPhase
fn enforce(&self) -> PluginPhase
Plugin execution phase
Source§fn transform_params<'life0, 'life1, 'async_trait>(
&'life0 self,
params: TextParams,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<TextParams, AiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transform_params<'life0, 'life1, 'async_trait>(
&'life0 self,
params: TextParams,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<TextParams, AiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transform request parameters Read more
Source§fn transform_result<'life0, 'life1, 'async_trait>(
&'life0 self,
result: TextResult,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<TextResult, AiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transform_result<'life0, 'life1, 'async_trait>(
&'life0 self,
result: TextResult,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<TextResult, AiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transform result Read more
Source§fn resolve_model<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_model_id: &'life1 str,
_ctx: &'life2 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn resolve_model<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_model_id: &'life1 str,
_ctx: &'life2 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Resolve model ID Read more
Source§fn load_template<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_template_name: &'life1 str,
_ctx: &'life2 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Message>>, AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn load_template<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_template_name: &'life1 str,
_ctx: &'life2 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Message>>, AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Load template Read more
Source§fn on_request_start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<(), AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_request_start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<(), AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Hook called when a request starts
Source§fn on_request_end<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
_result: &'life2 TextResult,
) -> Pin<Box<dyn Future<Output = Result<(), AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_request_end<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
_result: &'life2 TextResult,
) -> Pin<Box<dyn Future<Output = Result<(), AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Hook called when a request ends successfully
Source§fn on_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_error: &'life1 AiError,
_ctx: &'life2 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<(), AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_error: &'life1 AiError,
_ctx: &'life2 RequestContext,
) -> Pin<Box<dyn Future<Output = Result<(), AiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Hook called when an error occurs
Auto Trait Implementations§
impl Freeze for ToolUsePlugin
impl !RefUnwindSafe for ToolUsePlugin
impl Send for ToolUsePlugin
impl Sync for ToolUsePlugin
impl Unpin for ToolUsePlugin
impl !UnwindSafe for ToolUsePlugin
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