Package-level declarations

Types

Link copied to clipboard

How the start of user activity affects an in-flight model response.

Link copied to clipboard
data class AudioTranscriptionConfig(val languageCodes: List<String>? = null, val customVocabulary: List<String>? = null, val diarization: Boolean? = null, val wordTimestamp: Boolean? = null)

Configures transcription of audio on a live connection.

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

Configures server-side detection of user activity (voice activity detection).

Link copied to clipboard
data class Blob(val mimeType: String? = null, val displayName: String? = null, val data: ByteArray? = null)

Represents binary data.

Link copied to clipboard

The reason why the prompt was blocked.

Link copied to clipboard
data class Candidate @JvmOverloads constructor(val content: Content, val finishReason: FinishReason? = null, val finishMessage: String? = null, val citationMetadata: CitationMetadata? = null, val groundingMetadata: GroundingMetadata? = null, val avgLogprobs: Double? = null, val logprobsResult: LogprobsResult? = null, val continuationToken: ByteArray? = null)

Represents a possible response from the model.

Link copied to clipboard
data class Citation(val title: String? = null, val uri: String? = null, val startIndex: Int? = null, val endIndex: Int? = null)

Represents a citation to a source.

Link copied to clipboard
data class CitationMetadata(val citationSources: List<Citation> = emptyList())

Metadata about citations associated with the candidate.

Link copied to clipboard
data class CodeExecutionResult(val outcome: Outcome? = null, val output: String? = null, val id: String? = null)

The result of executing an ExecutableCode. Produced when the code-execution tool is used.

Link copied to clipboard
data class Content(val role: String? = null, val parts: List<Part> = emptyList())

Represents the content of a response, including its role and parts.

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

Enables context window compression, which keeps a live session's context below a given length so a long conversation does not exhaust it.

Link copied to clipboard

How readily the model treats a pause as the end of speech.

Link copied to clipboard
data class ExecutableCode(val code: String? = null, val language: Language? = null, val id: String? = null)

Code generated by the model to be executed. Produced when the code-execution tool is used, alongside a matching CodeExecutionResult.

Link copied to clipboard
data class FileData(val mimeType: String? = null, val displayName: String? = null, val fileUri: String? = null)

Represents file data.

Link copied to clipboard

The reason why the generation finished.

Link copied to clipboard
data class FunctionCall(val name: String = "", val args: Map<String, Any?> = emptyMap(), val id: String? = null, val partialArgs: List<PartialArg>? = null, val willContinue: Boolean? = null)

Represents a function call in a generation response.

Link copied to clipboard
data class FunctionCallingConfig(val allowedFunctionNames: List<String>? = null, val streamFunctionCallArguments: Boolean? = null, val mode: FunctionCallingConfigMode? = null)

Configuration for how the model uses the provided function declarations.

Link copied to clipboard

The mode controlling how the model chooses whether to emit function calls.

Link copied to clipboard
data class FunctionDeclaration(val name: String, val description: String, val parameters: Schema? = null, val response: Schema? = null)

Represents a function declaration for tool calling.

Link copied to clipboard
data class FunctionResponse(val name: String, val response: Map<String, Any?> = emptyMap(), val id: String? = null)

Represents a function response.

Link copied to clipboard
data class GenerateContentConfig @JvmOverloads constructor(val tools: List<Tool>? = null, val labels: Map<String, String>? = null, val systemInstruction: Content? = null, val temperature: Float? = null, val topP: Float? = null, val topK: Int? = null, val candidateCount: Int? = null, val maxOutputTokens: Int? = null, val stopSequences: List<String>? = null, val responseMimeType: String? = null, val responseSchema: Schema? = null, val thinkingConfig: ThinkingConfig? = null, val toolConfig: ToolConfig? = null, val safetySettings: List<SafetySetting>? = null, val mediaResolution: MediaResolution? = null, val serviceTier: ServiceTier? = null, val presencePenalty: Float? = null, val frequencyPenalty: Float? = null, val responseLogprobs: Boolean? = null, val routingConfig: GenerationConfigRoutingConfig? = null, val cachedContent: String? = null, val responseModalities: List<String>? = null, val seed: Int? = null, val continuationToken: ByteArray? = null)

Configuration for generating content.

Link copied to clipboard
data class GenerateContentResponse(val candidates: List<Candidate> = emptyList(), val promptFeedback: PromptFeedback? = null, val usageMetadata: UsageMetadata? = null, val modelVersion: String? = null)

Response from the generate content request.

Link copied to clipboard

Configuration for routing a request to a specific model, either automatically via autoMode or manually via manualMode. Not supported in the Gemini API.

