pub enum ToolCallAction {
Run,
Rewrite(Value),
Skip(String),
Stop(String),
}Expand description
Action for pre-tool hooks.
Variants§
Run
Execute with the current arguments.
Rewrite(Value)
Execute with replacement arguments.
Skip(String)
Do not execute; return this feedback to the model.
Stop(String)
Stop the run.
Implementations§
Source§impl ToolCallAction
impl ToolCallAction
Sourcepub fn rewrite(args: impl Into<Value>) -> Self
pub fn rewrite(args: impl Into<Value>) -> Self
Creates an action that replaces the arguments passed to the tool.
Sourcepub fn try_rewrite<T: Serialize>(args: &T) -> Result<Self, Error>
pub fn try_rewrite<T: Serialize>(args: &T) -> Result<Self, Error>
Serializes replacement arguments and creates a rewrite action.
Returns an error when args cannot be represented as JSON.
Trait Implementations§
Source§impl Clone for ToolCallAction
impl Clone for ToolCallAction
Source§fn clone(&self) -> ToolCallAction
fn clone(&self) -> ToolCallAction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolCallAction
impl Debug for ToolCallAction
Source§impl PartialEq for ToolCallAction
impl PartialEq for ToolCallAction
impl StructuralPartialEq for ToolCallAction
Auto Trait Implementations§
impl Freeze for ToolCallAction
impl RefUnwindSafe for ToolCallAction
impl Send for ToolCallAction
impl Sync for ToolCallAction
impl Unpin for ToolCallAction
impl UnsafeUnpin for ToolCallAction
impl UnwindSafe for ToolCallAction
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