Package-level declarations

Types

Link copied to clipboard
@Serializable
data class ApiAuth(val apiKeyConfig: ApiAuthApiKeyConfig? = null)

The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class ApiAuthApiKeyConfig(val apiKeySecretVersion: String? = null, val apiKeyString: String? = null)

The API secret. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class ApiKeyConfig(val apiKeySecret: String? = null, val apiKeyString: String? = null, val httpElementLocation: HttpElementLocation? = null, val name: String? = null)

Config for authentication with API key. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class ApiSpec(val value: String)

The API spec that the external API implements. This enum is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class AuthConfig(val apiKey: String? = null, val apiKeyConfig: ApiKeyConfig? = null, val authType: AuthType? = null, val googleServiceAccountConfig: AuthConfigGoogleServiceAccountConfig? = null, val httpBasicAuthConfig: AuthConfigHttpBasicAuthConfig? = null, val oauthConfig: AuthConfigOauthConfig? = null, val oidcConfig: AuthConfigOidcConfig? = null)

The authentication config to access the API.

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

Config for Google Service Account Authentication. This data type is not supported in Gemini API.

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

Config for HTTP Basic Authentication. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class AuthConfigOauthConfig(val accessToken: String? = null, val serviceAccount: String? = null)

Config for user oauth. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class AuthConfigOidcConfig(val idToken: String? = null, val serviceAccount: String? = null)

Config for user OIDC auth. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class AuthType(val value: String)

Type of auth scheme. This enum is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class Behavior(val value: String)

Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method.

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

A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video.

Link copied to clipboard
@Serializable
value class BlockedReason(val value: String)

Output only. The reason why the prompt was blocked.

Link copied to clipboard
object ByteArrayAsBase64Serializer : KSerializer<ByteArray>

A custom serializer for ByteArray that encodes to and decodes from Base64 strings.

Link copied to clipboard
@Serializable
data class CachedContent(val name: String? = null, val displayName: String? = null, val model: String? = null, val createTime: Instant? = null, val updateTime: Instant? = null, val expireTime: Instant? = null, val usageMetadata: CachedContentUsageMetadata? = null)

A resource used in LLM queries for users to explicitly specify what to cache.

Link copied to clipboard
@Serializable
data class CachedContentUsageMetadata(val audioDurationSeconds: Int? = null, val imageCount: Int? = null, val textCount: Int? = null, val totalTokenCount: Int? = null, val videoDurationSeconds: Int? = null)

Metadata on the usage of the cached content.

Link copied to clipboard
@Serializable
data class Candidate(val content: Content? = null, val citationMetadata: CitationMetadata? = null, val finishMessage: String? = null, val tokenCount: Int? = null, val finishReason: FinishReason? = null, val groundingMetadata: GroundingMetadata? = null, val avgLogprobs: Double? = null, val index: Int? = null, val logprobsResult: LogprobsResult? = null, val safetyRatings: List<SafetyRating>? = null, val urlContextMetadata: UrlContextMetadata? = null)

A response candidate generated from the model.

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

A citation for a piece of generatedcontent. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class CitationMetadata(val citations: List<Citation>? = null)

Citation information when the model quotes another source.

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

Result of executing the ExecutableCode. Generated only when the CodeExecution tool is used.

Link copied to clipboard
@Serializable
data class ComputerUse(val environment: Environment? = null, val excludedPredefinedFunctions: List<String>? = null, val enablePromptInjectionDetection: Boolean? = null, val disabledSafetyPolicies: List<SafetyPolicy>? = null)

Tool to support computer use.

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

Contains the multi-part content of a message.

Link copied to clipboard
@Serializable
data class CreateCachedContentConfig(val httpOptions: HttpOptions? = null, val ttl: Duration? = null, val expireTime: Instant? = null, val displayName: String? = null, val contents: List<Content>? = null, val systemInstruction: Content? = null, val tools: List<Tool>? = null, val toolConfig: ToolConfig? = null, val kmsKeyName: String? = null)

Optional configuration for cached content creation.

