Gemini
Creates a Gemini from a preconfigured GenAI SDK Client, for callers that need a custom transport or auth. Each generate request and live connection appends ADK's tracking tag to the client's user-agent and x-goog-api-client headers. The SDK matches these names exactly, so a client header spelled User-Agent replaces the merged value.
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").
The speech config for live sessions; see Gemini.speechConfig.
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.
Parameters
The name of the specific Gemini model to use (e.g., "gemini-3.1-flash-lite-preview").
The Google AI API key. If not provided, falls back to GOOGLE_API_KEY or GEMINI_API_KEY environment variables on GenAI SDK level.
The speech config for live sessions; see Gemini.speechConfig.
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.
Parameters
The name of the specific Gemini model to use (e.g., "gemini-3.1-flash-lite-preview").
The Vertex AI credentials to use.
The speech config for live sessions; see Gemini.speechConfig.