#[non_exhaustive]pub struct CachedContent {
pub name: String,
pub display_name: String,
pub model: String,
pub system_instruction: Option<Content>,
pub contents: Vec<Content>,
pub tools: Vec<Tool>,
pub tool_config: Option<ToolConfig>,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub usage_metadata: Option<UsageMetadata>,
pub encryption_spec: Option<EncryptionSpec>,
pub expiration: Option<Expiration>,
/* private fields */
}Expand description
A resource used in LLM queries for users to explicitly specify what to cache and how to cache.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringImmutable. Identifier. The server-generated resource name of the cached content Format: projects/{project}/locations/{location}/cachedContents/{cached_content}
display_name: StringOptional. Immutable. The user-generated meaningful display name of the cached content.
model: StringImmutable. The name of the Model to use for cached content. Currently,
only the published Gemini base models are supported, in form of
projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}
system_instruction: Option<Content>Optional. Input only. Immutable. Developer set system instruction. Currently, text only
contents: Vec<Content>Optional. Input only. Immutable. The content to cache
tools: Vec<Tool>Optional. Input only. Immutable. A list of Tools the model may use to
generate the next response
tool_config: Option<ToolConfig>Optional. Input only. Immutable. Tool config. This config is shared for all tools
create_time: Option<Timestamp>Output only. Creation time of the cache entry.
update_time: Option<Timestamp>Output only. When the cache entry was last updated in UTC time.
usage_metadata: Option<UsageMetadata>Output only. Metadata on the usage of the cached content.
encryption_spec: Option<EncryptionSpec>Input only. Immutable. Customer-managed encryption key spec for a
CachedContent. If set, this CachedContent and all its sub-resources
will be secured by this key.
expiration: Option<Expiration>Expiration time of the cached content.
Implementations§
Source§impl CachedContent
impl CachedContent
pub fn new() -> Self
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sets the value of display_name.
Sourcepub fn set_system_instruction<T: Into<Option<Content>>>(self, v: T) -> Self
pub fn set_system_instruction<T: Into<Option<Content>>>(self, v: T) -> Self
Sets the value of system_instruction.
Sourcepub fn set_contents<T, V>(self, v: T) -> Self
pub fn set_contents<T, V>(self, v: T) -> Self
Sets the value of contents.
Sourcepub fn set_tool_config<T: Into<Option<ToolConfig>>>(self, v: T) -> Self
pub fn set_tool_config<T: Into<Option<ToolConfig>>>(self, v: T) -> Self
Sets the value of tool_config.
Sourcepub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
pub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_update_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
pub fn set_update_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
Sets the value of update_time.
Sourcepub fn set_usage_metadata<T: Into<Option<UsageMetadata>>>(self, v: T) -> Self
pub fn set_usage_metadata<T: Into<Option<UsageMetadata>>>(self, v: T) -> Self
Sets the value of usage_metadata.
Sourcepub fn set_encryption_spec<T: Into<Option<EncryptionSpec>>>(self, v: T) -> Self
pub fn set_encryption_spec<T: Into<Option<EncryptionSpec>>>(self, v: T) -> Self
Sets the value of encryption_spec.
Sourcepub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
pub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
Sets the value of expiration.
Note that all the setters affecting expiration are mutually
exclusive.
Sourcepub fn expire_time(&self) -> Option<&Box<Timestamp>>
pub fn expire_time(&self) -> Option<&Box<Timestamp>>
The value of expiration
if it holds a ExpireTime, None if the field is not set or
holds a different branch.
Sourcepub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
pub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
Sets the value of expiration
to hold a ExpireTime.
Note that all the setters affecting expiration are
mutually exclusive.
Trait Implementations§
Source§impl Clone for CachedContent
impl Clone for CachedContent
Source§fn clone(&self) -> CachedContent
fn clone(&self) -> CachedContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more