pub struct KeywordClassifier;Expand description
Level 0 keyword-based task classifier.
Scans the last user message for known keyword patterns and returns
a TaskProfile with the detected type, estimated complexity, and
matched keywords.
§Complexity heuristic
Complexity is estimated as the ratio of matched keywords to total words in the message, clamped to [0.1, 0.9]. More keyword hits = higher estimated complexity (the request is touching multiple concerns).
Implementations§
Trait Implementations§
Source§impl Default for KeywordClassifier
impl Default for KeywordClassifier
Source§impl TaskClassifier for KeywordClassifier
impl TaskClassifier for KeywordClassifier
Source§fn classify(&self, request: &ChatRequest) -> TaskProfile
fn classify(&self, request: &ChatRequest) -> TaskProfile
Analyze the request and produce a task profile.
Auto Trait Implementations§
impl Freeze for KeywordClassifier
impl RefUnwindSafe for KeywordClassifier
impl Send for KeywordClassifier
impl Sync for KeywordClassifier
impl Unpin for KeywordClassifier
impl UnsafeUnpin for KeywordClassifier
impl UnwindSafe for KeywordClassifier
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 more