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

name
GeminiModel
The name of the Gemini model you want your agent to use. By default, your agent will use gemini-2.0-flash.
secret
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:
import { Agent, gemini } from '@ardent-ai/sdk';

const agent = new Agent({
  model: gemini()
});
Passing a single string argument will set the model name:
import { Agent, gemini } from '@ardent-ai/sdk';

const agent = new Agent({
  model: gemini('gemini-2.5-flash-preview-05-20')
});
Or, you can set every parameter by passing a configuration object:
import { Agent, gemini } from '@ardent-ai/sdk';

const agent = new Agent({
  model: gemini({
    name: 'gemini-2.5-flash-preview-05-20',
    secret: 'MY_CUSTOM_GEMINI_SECRET_NAME'
  })
});