Link copied to clipboard
@Serializable
data class CreateCachedContentParameters(val model: String? = null, val config: CreateCachedContentConfig? = null)

Parameters for caches.create method.

Link copied to clipboard
@Serializable
data class DeleteCachedContentConfig(val httpOptions: HttpOptions? = null)

Optional parameters for caches.delete method.

Link copied to clipboard
@Serializable
data class DeleteCachedContentParameters(val name: String? = null, val config: DeleteCachedContentConfig? = null)

Parameters for caches.delete method.

Link copied to clipboard
@Serializable
data class DeleteCachedContentResponse(val sdkHttpResponse: HttpResponse? = null)

Empty response for caches.delete method.

Link copied to clipboard
object DurationStringSerializer : KSerializer<Duration>

A custom serializer for Duration that formats it as a string ending in 's'.

Link copied to clipboard
@Serializable
data class DynamicRetrievalConfig(val dynamicThreshold: Double? = null, val mode: DynamicRetrievalConfigMode? = null)

Describes the options to customize dynamic retrieval.

Link copied to clipboard
@Serializable
value class DynamicRetrievalConfigMode(val value: String)

The mode of the predictor to be used in dynamic retrieval.

Link copied to clipboard
@Serializable
data class EnterpriseWebSearch(val blockingConfidence: PhishBlockThreshold? = null, val excludeDomains: List<String>? = null)

Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class Environment(val value: String)

The environment being operated.

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

Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the CodeExecution tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated.

Link copied to clipboard
@Serializable
data class ExternalApi(val apiAuth: ApiAuth? = null, val apiSpec: ApiSpec? = null, val authConfig: AuthConfig? = null, val elasticSearchParams: ExternalApiElasticSearchParams? = null, val endpoint: String? = null, val simpleSearchParams: ExternalApiSimpleSearchParams? = null)

Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class ExternalApiElasticSearchParams(val index: String? = null, val numHits: Int? = null, val searchTemplate: String? = null)

The search parameters to use for the ELASTIC_SEARCH spec. This data type is not supported in Gemini API.

Link copied to clipboard

The search parameters to use for SIMPLE_SEARCH spec. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class FeatureSelectionPreference(val value: String)

Options for feature selection preference.

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

URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage.

Link copied to clipboard
@Serializable
data class FileSearch(val fileSearchStoreNames: List<String>? = null, val metadataFilter: String? = null, val topK: Int? = null)

The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. This data type is not supported in Vertex AI.

Link copied to clipboard
@Serializable
value class FinishReason(val value: String)

Output only. The reason why the model stopped generating tokens.

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

A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values.

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

Function calling config.

Link copied to clipboard
@Serializable
value class FunctionCallingConfigMode(val value: String)

Function calling mode.

Link copied to clipboard
@Serializable
data class FunctionDeclaration(val description: String? = null, val name: String? = null, val parameters: Schema? = null, val parametersJsonSchema: JsonElement? = null, val response: Schema? = null, val responseJsonSchema: JsonElement? = null, val behavior: Behavior? = null)

Structured representation of a function declaration as defined by the OpenAPI 3.0 specification. Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client.

Link copied to clipboard
@Serializable
data class FunctionResponse(val willContinue: Boolean? = null, val scheduling: FunctionResponseScheduling? = null, val parts: List<FunctionResponsePart>? = null, val id: String? = null, val name: String? = null, val response: Map<String, JsonElement>? = null)

The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a FunctionCall made based on model prediction.

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

Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field.

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

URI based data for function response. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class FunctionResponsePart(val inlineData: FunctionResponseBlob? = null, val fileData: FunctionResponseFileData? = null)

A datatype containing media that is part of a FunctionResponse message. A FunctionResponsePart consists of data which has an associated datatype. A FunctionResponsePart can only contain one of the accepted types in FunctionResponsePart.data. A FunctionResponsePart must have a fixed IANA MIME type identifying the type and subtype of the media if the inline_data field is filled with raw bytes.

