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.
Constructors
Creates a Gemini from a preconfigured GenAI SDK Client, for callers that need a custom transport or auth.
Creates a Gemini instance using a Google AI API key for authentication. Its client retries transient failures with the GenAI SDK's default retry options; pass your own Client for other retry settings.
Creates a Gemini instance using Vertex AI credentials for authentication. Its client retries transient failures with the GenAI SDK's default retry options; pass your own Client for other retry settings.
Functions
Generates content for the given LlmRequest. This returns a Flow of LlmResponses.