UsageCost class final

Monetary cost of a request, in USD.

Ported from pi's Usage.cost.

Constructors

UsageCost({double input = 0, double output = 0, double cacheRead = 0, double cacheWrite = 0, double total = 0})
const
UsageCost.fromJson(Map<String, dynamic> json)
Deserializes from a JSON map produced by toJson.
factory

Properties

cacheRead → double
Cost of tokens read from the prompt cache.
final
cacheWrite → double
Cost of tokens written to the prompt cache.
final
hashCode → int
The hash code for this object.
no setterinherited
input → double
Cost of input tokens.
final
output → double
Cost of output tokens.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
total → double
Total cost.
final

Methods

copyWith({double? input, double? output, double? cacheRead, double? cacheWrite, double? total}) → UsageCost
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes to a JSON map.
toString() → String
A string representation of this object.
inherited

Operators

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