Gemini.Types.Live.GroundingMetadata (GeminiEx v0.11.0)

Copy Markdown View Source

Grounding metadata for Live API responses.

Contains information about sources and attributions for grounded content.

Fields

  • grounding_attributions - List of grounding attributions
  • web_search_queries - Search queries used for grounding
  • search_entry_point - Entry point for search
  • retrieval_queries - Retrieval queries used

Example

%GroundingMetadata{
  web_search_queries: ["weather today"],
  grounding_attributions: [%{source: "...", confidence: "HIGH"}]
}

Summary

Functions

Parses from API response.

Creates a new GroundingMetadata.

Converts to API format (camelCase).

Types

grounding_attribution()

@type grounding_attribution() :: %{
  source_id: map() | nil,
  content: map() | nil,
  segment: map() | nil,
  confidence_score: float() | nil
}

search_entry_point()

@type search_entry_point() :: %{
  rendered_content: String.t() | nil,
  sdk_blob: String.t() | nil
}

t()

@type t() :: %Gemini.Types.Live.GroundingMetadata{
  grounding_attributions: [grounding_attribution()] | nil,
  retrieval_queries: [String.t()] | nil,
  search_entry_point: search_entry_point() | nil,
  web_search_queries: [String.t()] | nil
}

Functions

from_api(data)

@spec from_api(map() | nil) :: t() | nil

Parses from API response.

new(opts \\ [])

@spec new(keyword()) :: t()

Creates a new GroundingMetadata.

to_api(value)

@spec to_api(t() | nil) :: map() | nil

Converts to API format (camelCase).