Record Class OpenAiApi.Usage.CompletionTokenDetails
java.lang.Object
java.lang.Record
org.springframework.ai.openai.api.OpenAiApi.Usage.CompletionTokenDetails
- Record Components:
reasoningTokens- Number of tokens generated by the model for reasoning.acceptedPredictionTokens- Number of tokens generated by the model for accepted predictions.audioTokens- Number of tokens generated by the model for audio.rejectedPredictionTokens- Number of tokens generated by the model for rejected predictions.
- Enclosing class:
- OpenAiApi.Usage
public static record OpenAiApi.Usage.CompletionTokenDetails(Integer reasoningTokens, Integer acceptedPredictionTokens, Integer audioTokens, Integer rejectedPredictionTokens)
extends Record
Breakdown of tokens used in a completion.
-
Constructor Summary
ConstructorsConstructorDescriptionCompletionTokenDetails(Integer reasoningTokens, Integer acceptedPredictionTokens, Integer audioTokens, Integer rejectedPredictionTokens) Creates an instance of aCompletionTokenDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacceptedPredictionTokensrecord component.Returns 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 thereasoningTokensrecord component.Returns the value of therejectedPredictionTokensrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompletionTokenDetails
public CompletionTokenDetails(Integer reasoningTokens, Integer acceptedPredictionTokens, Integer audioTokens, Integer rejectedPredictionTokens) Creates an instance of aCompletionTokenDetailsrecord class.- Parameters:
reasoningTokens- the value for thereasoningTokensrecord componentacceptedPredictionTokens- the value for theacceptedPredictionTokensrecord componentaudioTokens- the value for theaudioTokensrecord componentrejectedPredictionTokens- the value for therejectedPredictionTokensrecord 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). -
reasoningTokens
Returns the value of thereasoningTokensrecord component.- Returns:
- the value of the
reasoningTokensrecord component
-
acceptedPredictionTokens
Returns the value of theacceptedPredictionTokensrecord component.- Returns:
- the value of the
acceptedPredictionTokensrecord component
-
audioTokens
Returns the value of theaudioTokensrecord component.- Returns:
- the value of the
audioTokensrecord component
-
rejectedPredictionTokens
Returns the value of therejectedPredictionTokensrecord component.- Returns:
- the value of the
rejectedPredictionTokensrecord component
-