Gemini
The direct provider for Google's Gemini models. The app sends each request straight to Google and streams the reply; tools execute locally.
Construct it
let agent = try runtime.makeAgent(
provider: .gemini(apiKey: key, model: "gemini-2.5-flash"),
role: AgentRole(staticPersona: "You are a precise video-editing assistant.")
)
Hold the provider directly when you need it:
let provider = GeminiProvider(apiKey: key, model: "gemini-2.5-flash")
model defaults to gemini-2.5-flash and is a plain string — any model
Google offers works without a framework update.
What it supports
| Capability | Value |
|---|---|
| execution | app-driven (the session runs the loop) |
| context window | 1,000,000 tokens |
| vision | yes |
| tool choice | yes, native |
| structured output | yes, native |
Structured turns (get data, not prose) ride Gemini's native response schema, so the model is constrained to your shape at generation time.
The full flag-by-flag table lives in the capability matrix.
Keep the key out of shipped apps
.gemini(apiKey:) sends the key from the device — fine for prototypes,
extractable from any shipped binary. For production,
name an agent profile instead of a key.