Configuration for automated routing, where the model is selected by the pretrained routing model and the customer-provided modelRoutingPreference. Not supported in the Gemini API.

Configuration for manual routing, where the model is selected by the given modelName. Only public LLM models are accepted. Not supported in the Gemini API.

Link copied to clipboard
data class GoogleMaps(val enableWidget: Boolean? = null)

Tool to retrieve knowledge from Google Maps.

Link copied to clipboard
data class GoogleSearch(val excludeDomains: List<String> = emptyList())

Represents a Google Search tool.

Link copied to clipboard
data class GroundingChunk(val web: GroundingChunkWeb? = null, val retrievedContext: GroundingChunkRetrievedContext? = null, val maps: GroundingChunkMaps? = null)

A single cited source chunk that grounds part of the model's response.

Link copied to clipboard
data class GroundingChunkMaps(val uri: String? = null, val title: String? = null, val placeId: String? = null, val text: String? = null)

A grounding chunk sourced from Google Maps.

Link copied to clipboard
data class GroundingChunkRetrievedContext(val uri: String? = null, val title: String? = null, val text: String? = null)

A grounding chunk sourced from a retrieval (RAG) context.

Link copied to clipboard
data class GroundingChunkWeb(val uri: String? = null, val title: String? = null, val domain: String? = null)

A grounding chunk sourced from the open web.

Link copied to clipboard
data class GroundingMetadata(val imageSearchQueries: List<String>? = null, val groundingChunks: List<GroundingChunk>? = null, val groundingSupports: List<GroundingSupport>? = null, val webSearchQueries: List<String>? = null, val retrievalQueries: List<String>? = null, val searchEntryPoint: SearchEntryPoint? = null, val retrievalMetadata: RetrievalMetadata? = null)

Metadata returned to client when grounding is enabled.

Link copied to clipboard
data class GroundingSupport(val segment: Segment? = null, val groundingChunkIndices: List<Int>? = null, val confidenceScores: List<Float>? = null)

Maps a Segment of the response to the grounding chunks that support it.

Link copied to clipboard

The method used to block content for a HarmCategory. Not supported by the Gemini API.

Link copied to clipboard

The probability threshold at or above which content is blocked for a HarmCategory.

Link copied to clipboard

The category of a harm that a SafetySetting applies to.

Link copied to clipboard
data class HttpOptions(val baseUrl: String? = null, val apiVersion: String? = null, val headers: Map<String, String>? = null, val timeout: Duration? = null)

ADK-owned HTTP transport options for calls a com.google.adk.kt.models.Model makes to its backend.

Link copied to clipboard

The programming language of an ExecutableCode part.

Link copied to clipboard
data class LiveConnectConfig(val responseModalities: List<Modality>? = null, val temperature: Float? = null, val topP: Float? = null, val topK: Int? = null, val maxOutputTokens: Int? = null, val mediaResolution: MediaResolution? = null, val seed: Int? = null, val speechConfig: SpeechConfig? = null, val thinkingConfig: ThinkingConfig? = null, val enableAffectiveDialog: Boolean? = null, val systemInstruction: Content? = null, val tools: List<Tool>? = null, val sessionResumption: SessionResumptionConfig? = null, val inputAudioTranscription: AudioTranscriptionConfig? = null, val outputAudioTranscription: AudioTranscriptionConfig? = null, val realtimeInputConfig: RealtimeInputConfig? = null, val contextWindowCompression: ContextWindowCompressionConfig? = null, val proactivity: ProactivityConfig? = null, val safetySettings: List<SafetySetting>? = null)

Configuration for a live (bidirectional streaming) model connection.

Link copied to clipboard
data class LiveServerGoAway(val timeLeft: Duration? = null)

Warning that the server will stop serving this connection shortly.

Link copied to clipboard
data class LiveServerSessionResumptionUpdate(val newHandle: String? = null, val resumable: Boolean? = null, val lastConsumedClientMessageIndex: Long? = null)

A handle for resuming this session on a later connection.

Link copied to clipboard
data class LogprobsResult(val chosenCandidates: List<LogprobsResultCandidate>? = null, val topCandidates: List<LogprobsResultTopCandidates>? = null, val logProbabilitySum: Double? = null)

Detailed log probabilities for the chosen and top candidate tokens.

Link copied to clipboard
data class LogprobsResultCandidate(val token: String? = null, val tokenId: Int? = null, val logProbability: Double? = null)

A single token candidate and its log probability.

Link copied to clipboard

The top token candidates at a single decoding step.

Link copied to clipboard

