Geminix.V1beta.Candidate (geminix v0.2.0)

A response candidate generated from the model.

Fields:

  • :avg_logprobs (number/0) - Output only. Average log probability score of the candidate.
  • :citation_metadata (Geminix.V1beta.CitationMetadata.t/0) - Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the content. These are passages that are "recited" from copyrighted material in the foundational LLM's training data.
  • :content (Geminix.V1beta.Content.t/0) - Output only. Generated content returned from the model.
  • :finish_message (binary/0) - Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when finish_reason is set.
  • :finish_reason (binary/0) - Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
  • :grounding_attributions (list of Geminix.V1beta.GroundingAttribution.t/0) - Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for GenerateAnswer calls.
  • :grounding_metadata (Geminix.V1beta.GroundingMetadata.t/0) - Output only. Grounding metadata for the candidate. This field is populated for GenerateContent calls.
  • :index (integer/0) - Output only. Index of the candidate in the list of response candidates.
  • :logprobs_result (Geminix.V1beta.LogprobsResult.t/0) - Output only. Log-likelihood scores for the response tokens and top tokens
  • :safety_ratings (list of Geminix.V1beta.SafetyRating.t/0) - List of ratings for the safety of a response candidate. There is at most one rating per category.
  • :token_count (integer/0) - Output only. Token count for this candidate.
  • :url_context_metadata (Geminix.V1beta.UrlContextMetadata.t/0) - Output only. Metadata related to url context retrieval tool.

Summary

Functions

Create a Geminix.V1beta.Candidate.t/0 from a map returned by the Gemini API.

Types

t()

@type t() :: %Geminix.V1beta.Candidate{
  __meta__: term(),
  avg_logprobs: number(),
  citation_metadata: Geminix.V1beta.CitationMetadata.t(),
  content: Geminix.V1beta.Content.t(),
  finish_message: binary(),
  finish_reason: binary(),
  grounding_attributions: [Geminix.V1beta.GroundingAttribution.t()],
  grounding_metadata: Geminix.V1beta.GroundingMetadata.t(),
  index: integer(),
  logprobs_result: Geminix.V1beta.LogprobsResult.t(),
  safety_ratings: [Geminix.V1beta.SafetyRating.t()],
  token_count: integer(),
  url_context_metadata: Geminix.V1beta.UrlContextMetadata.t()
}

Functions

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

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

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