pub struct Modifier {
pub modifier_type: ModifierType,
pub tools: Vec<String>,
pub toolkits: Vec<String>,
/* private fields */
}Expand description
A modifier that can be applied to tools
Fields§
§modifier_type: ModifierTypeType of modifier
tools: Vec<String>List of tool slugs this modifier applies to (empty = all tools)
toolkits: Vec<String>List of toolkit slugs this modifier applies to (empty = all toolkits)
Implementations§
Source§impl Modifier
impl Modifier
Sourcepub fn before_execute<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: BeforeExecute + 'static,
pub fn before_execute<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: BeforeExecute + 'static,
Create a new before_execute modifier
Sourcepub fn after_execute<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: AfterExecute + 'static,
pub fn after_execute<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: AfterExecute + 'static,
Create a new after_execute modifier
Sourcepub fn schema<F>(tools: Vec<String>, toolkits: Vec<String>, modifier: F) -> Selfwhere
F: SchemaModifier + 'static,
pub fn schema<F>(tools: Vec<String>, toolkits: Vec<String>, modifier: F) -> Selfwhere
F: SchemaModifier + 'static,
Create a new schema modifier
Sourcepub fn before_execute_meta<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: BeforeExecuteMeta + 'static,
pub fn before_execute_meta<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: BeforeExecuteMeta + 'static,
Create a new before_execute_meta modifier
Sourcepub fn after_execute_meta<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: AfterExecuteMeta + 'static,
pub fn after_execute_meta<F>(
tools: Vec<String>,
toolkits: Vec<String>,
modifier: F,
) -> Selfwhere
F: AfterExecuteMeta + 'static,
Create a new after_execute_meta modifier
Sourcepub fn apply_to_params(
&self,
tool: &str,
toolkit: &str,
params: ToolExecuteParams,
) -> Result<ToolExecuteParams, String>
pub fn apply_to_params( &self, tool: &str, toolkit: &str, params: ToolExecuteParams, ) -> Result<ToolExecuteParams, String>
Apply the modifier to tool execution parameters
Sourcepub fn apply_to_response(
&self,
tool: &str,
toolkit: &str,
response: ToolExecutionResponse,
) -> Result<ToolExecutionResponse, String>
pub fn apply_to_response( &self, tool: &str, toolkit: &str, response: ToolExecutionResponse, ) -> Result<ToolExecutionResponse, String>
Apply the modifier to tool execution response
Sourcepub fn apply_to_schema(
&self,
tool: &str,
toolkit: &str,
schema: ToolSchema,
) -> Result<ToolSchema, String>
pub fn apply_to_schema( &self, tool: &str, toolkit: &str, schema: ToolSchema, ) -> Result<ToolSchema, String>
Apply the modifier to tool schema
Sourcepub fn apply_to_meta_params(
&self,
tool: &str,
toolkit: &str,
session_id: &str,
params: HashMap<String, Value>,
) -> Result<HashMap<String, Value>, String>
pub fn apply_to_meta_params( &self, tool: &str, toolkit: &str, session_id: &str, params: HashMap<String, Value>, ) -> Result<HashMap<String, Value>, String>
Apply the modifier to meta tool parameters
Sourcepub fn apply_to_meta_response(
&self,
tool: &str,
toolkit: &str,
session_id: &str,
response: ToolExecutionResponse,
) -> Result<ToolExecutionResponse, String>
pub fn apply_to_meta_response( &self, tool: &str, toolkit: &str, session_id: &str, response: ToolExecutionResponse, ) -> Result<ToolExecutionResponse, String>
Apply the modifier to meta tool response
Auto Trait Implementations§
impl Freeze for Modifier
impl !RefUnwindSafe for Modifier
impl Send for Modifier
impl Sync for Modifier
impl Unpin for Modifier
impl UnsafeUnpin for Modifier
impl !UnwindSafe for Modifier
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