pub trait IntentExtractor<T>where
T: FromStr,{
// Required method
fn extract_intent(&self, text: &str) -> Result<T, IntentError>;
}Expand description
A generic trait for extracting a structured intent of type T from a string response.
Type T is typically an enum representing the possible intents.
Required Methods§
Sourcefn extract_intent(&self, text: &str) -> Result<T, IntentError>
fn extract_intent(&self, text: &str) -> Result<T, IntentError>
Extracts and parses an intent from the given text.