Link copied to clipboard
@Serializable
value class FunctionResponseScheduling(val value: String)

Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.

Link copied to clipboard
@Serializable
data class GenerateContentConfig(val httpOptions: HttpOptions? = null, val shouldReturnHttpResponse: Boolean? = null, val systemInstruction: Content? = null, val temperature: Double? = null, val topP: Double? = null, val topK: Double? = null, val candidateCount: Int? = null, val maxOutputTokens: Int? = null, val stopSequences: List<String>? = null, val responseLogprobs: Boolean? = null, val logprobs: Int? = null, val presencePenalty: Double? = null, val frequencyPenalty: Double? = null, val seed: Int? = null, val responseMimeType: String? = null, val responseSchema: Schema? = null, val responseJsonSchema: JsonElement? = null, val modelSelectionConfig: ModelSelectionConfig? = null, val safetySettings: List<SafetySetting>? = null, val tools: List<Tool>? = null, val toolConfig: ToolConfig? = null, val cachedContent: String? = null, val responseModalities: List<String>? = null, val mediaResolution: MediaResolution? = null, val speechConfig: SpeechConfig? = null, val audioTimestamp: Boolean? = null, val thinkingConfig: ThinkingConfig? = null, val imageConfig: ImageConfig? = null, val enableEnhancedCivicAnswers: Boolean? = null, val modelArmorConfig: ModelArmorConfig? = null, val serviceTier: ServiceTier? = null, val routingConfig: GenerationConfigRoutingConfig? = null, val labels: Map<String, String>? = null)

Optional model configuration parameters.

Link copied to clipboard
@Serializable
data class GenerateContentParameters(val model: String? = null, val contents: List<Content>? = null, val config: GenerateContentConfig? = null)

Config for models.generate_content parameters.

Link copied to clipboard
@Serializable
data class GenerateContentResponse(val sdkHttpResponse: HttpResponse? = null, val candidates: List<Candidate>? = null, val createTime: Instant? = null, val modelVersion: String? = null, val promptFeedback: GenerateContentResponsePromptFeedback? = null, val responseId: String? = null, val usageMetadata: GenerateContentResponseUsageMetadata? = null, val modelStatus: ModelStatus? = null)

Response message for PredictionService.GenerateContent.

Link copied to clipboard
@Serializable
data class GenerateContentResponsePromptFeedback(val blockReason: BlockedReason? = null, val blockReasonMessage: String? = null, val safetyRatings: List<SafetyRating>? = null)

Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations.

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

Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. This data type is not supported in Gemini API.

Link copied to clipboard

The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. This data type is not supported in Gemini API.

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

The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. This data type is not supported in Gemini API.

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

The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class GetCachedContentConfig(val httpOptions: HttpOptions? = null)

Optional parameters for caches.get method.

Link copied to clipboard
@Serializable
data class GetCachedContentParameters(val name: String? = null, val config: GetCachedContentConfig? = null)

Parameters for caches.get method.

Link copied to clipboard
@Serializable
data class GoogleMaps(val authConfig: AuthConfig? = null, val enableWidget: Boolean? = null)

Tool to retrieve knowledge from Google Maps.

Link copied to clipboard
@Serializable
data class GoogleSearch(val searchTypes: SearchTypes? = null, val blockingConfidence: PhishBlockThreshold? = null, val excludeDomains: List<String>? = null, val timeRangeFilter: Interval? = null)

GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.

Link copied to clipboard
@Serializable
data class GoogleSearchRetrieval(val dynamicRetrievalConfig: DynamicRetrievalConfig? = null)

Tool to retrieve public web data for grounding, powered by Google.

Link copied to clipboard
@Serializable
data class GoogleTypeDate(val day: Int? = null, val month: Int? = null, val year: Int? = null)

Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This data type is not supported in Gemini API.

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

A piece of evidence that supports a claim made by the model.

Link copied to clipboard
@Serializable
data class GroundingChunkCustomMetadata(val key: String? = null, val numericValue: Double? = null, val stringListValue: GroundingChunkStringList? = null, val stringValue: String? = null)

