Record Class DashScopeApiSpec.TokenUsage

java.lang.Object
java.lang.Record
com.alibaba.cloud.ai.dashscope.spec.DashScopeApiSpec.TokenUsage
Record Components:
outputTokens - Number of tokens in the generated completion. Only applicable for completion requests.
inputTokens - Number of tokens in the prompt.
totalTokens - Total number of tokens used in the request (prompt + completion).
Enclosing class:
DashScopeApiSpec

public static record DashScopeApiSpec.TokenUsage(Integer outputTokens, Integer inputTokens, Integer totalTokens, Integer imageTokens, Integer videoTokens, Integer audioTokens, Integer seconds, DashScopeApiSpec.InputTokenDetailed inputTokensDetails, DashScopeApiSpec.OutputTokenDetailed outputTokensDetails, DashScopeApiSpec.PromptTokenDetailed promptTokenDetailed) extends Record
Usage statistics for the completion request.
  • Constructor Details

    • TokenUsage

      public TokenUsage(Integer outputTokens, Integer inputTokens, Integer totalTokens, Integer imageTokens, Integer videoTokens, Integer audioTokens, Integer seconds, DashScopeApiSpec.InputTokenDetailed inputTokensDetails, DashScopeApiSpec.OutputTokenDetailed outputTokensDetails, DashScopeApiSpec.PromptTokenDetailed promptTokenDetailed)
      Creates an instance of a TokenUsage record class.
      Parameters:
      outputTokens - the value for the outputTokens record component
      inputTokens - the value for the inputTokens record component
      totalTokens - the value for the totalTokens record component
      imageTokens - the value for the imageTokens record component
      videoTokens - the value for the videoTokens record component
      audioTokens - the value for the audioTokens record component
      seconds - the value for the seconds record component
      inputTokensDetails - the value for the inputTokensDetails record component
      outputTokensDetails - the value for the outputTokensDetails record component
      promptTokenDetailed - the value for the promptTokenDetailed record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • outputTokens

      public Integer outputTokens()
      Returns the value of the outputTokens record component.
      Returns:
      the value of the outputTokens record component
    • inputTokens

      public Integer inputTokens()
      Returns the value of the inputTokens record component.
      Returns:
      the value of the inputTokens record component
    • totalTokens

      public Integer totalTokens()
      Returns the value of the totalTokens record component.
      Returns:
      the value of the totalTokens record component
    • imageTokens

      public Integer imageTokens()
      Returns the value of the imageTokens record component.
      Returns:
      the value of the imageTokens record component
    • videoTokens

      public Integer videoTokens()
      Returns the value of the videoTokens record component.
      Returns:
      the value of the videoTokens record component
    • audioTokens

      public Integer audioTokens()
      Returns the value of the audioTokens record component.
      Returns:
      the value of the audioTokens record component
    • seconds

      public Integer seconds()
      Returns the value of the seconds record component.
      Returns:
      the value of the seconds record component
    • inputTokensDetails

      public DashScopeApiSpec.InputTokenDetailed inputTokensDetails()
      Returns the value of the inputTokensDetails record component.
      Returns:
      the value of the inputTokensDetails record component
    • outputTokensDetails

      public DashScopeApiSpec.OutputTokenDetailed outputTokensDetails()
      Returns the value of the outputTokensDetails record component.
      Returns:
      the value of the outputTokensDetails record component
    • promptTokenDetailed

      public DashScopeApiSpec.PromptTokenDetailed promptTokenDetailed()
      Returns the value of the promptTokenDetailed record component.
      Returns:
      the value of the promptTokenDetailed record component