Class OllamaEmbeddingUsage
java.lang.Object
org.springframework.ai.ollama.metadata.OllamaEmbeddingUsage
- All Implemented Interfaces:
Usage
Usage
implementation for Ollama embeddings.- Author:
- Christian Tzolov
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OllamaEmbeddingUsage
from
(OllamaApi.EmbeddingsResponse response) 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.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
-
Field Details
-
AI_USAGE_STRING
- See Also:
-
-
Constructor Details
-
OllamaEmbeddingUsage
-
-
Method Details
-
from
-
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
-