hanzo_client/models/context_bundle.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ContextBundle {
16 /// BudgetTokens is the ceiling the caller asked for. Packing stops under it, so this is a bound and not a target.
17 #[serde(rename = "budgetTokens", skip_serializing_if = "Option::is_none")]
18 pub budget_tokens: Option<i32>,
19 /// Query is the ask this bundle was packed for, echoed back so a cached or forwarded bundle still says what it answers.
20 #[serde(rename = "query", skip_serializing_if = "Option::is_none")]
21 pub query: Option<String>,
22 /// Repo narrows the retrieval to one repository. Absent means every indexed repo was searched.
23 #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
24 pub repo: Option<String>,
25 /// 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.
26 #[serde(rename = "spans", skip_serializing_if = "Option::is_none")]
27 pub spans: Option<Vec<models::Span>>,
28 /// 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).
29 #[serde(rename = "usedTokens", skip_serializing_if = "Option::is_none")]
30 pub used_tokens: Option<i32>,
31}
32
33impl ContextBundle {
34 pub fn new() -> ContextBundle {
35 ContextBundle {
36 budget_tokens: None,
37 query: None,
38 repo: None,
39 spans: None,
40 used_tokens: None,
41 }
42 }
43}
44