Package com.sap.ai.sdk.orchestration.model

# 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 Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `TokenUsageCompletionTokensDetails()`
  Default constructor for TokenUsageCompletionTokensDetails.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TokenUsageCompletionTokensDetails`
  `acceptedPredictionTokens(Integer acceptedPredictionTokens)`
  Set the acceptedPredictionTokens of this `TokenUsageCompletionTokensDetails` instance and return the same instance.
  `TokenUsageCompletionTokensDetails`
  `audioTokens(Integer audioTokens)`
  Set the audioTokens of this `TokenUsageCompletionTokensDetails` instance and return the same instance.
  `static TokenUsageCompletionTokensDetails`
  `create()`
  Create a new `TokenUsageCompletionTokensDetails` instance.
  `boolean`
  `equals(Object o)`
  `Integer`
  `getAcceptedPredictionTokens()`
  When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.
  `Integer`
  `getAudioTokens()`
  Audio input tokens generated by the model.
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `TokenUsageCompletionTokensDetails`.
  `Integer`
  `getReasoningTokens()`
  Tokens generated by the model for reasoning.
  `Integer`
  `getRejectedPredictionTokens()`
  When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion.
  `int`
  `hashCode()`
  `TokenUsageCompletionTokensDetails`
  `reasoningTokens(Integer reasoningTokens)`
  Set the reasoningTokens of this `TokenUsageCompletionTokensDetails` instance and return the same instance.
  `TokenUsageCompletionTokensDetails`
  `rejectedPredictionTokens(Integer rejectedPredictionTokens)`
  Set the rejectedPredictionTokens of this `TokenUsageCompletionTokensDetails` instance and return the same instance.
  `void`
  `setAcceptedPredictionTokens(Integer acceptedPredictionTokens)`
  Set the acceptedPredictionTokens of this `TokenUsageCompletionTokensDetails` instance.
  `void`
  `setAudioTokens(Integer audioTokens)`
  Set the audioTokens of this `TokenUsageCompletionTokensDetails` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `TokenUsageCompletionTokensDetails` instance.
  `void`
  `setReasoningTokens(Integer reasoningTokens)`
  Set the reasoningTokens of this `TokenUsageCompletionTokensDetails` instance.
  `void`
  `setRejectedPredictionTokens(Integer rejectedPredictionTokens)`
  Set the rejectedPredictionTokens of this `TokenUsageCompletionTokensDetails` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `TokenUsageCompletionTokensDetails` instance including unrecognized properties.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 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.