pub struct LlmClassifier {
pub model: Option<String>,
}Expand description
LLM-based classifier for refining ambiguous heuristic scores.
When classifier_model is configured (e.g. "anthropic/claude-haiku-4"),
this classifier uses a fast/cheap model to classify ambiguous requests.
It only activates when the heuristic score falls in the ambiguous zone (0.25–0.75).
The LLM understands any language natively — no keyword lists needed.
Fields§
§model: Option<String>The model to use for classification, in "provider/model-id" format.
Implementations§
Source§impl LlmClassifier
impl LlmClassifier
Sourcepub async fn classify(
&self,
input: &ClassifierInput,
heuristic_score: f64,
) -> Result<f64>
pub async fn classify( &self, input: &ClassifierInput, heuristic_score: f64, ) -> Result<f64>
Classify a user message to determine routing tier.
Sends a minimal prompt to the configured classifier model and parses the response as “high”, “medium”, or “low”.
Returns a score:
0.1forlow0.5formedium0.9forhigh
Falls back to the provided heuristic_score on any error.
Trait Implementations§
Source§impl Clone for LlmClassifier
impl Clone for LlmClassifier
Source§fn clone(&self) -> LlmClassifier
fn clone(&self) -> LlmClassifier
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LlmClassifier
impl Debug for LlmClassifier
Source§impl Default for LlmClassifier
impl Default for LlmClassifier
Source§fn default() -> LlmClassifier
fn default() -> LlmClassifier
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LlmClassifier
impl RefUnwindSafe for LlmClassifier
impl Send for LlmClassifier
impl Sync for LlmClassifier
impl Unpin for LlmClassifier
impl UnsafeUnpin for LlmClassifier
impl UnwindSafe for LlmClassifier
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