Geminix.V1beta.GenerateContentRequest (geminix v0.2.0)
Request to generate a completion from the model.
Fields:
:cached_content(binary/0) - Optional. The name of the content cached to use as context to serve the prediction. Format:cachedContents/{cachedContent}:contents(list ofGeminix.V1beta.Content.t/0) - Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like chat, this is a repeated field that contains the conversation history and the latest request.:generation_config(Geminix.V1beta.GenerationConfig.t/0) - Optional. Configuration options for model generation and outputs.:model(binary/0) - Required. The name of theModelto use for generating the completion. Format:models/{model}.:safety_settings(list ofGeminix.V1beta.SafetySetting.t/0) - Optional. A list of uniqueSafetySettinginstances for blocking unsafe content. This will be enforced on theGenerateContentRequest.contentsandGenerateContentResponse.candidates. 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, HARM_CATEGORY_CIVIC_INTEGRITY 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.:system_instruction(Geminix.V1beta.Content.t/0) - Optional. Developer set system instruction(s). Currently, text only.:tool_config(Geminix.V1beta.ToolConfig.t/0) - Optional. Tool configuration for anyToolspecified in the request. Refer to the Function calling guide for a usage example.:tools(list ofGeminix.V1beta.Tool.t/0) - Optional. A list ofToolstheModelmay use to generate the next response. AToolis a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of theModel. SupportedTools areFunctionandcode_execution. Refer to the Function calling and the Code execution guides to learn more.
Summary
Functions
Create a Geminix.V1beta.GenerateContentRequest.t/0 from a map returned
by the Gemini API.
Types
@type t() :: %Geminix.V1beta.GenerateContentRequest{ __meta__: term(), cached_content: binary(), contents: [Geminix.V1beta.Content.t()], generation_config: Geminix.V1beta.GenerationConfig.t(), model: binary(), safety_settings: [Geminix.V1beta.SafetySetting.t()], system_instruction: Geminix.V1beta.Content.t(), tool_config: Geminix.V1beta.ToolConfig.t(), tools: [Geminix.V1beta.Tool.t()] }
Functions
@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Create a Geminix.V1beta.GenerateContentRequest.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.