Package com.google.adk.models
Class CacheMetadata
java.lang.Object
com.google.adk.JsonBaseModel
com.google.adk.models.CacheMetadata
Context cache state carried on an LLM response, and on its event, from one request to the next.
Metadata for an active cache has a cacheName(), expireTime() and invocationsUsed(). Fingerprint-only metadata has none of them: it records the cacheable prefix
so that a later request can tell whether the prefix is still the same.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CacheMetadata.Builderbuilder()Full resource name of the cached content; empty when no cache is active.abstract intNumber of leading contents in the cache, or in the fingerprint when no cache is active.When the cache was created; empty when no cache is active.When the cache expires; empty when no cache is active.abstract StringHash of the cacheable state: system instruction, tools and the cached leading contents.Number of invocations that have used the cache; empty when no cache is active.abstract CacheMetadata.Builderfinal StringtoString()Returns a short description for logs, in the same shape as ADK Python's.Methods inherited from class com.google.adk.JsonBaseModel
fromJsonNode, fromJsonString, getMapper, toJson, toJsonNode, toJsonString
-
Method Details
-
fingerprint
Hash of the cacheable state: system instruction, tools and the cached leading contents. -
contentsCount
public abstract int contentsCount()Number of leading contents in the cache, or in the fingerprint when no cache is active. -
cacheName
Full resource name of the cached content; empty when no cache is active. -
expireTime
When the cache expires; empty when no cache is active. -
invocationsUsed
Number of invocations that have used the cache; empty when no cache is active. -
createdAt
When the cache was created; empty when no cache is active. -
toBuilder
-
builder
-
toString
Returns a short description for logs, in the same shape as ADK Python's.
-