pub struct EditTool { /* private fields */ }Expand description
The built-in edit tool.
Trait Implementations§
Source§impl AgentTool for EditTool
impl AgentTool for EditTool
Source§fn prepare_arguments(&self, args: Value) -> Result<Value, AgentError>
fn prepare_arguments(&self, args: Value) -> Result<Value, AgentError>
Fold legacy oldText/newText and parse a JSON-string edits. Mirrors
prepareEditArguments.
Source§fn schema(&self) -> &Tool
fn schema(&self) -> &Tool
The provider-facing tool definition (name, description, parameters schema).
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
_tool_call_id: &'life1 str,
params: Value,
signal: CancellationToken,
_on_update: Arc<dyn Fn(ToolResultPartial) + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<AgentToolResult, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
_tool_call_id: &'life1 str,
params: Value,
signal: CancellationToken,
_on_update: Arc<dyn Fn(ToolResultPartial) + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<AgentToolResult, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool call. Throw via
Err(AgentError) on failure — the loop
encodes the error message into an error ToolResultMessage. Read moreSource§fn execution_mode(&self) -> ToolExecutionMode
fn execution_mode(&self) -> ToolExecutionMode
Per-tool execution-mode override.
Sequential forces one-at-a-time for
the whole batch when any tool in it returns Sequential; Parallel
(default) allows concurrency.Auto Trait Implementations§
impl !RefUnwindSafe for EditTool
impl !UnwindSafe for EditTool
impl Freeze for EditTool
impl Send for EditTool
impl Sync for EditTool
impl Unpin for EditTool
impl UnsafeUnpin 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> 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 more