pub struct CohereEmbeddings { /* private fields */ }Expand description
Cohere 嵌入模型
Implementations§
Source§impl CohereEmbeddings
impl CohereEmbeddings
pub fn new(config: EmbeddingsConfig) -> Result<Self>
pub fn with_cache( config: EmbeddingsConfig, cache: Arc<EmbeddingCache>, ) -> Result<Self>
Trait Implementations§
Source§impl Debug for CohereEmbeddings
impl Debug for CohereEmbeddings
Source§impl EmbeddingModel for CohereEmbeddings
impl EmbeddingModel for CohereEmbeddings
Source§fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<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 = Result<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
生成单个文本的嵌入向量
Source§fn embed_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
批量生成嵌入向量
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
获取模型名称
Auto Trait Implementations§
impl !RefUnwindSafe for CohereEmbeddings
impl !UnwindSafe for CohereEmbeddings
impl Freeze for CohereEmbeddings
impl Send for CohereEmbeddings
impl Sync for CohereEmbeddings
impl Unpin for CohereEmbeddings
impl UnsafeUnpin for CohereEmbeddings
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