pub struct DefaultRetrieverEngine<VS, EM, CS>{ /* private fields */ }Expand description
默认检索引擎实现
结合 Embedding 模型、分块策略和向量存储提供完整的 RAG 功能。
Implementations§
Source§impl<VS, EM, CS> DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> DefaultRetrieverEngine<VS, EM, CS>
Trait Implementations§
Source§impl<VS, EM, CS> RetrieverEngine for DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> RetrieverEngine for DefaultRetrieverEngine<VS, EM, CS>
Source§fn index<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn index<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
索引文档
Source§fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
检索相似文档
Source§fn hybrid_retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn hybrid_retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
混合检索(向量 + 关键词)
Source§fn hybrid_retrieve_with_config<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
config: &'life2 HybridSearchConfig,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn hybrid_retrieve_with_config<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
config: &'life2 HybridSearchConfig,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
带配置的混合检索
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
doc_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
doc_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
删除文档
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
清空索引
Source§fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取文档数量
Source§fn retrieve_with_filter<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
filter: Option<MetadataFilter>,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn retrieve_with_filter<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
top_k: usize,
filter: Option<MetadataFilter>,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<RetrievalResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
带过滤条件的检索
Auto Trait Implementations§
impl<VS, EM, CS> !RefUnwindSafe for DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> !UnwindSafe for DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> Freeze for DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> Send for DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> Sync for DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> Unpin for DefaultRetrieverEngine<VS, EM, CS>
impl<VS, EM, CS> UnsafeUnpin for DefaultRetrieverEngine<VS, EM, CS>
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