Class ResponseUsage
-
- All Implemented Interfaces:
public final class ResponseUsage
Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ResponseUsage.Builder
A builder for ResponseUsage.
public final class
ResponseUsage.InputTokensDetails
A detailed breakdown of the input tokens.
public final class
ResponseUsage.OutputTokensDetails
A detailed breakdown of the output tokens.
-
Method Summary
Modifier and Type Method Description final Long
inputTokens()
The number of input tokens. final ResponseUsage.InputTokensDetails
inputTokensDetails()
A detailed breakdown of the input tokens. final Long
outputTokens()
The number of output tokens. final ResponseUsage.OutputTokensDetails
outputTokensDetails()
A detailed breakdown of the output tokens. final Long
totalTokens()
The total number of tokens used. final JsonField<Long>
_inputTokens()
Returns the raw JSON value of inputTokens. final JsonField<ResponseUsage.InputTokensDetails>
_inputTokensDetails()
Returns the raw JSON value of inputTokensDetails. final JsonField<Long>
_outputTokens()
Returns the raw JSON value of outputTokens. final JsonField<ResponseUsage.OutputTokensDetails>
_outputTokensDetails()
Returns the raw JSON value of outputTokensDetails. final JsonField<Long>
_totalTokens()
Returns the raw JSON value of totalTokens. final Map<String, JsonValue>
_additionalProperties()
final ResponseUsage.Builder
toBuilder()
final ResponseUsage
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ResponseUsage.Builder
builder()
Returns a mutable builder for constructing an instance of ResponseUsage. -
-
Method Detail
-
inputTokens
final Long inputTokens()
The number of input tokens.
-
inputTokensDetails
final ResponseUsage.InputTokensDetails inputTokensDetails()
A detailed breakdown of the input tokens.
-
outputTokens
final Long outputTokens()
The number of output tokens.
-
outputTokensDetails
final ResponseUsage.OutputTokensDetails outputTokensDetails()
A detailed breakdown of the output tokens.
-
totalTokens
final Long totalTokens()
The total number of tokens used.
-
_inputTokens
final JsonField<Long> _inputTokens()
Returns the raw JSON value of inputTokens.
Unlike inputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_inputTokensDetails
final JsonField<ResponseUsage.InputTokensDetails> _inputTokensDetails()
Returns the raw JSON value of inputTokensDetails.
Unlike inputTokensDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_outputTokens
final JsonField<Long> _outputTokens()
Returns the raw JSON value of outputTokens.
Unlike outputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_outputTokensDetails
final JsonField<ResponseUsage.OutputTokensDetails> _outputTokensDetails()
Returns the raw JSON value of outputTokensDetails.
Unlike outputTokensDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_totalTokens
final JsonField<Long> _totalTokens()
Returns the raw JSON value of totalTokens.
Unlike totalTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ResponseUsage.Builder toBuilder()
-
validate
final ResponseUsage validate()
-
builder
final static ResponseUsage.Builder builder()
Returns a mutable builder for constructing an instance of ResponseUsage.
The following fields are required:
.inputTokens() .inputTokensDetails() .outputTokens() .outputTokensDetails() .totalTokens()
-
-
-
-