Class VertexAiUsage
java.lang.Object
org.springframework.ai.vertexai.gemini.metadata.VertexAiUsage
- All Implemented Interfaces:
Usage
Represents the usage of a Vertex AI model.
- Since:
- 0.8.1
- Author:
- Christian Tzolov
-
Constructor Summary
ConstructorDescriptionVertexAiUsage
(com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata usageMetadata) -
Method Summary
Modifier and TypeMethodDescriptionReturns the number of tokens returned in the generation (aka completion) of the AI's 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
getTotalTokens
-
Constructor Details
-
VertexAiUsage
public VertexAiUsage(com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata usageMetadata)
-
-
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
Long
with the number of tokens used in the prompt of the AI request. - See Also:
-
getGenerationTokens
Description copied from interface:Usage
Returns the number of tokens returned in the generation (aka completion) of the AI's response.- Specified by:
getGenerationTokens
in interfaceUsage
- Returns:
- an
Long
with the number of tokens returned in the generation (aka completion) of the AI's response. - See Also:
-