pub struct ReadFileTool { /* private fields */ }Expand description
Built-in tool that reads a file and returns its contents.
Implementations§
Source§impl ReadFileTool
impl ReadFileTool
Trait Implementations§
Source§impl AgentTool for ReadFileTool
impl AgentTool for ReadFileTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Natural-language description included in the LLM prompt.
Source§fn parameters_schema(&self) -> &Value
fn parameters_schema(&self) -> &Value
JSON Schema describing the tool’s input shape, used for validation.
Source§fn execute(
&self,
_tool_call_id: &str,
params: Value,
cancellation_token: CancellationToken,
_on_update: Option<Box<dyn Fn(AgentToolResult) + Send + Sync>>,
_state: Arc<RwLock<SessionState>>,
_credential: Option<ResolvedCredential>,
) -> ToolFuture<'_>
fn execute( &self, _tool_call_id: &str, params: Value, cancellation_token: CancellationToken, _on_update: Option<Box<dyn Fn(AgentToolResult) + Send + Sync>>, _state: Arc<RwLock<SessionState>>, _credential: Option<ResolvedCredential>, ) -> ToolFuture<'_>
Execute the tool with validated parameters. Read more
Source§fn requires_approval(&self) -> bool
fn requires_approval(&self) -> bool
Whether this tool requires user approval before execution.
Default is
false — tools execute immediately.Source§fn metadata(&self) -> Option<ToolMetadata>
fn metadata(&self) -> Option<ToolMetadata>
Optional organizational metadata (namespace, version). Read more
Source§fn approval_context(&self, _params: &Value) -> Option<Value>
fn approval_context(&self, _params: &Value) -> Option<Value>
Optional rich context for the approval UI. Read more
Source§fn auth_config(&self) -> Option<AuthConfig>
fn auth_config(&self) -> Option<AuthConfig>
Optional authentication configuration for this tool. Read more
Auto Trait Implementations§
impl Freeze for ReadFileTool
impl RefUnwindSafe for ReadFileTool
impl Send for ReadFileTool
impl Sync for ReadFileTool
impl Unpin for ReadFileTool
impl UnsafeUnpin for ReadFileTool
impl UnwindSafe for ReadFileTool
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