Geminix.V1beta.GenerateAnswerRequest (geminix v0.2.0)
Request to generate a grounded answer from the Model.
Fields:
:answer_style(binary/0) - Required. Style in which answers should be returned.:contents(list ofGeminix.V1beta.Content.t/0) - Required. The content of the current conversation with theModel. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the lastContentin the list containing the question. Note:GenerateAnsweronly supports queries in English.:inline_passages(Geminix.V1beta.GroundingPassages.t/0) - Passages provided inline with the request.:safety_settings(list ofGeminix.V1beta.SafetySetting.t/0) - Optional. A list of uniqueSafetySettinginstances for blocking unsafe content. This will be enforced on theGenerateAnswerRequest.contentsandGenerateAnswerResponse.candidate. There should not be more than one setting for eachSafetyCategorytype. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for eachSafetyCategoryspecified in the safety_settings. If there is noSafetySettingfor a givenSafetyCategoryprovided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported. Refer to the guide for detailed information on available safety settings. Also refer to the Safety guidance to learn how to incorporate safety considerations in your AI applications.:semantic_retriever(Geminix.V1beta.SemanticRetrieverConfig.t/0) - Content retrieved from resources created via the Semantic Retriever API.:temperature(number/0) - Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.
Summary
Functions
Create a Geminix.V1beta.GenerateAnswerRequest.t/0 from a map returned
by the Gemini API.
Types
@type t() :: %Geminix.V1beta.GenerateAnswerRequest{ __meta__: term(), answer_style: binary(), contents: [Geminix.V1beta.Content.t()], inline_passages: Geminix.V1beta.GroundingPassages.t(), safety_settings: [Geminix.V1beta.SafetySetting.t()], semantic_retriever: Geminix.V1beta.SemanticRetrieverConfig.t(), temperature: number() }
Functions
@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Create a Geminix.V1beta.GenerateAnswerRequest.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.