Table of Contents

Class CreateCachedContentConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Optional configuration for cached content creation.

public record CreateCachedContentConfig : IEquatable<CreateCachedContentConfig>
Inheritance
CreateCachedContentConfig
Implements
Inherited Members

Properties

Contents

The content to cache.

[JsonPropertyName("contents")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Content>? Contents { get; set; }

Property Value

List<Content>

DisplayName

The user-generated meaningful display name of the cached content.

[JsonPropertyName("displayName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? DisplayName { get; set; }

Property Value

string

ExpireTime

Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.

[JsonPropertyName("expireTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? ExpireTime { get; set; }

Property Value

DateTime?

HttpOptions

Used to override HTTP request options.

[JsonPropertyName("httpOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpOptions? HttpOptions { get; set; }

Property Value

HttpOptions

KmsKeyName

The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. The key needs to be in the same region as where the compute resource is created. See https://cloud.google.com/vertex-ai/docs/general/cmek for more details. If this is set, then all created CachedContent objects will be encrypted with the provided encryption key. Allowed formats: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}

[JsonPropertyName("kmsKeyName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? KmsKeyName { get; set; }

Property Value

string

SystemInstruction

Developer set system instruction.

[JsonPropertyName("systemInstruction")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Content? SystemInstruction { get; set; }

Property Value

Content

ToolConfig

Configuration for the tools to use. This config is shared for all tools.

[JsonPropertyName("toolConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ToolConfig? ToolConfig { get; set; }

Property Value

ToolConfig

Tools

A list of Tools the model may use to generate the next response.

[JsonPropertyName("tools")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Tool>? Tools { get; set; }

Property Value

List<Tool>

Ttl

The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s".

[JsonPropertyName("ttl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Ttl { get; set; }

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a CreateCachedContentConfig object.

public static CreateCachedContentConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

CreateCachedContentConfig

The deserialized CreateCachedContentConfig object, or null if deserialization fails.