Geminix.V1beta.GenerateMessageResponse (geminix v0.2.0)

The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.

Fields:

  • :candidates (list of Geminix.V1beta.Message.t/0) - Candidate response messages from the model.
  • :filters (list of Geminix.V1beta.ContentFilter.t/0) - A set of content filtering metadata for the prompt and response text. This indicates which SafetyCategory(s) blocked a candidate from this response, the lowest HarmProbability that triggered a block, and the HarmThreshold setting for that category.
  • :messages (list of Geminix.V1beta.Message.t/0) - The conversation history used by the model.

Summary

Types

t()

@type t() :: %Geminix.V1beta.GenerateMessageResponse{
  __meta__: term(),
  candidates: [Geminix.V1beta.Message.t()],
  filters: [Geminix.V1beta.ContentFilter.t()],
  messages: [Geminix.V1beta.Message.t()]
}

Functions

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

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

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