Skip to content

Google Gemini

Use Google's Gemini models with GeminiModel. Supports native multimodal input and tool calling through the Google GenAI SDK.

For standalone invoke / stream usage, see LLM Models — Google Gemini.

Install

bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents==0.3.1
pip install --extra-index-url https://core-packages.elsai.ai/root/ "elsai-model[gemini]==2.1.0"

Setup

  1. Create a Google AI API key.
  2. Export credentials:
bash
export GEMINI_API_KEY=...
export GEMINI_MODEL_NAME=gemini-2.5-flash

Agent — basic

python
import os
from elsai import Agent
from elsai_model import LLM, Provider

model = LLM(
    provider=Provider.GEMINI,
    model=os.getenv("GEMINI_MODEL_NAME", "gemini-2.5-flash"),
    api_key=os.environ["GEMINI_API_KEY"],
    params={"temperature": 0.2},
)
agent = Agent(
    model=model,
    system_prompt="You are a concise assistant.",
)
result = agent("Summarize what an AI agent is in two sentences.")
print(result)

Available models

ModelID
Gemini 2.5 Flashgemini-2.5-flash
Gemini 2.5 Progemini-2.5-pro
Gemini 2.0 Flashgemini-2.0-flash

Copyright © 2026 elsai foundry.