Class EmptyUsage
java.lang.Object
org.springframework.ai.chat.metadata.EmptyUsage
- All Implemented Interfaces:
Usage
-
Constructor Summary
Constructors -
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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Usage
getTotalTokens
-
Constructor Details
-
EmptyUsage
public EmptyUsage()
-
-
Method Details
-
getPromptTokens
Description copied from interface:UsageReturns the number of tokens used in the prompt of the AI request.- Specified by:
getPromptTokensin interfaceUsage- Returns:
- an
Integerwith the number of tokens used in the prompt of the AI request. - See Also:
-
getCompletionTokens
Description copied from interface:UsageReturns the number of tokens returned in the generation (aka completion) of the AI's response.- Specified by:
getCompletionTokensin interfaceUsage- Returns:
- an
Integerwith the number of tokens returned in the generation (aka completion) of the AI's response. - See Also:
-
getNativeUsage
Description copied from interface:UsageReturn the usage data from the underlying model API response.- Specified by:
getNativeUsagein interfaceUsage- Returns:
- the object of type inferred by the API response.
-