CachedContent class final
A resource used in LLM queries for users to explicitly specify what to cache and how to cache.
- Inheritance
-
- Object
- ProtoMessage
- CachedContent
Constructors
-
CachedContent({Timestamp? expireTime, Duration? ttl, String name = '', String displayName = '', String model = '', Content? systemInstruction, List<
Content> contents = const [], List<Tool> tools = const [], ToolConfig? toolConfig, Timestamp? createTime, Timestamp? updateTime, CachedContent_UsageMetadata? usageMetadata, EncryptionSpec? encryptionSpec}) - CachedContent.fromJson(Object? j)
-
factory
Properties
-
contents
→ List<
Content> -
Optional. Input only. Immutable. The content to cache
final
- createTime → Timestamp?
-
Output only. Creation time of the cache entry.
final
- displayName → String
-
Optional. Immutable. The user-generated meaningful display name of the
cached content.
final
- encryptionSpec → EncryptionSpec?
-
Input only. Immutable. Customer-managed encryption key spec for a
CachedContent. If set, thisCachedContentand all its sub-resources will be secured by this key.final - expireTime → Timestamp?
-
Timestamp of when this resource is considered expired.
This is always provided on output, regardless of what was sent
on input.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- model → String
-
Immutable. The name of the
Modelto use for cached content. Currently, only the published Gemini base models are supported, in form of projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}final - name → String
-
Immutable. Identifier. The server-generated resource name of the cached
content Format:
projects/{project}/locations/{location}/cachedContents/{cached_content}
final
- qualifiedName → String
-
The fully qualified name of this message, i.e.,
google.protobuf.Durationorgoogle.rpc.ErrorInfo.finalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- systemInstruction → Content?
-
Optional. Input only. Immutable. Developer set system instruction.
Currently, text only
final
- toolConfig → ToolConfig?
-
Optional. Input only. Immutable. Tool config. This config is shared for all
tools
final
-
tools
→ List<
Tool> -
Optional. Input only. Immutable. A list of
Toolsthe model may use to generate the next responsefinal - ttl → Duration?
-
Input only. The TTL for this resource. The expiration time is computed:
now + TTL.
final
- updateTime → Timestamp?
-
Output only. When the cache entry was last updated in UTC time.
final
- usageMetadata → CachedContent_UsageMetadata?
-
Output only. Metadata on the usage of the cached content.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Object -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- fullyQualifiedName → const String