Geminix.V1beta.SemanticRetrieverConfig (geminix v0.2.0)

Configuration for retrieving grounding content from a Corpus or Document created using the Semantic Retriever API.

Fields:

  • :max_chunks_count (integer/0) - Optional. Maximum number of relevant Chunks to retrieve.
  • :metadata_filters (list of Geminix.V1beta.MetadataFilter.t/0) - Optional. Filters for selecting Documents and/or Chunks from the resource.
  • :minimum_relevance_score (number/0) - Optional. Minimum relevance score for retrieved relevant Chunks.
  • :query (Geminix.V1beta.Content.t/0) - Required. Query to use for matching Chunks in the given resource by similarity.
  • :source (binary/0) - Required. Name of the resource for retrieval. Example: corpora/123 or corpora/123/documents/abc.

Summary

Types

t()

@type t() :: %Geminix.V1beta.SemanticRetrieverConfig{
  __meta__: term(),
  max_chunks_count: integer(),
  metadata_filters: [Geminix.V1beta.MetadataFilter.t()],
  minimum_relevance_score: number(),
  query: Geminix.V1beta.Content.t(),
  source: binary()
}

Functions

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

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

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