pub struct ContextBuilder { /* private fields */ }Expand description
Builds context for AI providers by selecting and prioritizing relevant files
Implementations§
Source§impl ContextBuilder
impl ContextBuilder
Sourcepub fn with_semantic_index(self, index: SemanticIndex) -> Self
pub fn with_semantic_index(self, index: SemanticIndex) -> Self
Set the semantic index for searching
Sourcepub fn select_relevant_files(
&self,
query: &str,
all_files: Vec<FileContext>,
) -> Result<Vec<FileContext>, ResearchError>
pub fn select_relevant_files( &self, query: &str, all_files: Vec<FileContext>, ) -> Result<Vec<FileContext>, ResearchError>
Select relevant files based on a query
Sourcepub fn build_context(
&self,
files: Vec<FileContext>,
) -> Result<CodeContext, ResearchError>
pub fn build_context( &self, files: Vec<FileContext>, ) -> Result<CodeContext, ResearchError>
Build context from selected files
Sourcepub fn max_tokens(&self) -> usize
pub fn max_tokens(&self) -> usize
Get the maximum tokens allowed
Sourcepub fn set_max_tokens(&mut self, max_tokens: usize)
pub fn set_max_tokens(&mut self, max_tokens: usize)
Set the maximum tokens allowed
Trait Implementations§
Source§impl Clone for ContextBuilder
impl Clone for ContextBuilder
Source§fn clone(&self) -> ContextBuilder
fn clone(&self) -> ContextBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextBuilder
impl Debug for ContextBuilder
Auto Trait Implementations§
impl Freeze for ContextBuilder
impl RefUnwindSafe for ContextBuilder
impl Send for ContextBuilder
impl Sync for ContextBuilder
impl Unpin for ContextBuilder
impl UnwindSafe for ContextBuilder
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