pub struct GoogleEmbeddingModel { /* private fields */ }Expand description
Embedding model backed by embedContent.
Implementations§
Source§impl GoogleEmbeddingModel
impl GoogleEmbeddingModel
Sourcepub fn new(config: SharedConfig, model_id: impl Into<ModelId>) -> Self
pub fn new(config: SharedConfig, model_id: impl Into<ModelId>) -> Self
Creates the model.
Sourcepub fn prepare_request(
&self,
options: &EmbedOptions,
) -> Result<PreparedEmbeddingRequest, ProviderError>
pub fn prepare_request( &self, options: &EmbedOptions, ) -> Result<PreparedEmbeddingRequest, ProviderError>
Builds the request for options.
§Errors
Returns ProviderError::TooManyEmbeddingValues above
MAX_EMBEDDINGS_PER_CALL and ProviderError::InvalidArgument for
invalid options or a content list whose length differs from the
values.
Trait Implementations§
Source§impl Clone for GoogleEmbeddingModel
impl Clone for GoogleEmbeddingModel
Source§fn clone(&self) -> GoogleEmbeddingModel
fn clone(&self) -> GoogleEmbeddingModel
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 Debug for GoogleEmbeddingModel
impl Debug for GoogleEmbeddingModel
Source§impl EmbeddingModel for GoogleEmbeddingModel
impl EmbeddingModel for GoogleEmbeddingModel
Source§fn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Provider identifier.
Source§fn max_embeddings_per_call(&self) -> Option<usize>
fn max_embeddings_per_call(&self) -> Option<usize>
Maximum number of values per call, or
None when unlimited.Source§fn supports_parallel_calls(&self) -> bool
fn supports_parallel_calls(&self) -> bool
Whether several calls may run concurrently against this model.
Source§async fn do_embed(
&self,
options: EmbedOptions,
) -> Result<EmbedResult, ProviderError>
async fn do_embed( &self, options: EmbedOptions, ) -> Result<EmbedResult, ProviderError>
Embeds
options.values in one provider call.Source§fn max_input_bytes_per_call(&self) -> Option<usize>
fn max_input_bytes_per_call(&self) -> Option<usize>
Maximum total UTF-8 size of the values of one call in bytes, or
None when unlimited.Auto Trait Implementations§
impl !RefUnwindSafe for GoogleEmbeddingModel
impl !UnwindSafe for GoogleEmbeddingModel
impl Freeze for GoogleEmbeddingModel
impl Send for GoogleEmbeddingModel
impl Sync for GoogleEmbeddingModel
impl Unpin for GoogleEmbeddingModel
impl UnsafeUnpin for GoogleEmbeddingModel
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