pub enum BeforeModelDecision {
Continue,
Modify(Request),
ShortCircuit(Assistant),
Abort(String),
}Expand description
ModelHooks::before_model decision.
Self::Modify is where a composition layer normalises history for the
provider it is about to call. Core applies visibility and the tool-exchange
grammar and stops there: it never rewrites a
Segment because a different provider
produced it, because deciding that one vendor’s thinking segment is unusable
by another requires knowing both vendors’ rules — a compat matrix core does
not and must not learn. A registration that changes model mid-session reads
BeforeModelScope::request, rewrites the segments its next provider cannot
accept, and re-freezes through
RequestPlan::try_into_request, which
is the only way to construct a Request and therefore cannot be bypassed.
Variants§
Continue
Continue with the current request.
Modify(Request)
Replace the request after runtime validation.
ShortCircuit(Assistant)
Supply assistant output without invoking the model.
Abort(String)
Deliberately abort model invocation.