Skip to main content

Classifier

Trait Classifier 

Source
pub trait Classifier: Send + Sync {
    // Required method
    fn classify<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        input: &'life1 str,
        available_tools: &'life2 [ToolDescriptor],
    ) -> Pin<Box<dyn Future<Output = ClassificationResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn supports_multi_category(&self) -> bool { ... }
}
Expand description

Trait for task classifiers.

Classifiers analyze user input and determine the task category to enable intelligent tool routing.

Required Methods§

Source

fn classify<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, input: &'life1 str, available_tools: &'life2 [ToolDescriptor], ) -> Pin<Box<dyn Future<Output = ClassificationResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Classify user input and return routing information.

Provided Methods§

Source

fn supports_multi_category(&self) -> bool

Whether this classifier can handle multi-category classification.

Implementors§