Search Results for

    Show / Hide Table of Contents

    Class GenerateAnswerResponse

    Response from the model for a grounded answer. If successful, the response body contains data with the following structure:

    Inheritance
    object
    GenerateAnswerResponse
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Google
    Assembly: Glitch9.AIDevKit.Provider.Google.dll
    Syntax
    public class GenerateAnswerResponse

    Properties

    | Edit this page View Source

    Answer

    Candidate answer from the model.

    Declaration
    [JsonProperty("answer")]
    public GeminiCandidate Answer { get; set; }
    Property Value
    Type Description
    GeminiCandidate
    Remarks

    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 low answerableProbability.

    | Edit this page View Source

    AnswerableProbability

    Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages.

    A low answerableProbability indicates that the answer might not be grounded in the sources.

    When answerableProbability is low, some clients may wish to:

    - Display a message to the effect of "We couldn???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 clients??use cases. 0.5 is a good starting threshold.

    Declaration
    [JsonProperty("answerableProbability")]
    public float AnswerableProbability { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    InputFeedback

    Output only. Feedback related to the input data used to answer the question, as opposed to model-generated response to the question.

    "Input data" can be one or more of the following:

    - Question specified by the last entry in GenerateAnswerRequest.content

    - Conversation history specified by the other entries in GenerateAnswerRequest.content

    - Grounding sources (GenerateAnswerRequest.semantic_retriever or GenerateAnswerRequest.inline_passages)

    Declaration
    [JsonProperty("inputFeedback")]
    public PromptFeedback InputFeedback { get; set; }
    Property Value
    Type Description
    PromptFeedback

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation