pub trait KnowledgeProvider: Send + Sync {
// Required method
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
collection: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeHit>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait that any knowledge backend must implement.
Required Methods§
Sourcefn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
collection: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeHit>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
collection: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeHit>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Search the knowledge base for chunks similar to query.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".