Skip to main content

Embedder

Trait Embedder 

Source
pub trait Embedder: Send {
    // Required method
    fn embed(
        &mut self,
        texts: &[String],
    ) -> Result<Vec<Vec<f32>>, EmbedCallbackError>;
}
Expand description

嵌入回调:[文本] -> [向量],条数必须与输入一致。Rust 侧直接收闭包。

Required Methods§

Source

fn embed( &mut self, texts: &[String], ) -> Result<Vec<Vec<f32>>, EmbedCallbackError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> Embedder for F