ExAgent.Providers.Gemini (ExAgent v0.4.0)

Copy Markdown View Source

Google Gemini LLM provider.

Wraps the Gemini generateContent API with automatic Req client configuration, API key header, and JSON encoding.

Example

provider = ExAgent.Providers.Gemini.new(api_key: "AIza...")
ExAgent.Provider.chat(provider, messages)

Summary

Functions

Creates a new Gemini provider with validated options and initialized Req client.

Types

t()

@type t() :: %ExAgent.Providers.Gemini{
  api_key: String.t(),
  base_url: String.t(),
  max_tokens: pos_integer() | nil,
  modalities: [ExAgent.Source.modality()],
  model: String.t(),
  req: Req.Request.t() | nil,
  system_prompt: String.t() | nil,
  temperature: float() | nil,
  tools: [ExAgent.Tool.t()],
  upload_cache: boolean()
}

Functions

new(opts)

@spec new(keyword()) :: t()

Creates a new Gemini provider with validated options and initialized Req client.

Options

  • :api_key (required) - Google API key
  • :model - Model name (default: "gemini-3.6-flash")
  • :base_url - API base URL
  • :system_prompt - System instruction to prepend
  • :tools - List of ExAgent.Tool structs
  • :upload_cache - Reuse previous uploads of identical bytes (default: true)