pub struct Layer1EmbeddingAdapter { /* private fields */ }Expand description
Layer1 EmbeddingModel wrapper
Wraps a layer1 embedding model to implement layer3’s EmbeddingModel trait.
Implementations§
Source§impl Layer1EmbeddingAdapter
impl Layer1EmbeddingAdapter
Sourcepub fn new(model: Box<dyn EmbeddingModel>) -> Self
pub fn new(model: Box<dyn EmbeddingModel>) -> Self
Create a new adapter wrapping a layer1 embedding model
Trait Implementations§
Source§impl EmbeddingModel for Layer1EmbeddingAdapter
impl EmbeddingModel for Layer1EmbeddingAdapter
Source§fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Layer3Result<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 = Layer3Result<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 = Layer3Result<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 = Layer3Result<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 Layer1EmbeddingAdapter
impl !UnwindSafe for Layer1EmbeddingAdapter
impl Freeze for Layer1EmbeddingAdapter
impl Send for Layer1EmbeddingAdapter
impl Sync for Layer1EmbeddingAdapter
impl Unpin for Layer1EmbeddingAdapter
impl UnsafeUnpin for Layer1EmbeddingAdapter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more