pub struct OllamaEmbedder { /* private fields */ }Expand description
Embedding provider that calls Ollama’s /api/embed endpoint.
Implementations§
Source§impl OllamaEmbedder
impl OllamaEmbedder
Sourcepub fn try_new(config: &EmbeddingConfig) -> Result<Self, MemoryError>
pub fn try_new(config: &EmbeddingConfig) -> Result<Self, MemoryError>
Create a new OllamaEmbedder from config.
Returns an error if the HTTP client cannot be constructed (e.g. TLS backend is unavailable).
Trait Implementations§
Source§impl Embedder for OllamaEmbedder
impl Embedder for OllamaEmbedder
Source§fn embed<'a>(&'a self, text: &'a str) -> EmbedFuture<'a>
fn embed<'a>(&'a self, text: &'a str) -> EmbedFuture<'a>
Embed a single text. Returns a vector of f32.
Source§fn embed_batch<'a>(&'a self, texts: Vec<String>) -> EmbedBatchFuture<'a>
fn embed_batch<'a>(&'a self, texts: Vec<String>) -> EmbedBatchFuture<'a>
Embed multiple texts in a batch. Read more
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
The model name this embedder uses.
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Expected embedding dimensions.
Auto Trait Implementations§
impl Freeze for OllamaEmbedder
impl !RefUnwindSafe for OllamaEmbedder
impl Send for OllamaEmbedder
impl Sync for OllamaEmbedder
impl Unpin for OllamaEmbedder
impl UnsafeUnpin for OllamaEmbedder
impl !UnwindSafe for OllamaEmbedder
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