Skip to main content

StopGateHook

Type Alias StopGateHook 

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

A stop-gate hook: receives the would-be-final assistant message; returns Some(reason) to veto termination and continue the loop (the reason is injected as a new user message), or None to allow the stop. See Config::stop_gate.

Aliased Typeยง

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