pub struct ClassifierInput {
pub message: String,
pub context_tokens: usize,
pub turn_count: usize,
pub available_tools: Vec<String>,
}Expand description
Input for the classifier — metadata about the current request.
Fields§
§message: StringUser message text.
context_tokens: usizeEstimated context token count.
turn_count: usizeNumber of conversation turns so far.
available_tools: Vec<String>Tool names available in this session.
Implementations§
Source§impl ClassifierInput
impl ClassifierInput
Sourcepub fn contains_code_blocks(&self) -> bool
pub fn contains_code_blocks(&self) -> bool
Check if the message contains code blocks (``` markers).
Sourcepub fn contains_file_paths(&self) -> bool
pub fn contains_file_paths(&self) -> bool
Check if the message references file paths.
Detects patterns like src/main.rs, lib/config.ts, /etc/hosts.
Language-agnostic — relies on path structure, not words.
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Count the number of lines in the message.
Sourcepub fn symbol_density(&self) -> f64
pub fn symbol_density(&self) -> f64
Compute symbol density — ratio of code-like characters.
Counts {, }, (, ), [, ], <, >, =, ;, :,
|, &, !, @, #, $, %, ^, *, +, -, /.
Higher density suggests code, configuration, or technical content.
Sourcepub fn is_question(&self) -> bool
pub fn is_question(&self) -> bool
Check if the message ends with a question mark.
Sourcepub fn is_single_sentence(&self) -> bool
pub fn is_single_sentence(&self) -> bool
Check if the message appears to be a short, single-sentence statement.
Heuristic: ≤ 3 words and no newlines.
Sourcepub fn file_path_count(&self) -> usize
pub fn file_path_count(&self) -> usize
Count distinct file path references.
Trait Implementations§
Source§impl Clone for ClassifierInput
impl Clone for ClassifierInput
Source§fn clone(&self) -> ClassifierInput
fn clone(&self) -> ClassifierInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more