Geminix.V1beta.CitationSource (geminix v0.2.0)

A citation to a source for a portion of a specific response.

Fields:

  • :end_index (integer/0) - Optional. End of the attributed segment, exclusive.
  • :license (binary/0) - Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.
  • :start_index (integer/0) - Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.
  • :uri (binary/0) - Optional. URI that is attributed as a source for a portion of the text.

Summary

Types

t()

@type t() :: %Geminix.V1beta.CitationSource{
  __meta__: term(),
  end_index: integer(),
  license: binary(),
  start_index: integer(),
  uri: binary()
}

Functions

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

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

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