Mscc.GenerativeAI The base class for all models, providing common functionality for API communication. The base URL for the Google AI API. The base URL for the Vertex AI API. The base URL for the Vertex AI API for global locations. Gets the instance used for making API requests. If an is available, it is used to create the client; otherwise, a default client is created. Creates a default with appropriate settings for the target framework. A new instance. Gets or sets the API version to use. Gets or sets the request options for API calls. Gets or sets the name of the model to use. Returns the name of the model. Name of the model. Sets the API key to use for the request. The value can only be set or modified before the first request is made. Adds the API key to the request header if it is available. Using an API key with REST to send to the API. Sets the access token to use for the request. Sets the project ID to use for the request. The value can only be set or modified before the first request is made. Gets or sets the region to use for the request. This is used in Vertex AI requests. The default value is "us-central1". Gets or sets the timespan to wait before the request times out. A hook to verify if a specific request is supported by the current model configuration. Throws a if the functionality is not supported. The type of the request object. The request to verify. Initializes a new instance of the class, primarily for Google AI. It configures the model using an API key and environment variables. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Optional. Provides options for API requests. Initializes a new instance of the class, primarily for Vertex AI. It configures the model using a project ID, region, and access token. The Google Cloud project ID. The Google Cloud region. The model name to use. Optional. The access token for authentication. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Options for the request. Internal constructor for testing purposes, allows injecting a custom HttpMessageHandler. The to use for HTTP requests. Optional. Logger instance used for logging. Optional. Provides options for API requests. Parses the URL template and replaces placeholders with their current values. This method supports templates for both Google AI and Vertex AI endpoints. The URL template to parse (e.g., ). The specific API method to append to the URL (e.g., ":generateContent"). The fully resolved URL with all placeholders replaced. Serializes the request payload to a JSON string. The type of the request object. The request object to serialize. A JSON string representing the request. Deserializes the JSON response from an API call into an object. The type to deserialize the response into. The from the API call. A task that resolves to an instance of type . Configures and returns the default for deserialization. Default options for JSON deserialization. A modifier that adds a snake_case alias for each property. This allows deserialization to work with both camelCase and snake_case property names. Configures and returns the default for serialization. Default options for JSON serialization. Reads credentials from a specified JSON file. This is typically used for reading service account credentials from Google Cloud Platform. The path to the credentials file. A object if the file exists and is valid; otherwise, null. Retrieves an access token from Application Default Credentials (ADC) using the gcloud command-line tool. This method is specific to Google Cloud Platform. The access token as a string, or an empty string if it fails. Executes an external command-line application. The command or application to run. Optional arguments to pass to the application. The standard output from the application. Thrown if the process exits with a non-zero code. Formats a command and its arguments for logging purposes. The command or application that was run. The arguments passed to the application. A formatted string containing the command and arguments. Sends a POST request to the specified API endpoint and deserializes the response. The type of the request object. The type of the expected response object. The request object to send. The URL template for the API endpoint. The specific API method to call. Optional. Options for the request, like timeout and retry settings. Optional. Defines when the HTTP operation should complete. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A task that represents the asynchronous operation. The task result contains the deserialized response. Thrown if the request is null. Thrown if the HTTP response times out. Sends a POST request to the specified API endpoint and streams the response. Using Server-Sent Events The type of the request object. The type of the expected response objects in the stream. The request object to send. The URL template for the API endpoint. The specific API method to call. Optional. Options for the request, like timeout and retry settings. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An asynchronous stream of response objects. Thrown if the request is null. Sends an HTTP request and returns the response. It handles adding authentication headers, user-agent, and custom headers. It also implements a retry mechanism for transient failures. The to send. Optional. Options for the request, including timeout and retry settings. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Defines when the operation should complete. The from the API. Truncates the base64 data in the log to avoid blowing up the log file. The JSON string to sanitize. The sanitized JSON string. Asynchronously reads the content of an as a string. The HTTP response. A cancellation token. A task that represents the asynchronous operation. The task result contains the response content as a string. Creates a deep clone of an . This is necessary for retrying requests, as a request message can only be sent once. The request to clone. A cancellation token. A task that represents the asynchronous operation. The task result contains the cloned HTTP request message. Disposes the and its underlying resources. Releases the unmanaged resources used by the and optionally releases the managed resources. true to release both managed and unmanaged resources; false to release only unmanaged resources. Asynchronously disposes the and its underlying resources. A that represents the asynchronous dispose operation. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. The standard list filter. Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token. When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the [ListOperationsResponse.unreachable] field. This can only be `true` when reading across collections e.g. when `parent` is set to `"projects/example/locations/-"`. This field is not by default supported and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. Required. The name of the operation resource. Format: `batches/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The long-running operation resource. Thrown when the is or empty. Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. Required. The name of the operation resource. Format: `batches/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The long-running operation resource. Thrown when the is or empty. Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`. Required. The name of the operation resource. Format: `batches/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is or empty. Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Required. The name of the operation resource to be deleted. Format: `batches/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is or empty. Updates a batch of EmbedContent requests for batch processing. The batch resources to update Required. The name of the operation resource to be deleted. Format: `batches/{id}` Optional. The list of fields to update. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Updates a batch of GenerateContent requests for batch processing. The batch resources to update Required. The name of the operation resource to be deleted. Format: `batches/{id}` Optional. The list of fields to update. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Creates CachedContent resource. The cached content resource to create. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The cached content resource created Thrown when the is . Creates CachedContent resource. The minimum input token count for context caching is 32,768, and the maximum is the same as the maximum for the given model. Required. The name of the `Model` to use for cached content Format: `models/{model}` Optional. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. Optional. Input only. Developer set system instruction. Currently, text only. Optional. Input only. The content to cache. Optional. A chat history to initialize the session with. Optional. Input only. New TTL for this resource, input only. A duration in seconds with up to nine fractional digits, ending with 's' Optional. Timestamp in UTC of when this resource is considered expired. This is always provided on output, regardless of what was sent on input. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The created cached content resource. Thrown when the is or empty. Lists CachedContents resources. Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Reads CachedContent resource. Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The cached content resource. Thrown when the is or empty. Updates CachedContent resource (only expiration is updatable). The cached content resource to update. Optional. Input only. New TTL for this resource, input only. A duration in seconds with up to nine fractional digits, ending with 's' Optional. The list of fields to update. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The updated cached content resource. Thrown when the is . Thrown when the is or empty. Deletes CachedContent resource. Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is or empty. The `ChatModel` class provides methods for interacting with a chat-based generative model. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Generates a set of responses from the model given a chat history input. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Helper class to provide API versions. Helper class to provide model names. Ref: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versioning#latest-version Possible roles. Initializes a new instance of the class. Initializes a new instance of the class with a specific message that describes the current exception. Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. Initializes a new instance of the class with the block reason message that describes the current exception. Represents errors that occur during Generative AI API calls. HTTP response from the API. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The message that describes the error. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference if no inner exception is specified. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The HTTP response. The exception that is the cause of the current exception, or a null reference if no inner exception is specified. Represents errors that occur during Generative AI API calls. HTTP response from the API. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The message that describes the error. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference if no inner exception is specified. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The HTTP response. The exception that is the cause of the current exception, or a null reference if no inner exception is specified. Initializes a new instance of the class. Initializes a new instance of the class with a specific message that describes the current exception. Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. Initializes a new instance of the class. Initializes a new instance of the class with a specific message that describes the current exception. Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. Initializes a new instance of the class. Initializes a new instance of the class with a specific message that describes the current exception. Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. Initializes a new instance of the class. Initializes a new instance of the class with a specific message that describes the current exception. Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. Initializes a new instance of the class with the finish message that describes the current exception. Extensions for logging invocations. This extension uses the to generate logging code at compile time to achieve optimized code. Logs parsing the URL to call. Logger instance used for logging HTTP method of the request. Parsed URL. Logs invoking an API request. Optional. Logger instance used for logging Calling method Logs Optional. Logger instance used for logging Logs Optional. Logger instance used for logging Logs Optional. Logger instance used for logging Logs Optional. Logger instance used for logging Logs Optional. Logger instance used for logging Logs when exception thrown to run an external application. Optional. Logger instance used for logging Message of to log. Logs when exception thrown. Optional. Logger instance used for logging Nth attempt of request sent. Logs when exception thrown. Optional. Logger instance used for logging Nth attempt of request sent. Message to log. Logs when exception thrown. Optional. Logger instance used for logging Nth attempt of request sent. Message to log. Defines what effect activity has. If unspecified, the default behavior is `START_OF_ACTIVITY_INTERRUPTS`. If true, start of activity will interrupt the model's response (also called \"barge in\"). The model's current response will be cut-off in the moment of the interruption. This is the default behavior. The model's response will not be interrupted." Adapter size is unspecified. Adapter size 1. Adapter size 2. Adapter size 4. Adapter size 8. Adapter size 16. Adapter size 32. The aggregation result for the entire dataset and all metrics. One AggregationResult per metric. The dataset used for evaluation & aggregation. The aggregation result for a single metric. Aggregation metric. Results for bleu metric. Result for code execution metric. Results for exact match metric. Result for pairwise metric. Result for pointwise metric. Results for rouge metric. Unspecified aggregation metric. Average aggregation metric. Not supported for Pairwise metric. Mode aggregation metric. Standard deviation aggregation metric. Not supported for pairwise metric. Variance aggregation metric. Not supported for pairwise metric. Minimum aggregation metric. Not supported for pairwise metric. Maximum aggregation metric. Not supported for pairwise metric. Median aggregation metric. Not supported for pairwise metric. 90th percentile aggregation metric. Not supported for pairwise metric. 95th percentile aggregation metric. Not supported for pairwise metric. 99th percentile aggregation metric. Not supported for pairwise metric. Unspecified answer style. Succinct but abstract style. Very brief and extractive style. Verbose style including extra details. The response may be formatted as a sentence, paragraph, multiple paragraphs, or bullet points, etc. The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. The generic reusable api auth config. The API secret. The API secret. Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version} The API key string. Either this or api_key_secret_version must be set. Config for authentication with API key. Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name. Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. Optional. The API key to be used in the request directly. Optional. The location of the API key. Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version} Request for an AsyncBatchEmbedContent operation. Required. The batch to create. Closes the WebSocket connection gracefully. This method is thread-safe and idempotent. Asynchronously disposes the session by closing the WebSocket connection. Identifier for the source contributing to this attribution. Identifier for an inline passage. Identifier for a Chunk fetched via Semantic Retriever. Options for audio generation. Optional. The format of the audio response. Can be either: - "wav": Format the response as a WAV file. - "mp3": Format the response as an MP3 file. - "flac": Format the response as a FLAC file. - "opus": Format the response as an OPUS file. - "pcm16": Format the response as a PCM16 file. Optional. The voice to use for the audio response. The audio transcription configuration. Auth configuration to run the extension. Config for API key auth. Type of auth scheme. Config for Google Service Account auth. Config for HTTP Basic auth. Config for user oauth. Config for user OIDC auth. No Auth. API Key Auth. HTTP Basic Auth. Google Service Account Auth. OAuth auth. OpenID Connect (OIDC) Auth. Config for authentication with API key. Optional. The name of the SecretManager secret version resource storing the API key. Format: projects/{project}/secrets/{secrete}/versions/{version} - If both api_key_secret and api_key_string are specified, this field takes precedence over api_key_string. - If specified, the secretmanager.versions.access permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. Optional. The API key to be used in the request directly. Optional. The location of the API key. Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name. Config for Google Service Account Authentication. Optional. The service account that the extension execution service runs as. - If the service account is specified, the iam.serviceAccounts.getAccessToken permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension. Config for HTTP Basic Authentication. Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: projects/{project}/secrets/{secrete}/versions/{version} - If specified, the secretmanager.versions.access permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. Config for user oauth. Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. The service account used to generate access tokens for executing the Extension. - If the service account is specified, the iam.serviceAccounts.getAccessToken permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account. Config for user OIDC auth. OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant iam.serviceAccounts.getOpenIdToken permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). A request to create an ephemeral authentication token. Optional. Input only. Immutable. Configuration specific to BidiGenerateContent. Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.) If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future. Optional. Input only. Immutable. If field_mask is empty, and bidi_generate_content_setup is not present, then the effective BidiGenerateContentSetup message is taken from the Live API connection. If field_mask is empty, and bidi_generate_content_setup _is_ present, then the effective BidiGenerateContentSetup message is taken entirely from bidi_generate_content_setup in this request. The setup message from the Live API connection is ignored. If field_mask is not empty, then the corresponding fields from bidi_generate_content_setup will overwrite the fields from the setup message in the Live API connection. Output only. Identifier. The token itself. Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected. If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future. Optional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1. Configures automatic detection of activity. Optional. If enabled (the default), detected voice and text input count as activity. If disabled, the client must send activity signals. Optional. Determines how likely detected speech is ended. Optional. The required duration of detected speech before start-of-speech is committed. The lower this value, the more sensitive the start-of-speech detection is and shorter speech can be recognized. However, this also increases the probability of false positives. Optional. The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency. Optional. Determines how likely speech is to be detected. The default is END_SENSITIVITY_HIGH. Automatic detection ends speech more often. Automatic detection ends speech less often. The default is START_SENSITIVITY_HIGH. Automatic detection will detect the start of speech more often. Automatic detection will detect the start of speech less often. The configuration for automatic function calling. Whether to disable automatic function calling. If not set or set to False, will enable automatic function calling. If set to True, will disable automatic function calling. If automatic function calling is enabled, whether to ignore call history to the response. If not set, SDK will set ignore_call_history to false, and will append the call history to GenerateContentResponse.automatic_function_calling_history. If automatic function calling is enabled, maximum number of remote calls for automatic function calling. This number should be a positive integer. If not set, SDK will set maximum number of remote calls to 10. The configs for autorater. This is applicable to both EvaluateInstances and EvaluateDataset. Optional. The fully qualified name of the publisher model or tuned autorater endpoint to use. Publisher model format: projects/{project}/locations/{location}/publishers/*/models/* Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint} Optional. Default is true. Whether to flip the candidate and baseline responses. This is only applicable to the pairwise metric. If enabled, also provide PairwiseMetricSpec.candidate_response_field_name and PairwiseMetricSpec.baseline_response_field_name. When rendering PairwiseMetricSpec.metric_prompt_template, the candidate and baseline fields will be flipped for half of the samples to reduce bias. Optional. Configuration options for model generation and outputs. Optional. Number of samples for each instance in the dataset. If not specified, the default is 4. Minimum value is 1, maximum value is 32. 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. The model routing preference. Abstract base class for many config types. Used to override HTTP request options. Whether to include a reason for filtered-out images in the response. Abstract base type with logging instance. Default constructor. Base constructor to set the instance. Optional. Logger instance used for logging Request to batch create s. Required. The request messages specifying the s to create. A maximum of 100 s can be created in a batch. Response from containing a list of created s. s created. Request to batch delete s. Required. The request messages specifying the s to delete. Batch request to get embeddings from the model for a list of prompts. Required. Embed requests for the batch. The model in each of these requests must match the model specified BatchEmbedContentsRequest.model. The response to a BatchEmbedContentsRequest. Output only. The embeddings for each request, in the same order as provided in the batch request. Batch request to get a text embedding from the model. Optional. Embed requests for the batch. Only one of texts or requests can be set. Optional. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown. The response to a EmbedTextRequest. Output only. The embeddings generated from the input text. Request for a BatchGenerateContent operation. Required. The batch to create. Stats about the batch. Output only. The number of requests that failed to be processed. Output only. The number of requests that are still pending processing. Output only. The number of requests in the batch. Output only. The number of requests that were successfully processed. Request to batch update s. Required. The request messages specifying the s to update. A maximum of 100 s can be updated in a batch. Response from containing a list of updated s. s updated. Message to be sent in the first (and only in the first) BidiGenerateContentClientMessage. Contains configuration that will apply for the duration of the streaming RPC. Clients should wait for a BidiGenerateContentSetupComplete message before sending any additional messages. Optional. Configures a context window compression mechanism. If included, the server will automatically reduce the size of the context when it exceeds the configured length. Optional. Generation config. The following fields are not supported: - response_logprobs - response_mime_type - logprobs - response_schema - response_json_schema - stop_sequence - skip_response_cache - routing_config - audio_timestamp Optional. If set, enables transcription of voice input. The transcription aligns with the input audio language, if configured. Required. The model's resource name. This serves as an ID for the Model to use. Format: models/{model} Optional. If set, enables transcription of the model's audio output. The transcription aligns with the language code specified for the output audio, if configured. Optional. Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input. Optional. Configures the handling of realtime input. Optional. Configures session resumption mechanism. If included, the server will send SessionResumptionUpdate messages. Optional. The user provided system instructions for the model. Note: Only text should be used in parts and content in each part will be in a separate paragraph. Optional. A list of Tools the model may use to generate the next response. A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. The BigQuery location for the input content. Required. BigQuery URI to a table, up to 2000 characters long. Accepted forms: * BigQuery path. For example: bq://projectId.bqDatasetId.bqTableId. Bleu metric value for an instance. Output only. Bleu score. Spec for bleu score metric - calculates the precision of n-grams in the prediction as compared to reference - returns a score ranging between 0 to 1. Optional. Whether to use_effective_order to compute bleu score. A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. Raw media bytes. Text should not be sent as raw bytes, use the 'text' field. Raw media bytes. Text should not be sent as raw bytes, use the 'text' field. Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is used in the Gemini calls only when server-side tools (code_execution, google_search, and url_context) are enabled. Raw bytes for media formats. The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats). Information to read/write to blobstore2. The blob id, e.g., /blobstore/prod/playground/scotty The blob read token. Needed to read blobs that have not been replicated. Might not be available until the final call. The blob generation id. Metadata passed from Blobstore -> Scotty for a new GCS upload. This is a signed, serialized blobstore2.BlobMetadataContainer proto which must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads. Read handle passed from Bigstore -> Scotty for a GCS download. This is a signed, serialized blobstore2.ReadHandle proto which must never be set outside of Bigstore, and is not applicable to non-GCS media downloads. Defaults to unspecified. Blocks Low and above confidence URL that is risky. Blocks Medium and above confidence URL that is risky. Blocks High and above confidence URL that is risky. Blocks Higher and above confidence URL that is risky. Blocks Very high and above confidence URL that is risky. Blocks Extremely high confidence URL that is risky. Default value. This value is unused. The blocked reason is unspecified. Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it. Prompt was blocked due to unknown reasons. Prompt was blocked due to the terms which are included from the terminology blocklist. Prompt was blocked due to prohibited content. The prompt was blocked by Model Armor. Candidates blocked due to unsafe image generation content. The prompt was blocked as a jailbreak attempt. Config for blur baseline. When enabled, a linear path from the maximally blurred image to the input image is created. Using a blurred baseline instead of zero (black image) is motivated by the BlurIG approach explained here: https://arxiv.org/abs/2004.03383 The standard deviation of the blur kernel for the blurred baseline. The same blurring parameter is used for both the height and the width dimension. If not set, the method defaults to the zero (i.e. black for images) baseline. A resource used in LLM queries for users to explicitly specify what to cache and how to cache. Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for. Input only. Immutable. Customer-managed encryption key spec for a CachedContent. If set, this CachedContent and all its sub-resources will be secured by this key. Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}` Optional. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}` Specifies when this resource will expire. Input only. New TTL for this resource, input only. Optional. Input only. Immutable. The content to cache. Output only. Creation time of the cache entry. Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. Optional. Input only. Immutable. Developer set system instruction. Currently text only. Optional. Input only. Immutable. Tool config. This config is shared for all tools. Optional. Input only. Immutable. A list of Tools the model may use to generate the next response Output only. When the cache entry was last updated in UTC time. Output only. Metadata on the usage of the cached content. Metadata on the usage of the cached content. Metadata on the usage of the cached content. Duration of audio in seconds. Number of images. Number of text characters. Duration of video in seconds. Total number of tokens that the cached content consumes. A response candidate generated from the model. A response candidate generated from the model. A response candidate generated from the model. Output only. Generated content returned from the model. Output only. Metadata related to url context retrieval tool. Output only. Average log probability score of the candidate. Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the content. These are passages that are "recited" from copyrighted material in the foundational LLM's training data. Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when finish_reason is set. Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens. Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for GenerateAnswer calls. Output only. Grounding metadata for the candidate. This field is populated for GenerateContent calls. Output only. Index of the candidate in the list of response candidates. Output only. Log-likelihood scores for the response tokens and top tokens List of ratings for the safety of a response candidate. There is at most one rating per category. Output only. Token count for this candidate. Output only. Metadata related to url context retrieval tool. Request for chat completions. Required. The name of the `Model` to use for generating the completion. The model name will prefixed by \"models/\" if no slash appears in it. Required. The chat history to use for generating the completion. Supports single and multi-turn queries. Note: This is a polymorphic field, it is deserialized to a InternalChatMessage. Optional. The maximum number of tokens to include in a response candidate. Must be a positive integer. Optional. The maximum number of tokens to include in a response candidate. Must be a positive integer. This field is deprecated by the SDK. Optional. Amount of candidate completions to generate. Must be a positive integer. Defaults to 1 if not set. Optional. Defines the format of the response. If not set, the response will be formatted as text. Optional. The set of character sequences that will stop output generation. Note: This is a polymorphic field. It is meant to contain a string or repeated strings. Optional. Whether to stream the response or return a single response. If true, the \"object\" field in the response will be \"chat.completion.chunk\". Otherwise it will be \"chat.completion\". Optional. Options for streaming requests. Optional. Controls the randomness of the output. Optional. The maximum cumulative probability of tokens to consider when sampling. Optional. Controls whether the model should use a tool or not, and which tool to use. Can be either: - The string \"none\", to disable tools. - The string \"auto\", to let the model decide. - The string \"required\", to force the model to use a tool. - A function name descriptor object, specifying the tool to use. The last option follows the following schema: { \"type\": \"function\", \"function\": {\"name\" : \"the_function_name\"} } Optional. The set of tools the model can generate calls for. Each tool declares its signature. Optional. Options for audio generation. Optional. Modalities for the request. Optional. Whether to call tools in parallel. Included here for compatibility with the SDK, but only false is supported. Optional. Penalizes new tokens based on previous appearances. Valid ranges are [-2, 2]. Default is 0. Optional. The user name used for tracking the request. Not used, only for compatibility with the SDK. A function that the model can generate calls for. Required. The name of the function. Optional. A description of the function. Optional. Whether the schema validation is strict. If true, the model will fail if the schema is not valid. NOTE: This parameter is currently ignored. Optional. The parameters of the function. Contains an ongoing conversation with the model. This ChatSession object collects the messages sent and received, in its ChatSession.History attribute. The chat history. Returns the last received ContentResponse Constructor to start a chat session with history. The model to use in the chat. A chat history to initialize the session with. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Sends the conversation history with the added message and returns the model's response. Appends the request and response to the conversation history. The content request. Optional. Overrides for the model's generation config. Optional. Overrides for the model's safety settings. Optional. Overrides for the list of tools the model may use to generate the next response. Optional. Overrides for the configuration of tools. Optional. Overrides for the request options. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The model's response. Thrown when is . Thrown when the model's response is blocked by a reason. Thrown when the model's response is stopped by the model's safety settings. Thrown when the candidate count is larger than 1. Sends the conversation history with the added message and returns the model's response. Appends the request and response to the conversation history. The message or content sent. Optional. Overrides for the model's generation config. Optional. Overrides for the model's safety settings. Optional. Overrides for the list of tools the model may use to generate the next response. Optional. Overrides for the configuration of tools. Optional. Overrides for the request options. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The model's response. Thrown when is . Sends the conversation history with the added message and returns the model's response. Appends the request and response to the conversation history. The list of content parts sent. Optional. Overrides for the model's generation config. Optional. Overrides for the model's safety settings. Optional. Overrides for the list of tools the model may use to generate the next response. Optional. Overrides for the configuration of tools. Optional. Overrides for the request options. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The model's response. Thrown when the candidate count is larger than 1. Sends the conversation history with the added message and returns the model's response. Appends the request and response to the conversation history. The content request. Optional. Overrides for the model's generation config. Optional. Overrides for the model's safety settings. Optional. Overrides for the list of tools the model may use to generate the next response. Optional. Overrides for the configuration of tools. Optional. Overrides for the request options. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The model's response. Thrown when is Thrown when the is blocked by a reason. Thrown when the candidate count is larger than 1. Sends the conversation history with the added message and returns the model's response. Appends the request and response to the conversation history. The message sent. Optional. Overrides for the model's generation config. Optional. Overrides for the model's safety settings. Optional. Overrides for the list of tools the model may use to generate the next response. Optional. Overrides for the configuration of tools. Optional. Overrides for the request options. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The model's response. Thrown when is . Sends the conversation history with the added message and returns the model's response. Appends the request and response to the conversation history. The list of content parts sent. Optional. Overrides for the model's generation config. Optional. Overrides for the model's safety settings. Optional. Overrides for the list of tools the model may use to generate the next response. Optional. Overrides for the configuration of tools. Optional. Overrides for the request options. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The model's response. Thrown when is . Removes the last request/response pair from the chat history. Tuple with the last request/response pair. A tool that the model can generate calls for. Required. The name of the tool. Required. Required, must be \"function\". Describes the machine learning model version checkpoint. The ID of the checkpoint. The epoch of the checkpoint. The step of the checkpoint. Container for bytes-encoded data such as video frame, audio sample, or a complete binary/text data. A is a subpart of a that is treated as an independent unit for the purposes of vector representation and storage. Optional. Metadata that is associated with the data in the payload. Required. Mime type of the chunk data. See https://www.iana.org/assignments/media-types/media-types.xhtml for the full list. Output only. The Timestamp of when the was created. Optional. User provided custom metadata stored as key-value pairs. The maximum number of per chunk is 20. Required. The content for the , such as the text string. The maximum number of tokens per chunk is 2043. Immutable. Identifier. The resource name. The ID (name excluding the "corpora/*/documents/*/chunks/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: Output only. Current state of the . Output only. The Timestamp of when the was last updated. Extracted data that represents the content. The content as a string. The maximum number of tokens per chunk is 2043. Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto Number of tokens each chunk should have. Number of tokens overlap between chunks. White space chunking configuration. A citation for a piece of generatedcontent. Output only. The end index of the citation in the content. Output only. The license of the source of the citation. Output only. The publication date of the source of the citation. Output only. The start index of the citation in the content. Output only. The title of the source of the citation. Output only. The URI of the source of the citation. A collection of citations that apply to a piece of generated content. A collection of source attributions for a piece of content. Output only. A list of citations for the content. Citations to sources for a specific response. A citation to a source for a portion of a specific response. A citation to a source for a portion of a specific response. Output only. The title of the source of the citation. Output only. The publication date of the source of the citation. Optional. End of the attributed segment, exclusive. Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations. Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes. Optional. URI that is attributed as a source for a portion of the text. Tool that executes code generated by the model, and automatically returns the result to the model. See also and which are only generated when using this tool. Tool that executes code generated by the model, and automatically returns the result to the model. See also ExecutableCode and CodeExecutionResult which are only generated when using this tool. Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a part containing the [ExecutableCode]. Result of executing the . Only generated when using the , and always follows a containing the . Result of executing the ExecutableCode. Generated only when the CodeExecution tool is used. Required. Outcome of the code execution. Optional. Contains stdout when code execution is successful, stderr or other description otherwise. A sequence of media data references representing composite data. Introduced to support Bigstore composite objects. For details, visit http://go/bigstore-composites. Media data, set if reference_type is INLINE Path to the data, set if reference_type is PATH Describes what the field reference contains. Scotty-provided MD5 hash for an upload. Scotty-provided SHA1 hash for an upload. Scotty-provided SHA256 hash for an upload. For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported. Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef. Size of the data, in bytes Reference to a TI Blob, set if reference_type is BIGSTORE_REF. A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field. Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob. Specification for a computation based metric. Optional. A map of parameters for the metric, e.g. {"rouge_type": "rougeL"}. Required. The type of the computation based metric. Unspecified computation based metric type. Exact match metric. BLEU metric. ROUGE metric. Computer Use tool type. Computer Use tool type. Required. The environment being operated. Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions. Defaults to browser. Operates in a web browser. Operates in a web browser. Optional parameters for computing tokens. Request message for ComputeTokens RPC call. Request message for ComputeTokens RPC call. Optional. Input content. Optional. The instances that are the input to token computing API call. Schema is identical to the prediction schema of the text model, even for the non-text models, like chat models, or Codey models. Optional. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/* Optional parameters for the request. Response message for ComputeTokens RPC call. Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances. Filter condition applicable to a single key. Filter condition applicable to a single key. Required. Operator applied to the given key-value pair to trigger the condition. The numeric value to filter the metadata on. The string value to filter the metadata on. The base structured datatype containing multipart content of a message. Ref: https://ai.google.dev/api/rest/v1beta/Content The base structured datatype containing multi-part content of a message. A Content includes a role field designating the producer of the Content and a parts field containing multi-part data that contains the content of the message turn. Ordered Parts that constitute a single message. Parts may have different MIME types. Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'. Ordered Parts that constitute a single message. Parts may have different MIME types. The ETag of the item. Initializes a new instance of the class. Initializes a new instance of the class. String to process. Provide the of the text. Initializes a new instance of the class. The part to add. Provide the of the text. Thrown when is null. Initializes a new instance of the class. The parts to add. Provide the of the text. Thrown when is null. Initializes a new instance of the class. Initializes a new instance of the class. String to process. Role of the content. Must be either 'user' or 'model'. Thrown when or is empty or null. A list of floats representing an embedding. A list of floats representing an embedding. The embedding values. This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048]). Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified. Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified. The reason content was blocked during request processing. A string that describes the filtering behavior in more detail. A single example of a conversation with the model. Required. The content of the conversation with the model that resulted in the expected output. Required. The expected output for the given contents. To represent multi-step reasoning, this is a repeated field that contains the iterative steps of the expected output. A single step of the expected output. Required. A single step's content. Detailed Content-Type information from Scotty. The Content-Type of the media will typically be filled in by the header or Scotty's best_guess, but this extended information provides the backend with more information so that it can make a better decision if needed. This is only used on media upload requests from Scotty. The content type of the file derived by looking at specific bytes (i.e. \"magic bytes\") of the actual file. The content type of the file derived from the file extension of the URL path. The URL path is assumed to represent a file name (which is typically only true for agents that are providing a REST API). The content type of the file as specified in the request headers, multipart headers, or RUPIO start request. The content type of the file derived from the file extension of the original file name used by the client. Scotty's best guess of what the content type of the file is. Enables context window compression — a mechanism for managing the model's context window so that it does not exceed a given length. A sliding-window mechanism. The number of tokens (before running a turn) required to trigger a context window compression. This can be used to balance quality against latency as shorter context windows may result in faster model responses. However, any compression operation will cause a temporary latency increase, so they should not be triggered frequently. If not set, the default is 80% of the model's context window limit. This leaves 20% for the next user request/model response. Configuration for a Control reference image. The type of control reference image to use. When set to True, the control image will be computed by the model based on the control type. When set to False, the control image must be provided by the user. Defaults to False. Default control type. for canny edge for face mesh (person customization) for scribble Details of ModelService.CopyModel operation. The common part of the operation metadata. Request message for ModelService.CopyModel. Customer-managed encryption key options. If this is set, then the Model copy will be encrypted with the provided encryption key. Optional. Copy source_model into a new Model with this ID. The ID will become the final component of the model resource name. This value may be up to 63 characters, and valid characters are [a-z0-9_-]. The first character cannot be a number or hyphen. Optional. Specify this field to copy source_model into this existing Model as a new version. Format: projects/{project}/locations/{location}/models/{model} Required. The resource name of the Model to copy. That Model must be in the same Project. Format: projects/{project}/locations/{location}/models/{model} The copied model. A is a collection of s. A project can create up to 10 corpora. A Corpus is a collection of Documents. A project can create up to 10 corpora. Output only. The Timestamp of when the Corpus was created. Optional. The human-readable display name for the Corpus. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" Output only. Immutable. Identifier. The Corpus resource name. The ID (name excluding the "corpora/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from display_name along with a 12 character random suffix. Example: corpora/my-awesome-corpora-123a456b789c Output only. The Timestamp of when the Corpus was last updated. Request for querying a `Corpus`. Required. Query string to perform semantic search. Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical \"AND\"s. Example query at document level: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]}] Example query at chunk level for a numeric range of values: (year > 2015 AND year <= 2020) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2015, operation = GREATER}]}, {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: \"AND\"s for the same key are only supported for numeric values. String values only support \"OR\"s for the same key. Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100. Response from `QueryCorpus` containing a list of relevant chunks. The relevant chunks. RagCorpus status. Output only. Only when the state field is ERROR. Output only. RagCorpus life state. This state is not supposed to happen. RagCorpus resource entry is initialized, but hasn't done validation. RagCorpus is provisioned successfully and is ready to serve. RagCorpus is in a problematic situation. See `error_message` field for details. Counts the number of tokens in the prompt sent to a model. Models may tokenize text differently, so each model may return a different token_count. Required. The prompt, whose token count is to be returned. A response from CountMessageTokens. It returns the model's token_count for the prompt. The number of tokens that the model tokenizes the prompt into. Always non-negative. Counts the number of tokens in the prompt sent to a model. Models may tokenize text differently, so each model may return a different token_count. Required. The free-form input text given to the model as a prompt. A response from CountTextTokens. It returns the model's token_count for the prompt. The number of tokens that the model tokenizes the prompt into. Always non-negative. Config for the count_tokens method. Configuration that the model uses to generate the response. Not supported by the Gemini Developer API. Instructions for the model to steer it toward better performance. Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model. Request message for PredictionService.CountTokens. Request for counting tokens. Counts the number of tokens in the prompt sent to a model. Models may tokenize text differently, so each model may return a different token_count. Optional. Generation config that the model will use to generate the response. Optional. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model. Optional. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/* Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph. Optional. A list of Tools the model may use to generate the next response. A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Configuration for counting tokens. Optional. The input given to the model as a prompt. This field is ignored when generate_content_request is set. Optional. The overall input given to the Model. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). Models/Contents and generate_content_requests are mutually exclusive. You can either send Model + Contents or a generate_content_request, but never both. Response message for PredictionService.CountTokens. A response from `CountTokens`. It returns the model's `token_count` for the `prompt`. A response from CountTokens. It returns the model's token_count for the prompt. The total number of billable characters counted across all instances from the request. The number of tokens that the tokenizes the into. Always non-negative. The total number of tokens counted across all instances from the request. Number of tokens in the cached part of the prompt (the cached content). Output only. List of modalities that were processed in the cached content. Output only. List of modalities that were processed in the request input. Config for optional parameters. GCS or BigQuery URI prefix for the output predictions. Example: “gs://path/to/output/data” or “bq://projectId.bqDatasetId.bqTableId”. The user-defined name of this BatchJob. Request to create a . Required. The to create. Required. The name of the where this will be created. Example: Request for CreateFile. Optional. Metadata for the file to create. Response for CreateFile. Metadata for the created file. Request to create a tuned model. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. The name of the Model to tune. Example: models/text-bison-001 Tuning tasks that create tuned models. Constructor. Creates a request for a tuned model. Model to use. Name of the tuned model. Dataset for training or validation. Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used. Response of a newly created tuned model. A fine-tuned model created using ModelService.CreateTunedModel. Optional. Name of the foundation model to tune. Supported values: gemini-1.5-pro-002, gemini-1.5-flash-002, and gemini-1.0-pro-002. Optional. A display name for the tuned model. If not set, a random name is generated. Creates an instance of . Creates a request for tuning a model. Model to use. URI of dataset for training. URI of dataset for validation. Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used. Thrown when is empty or null. Thrown when is empty or null. Represents the credentials used to authenticate with the API. It de/serializes the content of the client_secret.json file for OAuth 2.0 using either Desktop or Web approach, and supports Service Accounts on Google Cloud Platform. Client secrets for web applications. Client secrets for desktop applications. Account used in Google CLoud Platform. Refresh token for the API to retrieve a new access token. Type of account in Google Cloud Platform. Uri of domain Project ID in Google Cloud Platform. Project ID (quota) in Google Cloud Platform. Represents the content of a client_secret.json file used in Google Cloud Platform to authenticate a user or service account. Client ID Client secret List of Callback URLs in case of a web application. Authentication endpoint. URL to an X509 certificate provider. Uri of token. Result for custom code execution metric. Output only. Custom code execution score. Specificies a metric that is populated by evaluating user-defined Python code. Required. Python function. Expected user to define the following function, e.g.: def evaluate(instance: dict[str, Any]) -> float: Please include this function signature in the code snippet. Instance is the evaluation instance, any fields populated in the instance are available to the function as instance[field_name]. Example: Example input: `` instance= EvaluationInstance( response=EvaluationInstance.InstanceData(text="The answer is 4."), reference=EvaluationInstance.InstanceData(text="4") ) ` Example converted input: ` { 'response': {'text': 'The answer is 4.'}, 'reference': {'text': '4'} } ` Example python function: ` def evaluate(instance: dict[str, Any]) -> float: if instance'response' == instance'reference': return 1.0 return 0.0 `` CustomCodeExecutionSpec is also supported in Batch Evaluation (EvalDataset RPC) and Tuning Evaluation. Each line in the input jsonl file will be converted to dict[str, Any] and passed to the evaluation function. If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. The error result of the operation in case of failure or cancellation. Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}. The normal, successful response of the operation. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse. User provided metadata stored as key-value pairs. Required. The key of the metadata to store. The numeric value of the metadata to store. The StringList value of the metadata to store. The string value of the metadata to store. Spec for custom output. Output only. List of raw output strings. Spec for custom output format configuration. Optional. Whether to return raw output. A collection of DataItems and Annotations on them. Dataset for training or validation. Output only. Timestamp when this Dataset was created. Output only. The number of DataItems in this Dataset. Only apply for non-structured Dataset. The description of the Dataset. Required. The user-defined name of the Dataset. The name can be up to 128 characters long and can consist of any UTF-8 characters. Customer-managed encryption key spec for a Dataset. If set, this Dataset and all sub-resources of this Dataset will be secured by this key. Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens. The labels with user-defined metadata to organize your Datasets. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one Dataset (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. Following system labels exist for each Dataset: * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its value is the metadata_schema's title. Required. Additional information about the Dataset. Output only. The resource name of the Artifact that was created in MetadataStore when creating the Dataset. The Artifact resource name pattern is projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}. Required. Points to a YAML file stored on Google Cloud Storage describing additional information about the Dataset. The schema is defined as an OpenAPI 3.0.2 Schema Object. The schema files that can be used here are found in gs://google-cloud-aiplatform/schema/dataset/metadata/. Optional. Reference to the public base model last used by the dataset. Only set for prompt datasets. Output only. Identifier. The resource name of the Dataset. Format: projects/{project}/locations/{location}/datasets/{dataset} Output only. Reserved for future use. Output only. Reserved for future use. All SavedQueries belong to the Dataset will be returned in List/Get Dataset response. The annotation_specs field will not be populated except for UI cases which will only use annotation_spec_count. In CreateDataset request, a SavedQuery is created together if this field is set, up to one SavedQuery can be set in CreateDatasetRequest. The SavedQuery should not contain any AnnotationSpec. Output only. Timestamp when this Dataset was last updated. Optional. Inline examples with simple input/output text. Distribution computed over a tuning dataset. Output only. Defines the histogram bucket. Output only. The maximum of the population values. Output only. The arithmetic mean of the values in the population. Output only. The median of the values in the population. Output only. The minimum of the population values. Output only. The 5th percentile of the values in the population. Output only. The 95th percentile of the values in the population. Output only. Sum of a given population of values. Dataset bucket used to create a histogram for the distribution given a population of values. Output only. Number of values in the bucket. Output only. Left bound of the bucket. Output only. Right bound of the bucket. Statistics computed over a tuning dataset. Output only. A partial sample of the indices (starting from 1) of the dropped examples. Output only. For each index in dropped_example_indices, the user-facing reason why the example was dropped. Output only. Number of billable characters in the tuning dataset. Output only. Number of tuning characters in the tuning dataset. Output only. Number of examples in the tuning dataset. Output only. Number of tuning steps for this Tuning Job. Output only. Sample user messages in the training dataset uri. Output only. Dataset distributions for the user input tokens. Output only. Dataset distributions for the messages per example. Output only. Dataset distributions for the user output tokens. Custom DateTime JSON converter to serialize and deserialize ISO 8601 format without nanoseconds. Custom DateTime JSON converter to serialize and deserialize ISO 8601 format without nanoseconds. Configuration options that change client network behavior when testing. Request to delete a . Required. The resource name of the to delete. Example: Points to a DeployedModel. Immutable. The ID of the Checkpoint deployed in the DeployedModel. Immutable. An ID of a DeployedModel in the above Endpoint. Immutable. A resource name of an Endpoint. Backend response for a Diff get checksums response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol. The object version of the object the checksums are being returned for. The total size of the server object. The chunk size of checksums. Must be a multiple of 256KB. If set, calculate the checksums based on the contents and return them to the caller. Exactly one of these fields must be populated. If checksums_location is filled, the server will return the corresponding contents to the user. If object_location is filled, the server will calculate the checksums based on the content there and return that to the user. For details on the format of the checksums, see http://go/scotty-diff-protocol. Backend response for a Diff download response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol. The original object location. A Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol. The object version of the object that is the base version the incoming diff script will be applied to. This field will always be filled in. The location of the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. The location of the checksums for the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. For details on the format of the checksums, see http://go/scotty-diff-protocol. Backend response for a Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol. The object version of the object at the server. Must be included in the end notification response. The version in the end notification response must correspond to the new version of the object that is now stored at the server, after the upload. The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification. Backend response for a Diff get version response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol. The object version of the object the checksums are being returned for. The total size of the server object. The input content is encapsulated and uploaded in the request. Statistics for distillation prompt dataset. These statistics do not include the responses sampled from the teacher model. Output only. Statistics computed for the training dataset. Hyperparameters for Distillation. Optional. Adapter size for distillation. Optional. Number of complete passes the model makes over the entire training dataset during training. Optional. Multiplier for adjusting the default learning rate. Tuning Spec for Distillation. The base teacher model that is being distilled. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). Optional. Hyperparameters for Distillation. Deprecated. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts. The student model that is being tuned, e.g., "google/gemma-2b-1.1-it". Deprecated. Use base_model instead. Deprecated. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. The resource name of the Tuned teacher model. Format: projects/{project}/locations/{location}/models/{model}. Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. A `Document` is a collection of `Chunk`s. A Document is a collection of Chunks. Output only. The Timestamp of when the Document was created. Optional. User provided custom metadata stored as key-value pairs used for querying. A Document can have a maximum of 20 CustomMetadata. Optional. The human-readable display name for the Document. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation" Output only. The mime type of the Document. Immutable. Identifier. The Document resource name. The ID (name excluding the "fileSearchStores/*/documents/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from display_name along with a 12 character random suffix. Example: fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c Output only. The size of raw bytes ingested into the Document. Output only. Current state of the Document. Output only. The Timestamp of when the Document was last updated. The default value. This value is used if the state is omitted. Some `Chunks` of the `Document` are being processed (embedding and vector storage). All `Chunks` of the `Document` is processed and available for querying. Some `Chunks` of the `Document` failed processing. Response for DownloadFile. Parameters specific to media downloads. A boolean to be returned in the response to Scotty. Allows/disallows gzip encoding of the payload content when the server thinks it's advantageous (hence, does not guarantee compression) which allows Scotty to GZip the response to the client. Determining whether or not Apiary should skip the inclusion of any Content-Range header on its response to Scotty. A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. Seconds of a duration. Nano seconds of a duration. Describes the options to customize dynamic retrieval. Describes the options to customize dynamic retrieval. The threshold to be used in dynamic retrieval. If not set, a system default value is used. The mode of the predictor to be used in dynamic retrieval. Always trigger retrieval. Run retrieval only when system decides it is necessary. Edit config object for model versions 006 and greater. All editConfig subfields are optional. If not specified, the default editing mode is inpainting. Optional. Describes the editing mode for the request. One editing mode per request. Optional. Optional. Determines the dilation percentage of the mask provided. 0.03 (3%) is the default value of shortest side. Minimum: 0, Maximum: 1 Optional. Defines whether the detected product should stay fixed or be repositioned. If you set this field, you must also set "editMode": "product-image". Values: reposition - Lets the model move the location of the detected product or object. (default value) fixed - The model maintains the original positioning of the detected product or object If the input image is not square, the model defaults to reposition. Request for image editing. Initializes a new instance of the class. A text description of the edit to apply to the image. The number of generated images. Response for the request to edit an image. Output only. A list of the generated images. List of generated images. A list of reasons why content may have been blocked. Default editing mode. Background swap editing mode. Controlled editing mode. Inpainting insertion editing mode. Inpainting removal editing mode. Outpainting editing mode. Product image editing mode. Style editing mode. A resource representing a batch of EmbedContent requests. Output only. Stats about the batch. Output only. The time at which the batch was created. Required. The user-defined name of this batch. Output only. The time at which the batch processing completed. Required. Input configuration of the instances on which batch processing are performed. Required. The name of the Model to use for generating the completion. Format: models/{model}. Output only. Identifier. Resource name of the batch. Format: batches/{batch_id}. Output only. The output of the batch request. Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. Output only. The state of the batch. Output only. The time at which the batch was last updated. The batch state is unspecified. The service is preparing to run the batch. The batch is in progress. The batch completed successfully. The batch failed. The batch has been cancelled. The batch has expired. The output of a batch request. This is returned in the AsyncBatchEmbedContentResponse or the EmbedContentBatch.output field. Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests. Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be EmbedContentResponse messages formatted as JSON. The responses will be written in the same order as the input requests. Stats about the batch. Output only. The number of requests that failed to be processed. Output only. The number of requests that are still pending processing. Output only. The number of requests in the batch. Output only. The number of requests that were successfully processed. Optional parameters for the embed_content method. Vertex API only. Whether to silently truncate inputs longer than the max sequence length. If this option is set to false, oversized inputs will lead to an INVALID_ARGUMENT error, similar to other text APIs. Vertex API only. The MIME type of the input. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (models/embedding-001). Type of task for which the embedding will be used. Title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Request message for PredictionService.EmbedContent. Request containing the for the model to embed. Request containing the Content for the model to embed. Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length. Required. The content to embed. Only the fields will be counted. Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the ListModels method. Format: models/{model} Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (models/embedding-001). Optional. Optional task type for which the embeddings will be used. Not supported on earlier models (models/embedding-001). Optional. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval. Response message for PredictionService.EmbedContent. The response to an . The response to an EmbedContentRequest. Whether the input content was truncated before generating the embedding. Metadata about the response(s). Output only. Generated candidates. Output only. The embeddings for each request, in the same order as provided in the batch request. Output only. The embedding generated from the input content. A list of floats representing the embedding. A list of floats representing the embedding. The embedding values. Request to get a text embedding from the model. Request to get a text embedding from the model. Default constructor. Optional. The free-form input text that the model will turn into an embedding. Required. The model name to use with the format model=models/{model}. Optional. The free-form input text that the model will turn into an embedding. The response to a EmbedTextRequest. The response to a EmbedTextRequest. Output only. The embeddings generated from the input text. Output only. The embedding generated from the input text. A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource. Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be in the same region as the resource. It must have the format projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. Optional. Sites with confidence level chosen & above this value will be blocked from the search results. Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI. Represents an environment variable present in a Container or Python Module. Required. Name of the environment variable. Must be a valid C identifier. Required. Variables that reference a $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. The results from an evaluation run performed by the EvaluationService. Output only. Aggregation statistics derived from results of EvaluationService. Output only. Output info for EvaluationService. Evaluate Dataset Run Result for Tuning Job. Output only. The checkpoint id used in the evaluation run. Only populated when evaluating checkpoints. Output only. The error of the evaluation run if any. Output only. Results for EvaluationService. Output only. The resource name of the evaluation run. Format: projects/{project}/locations/{location}/evaluationRuns/{evaluation_run_id}. Output only. The operation ID of the evaluation run. Format: projects/{project}/locations/{location}/operations/{operation_id}. Evaluation Config for Tuning Job. Optional. Autorater config for evaluation. Optional. Configuration options for inference generation and outputs. If not set, default generation parameters are used. Required. The metrics used for evaluation. Required. Config for evaluation output. The dataset used for evaluation. BigQuery source holds the dataset. Cloud storage source holds the dataset. Currently only one Cloud Storage file path is supported. Exact match metric value for an instance. Output only. Exact match score. Spec for exact match metric - returns 1 if prediction and reference exactly matches, otherwise 0. An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response. Output only. Timestamp when this Example was created. Optional. The display name for Example. Optional. Immutable. Unique identifier of an example. If not specified when upserting new examples, the example_id will be generated. An example of chat history and its expected outcome to be used with GenerateContent. Required. An example of an input Message from the user. Required. An example of what the model should output given the input. Example-based explainability that returns the nearest neighbors from the provided dataset. The Cloud Storage input instances. The Cloud Storage locations that contain the instances to be indexed for approximate nearest neighbor search. The full configuration for the generated index, the semantics are the same as metadata and should match [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config). The number of neighbors to return when querying for examples. Simplified preset configuration, which automatically sets configuration values based on the desired query speed-precision trade-off and modality. The Cloud Storage input instances. The format in which instances are given, if not specified, assume it's JSONL format. Currently only JSONL format is supported. The Cloud Storage location for the input instances. Format unspecified, used when unset. Examples are stored in JSONL files. 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. Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the tool, in which the code will be automatically executed, and a corresponding will also be generated. Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the CodeExecution tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated. Required. The code to be executed. Required. Programming language of the code. Unspecified language. This value should not be used. Python >= 3.10, with numpy and simpy available. Python is the default language. Metadata describing the Model's input and output for explanation. Points to a YAML file stored on Google Cloud Storage describing the format of the feature attributions. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML tabular Models always have this field populated by Vertex AI. Note: The URI given on output may be different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access. Required. Map from feature names to feature input metadata. Keys are the name of the features. Values are the specification of the feature. An empty InputMetadata is valid. It describes a text feature which has the name specified as the key in ExplanationMetadata.inputs. The baseline of the empty feature is chosen by Vertex AI. For Vertex AI-provided Tensorflow images, the key can be any friendly name of the feature. Once specified, featureAttributions are keyed by this key (if not grouped with another feature). For custom images, the key must match with the key in instance. Name of the source to generate embeddings for example based explanations. Required. Map from output names to output metadata. For Vertex AI-provided Tensorflow images, keys can be any user defined string that consists of any UTF-8 characters. For custom images, keys are the name of the output field in the prediction to be explained. Currently only one key is allowed. Parameters to configure explaining for Model's predictions. Example-based explanations that returns the nearest neighbors from the provided dataset. An attribution method that computes Aumann-Shapley values taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1703.01365 If populated, only returns attributions that have output_index contained in output_indices. It must be an ndarray of integers, with the same shape of the output it's explaining. If not populated, returns attributions for top_k indices of outputs. If neither top_k nor output_indices is populated, returns the argmax index of the outputs. Only applicable to Models that predict multiple outputs (e,g, multi-class Models that predict multiple classes). An attribution method that approximates Shapley values for features that contribute to the label being predicted. A sampling strategy is used to approximate the value rather than considering all subsets of features. Refer to this paper for model details: https://arxiv.org/abs/1306.4265. If populated, returns attributions for top K indices of outputs (defaults to 1). Only applies to Models that predicts more than one outputs (e,g, multi-class Models). When set to -1, returns explanations for all outputs. An attribution method that redistributes Integrated Gradients attribution to segmented regions, taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1906.02825 XRAI currently performs better on natural images, like a picture of a house or an animal. If the images are taken in artificial environments, like a lab or manufacturing line, or from diagnostic equipment, like x-rays or quality-control cameras, use Integrated Gradients instead. Specification of Model explanation. Optional. Metadata describing the Model's input and output for explanation. Required. Parameters that configure explaining of the Model's predictions. 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. The authentication config to access the API. Deprecated. Please use auth_config instead. The API spec that the external API implements. The authentication config to access the API. Parameters for the elastic search API. The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search Parameters for the simple search API. Unspecified API spec. This value should not be used. Simple search API spec. Elastic search API spec. The search parameters to use for the ELASTIC_SEARCH spec. The ElasticSearch index to use. Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the num_hits param. The ElasticSearch search template to use. The search parameters to use for SIMPLE_SEARCH spec. Noise sigma by features. Noise sigma represents the standard deviation of the gaussian kernel that will be used to add noise to interpolated inputs prior to computing gradients. Noise sigma per feature. No noise is added to features that are not set. Noise sigma for a single feature. The name of the input feature for which noise sigma is provided. The features are defined in explanation metadata inputs. This represents the standard deviation of the Gaussian kernel that will be used to add noise to the feature prior to computing gradients. Similar to noise_sigma but represents the noise added to the current feature. Defaults to 0.1. 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. URI based data. URI based data. Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in PromptMessage for prompt management. It is used in the Gemini calls only when server side tools (code_execution, google_search, and url_context) are enabled. Required. URI. Optional. The IANA standard MIME type of the source data. Optional. The human-readable display name for the File. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image" Optional. The resource name of the File to create. A file resource of the File API. A file uploaded to the API. Next ID: 15 Output only. The timestamp of when the File was created. Optional. The human-readable display name for the File. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image" Output only. The download uri of the File. Output only. Error status if File processing failed. Output only. The timestamp of when the File will be deleted. Only set if the File is scheduled to expire. Output only. MIME type of the file. Immutable. Identifier. The File resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: files/123-456 Output only. SHA-256 hash of the uploaded bytes. Output only. Size of the file in bytes. Source of the File. Output only. Processing state of the File. Output only. The timestamp of when the File was last updated. Output only. The uri of the File. Output only. Metadata for a video. Used if source is not specified. Indicates the file is uploaded by the user. Indicates the file is generated by Google. Indicates the file is a registered, i.e. a Google Cloud Storage file. The default value. This value is used if the state is omitted. File is being processed and cannot be used for inference yet. File is processed and available for inference. File failed processing. Source of the File. Used if source is not specified. Indicates the file is uploaded by the user. Indicates the file is generated by Google. Indicates the file is a registered, i.e. a Google Cloud Storage file. The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. Optional. The configuration for the retrieval. Required. Semantic retrieval resources to retrieve from. Currently only supports one corpus. In the future we may open up multiple corpora support. Convenience property. Convenience property. Required. The names of the file_search_stores to retrieve from. Example: fileSearchStores/my-file-search-store-123 Optional. Metadata filter to apply to the semantic retrieval documents and chunks. Optional. The number of semantic retrieval chunks to retrieve. Semantic retrieval configuration. Optional. Metadata filter to apply to the semantic retrieval documents and chunks. Optional. The number of semantic retrieval chunks to retrieve. A is a collection of s. A FileSearchStore is a collection of Documents. Output only. The number of documents in the FileSearchStore that are active and ready for retrieval. Output only. The Timestamp of when the FileSearchStore was created. Optional. The human-readable display name for the FileSearchStore. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" Output only. The number of documents in the FileSearchStore that have failed processing. Output only. Immutable. Identifier. The FileSearchStore resource name. It is an ID (name excluding the "fileSearchStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from display_name along with a 12 character random suffix. Example: fileSearchStores/my-awesome-file-search-store-123a456b789c If display_name is not provided, the name will be randomly generated. Output only. The number of documents in the FileSearchStore that are being processed. Output only. The size of raw bytes ingested into the FileSearchStore. This is the total size of all the documents in the FileSearchStore. Output only. The Timestamp of when the FileSearchStore was last updated. RagFile status. Output only. Only when the state field is ERROR. Output only. RagFile state. RagFile state is unspecified. RagFile resource has been created and indexed successfully. RagFile resource is in a problematic state. See `error_message` field for details. Optional. String for metadata filtering. Optional. Only returns contexts with vector distance smaller than the threshold. Optional. Only returns contexts with vector similarity larger than the threshold. Default value. This value is unused. Natural stop point of the model or provided stop sequence. The maximum number of tokens as specified in the request was reached. The response candidate content was flagged for safety reasons. The response candidate content was flagged for recitation reasons. The response candidate content was flagged for using an unsupported language. Unknown reason. Token generation stopped because the content contains forbidden terms. Token generation stopped for potentially containing prohibited content. Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII). The function call generated by the model is invalid. Token generation stopped because generated images contain safety violations. Image generation stopped because generated images has other prohibited content. Image generation stopped because of other miscellaneous issue. The model was expected to generate an image, but none was generated. Image generation stopped due to recitation. Model generated a tool call but no tools were enabled in the request. Model called too many tools consecutively, thus the system exited execution. Request has at least one thought signature missing. Finished due to malformed response. Tuning Spec for Full Fine Tuning. Optional. Hyperparameters for Full Fine Tuning. Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. 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. A predicted returned from the model that contains a string representing the with the arguments and their values. A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values. Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. Optional. The function parameters and values in JSON object format. Optional. Unique identifier of the function call. If populated, the client to execute the function_call and return the response with the matching id. Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. Function calling config. Configuration for specifying function calling behavior. Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the [FunctionCall.partial_args] field. Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names. Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO. Unspecified function calling mode. This value should not be used. Default model behavior, model decides to predict either a function call or a natural language response. Model is constrained to always predicting a function call only. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations". Model will not predict any function call. Model behavior is same as when not passing any function declarations. Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations". Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). 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. Structured representation of a function declaration as defined by the OpenAPI 3.03 specification. Included in this declaration are the function name and parameters. 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. Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. 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. Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. Required. A brief description of the function. Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 64. Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: `` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ` This field is mutually exclusive with parameters`. Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function. Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with response. This value is unused. If set, the system will wait to receive the function response before continuing the conversation. If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model. 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. The result output from a that contains a string representing the 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 made based on model prediction. 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 aFunctionCall made based on model prediction. Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call id. Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. Optional. Ordered Parts that constitute a function response. Parts may have different IANA MIME types. Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model. Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty response with will_continue=False to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set scheduling to SILENT. This value is unused. Only add the result to the conversation context, do not interrupt or trigger generation. Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation. Add the result to the conversation context, interrupt ongoing generation and prompt to generate output. Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field. Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. Raw bytes for media formats. The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats). URI based data for function response. Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. Required. URI. Required. The IANA standard MIME type of the source data. 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. A datatype containing media that is part of a message. A consists of data which has an associated datatype. A can only contain one of the accepted types in . A must have a fixed IANA MIME type identifying the type and subtype of the media if the field is filled with raw bytes. 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. URI based data. Inline media bytes. The Google Cloud Storage location where the output is to be written to. Required. Google Cloud Storage URI to output directory. If the uri doesn't end with '/', a '/' will be automatically appended. The directory is created if it doesn't exist. The Google Cloud Storage location for the input content. Required. Google Cloud Storage URI(-s) to the input file(s). May contain wildcards. For more information on wildcards, see https://cloud.google.com/storage/docs/wildcards. Input example for preference optimization. List of completions for a given prompt. Multi-turn contents that represents the Prompt. Completion and its preference score. Single turn completion for the given prompt. The score for the given completion. Request to generate a grounded answer from the model. Request to generate a grounded answer from the Model. Default constructor. Required. Style in which answers should be returned. Required. The content of the current conversation with the Model. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last Content in the list containing the question. Note: GenerateAnswer only supports queries in English. Passages provided inline with the request. Optional. A list of unique SafetySetting instances for blocking unsafe content. This will be enforced on the GenerateAnswerRequest.contents and GenerateAnswerResponse.candidate. There should not be more than one setting for each SafetyCategory type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each SafetyCategory specified in the safety_settings. If there is no SafetySetting for a given SafetyCategory provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. Content retrieved from resources created via the Semantic Retriever API. Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases. Response from the model for a grounded answer. Response from the model for a grounded answer. Responded text information of first candidate. A convenience overload to easily access the responded text. The responded text information of first candidate. Candidate answer from the model. Note: The model *always* attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low answerable_probability. Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low answerable_probability indicates that the answer might not be grounded in the sources. When answerable_probability is low, you may want to: * Display a message to the effect of "We couldn’t answer that question" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. 0.5 is a good starting threshold. Output only. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. The input data can be one or more of the following: - Question specified by the last entry in GenerateAnswerRequest.content - Conversation history specified by the other entries in GenerateAnswerRequest.content - Grounding sources (GenerateAnswerRequest.semantic_retriever or GenerateAnswerRequest.inline_passages) A resource representing a batch of GenerateContent requests. Output only. Stats about the batch. Output only. The time at which the batch was created. Required. The user-defined name of this batch. Output only. The time at which the batch processing completed. Required. Input configuration of the instances on which batch processing are performed. Required. The name of the Model to use for generating the completion. Format: models/{model}. Output only. Identifier. Resource name of the batch. Format: batches/{batch_id}. Output only. The output of the batch request. Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. Output only. The state of the batch. Output only. The time at which the batch was last updated. The batch state is unspecified. The service is preparing to run the batch. The batch is in progress. The batch completed successfully. The batch failed. The batch has been cancelled. The batch has expired. The output of a batch request. This is returned in the BatchGenerateContentResponse or the GenerateContentBatch.output field. Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests. Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be GenerateContentResponse messages formatted as JSON. The responses will be written in the same order as the input requests. Optional model configuration parameters. If enabled, audio timestamp will be included in the request to the model. The configuration for automatic function calling. Resource name of a context cache that can be used in subsequent requests. Labels with user-defined metadata to break down billed charges. Configuration for model router requests. Safety settings in the request to block unsafe content in the response. Instructions for the model to steer it toward better performance. For example, “Answer as concisely as possible” or “Don’t use technical terms in your response”. Associates model output to a specific function call. Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model. Request message for [PredictionService.GenerateContent]. Request to generate a completion from the model. Request to generate a completion from the model. Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied. The ETag of the item. Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. Initializes a new instance of the class. Initializes a new instance of the class. String to process. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Configuration of tools. Thrown when the is . Initializes a new instance of the class. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Configuration of tools. Thrown when the is . Initializes a new instance of the class. The media file resource. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Configuration of tools. Thrown when the is . Initializes a new instance of the class. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Configuration of tools. Thrown when the is . Adds a object to the request. Adds a media file or a base64-encoded string to the request. Depending on the flag, either an or part will be added to the request. Standard URLs are supported and the resource is downloaded if is . The URI of the media file. The IANA standard MIME type to check. Flag indicating whether the file shall be used online or read from the local file system. Thrown when the is . Adds a media file resource to the request. The media file resource. Thrown when the is . Thrown when the MIME type of > is not supported by the API. Adds a object to the Content at the specified . Part object to add to the collection. Zero-based index of element in the Contents collection. Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: cachedContents/{cachedContent} Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. Optional. Configuration options for model generation and outputs. Required. The name of the Model to use for generating the completion. Format: models/{model}. Optional. A list of unique SafetySetting instances for blocking unsafe content. This will be enforced on the GenerateContentRequest.contents and GenerateContentResponse.candidates. There should not be more than one setting for each SafetyCategory type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each SafetyCategory specified in the safety_settings. If there is no SafetySetting for a given SafetyCategory provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only. Optional. Tool configuration for any Tool specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example. Optional. A list of Tools the Model may use to generate the next response. A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the Model. Supported Tools are Function and code_execution. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. Response message for [PredictionService.GenerateContent]. Response from the model supporting multiple candidates. Ref: https://ai.google.dev/api/rest/v1beta/GenerateContentResponse Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in GenerateContentResponse.prompt_feedback and for each candidate in finish_reason and in safety_ratings. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check prompt_feedback) - Reports feedback on each candidate in finish_reason and safety_ratings. Output only. Timestamp when the request is made to the server. A convenience property to get the responded text information of first candidate. A convenience property to get the function calls. A convenience property to get the responded thinking information of first candidate. Default constructor. Base constructor to set the instance. Optional. Logger instance used for logging A convenience overload to easily access the responded text. The responded text information of first candidate. Candidate responses from the model. Output only. The current model status of this model. Output only. The model version used to generate the response. Returns the prompt's feedback related to the content filters. Output only. response_id is used to identify each response. Output only. Metadata on the generation requests' token usage. 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. Output only. The reason why the prompt was blocked. Output only. A readable message that explains the reason why the prompt was blocked. Output only. A list of safety ratings for the prompt. There is one rating per category. Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. Output only. A detailed breakdown of the token count for each modality in the cached content. Output only. The number of tokens in the cached content that was used for this request. The total number of tokens in the generated candidates. Output only. A detailed breakdown of the token count for each modality in the generated candidates. The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When cached_content is set, this also includes the number of tokens in the cached content. Output only. A detailed breakdown of the token count for each modality in the prompt. Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable. Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable. Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input. The total number of tokens for the entire request. This is the sum of prompt_token_count, candidates_token_count, tool_use_prompt_token_count, and thoughts_token_count. Output only. The traffic type for this request. Unspecified request traffic type. The request was processed using Pay-As-You-Go quota. Type for Priority Pay-As-You-Go traffic. Type for Flex traffic. Type for Provisioned Throughput traffic. A file generated on behalf of a user. A file generated on behalf of a user. The blob reference of the generated file to download. Only set when the GeneratedFiles.get request url has the \"?alt=media\" query param. Error details if the GeneratedFile ends up in the STATE_FAILED state. MIME type of the generatedFile. Identifier. The name of the generated file. Example: generatedFiles/abc-123 Output only. The state of the GeneratedFile. The default value. This value is used if the state is omitted. Being generated. Generated and is ready for download. Failed to generate the GeneratedFile. An output image. The output image data. Responsible AI filter reason if the image is filtered out of the response. The rewritten prompt used for the image generation if the prompt enhancer is enabled. A generated video. The output video An embedding vector generated by the model. Output only. The embedding vector generated for the input. Can be either a list of floats or a base64 string encoding the a list of floats with C-style layout (Numpy compatible). Output only. Index of the embedding in the list of embeddings. Output only. Always \"embedding\", required by the SDK. Request for embedding generation. Required. Model to generate the embeddings for. Required. The input to generate embeddings for. Can be a string, or a list of strings. The SDK supports a list of numbers and list of list of numbers, but this is not yet implemented. Optional. The format of the encoding. Must be either \"float\" or \"base64\". Optional. Dimensional size of the generated embeddings. Response for embedding generation. Output only. Model used to generate the embeddings. Output only. Always \"embedding\", required by the SDK. Output only. A list of the requested embeddings. The config for generating an images. Request for image generation. Initializes a new instance of the class. The text prompt guides what images the model generates. The number of generated images. Thrown when the is . Thrown when the is less than 1 or greater than 8. Response for image generation. Output only. A list of the generated images. List of generated images. Output only. Model used to generate the images. Output only. Always \"image\", required by the SDK. Generates a response from the model given an input MessagePrompt. Request to generate a message response from the model. Default constructor. Optional. The number of generated response messages to return. This value must be between [1, 8], inclusive. If unset, this will default to 1. Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion. Optional. Controls the randomness of the output. Values can range over [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied, while a value closer to 0.0 will typically result in less surprising responses from the model. Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of top_k most probable tokens. Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least top_p. The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages. The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages. Responded text information of first candidate. A convenience overload to easily access the responded text. The responded text information of first candidate. Candidate response messages from the model. A set of content filtering metadata for the prompt and response text. This indicates which SafetyCategory(s) blocked a candidate from this response, the lowest HarmProbability that triggered a block, and the HarmThreshold setting for that category. The conversation history used by the model. Request to generate a text completion response from the model. Request to generate a text completion response from the model. Default constructor. Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1. Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the Model specification. Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text. Optional. A list of unique SafetySetting instances for blocking unsafe content. that will be enforced on the GenerateTextRequest.prompt and GenerateTextResponse.candidates. There should not be more than one setting for each SafetyCategory type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each SafetyCategory specified in the safety_settings. If there is no SafetySetting for a given SafetyCategory provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response. Optional. Controls the randomness of the output. Note: The default value varies by model, see the Model.temperature attribute of the Model returned the getModel function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of top_k most probable tokens. Defaults to 40. Note: The default value varies by model, see the Model.top_k attribute of the Model returned the getModel function. Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the Model.top_p attribute of the Model returned the getModel function. The response from the model, including candidate completions. The response from the model, including candidate completions. Responded text information of first candidate. A convenience overload to easily access the responded text. The responded text information of first candidate. Candidate responses from the model. A set of content filtering metadata for the prompt and response text. This indicates which SafetyCategory(s) blocked a candidate from this response, the lowest HarmProbability that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the SafetySettings that would be necessary to unblock at least 1 response. The blocking is configured by the SafetySettings in the request (or the default SafetySettings of the API). Returns any safety feedback related to content filtering. Number of output videos. Number of output videos. Optional. The aspect ratio for the generated video. 16:9 (landscape) and 9:16 (portrait) are supported. Value: 9:16, or 16:9 Duration of the clip for video generation in seconds. Whether to use the prompt rewriting logic. Frames per second for video generation. Used to override HTTP request options. Optional field in addition to the text content. Negative prompts can be explicitly stated here to help generate the video. The GCS bucket where to save the generated videos. Whether allow to generate person videos, and restrict to specific ages. Supported values are: dont_allow, allow_adult. "personGeneration": "allow_all" is not available in Imagen 2 Editing and is only available to approved users‡ in Imagen 2 Generation. Values: allow_all: Allow generation of people of all ages. allow_adult (default): Allow generation of adults only. dont_allow: Disables the inclusion of people or faces in images. The PubSub topic where to publish the video generation progress. The resolution for the generated video. 1280x720, 1920x1080 are supported. Value: 1280x720, or 1920x1080 The RNG seed. If RNG seed is exactly same for each request with unchanged inputs, the prediction results will be consistent. Otherwise, a random RNG seed will be used each time to produce a different result. A video generation operation.\n\nUse the following code to refresh the operation:\n\n```\noperation = client.operations.get(operation)\n``` The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. The generated videos. Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. The error result of the operation in case of failure or cancellation. The normal response of the operation in case of success. An array that contains the object with video details to get information about. Initializes a new instance of the class. Initializes a new instance of the class. The text prompt guides what videos the model generates. The number of generated videos. Thrown when the is . Thrown when the is less than 1 or greater than 8. Response with generated videos. List of the generated videos Returns if any videos were filtered due to RAI policies. Returns rai failure reasons if any. Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. Configuration options for model generation and outputs. Not all parameters are configurable for every model. Configuration options for model generation and outputs. Not all parameters are configurable for every model. Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response. Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response. Optional. Config for model selection. Optional. Routing configuration. Optional. Config for model selection. Optional. An internal detail. Use `responseJsonSchema` rather than this field. Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. If not specified, the default is HIGH. Recommended for Gemini 3 or later models. Use with earlier models results in an error. Optional. Output schema of the generated response. This is an alternative to response_schema that accepts [JSON Schema](https://json-schema.org/). If set, response_schema must be omitted, but response_mime_type is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - $id - $defs - $ref - $anchor - type - format - title - description - enum (for strings and numbers) - items - prefixItems - minItems - maxItems - minimum - maximum - anyOf - oneOf (interpreted the same as anyOf) - properties - additionalProperties - required The non-standard propertyOrdering property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If $ref is set on a sub-schema, no other properties, except for than those starting as a $, may be set. Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family) Optional. Enables enhanced civic answers. It may not be available for all models. Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit. Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options. Optional. Only valid if response_logprobs=True. This sets the number of top logprobs to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20]. Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the Model.output_token_limit attribute of the Model returned from the getModel function. Optional. If specified, the media resolution specified will be used. Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary. Optional. An internal detail. Use responseJsonSchema rather than this field. Optional. If true, export the logprobs results in response. Optional. MIME type of the generated candidate text. Supported MIME types are: text/plain: (default) Text output. application/json: JSON response in the response candidates. text/x.enum: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types. Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text. Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible response_mime_type must also be set. Compatible MIME types: application/json: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details. Optional. Seed used in decoding. If not set, the request uses a randomly generated seed. Optional. The speech generation config. Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop_sequence. The stop sequence will not be included as part of the response. Optional. Controls the randomness of the output. Note: The default value varies by model, see the Model.temperature attribute of the Model returned from the getModel function. Values can range from [0.0, 2.0]. Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking. Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of top_k most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by Model and is specified by theModel.top_p attribute returned from the getModel function. An empty top_k attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting top_k on requests. Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by Model and is specified by theModel.top_p attribute returned from the getModel function. An empty top_k attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting top_k on requests. Media resolution has not been set. Media resolution set to low (64 tokens). Media resolution set to medium (256 tokens). Media resolution set to high (zoomed reframing with 256 tokens). Config for model selection. Required. Feature selection preference. Unspecified feature selection preference. Prefer higher quality over lower cost. Balanced feature selection preference. Prefer lower cost over higher quality. 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. In this mode, the model is selected automatically based on the content of the request. In this mode, the model is specified manually. 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. The model routing preference. Unspecified model routing preference. The model will be selected to prioritize the quality of the response. The model will be selected to balance quality and cost. The model will be selected to prioritize the cost of the request. The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. The name of the model to use. Only public LLM models are accepted. Generic Metadata shared by all operations. Output only. Time when the operation was created. Output only. Partial failures encountered. E.g. single files that couldn't be read. This field should never exceed 20 entries. Status details field will contain standard Google Cloud error details. Output only. Time when the operation was updated for the last time. If the operation has finished (successfully or not), this is the finish time. Contains information about the source of the models generated from Generative AI Studio. Required. The public base model URI. The Google Drive location for the input content. Required. Google Drive resource IDs. The type and ID of the Google Drive resource. Required. The ID of the Google Drive resource. Required. The type of the Google Drive resource. Unspecified resource type. File resource type. Folder resource type. Tool to retrieve public maps data for grounding, powered by Google. The GoogleMaps Tool that provides geospatial context for the user's query. The GoogleMaps Tool that provides geospatial context for the user's query. Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response. A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information. This data type is not supported in Gemini API. The URI of the place. The title of the place. The text of the place answer. This Place's resource name, in `places/{place_id}` format. This can be used to look up the place in the Google Maps API. A unique identifier for review. The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content. The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). The status code, which should be an enum value of google.rpc.Code. A list of messages that carry the error details. There is a common set of message types for APIs to use. A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. Optional. Sites with confidence level chosen & above this value will be blocked from the search results. Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Optional. The set of search types to enable. If not set, web search is enabled by default. Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). Tool to retrieve public web data for grounding, powered by Google. Tool to retrieve public web data for grounding, powered by Google. Tool to retrieve public web data for grounding, powered by Google. Optional. Disable using the result from this tool in detecting grounding attribution. This does not affect how the result is given to the model for generation. Creates an instance of Creates an instance of with Mode and DynamicThreshold. The mode of the predictor to be used in dynamic retrieval. The threshold to be used in dynamic retrieval. If not set, a system default value is used. Specifies the dynamic retrieval configuration for the given source. 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 Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. The default value. This value is unused. Represents a user. When set, you must provide email_address for the user. Represents a group. When set, you must provide email_address for the group. Represents access to everyone. No extra information is required. Attribution for a source that contributed to an answer. Attribution for a source that contributed to an answer. Grounding source content that makes up this attribution. Output only. Identifier for the source contributing to this attribution. Output only. Start index into the content. Output only. End index into the content. Output only. Part index into the content. A piece of evidence that supports a claim made by the model. This is used to show a citation for a claim made by the model. When grounding is enabled, the model returns a GroundingChunk that contains a reference to the source of the information. A GroundingChunk represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps. Optional. Grounding chunk from image search. Optional. Grounding chunk from Google Maps. Optional. Grounding chunk from context retrieved by the file search tool. Grounding chunk from the web. Information about the sources that support the content of a response. When grounding is enabled, the model returns citations for claims in the response. This object contains the retrieved sources. Metadata returned to client when grounding is enabled. Metadata returned to client when grounding is enabled. Optional. The queries that were executed by the retrieval tools. This field is populated only when the grounding source is a retrieval tool, such as Vertex AI Search. Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps. Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled. List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses. List of grounding support. Image search queries used for grounding. Metadata related to retrieval in the grounding flow. Optional. Google search entry for the following-up web searches. Web search queries for the following-up web search. 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. The URI that can be used to flag the content. The ID of the place or review. Passage included inline with a grounding configuration. Content of the passage. Identifier for the passage for attributing this passage in grounded answers. Identifier for a part within a GroundingPassage. Output only. Index of the part within the GenerateAnswerRequest's GroundingPassage.content. Output only. ID of the passage matching the GenerateAnswerRequest's GroundingPassage.id. A repeated list of passages. List of passages. A collection of supporting references for a segment of the model's response. Grounding support. Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices. Optional. A list of indices (into 'grounding_chunk' in response.candidate.grounding_metadata) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order). Segment of the content this support belongs to. The harm block method is unspecified. The harm block method uses both probability and severity scores. The harm block method uses the probability score. Threshold is unspecified. Content with NEGLIGIBLE will be allowed. Content with NEGLIGIBLE and LOW will be allowed. Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. All content will be allowed. Turn off the safety filter. Category is unspecified. **PaLM** - Negative or harmful comments targeting identity and/or protected attribute. **PaLM** - Content that is rude, disrespectful, or profane. **PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore. **PaLM** - Contains references to sexual acts or other lewd content. **PaLM** - Promotes unchecked medical advice. **PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts. **Gemini** - Harassment content. **Gemini** - Hate speech and content. **Gemini** - Sexually explicit content. **Gemini** - Dangerous content. **Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead. Probability is unspecified. Content has a negligible chance of being unsafe. Content has a low chance of being unsafe. Content has a medium chance of being unsafe. Content has a high chance of being unsafe. The harm severity is unspecified. The harm severity is negligible. The harm severity is low. The harm severity is medium. The harm severity is high. Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged. The HTTP Content-Type header value specifying the content type of the body. The HTTP request/response body as raw binary. Application specific response metadata. Must be set in the first response for streaming APIs. Element is in the HTTP request query. Element is in the HTTP request header. Element is in the HTTP request path. Element is in the HTTP request body. Element is in the HTTP request cookie. HTTP options to be used in each of the requests. Specifies the version of the API to use. The base URL for the AI platform service endpoint. Additional HTTP headers to be sent with the request. Timeout for the request in milliseconds. Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance Optional: The Adapter size to use for the tuning job. The adapter size influences the number of trainable parameters for the tuning job. A larger adapter size implies that the model can learn more complex tasks, but it requires a larger training dataset and longer training times. Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples. Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used. An image generated by the model. A base64 encoded string of one (generated) image. (20 MB) The IANA standard MIME type of the image. Exists if storageUri is provided. The Cloud Storage uri where the generated images are stored. The image bytes data. can contain a value for this field or the `GcsUri` field but not both. The base64-encoded JSON of the generated image. The URL of the generated image, if response_format is url (default). The prompt that was used to generate the image, if there was any revision to the prompt. Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people. Config for image generation features. Config for image generation features. Optional. The image output format for generated images. Optional. Controls whether the model can generate people. The default behavior is unspecified. The model will decide whether to generate images of people. Allows the model to generate images of people, including adults and children. Allows the model to generate images of adults, but not children. Prevents the model from generating images of people. Optional. The aspect ratio of the image to generate. Supported aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. If not specified, the model will choose a default aspect ratio based on any reference images provided. Optional. Specifies the size of generated images. Supported values are `1K`, `2K`, `4K`. If not specified, the model will use default value `1K` MIME type of the generated image. Compression quality of the generated image (for ``image/jpeg`` only). The image output format for generated images. Optional. The compression quality of the output image. Optional. The image format that the output should be saved as. The number of generated images. Accepted integer values: 1-8 (v.002), 1-4 (v.005, v.006). Default value: 4. The number of generated images. Accepted integer values: 1-8 (v.002), 1-4 (v.005, v.006). Default value: 4. Optional. Cloud Storage URI for where to store the generated images. Optional. Pseudo random seed for reproducible generated outcome; setting the seed lets you generate deterministic output. Version 006 model only: To use the seed field you must also set "addWatermark": false in the list of parameters. Optional. The text prompt for guiding the response. en (default), de, fr, it, es Optional. Description of what to discourage in the generated images. Optional. For model version 006 and greater use editConfig.guidanceScale. Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality. Values: 0-500 - Default: 60 Optional. Whether to disable the person/face safety filter (so that person/face can be included in the generated images). Deprecated (v.006 only): Use personGeneration instead. Optional. With input prompt, image, mask - backgroundEditing mode enables background editing. Values: backgroundEditing upscale Optional. Sample image size when mode is set to upscale. This field is no longer required when upscaling. Use upscaleConfig.upscaleFactor to set the upscaled image size. 2048 or 4096 Optional. The aspect ratio of the generated image. Value: 1:1, 9:16*, 16:9*, 3:4*, or 4:3* Optional. Whether to enable rounded Responsible AI scores for a list of safety attributes in responses for unfiltered input and output. Safety attribute categories: "Death, Harm and Tragedy", "Firearms and Weapons", "Hate", "Health", "Illicit Drugs", "Politics", "Porn", "Religion and Belief", "Toxic", "Violence", "Vulgarity", "War and Conflict". Optional. The safety setting that controls the type of people or face generation allowed. "personGeneration": "allow_all" is not available in Imagen 2 Editing and is only available to approved users‡ in Imagen 2 Generation. Values: allow_all: Allow generation of people of all ages. allow_adult (default): Allow generation of adults only. dont_allow: Disables the inclusion of people or faces in images. Optional. The safety setting that controls safety filter thresholds. Values: block_most: The highest threshold resulting in most requests blocked. block_some (default): The medium threshold that balances blocks for potentially harmful and benign content. block_few: Reduces the number of requests blocked due to safety filters. This setting might increase objectionable content generated by Imagen. Defines whether the image will include a SynthID. For more information, see Identifying AI-generated content with SynthID. edit config object for model versions 006 and greater. All editConfig subfields are optional. If not specified, the default editing mode is inpainting. Optional. Describes the output image format in an object. Whether to use the prompt rewriting logic. Cloud Storage URI used to store the generated images. MIME type of the generated image. Compression quality of the generated image (for `image/jpeg` only). User specified labels to track billing usage. An array that contains the object with image details to get information about. Initializes a new instance of the class. Initializes a new instance of the class. The text prompt guides what images the model generates. The number of generated images. Thrown when the is . Thrown when the is less than 1 or greater than 8. Output only. A list of the generated images. Optional. The compression quality of the output image. Optional. The image format that the output should be saved as. A list of languages (lower case?!) The quality of the image that will be generated. Standard quality. High definition quality. The type of the reference image. Raw reference type Mask reference type Control reference type Subject reference type Style reference type Image search for grounding and related configurations. OpenAI image generation request A text description of the desired image(s). Required. The name of the `Model` to use for generating the completion. The model name will prefixed by \"models/\" if no slash appears in it. Optional. Amount of candidate completions to generate. Must be a positive integer. Defaults to 1 if not set. The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image. Optional. The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated. The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3 models. The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. The style of the generated images. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. The number of generated images. Accepted integer values: 1-3 Optional. Cloud Storage uri where to store the generated images. Optional. The seed for random number generator (RNG). If RNG seed is the same for requests with the inputs, the prediction results will be the same. Optional. The text prompt for guiding the response. en (default), de, fr, it, es Initializes a new instance of the class. Initializes a new instance of the class. The base64 encoded image to process. The question to ask about the image. The number of predictions. Language of predicted text. Defaults to "en". Optional. Cloud Storage URI where to store the generated predictions. Thrown when the is . Thrown when the is less than 1 or greater than 3. Thrown when the is not supported. List of text strings representing captions, sorted by confidence. Request for ImportFile to import a File API file with a FileSearchStore. LINT.IfChange(ImportFileRequest) Optional. Config for telling the service how to chunk the file. If not provided, the service will use default parameters. Custom metadata to be associated with the file. Required. The name of the File to import. Example: files/abc-123 Raw media bytes sent directly in the request. Text should not be sent as raw bytes. Serialized bytes data of the image or video. You can specify at most 1 image with inlineData. To specify up to 16 images, use fileData. The base64 encoding of the image, PDF, or video to include inline in the prompt. When including media inline, you must also specify MIMETYPE. Size limit: 20MB The IANA standard MIME type of the source data. The media type of the image, PDF, or video specified in the data or fileUri fields. Acceptable values include the following: "image/png", "image/jpeg", "image/heic", "image/heif", "image/webp". application/pdf video/mov video/mpeg video/mp4 video/mpg video/avi video/wmv video/mpegps video/flv Maximum video length: 2 minutes. No limit on image resolution. Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in PromptMessage for prompt management. It is used in the Gemini calls only when server side tools (code_execution, google_search, and url_context) are enabled. The request to be processed in the batch. Optional. The metadata to be associated with the request. Required. The request to be processed in the batch. The requests to be processed in the batch if provided as part of the batch creation request. Required. The requests to be processed in the batch. The response to a single request in the batch. Output only. The error encountered while processing the request. Output only. The metadata associated with the request. Output only. The response to the request. The responses to the requests in the batch. Output only. The responses to the requests in the batch. The request to be processed in the batch. Optional. The metadata to be associated with the request. Required. The request to be processed in the batch. The requests to be processed in the batch if provided as part of the batch creation request. Required. The requests to be processed in the batch. The response to a single request in the batch. Output only. The error encountered while processing the request. Output only. The metadata associated with the request. Output only. The response to the request. The responses to the requests in the batch. Output only. The responses to the requests in the batch. Configures the input to the batch request. The name of the File containing the input requests. The requests to be processed in the batch. Configures the input to the batch request. The name of the File containing the input requests. The requests to be processed in the batch. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. Optional. If set, the input was blocked and no candidates are returned. Rephrase the input. Ratings for safety of the input. There is at most one rating per category. An instance of an image with additional metadata. Required. The text prompt for the image. The text prompt guides what images the model generates. This field is required for both generation and editing. Optional. Input image for editing. Base64 encoded image (20 MB) Optional. Mask image for mask-based editing. Base64 input image with 1s and 0s where 1 indicates regions to keep (PNG) (20 MB) Optional. A list of reference images for the editing operation. An attribution method that computes the Aumann-Shapley value taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1703.01365 Config for IG with blur baseline. When enabled, a linear path from the maximally blurred image to the input image is created. Using a blurred baseline instead of zero (black image) is motivated by the BlurIG approach explained here: https://arxiv.org/abs/2004.03383 Config for SmoothGrad approximation of gradients. When enabled, the gradients are approximated by averaging the gradients from noisy samples in the vicinity of the inputs. Adding noise can help improve the computed gradients. Refer to this paper for more details: https://arxiv.org/pdf/1706.03825.pdf Required. The number of steps for approximating the path integral. A good value to start is 50 and gradually increase until the sum to diff property is within the desired error range. Valid range of its value is [1, 100], inclusively. A convenience property to get the responded text information of first candidate. 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. Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. The Jira source for the ImportRagFilesRequest. Required. The Jira queries. JiraQueries contains the Jira queries and corresponding authentication. Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Jira API key. See [Manage API tokens for your Atlassian account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/). A list of custom Jira queries to import. For information about JQL (Jira Query Language), see https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/ Required. The Jira email address. A list of Jira projects to import in their entirety. Required. The Jira server URI. Unspecified language. This value should not be used. Python >= 3.10, with numpy and simpy available. Python is the default language. 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. The latitude in degrees. It must be in the range [-90.0, +90.0]. The longitude in degrees. It must be in the range [-180.0, +180.0]. Config for optional parameters. Response with a list of CachedContents. Response with CachedContents list. List of cached contents. A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. Response from containing a paginated list of s. The s are sorted by ascending . The returned s. A token, which can be sent as to retrieve the next page. If this field is omitted, there are no more pages. Response message for MetadataService.ListContexts. The Contexts retrieved from the MetadataStore. A token, which can be sent as ListContextsRequest.page_token to retrieve the next page. If this field is not populated, there are no subsequent pages. Response from ListCorpora containing a paginated list of Corpora. The results are sorted by ascending corpus.create_time. The returned corpora. A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no more pages. Response from ListDocuments containing a paginated list of Documents. The Documents are sorted by ascending document.create_time. The returned Documents. A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no more pages. Response from ListFileSearchStores containing a paginated list of FileSearchStores. The results are sorted by ascending file_search_store.create_time. The returned rag_stores. A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no more pages. Response for ListFiles. The list of Files. A token that can be sent as a page_token into a subsequent ListFiles call. Response for ListGeneratedFiles. The list of GeneratedFiles. A token that can be sent as a page_token into a subsequent ListGeneratedFiles call. Configuration for retrieving models. If query_base is set to True in the config or not set (default), the API will return all available base models. If set to False, it will return all tuned models. Response message for ModelService.ListModels Response from ListModel containing a paginated list of Models. The returned Models. A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no more pages. The response message for Operations.ListOperations. The standard List next-page token. A list of operations that matches the specified filter in the request. Unordered list. Unreachable resources. Populated when the request sets ListOperationsRequest.return_partial_success and reads across collections. For example, when attempting to list all resources across all supported locations. Response from ListPermissions containing a paginated list of permissions. A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no more pages. Returned permissions. Response message for VertexRagDataService.ListRagCorpora. Response from `ListRagEngineCorpora` containing a paginated list of `RagEngineCorpora`. A token to retrieve the next page of results. Pass to ListRagCorporaRequest.page_token to obtain that page. List of RagCorpora in the requested page. The returned corpora. Response message for VertexRagDataService.ListRagFiles. A token to retrieve the next page of results. Pass to ListRagFilesRequest.page_token to obtain that page. List of RagFiles in the requested page. The list of files. Response from ListTunedModels containing a paginated list of Models. A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no more pages. The returned Models. Session config for the API connection. The generation configuration for the session. The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified. The speech generation configuration. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Specification for an LLM based metric. Optional. Optional additional configuration for the metric. Optional. Optional configuration for the judge LLM (Autorater). Required. Template for the prompt sent to the judge model. Dynamically generate rubrics using a predefined spec. Dynamically generate rubrics using this specification. Use a pre-defined group of rubrics associated with the input. Refers to a key in the rubric_groups map of EvaluationInstance. Optional. System instructions for the judge model. 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. Logprobs Result Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates. Sum of log probabilities for all tokens. Length = total number of decoding steps. A single token and its associated log probability. Candidate for the logprobs token and score. The candidate's log probability. The candidate’s token string value. The candidate’s token id value. 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. The list of candidate tokens, sorted by log probability in descending order. 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. The name of the model to use. Only public LLM models are accepted. A grounding chunk from Google Maps. A Maps chunk corresponds to a single place. Sources that provide answers about the features of a given place in Google Maps. The ID of the place, in places/{place_id} format. A user can use this ID to look up that place. Text description of the place answer. Title of the place. URI reference of the place. Configuration for a Mask reference image. Prompts the model to generate a mask instead of you needing to provide one (unless MASK_MODE_USER_PROVIDED is used). A list of up to 5 class ids to use for semantic segmentation. Automatically creates an image mask based on specific objects. Dilation percentage of the mask provided. Float between 0 and 1. Optional. Prompts the model to generate a mask instead of you needing to provide one. Consequently, when you provide this parameter you can omit a mask object. Values: background: Automatically generates a mask to all regions except primary object, person, or subject in the image foreground: Automatically generates a mask to the primary object, person, or subject in the image semantic: Use automatic segmentation to create a mask area for one or more of the segmentation classes. Set the segmentation classes using the classes parameter and the corresponding class_id values. You can specify up to 5 classes. Optional. Determines the classes of objects that will be segmented in an automatically generated mask image. If you use this field, you must also set "maskType": "semantic". See Segmentation class IDs The mask mode of a reference image Default mask mode. automatically generate a mask using background segmentation. automatically generate a mask using foreground segmentation. automatically generate a mask using semantic segmentation, and the given mask class. the reference image is a mask image. 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: 5 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: 5 The name of the MCPServer. A transport that can stream HTTP requests and responses. A reference to data stored on the filesystem, on GFS or in blobstore. Original file name. Media data, set if reference_type is INLINE A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified. Parameters for a media download. A unique fingerprint/version id for the media data. Extended content type information provided for Scotty uploads. Scotty-provided SHA1 hash for an upload. Scotty-provided SHA256 hash for an upload. Scotty-provided MD5 hash for an upload. For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification. MIME type of the data. Set if reference_type is DIFF_UPLOAD_REQUEST. Set if reference_type is DIFF_UPLOAD_RESPONSE. Set if reference_type is DIFF_CHECKSUMS_RESPONSE. Set if reference_type is DIFF_VERSION_RESPONSE. Set if reference_type is DIFF_DOWNLOAD_RESPONSE. Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, \"MD5\" is the only possible value for this field. New values may be added at any time. Describes what the field reference contains. Use object_id instead. Time at which the media data was last updated, in milliseconds since UNIX epoch Path to the data, set if reference_type is PATH Blobstore v2 info, set if reference_type is BLOBSTORE_REF, and it refers to a v2 blob. Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: Hex encoded hash value of the uploaded media. Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef. Size of the data, in bytes Reference to a TI Blob, set if reference_type is BIGSTORE_REF. |is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence. For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported. Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA. A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field. Media resolution for the input media. Media resolution has not been set. Media resolution set to low. Media resolution set to medium. Media resolution set to high. Media resolution set to ultra high. The base unit of structured text. A Message includes an author and the content of the Message. The author is used to tag messages when they are fed to the model as text. Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string. Output only. Citation information for model-generated content in this Message. If this Message was generated as output from the model, this field may be populated with attribution information for any text included in the content. This field is used only on output. Required. The text content of the structured Message. All of the structured input text passed to the model as a prompt. A MessagePrompt contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model. Optional. Text that should be provided to the model first to ground the response. If not empty, this context will be given to the model first before the examples and messages. When using a context be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: "Translate the phrase from English to French." or "Given a statement, classify the sentiment as happy, sad or neutral." Anything included in this field will take precedence over message history if the total input size exceeds the model's input_token_limit and the input request is truncated. Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These examples are treated identically to conversation messages except that they take precedence over the history in messages: If the total input size exceeds the model's input_token_limit the input will be truncated. Items will be dropped from messages before examples. Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's input_token_limit the input will be truncated: The oldest items will be dropped from messages. Metadata for a chunk. Optional. Attributes attached to the data. The keys have semantic conventions and the consumers of the attributes should know how to deserialize the value bytes based on the keys. User provided filter to limit retrieval based on Chunk or Document level metadata values. Example (genre = drama OR genre = action): key = "document.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}] Required. The Conditions for the given key that will trigger this filter. Multiple Conditions are joined by logical ORs. Required. The key of the metadata to filter on. The metric used for running evaluations. Optional. The aggregation metrics to use. Spec for bleu metric. Spec for a computation based metric. Spec for Custom Code Execution metric. Spec for exact match metric. Spec for an LLM based metric. Spec for pairwise metric. Spec for pointwise metric. The spec for a pre-defined metric. Spec for rouge metric. Unspecified aggregation metric. Average aggregation metric. Not supported for Pairwise metric. Mode aggregation metric. Standard deviation aggregation metric. Not supported for pairwise metric. Variance aggregation metric. Not supported for pairwise metric. Minimum aggregation metric. Not supported for pairwise metric. Maximum aggregation metric. Not supported for pairwise metric. Median aggregation metric. Not supported for pairwise metric. 90th percentile aggregation metric. Not supported for pairwise metric. 95th percentile aggregation metric. Not supported for pairwise metric. 99th percentile aggregation metric. Not supported for pairwise metric. Unspecified modality. Plain text. Image. Video. Audio. Document, e.g. PDF. TABULAR modality Represents token counting info for a single modality. Represents token counting info for a single modality. The modality associated with this token count. Number of tokens. Unspecified modality. Plain text. Image. Video. Audio. Document, e.g. PDF. Always trigger retrieval. Run retrieval only when system decides it is necessary. Default model behavior, model decides to predict either a function call or a natural language response. Model is constrained to always predicting a function call only. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations". Model will not predict any function call. Model behavior is same as when not passing any function declarations. Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations". 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. Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user's prompt for safety and security risks before it is sent to the model. The name must be in the format projects/{project}/locations/{location}/templates/{template}. Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model's response for safety and security risks before it is returned to the user. The name must be in the format projects/{project}/locations/{location}/templates/{template}. User input field to specify the base model source. Currently it only supports specifing the Model Garden models and Genie models. Information about the base model of Genie models. Source information of Model Garden models. Specification of a container for serving predictions. Some fields in this message correspond to fields in the [Kubernetes Container v1 core specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). Immutable. Specifies arguments for the command that runs when the container starts. This overrides the container's [CMD](https://docs.docker.com/engine/reference/builder/#cmd). Specify this field as an array of executable and arguments, similar to a Docker CMD's "default parameters" form. If you don't specify this field but do specify the command field, then the command from the command field runs without any additional arguments. See the [Kubernetes documentation about how the command and args fields interact with a container's ENTRYPOINT and CMD](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). If you don't specify this field and don't specify the command field, then the container's [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#cmd) and CMD determine what runs based on their default behavior. See the Docker documentation about [how CMD and ENTRYPOINT interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with $$; for example: $$(VARIABLE_NAME) This field corresponds to the args field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). Immutable. Specifies the command that runs when the container starts. This overrides the container's [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). Specify this field as an array of executable and arguments, similar to a Docker ENTRYPOINT's "exec" form, not its "shell" form. If you do not specify this field, then the container's ENTRYPOINT runs, in conjunction with the args field or the container's [CMD](https://docs.docker.com/engine/reference/builder/#cmd), if either exists. If this field is not specified and the container does not have an ENTRYPOINT, then refer to the Docker documentation about [how CMD and ENTRYPOINT interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). If you specify this field, then you can also specify the args field to provide additional arguments for this command. However, if you specify this field, then the container's CMD is ignored. See the [Kubernetes documentation about how the command and args fields interact with a container's ENTRYPOINT and CMD](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with $$; for example: $$(VARIABLE_NAME) This field corresponds to the command field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). Immutable. Deployment timeout. Limit for deployment timeout is 2 hours. Immutable. List of environment variables to set in the container. After the container starts running, code running in the container can read these environment variables. Additionally, the command and args fields can reference these variables. Later entries in this list can also reference earlier entries. For example, the following example sets the variable VAR_2 to have the value foo bar: ``json [ { "name": "VAR_1", "value": "foo" }, { "name": "VAR_2", "value": "$(VAR_1) bar" } ] ` If you switch the order of the variables in the example, then the expansion does not occur. This field corresponds to the env` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). Immutable. List of ports to expose from the container. Vertex AI sends gRPC prediction requests that it receives to the first port on this list. Vertex AI also sends liveness and health checks to this port. If you do not specify this field, gRPC requests to the container will be disabled. Vertex AI does not use ports other than the first one listed. This field corresponds to the ports field of the Kubernetes Containers v1 core API. Immutable. Specification for Kubernetes readiness probe. Immutable. HTTP path on the container to send health checks to. Vertex AI intermittently sends GET requests to this path on the container's IP address and port to check that the container is healthy. Read more about [health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). For example, if you set this field to /bar, then Vertex AI intermittently sends a GET request to the /bar path on the port of your container specified by the first value of this ModelContainerSpec's ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/ DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following endpoints/)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [AIP_ENDPOINT_ID environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the DeployedModel. (Vertex AI makes this value available to your container code as the [AIP_DEPLOYED_MODEL_ID environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) Required. Immutable. URI of the Docker image to be used as the custom container for serving predictions. This URI must identify an image in Artifact Registry or Container Registry. Learn more about the [container publishing requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), including permissions requirements for the Vertex AI Service Agent. The container image is ingested upon ModelService.UploadModel, stored internally, and this original path is afterwards not used. To learn about the requirements for the Docker image itself, see [Custom container requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). You can use the URI to one of Vertex AI's [pre-built container images for prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) in this field. Immutable. Invoke route prefix for the custom container. "/*" is the only supported value right now. By setting this field, any non-root route on this model will be accessible with invoke http call eg: "/invoke/foo/bar", however the [PredictionService.Invoke] RPC is not supported yet. Only one of predict_route or invoke_route_prefix can be set, and we default to using predict_route if this field is not set. If this field is set, the Model can only be deployed to dedicated endpoint. Immutable. Specification for Kubernetes liveness probe. Immutable. List of ports to expose from the container. Vertex AI sends any prediction requests that it receives to the first port on this list. Vertex AI also sends [liveness and health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) to this port. If you do not specify this field, it defaults to following value: ``json [ { "containerPort": 8080 } ] ` Vertex AI does not use ports other than the first one listed. This field corresponds to the ports` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). Immutable. HTTP path on the container to send prediction requests to. Vertex AI forwards requests sent using projects.locations.endpoints.predict to this path on the container's IP address and port. Vertex AI then returns the container's response in the API response. For example, if you set this field to /foo, then when Vertex AI receives a prediction request, it forwards the request body in a POST request to the /foo path on the port of your container specified by the first value of this ModelContainerSpec's ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following endpoints/)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [AIP_ENDPOINT_ID environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the DeployedModel. (Vertex AI makes this value available to your container code as the [AIP_DEPLOYED_MODEL_ID environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) Immutable. The amount of the VM memory to reserve as the shared memory for the model in megabytes. Immutable. Specification for Kubernetes startup probe. Represents export format supported by the Model. All formats export to Google Cloud Storage. Output only. The content of this Model that may be exported. Output only. The ID of the export format. The possible format IDs are: * tflite Used for Android mobile devices. * edgetpu-tflite Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices. * tf-saved-model A tensorflow model in SavedModel format. * tf-js A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used in the browser and in Node.js using JavaScript. * core-ml Used for iOS mobile devices. * custom-trained A Model that was uploaded or trained by custom code. * genie A tuned Model Garden model. Should not be used. Model artifact and any of its supported files. Will be exported to the location specified by the `artifactDestination` field of the ExportModelRequest.output_config object. The container image that is to be used when deploying this Model. Will be exported to the location specified by the `imageDestination` field of the ExportModelRequest.output_config object. Contains information about the source of the models generated from Model Garden. Required. The model garden source model resource name. Optional. Whether to avoid pulling the model from the HF cache. Optional. The model garden source model version ID. Contains information about the original Model if this Model is a copy. Output only. The resource name of the Model this Model is a copy of, including the revision. Format: projects/{project}/locations/{location}/models/{model_id}@{version_id} A trained machine learning Model. Information about a Generative Language Model. Ref: https://ai.google.dev/api/rest/v1beta/models Information about a Generative Language Model. Immutable. The path to the directory containing the Model artifact and any of its supporting files. Not required for AutoML Models. Optional. User input field to specify the base model source. Currently it only supports specifing the Model Garden models and Genie models. Optional. Output only. The checkpoints of the model. Input only. The specification of the container that is to be used when deploying this Model. The specification is ingested upon ModelService.UploadModel, and all binaries it contains are copied and stored internally by Vertex AI. Not required for AutoML Models. Output only. Timestamp when this Model was uploaded into Vertex AI. The default checkpoint id of a model version. Output only. The pointers to DeployedModels created from this Model. Note that Model could have been deployed to Endpoints in different Locations. Customer-managed encryption key spec for a Model. If set, this Model and all sub-resources of this Model will be secured by this key. The default explanation specification for this Model. The Model can be used for requesting explanation after being deployed if it is populated. The Model can be used for batch explanation if it is populated. All fields of the explanation_spec can be overridden by explanation_spec of DeployModelRequest.deployed_model, or explanation_spec of BatchPredictionJob. If the default explanation specification is not set for this Model, this Model can still be used for requesting explanation by setting explanation_spec of DeployModelRequest.deployed_model and for batch explanation by setting explanation_spec of BatchPredictionJob. Immutable. An additional information about the Model; the schema of the metadata can be found in metadata_schema. Unset if the Model does not have any additional information. Output only. The resource name of the Artifact that was created in MetadataStore when creating the Model. The Artifact resource name pattern is projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}. Immutable. Points to a YAML file stored on Google Cloud Storage describing additional information about the Model, that is specific to it. Unset if the Model does not have any additional information. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI, if no additional metadata is needed, this field is set to an empty string. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access. Output only. Source of a model. It can either be automl training pipeline, custom training pipeline, BigQuery ML, or saved and tuned from Genie or Model Garden. Output only. If this Model is a copy of another Model, this contains info about the original. The schemata that describe formats of the Model's predictions and explanations as given and returned via PredictionService.Predict and PredictionService.Explain. Output only. Reserved for future use. Output only. Reserved for future use. Output only. When this Model is deployed, its prediction resources are described by the prediction_resources field of the Endpoint.deployed_models object. Because not all Models support all resource configuration types, the configuration types this Model supports are listed here. If no configuration types are listed, the Model cannot be deployed to an Endpoint and does not support online predictions (PredictionService.Predict or PredictionService.Explain). Such a Model can serve predictions by using a BatchPredictionJob, if it has at least one entry each in supported_input_storage_formats and supported_output_storage_formats. Output only. The formats in which this Model may be exported. If empty, this Model is not available for export. Output only. The formats this Model supports in BatchPredictionJob.input_config. If PredictSchemata.instance_schema_uri exists, the instances should be given as per that schema. The possible formats are: * jsonl The JSON Lines format, where each instance is a single line. Uses GcsSource. * csv The CSV format, where each instance is a single comma-separated line. The first line in the file is the header, containing comma-separated field names. Uses GcsSource. * tf-record The TFRecord format, where each instance is a single record in tfrecord syntax. Uses GcsSource. * tf-record-gzip Similar to tf-record, but the file is gzipped. Uses GcsSource. * bigquery Each instance is a single row in BigQuery. Uses BigQuerySource. * file-list Each line of the file is the location of an instance to process, uses gcs_source field of the InputConfig object. If this Model doesn't support any of these formats it means it cannot be used with a BatchPredictionJob. However, if it has supported_deployment_resources_types, it could serve online predictions by using PredictionService.Predict or PredictionService.Explain. Output only. The formats this Model supports in BatchPredictionJob.output_config. If both PredictSchemata.instance_schema_uri and PredictSchemata.prediction_schema_uri exist, the predictions are returned together with their instances. In other words, the prediction has the original instance data first, followed by the actual prediction content (as per the schema). The possible formats are: * jsonl The JSON Lines format, where each prediction is a single line. Uses GcsDestination. * csv The CSV format, where each prediction is a single comma-separated line. The first line in the file is the header, containing comma-separated field names. Uses GcsDestination. * bigquery Each prediction is a single row in a BigQuery table, uses BigQueryDestination . If this Model doesn't support any of these formats it means it cannot be used with a BatchPredictionJob. However, if it has supported_deployment_resources_types, it could serve online predictions by using PredictionService.Predict or PredictionService.Explain. Output only. The resource name of the TrainingPipeline that uploaded this Model, if any. Output only. Timestamp when this Model was most recently updated. User provided version aliases so that a model version can be referenced via alias (i.e. projects/{project}/locations/{location}/models/{model_id}@{version_alias} instead of auto-generated version id (i.e. projects/{project}/locations/{location}/models/{model_id}@{version_id}). The format is a-z{0,126}[a-z0-9] to distinguish from version_id. A default version alias will be created for the first version of the model, and there must be exactly one default version alias for a model. Output only. Timestamp when this version was created. The description of this version. Output only. Timestamp when this version was most recently updated. Should not be used. Resources that are dedicated to the DeployedModel, and that need a higher degree of manual configuration. Resources that to large degree are decided by Vertex AI, and require only a modest additional configuration. Resources that can be shared by multiple DeployedModels. A pre-configured DeploymentResourcePool is required. The version Id of the model (Vertex AI). Output only. The state of the tuned model. Required. The tuning task that creates the tuned model. Optional. TunedModel to use as the starting point for training the new model. The name of the base model, pass this to the generation request. The ETag of the item. Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. Required. The name of the base model, pass this to the generation request. Examples: * gemini-1.5-flash A short description of the model. The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters. Maximum number of input tokens allowed for this model. The maximum temperature this model can use. Required. The resource name of the Model. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: models/{model} with a {model} naming convention of: * "{base_model_id}-{version}" Examples: * models/gemini-1.5-flash-001 Maximum number of output tokens available for this model. The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as generateMessage and generateContent. Controls the randomness of the output. Values can range over [0.0,max_temperature], inclusive. A higher value will produce responses that are more varied, while a value closer to 0.0 will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model. Whether the model supports thinking. For Top-k sampling. Top-k sampling considers the set of top_k most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and top_k isn't allowed as a generation parameter. For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least top_p. This value specifies default to be used by the backend while making the call to the model. Required. The version number of the model. This represents the major version (1.0 or 1.5) Unspecified model routing preference. The model will be selected to prioritize the quality of the response. The model will be selected to balance quality and cost. The model will be selected to prioritize the cost of the request. Detail description of the source information of the model. If this Model is copy of another Model. If true then source_type pertains to the original. Type of the model source. Should not be used. The Model is uploaded by automl training pipeline. The Model is uploaded by user or custom training pipeline. The Model is registered and sync'ed from BigQuery ML. The Model is saved or tuned from Model Garden. The Model is saved or tuned from Genie. The Model is uploaded by text embedding finetuning pipeline. The Model is saved or tuned from Marketplace. The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable. A message explaining the model status. The stage of the underlying model. The time at which the model will be retired. Unspecified model stage. The underlying model is subject to lots of tunings. Models in this stage are for experimental purposes only. Models in this stage are more mature than experimental models. Models in this stage are considered stable and ready for production use. If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model. Models in this stage are deprecated. These models cannot be used. Models in this stage are retired. These models cannot be used. Configuration for a multi-speaker text-to-speech request. The configuration for the multi-speaker setup. Required. All the enabled speaker voices. This is a copy of the tech.blob.ObjectId proto, which could not be used directly here due to transitive closure issues with JavaScript support; see http://b/8801763. The name of the object. The name of the bucket to which this object belongs. Generation of the object. Generations are monotonically increasing across writes, allowing them to be be compared to determine which generation is newer. If this is omitted in a request, then you are requesting the live object. See http://go/bigstore-versions The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. The error result of the operation in case of failure or cancellation. Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. This resource represents a long-running operation that is the result of a network API call. This resource represents a long-running operation that is the result of a network API call. If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. The error result of the operation in case of failure or cancellation. Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}. The normal, successful response of the operation. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse. This resource represents a long-running operation that is the result of a network API call. The normal, successful response of the operation. Defines the valid operators that can be applied to a key-value pair. The default value. This value is unused. Supported by numeric. Supported by numeric. Supported by numeric and string. Supported by numeric. Supported by numeric. Supported by numeric and string. Supported by string only when value type for the given key has a stringListValue. Supported by string only when value type for the given key has a stringListValue. Unspecified status. This value should not be used. Code execution completed successfully. `output` contains the stdout, if any. Code execution failed. `output` contains the stderr and stdout, if any. Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present. Config for evaluation output. Cloud storage destination for evaluation output. Describes the info for output of EvaluationService. Output only. The full path of the Cloud Storage directory created, into which the evaluation results and aggregation results are written. Optional. The IANA standard MIME type of the image. Values: image/jpeg image/png Optional. The compression quality of the output image if encoding in image/jpeg. Spec for pairwise metric result. Output only. Spec for custom output. Output only. Explanation for pairwise metric score. Output only. Pairwise metric choice. Unspecified prediction choice. Baseline prediction wins Candidate prediction wins Winner cannot be determined Spec for pairwise metric. Optional. The field name of the baseline response. Optional. The field name of the candidate response. Optional. CustomOutputFormatConfig allows customization of metric output. When this config is set, the default output is replaced with the raw output string. If a custom format is chosen, the pairwise_choice and explanation fields in the corresponding metric result will be empty. Required. Metric prompt template for pairwise metric. Optional. System instructions for pairwise metric. Not specified, should not be used. String type. Number type. Integer type. Boolean type. Array type. Object type. Null type. A datatype containing media that is part of a multi-part Content message. A Part consists of data which has an associated datatype. A Part can only contain one of the accepted types in Part.data. For media types that are not text, Part must have a fixed IANA MIME type identifying the type and subtype of the media if inline_data or file_data field is filled with raw bytes. A datatype containing media that is part of a multi-part Content message. A part of a turn in a conversation with the model with a fixed MIME type. It has one of the following mutually exclusive fields: 1. text 2. inline_data 3. file_data 4. functionResponse 5. functionCall Exactly one field within a Part should be set, representing the specific type of content being conveyed. Using multiple fields within the same `Part` instance is considered invalid. A datatype containing media that is part of a multi-part Content message. A Part consists of data which has an associated datatype. A Part can only contain one of the accepted types in Part.data. A Part 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. The text content of the part. Optional. The inline data content of the part. This can be used to include images, audio, or video in a request. The ETag of the item. Result of executing the ExecutableCode. Code generated by the model that is meant to be executed. URI based data. A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values. The result output of 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. Optional. Media resolution for the input media. Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. Optional. Indicates if the part is thought from the model. Optional. An opaque signature for the thought so it can be reused in subsequent requests. Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data. Partial argument value of the function call. Optional. Represents a boolean value. Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data". Optional. Represents a null value. Optional. Represents a double value. Optional. Represents a string value. Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow. Null value. Tuning spec for Partner models. Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model. Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. Optional. Immutable. The type of the grantee. Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only. Required. The role granted by this permission. The default value. This value is unused. Represents a user. When set, you must provide email_address for the user. Represents a group. When set, you must provide email_address for the group. Represents access to everyone. No extra information is required. The default value. This value is unused. Owner can use, update, share and delete the resource. Writer can use, update and share the resource. Reader can use the resource. The default behavior is unspecified. The model will decide whether to generate images of people. Allows the model to generate images of people, including adults and children. Allows the model to generate images of adults, but not children. Prevents the model from generating images of people. Specifies your Pinecone instance. This is the name used to create the Pinecone index that's used with the RAG corpus. Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: "does Bar Foo have Wifi" or "is Foo Bar wheelchair accessible?"). Currently we only support review snippets as sources. Snippets of reviews that are used to generate answers about the features of a given place in Google Maps. Spec for pointwise metric result. Output only. Spec for custom output. Output only. Explanation for pointwise metric score. Output only. Pointwise metric score. Spec for pointwise metric. Optional. CustomOutputFormatConfig allows customization of metric output. By default, metrics return a score and explanation. When this config is set, the default output is replaced with either: - The raw output string. - A parsed output based on a user-defined schema. If a custom format is chosen, the score and explanation fields in the corresponding metric result will be empty. Required. Metric prompt template for pointwise metric. Optional. System instructions for pointwise metric. Represents a network port in a container. The number of the port to expose on the pod's IP address. Must be a valid port number, between 1 and 65535 inclusive. Configuration for a prebuilt voice. The configuration for the prebuilt speaker to use. The name of the preset voice to use. The spec for a pre-defined metric. Required. The name of a pre-defined metric, such as "instruction_following_v1" or "text_quality_v1". Optional. The parameters needed to run the pre-defined metric. Request message for PredictionService.PredictLongRunning. Request message for [PredictionService.PredictLongRunning]. Required. The instances that are the input to the prediction call. Optional. The parameters that govern the prediction call. Request message for PredictionService.Predict. Request message for PredictionService.Predict. Optional. The user labels for Imagen billing usage only. Only Imagen supports labels. For other use cases, it will be ignored. Required. The instances that are the input to the prediction call. Optional. The parameters that govern the prediction call. Response message for PredictionService.Predict. Response message for [PredictionService.Predict]. ID of the Endpoint's DeployedModel that served this prediction. Output only. Request-level metadata returned by the model. The metadata type will be dependent upon the model implementation. Output only. The resource name of the Model which is deployed as the DeployedModel that this prediction hits. Output only. The display name of the Model which is deployed as the DeployedModel that this prediction hits. Output only. The version ID of the Model which is deployed as the DeployedModel that this prediction hits. The outputs of the prediction call. Contains the schemata used in Model's predictions and explanations via PredictionService.Predict, PredictionService.Explain and BatchPredictionJob. Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single instance, which are used in PredictRequest.instances, ExplainRequest.instances and BatchPredictionJob.input_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access. Immutable. Points to a YAML file stored on Google Cloud Storage describing the parameters of prediction and explanation via PredictRequest.parameters, ExplainRequest.parameters and BatchPredictionJob.model_parameters. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI, if no parameters are supported, then it is set to an empty string. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access. Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single prediction produced by this Model, which are returned via PredictResponse.predictions, ExplainResponse.explanations, and BatchPredictionJob.output_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access. Statistics computed for datasets used for preference optimization. Output only. A partial sample of the indices (starting from 1) of the dropped examples. Output only. For each index in dropped_example_indices, the user-facing reason why the example was dropped. Output only. Dataset distributions for scores variance per example. Output only. Dataset distributions for scores. Output only. Number of billable tokens in the tuning dataset. Output only. Number of examples in the tuning dataset. Output only. Number of tuning steps for this Tuning Job. Output only. Sample user examples in the training dataset. Output only. Dataset distributions for the user input tokens. Output only. Dataset distributions for the user output tokens. Hyperparameters for Preference Optimization. Optional. Adapter size for preference optimization. Optional. Weight for KL Divergence regularization. Optional. Number of complete passes the model makes over the entire training dataset during training. Optional. Multiplier for adjusting the default learning rate. Tuning Spec for Preference Optimization. Optional. If set to true, disable intermediate checkpoints for Preference Optimization and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for Preference Optimization. Default is false. Optional. Hyperparameters for Preference Optimization. Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file. Optional. Cloud Storage path to file containing validation dataset for preference optimization tuning. The dataset must be formatted as a JSONL file. Preset configuration for example-based explanations The modality of the uploaded model, which automatically configures the distance measurement and feature normalization for the underlying example index and queries. If your model does not precisely fit one of these types, it is okay to choose the closest type. Preset option controlling parameters for speed-precision trade-off when querying for examples. If omitted, defaults to PRECISE. Should not be set. Added as a recommended best practice for enums IMAGE modality TEXT modality TABULAR modality More precise neighbors as a trade-off against slower response. Faster response as a trade-off against less precise neighbors. A pre-tuned model for continuous tuning. Output only. The name of the base model this PreTunedModel was tuned from. Optional. The source checkpoint id. If not specified, the default checkpoint will be used. The resource name of the Model. E.g., a model resource name with a specified version id or alias: projects/{project}/locations/{location}/models/{model}@{version_id} projects/{project}/locations/{location}/models/{model}@{alias} Or, omit the version id to use the default version: projects/{project}/locations/{location}/models/{model} Config for proactivity features. Optional. If enabled, the model can reject responding to the last prompt. For example, this allows the model to ignore out of context speech or to stay silent if the user did not make a request, yet. Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. ExecAction probes the health of a container by executing a command. Number of consecutive failures before the probe is considered failed. Defaults to 3. Minimum value is 1. Maps to Kubernetes probe argument 'failureThreshold'. GrpcAction probes the health of a container by sending a gRPC request. HttpGetAction probes the health of a container by sending an HTTP GET request. Number of seconds to wait before starting the probe. Defaults to 0. Minimum value is 0. Maps to Kubernetes probe argument 'initialDelaySeconds'. How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Must be less than timeout_seconds. Maps to Kubernetes probe argument 'periodSeconds'. Number of consecutive successes before the probe is considered successful. Defaults to 1. Minimum value is 1. Maps to Kubernetes probe argument 'successThreshold'. TcpSocketAction probes the health of a container by opening a TCP socket connection. Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Must be greater or equal to period_seconds. Maps to Kubernetes probe argument 'timeoutSeconds'. ExecAction specifies a command to execute. Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. GrpcAction checks the health of a container using a gRPC service. Port number of the gRPC service. Number must be in the range 1 to 65535. Service is the name of the service to place in the gRPC HealthCheckRequest. See https://github.com/grpc/grpc/blob/master/doc/health-checking.md. If this is not specified, the default behavior is defined by gRPC. HttpGetAction describes an action based on HTTP Get requests. Host name to connect to, defaults to the model serving container's IP. You probably want to set "Host" in httpHeaders instead. Custom headers to set in the request. HTTP allows repeated headers. Path to access on the HTTP server. Number of the port to access on the container. Number must be in the range 1 to 65535. Scheme to use for connecting to the host. Defaults to HTTP. Acceptable values are "HTTP" or "HTTPS". HttpHeader describes a custom header to be used in HTTP probes The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header. The header field value TcpSocketAction probes the health of a container by opening a TCP socket connection. Optional: Host name to connect to, defaults to the model serving container's IP. Number of the port to access on the container. Number must be in the range 1 to 65535. An image of the product. A set of the feedback metadata the prompt specified in . A set of the feedback metadata the prompt specified in GenerateContentRequest.content. Output only. A readable block reason message. Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt. Ratings for safety of the prompt. There is at most one rating per category. Request for querying a . Required. Query string to perform semantic search. Optional. The maximum number of s to return. The service may return fewer s. If unspecified, at most 10 s will be returned. The maximum specified result count is 100. Response from containing a list of relevant chunks. The relevant chunks. Request for querying a . Required. Query string to perform semantic search. Optional. The maximum number of s to return. The service may return fewer s. If unspecified, at most 10 s will be returned. The maximum specified result count is 100. Response from containing a list of relevant chunks. The returned relevant chunks. A RagChunk includes the content of a chunk of a RagFile, and associated metadata. If populated, represents where the chunk starts and ends in the document. The content of the chunk. Represents where the chunk starts and ends in the document. Page where chunk starts in the document. Inclusive. 1-indexed. Page where chunk ends in the document. Inclusive. 1-indexed. A RagCorpus is a RagFile container and a project can have multiple RagCorpora. Output only. RagCorpus state. Optional. The corpus type config of the RagCorpus. Output only. Timestamp when this RagCorpus was created. Optional. The description of the RagCorpus. Required. The display name of the RagCorpus. The name can be up to 128 characters long and can consist of any UTF-8 characters. Optional. Immutable. The CMEK key name used to encrypt at-rest data related to this Corpus. Only applicable to RagManagedDb option for Vector DB. This field can only be set at corpus creation time, and cannot be updated or deleted. Output only. The resource name of the RagCorpus. Optional. Immutable. The embedding model config of the RagCorpus. Output only. Number of RagFiles in the RagCorpus. NOTE: This field is not populated in the response of VertexRagDataService.ListRagCorpora. Optional. Immutable. The Vector DB config of the RagCorpus. Output only. Reserved for future use. Output only. Reserved for future use. Output only. Timestamp when this RagCorpus was last updated. Optional. Immutable. The config for the Vector DBs. Optional. Immutable. The config for the Vertex AI Search. The config for the corpus type of the RagCorpus. Optional. Config for the document corpus. Optional. Config for the memory corpus. Config for the document corpus. Config for the memory corpus. The LLM parser to use for the memory corpus. Config for the embedding model to use for RAG. Configuration for hybrid search. The Vertex AI Prediction Endpoint that either refers to a publisher model or an endpoint that is hosting a 1P fine-tuned text embedding model. Endpoints hosting non-1P fine-tuned text embedding models are currently not supported. This is used for dense vector search. Config for hybrid search. Required. The Vertex AI Prediction Endpoint that hosts the embedding model for dense embedding generations. Optional. The configuration for sparse embedding generation. This field is optional the default behavior depends on the vector database choice on the RagCorpus. Configuration for sparse emebdding generation. Use BM25 scoring algorithm. Message for BM25 parameters. Optional. The parameter to control document length normalization. It determines how much the document length affects the final score. b is in the range of [0, 1]. The default value is 0.75. Optional. The parameter to control term frequency saturation. It determines the scaling between the matching term frequency and final score. k1 is in the range of [1.2, 3]. The default value is 1.2. Optional. Use multilingual tokenizer if set to true. Config representing a model hosted on Vertex Prediction Endpoint. Required. The endpoint resource name. Format: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} or projects/{project}/locations/{location}/endpoints/{endpoint} Output only. The resource name of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model. Pattern: projects/{project}/locations/{location}/models/{model} Output only. Version ID of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model. A RagFile contains user data for chunking, embedding and indexing. Output only. Timestamp when this RagFile was created. Optional. The description of the RagFile. Output only. The RagFile is encapsulated and uploaded in the UploadRagFile request. Required. The display name of the RagFile. The name can be up to 128 characters long and can consist of any UTF-8 characters. Output only. State of the RagFile. Output only. Google Cloud Storage location of the RagFile. It does not support wildcards in the Cloud Storage uri for now. Output only. Google Drive location. Supports importing individual files as well as Google Drive folders. The RagFile is imported from a Jira query. Output only. The resource name of the RagFile. Output only. The type of the RagFile. The RagFile is imported from a SharePoint source. Output only. The size of the RagFile in bytes. The RagFile is imported from a Slack channel. Output only. Timestamp when this RagFile was last updated. Output only. The metadata for metadata search. The user_metadata Needs to be in JSON format. RagFile type is unspecified. RagFile type is TXT. RagFile type is PDF. Specifies the LLM parsing for RagFiles. The prompt to use for parsing. If not specified, a default prompt will be used. The maximum number of requests the job is allowed to make to the LLM model per minute in this project. Consult https://cloud.google.com/vertex-ai/generative-ai/docs/quotas and your document size to set an appropriate value here. If this value is not specified, max_parsing_requests_per_min will be used by indexing pipeline job as the global limit. The maximum number of requests the job is allowed to make to the LLM model per minute. Consult https://cloud.google.com/vertex-ai/generative-ai/docs/quotas and your document size to set an appropriate value here. If unspecified, a default value of 5000 QPM would be used. The name of a LLM model used for parsing. Format: * projects/{project_id}/locations/{location}/publishers/{publisher}/models/{model} A query to retrieve relevant contexts. Optional. The retrieval config for the query. Optional. Configurations for hybrid search results ranking. Optional. The number of contexts to retrieve. Optional. The query in text format to get relevant contexts. Configurations for hybrid search results ranking. Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally. The definition of the Rag resource. Optional. RagCorpora resource name. Format: projects/{project}/locations/{location}/ragCorpora/{ragCorpus} Optional. ragFileId. The files should be in the same ragCorpus set in ragCorpus field. Specifies the context retrieval config. Optional. Config for filters. Optional. Config for Hybrid Search. Optional. Config for ranking and reranking. Optional. The number of contexts to retrieve. Config for filters. Optional. String for metadata filtering. Optional. Only returns contexts with vector distance smaller than the threshold. Optional. Only returns contexts with vector similarity larger than the threshold. Config for Hybrid Search. Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally. Config for ranking and reranking. Optional. Config for LlmRanker. Optional. Config for Rank Service. Config for LlmRanker. Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). Config for Rank Service. Optional. The model name of the rank service. Format: semantic-ranker-512@latest Response from `ListRagStores` containing a paginated list of `RagStores`. The results are sorted by ascending `rag_store.create_time`. The returned rag_stores. A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages. A `RagStore` is a collection of `Document`s. Output only. Immutable. Identifier. The `RagStore` resource name. It is an ID (name excluding the "ragStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `ragStores/my-awesome-rag-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated. Optional. The human-readable display name for the `RagStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" Output only. The number of documents in the Ragstore that are active and ready for retrieval. Output only. The number of documents in the Ragstore that have failed processing. Output only. The number of documents in the Ragstore that are being processed. Output only. The size in bytes of the Ragstore. This is the total size of all the documents in the Ragstore. Output only. The Timestamp of when the `RagStore` was created. Output only. The Timestamp of when the `RagStore` was last updated. Config for the Vector DB to use for RAG. Authentication config for the chosen Vector DB. The config for the Pinecone. Optional. Immutable. The embedding model config of the Vector DB. The config for the RAG-managed Vector DB. The config for the RAG-managed Vertex Vector Search 2.0. The config for the Vertex Feature Store. The config for the Vertex Vector Search. The config for the Weaviate. The config for the Pinecone. Pinecone index name. This value cannot be changed after it's set. The config for the default RAG-managed Vector DB. Performs an ANN search on RagCorpus. Use this if you have a lot of files (> 10K) in your RagCorpus and want to reduce the search latency. Performs a KNN search on RagCorpus. Default choice if not specified. Config for ANN search. RagManagedDb uses a tree-based structure to partition data and facilitate faster searches. As a tradeoff, it requires longer indexing time and manual triggering of index rebuild via the ImportRagFiles and UpdateRagCorpus API. Number of leaf nodes in the tree-based structure. Each leaf node contains groups of closely related vectors along with their corresponding centroid. Recommended value is 10 * sqrt(num of RagFiles in your RagCorpus). Default value is 500. The depth of the tree-based structure. Only depth values of 2 and 3 are supported. Recommended value is 2 if you have if you have O(10K) files in the RagCorpus and set this to 3 if more than that. Default value is 2. Config for KNN search. The config for the RAG-managed Vertex Vector Search 2.0. Output only. The resource name of the Vector Search 2.0 Collection that RAG Created for the corpus. Only populated after the corpus is successfully created. Format: projects/{project}/locations/{location}/collections/{collection_id} The config for the Vertex Feature Store. The resource name of the FeatureView. Format: projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view} The config for the Vertex Vector Search. The resource name of the Index. Format: projects/{project}/locations/{location}/indexes/{index} The resource name of the Index Endpoint. Format: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint} The config for the Weaviate. The corresponding collection this corpus maps to. This value cannot be changed after it's set. Weaviate DB instance HTTP endpoint. e.g. 34.56.78.90:8080 Vertex RAG only supports HTTP connection to Weaviate. This value cannot be changed after it's set. Raw output. Output only. Raw output string. Configures the realtime input behavior in BidiGenerateContent. Optional. Defines what effect activity has. Optional. If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals. Optional. Defines which input is included in the user's turn. If unspecified, the default behavior is `START_OF_ACTIVITY_INTERRUPTS`. If true, start of activity will interrupt the model's response (also called "barge in"). The model's current response will be cut-off in the moment of the interruption. This is the default behavior. The model's response will not be interrupted. If unspecified, the default behavior is `TURN_INCLUDES_ONLY_ACTIVITY`. The users turn only includes activity since the last turn, excluding inactivity (e.g. silence on the audio stream). This is the default behavior. The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream). Configuration for recontextualizing an image. The number of sampling steps. A higher value has better image quality, while a lower value has better latency. Request for recontextualizing an image. ID of the model to use. For a list of models, see Google models (https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models). A set of source input(s) for image recontextualization. Configuration for image recontextualization. The output images response. List of generated images. A set of source input(s) for image recontextualization. A text prompt for guiding the model during image recontextualization. Not supported for Virtual Try-On. Image of the person or subject who will be wearing the product(s). A list of product images. Abstract class that represents a Reference image that is sent to API. Required. The reference image for the editing operation. Required. The id of the reference image. Required. The type of the reference image. Only set by the SDK." Configuration for the mask reference image. Configuration for the control reference image. Configuration for the style reference image. Configuration for the subject reference image. Describes what the field reference contains. Reference contains a GFS path or a local path. Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated. Data is included into this proto buffer. Data should be accessed from the current service using the operation GetMedia. The content for this media object is stored across multiple partial media objects under the composite_media field. Reference points to a bigstore object. Indicates the data is stored in diff_version_response. Indicates the data is stored in diff_checksums_response. Indicates the data is stored in diff_download_response. Indicates the data is stored in diff_upload_request. Indicates the data is stored in diff_upload_response. Indicates the data is stored in cosmo_binary_reference. Informs Scotty to generate a response payload with the size specified in the length field. The contents of the payload are generated by Scotty and are undefined. This is useful for testing download speeds between the user and Scotty without involving a real payload source. Note: range is not supported when using arbitrary_bytes. Request for RegisterFiles. Required. The Google Cloud Storage URIs to register. Example: gs://bucket/object. Response for RegisterFiles. The registered files to be used when calling GenerateContent. The information for a chunk relevant to a query. associated with the query. relevance to the query. associated with the chunk. The configuration for the replicated voice to use. Optional. The mimetype of the voice sample. The only currently supported value is audio/wav. This represents 16-bit signed little-endian wav data, with a 24kHz sampling rate. mime_type will default to audio/wav if not set. Optional. The sample of the custom voice. Provides options for individual API requests. Gets or sets the options for this request. Gets or sets the timeout for this specific request. If set to a positive value, the request will be cancelled if it exceeds this duration. This is achieved by linking a CancellationToken to the request. A value of TimeSpan.Zero (the default) or a negative value means no per-request timeout will be applied beyond any default client timeout. The base URL to use for the request. If not set, the default base URL for the model will be used. Gets or sets the version of the API. Gets or sets the proxy to use for the request. Gets or sets the headers to use for the request. Initializes a new instance of the class Initializes a new instance of the class Optional. Refer to [retry docs](https://googleapis.dev/python/google-api-core/latest/retry.html) for details. Optional. In seconds (or provide a [TimeToDeadlineTimeout](https://googleapis.dev/python/google-api-core/latest/timeout.html) object). Optional. The base URL to use for the request. Optional. The version of the API. Optional. Proxy settings to use for the request. Initializes a new instance of the class Defines the retry strategy for a request. The initial delay before the first retry, in seconds. The multiplier for the delay between retries. The maximum number of retries. The overall timeout for the retry logic. The HTTP status codes that should trigger a retry. Defines the format of the response. Required. Type of the response. Can be either: - \"text\": Format the response as text. - \"json_object\": Format the response as a JSON object. - \"json_schema\": Format the response as a JSON object following the given schema. Optional. The JSON schema to follow. Only used if type is \"json_schema\". Schema for the response. Required. Name of the object type represented by the schema. Optional. Description of the object represented by the schema. Optional. Whether the schema validation is strict. If true, the model will fail if the schema is not valid. NOTE: This parameter is currently ignored. Optional. The JSON schema to follow. Default value. Default value. Indicates the model should return text. Indicates the model should return images. Indicates the model should return audio. Defines a retrieval tool that model can call to access external knowledge. Defines a retrieval tool that model can call to access external knowledge. Optional. Deprecated. This option is no longer supported. Use data source powered by external API for grounding. Set to use data source powered by Vertex AI Search. Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService. Retrieval config. Retrieval config. Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Optional. The location of the user. Metadata related to the retrieval grounding source. This is part of the GroundingMetadata returned when grounding is enabled. Metadata related to retrieval in the grounding flow. Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search. The semantic retrieval resource to retrieve from. Required. The name of the semantic retrieval resource to retrieve from. Example: `ragStores/my-rag-store-123` Chunk from context retrieved by the file search tool. Optional. Name of the FileSearchStore containing the document. Example: fileSearchStores/123 Optional. Text of the chunk. Optional. Title of the document. Optional. URI reference of the semantic retrieval document. Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps. Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps. The ID of the review snippet. A link that corresponds to the user review on Google Maps. A link that corresponds to the user review on Google Maps. The ID of the review snippet. Title of the review. Rouge metric value for an instance. Output only. Rouge score. Spec for rouge score metric - calculates the recall of n-grams in prediction as compared to reference - returns a score ranging between 0 and 1. Optional. Supported rouge types are rougen[1-9], rougeL, and rougeLsum. Optional. Whether to split summaries while using rougeLsum. Optional. Whether to use stemmer to compute rouge score. 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. In this mode, the model is selected automatically based on the content of the request. In this mode, the model is specified manually. Specification for how rubrics should be generated. Configuration for the model used in rubric generation. Configs including sampling count and base model can be specified here. Flipping is not supported for rubric generation. Template for the prompt used to generate rubrics. The details should be updated based on the most-recent recipe requirements. The type of rubric content to be generated. Optional. An optional, pre-defined list of allowed types for generated rubrics. If this field is provided, it implies include_rubric_type should be true, and the generated rubric types should be chosen from this ontology. The content type to generate is not specified. Generate rubrics based on properties. Generate rubrics in an NL question answer format. Generate rubrics in a unit test format. Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result. Safety rating evaluated from content. Safety settings applied to the request. Enum that controls the safety filter level for objectionable content. Content with NEGLIGIBLE will be allowed. Content with NEGLIGIBLE and LOW will be allowed. Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. All content will be allowed. A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level. A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level. Ref: https://ai.google.dev/api/rest/v1beta/SafetyRating Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here. Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. Output only. The probability score of harm for this category. Output only. The severity of harm for this category. Output only. The severity score of harm for this category. The harm block threshold is unspecified. Block content with a low harm probability or higher. Block content with a medium harm probability or higher. Block content with a high harm probability. Do not block any content, regardless of its harm probability. Turn off the safety filter entirely. Was this content blocked because of this rating? Required. The category for this rating. Required. The probability of harm for this content. A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category. A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category. Represents a safety setting that can be used to control the model's behavior. It instructs the model to avoid certain responses given safety measurements based on category. Ref: https://ai.google.dev/api/rest/v1beta/SafetySetting Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked. Optional. The method for blocking content. If not specified, the default behavior is to use the probability score. Required. The category for this setting. Required. Controls the probability threshold at which harm is blocked. An attribution method that approximates Shapley values for features that contribute to the label being predicted. A sampling strategy is used to approximate the value rather than considering all subsets of features. Required. The number of feature permutations to consider when approximating the Shapley values. Valid range of its value is [1, 50], inclusively. A SavedQuery is a view of the dataset. It references a subset of annotations by problem type and filters. Output only. Filters on the Annotations in the dataset. Output only. Number of AnnotationSpecs in the context of the SavedQuery. Output only. Timestamp when this SavedQuery was created. Required. The user-defined name of the SavedQuery. The name can be up to 128 characters long and can consist of any UTF-8 characters. Used to perform a consistent read-modify-write update. If not set, a blind "overwrite" update happens. Some additional information about the SavedQuery. Output only. Resource name of the SavedQuery. Required. Problem type of the SavedQuery. Allowed values: * IMAGE_CLASSIFICATION_SINGLE_LABEL * IMAGE_CLASSIFICATION_MULTI_LABEL * IMAGE_BOUNDING_POLY * IMAGE_BOUNDING_BOX * TEXT_CLASSIFICATION_SINGLE_LABEL * TEXT_CLASSIFICATION_MULTI_LABEL * TEXT_EXTRACTION * TEXT_SENTIMENT * VIDEO_CLASSIFICATION * VIDEO_OBJECT_TRACKING Output only. If the Annotations belonging to the SavedQuery can be used for AutoML training. Output only. Timestamp when SavedQuery was last updated. All parameters related to queuing and scheduling of custom jobs. Optional. Indicates if the job should retry for internal errors after the job starts running. If true, overrides Scheduling.restart_job_on_worker_restart to false. Optional. This is the maximum duration that a job will wait for the requested resources to be provisioned if the scheduling strategy is set to [Strategy.DWS_FLEX_START]. If set to 0, the job will wait indefinitely. The default is 24 hours. Optional. Restarts the entire CustomJob if a worker gets restarted. This feature can be used by distributed training jobs that are not resilient to workers leaving and joining a job. Optional. This determines which type of scheduling strategy to use. Optional. The maximum job running time. The default is 7 days. Strategy will default to STANDARD. Deprecated. Regular on-demand provisioning strategy. Deprecated. Low cost by making potential use of spot resources. Standard provisioning strategy uses regular on-demand resources. Spot provisioning strategy uses spot resources. Flex Start strategy uses DWS to queue for resources. Specifies how the response should be scheduled in the conversation. This value is unused. Only add the result to the conversation context, do not interrupt or trigger generation. Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation. Add the result to the conversation context, interrupt ongoing generation and prompt to generate output. Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object). The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). Optional. If type is OBJECT, specifies how to handle properties not defined in properties. If it is a boolean false, no additional properties are allowed. If it is a schema, additional properties are allowed if they conform to the schema. Optional. defs provides a map of schema definitions that can be reused by ref elsewhere in the schema. Only allowed at root level of the schema. Optional. Allows referencing another schema definition to use in place of this schema. The value must be a valid reference to a schema in defs. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring Converts a JsonElement representing a JSON Schema to a Schema object. The JsonElement containing the JSON Schema A Schema object representing the JSON Schema Creates a Schema from a string. Supports either: - A JSON object string representing a JSON Schema, or - A simple OpenAPI type name (string, number, integer, boolean, array, object, null). If the string is a JSON string containing a nested JSON object, it will be parsed recursively. JSON schema text or a simple type name Thrown when value is null Thrown when value is whitespace-only or cannot be parsed into a Schema Builds a Schema from a .NET object using Json.Schema generation, then maps it into the internal Schema model. Builds a Schema from a .NET type using Json.Schema generation, then maps it into the internal Schema model. Any type. Builds a Schema from a .NET type using Json.Schema generation, then maps it into the internal Schema model. The file name of the assembly's XML comment file. Any type in the assembly. Builds a Schema from a .NET type using Json.Schema generation, then maps it into the internal Schema model. The type to generate. Builds a Schema from a .NET type using Json.Schema generation, then maps it into the internal Schema model. The type to generate. The to use. Builds a parameters from a delegate's signature. Skips framework parameters such as that should not be exposed to the model. The delegate whose parameters will be used to construct the schema. A representing the parameters of the delegate as an object with named properties, or null if there are no user-exposed parameters. Builds a response from a delegate's return type. Returns null for void, Task, or ValueTask without a result. The delegate whose return type will be used to generate the schema. A representing the return type of the delegate, or null if the return type is void, Task, or ValueTask without a result. Optional. The value should be validated against any (one or more) of the subschemas in the list. Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a default field don't get unknown-field errors. Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown. Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} Optional. Example of the object. Will only populated when the object is the root. Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality. Optional. Schema of the elements of Type.ARRAY. Optional. Maximum number of the elements for Type.ARRAY. Optional. Maximum length of the Type.STRING Optional. Maximum number of the properties for Type.OBJECT. Optional. Maximum value of the Type.INTEGER and Type.NUMBER Optional. Minimum number of the elements for Type.ARRAY. Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING Optional. Minimum number of the properties for Type.OBJECT. Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER Optional. Indicates if the value may be null. Optional. Pattern of the Type.STRING to restrict a string to a regular expression. Optional. Properties of Type.OBJECT. Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response. Optional. Required properties of Type.OBJECT. Optional. The title of the schema. Required. Data type. Response for list models. Output only. A list of the requested embeddings. Output only. Always "list", required by the SDK. An entry point for displaying Google Search results. A SearchEntryPoint is populated when the grounding source for a model's response is Google Search. It provides information that you can use to display the search results in your application. Google search entry point. Optional. Web content snippet that can be embedded in a web page or an app webview. Optional. Base64 encoded JSON representing array of tuple. Different types of search that can be enabled on the GoogleSearch tool. Optional. Setting this field enables image search. Image bytes are returned. Optional. Setting this field enables web search. Only text results are returned. A segment of the content. Segment of the content. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero. The index of a Part object within its parent Content object. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. The text corresponding to the segment from the response. Identifier for a Chunk retrieved via Semantic Retriever specified in the GenerateAnswerRequest using SemanticRetrieverConfig. Output only. Name of the Chunk containing the attributed text. Example: corpora/123/documents/abc/chunks/xyz Output only. Name of the source matching the request's SemanticRetrieverConfig.source. Example: corpora/123 or corpora/123/documents/abc Configuration for retrieving grounding content from a Corpus or Document created using the Semantic Retriever API. Optional. Maximum number of relevant Chunks to retrieve. Optional. Filters for selecting Documents and/or Chunks from the resource. Optional. Minimum relevance score for retrieved relevant Chunks. Required. Query to use for matching Chunks in the given resource by similarity. Required. Name of the resource for retrieval. Example: corpora/123 or corpora/123/documents/abc. Session resumption configuration. This message is included in the session configuration as BidiGenerateContentSetup.session_resumption. If configured, the server will send SessionResumptionUpdate messages. The handle of a previous session. If not present then a new session is created. Session handles come from SessionResumptionUpdate.token values in previous connections. The SharePointSources to pass to ImportRagFiles. The SharePoint sources. An individual SharePointSource. The Application ID for the app registered in Microsoft Azure Portal. The application must also be configured with MS Graph permissions "Files.ReadAll", "Sites.ReadAll" and BrowserSiteLists.Read.All. The application secret for the app registered in Azure. The ID of the drive to download from. The name of the drive to download from. Output only. The SharePoint file id. Output only. The ID of the SharePoint folder to download from. The path of the SharePoint folder to download from. The name of the SharePoint site to download from. This can be the site name or the site id. Unique identifier of the Azure Active Directory Instance. The Slack source for the ImportRagFilesRequest. Required. The Slack channels. SlackChannels contains the Slack channels and corresponding access token. Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Slack channel access token that has access to the slack channel IDs. See: https://api.slack.com/tutorials/tracks/getting-a-token. Required. The Slack channel IDs. SlackChannel contains the Slack channel ID and the time range to import. Required. The Slack channel ID. Optional. The ending timestamp for messages to import. Optional. The starting timestamp for messages to import. The SlidingWindow method operates by discarding content at the beginning of the context window. The resulting context will always begin at the start of a USER role turn. System instructions and any BidiGenerateContentSetup.prefix_turns will always remain at the beginning of the result. The target number of tokens to keep. The default value is trigger_tokens/2. Discarding parts of the context window causes a temporary latency increase so this value should be calibrated to avoid frequent compression operations. Config for SmoothGrad approximation of gradients. When enabled, the gradients are approximated by averaging the gradients from noisy samples in the vicinity of the inputs. Adding noise can help improve the computed gradients. Refer to this paper for more details: https://arxiv.org/pdf/1706.03825.pdf This is similar to noise_sigma, but provides additional flexibility. A separate noise sigma can be provided for each feature, which is useful if their distributions are different. No noise is added to features that are not set. If this field is unset, noise_sigma will be used for all features. This is a single float value and will be used to add noise to all the features. Use this field when all features are normalized to have the same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where features are normalized to have 0-mean and 1-variance. Learn more about [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization). For best results the recommended value is about 10% - 20% of the standard deviation of the input feature. Refer to section 3.2 of the SmoothGrad paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1. If the distribution is different per feature, set feature_noise_sigma instead for each feature. The number of gradient samples to use for approximation. The higher this number, the more accurate the gradient is, but the runtime complexity increases by this factor as well. Valid range of its value is [1, 50]. Defaults to 3. Used if source is not specified. Indicates the file is uploaded by the user. Indicates the file is generated by Google. Indicates the file is a registered, i.e. a Google Cloud Storage file. Configuration for a single speaker in a multi-speaker setup. The configuration for a single speaker in a multi speaker setup. Required. The name of the speaker to use. Should be the same as in the prompt. Required. The configuration for the voice to use. Configuration for speech generation. Config for speech generation and transcription. Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: de-DE, en-AU, en-GB, en-IN, en-US, es-US, fr-FR, hi-IN, pt-BR, ar-XA, es-ES, fr-CA, id-ID, it-IT, ja-JP, tr-TR, vi-VN, bn-IN, gu-IN, kn-IN, ml-IN, mr-IN, ta-IN, te-IN, nl-NL, ko-KR, cmn-CN, pl-PL, ru-RU, and th-TH. Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field. The configuration in case of single-voice output. The default value. This value is used if the state is omitted. Some `Chunks` of the `Document` are being processed (embedding and vector storage). All `Chunks` of the `Document` is processed and available for querying. Some `Chunks` of the `Document` failed processing. The batch state is unspecified. The service is preparing to run the batch. The batch is in progress. The batch completed successfully. The batch failed. The batch has been cancelled. The batch has expired. File is being processed and cannot be used for inference yet. File is processed and available for inference. File failed processing. Being generated. Generated and is ready for download. The model is being created. A state used by systems like Vertex AI Pipelines to indicate that the underlying data item represented by this Artifact is being created. A state indicating that the Artifact should exist, unless something external to the system deletes it. The job state is unspecified. The job has been just created or resumed and processing has not yet begun. The service is preparing to run the job. The job is in progress. The job completed successfully. The job failed. The job is being cancelled. From this state the job may only go to either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. The job has been cancelled. The job has been stopped, and can be resumed. The job has expired. The job is being updated. Only jobs in the `RUNNING` state can be updated. After updating, the job goes back to the `RUNNING` state. The job is partially succeeded, some results may be missing due to errors. This state is not supposed to happen. RagCorpus resource entry is initialized, but hasn't done validation. RagCorpus is in a problematic situation. See `error_message` field for details. The evaluation run is running. The evaluation run has succeeded. The evaluation run has been cancelled. The evaluation run is performing inference. The evaluation run is performing rubric generation. The Execution is new The Execution has finished running The Execution completed through Cache hit. State when the featureOnlineStore configuration is not being updated and the fields reflect the current configuration of the featureOnlineStore. The featureOnlineStore is usable in this state. The state of the featureOnlineStore configuration when it is being updated. During an update, the fields reflect either the original configuration or the updated configuration of the featureOnlineStore. The featureOnlineStore is still usable in this state. The default behavior of whether to enable the monitoring. EntityType-level config: disabled. Feature-level config: inherited from the configuration of EntityType this Feature belongs to. Explicitly enables import features analysis. EntityType-level config: by default enables import features analysis for all Features under it. Feature-level config: enables import features analysis regardless of the EntityType-level config. Explicitly disables import features analysis. EntityType-level config: by default disables import features analysis for all Features under it. Feature-level config: disables import features analysis regardless of the EntityType-level config. Indicates that a specific NasTrial has been requested, but it has not yet been suggested by the service. Indicates that the NasTrial should stop according to the service. Indicates that the NasTrial should not be attempted again. The service will set a NasTrial to INFEASIBLE when it's done but missing the final_measurement. Should not be used. The PSC service automation is successful. The PSC service automation has failed. The PROVISIONING state indicates the persistent resources is being created. The REBOOTING state indicates the persistent resource is being rebooted (PR is not available right now but is expected to be ready again later). The pipeline state is unspecified. The pipeline has been created or resumed, and processing has not yet begun. The service is preparing to run the pipeline. The pipeline is in progress. The pipeline completed successfully. The pipeline failed. The pipeline is being cancelled. From this state, the pipeline may only go to either PIPELINE_STATE_SUCCEEDED, PIPELINE_STATE_FAILED or PIPELINE_STATE_CANCELLED. The pipeline has been cancelled. The pipeline has been stopped, and can be resumed. Specifies Task cancel is in pending state. Specifies task is being cancelled. Specifies task was skipped due to cache hit. Specifies that the task was not triggered because the task's trigger policy is not satisfied. The trigger policy is specified in the `condition` field of PipelineJob.pipeline_spec. Runtime resources are being allocated for the sandbox environment. Sandbox runtime is ready for serving. Sandbox runtime is halted, performing tear down tasks. Sandbox has terminated with underlying runtime failure. Sandbox runtime has been deleted. The schedule is paused. No new runs will be created until the schedule is resumed. Already started runs will be allowed to complete. The Schedule is completed. No new runs will be scheduled. Already started runs will be allowed to complete. Schedules in completed state cannot be paused or resumed. The study is stopped due to an internal error. The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). The type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). The status code, which should be an enum value of google.rpc.Code. A list of messages that carry the error details. There is a common set of message types for APIs to use. A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. A ContentsExample to be used with GenerateContent alongside information required for storage and retrieval with Example Store. Required. The example to be used with GenerateContent. Optional. (Optional) the search key used for retrieval. If not provided at upload-time, the search key will be generated from contents_example.contents using the method provided by search_key_generation_method. The generated search key will be included in retrieved examples. Optional. The method used to generate the search key from contents_example.contents. This is ignored when uploading an example if search_key is provided. Options for generating the search key from the conversation history. Use only the last entry of the conversation history (contents_example.contents) as the search key. Configuration for using only the last entry of the conversation history as the search key. A transport that can stream HTTP requests and responses. Next ID: 6 Optional: Fields for authentication headers, timeouts, etc., if needed. Timeout for SSE read operations. Whether to close the client session when the transport closes. HTTP timeout for regular operations. The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp" Options for streaming requests. Optional. If set, include usage statistics in the response. User provided string values assigned to a single metadata key. The string values of the metadata to store. Configuration for a Style reference image. A text description of the style to use for the generated image. Configuration for a Subject reference image. The subject type of a subject reference image. Subject description for the image. Enum representing the subject type of a subject reference image. Default subject type. Person subject type. Animal subject type. Product subject type. Hyperparameters for SFT. Optional. Adapter size for tuning. Optional. Batch size for tuning. This feature is only available for open source models. Optional. Number of complete passes the model makes over the entire training dataset during training. Optional. Learning rate for tuning. Mutually exclusive with learning_rate_multiplier. This feature is only available for open source models. Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with learning_rate. This feature is only available for 1P models. Dataset distribution for Supervised Tuning. Output only. Sum of a given population of values that are billable. Output only. Defines the histogram bucket. Output only. The maximum of the population values. Output only. The arithmetic mean of the values in the population. Output only. The median of the values in the population. Output only. The minimum of the population values. Output only. The 5th percentile of the values in the population. Output only. The 95th percentile of the values in the population. Output only. Sum of a given population of values. Dataset bucket used to create a histogram for the distribution given a population of values. Output only. Number of values in the bucket. Output only. Left bound of the bucket. Output only. Right bound of the bucket. Tuning data statistics for Supervised Tuning. Output only. For each index in truncated_example_indices, the user-facing reason why the example was dropped. Output only. Number of billable characters in the tuning dataset. Output only. Number of billable tokens in the tuning dataset. Output only. The number of examples in the dataset that have been dropped. An example can be dropped for reasons including: too many tokens, contains an invalid image, contains too many images, etc. Output only. Number of tuning characters in the tuning dataset. Output only. A partial sample of the indices (starting from 1) of the dropped examples. Output only. Number of examples in the tuning dataset. Output only. Number of tuning steps for this Tuning Job. Output only. Sample user messages in the training dataset uri. Output only. Dataset distributions for the user input tokens. Output only. Dataset distributions for the messages per example. Output only. Dataset distributions for the user output tokens. Tuning Spec for Supervised Tuning for first party models. Optional. Evaluation Config for Tuning Job. Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false. Optional. Hyperparameters for SFT. Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. Tuning mode. Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. Unset value, which will default to one of the other enum values. Specifies the given text is a query in a search/retrieval setting. Specifies the given text is a document from the corpus being searched. Specifies the given text will be used for STS. Specifies that the given text will be classified. Specifies that the embeddings will be used for clustering. Specifies that the given text will be used for question answering. Specifies that the given text will be used for fact verification. Specifies that the given text will be used for code retrieval. Output text returned from a model. Output only. Citation information for model-generated output in this TextCompletion. This field may be populated with attribution information for any text included in the output. Output only. The generated text returned from the model. Ratings for the safety of a response. There is at most one rating per category. Required. The prompt text. Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion. Required. The prompt text. Config for thinking features. Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. The number of thoughts tokens that the model should generate. Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. If not specified, the default is HIGH. Recommended for Gemini 3 or later models. Use with earlier models results in an error. Unspecified thinking level. Little to no thinking. Low thinking level. Medium thinking level. High thinking level. Tokens info with a list of tokens and the corresponding list of token ids. Optional. Optional fields for the role from the corresponding Content. A list of token ids from the input. A list of tokens from the input. Tool details that the model may use to generate response. A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval). Tool details that the model may use to generate response. A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Next ID: 15 Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. Optional. If specified, Vertex AI will use Parallel.ai to search for information to answer user queries. The search results will be grounded on Parallel.ai and presented to the model for response generation Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. Optional. Enables the model to execute code as part of generation. Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations. Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora. Optional. A list of FunctionDeclarations available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn. Optional. Tool that allows grounding the model's response with geospatial context related to the user's query. Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. Optional. Retrieval tool that is powered by Google search. Optional. MCP Servers to connect to. Optional. Tool to support URL context retrieval. 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. Tool to support computer use. Required. The environment being operated. Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions. Tool config. This config is shared for all tools provided in the request. The Tool configuration containing parameters for specifying Tool use in the request. Optional. Function calling config. Optional. Retrieval config. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. Optional. Sites with confidence level chosen & above this value will be blocked from the search results. Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding. ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding. Optional. The API key for ParallelAiSearch. If an API key is not provided, the system will attempt to verify access by checking for an active Parallel.ai subscription through the Google Cloud Marketplace. See https://docs.parallel.ai/search/search-quickstart for more details. Optional. Custom configs for ParallelAiSearch. This field can be used to pass any parameter from the Parallel.ai Search API. See the Parallel.ai documentation for the full list of available parameters and their usage: https://docs.parallel.ai/api-reference/search-beta/search Currently only source_policy, excerpts, max_results, mode, fetch_policy can be set via this field. For example: { "source_policy": { "include_domains": ["google.com", "wikipedia.org"], "exclude_domains": ["example.com"] }, "fetch_policy": { "max_age_seconds": 3600 } } A list of `Tool`s that can be used by the model to improve its abilities. Initializes a new instance of the class. Initializes a new instance of the class with a list of delegates as functions. The delegates to be added as functions. Thrown when the delegates parameter is null. Adds the Google Search Retrieval tool to the list of tools. Adds the Code Execution tool to the list of tools. Adds the URL Context tool to the list of tools. Adds the Google Maps tool to the list of tools. Whether to return a token and enable the Google Maps widget (default is false). Adds the Computer Use tool to the list of tools. The environment being operated. Adds the tool to the list of tools. List of s to query. Adds a function to the list of function declarations. The name of the function. The description of the function. Adds a function to the list of function declarations. The delegate to be added as a function. Adds a function to the list of function declarations. The name of the function. The delegate to be added as a function. Adds a function to the list of function declarations. The name of the function. The description of the function. The delegate to be added as a function. Removes a function from the list of function declarations by name. The name of the function to remove. True if the function was removed, false otherwise. Removes a function from the list of function declarations by delegate. The delegate of the function to remove. True if the function was removed, false otherwise. Clears all functions from the list of function declarations. Get list of available function declarations Invokes a function by name with the provided arguments. The name of the function to invoke. The arguments to pass to the function. The result of the function invocation. Candidates with top log probabilities at each decoding step. Sorted by log probability in descending order. Unspecified request traffic type. The request was processed using Pay-As-You-Go quota. Type for Provisioned Throughput traffic. Dataset for training or validation. Optional. Inline examples. Request to transfer the ownership of the tuned model. Required. The email address of the user to whom the tuned model is being transferred to. Response from TransferOwnership. Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters. TunedModelCheckpoint for the Tuned Model of a Tuning Job. The ID of the checkpoint. The Endpoint resource name that the checkpoint is deployed to. Format: projects/{project}/locations/{location}/endpoints/{endpoint}. The epoch of the checkpoint. The step of the checkpoint. The Model Registry Model and Online Prediction Endpoint associated with this TuningJob. A fine-tuned model created using ModelService.CreateTunedModel. Output only. The checkpoints associated with this TunedModel. This field is only populated for tuning jobs that enable intermediate checkpoints. Output only. A resource name of an Endpoint. Format: projects/{project}/locations/{location}/endpoints/{endpoint}. Output only. The resource name of the TunedModel. Format: projects/{project}/locations/{location}/models/{model}@{version_id} When tuning from a base model, the version ID will be 1. For continuous tuning, if the provided tuned_model_display_name is set and different from parent model's display name, the tuned model will have a new parent model with version 1. Otherwise the version id will be incremented by 1 from the last version ID in the parent model. E.g., projects/{project}/locations/{location}/models/{model}@{last_version_id + 1} Immutable. The name of the Model to tune. Example: models/gemini-1.5-flash-001 Output only. The timestamp when this model was created. Optional. A short description of this model. Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. Output only. The tuned model name. A unique name will be generated on create. Example: tunedModels/az2mb0bpw6i If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = Sentence Translator * name = tunedModels/sentence-translator-u3b7m Optional. List of project numbers that have read access to the tuned model. Output only. The state of the tuned model. Optional. Controls the randomness of the output. Values can range over [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied, while a value closer to 0.0 will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. Optional. For Top-k sampling. Top-k sampling considers the set of top_k most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least top_p. This value specifies default to be the one used by the base model while creating the model. Optional. TunedModel to use as the starting point for training the new model. Required. The tuning task that creates the tuned model. Output only. The timestamp when this model was updated. The default value. This value is unused. The model is being created. The model is ready to be used. The model failed to be created. Tuned model as a source for training a new model. Output only. The name of the base Model this TunedModel was tuned from. Example: models/gemini-1.5-flash-001 Immutable. The name of the TunedModel to use as the starting point for training the new model. Example: tunedModels/my-tuned-model The structured datatype containing multi-part content of an example message. This is a subset of the Content proto used during model inference with limited type support. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. The structured datatype containing multi-part content of an example message. This is a subset of the Content proto used during model inference with limited type support. A Content includes a role field designating the producer of the Content and a parts field containing multi-part data that contains the content of the message turn. Ordered `Parts` that constitute a single message. Parts may have different MIME types. Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset. Ordered Parts that constitute a single message. Parts may have different MIME types. The ETag of the item. Initializes a new instance of the class. Initializes a new instance of the class. String to process. Initializes a new instance of the class. File to process. The tuning data statistic values for TuningJob. Output only. Statistics for distillation prompt dataset. These statistics do not include the responses sampled from the teacher model. Output only. Statistics for preference optimization. The SFT Tuning data stats. A single example for tuning. A single example for tuning. Required. The expected model output. Optional. Text model input. A set of tuning examples. Can be training or validation data. The examples. Example input can be for text or discuss, but all examples in a set must be of the same type. Content examples. For multiturn conversations. Represents a TuningJob that runs with Google owned models. The base model that is being tuned. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). Output only. Time when the TuningJob was created. Optional. The user-provided path to custom model weights. Set this field to tune a custom model. The path must be a Cloud Storage directory that contains the model weights in .safetensors format along with associated model metadata files. If this field is set, the base_model field must still be set to indicate which base model the custom model is derived from. This feature is only available for open source models. Optional. The description of the TuningJob. Tuning Spec for Distillation. Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key. Output only. Time when the TuningJob entered any of the following JobStates: JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED, JOB_STATE_EXPIRED. Output only. Only populated when job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED. Output only. Evaluation runs for the Tuning Job. Output only. The Experiment associated with this TuningJob. Tuning Spec for Full Fine Tuning. Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. Output only. Identifier. Resource name of a TuningJob. Format: projects/{project}/locations/{location}/tuningJobs/{tuning_job} Optional. Cloud Storage path to the directory where tuning job outputs are written to. This field is only available and required for open source models. Tuning Spec for open sourced and third party Partner models. Output only. The resource name of the PipelineJob associated with the TuningJob. Format: projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}. The pre-tuned model for continuous tuning. Tuning Spec for Preference Optimization. Output only. Reserved for future use. Output only. Reserved for future use. The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the iam.serviceAccounts.actAs permission on this service account. Output only. Time when the TuningJob for the first time entered the JOB_STATE_RUNNING state. Output only. The detailed state of the job. Tuning Spec for Supervised Fine Tuning. Output only. The tuned model resources associated with this TuningJob. Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version. Output only. The tuning data statistics associated with this TuningJob. Output only. The detail state of the tuning job (while the overall JobState is running). Output only. Time when the TuningJob was most recently updated. Tuning Spec for Veo Tuning. The job state is unspecified. The job has been just created or resumed and processing has not yet begun. The service is preparing to run the job. The job is in progress. The job completed successfully. The job failed. The job is being cancelled. From this state the job may only go to either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. The job has been cancelled. The job has been stopped, and can be resumed. The job has expired. The job is being updated. Only jobs in the `RUNNING` state can be updated. After updating, the job goes back to the `RUNNING` state. The job is partially succeeded, some results may be missing due to errors. Default tuning job state. Tuning job is waiting for job quota. Tuning job is validating the dataset. Tuning job is waiting for hardware capacity. Tuning job is running. Tuning job is doing some post processing steps. Default tuning job state. Tuning job is waiting for job quota. Tuning job is validating the dataset. Tuning job is waiting for hardware capacity. Tuning job is running. Tuning job is doing some post processing steps. Tuning mode is unspecified. Full fine-tuning mode. PEFT adapter tuning mode. A tuning example with multiturn input. Each Content represents a turn in the conversation. Optional. Developer set system instructions. Currently, text only. A datatype containing data that is part of a multi-part `TuningContent` message. This is a subset of the Part used for model inference, with limited type support. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A datatype containing data that is part of a multi-part TuningContent message. This is a subset of the Part used for model inference, with limited type support. A Part consists of data which has an associated datatype. A Part can only contain one of the accepted types in Part.data. Inline text. Record for a single tuning step. Output only. The timestamp when this metric was computed. Output only. The epoch this step was part of. Output only. The mean loss of the training examples for this step. Output only. The tuning step. Tuning tasks that create tuned models. Output only. The timestamp when tuning this model completed. Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used. Output only. Metrics collected during tuning. Output only. The timestamp when tuning this model started. Required. Input only. Immutable. The model training data. Defines which input is included in the user's turn. If unspecified, the default behavior is `TURN_INCLUDES_ONLY_ACTIVITY`. The users turn only includes activity since the last turn, excluding inactivity (e.g. silence on the audio stream). This is the default behavior. The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream). Request to update a . Required. The to update. Required. The list of fields to update. Currently, this only supports updating and . Instance to upload a local file to create a File resource. Optional. Metadata for the file to create. Information about an uploaded file via FIle API Ref: https://ai.google.dev/api/rest/v1beta/files Metadata for the created file. Request for UploadToFileSearchStore. Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters. Custom metadata to be associated with the data. Optional. Display name of the created document. Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content. Request for `UploadToRagStore`. Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters. Custom metadata to be associated with the data. Optional. Display name of the created document. Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content. Optional. When upscaling, the factor to which the image will be upscaled. If not specified, the upscale factor will be determined from the longer side of the input image and sampleImageSize. The factor to upscale the image (x2 or x4). Upscale factor 2 Upscale factor 4 Configuration for upscaling an image. The level of compression if the output_mime_type is image/jpeg. The image format that the output should be saved as. Request for image upscaling. Configuration for image upscaling. Response for the request to upscale an image. Output only. A list of the generated images. List of generated images. Tool to support URL context. Tool to support URL context retrieval. Tool to support URL context retrieval. Metadata returned when the model uses the url_context tool to get information from a user-provided URL. Metadata related to url context retrieval tool. List of url context. The metadata for a single URL retrieval. Context of the a single url retrieval. Retrieved url by the tool. Status of the url retrieval. Context of the a single url retrieval. Retrieved url by the tool. Metadata related to url context retrieval tool. List of url retrieval contexts. Default value. This value is unused. Url retrieval is successful. Url retrieval is failed due to error. Url retrieval is failed because the content is behind paywall. Url retrieval is failed because the content is unsafe. Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. 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. Metadata on the generation request's token usage. Output only. The traffic type for this request. Unspecified request traffic type. Type for Pay-As-You-Go traffic. Type for Priority Pay-As-You-Go traffic. Type for Flex traffic. Type for Provisioned Throughput traffic. Number of text characters. Number of images. Duration of video in seconds. Duration of audio in seconds. Output only. List of modalities of the cached content in the request input. Number of tokens in the cached part of the prompt (the cached content) Total number of tokens across all the generated response candidates. Output only. List of modalities that were returned in the response. Number of tokens in the prompt. When cached_content is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. Output only. List of modalities that were processed in the request input. Output only. Number of tokens of thoughts for thinking models. Output only. Number of tokens present in tool-use prompt(s). Output only. List of modalities that were processed for tool-use request inputs. Total token count for the generation request (prompt + response candidates). Hyperparameters for Veo. Optional. Number of complete passes the model makes over the entire training dataset during training. Optional. Multiplier for adjusting the default learning rate. Optional. The tuning task. Either I2V or T2V. Optional. The ratio of Google internal dataset to use in the training mixture, in range of [0, 1). If 0.2, it means 20% of Google internal dataset and 80% of user dataset will be used for training. If not set, the default value is 0.1. Default value. This value is unused. Tuning task for image to video. Tuning task for text to video. Tuning task for reference to video. Tuning Spec for Veo Model Tuning. Optional. Hyperparameters for Veo. Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used. Optional. Fully-qualified Vertex AI Search data store resource ID. Format: projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore} Optional. Fully-qualified Vertex AI Search engine resource ID. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} Optional. Filter strings to be passed to the search API. Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10. Config for the Vertex AI Search. Vertex AI Search Serving Config resource full name. For example, projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config} or projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}. 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 Full resource name of DataStore, such as Format: projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore} Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) The Vertex AI Feature Store FeatureView that the RAG corpus maps to. The embedding model to use for the RAG corpus. This value can't be changed after it's set. If you leave it empty, we use `text-embedding-004` as the embedding model. Retrieve from Vertex RAG Store for grounding. Optional. Deprecated. Please use rag_resources instead. Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support. Optional. The retrieval config for the Rag query. Optional. Number of top k results to return from the selected corpora. Optional. Currently only supported for Gemini Multimodal Live API. In Gemini Multimodal Live API, if store_context bool is specified, Gemini will leverage it to automatically memorize the interactions between the client and Gemini, and retrieve context when needed to augment the response generation for users' ongoing and future interactions. Optional. Only return results with vector distance smaller than the threshold. The definition of the Rag resource. Optional. RagCorpora resource name. Format: projects/{project}/locations/{location}/ragCorpora/{rag_corpus} Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field. Vertex Vector Search instance. This is the resource name of the Vector Search index that's used with the RAG corpus. Format: projects/{project}/locations/{location}/indexes/{index} The resource name of the Vector Search Index Endpoint Format: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint} A generated video. Path to another storage. Video bytes. Video encoding, for example \"video/mp4\". Metadata for a video . Metadata for a video File. Starting offset of a video. Ending offset of a video. Should be larger than the . Duration of the video. Provides metadata for a video, including the start and end offsets for clipping and the frame rate. Metadata describes the input video content. Deprecated: Use GenerateContentRequest.processing_options instead. Metadata describes the input video content. Optional. The end offset of the video. Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0]. Optional. The start offset of the video. Represents the result from a vision generative model. Configuration for a voice. The configuration for the voice to use. Optional. The configuration for a replicated voice. This enables users to replicate a voice from an audio sample. The configuration for the prebuilt voice to use. Specifies your Weaviate instance. The Weaviate instance's HTTP endpoint. The Weaviate collection that the RAG corpus maps to. Chunk from the web. Output only. Title of the chunk. Output only. URI reference of the chunk. 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. The domain of the web page that contains the evidence. This can be used to filter out low-quality sources. This field is not supported in Gemini API. The URI of the web page that contains the evidence. The title of the web page that contains the evidence. Standard web search for grounding and related configurations. Configuration for a white space chunking algorithm [white space delimited]. Maximum number of overlapping tokens between two adjacent chunks. Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow. An explanation method that redistributes Integrated Gradients attributions to segmented regions, taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1906.02825 Supported only by image Models. Config for XRAI with blur baseline. When enabled, a linear path from the maximally blurred image to the input image is created. Using a blurred baseline instead of zero (black image) is motivated by the BlurIG approach explained here: https://arxiv.org/abs/2004.03383 Config for SmoothGrad approximation of gradients. When enabled, the gradients are approximated by averaging the gradients from noisy samples in the vicinity of the inputs. Adding noise can help improve the computed gradients. Refer to this paper for more details: https://arxiv.org/pdf/1706.03825.pdf Required. The number of steps for approximating the path integral. A good value to start is 50 and gradually increase until the sum to diff property is met within the desired error range. Valid range of its value is [1, 100], inclusively. Converts a given string to snake case. The string to be converted to snake case. The resulting snake case string. Converts a given string to camel case. The string to be converted to camel case. Whether to remove whitespace or not. Whether to preserve the leading underscore or not. The resulting camel case string. Converts the specified string to PascalCase. The string to convert. The PascalCase version of the string. Splits a given camel case string into separate words using the specified separator. The camel case string to be split. The separator to be used. By default, a single space is used. The resulting string with words separated by the specified separator. Converts a string to kebab-case, with words separated by hyphens. The input string to be converted to kebab-case. A kebab-case representation of the input string. Extension method to convert a given string to title case. The string to convert to title case. A new string with each word in title case. Convert a string to Train Case string Insert any character before all upper space characters in a string string Insert a space before any upper case character in a string string Replace specific characters found in a string See: https://stackoverflow.com/a/7265786/7986443 string Replace all whitespace in a string See: https://stackoverflow.com/questions/6219454/efficient-way-to-remove-all-whitespace-from-string string Extension method to check if all the letters in the input string are uppercase. The string to check for uppercase letters. True if all the letters in the input string are uppercase, otherwise false. Convert SnakeCase to CamelCase See: https://www.codegrepper.com/code-examples/csharp/camelCase+and+snakeCase string Convert the first character in a string to lower case See: https://stackoverflow.com/questions/21755757/first-character-of-string-lowercase-c-sharp/21755933 string Convert the first character in a string to upper case string The `CorporaModel` class provides methods for interacting with a corpus of documents. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Creates an empty `Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Updates a `Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Lists all `Corpora` owned by the user. The maximum number of Corpora to return (per page). A page token, received from a previous List call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Gets information about a specific `Corpus`. Name od the corpus. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Deletes a `Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Performs semantic search over a `Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Creates an empty . Required. The name of the where this exists. Example: `ragStores/my-rag-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Deletes a . Required. The name of the . Required. The name of the where this exists. Example: `ragStores/my-rag-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the is or empty. Gets information about a specific . Required. The name of the . Required. The name of the where this exists. Example: `ragStores/my-rag-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the is or empty. Lists all s in a . Required. The name of the where this exists. Example: `ragStores/my-rag-store-123` The maximum number of items to return (per page). A page token, received from a previous List call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Performs semantic search over a . Required. The name of the . Required. The name of the where this exists. Example: `ragStores/my-rag-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Updates a . Required. The name of the . Required. The name of the where this exists. Example: `ragStores/my-rag-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Initializes a new instance of the class. Initializes a new instance of the class. The default constructor attempts to read .env file and environment variables. Sets default values, if available. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Generates embeddings from the model given an input. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Generates embeddings from the model given an input. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Creates an empty . Required. The `FileSearchStore`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the request is null. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Deletes a . Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123` Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets information about a specific . Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Lists all s owned by the user. The maximum number of items to return (per page). A page token, received from a previous List call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Imports a from File Service to a . Required. Immutable. The name of the to import the file into. Example: `fileSearchStores/my-file-search-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Imports a from File Service to a . Required. Immutable. The name of the to import the file into. Example: `fileSearchStores/my-file-search-store-123` The from the Files API. Custom metadata to be associated with the file. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the is . Imports a from File Service to a . Required. Immutable. The name of the to import the file into. Example: `fileSearchStores/my-file-search-store-123` Name of the . Custom metadata to be associated with the file. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An operation of the imported file. Thrown when the is or empty. Thrown when the is or empty. Uploads data to a , preprocesses and chunks before storing it in a Document. Name of the File Search Store. URI or path to the file to upload. A name displayed for the uploaded file. Configuration settings for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An operation of the uploaded file. Thrown when the is null or empty. Thrown when the file is not found. Thrown when the file size exceeds the maximum allowed size. Thrown when the file upload fails. Thrown when the request fails to execute. Thrown when the MIME type of the URI is not supported by the API. Uploads data to a , preprocesses and chunks before storing it in a Document. Name of the File Search Store. Stream to upload. A name displayed for the uploaded file. The MIME type of the stream content. Configuration settings for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An operation of the uploaded file. Thrown when the is null or empty. Thrown when the size exceeds the maximum allowed size. Thrown when the upload fails. Thrown when the request fails to execute. Thrown when the is not supported by the API. Compatibility method with Google SDK. Use for convenience. Name of the File Search Store. URI or path to the file to upload. Configuration settings for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An operation of the uploaded file. Compatibility method with Google SDK. Use for convenience. Name of the File Search Store. Stream to upload. A name displayed for the uploaded file. The MIME type of the stream content. Configuration settings for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An operation of the uploaded file. Thrown when the is null or empty. Thrown when the size exceeds the maximum allowed size. Thrown when the upload fails. Thrown when the request fails to execute. Thrown when the is not supported by the API. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Lists the metadata for Files owned by the requesting project. The maximum number of Models to return (per page). A page token, received from a previous ListFiles call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List of files in File API. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets the metadata for the given File. Required. The resource name of the file to get. This name should match a file name returned by the ListFiles method. Format: files/file-id. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Deletes a file. Required. The resource name of the file to get. This name should match a file name returned by the ListFiles method. Format: files/file-id. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails. Request with GCS Uris to register. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . A custom JSON converter factory for enums that allows for flexible parsing. It can handle enums represented as strings (including snake_case and kebab-case) and integers. Determines whether this converter can convert the specified type. The type to check. true if the type is an enum; otherwise, false. Creates a converter for the specified type. The type to convert. The JSON serializer options. A new instance of the generic . Reads and converts the JSON to type . The to read from. The type to convert. The JSON serializer options. The converted enum value. Thrown if the JSON value cannot be converted to the enum type. Writes a specified value as JSON. The to write to. The value to write. The JSON serializer options. Merges a sequence of objects into a single one. The first candidate of each response is taken; their collections are concatenated in the order the responses are given. For duplicated metadata fields the value from the *last* response that provides a non-null value overwrites earlier ones (“last value wins”). Initializes a new instance of the class. Initializes a new instance of the class. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Lists the generated files owned by the requesting project. The maximum number of Models to return (per page). A page token, received from a previous ListFiles call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List of files in File API. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Checks whether the API key has the right conditions. API key for the Gemini API. Thrown when the is null. Thrown when the is empty. Thrown when the has extra whitespace at the start or end, doesn't start with 'AIza', or has the wrong length. Checks if the functionality is supported by the model. Model to use. Message to use. Thrown when the functionality is not supported by the model. Checks if the IANA standard MIME type is supported by the model. See for a list of supported image data and video format MIME types. See for a list of supported audio format MIME types. The IANA standard MIME type to check. Thrown when the is not supported by the API. Checks if the IANA standard MIME type is supported by the model. See for a list of supported image data and video format MIME types. See for a list of supported audio format MIME types. See also for a list of supported MIME types for document processing. Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types The IANA standard MIME type to check. Thrown when the is not supported by the API. A comprehensive and complete list of MIME types supported by the Gemini API's File Search feature. This list has been verified to include all text/x-* types. Source: https://ai.google.dev/gemini-api/docs/file-search#supported-files Checks if the language is supported by the model. Language to use. Thrown when the is not supported by the API. Checks if invalid characters are part of the name of an entity. The name of the URL resource. Thrown when contains invalid characters. Sanitizes the model name by ensuring it starts with "models/" unless it is a tuned model. The model name to sanitize. The sanitized model name. Sanitizes the file name by ensuring it starts with "files/". The file name to sanitize. The sanitized file name. Sanitizes the generated file name by ensuring it starts with "generatedFiles/". The generated file name to sanitize. The sanitized generated file name. Sanitizes the cached content name by ensuring it starts with "cachedContents/". The cached content name to sanitize. The sanitized cached content name. Sanitizes the batch name by ensuring it starts with "batches/". The batch name to sanitize. The sanitized batch name. Sanitizes the tuning job name by ensuring it starts with "tuningJobs/". The tuning job name to sanitize. The sanitized tuning job name. Sanitizes the endpoint name. The endpoint name to sanitize. The sanitized endpoint name. Sanitizes the file search store name by ensuring it starts with "fileSearchStores/". The file search store name to sanitize. The sanitized file search store name. Sanitizes the corpora name by ensuring it starts with "corpora/". The corpora name to sanitize. The sanitized corpora name. Sanitizes the document name by ensuring it starts with "documents/". The document name to sanitize. The sanitized document name. Populates a Part from a byte array string and mime type. The part to populate. The string representation of the byte array. The mime type of the data. The populated part. Populates a Part from a code execution result. The part to populate. The outcome of the code execution. The output of the code execution. The populated part. Populates a Part from executable code. The part to populate. The executable code. The language of the code. The populated part. Populates a Part from a function call. The part to populate. The name of the function. The arguments for the function call. The populated part. Populates a Part from a function response. The part to populate. The name of the function. The response from the function. The populated part. Populates a Part from a text string. The part to populate. The text value. The populated part. Populates a Part from a URI. The part to populate. The URI of the file data. The mime type of the file. If null, it will be inferred from the URI. The populated part. Creates an Image object from a file URI. The URI of the image file. The mime type of the image. If null, it will be inferred from the URI. An Image object. Checks if a string is a valid Base64 string. The string to check. True if the string is a valid Base64 string, otherwise false. Checks if a string is valid JSON. The string to check. True if the string is valid JSON, otherwise false. Throws an exception if the IsSuccessStatusCode property for the HTTP response is false. The HTTP response message to check. Custom error message to prepend the message."/> Include the response content in the error message. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The HTTP response message if the call is successful. Throws an exception if the property for the HTTP response is false. The HTTP response. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The HTTP response was not successful. Reads an image file from a URL as a byte array. The URL of the image file. A byte array of the image file. Reads an image file from a URL as a byte array. The URL of the image file. A cancellation token. A byte array of the image file. Reads an image file from a URL and returns it as a Base64 encoded string. The URL of the image file. A cancellation token. A Base64 encoded string of the image file. Gets the MIME type from a file extension in a URI. The URI of the file. The inferred MIME type, or "application/octet-stream" if not found. Thrown when the is null. Truncates/abbreviates a string and places a user-facing indicator at the end. The string to truncate. Maximum length of the resulting string. Optional. Indicator to use, by default the ellipsis … The truncated string Thrown when the parameter is null or empty. Thrown when the length of the is larger than the . Gets the normalized (snake_case) name of a delegate's method. The delegate to get the name from. The snake_case method name. Converts HTTP headers to a formatted string, redacting sensitive information. The HttpHeaders to format. A formatted string representation of the headers. Configures the request to expect a JSON response. Gets the tools for the request, initializing the collection if it's null. The list of tools for the request. Adds the Google Search tool if it's not already present. The updated list of tools. Adds the Google Maps tool if it's not already present. Whether to enable the widget for Google Maps. The updated list of tools. Adds the Google Search Retrieval tool for grounding if it's not already present. The updated list of tools. Adds the Code Execution tool if it's not already present. The updated list of tools. Adds the URL Context tool if it's not already present. The updated list of tools. Represents a generative model that can be used to generate content, count tokens, and perform other generative AI tasks. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. Configuration options for model generation and outputs. Optional. A list of Tools the model may use to generate the next response. Optional. Configuration of tools used by the model. Optional. Instructions for the model to steer it toward better performance. Gets the appropriate API URL based on the configuration (Google AI vs. Vertex AI, custom endpoint, etc.). Gets or sets the API version. For Vertex AI, this is fixed to v1. Determines the API method name based on the model and configuration. Gets a value indicating whether the model is configured to use Vertex AI. You can enable Server Sent Events (SSE) for gemini-1.0-pro See Server-sent Events Gets or sets a value indicating whether to activate JSON Mode, which instructs the model to generate a JSON object. Gets or sets a value indicating whether to activate grounding with Google Search, which connects the model to real-time information. Gets or sets a value indicating whether to activate the Google Search tool, allowing the model to query Google Search. Gets or sets a value indicating whether to activate automatic code execution, allowing the model to run code. Gets or sets a value indicating whether to enable a realtime stream using the Multimodal Live API. Initializes a new instance of the class. The default constructor attempts to read `.env` file and environment variables to set default values. Initializes a new instance of the class with specified HTTP client factory and logger. The default constructor attempts to read .env file and environment variables. Sets default values, if available. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class for use with Google AI, with optional express Vertex AI configuration. API key provided by Google AI Studio Model to use Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Configuration of tools. Optional. Flag to indicate use of Vertex AI in express mode. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class for use with Vertex AI. Identifier of the Google Cloud project Region to use Model to use Access token for the Google Cloud project. Optional. Endpoint ID of the tuned model to use. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Configuration of tools. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class from a object. Content that has been preprocessed. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Thrown when is null. Initializes a new instance of the class from a object. Tuning Job to use with the model. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Thrown when is null. Initializes a new instance of the class for testing purposes, allowing injection of a custom . Gets a list of available tuned models and their descriptions. List of available tuned models. The maximum number of Models to return (per page). A page token, received from a previous ListModels call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the [ListOperationsResponse.unreachable] field. This can only be `true` when reading across collections e.g. when `parent` is set to `"projects/example/locations/-"`. This field is not by default supported and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API. List of available models. Flag, whether models or tuned models shall be returned. The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size. A page token, received from a previous ListModels call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information. Required. The resource name of the model. This name should match a model name returned by the ListModels method. Format: models/model-id or tunedModels/my-model-id Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Copies a model in Vertex AI Model Registry. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the functionality is not supported by the model. Creates a tuned model. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the functionality is not supported by the model. Deletes a tuned model. Required. The resource name of the model. Format: tunedModels/my-model-id Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is null or empty. Thrown when the functionality is not supported by the model. Updates a tuned model. Required. The resource name of the model. Format: tunedModels/my-model-id The tuned model to update. Optional. The list of fields to update. This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo". Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is null or empty. Thrown when the functionality is not supported by the model. Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role. Required. The resource name of the tuned model to transfer ownership. Format: tunedModels/my-model-id Required. The email address of the user to whom the tuned model is being transferred to. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the or is null or empty. Thrown when the functionality is not supported by the model. Uploads a file to the File API backend. URI or path to the file to upload. A name displayed for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token to cancel the upload. A URI of the uploaded file. Thrown when the is null or empty. Thrown when the file is not found. Thrown when the file size exceeds the maximum allowed size. Thrown when the file upload fails. Thrown when the request fails to execute. Uploads a stream to the File API backend. Stream to upload. A name displayed for the uploaded file. The MIME type of the stream content. Flag indicating whether to use resumable upload. Options for the request. A cancellation token to cancel the upload. A URI of the uploaded file. Thrown when the is null or empty. Thrown when the size exceeds the maximum allowed size. Thrown when the upload fails. Thrown when the request fails to execute. Lists the metadata for Files owned by the requesting project. The maximum number of Models to return (per page). A page token, received from a previous ListFiles call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List of files in File API. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets the metadata for the given File. Required. The resource name of the file to get. This name should match a file name returned by the ListFiles method. Format: files/file-id. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is null or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Deletes a file. Required. The resource name of the file to get. This name should match a file name returned by the ListFiles method. Format: files/file-id. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is null or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Generates a model response given an input . Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Thrown when the functionality is not supported by the model or combination of features. Generates a response from the model given an input prompt and other parameters. Required. String to process. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Configuration of tools. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Generates a streamed response from the model given an input GenerateContentRequest. This method uses a MemoryStream and StreamContent to send a streaming request to the API. It runs asynchronously sending and receiving chunks to and from the API endpoint, which allows non-blocking code execution. The request to send to the API. Options for the request. Stream of GenerateContentResponse with chunks asynchronously. Thrown when the is . Thrown when the request fails to execute. Thrown when the functionality is not supported by the model or combination of features. Generates a response from the model given an input GenerateContentRequest. Required. The request to send to the API. Options for the request. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Enqueues a batch of requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Thrown when the functionality is not supported by the model or combination of features. Enqueues a batch of requests for batch processing. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Thrown when the functionality is not supported by the model or combination of features. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Thrown when the request fails to execute. Generates images from text prompt. Required. Model to use. Required. String to process. Configuration of image generation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the is . Thrown when the request fails to execute. Generates images from text prompt. Required. String to process. Number of images to generate. Range: 1..8. A description of what you want to omit in the generated images. Aspect ratio for the image. Controls the strength of the prompt. Suggested values are - * 0-9 (low strength) * 10-20 (medium strength) * 21+ (high strength) Language of the text prompt for the image. Adds a filter level to Safety filtering. Allow generation of people by the model. Option to enhance your provided prompt. Explicitly set the watermark Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Edits a set of images specified in the request. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Thrown when the functionality is not supported by the model or combination of features. Thrown when the request fails to execute. Edits a set of images based on a text description and configuration. Required. Model to use. Required. A text description of the edit to apply to the image. List of references images for editing. Number of images to generate. Range: 1..8. Configuration for image editing. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Thrown when the is . Thrown when the request fails to execute. Makes an API request to upscale a provided image. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Thrown when the functionality is not supported by the model or combination of features. Thrown when the request fails to execute. Makes an API request to upscale a provided image. The model to use. The input image for upscaling. The factor to upscale the image (x2 or x4). Configuration for upscaling. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Thrown when the is . Thrown when the request fails to execute. Generates a video response from the model given an input . Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Generates images from text prompt. Required. String to process. Number of images to generate. Range: 1..8. A description of what you want to omit in the generated images. Aspect ratio for the image. Controls the strength of the prompt. Suggested values are - * 0-9 (low strength) * 10-20 (medium strength) * 21+ (high strength) Language of the text prompt for the image. Adds a filter level to Safety filtering. Allow generation of people by the model. Option to enhance your provided prompt. Explicitly set the watermark Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Generates a grounded answer from the model given an input GenerateAnswerRequest. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for a grounded answer. Thrown when the is . Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). Required. EmbedContentRequest to process. The content to embed. Only the parts.text fields will be counted. Optional. The model used to generate embeddings. Defaults to models/embedding-001. Optional. Optional task type for which the embeddings will be used. Can only be set for models/embedding-001. Optional. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List containing the embedding (list of float values) for the input content. Thrown when the is . Thrown when the functionality is not supported by the model. Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects. Required. Embed requests for the batch. The model in each of these requests must match the model specified BatchEmbedContentsRequest.model. Optional. The model used to generate embeddings. Defaults to models/embedding-001. Optional. Optional task type for which the embeddings will be used. Can only be set for models/embedding-001. Optional. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List containing the embedding (list of float values) for the input content. Thrown when the is . Generates an embedding from the model given an input Content. Required. String to process. The content to embed. Only the parts.text fields will be counted. Optional. The model used to generate embeddings. Defaults to models/embedding-001. Optional. Optional task type for which the embeddings will be used. Can only be set for models/embedding-001. Optional. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List containing the embedding (list of float values) for the input content. Thrown when the is . Thrown when the functionality is not supported by the model. Generates an embedding from the model given an input Content. Required. List of strings to process. The content to embed. Only the parts.text fields will be counted. Optional. The model used to generate embeddings. Defaults to models/embedding-001. Optional. Optional task type for which the embeddings will be used. Can only be set for models/embedding-001. Optional. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List containing the embedding (list of float values) for the input content. Thrown when the is . Thrown when the functionality is not supported by the model. Generates multiple embeddings from the model given input text in a synchronous call. Content to embed. Optional. The model used to generate embeddings. Defaults to models/embedding-001. Optional. Optional task type for which the embeddings will be used. Can only be set for models/embedding-001. Optional. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List containing the embedding (list of float values) for the input content. Thrown when the is . Thrown when the functionality is not supported by the model. Counts the number of tokens for the given content. The name of the GenAI model to use for token counting. A to compute tokens for. A instance that specifies the optional configurations. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A that represents the asynchronous operation. The task result contains a instance with token information. Counts the number of tokens for the given content. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A that represents the asynchronous operation. The task result contains a instance with token information. Thrown when the is . Counts the number of tokens for the given file resource. Computes the number of tokens for the given content. The name of the GenAI model to use for token computation. A to compute tokens for. A instance that specifies the optional configurations. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A that represents the asynchronous operation. The task result contains a instance with token information. Thrown when called with a non-Vertex AI client. Computes the number of tokens for the given content. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A that represents the asynchronous operation. The task result contains a instance with token information. Thrown when called with a non-Vertex AI client. Thrown when request is null. Starts a chat session. Optional. A collection of objects, or equivalents to initialize the session. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Returns a attached to this model. Performs a prediction request. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Prediction response. Thrown when the is . Thrown when the request fails to execute. Same as Predict but returns an LRO. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Prediction response. Thrown when the is . Thrown when the request fails to execute. Generates a response from the model given an input message. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Counts the number of tokens in the content. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Number of tokens. Thrown when the is . Generates a response from the model given an input prompt. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Runs a model's tokenizer on a string and returns the token count. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Number of tokens. Thrown when the is . A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Counts the number of tokens in the content. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Number of tokens. Thrown when the is . Generates multiple embeddings from the model given input text in a synchronous call. Required. Embed requests for the batch. The model in each of these requests must match the model specified BatchEmbedContentsRequest.model. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List of Embeddings of the content as a list of floating numbers. Thrown when the is . Entry point to access Gemini API running in Google AI. See Model reference. Initializes a new instance of the class with access to Google AI Gemini API. The default constructor attempts to read .env file and environment variables. Sets default values, if available. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Options for the request. Optional. Logger instance used for logging The following environment variables are used: GOOGLE_API_KEY API key provided by Google AI Studio. GOOGLE_ACCESS_TOKEN Optional. Access token provided by OAuth 2.0 or Application Default Credentials (ADC). Initializes a new instance of the class with access to Google AI Gemini API. Either API key or access token is required. API key for Google AI Studio. Access token for the Google Cloud project. Version of the API. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Options for the request. Optional. Logger instance used for logging Create a generative model on Google AI to use. Model to use (default: "gemini-2.5-pro") Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Logger instance used for logging Generative model instance. Create a generative model on Google AI to use. Content that has been preprocessed. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. Logger instance used for logging Generative model instance. Thrown when is null. Returns an instance of to use with a model. Optional. Logger instance used for logging Cached content instance. Returns an instance of to use with a model. Optional. Logger instance used for logging Batches instance. Returns an instance of to use with a model. Model to use (default: "imagegeneration") Optional. Logger instance used for logging Imagen model Returns an instance of . Returns an instance of . Uploads a file to the File API backend. URI or path to the file to upload. A name displayed for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token to cancel the upload. A URI of the uploaded file. Thrown when the is null or empty. Thrown when the file is not found. Thrown when the file size exceeds the maximum allowed size. Thrown when the file upload fails. Thrown when the request fails to execute. Uploads a stream to the File API backend. Stream to upload. A name displayed for the uploaded file. The MIME type of the stream content. Flag indicating whether to use resumable upload. Options for the request. A cancellation token to cancel the upload. A URI of the uploaded file. Thrown when the is null or empty. Thrown when the size exceeds the maximum allowed size. Thrown when the upload fails. Thrown when the request fails to execute. Gets a generated file. When calling this method via REST, only the metadata of the generated file is returned. To retrieve the file content via REST, add alt=media as a query parameter. Required. The name of the generated file to retrieve. Example: `generatedFiles/abc-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is null or empty. Thrown when the request fails to execute. Lists the metadata for Files owned by the requesting project. The maximum number of Models to return (per page). A page token, received from a previous files.list call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List of files in File API. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets the metadata for the given File. Required. The resource name of the file to get. This name should match a file name returned by the files.list method. Format: files/file-id. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is null or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Deletes a file. Required. The resource name of the file to get. This name should match a file name returned by the files.list method. Format: files/file-id. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is null or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails. List of Google Cloud Storage URIs to register. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Lists the metadata for Files owned by the requesting project. The maximum number of Models to return (per page). A page token, received from a previous files.list call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List of files in File API. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Thrown when both "apiKey" and "accessToken" are . Thrown when the is . Thrown when the is . Specify API key in HTTP header Using an API key with REST to send to the API. The API key to use for the request. A delegating handler that provides a timeout for HTTP requests. Default constructor. Base constructor to set the instance. Optional. Logger instance used for logging The interface shall be used to write generic implementations using either Google AI Gemini API or Vertex AI Gemini API as backends. Create an instance of a generative model to use. Model to use (default: "gemini-1.5-pro") Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Logger instance used for logging Thrown when required parameters are null. Generative model instance. Create an instance of a generative model to use. Content that has been preprocessed. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. Logger instance used for logging Generative model instance. Gets information about a specific Model. Required. The resource name of the model. This name should match a model name returned by the models.list method. Format: models/model-id or tunedModels/my-model-id Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when model parameter is null. Thrown when the backend does not support this method or the model. Returns an instance of an image generation model. Model to use (default: "imagegeneration") Optional. Logger instance used for logging Returns an instance of . Optional. Logger instance used for logging Returns an instance of . Optional. Logger instance used for logging Name of the model that supports image generation. The can create high quality visual assets in seconds and brings Google's state-of-the-art vision and multimodal generative AI capabilities to application developers. Initializes a new instance of the class. Initializes a new instance of the class. The default constructor attempts to read .env file and environment variables. Sets default values, if available. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class with access to Google AI Gemini API. API key provided by Google AI Studio Model to use Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class with access to Vertex AI Gemini API. Identifier of the Google Cloud project Region to use Access token for the Google Cloud project. Model to use Optional. Logger instance used for logging Generates images from the specified . Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated images. Thrown when the is . Generates images from text prompt. Required. String to process. Number of images to generate. Range: 1..8. A description of what you want to omit in the generated images. Aspect ratio for the image. Controls the strength of the prompt. Suggested values are - * 0-9 (low strength) * 10-20 (medium strength) * 21+ (high strength) Language of the text prompt for the image. Adds a filter level to Safety filtering. Allow generation of people by the model. Option to enhance your provided prompt. Explicitly set the watermark Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Generates a response from the model given an input prompt and other parameters. Required. String to process. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Generates an image from the model given an input. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Name of the model that supports image captioning. generates a caption from an image you provide based on the language that you specify. The model supports the following languages: English (en), German (de), French (fr), Spanish (es) and Italian (it). Initializes a new instance of the class. Initializes a new instance of the class. The default constructor attempts to read .env file and environment variables. Sets default values, if available. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class with access to Vertex AI Gemini API. Identifier of the Google Cloud project Region to use Access token for the Google Cloud project. Model to use Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Generates images from the specified . Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated images. Generates a response from the model given an input prompt and other parameters. Required. The base64 encoded image to process. Optional. Number of results to return. Default is 1. Optional. Language to use. Default is en. Optional. Cloud Storage uri where to store the generated predictions. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Thrown when the is not supported by the API. Generates a response from the model given an input prompt and other parameters. Required. The base64 encoded image to process. Required. The question to ask about the image. Optional. Number of results to return. Default is 1. Optional. Language to use. Default is en. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Thrown when the is not supported by the API. The Gemini Interactions API is an experimental API that allows developers to build generative AI applications using Gemini models. Gemini is a highly capable multimodal model that can understand and process various types of information, including language, images, audio, video, and code. The API supports use cases like reasoning across text and images, content generation, dialogue agents, summarization, and classification. Initializes a new instance of the class. Initializes a new instance of the class with a specified . The to use for making API requests. Initializes a new instance of the class with optional and . Optional. The to use for creating HttpClient instances. Optional. The instance for logging. Creates a new interaction based on the provided request. The request object containing all parameters for the interaction. Optional. Options for configuring the request, such as timeout and retry settings. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An representing the created interaction. Thrown if the request is null. Creates a new interaction with the specified parameters. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. The input string for the interaction. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An representing the created interaction. Creates a new interaction with the specified parameters, using structured content as input. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. The structured content for the interaction. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An representing the created interaction. Creates a new interaction with a list of content parts as input. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. A list of content parts for the interaction. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An representing the created interaction. Creates a new interaction with a history of conversation turns as input. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. A list of conversation turns representing the history. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An representing the created interaction. Creates a new interaction and streams the response as it is generated. The request object containing all parameters for the interaction. Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An asynchronous stream of chunks. Thrown if the request is null. Creates a new interaction and streams the response. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. The input string for the interaction. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An asynchronous stream of chunks. Creates a new interaction with structured content and streams the response. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. The structured content for the interaction. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An asynchronous stream of chunks. Creates a new interaction with a list of content parts and streams the response. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. A list of content parts for the interaction. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An asynchronous stream of chunks. Creates a new interaction with a history of conversation turns and streams the response. The name of the `Model` to use for the interaction. The name of the `Agent` to use for the interaction. A list of conversation turns representing the history. A system instruction to guide the model's behavior. A list of tool declarations the model may call. Enforces the response to be a JSON object matching a specified schema. The MIME type of the response, required if `responseFormat` is set. If true, the interaction will be streamed. If true, the request and response will be stored for later retrieval. If true, the interaction will run in the background. Configuration for the model's generation process. Configuration for the agent. The ID of the previous interaction in a conversation. The requested modalities for the response (e.g., TEXT, IMAGE). Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An asynchronous stream of chunks. Retrieves the full details of a single interaction by its ID. The unique identifier of the interaction to retrieve. If true, the generated content will be streamed incrementally. Optional. If set, resumes the stream from the event after the specified ID. Requires `stream` to be true. The API version to use for the request. Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An with the details of the interaction. Deletes an interaction by its ID. The unique identifier of the interaction to delete. The API version to use for the request. Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An empty string if the deletion is successful. Cancels a running background interaction by its ID. The unique identifier of the interaction to cancel. The API version to use for the request. Optional. Options for configuring the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An representing the canceled interaction. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The IHttpClientFactory to use for creating HttpClient instances. Optional. Logger instance used for logging Uploads data to a ragStore, preprocesses and chunks before storing it in a RagStore Document. Uploads data to a , preprocesses and chunks before storing it in a Document. Name of the File Search Store. URI or path to the file to upload. A name displayed for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. An operation of the uploaded file. Thrown when the is null or empty. Thrown when the file is not found. Thrown when the file size exceeds the maximum allowed size. Thrown when the file upload fails. Thrown when the request fails to execute. Thrown when the MIME type of the URI is not supported by the API. Uploads a file to the File API backend. URI or path to the file to upload. A name displayed for the uploaded file. Flag indicating whether to use resumable upload. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A URI of the uploaded file. Thrown when the is null or empty. Thrown when the file is not found. Thrown when the file size exceeds the maximum allowed size. Thrown when the file upload fails. Thrown when the request fails to execute. Thrown when the MIME type of the URI is not supported by the API. Uploads a stream to the File API backend. Stream to upload. A name displayed for the uploaded file. The MIME type of the stream content. Flag indicating whether to use resumable upload. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A URI of the uploaded file. Thrown when the is null or empty. Thrown when the size exceeds the maximum allowed size. Thrown when the upload fails. Thrown when the request fails to execute. Thrown when the is not supported by the API. Gets a generated file. When calling this method via REST, only the metadata of the generated file is returned. To retrieve the file content via REST, add alt=media as a query parameter. Required. The name of the generated file to retrieve. Example: `generatedFiles/abc-123` Optional. Flag indicating whether to retrieve the file content. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is null or empty. Thrown when the request fails to execute. Gets a generated file. When calling this method via REST, only the metadata of the generated file is returned. To retrieve the file content via REST, add alt=media as a query parameter. Required. The name of the generated file to retrieve. Example: `generatedFiles/abc-123` Optional. Flag indicating whether to retrieve the file content. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is null or empty. Thrown when the request fails to execute. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Lists the currently available models. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. List of available models. Thrown when the request fails to execute. Gets a model instance. Required. The resource name of the model. This name should match a model name returned by the ListModels method. Required. The name of the model to get. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the request fails to execute. Generates a set of responses from the model given a chat history input. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Generates embeddings from the model given an input. Required. The request to send to the API. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The `RagEngineModel` class provides methods for interacting with a RAG engine. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class. Access token for the Google Cloud project. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Creates an empty `RAG Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Updates a `RAG Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Lists all `RAG Corpora` owned by the user. The maximum number of Models to return (per page). A page token, received from a previous ListModels call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Gets information about a specific `RAG Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Deletes a `RAG Corpus`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. DeleteOperationMetadata Upload a local file to the corpus. URI or path to the file to upload. A name displayed for the uploaded file. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Upload a stream to the corpus. Stream to upload. The MIME type of the stream content. A name displayed for the uploaded file. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. A cancellation token that can be used by other objects or threads to receive notice of cancellation. ImportRagFilesOperationMetadata The maximum number of Models to return (per page). A page token, received from a previous ListModels call. Provide the pageToken returned by one request as an argument to the next request to retrieve the next page. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Required. Single RAG retrieve query. Required. Single RAG retrieve query. The data source for Vertex RagStore. Relevant contexts for one query. A context of the query. If the file is imported from Cloud Storage or Google Drive, sourceUri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, sourceUri will be file display name. The file display name. The text chunk. According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Creates an empty . Required. The `Document`. Required. The name of the `RagStore` where this `Document` will be created. Example: `ragStores/my-rag-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Deletes a . Required. The name of the `RagStore` where this `Document` exists. Example: `ragStores/my-rag-store-123` Required. The name of the `Document`. Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets information about a specific . Required. The name of the `RagStore` where this `Document` exists. Example: `ragStores/my-rag-store-123` Required. The name of the `Document`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Lists all s in a `RagStores`. Required. The name of the `RagStore` where the `Document`s exist. Example: `ragStores/my-rag-store-123` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Updates a `RagStore`. Required. The name of the `RagStore` where the `Document`s exist. Example: `ragStores/my-rag-store-123` Optional. The list of fields to update. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Performs semantic search over a . Required. The name of the `RagStore` where this `Document` exists. Example: `ragStores/my-rag-store-123` Required. The name of the `Document`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is or empty. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. Required. The name of the `RagStore` where this `Operation` exists. Example: `ragStores/my-rag-store-123` Required. The name of the `Operation`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is or empty. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. Required. The name of the `RagStore` where this `Operation` exists. Example: `ragStores/my-rag-store-123` Required. The name of the `Operation`. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Metadata for the given file. Thrown when the is or empty. Thrown when the is or empty. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. The model object. Output only. Id of the model. Output only. Always "model", required by the SDK. Output only. The Unix timestamp (in seconds) when the model was created. Output only. The organization that owns the model. Output only. Optional. An indicator whether a fine-tuned model has been deleted. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class with access to Vertex AI Gemini API. Identifier of the Google Cloud project Region to use Access token for the Google Cloud project. Model to use Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Gets metadata of a tuning job. Required. The ID of the tuning job. Format: `tuningJobs/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. The details of a tuning job. Thrown when the is or empty. Cancels a tuning job. Required. The ID of the tuning job. Format: `tuningJobs/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is or empty. Deletes a tuning job. Required. The ID of the tuning job. Format: `tuningJobs/{id}` Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. If successful, the response body is empty. Thrown when the is or empty. The search parameters to use for the ELASTIC_SEARCH spec. The ElasticSearch index to use. Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param. The ElasticSearch search template to use. The search parameters to use for SIMPLE_SEARCH spec. Tool that executes code generated by the model, and automatically returns the result to the model. See also `` and `` which are only generated when using this tool. Entry point to access Gemini API running in Vertex AI. See Model reference. See also https://cloud.google.com/nodejs/docs/reference/vertexai/latest/vertexai/vertexinit Initializes a new instance of the class with access to Vertex AI Gemini API. The default constructor attempts to read .env file and environment variables. Sets default values, if available. Optional. The to use for creating HttpClient instances. Optional. Options for the request. Optional. Logger instance used for logging The following environment variables are used: GOOGLE_PROJECT_ID Identifier of the Google Cloud project. GOOGLE_REGION Identifier of the Google Cloud region to use (default: "us-central1"). Initializes a new instance of the class with access to Vertex AI Gemini API. Identifier of the Google Cloud project. Optional. Region to use (default: "us-central1"). Access token for the Google Cloud project. Optional. Endpoint ID of the deployed model to use. Version of the API. Optional. The to use for creating HttpClient instances. Optional. Options for the request. Optional. Logger instance used for logging Thrown when is . Initializes a new instance of the class with access to Vertex AI Gemini API. API key for Vertex AI in express mode. Version of the API. Optional. The to use for creating HttpClient instances. Optional. Options for the request. Optional. Logger instance used for logging. Thrown when is . Create a generative model on Vertex AI to use. Model to use (default: "gemini-1.5-pro") Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. A list of Tools the model may use to generate the next response. Optional. Optional. Logger instance used for logging. Generative model instance. Thrown when "projectId" or "region" is . Create a generative model on Vertex AI to use. Content that has been preprocessed. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. Logger instance used for logging. Generative model instance. Thrown when is null. Thrown when "projectId" or "region" is . Create a generative model on Vertex AI to use. Tuning Job to use with the model. Optional. Configuration options for model generation and outputs. Optional. A list of unique SafetySetting instances for blocking unsafe content. Optional. Logger instance used for logging. Generative model instance. Thrown when is null. Thrown when "projectId" or "region" is . Model to use. Optional. Logger instance used for logging. Thrown when "projectId" or "region" is . Model to use (default: "imagegeneration") Optional. Logger instance used for logging. Thrown when "projectId" or "region" is . Model to use (default: "imagetext") Optional. Logger instance used for logging. Thrown when "projectId" or "region" is . Optional. Logger instance used for logging. Thrown when "projectId" or "region" is . Thrown when "apiKey" is Thrown when "projectId" or "region" is . Generates a video from the model given an input. Initializes a new instance of the class. Initializes a new instance of the class. Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class with access to Google AI Gemini API. API key provided by Google AI Studio Model to use Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Initializes a new instance of the class with access to Vertex AI Gemini API. Identifier of the Google Cloud project Region to use Model to use Optional. The to use for creating HttpClient instances. Optional. Logger instance used for logging Generates videos from the specified . Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Generates images from text prompt. Required. String to process. Number of images to generate. Range: 1..8. A description of what you want to omit in the generated images. Aspect ratio for the image. Adds a filter level to Safety filtering. Allow generation of people by the model. Option to enhance your provided prompt. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute. Generates a response from the model given an input prompt and other parameters. Required. String to process. Options for the request. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Response from the model for generated content. Thrown when the is . Thrown when the request fails to execute.