Geminix.V1beta.GroundingMetadata (geminix v0.2.0)

Metadata returned to client when grounding is enabled.

Fields:

  • :google_maps_widget_context_token (binary/0) - Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled.
  • :grounding_chunks (list of Geminix.V1beta.GroundingChunk.t/0) - List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses.
  • :grounding_supports (list of Geminix.V1beta.GoogleAiGenerativelanguageV1betaGroundingSupport.t/0) - List of grounding support.
  • :retrieval_metadata (Geminix.V1beta.RetrievalMetadata.t/0) - Metadata related to retrieval in the grounding flow.
  • :search_entry_point (Geminix.V1beta.SearchEntryPoint.t/0) - Optional. Google search entry for the following-up web searches.
  • :web_search_queries (list of binary/0) - Web search queries for the following-up web search.

Summary

Types

t()

@type t() :: %Geminix.V1beta.GroundingMetadata{
  __meta__: term(),
  google_maps_widget_context_token: binary(),
  grounding_chunks: [Geminix.V1beta.GroundingChunk.t()],
  grounding_supports: [
    Geminix.V1beta.GoogleAiGenerativelanguageV1betaGroundingSupport.t()
  ],
  retrieval_metadata: Geminix.V1beta.RetrievalMetadata.t(),
  search_entry_point: Geminix.V1beta.SearchEntryPoint.t(),
  web_search_queries: [binary()]
}

Functions

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

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

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