pub struct EmbeddingModel<T = Client> { /* private fields */ }Implementations§
Source§impl<T> EmbeddingModel<T>
impl<T> EmbeddingModel<T>
pub fn new( client: Client<GeminiExt, T>, model: impl Into<String>, ndims: usize, ) -> EmbeddingModel<T>
pub fn with_model( client: Client<GeminiExt, T>, model: &str, ndims: usize, ) -> EmbeddingModel<T>
Trait Implementations§
Source§impl<T> Clone for EmbeddingModel<T>where
T: Clone,
impl<T> Clone for EmbeddingModel<T>where
T: Clone,
Source§fn clone(&self) -> EmbeddingModel<T>
fn clone(&self) -> EmbeddingModel<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> EmbeddingModel for EmbeddingModel<T>where
T: Clone + HttpClientExt + 'static,
impl<T> EmbeddingModel for EmbeddingModel<T>where
T: Clone + HttpClientExt + 'static,
Source§async fn embed_texts(
&self,
documents: impl IntoIterator<Item = String> + WasmCompatSend,
) -> Result<Vec<Embedding>, EmbeddingError>
async fn embed_texts( &self, documents: impl IntoIterator<Item = String> + WasmCompatSend, ) -> Result<Vec<Embedding>, EmbeddingError>
Source§const MAX_DOCUMENTS: usize = 1024
const MAX_DOCUMENTS: usize = 1024
The maximum number of documents that can be embedded in a single request.
Source§type Client = Client<GeminiExt, T>
type Client = Client<GeminiExt, T>
Provider client type used to construct this embedding model.
Source§fn make(
client: &<EmbeddingModel<T> as EmbeddingModel>::Client,
model: impl Into<String>,
dims: Option<usize>,
) -> EmbeddingModel<T>
fn make( client: &<EmbeddingModel<T> as EmbeddingModel>::Client, model: impl Into<String>, dims: Option<usize>, ) -> EmbeddingModel<T>
Construct a model handle from a provider client, model identifier, and optional dimensions.
Source§fn embed_text(
&self,
text: &str,
) -> impl Future<Output = Result<Embedding, EmbeddingError>> + WasmCompatSend
fn embed_text( &self, text: &str, ) -> impl Future<Output = Result<Embedding, EmbeddingError>> + WasmCompatSend
Embed a single text document.
Source§fn embed_texts_with_usage(
&self,
texts: impl IntoIterator<Item = String> + WasmCompatSend,
) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
fn embed_texts_with_usage( &self, texts: impl IntoIterator<Item = String> + WasmCompatSend, ) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
Embed multiple text documents in a single request and return token usage. Read more
Source§fn embed_text_with_usage(
&self,
text: &str,
) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
fn embed_text_with_usage( &self, text: &str, ) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
Embed a single text document and return token usage. Read more
Auto Trait Implementations§
impl<T> Freeze for EmbeddingModel<T>where
T: Freeze,
impl<T> RefUnwindSafe for EmbeddingModel<T>where
T: RefUnwindSafe,
impl<T> Send for EmbeddingModel<T>where
T: Send,
impl<T> Sync for EmbeddingModel<T>where
T: Sync,
impl<T> Unpin for EmbeddingModel<T>where
T: Unpin,
impl<T> UnsafeUnpin for EmbeddingModel<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for EmbeddingModel<T>where
T: UnwindSafe,
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