Geminix.V1beta.MetadataFilter (geminix v0.2.0)

User provided filter to limit retrieval based on Chunk or Document level metadata values. Example (genre = drama OR genre = action): key = "document.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}]

Fields:

  • :conditions (list of Geminix.V1beta.Condition.t/0) - Required. The Conditions for the given key that will trigger this filter. Multiple Conditions are joined by logical ORs.
  • :key (binary/0) - Required. The key of the metadata to filter on.

Summary

Types

t()

@type t() :: %Geminix.V1beta.MetadataFilter{
  __meta__: term(),
  conditions: [Geminix.V1beta.Condition.t()],
  key: binary()
}

Functions

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

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

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