GoogleLLMClient

open class GoogleLLMClient(apiKey: String, settings: GoogleClientSettings = GoogleClientSettings(), baseClient: HttpClient = HttpClient(), clock: Clock = Clock.System) : LLMClient(source)

Implementation of LLMClient for Google's Gemini API.

This client supports both standard and streaming text generation with optional tool calling capabilities.

Parameters

apiKey

The API key for the Google AI API

settings

Custom client settings, defaults to standard API endpoint and timeouts

baseClient

Optional custom HTTP client

clock

Clock instance used for tracking response metadata timestamps.

Constructors

Link copied to clipboard
constructor(apiKey: String, settings: GoogleClientSettings = GoogleClientSettings(), baseClient: HttpClient = HttpClient(), clock: Clock = Clock.System)

Functions

Link copied to clipboard
open suspend override fun execute(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): List<Message.Response>
Link copied to clipboard
open suspend override fun executeMultipleChoices(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): List<LLMChoice>
Link copied to clipboard
open override fun executeStreaming(prompt: Prompt, model: LLModel): Flow<String>
Link copied to clipboard
open suspend override fun moderate(prompt: Prompt, model: LLModel): ModerationResult

Moderates the given prompt using the specified language model. This method is not supported by the Google API and will throw an exception when invoked.