Skip to main content

WriteTool

Struct WriteTool 

Source
pub struct WriteTool<B: FileBackend>(pub Arc<B>);

Tuple Fields§

§0: Arc<B>

Trait Implementations§

Source§

impl<B: FileBackend> Tool for WriteTool<B>

Source§

fn name(&self) -> &str

Unique tool name (used as discriminator in LLM function calling).
Source§

fn description(&self) -> &str

Human-readable description shown to the LLM.
Source§

fn parameters_schema(&self) -> Value

JSON Schema for the tool’s parameters (generated via json_schema_for::<Args>()).
Source§

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, args: Value, _ctx: &'life1 mut AgentContext, ) -> Pin<Box<dyn Future<Output = Result<ToolOutput, ToolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn is_system(&self) -> bool

System tools are always visible (not subject to progressive discovery).
Source§

fn is_read_only(&self) -> bool

Read-only tools can execute in parallel via execute_readonly.
Source§

fn execute_readonly<'life0, 'life1, 'async_trait>( &'life0 self, args: Value, ctx: &'life1 AgentContext, ) -> Pin<Box<dyn Future<Output = Result<ToolOutput, ToolError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Execute without mutable context (for parallel read-only dispatch). Default: delegates to execute with a cloned context. Override for true read-only tools to avoid the clone.
Source§

fn to_def(&self) -> ToolDef

Auto Trait Implementations§

§

impl<B> Freeze for WriteTool<B>

§

impl<B> RefUnwindSafe for WriteTool<B>
where B: RefUnwindSafe,

§

impl<B> Send for WriteTool<B>

§

impl<B> Sync for WriteTool<B>

§

impl<B> Unpin for WriteTool<B>

§

impl<B> UnsafeUnpin for WriteTool<B>

§

impl<B> UnwindSafe for WriteTool<B>
where B: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.