pub struct EditTool { /* private fields */ }Expand description
Agent tool that applies unique non-overlapping text replacements.
Implementations§
Source§impl EditTool
impl EditTool
Sourcepub fn with_options(options: EditToolOptions) -> Self
pub fn with_options(options: EditToolOptions) -> Self
Creates an edit tool from explicit options.
Sourcepub fn parameters_schema() -> Value
pub fn parameters_schema() -> Value
Returns the JSON Schema for edit arguments (normalized TypeBox shape).
Sourcepub fn prepare_edit_arguments(raw: &Map<String, Value>) -> Map<String, Value>
pub fn prepare_edit_arguments(raw: &Map<String, Value>) -> Map<String, Value>
Compatibility shim for legacy top-level oldText/newText and stringified edits.
Sourcepub fn parse_input(
args: &Map<String, Value>,
) -> Result<EditToolInput, ToolError>
pub fn parse_input( args: &Map<String, Value>, ) -> Result<EditToolInput, ToolError>
Sourcepub fn success_text(path: &str, edit_count: usize) -> String
pub fn success_text(path: &str, edit_count: usize) -> String
Formats the success text using the caller’s path string.
Trait Implementations§
Source§impl AgentTool for EditTool
impl AgentTool for EditTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable tool description.
Source§fn parameters(&self) -> &Value
fn parameters(&self) -> &Value
JSON Schema for tool arguments.
Source§fn prepare_arguments(
&self,
raw: &Map<String, Value>,
) -> Result<Map<String, Value>, ToolError>
fn prepare_arguments( &self, raw: &Map<String, Value>, ) -> Result<Map<String, Value>, ToolError>
Optional compatibility shim for raw tool-call arguments before validation. Read more
Source§fn validate_arguments(
&self,
args: &Map<String, Value>,
) -> Result<Map<String, Value>, ToolError>
fn validate_arguments( &self, args: &Map<String, Value>, ) -> Result<Map<String, Value>, ToolError>
Validates prepared arguments for this tool. Read more
Source§fn execute(
&self,
_tool_call_id: &str,
args: Map<String, Value>,
cancel: CancellationToken,
_updates: ToolUpdates,
) -> BoxFuture<'static, Result<AgentToolResult, ToolError>>
fn execute( &self, _tool_call_id: &str, args: Map<String, Value>, cancel: CancellationToken, _updates: ToolUpdates, ) -> BoxFuture<'static, Result<AgentToolResult, ToolError>>
Executes the tool call. Read more
Source§fn execution_mode(&self) -> Option<ToolExecutionMode>
fn execution_mode(&self) -> Option<ToolExecutionMode>
Optional per-tool execution mode override. Read more
Auto Trait Implementations§
impl Freeze for EditTool
impl RefUnwindSafe for EditTool
impl Send for EditTool
impl Sync for EditTool
impl Unpin for EditTool
impl UnsafeUnpin for EditTool
impl UnwindSafe for EditTool
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.