pub struct HeuristicGate {
pub min_output_tokens: u32,
pub refusal_patterns: Vec<String>,
pub accept_tool_calls: bool,
pub escalate_on_max_tokens: bool,
}Expand description
Zero-cost heuristic gate (no extra LLM calls).
Fields§
§min_output_tokens: u32Minimum output tokens for acceptance (default: 5).
refusal_patterns: Vec<String>Refusal phrases that trigger escalation.
accept_tool_calls: boolAccept responses that include tool calls (default: true).
escalate_on_max_tokens: boolEscalate on MaxTokens stop reason (default: true).
Trait Implementations§
Source§impl ConfidenceGate for HeuristicGate
impl ConfidenceGate for HeuristicGate
Source§fn accept(
&self,
_request: &CompletionRequest,
response: &CompletionResponse,
) -> bool
fn accept( &self, _request: &CompletionRequest, response: &CompletionResponse, ) -> bool
Return
true if the response is good enough to accept without escalating to a higher tier.Auto Trait Implementations§
impl Freeze for HeuristicGate
impl RefUnwindSafe for HeuristicGate
impl Send for HeuristicGate
impl Sync for HeuristicGate
impl Unpin for HeuristicGate
impl UnsafeUnpin for HeuristicGate
impl UnwindSafe for HeuristicGate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more