Usage class

Token usage metadata for a completion.

Constructors

Usage({required int promptTokens, required int completionTokens, required int totalTokens})
Creates usage metadata.
const
Usage.fromJson(String data)
Creates Usage from a JSON string.
factory
Usage.fromMap(Map<String, dynamic> data)
Creates Usage from decoded map data.
factory

Properties

completionTokens → int
Completion token count.
final
hashCode → int
The hash code for this object.
no setterinherited
promptTokens → int
Prompt token count.
final
props → List<Object?>
Values used for equality-style comparisons.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
totalTokens → int
Total token count.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Converts this usage object to map data.
toString() → String
A string representation of this object.
inherited

Operators

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