CompletionTokensDetails class

Breakdown of tokens used in a completion.

Annotations
  • @freezed

Constructors

CompletionTokensDetails.new({@JsonKey(name: 'accepted_prediction_tokens', includeIfNull: false) int? acceptedPredictionTokens, @JsonKey(name: 'audio_tokens', includeIfNull: false) int? audioTokens, @JsonKey(name: 'reasoning_tokens', includeIfNull: false) int? reasoningTokens, @JsonKey(name: 'rejected_prediction_tokens', includeIfNull: false) int? rejectedPredictionTokens})
Factory constructor for CompletionTokensDetails
const
factory
CompletionTokensDetails.fromJson(Map<String, dynamic> json)
Object construction from a JSON representation
factory

Properties

acceptedPredictionTokens int?
When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.
no setterinherited
audioTokens int?
Audio input tokens generated by the model.
no setterinherited
copyWith → $CompletionTokensDetailsCopyWith<CompletionTokensDetails>
Create a copy of CompletionTokensDetails with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
reasoningTokens int?
Tokens generated by the model for reasoning.
no setterinherited
rejectedPredictionTokens int?
When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this CompletionTokensDetails to a JSON map.
inherited
toMap() Map<String, dynamic>
Map representation of object (not serialized)
toString() String
A string representation of this object.
inherited
validateSchema() String?
Perform validations on the schema property values

Operators

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

Constants

propertyNames → const List<String>
List of all property names of schema