Package-level declarations

Types

Link copied to clipboard
@Serializable
class ActivityEnd

Represents the activity end.

Link copied to clipboard
@Serializable
enum ActivityHandling : Enum<ActivityHandling>

Represents the activity handling.

Link copied to clipboard
@Serializable
class ActivityStart

Represents the activity start.

Link copied to clipboard
@Serializable
class AudioTranscriptionConfig

Represents the audio transcription config.

Link copied to clipboard
@Serializable
data class AutomaticActivityDetection(val disabled: Boolean? = null, val startOfSpeechSensitivity: StartSensitivity? = null, val prefixPaddingMs: Int? = null, val endOfSpeechSensitivity: EndSensitivity? = null, val silenceDurationMs: Int? = null)

Represents the automatic activity detection.

Link copied to clipboard
@Serializable
data class BidiGenerateContentClientContent(val turns: List<Content>? = null, val turnComplete: Boolean? = null)

Incremental update of the current conversation delivered from the client.

Link copied to clipboard
@Serializable
data class BidiGenerateContentClientMessage(val setup: BidiGenerateContentSetup? = null, val clientContent: BidiGenerateContentClientContent? = null, val realtimeInput: BidiGenerateContentRealtimeInput? = null, val toolResponse: BidiGenerateContentToolResponse? = null)

Wrapper for all client messages. The JSON object must have exactly one of the fields.

Link copied to clipboard
@Serializable
data class BidiGenerateContentRealtimeInput(val mediaChunks: List<Blob>? = null, val audio: Blob? = null, val video: Blob? = null, val activityStart: ActivityStart? = null, val activityEnd: ActivityEnd? = null, val audioStreamEnd: Boolean? = null, val text: String? = null)

User input that is sent in real time.

Link copied to clipboard
@Serializable
data class BidiGenerateContentServerContent(val generationComplete: Boolean? = null, val turnComplete: Boolean? = null, val interrupted: Boolean? = null, val groundingMetadata: GroundingMetadata? = null, val inputTranscription: BidiGenerateContentTranscription? = null, val outputTranscription: BidiGenerateContentTranscription? = null, val urlContextMetadata: UrlContextMetadata? = null, val modelTurn: Content? = null)

Represents the bidi generate content server content.

Link copied to clipboard
@Serializable
data class BidiGenerateContentServerMessage(val usageMetadata: UsageMetadata? = null, val setupComplete: BidiGenerateContentSetupComplete? = null, val serverContent: BidiGenerateContentServerContent? = null, val toolCall: BidiGenerateContentToolCall? = null, val toolCallCancellation: BidiGenerateContentToolCallCancellation? = null, val goAway: GoAway? = null, val sessionResumptionUpdate: SessionResumptionUpdate? = null)

Response message for the BidiGenerateContent call.

Link copied to clipboard
@Serializable
data class BidiGenerateContentSetup(val model: String, val generationConfig: GenerationConfig? = null, val systemInstruction: Content? = null, val tools: Array<Tool>? = null, val realtimeInputConfig: RealtimeInputConfig? = null, val sessionResumption: SessionResumptionConfig? = null, val contextWindowCompression: ContextWindowCompressionConfig? = null, val inputAudioTranscription: AudioTranscriptionConfig? = null, val outputAudioTranscription: AudioTranscriptionConfig? = null, val proactivity: ProactivityConfig? = null)

Message to be sent in the first (and only in the first) BidiGenerateContentClientMessage. Contains configuration that will apply for the duration of the streaming RPC.

Link copied to clipboard

Represents the bidi generate content setup complete.

Link copied to clipboard
@Serializable
data class BidiGenerateContentToolCall(val functionCalls: List<FunctionCall>? = null)

Represents the bidi generate content tool call.

Link copied to clipboard
@Serializable
data class BidiGenerateContentToolCallCancellation(val ids: List<String>? = null)

Represents the bidi generate content tool call cancellation.

Link copied to clipboard
@Serializable
data class BidiGenerateContentToolResponse(val functionResponses: List<FunctionResponse>? = null)

Client generated response to a ToolCall received from the server.

Link copied to clipboard
@Serializable
data class BidiGenerateContentTranscription(val text: String? = null)

Represents the bidi generate content transcription.

Link copied to clipboard
@Serializable
data class Blob(val mimeType: String, val data: String)

Represents the blob.

Link copied to clipboard
@Serializable
data class ContextWindowCompressionConfig(val slidingWindow: SlidingWindow? = null, val triggerTokens: Long? = null)

Represents the context window compression config.

Link copied to clipboard
@Serializable
enum EndSensitivity : Enum<EndSensitivity>

Represents the end sensitivity.

Link copied to clipboard
class GeminiLive(apiKey: String, model: String, config: LiveConnectConfig? = null, json: Json = Json { ignoreUnknownKeys = true encodeDefaults = true }, client: HttpClient? = null)

A client for interacting with the Gemini Live API via WebSockets.

Link copied to clipboard
class GeminiLiveSession(session: WebSocketSession, incomingMessages: Channel<BidiGenerateContentServerMessage>, json: Json, listenerJob: Job)

Represents the gemini live session.

Link copied to clipboard
@Serializable
data class GoAway(val timeLeft: String? = null)

Represents the go away.

Link copied to clipboard
@Serializable
data class LiveConnectConfig(val responseModalities: Array<Modality>? = null, val speechConfig: SpeechConfig? = null, val systemInstruction: Content? = null, val tools: Array<Tool>? = null, val generationConfig: GenerationConfig? = null, val enableAffectiveDialog: Boolean? = null)

Represents the live connect config.

Link copied to clipboard
@Serializable
data class ProactivityConfig(val proactiveAudio: Boolean? = null)

Represents the proactivity config.

Link copied to clipboard
@Serializable
data class RealtimeInputConfig(val automaticActivityDetection: AutomaticActivityDetection? = null, val activityHandling: ActivityHandling? = null, val turnCoverage: TurnCoverage? = null)

Represents the realtime input config.

Link copied to clipboard
@Serializable
data class SessionResumptionConfig(val handle: String? = null)

Represents the session resumption config.

Link copied to clipboard
@Serializable
data class SessionResumptionUpdate(val newHandle: String? = null, val resumable: Boolean? = null)

Represents the session resumption update.

Link copied to clipboard
@Serializable
data class SlidingWindow(val targetTokens: Long? = null)

Represents the sliding window.

Link copied to clipboard
@Serializable
enum StartSensitivity : Enum<StartSensitivity>

Represents the start sensitivity.

Link copied to clipboard
@Serializable
enum TurnCoverage : Enum<TurnCoverage>

Represents the turn coverage.