Package org.springframework.ai.bedrock
Class BedrockUsage
java.lang.Object
org.springframework.ai.bedrock.BedrockUsage
- All Implemented Interfaces:
Usage
Usage
implementation for Bedrock API.- Since:
- 0.8.0
- Author:
- Christian Tzolov
-
Constructor Summary
ModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionstatic BedrockUsage
Returns 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.getUsage()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.ai.chat.metadata.Usage
getTotalTokens
-
Constructor Details
-
BedrockUsage
-
-
Method Details
-
from
-
getUsage
-
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:
-
toString
-