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
Link copied to clipboard
Creates a Gemini instance using a Google AI API key for authentication.
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
Link copied to clipboard
interface GeminiModels
Internal wrapper around GenAI SDK Models to allow mocking in tests.
Link copied to clipboard
Functions
Link copied to clipboard
Generates content for the given LlmRequest. This returns a Flow of LlmResponses.