pub struct Extractor<'a, P: LlmProvider> { /* private fields */ }Implementations§
Source§impl<'a, P: LlmProvider> Extractor<'a, P>
impl<'a, P: LlmProvider> Extractor<'a, P>
pub fn new(provider: &'a P) -> Self
pub fn with_preamble(self, preamble: impl Into<String>) -> Self
Sourcepub async fn extract<T>(&self, input: &str) -> Result<T, LlmError>where
T: DeserializeOwned + JsonSchema + 'static,
pub async fn extract<T>(&self, input: &str) -> Result<T, LlmError>where
T: DeserializeOwned + JsonSchema + 'static,
§Errors
Returns an error if the provider fails or the response cannot be parsed.
Auto Trait Implementations§
impl<'a, P> Freeze for Extractor<'a, P>
impl<'a, P> RefUnwindSafe for Extractor<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for Extractor<'a, P>
impl<'a, P> Sync for Extractor<'a, P>
impl<'a, P> Unpin for Extractor<'a, P>
impl<'a, P> UnsafeUnpin for Extractor<'a, P>
impl<'a, P> UnwindSafe for Extractor<'a, P>where
P: RefUnwindSafe,
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