The modality that a token count applies to.

Link copied to clipboard

The resolution used when processing media inputs.

Link copied to clipboard

A modality the model can return in a response.

Link copied to clipboard
data class ModalityTokenCount(val modality: MediaModality? = null, val tokenCount: Int? = null)

A breakdown of token usage by modality.

Link copied to clipboard

The model routing preference for automated routing.

Link copied to clipboard
data class MultiSpeakerVoiceConfig(val speakerVoiceConfigs: List<SpeakerVoiceConfig>? = null)

Configuration for a multi-speaker text-to-speech request.

Link copied to clipboard

The outcome of executing an ExecutableCode part.

Link copied to clipboard
class Part(val text: String? = null, val inlineData: Blob? = null, val fileData: FileData? = null, val functionCall: FunctionCall? = null, val functionResponse: FunctionResponse? = null, val thought: Boolean? = null, val thoughtSignature: ByteArray? = null, val videoMetadata: VideoMetadata? = null, val toolCall: ToolCall? = null, val toolResponse: ToolResponse? = null, val partMetadata: Map<String, Any?>? = null, val executableCode: ExecutableCode? = null, val codeExecutionResult: CodeExecutionResult? = null, val mediaResolution: PartMediaResolution? = null)

A part of a multi-modal prompt or response.

Link copied to clipboard
data class PartialArg(val value: PartialArgValue? = null, val jsonPath: String? = null, val willContinue: Boolean? = null)

Partial argument value of the function call.

Link copied to clipboard
sealed interface PartialArgValue

Represents one of the possible values within a PartialArg.

Link copied to clipboard
data class PartMediaResolution(val level: PartMediaResolutionLevel? = null, val numTokens: Int? = null)

The media resolution applied to a Part's media input.

Link copied to clipboard

The tokenization quality used for a Part's media, set via PartMediaResolution.

Link copied to clipboard
data class PrebuiltVoiceConfig(val voiceName: String? = null)

Configuration for a prebuilt voice.

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

Config for proactivity features.

Link copied to clipboard
data class PromptFeedback(val blockReason: BlockedReason? = null, val blockReasonMessage: String? = null)

Feedback received from the prompt.

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

Configures how realtime input is interpreted as conversational turns.

Link copied to clipboard
data class ReplicatedVoiceConfig(val mimeType: String? = null, val voiceSampleAudio: ByteArray? = null, val consentAudio: ByteArray? = null, val voiceConsentSignature: VoiceConsentSignature? = null)

Configuration for a replicated (cloned) voice.

Link copied to clipboard
data class Retrieval(val vertexAiSearch: VertexAISearch? = null, val vertexRagStore: VertexRagStore? = null)

Defines a retrieval tool that model can call to access external knowledge.

Link copied to clipboard
data class RetrievalMetadata(val googleSearchDynamicRetrievalScore: Float? = null)

Metadata about the retrieval step performed for a grounded response.

Link copied to clipboard
object Role

Standard roles for content and events.

Link copied to clipboard
data class SafetySetting(val category: HarmCategory? = null, val threshold: HarmBlockThreshold? = null, val method: HarmBlockMethod? = null)

A per-request safety setting controlling the block threshold for a single HarmCategory.

Link copied to clipboard
data class Schema(val type: Type? = null, val properties: Map<String, Schema>? = null, val items: Schema? = null, val required: List<String>? = null, val description: String? = null, val enum: List<String>? = null, val format: String? = null, val nullable: Boolean? = null, val default: Any? = null, val anyOf: List<Schema>? = null, val title: String? = null, val pattern: String? = null, val minimum: Double? = null, val maximum: Double? = null, val minLength: Long? = null, val maxLength: Long? = null, val minItems: Long? = null, val maxItems: Long? = null, val minProperties: Long? = null, val maxProperties: Long? = null)

Schema is used to define the format of input/output data.

Link copied to clipboard
data class SearchEntryPoint(val renderedContent: String? = null)

The Google Search entry point used to render search suggestions for grounded responses.

Link copied to clipboard
data class Segment(val startIndex: Int? = null, val endIndex: Int? = null, val partIndex: Int? = null, val text: String? = null)

A contiguous segment of the response content that a GroundingSupport refers to.

Link copied to clipboard

The service tier requested for a generate content request.

Link copied to clipboard
data class SessionResumptionConfig(val handle: String? = null, val transparent: Boolean? = null)

Configures the session resumption mechanism.

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

Sliding-window context compression: the oldest turns are dropped once the window is exceeded.

Link copied to clipboard
data class SpeakerVoiceConfig(val speaker: String? = null, val voiceConfig: VoiceConfig? = null)

