Class EmptyUsage
java.lang.Object
org.springframework.ai.chat.metadata.EmptyUsage
- All Implemented Interfaces:
Usage
A EmpytUsage implementation that returns zero for all property getters
- Since:
- 0.7.0
- Author:
- John Blum, Ilayaperumal Gopinathan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the number of tokens returned in the generation (aka completion) of the AI's response.Return the usage data from the underlying model API response.Returns the number of tokens used in the prompt of the AI request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.chat.metadata.Usage
getGenerationTokens, getTotalTokens
-
Constructor Details
-
EmptyUsage
public EmptyUsage()
-
-
Method Details
-
getPromptTokens
Description copied from interface:Usage
Returns the number of tokens used in the prompt of the AI request.- Specified by:
getPromptTokens
in interfaceUsage
- Returns:
- an
Integer
with the number of tokens used in the prompt of the AI request. - See Also:
-
getCompletionTokens
Description copied from interface:Usage
Returns the number of tokens returned in the generation (aka completion) of the AI's response.- Specified by:
getCompletionTokens
in interfaceUsage
- Returns:
- an
Integer
with the number of tokens returned in the generation (aka completion) of the AI's response. - See Also:
-
getNativeUsage
Description copied from interface:Usage
Return the usage data from the underlying model API response.- Specified by:
getNativeUsage
in interfaceUsage
- Returns:
- the object of type inferred by the API response.
-