User provided metadata about the GroundingFact. This data type is not supported in Vertex AI.

Link copied to clipboard
@Serializable
data class GroundingChunkImage(val sourceUri: String? = null, val imageUri: String? = null, val title: String? = null, val domain: String? = null)

An Image chunk is a piece of evidence that comes from an image search result. It contains the URI of the image search result and the URI of the image. This is used to provide the user with a link to the source of the information.

Link copied to clipboard
@Serializable
data class GroundingChunkMaps(val placeAnswerSources: GroundingChunkMapsPlaceAnswerSources? = null, val placeId: String? = null, val text: String? = null, val title: String? = null, val uri: String? = null, val route: GroundingChunkMapsRoute? = null)

A Maps chunk is a piece of evidence that comes from Google Maps.

Link copied to clipboard
@Serializable
data class GroundingChunkMapsPlaceAnswerSources(val reviewSnippet: List<GroundingChunkMapsPlaceAnswerSourcesReviewSnippet>? = null, val flagContentUri: String? = null, val reviewSnippets: List<GroundingChunkMapsPlaceAnswerSourcesReviewSnippet>? = null)

The sources that were used to generate the place answer.

@Serializable
data class GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution(val displayName: String? = null, val photoUri: String? = null, val uri: String? = null)

Author attribution for a photo or review.

@Serializable
data class GroundingChunkMapsPlaceAnswerSourcesReviewSnippet(val authorAttribution: GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution? = null, val flagContentUri: String? = null, val googleMapsUri: String? = null, val relativePublishTimeDescription: String? = null, val review: String? = null, val reviewId: String? = null, val title: String? = null)

Encapsulates a review snippet.

Link copied to clipboard
@Serializable
data class GroundingChunkMapsRoute(val distanceMeters: Int? = null, val duration: Duration? = null, val encodedPolyline: String? = null)

Route information from Google Maps. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class GroundingChunkRetrievedContext(val documentName: String? = null, val ragChunk: RagChunk? = null, val text: String? = null, val title: String? = null, val uri: String? = null, val customMetadata: List<GroundingChunkCustomMetadata>? = null, val fileSearchStore: String? = null, val pageNumber: Int? = null, val mediaId: String? = null)

Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset.

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

A list of string values. This data type is not supported in Vertex AI.

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

A Web chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information.

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

Information for various kinds of grounding.

Link copied to clipboard
@Serializable
data class GroundingMetadataSourceFlaggingUri(val flagContentUri: String? = null, val sourceId: String? = null)

A URI that can be used to flag a place or review for inappropriate content. This is populated only when the grounding source is Google Maps. This data type is not supported in Gemini API.

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

Grounding support.

Link copied to clipboard
@Serializable
value class HarmBlockMethod(val value: String)

The method for blocking content. If not specified, the default behavior is to use the probability score. This enum is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class HarmBlockThreshold(val value: String)

The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.

Link copied to clipboard
@Serializable
value class HarmCategory(val value: String)

The harm category to be blocked.

Link copied to clipboard
@Serializable
value class HarmProbability(val value: String)

Output only. The probability of harm for this category.

Link copied to clipboard
@Serializable
value class HarmSeverity(val value: String)

Output only. The severity of harm for this category. This enum is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class HttpElementLocation(val value: String)

The location of the API key. This enum is not supported in Gemini API.

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

HTTP options to be used in each of the requests.

Link copied to clipboard
@Serializable
data class HttpResponse(val headers: Map<String, String>? = null, val body: String? = null)

A wrapper class for the http response.

Link copied to clipboard
@Serializable
data class ImageConfig(val aspectRatio: String? = null, val imageSize: String? = null, val personGeneration: String? = null, val prominentPeople: ProminentPeople? = null, val outputMimeType: String? = null, val outputCompressionQuality: Int? = null, val imageOutputOptions: ImageConfigImageOutputOptions? = null)

The image generation configuration to be used in GenerateContentConfig.

