Gemini
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.
GenAI SDK based Gemini currently prevents usage of API_KEY and GoogleCredentials on Android. Use Firebase AI instead.
Parameters
The Client instance from the GenAI SDK used for making API calls.
The name of the specific Gemini model to use (e.g., "gemini-3.1-flash-lite-preview").
Constructors
Creates a Gemini instance using a Google AI API key for authentication.
Creates a Gemini instance using Vertex AI credentials for authentication.
Types
Wrapper around GenAI SDK Models to allow mocking in tests.
Functions
Generates content for the given LlmRequest. This returns a Flow of LlmResponses.