Class GoogleGenAiModalityTokenCount

java.lang.Object
org.springframework.ai.google.genai.metadata.GoogleGenAiModalityTokenCount

public class GoogleGenAiModalityTokenCount extends Object
Represents token count information for a specific modality (text, image, audio, video).
Since:
1.1.0
Author:
Dan Dobrin
  • Constructor Details

    • GoogleGenAiModalityTokenCount

      public GoogleGenAiModalityTokenCount(String modality, Integer tokenCount)
      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

      public String getModality()
      Returns the modality type.
      Returns:
      the modality type as a string
    • getTokenCount

      public Integer getTokenCount()
      Returns the token count for this modality.
      Returns:
      the token count
    • toString

      public String toString()
      Overrides:
      toString in class Object