ContextUsageEstimate class final
Estimated context-token usage for a message list.
Ported from pi's ContextUsageEstimate.
Constructors
- ContextUsageEstimate({required int tokens, required int usageTokens, required int trailingTokens, required int? lastUsageIndex})
-
Creates a ContextUsageEstimate.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastUsageIndex → int?
-
Index of the message that provided usage, or
nullwhen none exists.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tokens → int
-
Estimated total context tokens.
final
- trailingTokens → int
-
Estimated tokens after the most recent assistant usage block.
final
- usageTokens → int
-
Tokens reported by the most recent assistant usage block.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- empty → const ContextUsageEstimate
- An empty estimate (no messages, no anchor).