Type Alias Tool Conditional Fn
Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
pub type ToolConditionalFn = Arc<dyn Fn(String, Json) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send>> + Send + Sync>;
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.
This alias is Arc-backed so the runtime can clone conditional guardrails into an evaluation snapshot and invoke them after registry locks are released.
Parameters
- First argument: Tool name being evaluated.
- Second argument: Current tool argument payload.
Returns
A Result containing Ok(None) when execution is allowed or Ok(Some(reason)) when the guardrail rejects the call.
Errors
The callback can return any FlowError to abort guardrail evaluation.