pub struct ExtractorBuilder<M, T>where
M: CompletionModel,
T: JsonSchema + for<'a> Deserialize<'a> + Serialize + WasmCompatSend + WasmCompatSync + 'static,{ /* private fields */ }Expand description
Builder for the Extractor
Implementations§
Source§impl<M, T> ExtractorBuilder<M, T>where
M: CompletionModel,
T: JsonSchema + for<'a> Deserialize<'a> + Serialize + WasmCompatSend + WasmCompatSync + 'static,
impl<M, T> ExtractorBuilder<M, T>where
M: CompletionModel,
T: JsonSchema + for<'a> Deserialize<'a> + Serialize + WasmCompatSend + WasmCompatSync + 'static,
pub fn new(model: M) -> ExtractorBuilder<M, T>
Sourcepub fn preamble(self, preamble: &str) -> ExtractorBuilder<M, T>
pub fn preamble(self, preamble: &str) -> ExtractorBuilder<M, T>
Add additional preamble to the extractor
Sourcepub fn context(self, doc: &str) -> ExtractorBuilder<M, T>
pub fn context(self, doc: &str) -> ExtractorBuilder<M, T>
Add a context document to the extractor
pub fn additional_params(self, params: Value) -> ExtractorBuilder<M, T>
Sourcepub fn max_tokens(self, max_tokens: u64) -> ExtractorBuilder<M, T>
pub fn max_tokens(self, max_tokens: u64) -> ExtractorBuilder<M, T>
Set the maximum number of tokens for the completion
Sourcepub fn retries(self, retries: u64) -> ExtractorBuilder<M, T>
pub fn retries(self, retries: u64) -> ExtractorBuilder<M, T>
Set the maximum number of retries for the extractor.
Sourcepub fn tool_choice(self, choice: ToolChoice) -> ExtractorBuilder<M, T>
pub fn tool_choice(self, choice: ToolChoice) -> ExtractorBuilder<M, T>
Set the tool_choice option for the inner Agent.
Sourcepub fn dynamic_context(
self,
sample: usize,
dynamic_context: impl VectorStoreIndexDyn + Send + Sync + 'static,
) -> ExtractorBuilder<M, T>
pub fn dynamic_context( self, sample: usize, dynamic_context: impl VectorStoreIndexDyn + Send + Sync + 'static, ) -> ExtractorBuilder<M, T>
Add dynamic context (RAG) to the extractor.
On each prompt, sample documents will be retrieved from the index based on the RAG text
and inserted in the request.
Auto Trait Implementations§
impl<M, T> Freeze for ExtractorBuilder<M, T>where
M: Freeze,
impl<M, T> !RefUnwindSafe for ExtractorBuilder<M, T>
impl<M, T> Send for ExtractorBuilder<M, T>
impl<M, T> Sync for ExtractorBuilder<M, T>
impl<M, T> Unpin for ExtractorBuilder<M, T>
impl<M, T> UnsafeUnpin for ExtractorBuilder<M, T>where
M: UnsafeUnpin,
impl<M, T> !UnwindSafe for ExtractorBuilder<M, 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