pub struct PromptBasedExtractor { /* private fields */ }๐Deprecated since 0.8.0: Please use
IntentFrame instead for better safety and clarity.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