Class UsageCalculator
java.lang.Object
org.springframework.ai.support.UsageCalculator
-
Method Summary
Modifier and TypeMethodDescriptionstatic UsagegetCumulativeUsage(Usage currentUsage, ChatResponse previousChatResponse) Accumulate usage tokens from the previous chat response to the current usage tokens.static booleanCheck if theUsageis empty.
-
Method Details
-
getCumulativeUsage
Accumulate usage tokens from the previous chat response to the current usage tokens.- Parameters:
currentUsage- the current usage.previousChatResponse- the previous chat response.- Returns:
- accumulated usage.
-
isEmpty
-