Link copied to clipboard
@Serializable
data class ImageConfigImageOutputOptions(val compressionQuality: Int? = null, val mimeType: String? = null)

The image output format for generated images. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
class ImageSearch

Image search for grounding and related configurations.

Link copied to clipboard
expect class Instant
actual class Instant(val value: <Error class: unknown class>)
Link copied to clipboard
object InstantSerializer : KSerializer<Instant>

A custom serializer for Instant that encodes to and decodes from ISO-8601 strings.

Link copied to clipboard
@Serializable
data class Interval(val endTime: Instant? = null, val startTime: Instant? = null)

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.

Link copied to clipboard
@Serializable
value class Language(val value: String)

Programming language of the code.

Link copied to clipboard
@Serializable
data class LatLng(val latitude: Double? = null, val longitude: Double? = null)

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.

Link copied to clipboard
@Serializable
data class ListCachedContentsConfig(val httpOptions: HttpOptions? = null, val pageSize: Int? = null, val pageToken: String? = null)

Config for caches.list method.

Link copied to clipboard
@Serializable
data class ListCachedContentsParameters(val config: ListCachedContentsConfig? = null)

Parameters for caches.list method.

Link copied to clipboard
@Serializable
data class ListCachedContentsResponse(val sdkHttpResponse: HttpResponse? = null, val nextPageToken: String? = null, val cachedContents: List<CachedContent>? = null)
Link copied to clipboard
@Serializable
data class LogprobsResult(val chosenCandidates: List<LogprobsResultCandidate>? = null, val topCandidates: List<LogprobsResultTopCandidates>? = null, val logProbabilitySum: Double? = null)

The log probabilities of the tokens generated by the model. This is useful for understanding the model's confidence in its predictions and for debugging. For example, you can use log probabilities to identify when the model is making a less confident prediction or to explore alternative responses that the model considered. A low log probability can also indicate that the model is "hallucinating" or generating factually incorrect information.

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

A single token and its associated log probability.

Link copied to clipboard
@Serializable
data class LogprobsResultTopCandidates(val candidates: List<LogprobsResultCandidate>? = null)

A list of the top candidate tokens and their log probabilities at each decoding step. This can be used to see what other tokens the model considered.

Link copied to clipboard
@Serializable
data class McpServer(val name: String? = null, val streamableHttpTransport: StreamableHttpTransport? = null)

A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6. This data type is not supported in Vertex AI.

Link copied to clipboard
@Serializable
value class MediaModality(val value: String)

The modality that this token count applies to.

Link copied to clipboard
@Serializable
value class MediaResolution(val value: String)

The media resolution to use.

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

Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.

Link copied to clipboard
@Serializable
data class ModelArmorConfig(val promptTemplateName: String? = null, val responseTemplateName: String? = null)

Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class ModelRoutingPreference(val value: String)

The model routing preference.

Link copied to clipboard
@Serializable
data class ModelSelectionConfig(val featureSelectionPreference: FeatureSelectionPreference? = null)

Config for model selection.

Link copied to clipboard
@Serializable
value class ModelStage(val value: String)

The stage of the underlying model. This enum is not supported in Vertex AI.

Link copied to clipboard
@Serializable
data class ModelStatus(val message: String? = null, val modelStage: ModelStage? = null, val retirementTime: Instant? = null)

The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable. This data type is not supported in Vertex AI.

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

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

Link copied to clipboard
@Serializable
value class NullValue(val value: String)

Optional. Represents a null value.

Link copied to clipboard
@Serializable
value class Outcome(val value: String)

Outcome of the code execution.

Link copied to clipboard
@Serializable
data class Part(val mediaResolution: PartMediaResolution? = null, val codeExecutionResult: CodeExecutionResult? = null, val executableCode: ExecutableCode? = null, val fileData: FileData? = null, val functionCall: FunctionCall? = null, val functionResponse: FunctionResponse? = null, val inlineData: Blob? = null, val text: String? = 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, JsonElement>? = null)

A datatype containing media content.

