Type Alias LlmConditional Fn
Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.
pub type LlmConditionalFn = Arc<dyn Fn(&LlmRequest) -> Result<Option<String>> + Send + Sync>;
Decide whether an LLM call is allowed to continue.
The callback receives the current LlmRequest and can allow execution, reject it with a guardrail reason, or return an error.
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: Current
LlmRequestbeing evaluated.
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.