View Source Omni.Providers.Google (Omni v0.1.1)
Provider implementation for the Google Gemini API. Use this Provider to chat with any of the Gemini models.
Authorization
Obtain an API key from the Google AI Studio
and add it to your application's config.exs
:
config :omni, Omni.Providers.Google, "NotaRealKey"
Alternatively, pass the API key to Onmi.init/2
:
iex> Omni.init(:google, api_key: api_key)
%Omni.Provider{mod: Omni.Providers.Google, req: %Req.Request{}}
Summary
Functions
Returns the schema for this Provider.
Schema
:model
(String.t/0
) - Required. Name of the model to use.:contents
(list ofmap/0
) - Required. The base structured datatype containing multi-part content of a message.:system
(map/0
) - Developer set system instruction.:text
(String.t/0
) - Required. System text.
:tools
(list ofmap/0
) - A list of Tools the model may use to generate the next response.:tool_config
(map/0
) - Tool configuration for any Tool specified in the request.:function_calling_config
(map/0
) - Function calling config.:mode
- Specifies the mode in which function calling should execute.:allowed_function_names
(list ofString.t/0
) - A set of function names that, when provided, limits the functions the model will call.
:generation
(map/0
) - Configuration options for model generation and outputs.:stop_sequences
(list ofString.t/0
) - Set of character sequences that will stop output generation.:response_mime_type
- Output response mimetype of the generated candidate text.:response_schema
(map/0
) - Output response schema of the generated candidate text.:candidate_count
(integer/0
) - Number of generated responses to return.:max_output_tokens
(integer/0
) - The maximum number of tokens to include in a candidate.:temperature
(float/0
) - Controls the randomness of the output. Between 0.0 and 2.0.:top_p
(float/0
) - The maximum cumulative probability of tokens to consider when sampling.:top_k
(integer/0
) - The maximum number of tokens to consider when sampling.
:safety
(list ofmap/0
) - A list of unique SafetySetting instances for blocking unsafe content.