Class ResponseUsage
-
- All Implemented Interfaces:
public final class ResponseUsageRepresents 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 classResponseUsage.BuilderA builder for ResponseUsage.
public final classResponseUsage.InputTokensDetailsA detailed breakdown of the input tokens.
public final classResponseUsage.OutputTokensDetailsA detailed breakdown of the output tokens.
-
Method Summary
Modifier and Type Method Description final LonginputTokens()The number of input tokens. final ResponseUsage.InputTokensDetailsinputTokensDetails()A detailed breakdown of the input tokens. final LongoutputTokens()The number of output tokens. final ResponseUsage.OutputTokensDetailsoutputTokensDetails()A detailed breakdown of the output tokens. final LongtotalTokens()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.BuildertoBuilder()final ResponseUsagevalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseUsage.Builderbuilder()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()
-
-
-
-