pub struct HydeService { /* private fields */ }Expand description
HyDE service for query expansion using hypothetical documents
Implementations§
Source§impl HydeService
impl HydeService
pub fn new( llm_service: Arc<dyn LlmService>, embedding_service: Arc<dyn EmbeddingService>, config: HydeConfig, ) -> Self
Sourcepub async fn expand_query(&self, query: &str) -> Result<HydeExpansion>
pub async fn expand_query(&self, query: &str) -> Result<HydeExpansion>
Expand a query using HyDE methodology
Sourcepub fn get_best_documents<'a>(
&self,
expansion: &'a HydeExpansion,
limit: usize,
) -> Vec<&'a HypotheticalDocument>
pub fn get_best_documents<'a>( &self, expansion: &'a HydeExpansion, limit: usize, ) -> Vec<&'a HypotheticalDocument>
Get the best hypothetical documents based on confidence
Auto Trait Implementations§
impl Freeze for HydeService
impl !RefUnwindSafe for HydeService
impl Send for HydeService
impl Sync for HydeService
impl Unpin for HydeService
impl !UnwindSafe for HydeService
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