glean/providers/gemini
Google Gemini provider, on the Gemini REST API.
What glean’s settings become on the wire:
tool_choiceis sent astoolConfig.functionCallingConfig.reasoning_effortis sent asthinkingConfig.thinkingLevel, which Gemini 3 and later models take. Gemini has no level abovehigh, soXHighEffortandMaxEffortsendhigh. Gemini 2.5 models take a token budget instead: leavereasoning_effortunset for them.include_reasoningasks for thought summaries (thinkingConfig.includeThoughts); without it Gemini thinks but returns no reasoning text.- Files the model makes (images from the image models) come back as
GeneratedFileand are sent back on the next turn.
Values
pub fn default_config(
api_key api_key: String,
model model: String,
) -> config.ProviderConfig
The default configuration for this provider. Change it with the
glean/providers/config setters, then pass it to from_config.
pub fn from_config(
cfg: config.ProviderConfig,
) -> provider.Provider
Create a Gemini provider from a full config.
pub fn new(
api_key api_key: String,
model model: String,
) -> provider.Provider
Create a Gemini provider.
Example
let provider = gemini.new(api_key: "AIza...", model: "gemini-2.5-pro")