Configuration for a single speaker in a multi-speaker setup.

Link copied to clipboard
data class SpeechConfig(val voiceConfig: VoiceConfig? = null, val languageCode: String? = null, val multiSpeakerVoiceConfig: MultiSpeakerVoiceConfig? = null)

Config for speech generation and transcription.

Link copied to clipboard

How readily the model treats incoming audio as the start of speech.

Link copied to clipboard
data class ThinkingConfig(val includeThoughts: Boolean? = null, val thinkingBudget: Int? = null, val thinkingLevel: ThinkingLevel? = null)

The thinking features configuration.

Link copied to clipboard

The number of thoughts tokens that the model should generate.

Link copied to clipboard
data class Tool(val functionDeclarations: List<FunctionDeclaration>? = null, val googleSearch: GoogleSearch? = null, val googleMaps: GoogleMaps? = null, val retrieval: Retrieval? = null, val urlContext: UrlContext? = null)

Represents a GenAI tool definition.

Link copied to clipboard
data class ToolCall(val id: String? = null, val toolType: ToolType? = null, val args: Map<String, Any?>? = null)

A tool call the model runs on its own server side.

Link copied to clipboard
data class ToolConfig(val functionCallingConfig: FunctionCallingConfig? = null)

Configuration shared across all tools provided in a request.

Link copied to clipboard
data class ToolResponse(val id: String? = null, val toolType: ToolType? = null, val response: Map<String, Any?>? = null)

The output of a server-side ToolCall the model ran itself.

Link copied to clipboard
value class ToolType(val value: String)

The type of tool a server-side ToolCall invoked.

Link copied to clipboard
data class Transcription(val text: String? = null, val finished: Boolean? = null, val languageCode: String? = null, val speakerLabel: String? = null, val words: List<WordInfo>? = null)

A transcription of audio, either the user's input or the model's output.

Link copied to clipboard
Link copied to clipboard

Which realtime input counts towards the user's turn.

Link copied to clipboard

The value type of the schema.

Link copied to clipboard

Tool to support URL context retrieval.

Link copied to clipboard
data class UsageMetadata(val promptTokenCount: Int? = null, val candidatesTokenCount: Int? = null, val totalTokenCount: Int? = null, val thoughtsTokenCount: Int? = null, val toolUsePromptTokenCount: Int? = null, val cachedContentTokenCount: Int? = null, val promptTokensDetails: List<ModalityTokenCount>? = null, val candidatesTokensDetails: List<ModalityTokenCount>? = null, val toolUsePromptTokensDetails: List<ModalityTokenCount>? = null, val trafficType: String? = null)

Usage metadata for a generate content request.

Link copied to clipboard
data class VertexAISearch(val dataStoreSpecs: List<VertexAISearchDataStoreSpec>? = null, val datastore: String? = null, val engine: String? = null, val filter: String? = null, val maxResults: Int? = null)

Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive.

Link copied to clipboard
data class VertexAISearchDataStoreSpec(val dataStore: String? = null, val filter: String? = null)

Define data stores within engine to filter on in a search call and configurations for those data stores.

Link copied to clipboard
data class VertexRagStore(val ragCorpora: List<String>? = null, val ragResources: List<VertexRagStoreRagResource>? = null, val similarityTopK: Int? = null, val vectorDistanceThreshold: Double? = null)

Retrieve from a Vertex RAG store for grounding.

Link copied to clipboard
data class VertexRagStoreRagResource(val ragCorpus: String? = null, val ragFileIds: List<String>? = null)

The representation of a RAG source for a VertexRagStore.

Link copied to clipboard
data class VideoMetadata(val startOffset: Duration? = null, val endOffset: Duration? = null, val fps: Double? = null)

Metadata describing how to interpret a video Part.

Link copied to clipboard
data class VoiceActivity(val voiceActivityType: VoiceActivityType? = null, val audioOffset: Duration? = null)

A server-detected change in whether the user is speaking.

Link copied to clipboard

Which edge of a stretch of user speech the server detected.

Link copied to clipboard
data class VoiceConfig(val replicatedVoiceConfig: ReplicatedVoiceConfig? = null, val prebuiltVoiceConfig: PrebuiltVoiceConfig? = null)

The configuration for the voice to use.

Link copied to clipboard
data class VoiceConsentSignature(val signature: String? = null)

A server-issued signature attesting that voice consent was already verified.

Link copied to clipboard
data class WordInfo(val word: String? = null, val startOffset: String? = null, val endOffset: String? = null)

A single transcribed word and where it falls in the audio.