pub struct GrepTool { /* private fields */ }Expand description
Agent tool that searches file contents.
Implementations§
Source§impl GrepTool
impl GrepTool
Sourcepub fn with_options(options: GrepToolOptions) -> Self
pub fn with_options(options: GrepToolOptions) -> Self
Creates a grep tool from explicit options.
Sourcepub fn parameters_schema() -> Value
pub fn parameters_schema() -> Value
Returns the JSON Schema for grep arguments (normalized TypeBox shape).
Sourcepub fn parse_input(
args: &Map<String, Value>,
) -> Result<GrepToolInput, ToolError>
pub fn parse_input( args: &Map<String, Value>, ) -> Result<GrepToolInput, ToolError>
Validates raw tool arguments into GrepToolInput.
§Errors
Returns ToolError when required fields are missing or mistyped.
Trait Implementations§
Source§impl AgentTool for GrepTool
impl AgentTool for GrepTool
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 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 GrepTool
impl RefUnwindSafe for GrepTool
impl Send for GrepTool
impl Sync for GrepTool
impl Unpin for GrepTool
impl UnsafeUnpin for GrepTool
impl UnwindSafe for GrepTool
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.