pub struct LoggingEmbeddingModel<M>where
M: EmbeddingModel,{ /* private fields */ }Expand description
日志型 Embedding 模型适配器
包装一个内部 EmbeddingModel,在调用时记录调用的文本和耗时。 适用于调试和性能分析场景。
Implementations§
Source§impl<M> LoggingEmbeddingModel<M>where
M: EmbeddingModel,
impl<M> LoggingEmbeddingModel<M>where
M: EmbeddingModel,
Trait Implementations§
Source§impl<M> EmbeddingModel for LoggingEmbeddingModel<M>where
M: EmbeddingModel,
impl<M> EmbeddingModel for LoggingEmbeddingModel<M>where
M: EmbeddingModel,
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, AiError>> + 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>>, AiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dimension(&self) -> usize
fn model_name(&self) -> &str
Auto Trait Implementations§
impl<M> !Freeze for LoggingEmbeddingModel<M>
impl<M> RefUnwindSafe for LoggingEmbeddingModel<M>where
M: RefUnwindSafe,
impl<M> Send for LoggingEmbeddingModel<M>
impl<M> Sync for LoggingEmbeddingModel<M>
impl<M> Unpin for LoggingEmbeddingModel<M>where
M: Unpin,
impl<M> UnsafeUnpin for LoggingEmbeddingModel<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for LoggingEmbeddingModel<M>where
M: 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