Class GoogleGenAiCachedContent
java.lang.Object
org.springframework.ai.google.genai.cache.GoogleGenAiCachedContent
Represents cached content in Google GenAI for reusing large contexts across multiple
requests.
- Since:
- 1.1.0
- Author:
- Dan Dobrin
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static GoogleGenAiCachedContentfrom(com.google.genai.types.CachedContent cachedContent) Creates a GoogleGenAiCachedContent from the SDK's CachedContent.List<com.google.genai.types.Content>getModel()getName()Gets the remaining time to live for the cached content.com.google.genai.types.ContentgetTtl()com.google.genai.types.CachedContentUsageMetadatabooleanChecks if the cached content has expired.toString()
-
Method Details
-
from
Creates a GoogleGenAiCachedContent from the SDK's CachedContent.- Parameters:
cachedContent- the SDK cached content- Returns:
- a new GoogleGenAiCachedContent instance
-
getName
-
getModel
-
getDisplayName
-
getCreateTime
-
getUpdateTime
-
getExpireTime
-
getTtl
-
getContents
-
getSystemInstruction
public com.google.genai.types.Content getSystemInstruction() -
getUsageMetadata
public com.google.genai.types.CachedContentUsageMetadata getUsageMetadata() -
isExpired
public boolean isExpired()Checks if the cached content has expired.- Returns:
- true if expired, false otherwise
-
getRemainingTtl
Gets the remaining time to live for the cached content.- Returns:
- the remaining TTL, or null if no expiration
-
toString
-
builder
-