pub enum StopDecision {
Accept,
Continue {
message: String,
},
Halt {
reason: String,
},
AcceptUnmet {
unmet: Vec<String>,
},
}Expand description
What an on_stop hook decides when the model replies without tool calls.
Stopping and succeeding are separate decisions. A hook can let the run
stop (more turns would not help: the work is blocked, deferred or its
budget for asking is spent) while recording that the objective was not
met. Such a run ends crate::RunStatus::Completed with
crate::RunState::unmet filled, and
crate::RunOutcome::is_succeeded is false.
Variants§
Accept
Stop, and this hook has nothing against calling the run a success.
Continue
Do not finish yet; append this message and run another turn.
Halt
Stop now, whatever any other hook asked for, and record reason as
unmet: for a hook that knows more turns must not happen.
AcceptUnmet
Stop, but the objective is not met. Each line names one unmet
requirement in words a person can read. The run ends Completed
(the model may not keep going) and never counts as succeeded.
Implementations§
Source§impl StopDecision
impl StopDecision
Sourcepub fn permits_stop(&self) -> bool
pub fn permits_stop(&self) -> bool
Whether the run may stop (anything but StopDecision::Continue).