pub struct ContextQuery {
pub file: PathBuf,
pub line: u32,
pub surrounding_lines: u32,
pub intent: Option<String>,
pub max_tokens: usize,
}Expand description
Query for context assembly.
Fields§
§file: PathBufThe file of interest
line: u32The line number of interest
surrounding_lines: u32Number of lines to include around the query point
intent: Option<String>Optional intent describing what the user is trying to do
max_tokens: usizeMaximum tokens to include in the result
Implementations§
Source§impl ContextQuery
impl ContextQuery
Sourcepub fn with_surrounding_lines(self, lines: u32) -> Self
pub fn with_surrounding_lines(self, lines: u32) -> Self
Set the number of surrounding lines to include.
Sourcepub fn with_intent(self, intent: String) -> Self
pub fn with_intent(self, intent: String) -> Self
Set the intent description.
Sourcepub fn with_max_tokens(self, max_tokens: usize) -> Self
pub fn with_max_tokens(self, max_tokens: usize) -> Self
Set the maximum token budget.
Trait Implementations§
Source§impl Clone for ContextQuery
impl Clone for ContextQuery
Source§fn clone(&self) -> ContextQuery
fn clone(&self) -> ContextQuery
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 moreAuto Trait Implementations§
impl Freeze for ContextQuery
impl RefUnwindSafe for ContextQuery
impl Send for ContextQuery
impl Sync for ContextQuery
impl Unpin for ContextQuery
impl UnwindSafe for ContextQuery
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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