The gemini function configures Google’s Gemini as your model provider.

import { createAgent, gemini } from '@inngest/agent-kit';

const agent = createAgent({
  name: 'Code writer',
  system: 'You are an expert TypeScript programmer.',
  model: gemini('gemini-pro'),
});

Configuration

The gemini function accepts a model name string or a configuration object:

const agent = createAgent({
  model: gemini({
    model: 'gemini-pro',
    apiKey: process.env.GOOGLE_API_KEY,
    baseUrl: 'https://generativelanguage.googleapis.com/v1/',
  }),
});

Options

model
string
required

ID of the model to use. See the model endpoint compatibility table for details on which models work with the Gemini API.

apiKey
string

The Google API key to use for authenticating your request. By default we’ll search for and use the GOOGLE_API_KEY environment variable.

baseUrl
string
default:
"https://generativelanguage.googleapis.com/v1/"

The base URL for the Gemini API.

Available Models

  • gemini-1.5-pro
  • gemini-1.5-flash
  • gemini-1.5-flash-8b
  • gemini-1.0-pro
  • text-embedding-004
  • aqa

For the latest list of available models, see Google’s Gemini model overview.