pub struct LocalOnnxProvider { /* private fields */ }Expand description
Local ONNX-based embedding provider
This is a stub implementation. In production, this would use:
- ort (ONNX Runtime) for model inference
- fastembed-rs for pre-packaged models
- tokenizers for text preprocessing
Implementations§
Source§impl LocalOnnxProvider
impl LocalOnnxProvider
Sourcepub fn new(config: EmbeddingConfig) -> EmbeddingResult<Self>
pub fn new(config: EmbeddingConfig) -> EmbeddingResult<Self>
Create a new local ONNX provider
Sourcepub fn load_pretrained(model_name: &str) -> EmbeddingResult<Self>
pub fn load_pretrained(model_name: &str) -> EmbeddingResult<Self>
Load a pre-trained model by name
Trait Implementations§
Source§impl Debug for LocalOnnxProvider
impl Debug for LocalOnnxProvider
Source§impl EmbeddingProvider for LocalOnnxProvider
impl EmbeddingProvider for LocalOnnxProvider
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name
Source§fn max_length(&self) -> usize
fn max_length(&self) -> usize
Maximum text length (in characters or tokens)
Source§fn embed_batch(&self, texts: &[&str]) -> EmbeddingResult<Vec<Vec<f32>>>
fn embed_batch(&self, texts: &[&str]) -> EmbeddingResult<Vec<Vec<f32>>>
Generate embeddings for multiple texts (batch)
Auto Trait Implementations§
impl Freeze for LocalOnnxProvider
impl RefUnwindSafe for LocalOnnxProvider
impl Send for LocalOnnxProvider
impl Sync for LocalOnnxProvider
impl Unpin for LocalOnnxProvider
impl UnwindSafe for LocalOnnxProvider
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