Geminix.V1beta.CachedContent (geminix v0.2.0)

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

Fields:

  • :contents (list of Geminix.V1beta.Content.t/0) - Optional. Input only. Immutable. The content to cache.
  • :create_time (DateTime.t/0) - Output only. Creation time of the cache entry.
  • :display_name (binary/0) - Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.
  • :expire_time (DateTime.t/0) - Timestamp in UTC of when this resource is considered expired. This is always provided on output, regardless of what was sent on input.
  • :model (binary/0) - Required. Immutable. The name of the Model to use for cached content Format: models/{model}
  • :name (binary/0) - Output only. Identifier. The resource name referring to the cached content. Format: cachedContents/{id}
  • :system_instruction (Geminix.V1beta.Content.t/0) - Optional. Input only. Immutable. Developer set system instruction. Currently text only.
  • :tool_config (Geminix.V1beta.ToolConfig.t/0) - Optional. Input only. Immutable. Tool config. This config is shared for all tools.
  • :tools (list of Geminix.V1beta.Tool.t/0) - Optional. Input only. Immutable. A list of Tools the model may use to generate the next response
  • :ttl (binary/0) - Input only. New TTL for this resource, input only.
  • :update_time (DateTime.t/0) - Output only. When the cache entry was last updated in UTC time.
  • :usage_metadata (Geminix.V1beta.CachedContentUsageMetadata.t/0) - Output only. Metadata on the usage of the cached content.

Summary

Types

t()

@type t() :: %Geminix.V1beta.CachedContent{
  __meta__: term(),
  contents: [Geminix.V1beta.Content.t()],
  create_time: DateTime.t(),
  display_name: binary(),
  expire_time: DateTime.t(),
  model: binary(),
  name: binary(),
  system_instruction: Geminix.V1beta.Content.t(),
  tool_config: Geminix.V1beta.ToolConfig.t(),
  tools: [Geminix.V1beta.Tool.t()],
  ttl: binary(),
  update_time: DateTime.t(),
  usage_metadata: Geminix.V1beta.CachedContentUsageMetadata.t()
}

Functions

from_map(schema \\ %__MODULE__{}, map)

@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Create a Geminix.V1beta.CachedContent.t/0 from a map returned by the Gemini API.

Sometimes, this function should not be applied to the full response body, but instead it should be applied to the correct part of the map in the response body. This depends on the concrete API call.