# Gemini

class Gemini(client: <Error class: unknown class>, val name: String, models: Gemini.GeminiModels = RealGeminiModels(client.models)) : Model

Implementation of Model that interacts with Google Gemini models using the GenAI SDK.

This class provides functionality to generate content from Gemini models, supporting both unary and streaming responses. It can be configured to use either a Google AI API key or Vertex AI credentials for authentication.

#### Parameters

client

The Client instance from the GenAI SDK used for making API calls.

name

The name of the specific Gemini model to use (e.g., "gemini-3.1-flash-lite-preview").

## Constructors

Gemini
Link copied to clipboard
@JvmOverloads
constructor(name: String, apiKey: String? = null)

Creates a Gemini instance using a Google AI API key for authentication.

constructor(name: String, vertexCredentials: VertexCredentials)

Creates a Gemini instance using Vertex AI credentials for authentication.

constructor(client: <Error class: unknown class>, name: String, models: Gemini.GeminiModels = RealGeminiModels(client.models))

## Types

Companion
Link copied to clipboard
object Companion
GeminiModels
Link copied to clipboard
interface GeminiModels

Internal wrapper around GenAI SDK Models to allow mocking in tests.

RealGeminiModels
Link copied to clipboard
class RealGeminiModels(delegate: <Error class: unknown class>) : Gemini.GeminiModels

## Properties

name
Link copied to clipboard
open override val name: String

## Functions

generateContent
Link copied to clipboard
open override fun generateContent(request: LlmRequest, stream: Boolean): Flow<LlmResponse>

Generates content for the given LlmRequest. This returns a Flow of LlmResponses.