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 Summary
ConstructorsConstructorDescriptionTokenUsage(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 aTokenUsagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaudioTokensrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theimageTokensrecord component.Returns the value of theinputTokensrecord component.Returns the value of theinputTokensDetailsrecord component.Returns the value of theoutputTokensrecord component.Returns the value of theoutputTokensDetailsrecord component.Returns the value of thepromptTokenDetailedrecord component.seconds()Returns the value of thesecondsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetotalTokensrecord component.Returns the value of thevideoTokensrecord component.
-
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 aTokenUsagerecord class.- Parameters:
outputTokens- the value for theoutputTokensrecord componentinputTokens- the value for theinputTokensrecord componenttotalTokens- the value for thetotalTokensrecord componentimageTokens- the value for theimageTokensrecord componentvideoTokens- the value for thevideoTokensrecord componentaudioTokens- the value for theaudioTokensrecord componentseconds- the value for thesecondsrecord componentinputTokensDetails- the value for theinputTokensDetailsrecord componentoutputTokensDetails- the value for theoutputTokensDetailsrecord componentpromptTokenDetailed- the value for thepromptTokenDetailedrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
outputTokens
Returns the value of theoutputTokensrecord component.- Returns:
- the value of the
outputTokensrecord component
-
inputTokens
Returns the value of theinputTokensrecord component.- Returns:
- the value of the
inputTokensrecord component
-
totalTokens
Returns the value of thetotalTokensrecord component.- Returns:
- the value of the
totalTokensrecord component
-
imageTokens
Returns the value of theimageTokensrecord component.- Returns:
- the value of the
imageTokensrecord component
-
videoTokens
Returns the value of thevideoTokensrecord component.- Returns:
- the value of the
videoTokensrecord component
-
audioTokens
Returns the value of theaudioTokensrecord component.- Returns:
- the value of the
audioTokensrecord component
-
seconds
Returns the value of thesecondsrecord component.- Returns:
- the value of the
secondsrecord component
-
inputTokensDetails
Returns the value of theinputTokensDetailsrecord component.- Returns:
- the value of the
inputTokensDetailsrecord component
-
outputTokensDetails
Returns the value of theoutputTokensDetailsrecord component.- Returns:
- the value of the
outputTokensDetailsrecord component
-
promptTokenDetailed
Returns the value of thepromptTokenDetailedrecord component.- Returns:
- the value of the
promptTokenDetailedrecord component
-