Package ai.optfor.springopenaiapi.model
Record Class Usage
java.lang.Object
java.lang.Record
ai.optfor.springopenaiapi.model.Usage
-
Constructor Summary
ConstructorsConstructorDescriptionUsage(int prompt_tokens, int completion_tokens, int total_tokens) Creates an instance of aUsagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecompletion_tokensrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theprompt_tokensrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotal_tokensrecord component.
-
Constructor Details
-
Usage
public Usage(int prompt_tokens, int completion_tokens, int total_tokens) Creates an instance of aUsagerecord class.- Parameters:
prompt_tokens- the value for theprompt_tokensrecord componentcompletion_tokens- the value for thecompletion_tokensrecord componenttotal_tokens- the value for thetotal_tokensrecord 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 with '=='. -
prompt_tokens
public int prompt_tokens()Returns the value of theprompt_tokensrecord component.- Returns:
- the value of the
prompt_tokensrecord component
-
completion_tokens
public int completion_tokens()Returns the value of thecompletion_tokensrecord component.- Returns:
- the value of the
completion_tokensrecord component
-
total_tokens
public int total_tokens()Returns the value of thetotal_tokensrecord component.- Returns:
- the value of the
total_tokensrecord component
-