Class CompletionUsage.Builder
-
- All Implemented Interfaces:
public final class CompletionUsage.Builder
A builder for CompletionUsage.
-
-
Method Summary
-
-
Method Detail
-
completionTokens
final CompletionUsage.Builder completionTokens(Long completionTokens)
Number of tokens in the generated completion.
-
completionTokens
final CompletionUsage.Builder completionTokens(JsonField<Long> completionTokens)
Sets Builder.completionTokens to an arbitrary JSON value.
You should usually call Builder.completionTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
promptTokens
final CompletionUsage.Builder promptTokens(Long promptTokens)
Number of tokens in the prompt.
-
promptTokens
final CompletionUsage.Builder promptTokens(JsonField<Long> promptTokens)
Sets Builder.promptTokens to an arbitrary JSON value.
You should usually call Builder.promptTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
totalTokens
final CompletionUsage.Builder totalTokens(Long totalTokens)
Total number of tokens used in the request (prompt + completion).
-
totalTokens
final CompletionUsage.Builder totalTokens(JsonField<Long> totalTokens)
Sets Builder.totalTokens to an arbitrary JSON value.
You should usually call Builder.totalTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
completionTokensDetails
final CompletionUsage.Builder completionTokensDetails(CompletionUsage.CompletionTokensDetails completionTokensDetails)
Breakdown of tokens used in a completion.
-
completionTokensDetails
final CompletionUsage.Builder completionTokensDetails(JsonField<CompletionUsage.CompletionTokensDetails> completionTokensDetails)
Sets Builder.completionTokensDetails to an arbitrary JSON value.
You should usually call Builder.completionTokensDetails with a well-typed CompletionTokensDetails value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
promptTokensDetails
final CompletionUsage.Builder promptTokensDetails(CompletionUsage.PromptTokensDetails promptTokensDetails)
Breakdown of tokens used in the prompt.
-
promptTokensDetails
final CompletionUsage.Builder promptTokensDetails(JsonField<CompletionUsage.PromptTokensDetails> promptTokensDetails)
Sets Builder.promptTokensDetails to an arbitrary JSON value.
You should usually call Builder.promptTokensDetails with a well-typed PromptTokensDetails value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final CompletionUsage.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final CompletionUsage.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final CompletionUsage.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final CompletionUsage.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final CompletionUsage.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final CompletionUsage build()
Returns an immutable instance of CompletionUsage.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.completionTokens() .promptTokens() .totalTokens()
-
-
-
-