Geminix.V1beta.EmbedContentRequest (geminix v0.2.0)

Request containing the Content for the model to embed.

Fields:

  • :content (Geminix.V1beta.Content.t/0) - Required. The content to embed. Only the parts.text fields will be counted.
  • :model (binary/0) - Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the ListModels method. Format: models/{model}
  • :output_dimensionality (integer/0) - Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (models/embedding-001).
  • :task_type (binary/0) - Optional. Optional task type for which the embeddings will be used. Not supported on earlier models (models/embedding-001).
  • :title (binary/0) - Optional. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval.

Summary

Types

t()

@type t() :: %Geminix.V1beta.EmbedContentRequest{
  __meta__: term(),
  content: Geminix.V1beta.Content.t(),
  model: binary(),
  output_dimensionality: integer(),
  task_type: binary(),
  title: binary()
}

Functions

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

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

Create a Geminix.V1beta.EmbedContentRequest.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.