pub struct EmbeddingEngineBuilder { /* private fields */ }Expand description
Builder for creating an EmbeddingEngine with fluent API.
Implementations§
Source§impl EmbeddingEngineBuilder
impl EmbeddingEngineBuilder
Sourcepub fn model(self, model: EmbeddingModel) -> Self
pub fn model(self, model: EmbeddingModel) -> Self
Set the embedding model to use.
Sourcepub fn cache_dir(self, dir: impl Into<String>) -> Self
pub fn cache_dir(self, dir: impl Into<String>) -> Self
Set the cache directory for model files.
Sourcepub fn max_batch_size(self, size: usize) -> Self
pub fn max_batch_size(self, size: usize) -> Self
Set the maximum batch size.
Sourcepub fn use_gpu(self, enable: bool) -> Self
pub fn use_gpu(self, enable: bool) -> Self
Enable GPU acceleration (reserved for future use; ORT selects the execution provider).
Sourcepub fn num_threads(self, threads: usize) -> Self
pub fn num_threads(self, threads: usize) -> Self
Set the number of intra-op CPU threads for ORT inference.
Sourcepub async fn build(self) -> Result<EmbeddingEngine>
pub async fn build(self) -> Result<EmbeddingEngine>
Build the embedding engine.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EmbeddingEngineBuilder
impl RefUnwindSafe for EmbeddingEngineBuilder
impl Send for EmbeddingEngineBuilder
impl Sync for EmbeddingEngineBuilder
impl Unpin for EmbeddingEngineBuilder
impl UnsafeUnpin for EmbeddingEngineBuilder
impl UnwindSafe for EmbeddingEngineBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more