Package com.tnsai.llm.routing
Record Class CostBasedRouter.CostStats
java.lang.Object
java.lang.Record
com.tnsai.llm.routing.CostBasedRouter.CostStats
- Enclosing class:
CostBasedRouter
public static record CostBasedRouter.CostStats(double totalEstimatedCost, Map<String,Double> costPerProvider, long totalInputTokens, long totalOutputTokens)
extends Record
Cost statistics.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecostPerProviderrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.doubleReturns the value of thetotalEstimatedCostrecord component.longReturns the value of thetotalInputTokensrecord component.longReturns the value of thetotalOutputTokensrecord component.
-
Constructor Details
-
CostStats
public CostStats(double totalEstimatedCost, Map<String, Double> costPerProvider, long totalInputTokens, long totalOutputTokens) Creates an instance of aCostStatsrecord class.- Parameters:
totalEstimatedCost- the value for thetotalEstimatedCostrecord componentcostPerProvider- the value for thecostPerProviderrecord componenttotalInputTokens- the value for thetotalInputTokensrecord componenttotalOutputTokens- the value for thetotalOutputTokensrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
totalEstimatedCost
public double totalEstimatedCost()Returns the value of thetotalEstimatedCostrecord component.- Returns:
- the value of the
totalEstimatedCostrecord component
-
costPerProvider
Returns the value of thecostPerProviderrecord component.- Returns:
- the value of the
costPerProviderrecord component
-
totalInputTokens
public long totalInputTokens()Returns the value of thetotalInputTokensrecord component.- Returns:
- the value of the
totalInputTokensrecord component
-
totalOutputTokens
public long totalOutputTokens()Returns the value of thetotalOutputTokensrecord component.- Returns:
- the value of the
totalOutputTokensrecord component
-