pub struct ReadTool<const LINE_NUMBERS: bool = true>;Expand description
Tool for reading file contents with optional line numbers.
The LINE_NUMBERS const generic controls output format:
true(default): Lines prefixed withL{number}:false: Raw file content
Implementations§
Trait Implementations§
Source§impl<Deps: Send + Sync, const LINE_NUMBERS: bool> Tool<Deps> for ReadTool<LINE_NUMBERS>
impl<Deps: Send + Sync, const LINE_NUMBERS: bool> Tool<Deps> for ReadTool<LINE_NUMBERS>
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Get the tool’s definition. Read more
Source§fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with given arguments. Read more
Source§fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
def: ToolDefinition,
) -> Pin<Box<dyn Future<Output = Option<ToolDefinition>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
def: ToolDefinition,
) -> Pin<Box<dyn Future<Output = Option<ToolDefinition>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Prepare the tool definition at runtime. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Get the tool description.
Source§impl<const LINE_NUMBERS: bool> ToolContext for ReadTool<LINE_NUMBERS>
impl<const LINE_NUMBERS: bool> ToolContext for ReadTool<LINE_NUMBERS>
Auto Trait Implementations§
impl<const LINE_NUMBERS: bool> Freeze for ReadTool<LINE_NUMBERS>
impl<const LINE_NUMBERS: bool> RefUnwindSafe for ReadTool<LINE_NUMBERS>
impl<const LINE_NUMBERS: bool> Send for ReadTool<LINE_NUMBERS>
impl<const LINE_NUMBERS: bool> Sync for ReadTool<LINE_NUMBERS>
impl<const LINE_NUMBERS: bool> Unpin for ReadTool<LINE_NUMBERS>
impl<const LINE_NUMBERS: bool> UnwindSafe for ReadTool<LINE_NUMBERS>
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