Geminix.V1beta.GenerateAnswerResponse (geminix v0.2.0)
Response from the model for a grounded answer.
Fields:
:answer(Geminix.V1beta.Candidate.t/0) - Candidate answer from the model. Note: The model always attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a lowanswerable_probability.:answerable_probability(number/0) - Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A lowanswerable_probabilityindicates that the answer might not be grounded in the sources. Whenanswerable_probabilityis low, you may want to: Display a message to the effect of "We couldn’t answer that question" to the user. Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases.0.5is a good starting threshold.:input_feedback(Geminix.V1beta.InputFeedback.t/0) - Output only. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. The input data can be one or more of the following: - Question specified by the last entry inGenerateAnswerRequest.content- Conversation history specified by the other entries inGenerateAnswerRequest.content- Grounding sources (GenerateAnswerRequest.semantic_retrieverorGenerateAnswerRequest.inline_passages)
Summary
Functions
Create a Geminix.V1beta.GenerateAnswerResponse.t/0 from a map returned
by the Gemini API.
Types
@type t() :: %Geminix.V1beta.GenerateAnswerResponse{ __meta__: term(), answer: Geminix.V1beta.Candidate.t(), answerable_probability: number(), input_feedback: Geminix.V1beta.InputFeedback.t() }
Functions
@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Create a Geminix.V1beta.GenerateAnswerResponse.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.