Mscc.GenerativeAI 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. Specify API key in HTTP header 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. Returns the region to use for the request. Gets or sets the timespan to wait before the request times out. Throws a , if the functionality is not supported by combination of settings. Optional. Logger instance used for logging Optional. Logger instance used for logging Parses the URL template and replaces the placeholder with current values. Given two API endpoints for Google AI Gemini and Vertex AI Gemini this method uses regular expressions to replace placeholders in a URL template with actual values. API endpoint to parse. Method part of the URL to inject Return serialized JSON string of request payload. Return deserialized object from JSON response. Type to deserialize response into. Response from an API call in JSON format. An instance of type T. Get default options for JSON serialization. default options for JSON serialization. Get credentials from specified file. This would usually be the secret.json file from Google Cloud Platform. File with credentials to read. Credentials read from file. This method uses the gcloud command-line tool to retrieve an access token from the Application Default Credentials (ADC). It is specific to Google Cloud Platform and allows easy authentication with the Gemini API on Google Cloud. Reference: https://cloud.google.com/docs/authentication The access token. Run an external application as process in the underlying operating system, if possible. The command or application to run. Optional arguments given to the application to run. Output from the application. Formatting string for logging purpose. The command or application to run. Optional arguments given to the application to run. Formatted string containing parameter values. 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. Logger instance used for logging Creates CachedContent resource. The cached content resource to create. 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. 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. 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}` 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. 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}` 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. Initializes a new instance of the class. Initializes a new instance of the class. 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. 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 Imagen 3 Generation is a Pre-GA. Allowlisting required. Imagen 3 Generation is a Pre-GA. Allowlisting required. Imagen 3 Generation is a Pre-GA. Allowlisting required. Possible roles. Initializes a new instance of the class. Initializes a new instance of the class. Optional. Logger instance used for logging Creates an empty `Corpus`. Gets information about a specific `Corpus`. Lists all `Corpora` owned by the user. Deletes a `Corpus`. Updates a `Corpus`. Performs semantic search over a `Corpus`. Generates embeddings from the model given an input. Initializes a new instance of the class. Initializes a new instance of the class. Optional. Logger instance used for logging Generates embeddings from the model given an input. Required. The request to send to the API. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Adapter size for tuning job. Unspecified adapter size. Adapter size 1. Adapter size 4. Adapter size 8. Adapter size 16. Style for grounded answers. 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. A list of reasons why content may have been blocked. BlockedReasonUnspecified means unspecified blocked reason. Safety means candidates blocked due to safety. You can inspect s 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. Candidates blocked due to unsafe image generation content. The mode of the predictor to be used in dynamic retrieval. Always trigger retrieval. Run retrieval only when system decides it is necessary. 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. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens. Unspecified means the finish reason is unspecified. Stop means natural stop point of the model or provided stop sequence. MaxTokens means the maximum number of tokens as specified in the request was reached. Safety means the token generation was stopped as the response was flagged for safety reasons. NOTE: When streaming the Candidate.Content will be empty if content filters blocked the output. Recitation means the token generation was stopped as the response was flagged for unauthorized citations. Other means all other reasons that stopped the token generation The token generation was stopped as the response was flagged for the terms which are included from the terminology blocklist. The token generation was stopped as the response was flagged for the prohibited contents. The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents. The function call generated by the model is invalid. The response candidate content was flagged for using an unsupported language. Token generation stopped because generated images contain safety violations. Mode of function calling to define the execution behavior for function calling. 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. Probability vs severity. The harm block method is unspecified. The harm block method uses both probability and severity scores. The harm block method uses the probability score. Block at and beyond a specified harm probability. 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. The category of a rating. Ref: https://ai.google.dev/api/rest/v1beta/HarmCategory HarmCategoryUnspecified means the harm category is unspecified. HarmCategoryHateSpeech means the harm category is hate speech. HarmCategoryDangerousContent means the harm category is dangerous content. HarmCategoryHarassment means the harm category is harassment. HarmCategorySexuallyExplicit means the harm category is sexually explicit content. Content that may be used to harm civic integrity. Negative or harmful comments targeting identity and/or protected attribute. Content that is rude, disrespectful, or profane. Describes scenarios depicting violence against an individual or group, or general descriptions of gore. Contains references to sexual acts or other lewd content. Promotes unchecked medical advice. Dangerous content that promotes, facilitates, or encourages harmful acts. The probability that a piece of content is harmful. Unspecified means harm probability unspecified. Negligible means negligible level of harm. Low means low level of harm. Medium means medium level of harm. High means high level of harm. Harm severity levels. Unspecified means harm probability unspecified. Negligible means negligible level of harm. Low means low level of harm. Medium means medium level of harm. High means high level of harm. Unspecified language. This value should not be used. Python >= 3.10, with numpy and simpy available. The media resolution 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). The modality associated with a token count. Unspecified modality. Plain text. Image. Video. Audio. Document, e.g. PDF. 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. Outcome of the code execution. Unspecified status. This value should not be used. Code execution completed successfully. Code execution finished but with a failure. `stderr` should contain the reason. Code execution ran for too long, and was cancelled. There may or may not be a partial output present. Type contains the list of OpenAPI data types as defined by https://spec.openapis.org/oas/v3.0.3#data-types Unspecified means not specified, should not be used. String means openAPI string type Number means openAPI number type Integer means openAPI integer type Boolean means openAPI boolean type Array means openAPI array type Object means openAPI object type 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. The requested modalities of the response. Default value. Indicates the model should return text. Indicates the model should return images. Indicates the model should return audio. The state of the tuned model. 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. Output only. Current state of the Chunk. The default value. This value is used if the state is omitted. Chunk is being processed (embedding and vector storage). Chunk is processed and available for querying. Chunk failed processing. States for the lifecycle of a 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. The state of the tuned model. 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. The state of the tuning job. The default value. This value is unused. The tuning job is running. The tuning job is pending. The tuning job failed. The tuning job has been cancelled. Type of task for which the embedding will be used. Ref: https://ai.google.dev/api/rest/v1beta/TaskType 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. 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. 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. Initializes a new instance of the class. Initializes a new instance of the class. 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. 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. 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. 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. Initializes a new instance of the class. Initializes a new instance of the class. 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. 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. Checks if the language is supported by the model. Language to use. Thrown when the is not supported by the API. 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. The HTTP response message if the call is successful. 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 . You can enable Server Sent Events (SSE) for gemini-1.0-pro See Server-sent Events Activate JSON Mode (default = no) Activate Grounding with Google Search (default = no) Activate Google Search (default = no) Enable realtime stream using Multimodal Live API 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. 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. 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. 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. 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. Logger instance used for logging Initializes a new instance of the class given cached content. 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 Thrown when is null. Initializes a new instance of the class given cached content. 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 Thrown when is null. Get a list of available tuned models and description. 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 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 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 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. 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. 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 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". 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. 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. 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. 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. 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. 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. 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. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . Generates images from text prompt. Required. Model to use. Required. String to process. Configuration of image generation. 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 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. 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. 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. 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. 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. 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. 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. Runs a model's tokenizer on input `Content` and returns the token count. 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. Number of tokens. Thrown when the is . 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. 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. 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. 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. 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. 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. Logger instance used for logging Create a generative model on Google 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. Generative model instance. Thrown when both "apiKey" and "accessToken" are . 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. Generative model instance. Thrown when is null. Thrown when both "apiKey" and "accessToken" are . Returns an instance of CachedContent to use with a model. Cached content instance. Thrown when both "apiKey" and "accessToken" are . Returns an instance of to use with a model. Model to use (default: "imagegeneration") Imagen model Thrown when both "apiKey" and "accessToken" are . 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. 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. 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` 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. 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. 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. 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. 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. List of files in File API. Thrown when the functionality is not supported by the model. Thrown when the request fails to execute. 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. 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. 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 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") 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. 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. 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. Logger instance used for logging Generates images from the specified . Required. The request to send to the API. 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 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. 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. Logger instance used for logging 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. 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. Logger instance used for logging Generates images from the specified . Required. The request to send to the API. 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. 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. 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. Extensions for logging invocations. This extension uses the to generate logging code at compile time to achieve optimized code. Logs Optional. Logger instance used for logging Logs Optional. Logger instance used for logging Logs invoking an API request. Optional. Logger instance used for logging Calling method URL of Gemini API endpoint Data sent to the API endpoint Logs when exception thrown to run an external application. Optional. Logger instance used for logging Message of to log. Logs parsing the URL to call. Optional. Logger instance used for logging Parsed URL. Initializes a new instance of the class. Initializes a new instance of the class. Optional. Logger instance used for logging 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. 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. 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. 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. Logger instance used for logging Lists the currently available models. 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. 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. 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. A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . 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. 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. Logger instance used for logging A cancellation token that can be used by other objects or threads to receive notice of cancellation. Thrown when the is . 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}` 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}` 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}` 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. Abstract base type with logging instance. Base constructor to set the instance. Optional. Logger instance used for logging 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. 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. List of cached content resources. A token, which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no more pages. 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}` Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. Specifies when this resource will expire. Input only. New TTL for this resource, input only. Output only. Creation time of the cache entry. Output only. When the cache entry was last updated in UTC time. 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. The content to cache. Optional. Input only. Immutable. Developer set system instruction. Currently text only. Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response Optional. Input only. Immutable. Tool config. This config is shared for all tools. Output only. Metadata on the usage of the cached content. Metadata on the usage of the cached content. Total number of tokens that the cached content consumes. A response candidate generated from the model. Ref: https://ai.google.dev/api/rest/v1beta/Candidate Output only. Content parts of the candidate. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens. Output only. Describes the reason the mode stopped generating tokens in more detail. This is only filled when `finish_reason` is set. Output only. Index of the candidate. Output only. List of ratings for the safety of a response candidate. There is at most one rating per category. Output only. Source attribution of the generated content. Output only. Token count for this candidate. Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for GenerateAnswer calls. Output only. Output only. Log-likelihood scores for the response tokens and top tokens 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. 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. 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. 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. 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. 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. 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\". A `Chunk` is a subpart of a `Document` that is treated as an independent unit for the purposes of vector representation and storage. A `Corpus` can have a maximum of 1 million `Chunk`s. Immutable. Identifier. The `Chunk` 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: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c` Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043. Output only. Current state of the `Chunk`. Output only. The Timestamp of when the `Chunk` was created. Output only. The Timestamp of when the `Chunk` was last updated. Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20. Extracted data that represents the `Chunk` content. The `Chunk` content as a string. The maximum number of tokens per chunk is 2043. A collection of source attributions for a piece of content. Ref: https://ai.google.dev/api/rest/v1beta/CitationMetadata Output only. List of citations. A citation to a source for a portion of a specific response. Output only. Start index into the content. Output only. End index into the content. Output only. Url reference of the attribution. Output only. Title of the attribution. Output only. License of the attribution. Output only. Publication date of the attribution. 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. Result of executing the `ExecutableCode`. Only generated when using the `CodeExecution`, and always follows a `part` containing the `ExecutableCode`. 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. Request message for ComputeTokens RPC call. Optional. The name of the publisher model requested to serve the prediction. Format: models/{model}. Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request. 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. 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. The base structured datatype containing multipart content of a message. Ref: https://ai.google.dev/api/rest/v1beta/Content 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. 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. Ref: https://ai.google.dev/api/rest/v1beta/ContentEmbedding The embedding values. Content filtering metadata associated with processing a single request. Ref: https://ai.google.dev/api/rest/v1beta/ContentFilter Output only. The reason content was blocked during request processing. A string that describes the filtering behavior in more detail. 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. Request to copy a model. The Google Cloud path of the source model. The path is based on "projects/SOURCE_PROJECT_ID/locations/SOURCE_LOCATION/models/SOURCE_MODEL_ID[@VERSION_ID]" The copied model. 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. A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora. 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` 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. The Timestamp of when the `Corpus` was created. Output only. The Timestamp of when the `Corpus` was last updated. A response from `CountTokens`. It returns the model's `token_count` for the `prompt`. The total number of tokens counted across all instances from the request. The total number of tokens counted across all instances from the request. The total number of billable characters 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 request input. 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. 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 string value of the metadata to store. The StringList value of the metadata to store. 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. 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. 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. Request containing the for the model to embed. 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}` Required. The content to embed. Only the `parts.text` fields will be counted. 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. 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, and the earlier model (`models/embedding-001`) cannot specify this value. The response to an EmbedContentRequest. Output only. Generated candidates. Output only. The embedding generated from the input content. Output only. The embeddings for each request, in the same order as provided in the batch request. A list of floats representing an embedding. Ref: https://ai.google.dev/api/rest/v1beta/Embedding The embedding values. Optional. The free-form input text that the model will turn into an embedding. Default constructor. Optional. The free-form input text that the model will turn into an embedding. 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. Optional. Embed requests for the batch. Only one of texts or requests can be set. The response to a EmbedTextRequest. Output only. The embedding generated from the input text. Output only. The embeddings generated from the input text. An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response. Required. An example of an input Message from the user. Required. An example of what the model should output given the input. 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. Programming language of the `code`. Required. The code to be executed. URI based data. URI of the file of the image or video to include in the prompt. The bucket that stores the file must be in the same Google Cloud project that's sending the request. 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 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. 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 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. MIME type of the file. Output only. Size of the file in bytes. Output only. The timestamp of when the File was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Output only. The timestamp of when the File was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Output only. The timestamp of when the File will be deleted. Only set if the File is scheduled to expire. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Output only. SHA-256 hash of the uploaded bytes. A base64-encoded string. Output only. The URI of the File. Output only. Processing state of the File. Output only. Error status if File processing failed. Output only. Metadata for a video. Output only. The download uri of the `File`. Source of the File. A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the parameters and their values. Required. The name of the function to call. Matches [FunctionDeclaration.name]. Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details. Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. Configuration for specifying function calling behavior. Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO. 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. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided. 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. Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63. Required. A brief description of the function. Description and purpose of the function. Model uses it to decide how and whether to call the function. 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. For function with no parameters, this can be left unset. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - 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. 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 call. It is used as context to the model. Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name]. Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output. Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. Request to generate a grounded answer from the model. 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: models.generateAnswer currently only supports queries in English. Required. Style in which answers should be returned. 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 safetySettings. 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. Passages provided inline with the request. 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. Default constructor. Configuration for retrieving grounding content from a Corpus or Document created using the Semantic Retriever API. Required. Name of the resource for retrieval, e.g. corpora/123 or corpora/123/documents/abc. Required. Query to use for similarity matching Chunks in the given resource. Optional. Filters for selecting Documents and/or Chunks from the resource. Optional. Maximum number of relevant Chunks to retrieve. Optional. Minimum relevance score for retrieved relevant Chunks. A repeated list of passages. List of passages. Passage included inline with a grounding configuration. Identifier for the passage for attributing this passage in grounded answers. Content of the passage. Response from the model for a grounded answer. 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 answerableProbability. Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low answerableProbability indicates that the answer might not be grounded in the sources. Output only. Feedback related to the input data used to answer the question, as opposed to model-generated response to the question. A convenience overload to easily access the responded text. The responded text information of first candidate. Request to generate a completion from the model. Required. The name of the Model to use for generating the completion. Format: models/{model}. Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request. Optional. Configuration options for model generation and outputs. Optional. A list of unique `` 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. Available for gemini-1.5-pro and gemini-1.0-pro-002. 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". The text strings count toward the token limit. The role field of systemInstruction is ignored and doesn't affect the performance of the model. Note: only text should be used in parts and content in each part will be in a separate paragraph. Optional. Configuration of tools used by the model. Optional. A list of Tools the model may use to generate the next response. A 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 only supported tool is currently Function. Optional. The name of the content cached to use as context to serve the prediction. Format: cachedContents/{cachedContent} 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. Response from the model supporting multiple candidates. Ref: https://ai.google.dev/api/rest/v1beta/GenerateContentResponse A convenience property to get the responded text information of first candidate. Output only. Generated Candidate responses from the model. Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations. Usage metadata about the response(s). Output only. The model version used to generate the response. A convenience overload to easily access the responded text. The responded text information of first candidate. A file generated on behalf of a user. Identifier. The name of the generated file. Example: `generatedFiles/abc-123` MIME type of the generatedFile. Error details if the GeneratedFile ends up in the STATE_FAILED state. Output only. The state of the GeneratedFile. The blob reference of the generated file to download. Only set when the GeneratedFiles.get request url has the \"?alt=media\" query param. 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. Generates a response from the model given an input MessagePrompt. 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. Controls the randomness of predictions. Temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that expect a true or correct response, while higher temperatures can lead to more diverse or unexpected results. With a temperature of 0, the highest probability token is always selected. Optional. If specified, nucleus sampling will be used. Top-p changes how the model selects tokens for output. Tokens are selected from most probable to least until the sum of their probabilities equals the top-p value. For example, if tokens A, B and C have a probability of .3, .2 and .1 and the top-p value is .5, then the model will select either A or B as the next token (using temperature). Optional. If specified, top-k sampling will be used. Top-k changes how the model selects tokens for output. A top-k of 1 means that the selected token is the most probable among all tokens in the model's vocabulary (also called greedy decoding), while a top-k of 3 means that the next token is selected from among the three most probable tokens (using temperature). Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1. Default constructor. Responded text information of first candidate. Candidate response messages from the model. The conversation history used by 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. A convenience overload to easily access the responded text. The responded text information of first candidate. 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. 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 safetySettings. 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. Optional. Controls the randomness of predictions. Temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that expect a true or correct response, while higher temperatures can lead to more diverse or unexpected results. With a temperature of 0, the highest probability token is always selected. Optional. If specified, nucleus sampling will be used. Top-p changes how the model selects tokens for output. Tokens are selected from most probable to least until the sum of their probabilities equals the top-p value. For example, if tokens A, B and C have a probability of .3, .2 and .1 and the top-p value is .5, then the model will select either A or B as the next token (using temperature). Optional. If specified, top-k sampling will be used. Top-k changes how the model selects tokens for output. A top-k of 1 means that the selected token is the most probable among all tokens in the model's vocabulary (also called greedy decoding), while a top-k of 3 means that the next token is selected from among the three most probable tokens (using temperature). 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 output tokens to generate per message. Token limit determines the maximum amount of text output from one prompt. A token is approximately four characters. Optional. Stop sequences. A stop sequence is a series of characters (including spaces) that stops response generation if the model encounters it. The sequence is not included as part of the response. You can add up to five stop sequences. Default constructor. The response from the model, including candidate completions. 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. Returns any safety feedback related to content filtering. A convenience overload to easily access the responded text. The responded text information of first candidate. Configuration options for model generation and outputs. Not all parameters may be configurable for every model. Ref: https://ai.google.dev/api/rest/v1beta/GenerationConfig Optional. Controls the randomness of predictions. Temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that expect a true or correct response, while higher temperatures can lead to more diverse or unexpected results. With a temperature of 0, the highest probability token is always selected. Optional. If specified, nucleus sampling will be used. Top-p changes how the model selects tokens for output. Tokens are selected from most probable to least until the sum of their probabilities equals the top-p value. For example, if tokens A, B and C have a probability of .3, .2 and .1 and the top-p value is .5, then the model will select either A or B as the next token (using temperature). Optional. If specified, top-k sampling will be used. Top-k changes how the model selects tokens for output. A top-k of 1 means that the selected token is the most probable among all tokens in the model's vocabulary (also called greedy decoding), while a top-k of 3 means that the next token is selected from among the three most probable tokens (using temperature). Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1. 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. Stop sequences. A stop sequence is a series of characters (including spaces) that stops response generation if the model encounters it. The sequence is not included as part of the response. You can add up to five stop sequences. Optional. Output response mimetype of the generated candidate text. Supported mimetype: `text/plain`: (default) Text output. `application/json`: JSON response in the candidates. Optional. Output response schema of the generated candidate text when response mime type can have schema. Schema can be objects, primitives or arrays and is a subset of [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response. 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 frequencyPenalty 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. 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 maxOutputTokens limit: "...the the the the the...". Optional. If true, export the logprobs results in response. Optional. Only valid if responseLogprobs=True. This sets the number of top logprobs to return at each decoding step in the Candidate.logprobs_result. Optional. Enables enhanced civic answers. It may not be available for all models. 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. The speech generation config. Optional. If specified, the media resolution specified will be used. Optional. Seed used in decoding. If not set, the request uses a randomly generated seed. Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. Tool to retrieve public web data for grounding, powered by Google. Specifies the dynamic retrieval configuration for the given source. 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. Output only. Start index into the content. Output only. End index into the content. Output only. Part index into the content. Grounding chunk. Grounding chunk from the web. Metadata returned to client when grounding is enabled. Optional. Google search entry for the following-up web searches. Web search queries for the following-up web search. List of grounding support. Metadata related to retrieval in the grounding flow. List of supporting references retrieved from specified grounding source. 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`. Grounding support. Segment of the content this support belongs to. A list of indices (into 'grounding_chunk') 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. 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. 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. Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance 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. 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 learningRate based on the default (recommended) value. Actual learning rate := learningRateMultiplier * 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. Optional. 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: 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. 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. Response from ListFiles method containing a paginated list of files. The list of files. A token, which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no more pages. Response from ListFiles method containing a paginated list of generated files. The list of generated files. A token, which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no more pages. Logprobs Result Length = total number of decoding steps. Length = total number of decoding steps. The chosen candidates may or may not be in topCandidates. Candidate for the logprobs token and score. The candidate’s token string value. The candidate’s token id value. The candidate's log probability. 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. 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. Required. The text content of the structured Message. 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. 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. Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. 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 = [{stringValue = "drama", operation = EQUAL}, {stringValue = "action", operation = EQUAL}] Required. The key of the metadata to filter on. Required. The Conditions for the given key that will trigger this filter. Multiple Conditions are joined by logical ORs. Filter condition applicable to a single key. Required. Operator applied to the given key-value pair to trigger the condition. The string value to filter the metadata on. The numeric value to filter the metadata on. Represents token counting info for a single modality. The modality associated with this token count. Number of tokens. Response from ListModels method containing a paginated list of Models. The list of Models. A token, which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no more pages. Information about a Generative Language Model. Ref: https://ai.google.dev/api/rest/v1beta/models Required. The resource name of the Model. The name of the base model, pass this to the generation request. The version number of the model (Google AI). The version Id of the model (Vertex AI). 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. The human-readable name of the model. E.g. "Chat Bison". The name can be up to 128 characters long and can consist of any UTF-8 characters. A short description of the model. Maximum number of input tokens allowed for this model. Maximum number of output tokens available for this model. The model's supported generation methods. The method names are defined as Pascal case strings, such as generateMessage which correspond to API methods. 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 used by the backend while making the call to the model. The maximum temperature this model can use. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least topP. This value specifies default to be used by the backend while making the call to the model. For Top-k sampling. Top-k sampling considers the set of topK most probable tokens. This value specifies default to be used by the backend while making the call to the model. Output only. The state of the tuned model. Output only. The timestamp when this model was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Output only. The timestamp when this model was updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". 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. Output only. The timestamp when this model was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Output only. The timestamp when this model was updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". "sourceType": "GENIE" "genieSource": {} Tuned model as a source for training a new model. Immutable. The name of the TunedModel to use as the starting point for training the new model. Example: tunedModels/my-tuned-model Output only. The name of the base Model this TunedModel was tuned from. Example: models/text-bison-001 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 This resource represents a long-running operation that is the result of a network API call. 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`. 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 A text part of a conversation with the model. Raw media bytes sent directly in the request. URI based data. 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. A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values. Optional. For video input, the start and end offset of the video in Duration format. Code generated by the model that is meant to be executed. Result of executing the ExecutableCode. Optional. Indicates if the part is thought from the model. The ETag of the item. 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`. The configuration for the prebuilt speaker to use. The name of the preset voice to use. 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. Required. The instances that are the input to the prediction call. Optional. The parameters that govern the prediction call. Response message for [PredictionService.Predict]. The outputs of the prediction call. A set of the feedback metadata the prompt specified in GenerateContentRequest.content. Output only. Optional. If set, the prompt was blocked and no candidates are returned. Rephrase your prompt. Output only. Ratings for safety of the prompt. There is at most one rating per category. Output only. A readable block reason message. Request for querying a `Corpus`. Required. Query string to perform semantic search. 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. The information for a chunk relevant to a query. associated with the query. relevance to the query. Initializes a new instance of the class Refer to [retry docs](https://googleapis.dev/python/google-api-core/latest/retry.html) for details. In seconds (or provide a [TimeToDeadlineTimeout](https://googleapis.dev/python/google-api-core/latest/timeout.html) object). 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. Defines a retrieval tool that model can call to access external knowledge. 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. Optional. Set to use data source powered by Vertex AI Search. 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. 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. Safety rating for a piece of content. Ref: https://ai.google.dev/api/rest/v1beta/SafetyRating Output only. Required. The category for this rating. Output only. Required. The probability of harm for this content. Output only. Indicates whether the content was filtered out because of this rating. Output only. Harm probability scoring in the content. Vertex AI only Output only. Harm severity levels in the content. Vertex AI only Output only. Harm severity scoring in the content. Vertex AI only Safety setting, affecting the safety-blocking behavior. 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 Required. The category for this setting. Required. Controls the probability threshold at which harm is blocked. 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. Required. Data type. Optional. The format of the data. This is used only for primitive datatypes. Supported formats: for NUMBER type: float, double for INTEGER type: int32, int64 for STRING type: enum, date-time Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown. Optional. Indicates if the value may be null. Optional. Schema of the elements of Type.ARRAY. Optional. Maximum number of the elements for Type.ARRAY. Optional. Minimum number of the elements for Type.ARRAY. 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. Properties of Type.OBJECT. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. 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. Response for list models. Output only. A list of the requested embeddings. Output only. Always "list", required by the SDK. 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. 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. Segment of the content. Output only. The text corresponding to the segment from the response. Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. Output only. The index of a Part object within its parent Content object. Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero. 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` The speech generation config. The configuration for the speaker to use. 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 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 list of messages that carry the error details. There is a common set of message types for APIs to use. Options for streaming requests. Optional. If set, include usage statistics in the response. Cloud Storage URI of your training dataset. The dataset must be formatted as a JSONL file. For best results, provide at least 100 to 500 examples. Optional: The Cloud Storage URI of your validation dataset file. Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used. Output text returned from a model. Output only. The generated text returned from the model. Ratings for the safety of a response. There is at most one rating per category. 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. Required. The prompt text. Config for thinking features. Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. Tokens info with a list of tokens and the corresponding list of token ids. A list of token ids from the input. A list of tokens from the input. Optional. Optional fields for the role from the corresponding Content. Defines a tool that model can call to access external knowledge. Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall][content.part.function_call] in the response. User should provide a [FunctionResponse][content.part.function_response] for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided. Optional. Enables the model to execute code as part of 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. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search. Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. Candidates with top log probabilities at each decoding step. Sorted by log probability in descending order. Dataset for training or validation. Optional. Inline examples. A set of tuning examples. Can be training or validation data. Required. 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. A single example for tuning. Optional. Text model input. Required. The expected model output. A tuning example with multiturn input. Each Content represents a turn in the conversation. Optional. Developer set system instructions. Currently, text only. 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. Name of the tuned model. Display name of the tuned model. 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. Record for a single tuning step. Output only. The tuning step. Output only. The epoch this step was part of. Output only. The mean loss of the training examples for this step. Output only. The timestamp when this metric was computed. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Tuning tasks that create tuned models. Output only. The timestamp when tuning this model started. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Output only. The timestamp when tuning this model completed. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Output only. Metrics collected during tuning. Required. Input only. Immutable. The model training data. Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used. 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. Number of tokens in the request. Number of tokens in the response(s). Number of tokens in the response(s). Number of tokens in the cached content. Output only. Number of tokens present in tool-use prompt(s). Output only. List of modalities that were processed in the request input. Output only. List of modalities that were returned in the response. Output only. List of modalities of the cached content in the request input. Output only. List of modalities that were processed for tool-use request inputs. Retrieve from Vertex AI Search datastore for grounding. Fully-qualified Vertex AI Search's datastore resource ID. Format: projects/{project_id}/locations/{location}/collections/default_collection/dataStores/{data_store_id} See https://cloud.google.com/vertex-ai-search-and-conversation Optional. For video input, the start and end offset of the video in Duration format. For example, to specify a 10 second clip starting at 1:00, set "start_offset": { "seconds": 60 } and "end_offset": { "seconds": 70 }. Duration of the video. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s". Starting offset of a video. Ending offset of a video. Should be larger than the . The configuration for the voice to use. The configuration for the prebuilt voice to use. Chunk from the web. URI reference of the chunk. Title of the chunk. 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. 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. 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. 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. 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. 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 number of generated images. Accepted integer values: 1-8 (v.002), 1-4 (v.005, v.006). Default value: 4. Optional. Cloud Storage uri 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. 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 the Responsible AI filtered reason or error code for blocked output in the response content. 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. 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). 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. 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. 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. 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 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. 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. Custom JSON converter to serialize and deserialize JSON schema. 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. 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"). 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. 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. 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. 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. Generative model instance. Thrown when is null. Thrown when "projectId" or "region" is . Model to use. Thrown when "projectId" or "region" is . Model to use (default: "imagegeneration") Thrown when "projectId" or "region" is . Model to use (default: "imagetext") Thrown when "projectId" or "region" is .