pub struct Intent {
pub intent_type: IntentType,
pub confidence: f64,
pub raw_input: String,
pub keywords: Vec<String>,
}Expand description
Intent represents the player’s intended action or request
Fields§
§intent_type: IntentTypeType of intent
confidence: f64Confidence score for the intent classification (0.0 - 1.0)
raw_input: StringRaw input from the player
keywords: Vec<String>Keywords extracted from the input
Implementations§
Source§impl Intent
impl Intent
Sourcepub fn new(
intent_type: IntentType,
confidence: f64,
raw_input: &str,
keywords: Vec<String>,
) -> Self
pub fn new( intent_type: IntentType, confidence: f64, raw_input: &str, keywords: Vec<String>, ) -> Self
Sourcepub fn extract_keywords(text: &str) -> Vec<String>
pub fn extract_keywords(text: &str) -> Vec<String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Intent
impl<'de> Deserialize<'de> for Intent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
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