Package com.google.genai.types
Class CachedContent
-
- All Implemented Interfaces:
public abstract class CachedContent extends JsonSerializable
A resource used in LLM queries for users to explicitly specify what to cache.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classCachedContent.BuilderBuilder for CachedContent.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description CachedContent()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>name()The server-generated resource name of the cached content. abstract Optional<String>displayName()The user-generated meaningful display name of the cached content. abstract Optional<String>model()The name of the publisher model to use for cached content. abstract Optional<Instant>createTime()Creation time of the cache entry. abstract Optional<Instant>updateTime()When the cache entry was last updated in UTC time. abstract Optional<Instant>expireTime()Expiration time of the cached content. abstract Optional<CachedContentUsageMetadata>usageMetadata()Metadata on the usage of the cached content. static CachedContent.Builderbuilder()Instantiates a builder for CachedContent. abstract CachedContent.BuildertoBuilder()Creates a builder with the same values as this instance. static CachedContentfromJson(String jsonString)Deserializes a JSON string to a CachedContent object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
displayName
abstract Optional<String> displayName()
The user-generated meaningful display name of the cached content.
-
createTime
abstract Optional<Instant> createTime()
Creation time of the cache entry.
-
updateTime
abstract Optional<Instant> updateTime()
When the cache entry was last updated in UTC time.
-
expireTime
abstract Optional<Instant> expireTime()
Expiration time of the cached content.
-
usageMetadata
abstract Optional<CachedContentUsageMetadata> usageMetadata()
Metadata on the usage of the cached content.
-
builder
static CachedContent.Builder builder()
Instantiates a builder for CachedContent.
-
toBuilder
abstract CachedContent.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static CachedContent fromJson(String jsonString)
Deserializes a JSON string to a CachedContent object.
-
-
-
-