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

# Class TokenUsagePromptTokensDetails

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

public class TokenUsagePromptTokensDetails extends Object
Details of the prompt tokens.

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TokenUsagePromptTokensDetails`
  `audioTokens(Integer audioTokens)`
  Set the audioTokens of this `TokenUsagePromptTokensDetails` instance and return the same instance.
  `TokenUsagePromptTokensDetails`
  `cacheCreationTokenDetails(CacheCreationTokenDetails cacheCreationTokenDetails)`
  Set the cacheCreationTokenDetails of this `TokenUsagePromptTokensDetails` instance and return the same instance.
  `TokenUsagePromptTokensDetails`
  `cacheCreationTokens(Integer cacheCreationTokens)`
  Set the cacheCreationTokens of this `TokenUsagePromptTokensDetails` instance and return the same instance.
  `TokenUsagePromptTokensDetails`
  `cachedTokens(Integer cachedTokens)`
  Set the cachedTokens of this `TokenUsagePromptTokensDetails` instance and return the same instance.
  `static TokenUsagePromptTokensDetails`
  `create()`
  Create a new `TokenUsagePromptTokensDetails` instance.
  `boolean`
  `equals(Object o)`
  `Integer`
  `getAudioTokens()`
  Audio input tokens present in the prompt.
  `CacheCreationTokenDetails`
  `getCacheCreationTokenDetails()`
  Get cacheCreationTokenDetails
  `Integer`
  `getCacheCreationTokens()`
  Number of tokens written to the cache (Anthropic only).
  `Integer`
  `getCachedTokens()`
  Cached tokens present in the prompt.
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `TokenUsagePromptTokensDetails`.
  `int`
  `hashCode()`
  `void`
  `setAudioTokens(Integer audioTokens)`
  Set the audioTokens of this `TokenUsagePromptTokensDetails` instance.
  `void`
  `setCacheCreationTokenDetails(CacheCreationTokenDetails cacheCreationTokenDetails)`
  Set the cacheCreationTokenDetails of this `TokenUsagePromptTokensDetails` instance.
  `void`
  `setCacheCreationTokens(Integer cacheCreationTokens)`
  Set the cacheCreationTokens of this `TokenUsagePromptTokensDetails` instance.
  `void`
  `setCachedTokens(Integer cachedTokens)`
  Set the cachedTokens of this `TokenUsagePromptTokensDetails` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `TokenUsagePromptTokensDetails` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `TokenUsagePromptTokensDetails` instance including unrecognized properties.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### TokenUsagePromptTokensDetails

    protected TokenUsagePromptTokensDetails()
    Default constructor for TokenUsagePromptTokensDetails.

- ## Method Details

  - ### audioTokens

    @Nonnull public TokenUsagePromptTokensDetails audioTokens(@Nullable Integer audioTokens)
    Set the audioTokens of this `TokenUsagePromptTokensDetails` instance and return the same instance.
    Parameters:
      `audioTokens` - Audio input tokens present in the prompt.
    Returns:
      The same instance of this `TokenUsagePromptTokensDetails` class

  - ### getAudioTokens

    @Nonnull public Integer getAudioTokens()
    Audio input tokens present in the prompt.
    Returns:
      audioTokens The audioTokens of this `TokenUsagePromptTokensDetails` instance.

  - ### setAudioTokens

    public void setAudioTokens(@Nullable Integer audioTokens)
    Set the audioTokens of this `TokenUsagePromptTokensDetails` instance.
    Parameters:
      `audioTokens` - Audio input tokens present in the prompt.

  - ### cachedTokens

    @Nonnull public TokenUsagePromptTokensDetails cachedTokens(@Nullable Integer cachedTokens)
    Set the cachedTokens of this `TokenUsagePromptTokensDetails` instance and return the same instance.
    Parameters:
      `cachedTokens` - Cached tokens present in the prompt.
    Returns:
      The same instance of this `TokenUsagePromptTokensDetails` class

  - ### getCachedTokens

    @Nonnull public Integer getCachedTokens()
    Cached tokens present in the prompt.
    Returns:
      cachedTokens The cachedTokens of this `TokenUsagePromptTokensDetails` instance.

  - ### setCachedTokens

    public void setCachedTokens(@Nullable Integer cachedTokens)
    Set the cachedTokens of this `TokenUsagePromptTokensDetails` instance.
    Parameters:
      `cachedTokens` - Cached tokens present in the prompt.

  - ### cacheCreationTokens

    @Nonnull public TokenUsagePromptTokensDetails cacheCreationTokens(@Nullable Integer cacheCreationTokens)
    Set the cacheCreationTokens of this `TokenUsagePromptTokensDetails` instance and return the same instance.
    Parameters:
      `cacheCreationTokens` - Number of tokens written to the cache (Anthropic only).
    Returns:
      The same instance of this `TokenUsagePromptTokensDetails` class

  - ### getCacheCreationTokens

    @Nonnull public Integer getCacheCreationTokens()
    Number of tokens written to the cache (Anthropic only).
    Returns:
      cacheCreationTokens The cacheCreationTokens of this `TokenUsagePromptTokensDetails` instance.

  - ### setCacheCreationTokens

    public void setCacheCreationTokens(@Nullable Integer cacheCreationTokens)
    Set the cacheCreationTokens of this `TokenUsagePromptTokensDetails` instance.
    Parameters:
      `cacheCreationTokens` - Number of tokens written to the cache (Anthropic only).

  - ### cacheCreationTokenDetails

    @Nonnull public TokenUsagePromptTokensDetails cacheCreationTokenDetails(@Nullable CacheCreationTokenDetails cacheCreationTokenDetails)
    Set the cacheCreationTokenDetails of this `TokenUsagePromptTokensDetails` instance and return the same instance.
    Parameters:
      `cacheCreationTokenDetails` - The cacheCreationTokenDetails of this `TokenUsagePromptTokensDetails`
    Returns:
      The same instance of this `TokenUsagePromptTokensDetails` class

  - ### getCacheCreationTokenDetails

    @Nonnull public CacheCreationTokenDetails getCacheCreationTokenDetails()
    Get cacheCreationTokenDetails
    Returns:
      cacheCreationTokenDetails The cacheCreationTokenDetails of this `TokenUsagePromptTokensDetails` instance.

  - ### setCacheCreationTokenDetails

    public void setCacheCreationTokenDetails(@Nullable CacheCreationTokenDetails cacheCreationTokenDetails)
    Set the cacheCreationTokenDetails of this `TokenUsagePromptTokensDetails` instance.
    Parameters:
      `cacheCreationTokenDetails` - The cacheCreationTokenDetails of this `TokenUsagePromptTokensDetails`

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `TokenUsagePromptTokensDetails`.
    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 `TokenUsagePromptTokensDetails` 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 `TokenUsagePromptTokensDetails` 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 `TokenUsagePromptTokensDetails` 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 TokenUsagePromptTokensDetails create()
    Create a new `TokenUsagePromptTokensDetails` instance. No arguments are required.