Class TokenUsageCompletionTokensDetails
java.lang.Object
com.sap.ai.sdk.orchestration.model.TokenUsageCompletionTokensDetails
Breakdown of tokens used in a completion.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for TokenUsageCompletionTokensDetails. -
Method Summary
Modifier and TypeMethodDescriptionacceptedPredictionTokens(Integer acceptedPredictionTokens) Set the acceptedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.audioTokens(Integer audioTokens) Set the audioTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.create()Create a newTokenUsageCompletionTokensDetailsinstance.booleanWhen using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.Audio input tokens generated by the model.getCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theTokenUsageCompletionTokensDetails.Tokens generated by the model for reasoning.When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion.inthashCode()reasoningTokens(Integer reasoningTokens) Set the reasoningTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.rejectedPredictionTokens(Integer rejectedPredictionTokens) Set the rejectedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.voidsetAcceptedPredictionTokens(Integer acceptedPredictionTokens) Set the acceptedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance.voidsetAudioTokens(Integer audioTokens) Set the audioTokens of thisTokenUsageCompletionTokensDetailsinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisTokenUsageCompletionTokensDetailsinstance.voidsetReasoningTokens(Integer reasoningTokens) Set the reasoningTokens of thisTokenUsageCompletionTokensDetailsinstance.voidsetRejectedPredictionTokens(Integer rejectedPredictionTokens) Set the rejectedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance.toMap()Get the value of all properties of thisTokenUsageCompletionTokensDetailsinstance including unrecognized properties.toString()
-
Constructor Details
-
TokenUsageCompletionTokensDetails
protected TokenUsageCompletionTokensDetails()Default constructor for TokenUsageCompletionTokensDetails.
-
-
Method Details
-
acceptedPredictionTokens
@Nonnull public TokenUsageCompletionTokensDetails acceptedPredictionTokens(@Nullable Integer acceptedPredictionTokens) Set the acceptedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.- Parameters:
acceptedPredictionTokens- When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.- Returns:
- The same instance of this
TokenUsageCompletionTokensDetailsclass
-
getAcceptedPredictionTokens
When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.- Returns:
- acceptedPredictionTokens The acceptedPredictionTokens of this
TokenUsageCompletionTokensDetailsinstance.
-
setAcceptedPredictionTokens
Set the acceptedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance.- Parameters:
acceptedPredictionTokens- When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.
-
audioTokens
Set the audioTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.- Parameters:
audioTokens- Audio input tokens generated by the model.- Returns:
- The same instance of this
TokenUsageCompletionTokensDetailsclass
-
getAudioTokens
Audio input tokens generated by the model.- Returns:
- audioTokens The audioTokens of this
TokenUsageCompletionTokensDetailsinstance.
-
setAudioTokens
Set the audioTokens of thisTokenUsageCompletionTokensDetailsinstance.- Parameters:
audioTokens- Audio input tokens generated by the model.
-
reasoningTokens
@Nonnull public TokenUsageCompletionTokensDetails reasoningTokens(@Nullable Integer reasoningTokens) Set the reasoningTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.- Parameters:
reasoningTokens- Tokens generated by the model for reasoning.- Returns:
- The same instance of this
TokenUsageCompletionTokensDetailsclass
-
getReasoningTokens
Tokens generated by the model for reasoning.- Returns:
- reasoningTokens The reasoningTokens of this
TokenUsageCompletionTokensDetailsinstance.
-
setReasoningTokens
Set the reasoningTokens of thisTokenUsageCompletionTokensDetailsinstance.- Parameters:
reasoningTokens- Tokens generated by the model for reasoning.
-
rejectedPredictionTokens
@Nonnull public TokenUsageCompletionTokensDetails rejectedPredictionTokens(@Nullable Integer rejectedPredictionTokens) Set the rejectedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance and return the same instance.- Parameters:
rejectedPredictionTokens- When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.- Returns:
- The same instance of this
TokenUsageCompletionTokensDetailsclass
-
getRejectedPredictionTokens
When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.- Returns:
- rejectedPredictionTokens The rejectedPredictionTokens of this
TokenUsageCompletionTokensDetailsinstance.
-
setRejectedPredictionTokens
Set the rejectedPredictionTokens of thisTokenUsageCompletionTokensDetailsinstance.- Parameters:
rejectedPredictionTokens- When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.
-
getCustomFieldNames
Get the names of the unrecognizable properties of theTokenUsageCompletionTokensDetails.- Returns:
- The set of properties names
-
getCustomField
@Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException Deprecated.UsetoMap()instead.Get the value of an unrecognizable property of thisTokenUsageCompletionTokensDetailsinstance.- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
NoSuchElementException- If no property with the given name could be found.
-
toMap
Get the value of all properties of thisTokenUsageCompletionTokensDetailsinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisTokenUsageCompletionTokensDetailsinstance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
customFieldName- The name of the propertycustomFieldValue- The value of the property
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Create a newTokenUsageCompletionTokensDetailsinstance. No arguments are required.
-
toMap()instead.