pub struct AdmissionControl { /* private fields */ }Expand description
A-MAC admission controller.
Implementations§
Source§impl AdmissionControl
impl AdmissionControl
pub fn new( threshold: f32, fast_path_margin: f32, weights: AdmissionWeights, ) -> Self
Sourcepub fn with_provider(self, provider: AnyProvider) -> Self
pub fn with_provider(self, provider: AnyProvider) -> Self
Attach a dedicated LLM provider for future_utility evaluation.
When set, this provider is used instead of the caller-supplied fallback.
Sourcepub fn with_goal_gate(self, config: GoalGateConfig) -> Self
pub fn with_goal_gate(self, config: GoalGateConfig) -> Self
Enable goal-conditioned write gate (#2408).
Sourcepub async fn evaluate(
&self,
content: &str,
role: &str,
fallback_provider: &AnyProvider,
qdrant: Option<&Arc<EmbeddingStore>>,
goal_text: Option<&str>,
) -> AdmissionDecision
pub async fn evaluate( &self, content: &str, role: &str, fallback_provider: &AnyProvider, qdrant: Option<&Arc<EmbeddingStore>>, goal_text: Option<&str>, ) -> AdmissionDecision
Evaluate admission for a message.
goal_text: optional current-turn goal context for goal-conditioned scoring.
Ignored when the goal gate is disabled or goal_text is None/trivial (< 10 chars).
Fast path: skips LLM when heuristic-only score is already above threshold + fast_path_margin.
Slow path: calls LLM for future_utility when borderline.
On LLM failure, future_utility defaults to 0.5 (neutral).
Auto Trait Implementations§
impl !Freeze for AdmissionControl
impl !RefUnwindSafe for AdmissionControl
impl Send for AdmissionControl
impl Sync for AdmissionControl
impl Unpin for AdmissionControl
impl UnsafeUnpin for AdmissionControl
impl !UnwindSafe for AdmissionControl
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request