Type Alias LlmConditional Fn
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -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 LlmConditionalFn = Arc<dyn Fn(LlmRequest) -> Pin<Box<dyn Future<Output = Result<Option<String>, FlowError>> + Send>> + Sync + Send>;
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.