pub struct Extractor<T>{ /* private fields */ }Expand description
Implementations§
Source§impl<T> Extractor<T>
impl<T> Extractor<T>
Sourcepub fn with_model_label(self, label: impl Into<ModelRef>) -> Self
pub fn with_model_label(self, label: impl Into<ModelRef>) -> Self
Set a different default model for this extractor’s subsequent runs.
Use the model registered under label in the extractor’s handler table.
Sourcepub fn with_model(self, model: impl Into<DynModel<Completion>>) -> Self
pub fn with_model(self, model: impl Into<DynModel<Completion>>) -> Self
Register model in the extractor’s handler table and use it.
Sourcepub fn extract(&self, text: impl Into<Message>) -> TypedRun<T>
pub fn extract(&self, text: impl Into<Message>) -> TypedRun<T>
Extract structured data from text.
The returned run supports history, a per-run model, and retry overrides,
and can be awaited for a
TypedPromptResponse<T>. The
model must call the submit tool; a run in which it does not is an
empty response and, within the retry budget, is retried from scratch.
Usage accumulates across attempts, including attempts that received a
billed response but failed extraction; attempts whose completion call
itself errored contribute no usage.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Extractor<T>
impl<T> !UnwindSafe for Extractor<T>
impl<T> Freeze for Extractor<T>where
PhantomData<T>: Freeze,
impl<T> Send for Extractor<T>where
PhantomData<T>: Send,
impl<T> Sync for Extractor<T>where
PhantomData<T>: Sync,
impl<T> Unpin for Extractor<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for Extractor<T>where
PhantomData<T>: UnsafeUnpin,
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