Gemini

class Gemini : 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.

GenAI SDK based Gemini currently prevents usage of API_KEY and GoogleCredentials on Android. Use Firebase AI instead.

Constructors

Link copied to clipboard
constructor(client: ERROR CLASS: Symbol not found for Client, name: String)

Creates a Gemini from a preconfigured GenAI SDK Client, for callers that need a custom transport or auth.

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.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val name: String

The name of the model.

Functions

Link copied to clipboard
open override fun generateContent(request: LlmRequest, stream: Boolean = false): ERROR CLASS: Symbol not found for Flow<com/google/adk/kt/models/LlmResponse>

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