nit: add docstring (#9099)

Add docstring on `ToolHandler` trait
This commit is contained in:
jif-oai
2026-01-12 17:40:52 +00:00
committed by GitHub
parent d5562983d9
commit 898e5f82f0

View File

@@ -30,10 +30,16 @@ pub trait ToolHandler: Send + Sync {
)
}
/// Returns `true` if the [ToolInvocation] *might* mutate the environment of the
/// user (through file system, OS operations, ...).
/// This function must remains defensive and return `true` if a doubt exist on the
/// exact effect of a ToolInvocation.
async fn is_mutating(&self, _invocation: &ToolInvocation) -> bool {
false
}
/// Perform the actual [ToolInvocation] and returns a [ToolOutput] containing
/// the final output to return to the model.
async fn handle(&self, invocation: ToolInvocation) -> Result<ToolOutput, FunctionCallError>;
}