Class CachedContentUsageMetadata

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.CachedContentUsageMetadata

public abstract class CachedContentUsageMetadata extends JsonSerializable
Metadata on the usage of the cached content.
  • Constructor Details

    • CachedContentUsageMetadata

      public CachedContentUsageMetadata()
  • Method Details

    • audioDurationSeconds

      public abstract Optional<Integer> audioDurationSeconds()
      Duration of audio in seconds.
    • imageCount

      public abstract Optional<Integer> imageCount()
      Number of images.
    • textCount

      public abstract Optional<Integer> textCount()
      Number of text characters.
    • totalTokenCount

      public abstract Optional<Integer> totalTokenCount()
      Total number of tokens that the cached content consumes.
    • videoDurationSeconds

      public abstract Optional<Integer> videoDurationSeconds()
      Duration of video in seconds.
    • builder

      public static CachedContentUsageMetadata.Builder builder()
      Instantiates a builder for CachedContentUsageMetadata.
    • toBuilder

      public abstract CachedContentUsageMetadata.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static CachedContentUsageMetadata fromJson(String jsonString)
      Deserializes a JSON string to a CachedContentUsageMetadata object.