pub struct ContextBundle {
pub budget_tokens: Option<i32>,
pub query: Option<String>,
pub repo: Option<String>,
pub spans: Option<Vec<Span>>,
pub used_tokens: Option<i32>,
}Fields§
§budget_tokens: Option<i32>BudgetTokens is the ceiling the caller asked for. Packing stops under it, so this is a bound and not a target.
query: Option<String>Query is the ask this bundle was packed for, echoed back so a cached or forwarded bundle still says what it answers.
repo: Option<String>Repo narrows the retrieval to one repository. Absent means every indexed repo was searched.
spans: Option<Vec<Span>>Spans are the packed chunks, most relevant first, each expanded with the definitions it calls and its notable callers. The top match is always present even if it had to be truncated to fit, so a matched query never comes back with nothing.
used_tokens: Option<i32>UsedTokens is what the returned spans actually cost, by the same estimate the packer used (roughly one token per four characters — an estimate, not a tokenizer’s count, so size a real window with headroom).
Implementations§
Source§impl ContextBundle
impl ContextBundle
pub fn new() -> ContextBundle
Trait Implementations§
Source§impl Clone for ContextBundle
impl Clone for ContextBundle
Source§fn clone(&self) -> ContextBundle
fn clone(&self) -> ContextBundle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more