Class GoogleGenAiModalityTokenCount
java.lang.Object
org.springframework.ai.google.genai.metadata.GoogleGenAiModalityTokenCount
Represents token count information for a specific modality (text, image, audio, video).
- Since:
- 1.1.0
- Author:
- Dan Dobrin
-
Constructor Summary
ConstructorsConstructorDescriptionGoogleGenAiModalityTokenCount(String modality, Integer tokenCount) Creates a new modality token count instance. -
Method Summary
-
Constructor Details
-
GoogleGenAiModalityTokenCount
Creates a new modality token count instance.- Parameters:
modality- the modality type (e.g., "TEXT", "IMAGE", "AUDIO", "VIDEO")tokenCount- the number of tokens for this modality
-
-
Method Details
-
from
public static GoogleGenAiModalityTokenCount from(com.google.genai.types.ModalityTokenCount modalityTokenCount) Creates a GoogleGenAiModalityTokenCount from the SDK's ModalityTokenCount.- Parameters:
modalityTokenCount- the SDK modality token count- Returns:
- a new GoogleGenAiModalityTokenCount instance
-
getModality
Returns the modality type.- Returns:
- the modality type as a string
-
getTokenCount
Returns the token count for this modality.- Returns:
- the token count
-
toString
-