Class CompletionUsage
-
- All Implemented Interfaces:
public final class CompletionUsage
Usage statistics for the completion request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
CompletionUsage.Builder
A builder for CompletionUsage.
public final class
CompletionUsage.CompletionTokensDetails
Breakdown of tokens used in a completion.
public final class
CompletionUsage.PromptTokensDetails
Breakdown of tokens used in the prompt.
-
Method Summary
-
-
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()
-
builder
final static CompletionUsage.Builder builder()
Returns a mutable builder for constructing an instance of CompletionUsage.
The following fields are required:
.completionTokens() .promptTokens() .totalTokens()
-
-
-
-