Skip to main content

ToolConditionalFn

Type Alias ToolConditionalFn 

Source
pub type ToolConditionalFn = Box<dyn Fn(&str, &Json) -> Result<Option<String>> + Send + Sync>;
Expand description

Decide whether a tool call is allowed to continue.

The callback receives the tool name and the current argument payload. It can return Ok(None) to allow execution, Ok(Some(reason)) to reject the call with a guardrail message, or an error to abort evaluation entirely.

Aliased Typeยง

pub struct ToolConditionalFn(/* private fields */);