CachedContent Class

Content that has been preprocessed and can be used in subsequent requests to GenerativeService. Cached content can be only used with the model it was created for.

Definition

Namespace: GenerativeAI.Types
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class CachedContent
Inheritance
Object    CachedContent

Constructors

CachedContentInitializes a new instance of the CachedContent class

Properties

Contents Optional. Input only. Immutable. The content to cache.
CreateTime Output only. Creation time of the cache entry. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
DisplayName Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.
ExpireTime Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
Model Required. Immutable. The name of the Model to use for cached content. Format: models/{model}
Name Optional. Identifier. The resource name referring to the cached content. Format: cachedContents/{id}
SystemInstruction Optional. Input only. Immutable. Developer set system instruction. Currently text only.
ToolConfig Optional. Input only. Immutable. Tool config. This config is shared for all tools.
Tools Optional. Input only. Immutable. A list of Tools the model may use to generate the next response.
Ttl Input only. New TTL for this resource, input only. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
UpdateTime Output only. When the cache entry was last updated in UTC time. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
UsageMetadata Output only. Metadata on the usage of the cached content.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also