IterationUsage class
Token usage for a single iteration (message or compaction).
- Annotations
-
- @immutable
Constructors
- IterationUsage({required String type, required int inputTokens, required int outputTokens, int cacheCreationInputTokens = 0, int cacheReadInputTokens = 0, CacheCreation? cacheCreation})
-
Creates an IterationUsage.
const
-
IterationUsage.fromJson(Map<
String, dynamic> json) -
Creates an IterationUsage from JSON.
factory
Properties
- cacheCreation → CacheCreation?
-
Cache creation details by TTL.
final
- cacheCreationInputTokens → int
-
Cache creation token count for this iteration.
final
- cacheReadInputTokens → int
-
Cache read token count for this iteration.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- inputTokens → int
-
Input tokens for this iteration.
final
- outputTokens → int
-
Output tokens for this iteration.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
Iteration type (for example: "message" or "compaction").
final
Methods
-
copyWith(
{String? type, int? inputTokens, int? outputTokens, int? cacheCreationInputTokens, int? cacheReadInputTokens, Object? cacheCreation = unsetCopyWithValue}) → IterationUsage - Creates a copy with replaced values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override