Class TokenUsageCompletionTokensDetails

java.lang.Object
com.sap.ai.sdk.orchestration.model.TokenUsageCompletionTokensDetails

public class TokenUsageCompletionTokensDetails extends Object
Breakdown of tokens used in a completion.
  • Constructor Details

    • TokenUsageCompletionTokensDetails

      protected TokenUsageCompletionTokensDetails()
      Default constructor for TokenUsageCompletionTokensDetails.
  • Method Details

    • acceptedPredictionTokens

      @Nonnull public TokenUsageCompletionTokensDetails acceptedPredictionTokens(@Nullable Integer acceptedPredictionTokens)
      Set the acceptedPredictionTokens of this TokenUsageCompletionTokensDetails instance 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 TokenUsageCompletionTokensDetails class
    • getAcceptedPredictionTokens

      @Nonnull public Integer getAcceptedPredictionTokens()
      When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.
      Returns:
      acceptedPredictionTokens The acceptedPredictionTokens of this TokenUsageCompletionTokensDetails instance.
    • setAcceptedPredictionTokens

      public void setAcceptedPredictionTokens(@Nullable Integer acceptedPredictionTokens)
      Set the acceptedPredictionTokens of this TokenUsageCompletionTokensDetails instance.
      Parameters:
      acceptedPredictionTokens - When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.
    • audioTokens

      @Nonnull public TokenUsageCompletionTokensDetails audioTokens(@Nullable Integer audioTokens)
      Set the audioTokens of this TokenUsageCompletionTokensDetails instance and return the same instance.
      Parameters:
      audioTokens - Audio input tokens generated by the model.
      Returns:
      The same instance of this TokenUsageCompletionTokensDetails class
    • getAudioTokens

      @Nonnull public Integer getAudioTokens()
      Audio input tokens generated by the model.
      Returns:
      audioTokens The audioTokens of this TokenUsageCompletionTokensDetails instance.
    • setAudioTokens

      public void setAudioTokens(@Nullable Integer audioTokens)
      Set the audioTokens of this TokenUsageCompletionTokensDetails instance.
      Parameters:
      audioTokens - Audio input tokens generated by the model.
    • reasoningTokens

      @Nonnull public TokenUsageCompletionTokensDetails reasoningTokens(@Nullable Integer reasoningTokens)
      Set the reasoningTokens of this TokenUsageCompletionTokensDetails instance and return the same instance.
      Parameters:
      reasoningTokens - Tokens generated by the model for reasoning.
      Returns:
      The same instance of this TokenUsageCompletionTokensDetails class
    • getReasoningTokens

      @Nonnull public Integer getReasoningTokens()
      Tokens generated by the model for reasoning.
      Returns:
      reasoningTokens The reasoningTokens of this TokenUsageCompletionTokensDetails instance.
    • setReasoningTokens

      public void setReasoningTokens(@Nullable Integer reasoningTokens)
      Set the reasoningTokens of this TokenUsageCompletionTokensDetails instance.
      Parameters:
      reasoningTokens - Tokens generated by the model for reasoning.
    • rejectedPredictionTokens

      @Nonnull public TokenUsageCompletionTokensDetails rejectedPredictionTokens(@Nullable Integer rejectedPredictionTokens)
      Set the rejectedPredictionTokens of this TokenUsageCompletionTokensDetails instance 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 TokenUsageCompletionTokensDetails class
    • getRejectedPredictionTokens

      @Nonnull public Integer 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 TokenUsageCompletionTokensDetails instance.
    • setRejectedPredictionTokens

      public void setRejectedPredictionTokens(@Nullable Integer rejectedPredictionTokens)
      Set the rejectedPredictionTokens of this TokenUsageCompletionTokensDetails 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.
    • getCustomFieldNames

      @Nonnull public Set<String> getCustomFieldNames()
      Get the names of the unrecognizable properties of the TokenUsageCompletionTokensDetails.
      Returns:
      The set of properties names
    • getCustomField

      @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
      Deprecated.
      Use toMap() instead.
      Get the value of an unrecognizable property of this TokenUsageCompletionTokensDetails instance.
      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

      @Nonnull public Map<String,Object> toMap()
      Get the value of all properties of this TokenUsageCompletionTokensDetails instance including unrecognized properties.
      Returns:
      The map of all properties
    • setCustomField

      public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
      Set an unrecognizable property of this TokenUsageCompletionTokensDetails instance. 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 property
      customFieldValue - The value of the property
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • create

      public static TokenUsageCompletionTokensDetails create()
      Create a new TokenUsageCompletionTokensDetails instance. No arguments are required.