Class CachedContent

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

public abstract class CachedContent extends JsonSerializable
A resource used in LLM queries for users to explicitly specify what to cache.
  • Constructor Details

    • CachedContent

      public CachedContent()
  • Method Details

    • name

      public abstract Optional<String> name()
      The server-generated resource name of the cached content.
    • displayName

      public abstract Optional<String> displayName()
      The user-generated meaningful display name of the cached content.
    • model

      public abstract Optional<String> model()
      The name of the publisher model to use for cached content.
    • createTime

      public abstract Optional<Instant> createTime()
      Creation time of the cache entry.
    • updateTime

      public abstract Optional<Instant> updateTime()
      When the cache entry was last updated in UTC time.
    • expireTime

      public abstract Optional<Instant> expireTime()
      Expiration time of the cached content.
    • usageMetadata

      public abstract Optional<CachedContentUsageMetadata> usageMetadata()
      Metadata on the usage of the cached content.
    • builder

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

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

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