pub struct ExtractorBuilder<T>where
T: JsonSchema + for<'a> Deserialize<'a> + Serialize + WasmCompatSend + WasmCompatSync + 'static,{ /* private fields */ }Expand description
Builder for the Extractor
Implementations§
Source§impl<T> ExtractorBuilder<T>where
T: JsonSchema + for<'a> Deserialize<'a> + Serialize + WasmCompatSend + WasmCompatSync + 'static,
impl<T> ExtractorBuilder<T>where
T: JsonSchema + for<'a> Deserialize<'a> + Serialize + WasmCompatSend + WasmCompatSync + 'static,
pub fn new<M>(model: M) -> Selfwhere
M: CompletionModel + 'static,
Sourcepub fn from_model_handle(model: ModelHandle) -> Self
pub fn from_model_handle(model: ModelHandle) -> Self
Create an extractor builder from an opaque runtime model handle.
Sourcepub fn dynamic_context<I>(self, samples: usize, index: I) -> Selfwhere
I: VectorStoreIndexDyn + 'static,
pub fn dynamic_context<I>(self, samples: usize, index: I) -> Selfwhere
I: VectorStoreIndexDyn + 'static,
Add dynamic context retrieved from a vector store on every extraction attempt.
This delegates to AgentBuilder::dynamic_context and therefore uses the
same completion-call hook lifecycle as an agent.
pub fn additional_params(self, params: Value) -> Self
Sourcepub fn max_tokens(self, max_tokens: u64) -> Self
pub fn max_tokens(self, max_tokens: u64) -> Self
Set the maximum number of tokens for the completion
Sourcepub fn tool_choice(self, choice: ToolChoice) -> Self
pub fn tool_choice(self, choice: ToolChoice) -> Self
Set the tool_choice option for the inner Agent.
Sourcepub fn add_hook<H>(self, hook: H) -> Selfwhere
H: AgentHook + 'static,
pub fn add_hook<H>(self, hook: H) -> Selfwhere
H: AgentHook + 'static,
Add a provider-independent lifecycle hook to every extraction attempt.
Completion-response hooks receive canonical Rig content, usage, prompt, and message ID fields, just like hooks attached directly to an agent.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ExtractorBuilder<T>
impl<T> !UnwindSafe for ExtractorBuilder<T>
impl<T> Freeze for ExtractorBuilder<T>
impl<T> Send for ExtractorBuilder<T>
impl<T> Sync for ExtractorBuilder<T>
impl<T> Unpin for ExtractorBuilder<T>where
T: Unpin,
impl<T> UnsafeUnpin for ExtractorBuilder<T>
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