pub struct WriteFileTool { /* private fields */ }Expand description
Tool that writes files to the filesystem with permission checks.
Implementations§
Source§impl WriteFileTool
impl WriteFileTool
Sourcepub fn new(permission_registry: Arc<PermissionRegistry>) -> Self
pub fn new(permission_registry: Arc<PermissionRegistry>) -> Self
Create a new WriteFileTool with the given permission registry.
§Arguments
permission_registry- The registry used to request and cache permissions.
Trait Implementations§
Source§impl Executable for WriteFileTool
impl Executable for WriteFileTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Get the tool description.
Source§fn input_schema(&self) -> &str
fn input_schema(&self) -> &str
Get the input schema as JSON string.
Source§fn execute(
&self,
context: ToolContext,
input: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send>>
fn execute( &self, context: ToolContext, input: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send>>
Execute the tool with given input.
Source§fn display_config(&self) -> DisplayConfig
fn display_config(&self) -> DisplayConfig
Get display configuration for UI rendering.
Source§fn compact_summary(
&self,
input: &HashMap<String, Value>,
_result: &str,
) -> String
fn compact_summary( &self, input: &HashMap<String, Value>, _result: &str, ) -> String
Generate compact summary for context compaction.
Source§fn required_permissions(
&self,
context: &ToolContext,
input: &HashMap<String, Value>,
) -> Option<Vec<PermissionRequest>>
fn required_permissions( &self, context: &ToolContext, input: &HashMap<String, Value>, ) -> Option<Vec<PermissionRequest>>
Return the permissions required to execute this tool with the given input. Read more
Source§fn to_definition(&self) -> ToolDefinition
fn to_definition(&self) -> ToolDefinition
Convert to LLM tool definition.
Source§fn to_llm_tool(&self) -> LLMTool
fn to_llm_tool(&self) -> LLMTool
Convert to LLMTool for provider APIs.
Source§fn handles_own_permissions(&self) -> bool
fn handles_own_permissions(&self) -> bool
Whether this tool handles its own permission flow internally. Read more
Auto Trait Implementations§
impl Freeze for WriteFileTool
impl !RefUnwindSafe for WriteFileTool
impl Send for WriteFileTool
impl Sync for WriteFileTool
impl Unpin for WriteFileTool
impl !UnwindSafe for WriteFileTool
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