Class CompletionUsage
-
- All Implemented Interfaces:
public final class CompletionUsageUsage statistics for the completion request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classCompletionUsage.BuilderA builder for CompletionUsage.
public final classCompletionUsage.CompletionTokensDetailsBreakdown of tokens used in a completion.
public final classCompletionUsage.PromptTokensDetailsBreakdown of tokens used in the prompt.
-
Method Summary
Modifier and Type Method Description final LongcompletionTokens()Number of tokens in the generated completion. final LongpromptTokens()Number of tokens in the prompt. final LongtotalTokens()Total number of tokens used in the request (prompt + completion). final Optional<CompletionUsage.CompletionTokensDetails>completionTokensDetails()Breakdown of tokens used in a completion. final Optional<CompletionUsage.PromptTokensDetails>promptTokensDetails()Breakdown of tokens used in the prompt. final JsonField<Long>_completionTokens()Returns the raw JSON value of completionTokens. final JsonField<Long>_promptTokens()Returns the raw JSON value of promptTokens. final JsonField<Long>_totalTokens()Returns the raw JSON value of totalTokens. final JsonField<CompletionUsage.CompletionTokensDetails>_completionTokensDetails()Returns the raw JSON value of completionTokensDetails. final JsonField<CompletionUsage.PromptTokensDetails>_promptTokensDetails()Returns the raw JSON value of promptTokensDetails. final Map<String, JsonValue>_additionalProperties()final CompletionUsage.BuildertoBuilder()final CompletionUsagevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static CompletionUsage.Builderbuilder()Returns a mutable builder for constructing an instance of CompletionUsage. -
-
Method Detail
-
completionTokens
final Long completionTokens()
Number of tokens in the generated completion.
-
promptTokens
final Long promptTokens()
Number of tokens in the prompt.
-
totalTokens
final Long totalTokens()
Total number of tokens used in the request (prompt + completion).
-
completionTokensDetails
final Optional<CompletionUsage.CompletionTokensDetails> completionTokensDetails()
Breakdown of tokens used in a completion.
-
promptTokensDetails
final Optional<CompletionUsage.PromptTokensDetails> promptTokensDetails()
Breakdown of tokens used in the prompt.
-
_completionTokens
final JsonField<Long> _completionTokens()
Returns the raw JSON value of completionTokens.
Unlike completionTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_promptTokens
final JsonField<Long> _promptTokens()
Returns the raw JSON value of promptTokens.
Unlike promptTokens, 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.
-
_completionTokensDetails
final JsonField<CompletionUsage.CompletionTokensDetails> _completionTokensDetails()
Returns the raw JSON value of completionTokensDetails.
Unlike completionTokensDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_promptTokensDetails
final JsonField<CompletionUsage.PromptTokensDetails> _promptTokensDetails()
Returns the raw JSON value of promptTokensDetails.
Unlike promptTokensDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final CompletionUsage.Builder toBuilder()
-
validate
final CompletionUsage validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static CompletionUsage.Builder builder()
Returns a mutable builder for constructing an instance of CompletionUsage.
The following fields are required:
.completionTokens() .promptTokens() .totalTokens()
-
-
-
-