# Package-level declarations

## Types

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

Represents binary data.

BlockedReason
Link copied to clipboard
enum BlockedReason : Enum<BlockedReason>

The reason why the prompt was blocked.

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

Represents a possible response from the model.

Citation
Link copied to clipboard
data class Citation(val title: String? = null)

Represents a citation to a source.

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

Metadata about citations associated with the candidate.

Content
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.

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

Represents file data.

FinishReason
Link copied to clipboard
enum FinishReason : Enum<FinishReason>

The reason why the generation finished.

FunctionCall
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.

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

Represents a function declaration for tool calling.

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

Represents a function response.

GenerateContentConfig
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 thinkingConfig: ThinkingConfig? = null)

Configuration for generating content.

GenerateContentResponse
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.

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

Tool to retrieve knowledge from Google Maps.

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

Represents a Google Search tool.

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

Metadata returned to client when grounding is enabled.

LlmConstants
Link copied to clipboard
object LlmConstants

Internal constants for LLM requests and responses.

Part
Link copied to clipboard
class Part constructor(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 opaqueData: Any? = null)

A part of a multi-modal prompt or response.

PartialArg
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.

PartialArgValue
Link copied to clipboard
sealed interface PartialArgValue

Represents one of the possible values within a PartialArg.

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

Feedback received from the prompt.

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

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

Role
Link copied to clipboard
object Role

Standard roles for content and events.

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

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

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

The thinking features configuration.

ThinkingLevel
Link copied to clipboard
enum ThinkingLevel : Enum<ThinkingLevel>

The number of thoughts tokens that the model should generate.

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

Represents a GenAI tool definition.

Type
Link copied to clipboard
enum Type : Enum<Type>

The value type of the schema.

UsageMetadata
Link copied to clipboard
data class UsageMetadata(val promptTokenCount: Int? = null, val candidatesTokenCount: Int? = null, val totalTokenCount: Int? = null)

Usage metadata for a generate content request.

VertexAISearch
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.

VertexAISearchDataStoreSpec
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.