Link copied to clipboard
@Serializable
data class PartialArg(val boolValue: Boolean? = null, val jsonPath: String? = null, val nullValue: NullValue? = null, val numberValue: Double? = null, val stringValue: String? = null, val willContinue: Boolean? = null)

Partial argument value of the function call. This data type is not supported in Gemini API.

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

Media resolution for the input media.

Link copied to clipboard
@Serializable
value class PartMediaResolutionLevel(val value: String)

The tokenization quality used for given media.

Link copied to clipboard
@Serializable
value class PhishBlockThreshold(val value: String)

Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API.

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

Configuration for a prebuilt voice.

Link copied to clipboard
@Serializable
value class ProminentPeople(val value: String)

Controls whether prominent people (celebrities) generation is allowed. If used with personGeneration, personGeneration enum would take precedence. For instance, if ALLOW_NONE is set, all person generation would be blocked. If this field is unspecified, the default behavior is to allow prominent people. This enum is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class RagChunk(val pageSpan: RagChunkPageSpan? = null, val text: String? = null, val chunkId: String? = null, val fileId: String? = null)

A RagChunk includes the content of a chunk of a RagFile, and associated metadata. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class RagChunkPageSpan(val firstPage: Int? = null, val lastPage: Int? = null)

Represents where the chunk starts and ends in the document. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class RagRetrievalConfig(val filter: RagRetrievalConfigFilter? = null, val hybridSearch: RagRetrievalConfigHybridSearch? = null, val ranking: RagRetrievalConfigRanking? = null, val topK: Int? = null)

Specifies the context retrieval config. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class RagRetrievalConfigFilter(val metadataFilter: String? = null, val vectorDistanceThreshold: Double? = null, val vectorSimilarityThreshold: Double? = null)

Config for filters. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class RagRetrievalConfigHybridSearch(val alpha: Double? = null)

Config for Hybrid Search. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class RagRetrievalConfigRanking(val llmRanker: RagRetrievalConfigRankingLlmRanker? = null, val rankService: RagRetrievalConfigRankingRankService? = null)

Config for ranking and reranking. This data type is not supported in Gemini API.

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

Config for LlmRanker. This data type is not supported in Gemini API.

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

Config for Rank Service. This data type is not supported in Gemini API.

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

The configuration for the replicated voice to use.

Link copied to clipboard
@Serializable
data class Retrieval(val disableAttribution: Boolean? = null, val externalApi: ExternalApi? = null, val vertexAiSearch: VertexAISearch? = null, val vertexRagStore: VertexRagStore? = null)

Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class RetrievalConfig(val latLng: LatLng? = null, val languageCode: String? = null)

Retrieval config.

Link copied to clipboard
@Serializable
data class RetrievalMetadata(val googleSearchDynamicRetrievalScore: Double? = null)

Metadata returned to client when grounding is enabled.

Link copied to clipboard
@Serializable
value class SafetyPolicy(val value: String)

SafetyPolicy

Link copied to clipboard
@Serializable
data class SafetyRating(val blocked: Boolean? = null, val category: HarmCategory? = null, val overwrittenThreshold: HarmBlockThreshold? = null, val probability: HarmProbability? = null, val probabilityScore: Double? = null, val severity: HarmSeverity? = null, val severityScore: Double? = null)

A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.

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

A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category.

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

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

Link copied to clipboard
@Serializable
data class SearchEntryPoint(val renderedContent: String? = null, val sdkBlob: ByteArray? = null)

The entry point used to search for grounding sources.

Link copied to clipboard
@Serializable
data class SearchTypes(val webSearch: WebSearch? = null, val imageSearch: ImageSearch? = null)

Different types of search that can be enabled on the GoogleSearch tool.

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

Segment of the content this support belongs to.

Link copied to clipboard
@Serializable
value class ServiceTier(val value: String)

Pricing and performance service tier.

Link copied to clipboard
@Serializable
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
@Serializable
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
@Serializable
data class StreamableHttpTransport(val headers: Map<String, String>? = null, val sseReadTimeout: Duration? = null, val terminateOnClose: Boolean? = null, val timeout: Duration? = null, val url: String? = null)

