ContextBundle class

Constructors

ContextBundle({int? budgetTokens, String? query, String? repo, List<Span> spans = const [], int? usedTokens})
Returns a new ContextBundle instance.

Properties

budgetTokens ↔ int?
BudgetTokens is the ceiling the caller asked for. Packing stops under it, so this is a bound and not a target.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
query ↔ String?
Query is the ask this bundle was packed for, echoed back so a cached or forwarded bundle still says what it answers.
getter/setter pair
repo ↔ String?
Repo narrows the retrieval to one repository. Absent means every indexed repo was searched.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spans ↔ List<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.
getter/setter pair
usedTokens ↔ int?
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).
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → ContextBundle?
Returns a new ContextBundle instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<ContextBundle>
mapFromJson(dynamic json) → Map<String, ContextBundle>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<ContextBundle>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.