Record Class AiUsage
java.lang.Object
java.lang.Record
com.shaft.pilot.ai.AiUsage
- Record Components:
inputTokens- input tokens, or zero when unavailableoutputTokens- output tokens, or zero when unavailablecostUsd- cost in USD, ornullwhen unavailable
Provider-reported usage metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionAiUsage(long inputTokens, long outputTokens, BigDecimal costUsd) Creates an instance of aAiUsagerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncostUsd()Returns the value of thecostUsdrecord component.static AiUsageempty()Returns empty usage metadata.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theinputTokensrecord component.longReturns the value of theoutputTokensrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AiUsage
Creates an instance of aAiUsagerecord class.- Parameters:
inputTokens- the value for theinputTokensrecord componentoutputTokens- the value for theoutputTokensrecord componentcostUsd- the value for thecostUsdrecord component
-
-
Method Details
-
empty
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
inputTokens
public long inputTokens()Returns the value of theinputTokensrecord component.- Returns:
- the value of the
inputTokensrecord component
-
outputTokens
public long outputTokens()Returns the value of theoutputTokensrecord component.- Returns:
- the value of the
outputTokensrecord component
-
costUsd
-