Geminix.V1beta.GenerateTextResponse (geminix v0.2.0)

The response from the model, including candidate completions.

Fields:

  • :candidates (list of Geminix.V1beta.TextCompletion.t/0) - Candidate responses 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. This indicates the smallest change to the SafetySettings that would be necessary to unblock at least 1 response. The blocking is configured by the SafetySettings in the request (or the default SafetySettings of the API).
  • :safety_feedback (list of Geminix.V1beta.SafetyFeedback.t/0) - Returns any safety feedback related to content filtering.

Summary

Types

t()

@type t() :: %Geminix.V1beta.GenerateTextResponse{
  __meta__: term(),
  candidates: [Geminix.V1beta.TextCompletion.t()],
  filters: [Geminix.V1beta.ContentFilter.t()],
  safety_feedback: [Geminix.V1beta.SafetyFeedback.t()]
}

Functions

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

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

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