pub struct NomicEmbedProvider { /* private fields */ }Expand description
Embedding provider backed by the Nomic Atlas embeddings API.
Default model: nomic-embed-text-v1.5 (768 dims). The Nomic endpoint
accepts an array of texts under the texts key and responds with
{ "embeddings": [ [...], ... ] }.
Implementations§
Source§impl NomicEmbedProvider
impl NomicEmbedProvider
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Create a new Nomic provider with the default model (nomic-embed-text-v1.5).
Sourcepub fn with_model(
api_key: impl Into<String>,
model: impl Into<String>,
dimensions: usize,
) -> Self
pub fn with_model( api_key: impl Into<String>, model: impl Into<String>, dimensions: usize, ) -> Self
Create with an explicit model and dimension override.
Sourcepub fn with_task_type(self, task_type: impl Into<String>) -> Self
pub fn with_task_type(self, task_type: impl Into<String>) -> Self
Set the task_type (search_document, search_query, clustering, classification).
Sourcepub fn build_payload(&self, texts: &[String]) -> Value
pub fn build_payload(&self, texts: &[String]) -> Value
Build the request payload for the Nomic embeddings API.
Trait Implementations§
Source§impl EmbeddingProvider for NomicEmbedProvider
impl EmbeddingProvider for NomicEmbedProvider
Source§fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compute embedding vector for a single text.
Source§fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compute embeddings for a batch of texts.
Auto Trait Implementations§
impl Freeze for NomicEmbedProvider
impl RefUnwindSafe for NomicEmbedProvider
impl Send for NomicEmbedProvider
impl Sync for NomicEmbedProvider
impl Unpin for NomicEmbedProvider
impl UnsafeUnpin for NomicEmbedProvider
impl UnwindSafe for NomicEmbedProvider
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