pub struct PromptBasedExtractor { /* private fields */ }Expand description
A classic, prompt-based implementation of IntentExtractor.
This extractor uses FlexibleExtractor to find content within a specific
XML-like tag (e.g., <intent>...<intent>) and then parses that content
into the target intent type T.
Implementations§
Trait Implementations§
Source§impl<T> IntentExtractor<T> for PromptBasedExtractorwhere
T: FromStr,
impl<T> IntentExtractor<T> for PromptBasedExtractorwhere
T: FromStr,
Source§fn 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.
Auto Trait Implementations§
impl Freeze for PromptBasedExtractor
impl RefUnwindSafe for PromptBasedExtractor
impl Send for PromptBasedExtractor
impl Sync for PromptBasedExtractor
impl Unpin for PromptBasedExtractor
impl UnwindSafe for PromptBasedExtractor
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