Package-level declarations

Types

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(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)

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 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 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)

Configuration for how the model uses the provided function declarations.

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(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)

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.

data class GenerationConfigRoutingConfigAutoRoutingMode(val modelRoutingPreference: ModelRoutingPreference? = null)

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.

data class GenerationConfigRoutingConfigManualRoutingMode(val modelName: String? = null)

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 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: ERROR CLASS: Symbol not found for Duration?? = null)

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

Link copied to clipboard

Internal constants for LLM requests and responses.

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
data class LogprobsResultTopCandidates(val candidates: List<LogprobsResultCandidate>? = null)

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
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
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)

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 PromptFeedback(val blockReason: BlockedReason? = null, val blockReasonMessage: String? = null)

Feedback received from the prompt.

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)

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 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
enum Type : Enum<Type>

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: ERROR CLASS: Symbol not found for Duration?? = null, val endOffset: ERROR CLASS: Symbol not found for Duration?? = null, val fps: Double? = null)

Metadata describing how to interpret a video Part.