A transport that can stream HTTP requests and responses. Next ID: 6. This data type is not supported in Vertex AI.

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

The thinking features configuration.

Link copied to clipboard
@Serializable
value class ThinkingLevel(val value: String)

The number of thoughts tokens that the model should generate.

Link copied to clipboard
@Serializable
data class Tool(val retrieval: Retrieval? = null, val computerUse: ComputerUse? = null, val fileSearch: FileSearch? = null, val googleSearch: GoogleSearch? = null, val googleMaps: GoogleMaps? = null, val codeExecution: ToolCodeExecution? = null, val enterpriseWebSearch: EnterpriseWebSearch? = null, val functionDeclarations: List<FunctionDeclaration>? = null, val googleSearchRetrieval: GoogleSearchRetrieval? = null, val parallelAiSearch: ToolParallelAiSearch? = null, val urlContext: UrlContext? = null, val mcpServers: List<McpServer>? = null, val exaAiSearch: ToolExaAiSearch? = null)

Tool details of a tool that the model may use to generate a response.

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

A predicted server-side ToolCall returned from the model.

Link copied to clipboard
@Serializable
class ToolCodeExecution

Tool that executes code generated by the model, and automatically returns the result to the model. See also ExecutableCode and CodeExecutionResult, which are input and output to this tool. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class ToolConfig(val retrievalConfig: RetrievalConfig? = null, val functionCallingConfig: FunctionCallingConfig? = null, val includeServerSideToolInvocations: Boolean? = null)

Tool config. This config is shared for all tools provided in the request.

Link copied to clipboard
@Serializable
data class ToolExaAiSearch(val apiKey: String? = null, val customConfigs: Map<String, JsonElement>? = null)

ExaAiSearch tool type. A tool that uses the Exa.ai search engine for grounding. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
data class ToolParallelAiSearch(val apiKey: String? = null, val customConfigs: Map<String, JsonElement>? = null)

ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding. This data type is not supported in Gemini API.

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

The output from a server-side ToolCall execution.

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

The type of tool in the function call.

Link copied to clipboard
@Serializable
value class TrafficType(val value: String)

Output only. The traffic type for this request. This enum is not supported in Gemini API.

Link copied to clipboard
@Serializable
value class Type(val value: String)

Data type of the schema field.

Link copied to clipboard
@Serializable
data class UpdateCachedContentConfig(val httpOptions: HttpOptions? = null, val ttl: Duration? = null, val expireTime: Instant? = null)

Optional parameters for caches.update method.

Link copied to clipboard
@Serializable
data class UpdateCachedContentParameters(val name: String? = null, val config: UpdateCachedContentConfig? = null)
Link copied to clipboard
@Serializable
class UrlContext

Tool to support URL context.

Link copied to clipboard
@Serializable
data class UrlContextMetadata(val urlMetadata: List<UrlMetadata>? = null)

Metadata returned when the model uses the url_context tool to get information from a user-provided URL.

Link copied to clipboard
@Serializable
data class UrlMetadata(val retrievedUrl: String? = null, val urlRetrievalStatus: UrlRetrievalStatus? = null)

The metadata for a single URL retrieval.

Link copied to clipboard
@Serializable
value class UrlRetrievalStatus(val value: String)

The status of the URL retrieval.

Link copied to clipboard
@Serializable
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. See https://cloud.google.com/products/agent-builder. This data type is not supported in Gemini API.

Link copied to clipboard
@Serializable
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. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec. This data type is not supported in Gemini API.

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

Retrieve from Vertex RAG Store for grounding. This data type is not supported in Gemini API.

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

The definition of the Rag resource. This data type is not supported in Gemini API.

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

Provides metadata for a video, including the start and end offsets for clipping and the frame rate.

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

The configuration for the voice to use.

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

The signature of the voice consent check.

Link copied to clipboard
@Serializable
class WebSearch

Standard web search for grounding and related configurations. Only text results are returned.