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)

Represents a possible response from the model.

Link copied to clipboard
data class Citation(val title: String? = 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 FunctionDeclaration(val name: String, val description: String, val parameters: 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 thinkingConfig: ThinkingConfig? = 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
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 GroundingMetadata(val imageSearchQueries: List<String> = emptyList())

Metadata returned to client when grounding is enabled.

Link copied to clipboard

Internal constants for LLM requests and responses.

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.

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)

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

Link copied to clipboard
object Role

Standard roles for content and events.

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.

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)

Represents a GenAI tool definition.

Link copied to clipboard
enum Type : Enum<Type>

The value type of the schema.

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.

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.