Skip to main content
Before building an agent that uses a Gemini model, you’ll need to create an Google AI Studio account and get an API key.

Configuration

GeminiModel
The name of the Gemini model you want your agent to use. By default, your agent will use gemini-2.0-flash.
string
The name of the secret which contains your Gemini API key. NOTE: This is the name of the secret, not your actual secret key!

Creating the Model

Calling gemini() with no arguments will use all default values:
Passing a single string argument will set the model name:
Or, you can set every parameter by passing a configuration object: