ExAgent.Providers.Gemini (ExAgent v0.2.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: integer(),
  model: String.t(),
  req: Req.Request.t() | nil,
  system_prompt: String.t() | nil,
  temperature: float(),
  tools: [ExAgent.Tool.t()]
}

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-2.0-flash")
  • :base_url - API base URL
  • :system_prompt - System instruction to prepend
  • :tools - List of ExAgent.Tool structs