LanguageModelUsage class

Usage stats for the generation.

You can use this information to determine how much the model call costed (as usage is usually priced by token).

This is only available for some models.

Annotations
  • @immutable

Constructors

LanguageModelUsage({int? promptTokens, int? promptBillableCharacters, int? responseTokens, int? responseBillableCharacters, int? totalTokens})
Usage stats for the generation.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
promptBillableCharacters int?
The total number of billable characters in the prompt if applicable.
final
promptTokens int?
The number of tokens in the prompt.
final
responseBillableCharacters int?
The total number of billable characters in the completion if applicable.
final
responseTokens int?
The number of tokens in the completion.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalTokens int?
The total number of tokens in the prompt and completion.
final

Methods

concat(LanguageModelUsage other) LanguageModelUsage
Merges this usage with another by summing the values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(covariant LanguageModelUsage other) bool
The equality operator.
override