Get desktop application:
View/edit binary Protocol Buffers messages
API for managing cache of content (CachedContent resources) that can be used in GenerativeService requests. This way generate content requests can benefit from preprocessing work being done earlier, possibly lowering their computational cost. It is intended to be used with large contexts.
Lists CachedContents.
Request to list CachedContents.
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.
Response with CachedContents list.
List of cached contents.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
Creates CachedContent resource.
Request to create CachedContent.
Required. The cached content to create.
Reads CachedContent resource.
Request to read CachedContent.
Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`
Updates CachedContent resource (only expiration is updatable).
Request to update CachedContent.
Required. The content cache entry to update
The list of fields to update.
Deletes CachedContent resource.
Request to delete CachedContent.
Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`
An API for using Generative Language Models (GLMs) in dialog applications. Also known as large language models (LLMs), this API provides models that are trained for multi-turn dialog.
Generates a response from the model given an input `MessagePrompt`.
Request to generate a message response from the model.
Required. The name of the model to use. Format: `name=models/{model}`.
Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.
Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model.
Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.
Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`.
Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens.
The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.
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.
Runs a model's tokenizer on a string and returns the token count.
Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.
Required. The 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 prompt, whose token count is to be returned.
A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.
The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.
An API for uploading and managing files.
Creates a `File`.
Request for `CreateFile`.
Optional. Metadata for the file to create.
Response for `CreateFile`.
Metadata for the created file.
Lists the metadata for `File`s owned by the requesting project.
Request for `ListFiles`.
Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.
Optional. A page token from a previous `ListFiles` call.
Response for `ListFiles`.
The list of `File`s.
A token that can be sent as a `page_token` into a subsequent `ListFiles` call.
Gets the metadata for the given `File`.
Request for `GetFile`.
Required. The name of the `File` to get. Example: `files/abc-123`
Deletes the `File`.
Request for `DeleteFile`.
Required. The name of the `File` to delete. Example: `files/abc-123`
API for using Large Models that generate multimodal content and have additional capabilities beyond text generation.
Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.
Generates a grounded answer from the model given an input `GenerateAnswerRequest`.
Request to generate a grounded answer from the `Model`.
The sources in which to ground the answer.
Passages provided inline with the request.
Content retrieved from resources created via the Semantic Retriever API.
Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{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: `GenerateAnswer` 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 safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.
Response from the model for a grounded answer.
Candidate answer from the model. Note: The model *always* attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low `answerable_probability`.
Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low `answerable_probability` indicates that the answer might not be grounded in the sources. When `answerable_probability` is low, you may want to: * Display a message to the effect of "We couldn’t answer that question" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. `0.5` is a good starting threshold.
Output only. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. The input data can be one or more of the following: - Question specified by the last entry in `GenerateAnswerRequest.content` - Conversation history specified by the other entries in `GenerateAnswerRequest.content` - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or `GenerateAnswerRequest.inline_passages`)
Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.
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).
The response to an `EmbedContentRequest`.
Output only. The embedding generated from the input content.
Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.
Batch request to get embeddings from the model for a list of prompts.
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. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.
The response to a `BatchEmbedContentsRequest`.
Output only. The embeddings for each request, in the same order as provided in the batch request.
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.
Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.
Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`
Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.
Optional. The overall input given to the `Model`. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). `Model`s/`Content`s and `generate_content_request`s are mutually exclusive. You can either send `Model` + `Content`s or a `generate_content_request`, but never both.
A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.
The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative.
Number of tokens in the cached part of the prompt (the cached content).
Low-Latency bidirectional streaming API that supports audio and video streaming inputs can produce multimodal output streams (audio and text).
Messages sent by the client in the BidiGenerateContent call.
The type of the message.
Optional. Session configuration sent in the first and only first client message.
Optional. Incremental update of the current conversation delivered from the client.
Optional. User input that is sent in real time.
Optional. Response to a `ToolCallMessage` received from the server.
Response message for the BidiGenerateContent call.
The type of the message.
Output only. Sent in response to a `BidiGenerateContentSetup` message from the client when setup is complete.
Output only. Content generated by the model in response to client messages.
Output only. Request for the client to execute the `function_calls` and return the responses with the matching `id`s.
Output only. Notification for the client that a previously issued `ToolCallMessage` with the specified `id`s should be cancelled.
Provides methods for getting metadata information about Generative Models.
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.
Request for getting information about a specific Model.
Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`
Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.
Request for listing all Models.
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 `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.
Response from `ListModel` containing a paginated list of Models.
The returned Models.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
Gets information about a specific TunedModel.
Request for getting information about a specific Model.
Required. The resource name of the model. Format: `tunedModels/my-model-id`
Lists created tuned models.
Request for listing TunedModels.
Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.
Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.
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 Examples: "owner:me" returns all tuned models to which caller has owner role "readers:me" returns all tuned models to which caller has reader role "readers:everyone" returns all tuned models that are shared with everyone
Response from `ListTunedModels` containing a paginated list of Models.
The returned Models.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222
Request to create a TunedModel.
Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.
Required. The tuned model to create.
Updates a tuned model.
Request to update a TunedModel.
Required. The tuned model to update.
Optional. The list of fields to update.
Deletes a tuned model.
Request to delete a TunedModel.
Required. The resource name of the model. Format: `tunedModels/my-model-id`
Provides methods for managing permissions to PaLM API resources.
Create a permission to a specific resource.
Request to create a `Permission`.
Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`
Required. The permission to create.
Gets information about a specific Permission.
Request for getting information about a specific `Permission`.
Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`
Lists permissions for the specific resource.
Request for listing permissions.
Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`
Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.
Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.
Response from `ListPermissions` containing a paginated list of permissions.
Returned permissions.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
Updates the permission.
Request to update the `Permission`.
Required. The permission to update. The permission's `name` field is used to identify the permission to update.
Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)
Deletes the permission.
Request to delete the `Permission`.
Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`
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.
Request to transfer the ownership of the tuned model.
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.
Response from `TransferOwnership`.
(message has no fields)
A service for online predictions and explanations.
Performs a prediction request.
Request message for [PredictionService.Predict][google.ai.generativelanguage.v1alpha.PredictionService.Predict].
Required. The name of the model for prediction. Format: `name=models/{model}`.
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.
An API for semantic search over a corpus of user uploaded content.
Creates an empty `Corpus`.
Request to create a `Corpus`.
Required. The `Corpus` to create.
Gets information about a specific `Corpus`.
Request for getting information about a specific `Corpus`.
Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`
Updates a `Corpus`.
Request to update a `Corpus`.
Required. The `Corpus` to update.
Required. The list of fields to update. Currently, this only supports updating `display_name`.
Deletes a `Corpus`.
Request to delete a `Corpus`.
Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`
Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.
Lists all `Corpora` owned by the user.
Request for listing `Corpora`.
Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.
Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.
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.
Performs semantic search over a `Corpus`.
Request for querying a `Corpus`.
Required. The name of the `Corpus` to query. Example: `corpora/my-corpus-123`
Required. Query string to perform semantic search.
Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical "AND"s. Example query at document level: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = "document.custom_metadata.year" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = "document.custom_metadata.year" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = "document.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}]}] Example query at chunk level for a numeric range of values: (year > 2015 AND year <= 2020) `MetadataFilter` object list: metadata_filters = [ {key = "chunk.custom_metadata.year" conditions = [{int_value = 2015, operation = GREATER}]}, {key = "chunk.custom_metadata.year" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: "AND"s for the same key are only supported for numeric values. String values only support "OR"s for the same key.
Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.
Response from `QueryCorpus` containing a list of relevant chunks.
The relevant chunks.
Creates an empty `Document`.
Request to create a `Document`.
Required. The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`
Required. The `Document` to create.
Gets information about a specific `Document`.
Request for getting information about a specific `Document`.
Required. The name of the `Document` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc`
Updates a `Document`.
Request to update a `Document`.
Required. The `Document` to update.
Required. The list of fields to update. Currently, this only supports updating `display_name` and `custom_metadata`.
Deletes a `Document`.
Request to delete a `Document`.
Required. The resource name of the `Document` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc`
Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.
Lists all `Document`s in a `Corpus`.
Request for listing `Document`s.
Required. The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`
Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.
Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.
Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.
The returned `Document`s.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
Performs semantic search over a `Document`.
Request for querying a `Document`.
Required. The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`
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.
Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical "AND"s. Note: `Document`-level filtering is not supported for this request because a `Document` name is already specified. Example query: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = "chunk.custom_metadata.year" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}}, {key = "chunk.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}}] Example query for a numeric range of values: (year > 2015 AND year <= 2020) `MetadataFilter` object list: metadata_filters = [ {key = "chunk.custom_metadata.year" conditions = [{int_value = 2015, operation = GREATER}]}, {key = "chunk.custom_metadata.year" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: "AND"s for the same key are only supported for numeric values. String values only support "OR"s for the same key.
Response from `QueryDocument` containing a list of relevant chunks.
The returned relevant chunks.
Creates a `Chunk`.
Batch create `Chunk`s.
Request to batch create `Chunk`s.
Optional. The name of the `Document` where this batch of `Chunk`s will be created. The parent field in every `CreateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`
Required. The request messages specifying the `Chunk`s to create. A maximum of 100 `Chunk`s can be created in a batch.
Response from `BatchCreateChunks` containing a list of created `Chunk`s.
`Chunk`s created.
Gets information about a specific `Chunk`.
Request for getting information about a specific `Chunk`.
Required. The name of the `Chunk` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`
Updates a `Chunk`.
Batch update `Chunk`s.
Request to batch update `Chunk`s.
Optional. The name of the `Document` containing the `Chunk`s to update. The parent field in every `UpdateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`
Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch.
Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.
`Chunk`s updated.
Deletes a `Chunk`.
Batch delete `Chunk`s.
Request to batch delete `Chunk`s.
Optional. The name of the `Document` containing the `Chunk`s to delete. The parent field in every `DeleteChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`
Required. The request messages specifying the `Chunk`s to delete.
Lists all `Chunk`s in a `Document`.
Request for listing `Chunk`s.
Required. The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`
Optional. The maximum number of `Chunk`s to return (per page). The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum size limit is 100 `Chunk`s per page.
Optional. A page token, received from a previous `ListChunks` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListChunks` must match the call that provided the page token.
Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`.
The returned `Chunk`s.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
API for using Generative Language Models (GLMs) trained to generate text. Also known as Large Language Models (LLM)s, these generate text given an input prompt from the user.
Generates a response from the model given an input message.
Request to generate a text completion response from the model.
Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m
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 the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned the `getModel` function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model.
Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.
Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the `Model` specification.
Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function.
Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function.
Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service.
The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response.
The response from the model, including candidate completions.
Candidate responses from the model.
A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API).
Returns any safety feedback related to content filtering.
Generates an embedding from the model given an input message.
The response to a EmbedTextRequest.
Output only. The embedding generated from the input text.
Generates multiple embeddings from the model given input text in a synchronous call.
Batch request to get a text embedding from the model.
Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001
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 embeddings generated from the input text.
Runs a model's tokenizer on a text and returns the token count.
Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.
Required. The 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 free-form input text given to the model as a prompt.
A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.
The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.
Identifier for the source contributing to this attribution.
Used in:
Identifier for an inline passage.
Identifier for a `Chunk` fetched via Semantic Retriever.
Identifier for a part within a `GroundingPassage`.
Used in:
Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.
Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.
Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.
Used in:
Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`
Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`
Incremental update of the current conversation delivered from the client. All of the content here is unconditionally appended to the conversation history and used as part of the prompt to the model to generate content. A message here will interrupt any current model generation.
Used in:
Optional. The content appended to 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 and the latest request.
Optional. If true, indicates that the server content generation should start with the currently accumulated prompt. Otherwise, the server awaits additional messages before starting generation.
User input that is sent in real time. This is different from [BidiGenerateContentClientContent][google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent] in a few ways: - Can be sent continuously without interruption to model generation. - If there is a need to mix data interleaved across the [BidiGenerateContentClientContent][google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent] and the [BidiGenerateContentRealtimeInput][google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput], the server attempts to optimize for best response, but there are no guarantees. - End of turn is not explicitly specified, but is rather derived from user activity (for example, end of speech). - Even before the end of turn, the data is processed incrementally to optimize for a fast start of the response from the model. - Is always direct user input that is sent in real time. Can be sent continuously without interruptions. The model automatically detects the beginning and the end of user speech and starts or terminates streaming the response accordingly. Data is processed incrementally as it arrives, minimizing latency.
Used in:
Optional. Inlined bytes data for media input.
Incremental server update generated by the model in response to client messages. Content is generated as quickly as possible, and not in real time. Clients may choose to buffer and play it out in real time.
Used in:
Output only. The content that the model has generated as part of the current conversation with the user.
Output only. If true, indicates that the model is done generating. Generation will only start in response to additional client messages. Can be set alongside `content`, indicating that the `content` is the last in the turn.
Output only. If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in real time, this is a good signal to stop and empty the current playback queue.
Output only. Grounding metadata for the generated content.
Message to be sent in the first and only first `BidiGenerateContentClientMessage`. Contains configuration that will apply for the duration of the streaming RPC. Clients should wait for a `BidiGenerateContentSetupComplete` message before sending any additional messages.
Used in:
Required. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`
Optional. Generation config. The following fields are not supported: - `response_logprobs` - `response_mime_type` - `logprobs` - `response_schema` - `stop_sequence` - `routing_config` - `audio_timestamp`
Optional. The user provided system instructions for the model. Note: Only text should be used in parts and content in each part will be in a separate paragraph.
Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
Sent in response to a `BidiGenerateContentSetup` message from the client.
Used in:
(message has no fields)
Request for the client to execute the `function_calls` and return the responses with the matching `id`s.
Used in:
Output only. The function call to be executed.
Notification for the client that a previously issued `ToolCallMessage` with the specified `id`s should have been not executed and should be cancelled. If there were side-effects to those tool calls, clients may attempt to undo the tool calls. This message occurs only in cases where the clients interrupt server turns.
Used in:
Output only. The ids of the tool calls to be cancelled.
Client generated response to a `ToolCall` received from the server. Individual `FunctionResponse` objects are matched to the respective `FunctionCall` objects by the `id` field. Note that in the unary and server-streaming GenerateContent APIs function calling happens by exchanging the `Content` parts, while in the bidi GenerateContent APIs function calling happens over these dedicated set of messages.
Used in:
Optional. The response to the function calls.
Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.
Used in:
,The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).
Raw bytes for media formats.
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.
Used as response type in: CacheService.CreateCachedContent, CacheService.GetCachedContent, CacheService.UpdateCachedContent
Used as field type in:
, ,Specifies when this resource will expire.
Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.
Input only. New TTL for this resource, input only.
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.
Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`
Optional. Input only. Immutable. Developer set system instruction. Currently text only.
Optional. Input only. Immutable. The content to cache.
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. Creation time of the cache entry.
Output only. When the cache entry was last updated in UTC time.
Output only. Metadata on the usage of the cached content.
Metadata on the usage of the cached content.
Used in:
Total number of tokens that the cached content consumes.
A response candidate generated from the model.
Used in:
,Output only. Index of the candidate in the list of response candidates.
Output only. Generated content returned from the model.
Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
List of ratings for the safety of a response candidate. There is at most one rating per category.
Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are "recited" from copyrighted material in the foundational LLM's training data.
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. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.
Output only. Average log probability score of the candidate.
Output only. Log-likelihood scores for the response tokens and top tokens
Defines the reason why the model stopped generating tokens.
Used in:
Default value. This value is unused.
Natural stop point of the model or provided stop sequence.
The maximum number of tokens as specified in the request was reached.
The response candidate content was flagged for safety reasons.
The response candidate content was flagged for recitation reasons.
The response candidate content was flagged for using an unsupported language.
Unknown reason.
Token generation stopped because the content contains forbidden terms.
Token generation stopped for potentially containing prohibited content.
Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
The function call generated by the model is invalid.
Token generation stopped because generated images contain safety violations.
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.
Used as response type in: RetrieverService.CreateChunk, RetrieverService.GetChunk, RetrieverService.UpdateChunk
Used as field type in:
, , , , ,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.
Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20.
Output only. The Timestamp of when the `Chunk` was created.
Output only. The Timestamp of when the `Chunk` was last updated.
Output only. Current state of the `Chunk`.
States for the lifecycle of a `Chunk`.
Used in:
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.
Extracted data that represents the `Chunk` content.
Used in:
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.
Used in:
, ,Citations to sources for a specific response.
A citation to a source for a portion of a specific response.
Used in:
Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.
Optional. End of the attributed segment, exclusive.
Optional. URI that is attributed as a source for a portion of the text.
Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.
Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.
Used in:
(message has no fields)
Result of executing the `ExecutableCode`. Only generated when using the `CodeExecution`, and always follows a `part` containing the `ExecutableCode`.
Used in:
Required. Outcome of the code execution.
Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
Enumeration of possible outcomes of the code execution.
Used in:
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.
Filter condition applicable to a single key.
Used in:
The value type must be consistent with the value type defined in the field for the corresponding key. If the value types are not consistent, the result will be an empty set. When the `CustomMetadata` has a `StringList` value type, the filtering condition should use `string_value` paired with an INCLUDES/EXCLUDES operation, otherwise the result will also be an empty set.
The string value to filter the metadata on.
The numeric value to filter the metadata on.
Required. Operator applied to the given key-value pair to trigger the condition.
Defines the valid operators that can be applied to a key-value pair.
Used in:
The default value. This value is unused.
Supported by numeric.
Supported by numeric.
Supported by numeric & string.
Supported by numeric.
Supported by numeric.
Supported by numeric & string.
Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.
Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.
The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
Used in:
, , , , , , , , , , ,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.
A list of floats representing an embedding.
Used in:
,The embedding values.
Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.
Used in:
,The reason content was blocked during request processing.
A string that describes the filtering behavior in more detail.
A list of reasons why content may have been blocked.
Used in:
A blocked reason was not specified.
Content was blocked by safety settings.
Content was blocked, but the reason is uncategorized.
A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.
Used as response type in: RetrieverService.CreateCorpus, RetrieverService.GetCorpus, RetrieverService.UpdateCorpus
Used as field type in:
, ,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.
Request to create a `Chunk`.
Used as request type in: RetrieverService.CreateChunk
Used as field type in:
Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`
Required. The `Chunk` to create.
Metadata about the state and progress of creating a tuned model returned from the long-running operation
Name of the tuned model associated with the tuning operation.
The total number of tuning steps.
The number of steps completed.
The completed percentage for the tuning operation.
Metrics collected during tuning.
User provided metadata stored as key-value pairs.
Used in:
,The string value of the metadata to store.
The StringList value of the metadata to store.
The numeric value of the metadata to store.
Required. The key of the metadata to store.
Dataset for training or validation.
Used in:
Inline data or a reference to the data.
Optional. Inline examples with simple input/output text.
Request to delete a `Chunk`.
Used as request type in: RetrieverService.DeleteChunk
Used as field type in:
Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`
A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.
Used as response type in: RetrieverService.CreateDocument, RetrieverService.GetDocument, RetrieverService.UpdateDocument
Used as field type in:
, ,Immutable. Identifier. The `Document` resource name. The ID (name excluding the "corpora/*/documents/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`
Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation"
Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.
Output only. The Timestamp of when the `Document` was last updated.
Output only. The Timestamp of when the `Document` was created.
Describes the options to customize dynamic retrieval.
Used in:
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.
The mode of the predictor to be used in dynamic retrieval.
Used in:
Always trigger retrieval.
Run retrieval only when system decides it is necessary.
Request containing the `Content` for the model to embed.
Used as request type in: GenerativeService.EmbedContent
Used as field type in:
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 only. You cannot set this value if using the earlier model (`models/embedding-001`).
Request to get a text embedding from the model.
Used as request type in: TextService.EmbedText
Used as field type in:
Required. The model name to use with the format model=models/{model}.
Optional. The free-form input text that the model will turn into an embedding.
A list of floats representing the embedding.
Used in:
,The embedding values.
An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.
Used in:
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.
Used in:
Required. Programming language of the `code`.
Required. The code to be executed.
Supported programming languages for the generated code.
Used in:
Unspecified language. This value should not be used.
Python >= 3.10, with numpy and simpy available.
A file uploaded to the API. Next ID: 15
Used as response type in: FileService.GetFile
Used as field type in:
, ,Metadata for the File.
Output only. Metadata for a video.
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.
Output only. The timestamp of when the `File` was last updated.
Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.
Output only. SHA-256 hash of the uploaded bytes.
Output only. The uri of the `File`.
Output only. Processing state of the File.
Output only. Error status if File processing failed.
States for the lifecycle of a File.
Used in:
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.
URI based data.
Used in:
Optional. The IANA standard MIME type of the source data.
Required. URI.
A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.
Used in:
,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`.
Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.
Optional. The function parameters and values in JSON object format.
Configuration for specifying function calling behavior.
Used in:
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.
Defines the execution behavior for function calling by defining the execution mode.
Used in:
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.
Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.
Used in:
Required. The name of the function. 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.
Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.
Optional. Describes the 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 from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.
Used in:
,Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.
Required. The function response in JSON object format.
Style for grounded answers.
Used in:
Unspecified answer style.
Succint 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.
Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question.
Used in:
Optional. If set, the input was blocked and no candidates are returned. Rephrase the input.
Ratings for safety of the input. There is at most one rating per category.
Specifies what was the reason why input was blocked.
Used in:
Default value. This value is unused.
Input was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.
Input was blocked due to other reasons.
Request to generate a completion from the model.
Used as request type in: GenerativeService.GenerateContent, GenerativeService.StreamGenerateContent
Used as field type in:
Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.
Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
Optional. Tool configuration for any `Tool` specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example.
Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
Optional. Configuration options for model generation and outputs.
Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`.
Used as response type in: GenerativeService.GenerateContent, GenerativeService.StreamGenerateContent
Candidate responses from the model.
Returns the prompt's feedback related to the content filters.
Output only. Metadata on the generation requests' token usage.
Output only. The model version used to generate the response.
A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.
Used in:
Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.
Ratings for safety of the prompt. There is at most one rating per category.
Specifies the reason why the prompt was blocked.
Used in:
Default value. This value is unused.
Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.
Prompt was blocked due to unknown reasons.
Prompt was blocked due to the terms which are included from the terminology blocklist.
Prompt was blocked due to prohibited content.
Candidates blocked due to unsafe image generation content.
Metadata on the generation request's token usage.
Used in:
Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.
Number of tokens in the cached part of the prompt (the cached content)
Total number of tokens across all the generated response candidates.
Total token count for the generation request (prompt + response candidates).
Configuration options for model generation and outputs. Not all parameters are configurable for every model.
Used in:
,Optional. Number of generated responses to return. Currently, this value can only be set to 1. If unset, this will default to 1.
Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response.
Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.
Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0].
Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.
Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.
Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types.
Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible `response_mime_type` must also be set. Compatible MIME types: `application/json`: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details.
Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use [frequency_penalty][google.ai.generativelanguage.v1alpha.GenerationConfig.frequency_penalty] for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.
Optional. 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 dificult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the [max_output_tokens][google.ai.generativelanguage.v1alpha.GenerationConfig.max_output_tokens] limit.
Optional. If true, export the logprobs results in response.
Optional. Only valid if [response_logprobs=True][google.ai.generativelanguage.v1alpha.GenerationConfig.response_logprobs]. This sets the number of top logprobs to return at each decoding step in the [Candidate.logprobs_result][google.ai.generativelanguage.v1alpha.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.
Supported modalities of the response.
Used in:
Default value.
Indicates the model should return text.
Indicates the model should return images.
Indicates the model should return audio.
Tool to retrieve public web data for grounding, powered by Google.
Used in:
Specifies the dynamic retrieval configuration for the given source.
Attribution for a source that contributed to an answer.
Used in:
Output only. Identifier for the source contributing to this attribution.
Grounding source content that makes up this attribution.
Grounding chunk.
Used in:
Chunk type.
Grounding chunk from the web.
Chunk from the web.
Used in:
URI reference of the chunk.
Title of the chunk.
Metadata returned to client when grounding is enabled.
Used in:
,Optional. Google search entry for the following-up web searches.
List of supporting references retrieved from specified grounding source.
List of grounding support.
Metadata related to retrieval in the grounding flow.
Web search queries for the following-up web search.
Passage included inline with a grounding configuration.
Used in:
Identifier for the passage for attributing this passage in grounded answers.
Content of the passage.
A repeated list of passages.
Used in:
List of passages.
Grounding support.
Used in:
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.
The category of a rating. These categories cover various kinds of harms that developers may wish to adjust.
Used in:
,Category is unspecified.
**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.
**PaLM** - Content that is rude, disrespectful, or profane.
**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.
**PaLM** - Contains references to sexual acts or other lewd content.
**PaLM** - Promotes unchecked medical advice.
**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.
**Gemini** - Harassment content.
**Gemini** - Hate speech and content.
**Gemini** - Sexually explicit content.
**Gemini** - Dangerous content.
**Gemini** - Content that may be used to harm civic integrity.
Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance
Used in:
Options for specifying learning rate during tuning.
Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.
Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.
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.
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.
Logprobs Result
Used in:
Length = total number of decoding steps.
Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.
Candidate for the logprobs token and score.
Used in:
,The candidate’s token string value.
The candidate’s token id value.
The candidate's log probability.
Candidates with top log probabilities at each decoding step.
Used in:
Sorted by log probability in descending order.
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.
Used in:
, ,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.
Used in:
,Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: "Translate the phrase from English to French." or "Given a statement, classify the sentiment as happy, sad or neutral." Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated.
Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`.
Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.
User provided filter to limit retrieval based on `Chunk` or `Document` level metadata values. Example (genre = drama OR genre = action): key = "document.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}]
Used in:
, ,Required. The key of the metadata to filter on.
Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.
Information about a Generative Language Model.
Used as response type in: ModelService.GetModel
Used as field type in:
Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * "{base_model_id}-{version}" Examples: * `models/gemini-1.5-flash-001`
Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`
Required. The version number of the model. This represents the major version (`1.0` or `1.5`)
The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters.
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 corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.
Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.
The maximum temperature this model can use.
For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.
For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.
A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
Used in:
Inline text.
Inline media bytes.
A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.
The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.
URI based data.
Code generated by the model that is meant to be executed.
Result of executing the `ExecutableCode`.
Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete
Used as response type in: PermissionService.CreatePermission, PermissionService.GetPermission, PermissionService.UpdatePermission
Used as field type in:
, ,Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.
Optional. Immutable. The type of the grantee.
Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.
Required. The role granted by this permission.
Defines types of the grantee of this permission.
Used in:
The default value. This value is unused.
Represents a user. When set, you must provide email_address for the user.
Represents a group. When set, you must provide email_address for the group.
Represents access to everyone. No extra information is required.
Defines the role granted by this permission.
Used in:
The default value. This value is unused.
Owner can use, update, share and delete the resource.
Writer can use, update and share the resource.
Reader can use the resource.
The configuration for the prebuilt speaker to use.
Used in:
The name of the preset voice to use.
The information for a chunk relevant to a query.
Used in:
,`Chunk` relevance to the query.
`Chunk` associated with the query.
Metadata related to retrieval in the grounding flow.
Used in:
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.
Used in:
Safety rating evaluated from content.
Safety settings applied to the request.
Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.
Used in:
, , , ,Required. The category for this rating.
Required. The probability of harm for this content.
Was this content blocked because of this rating?
The probability that a piece of content is harmful. The classification system gives the probability of the content being unsafe. This does not indicate the severity of harm for a piece of content.
Used in:
Probability is unspecified.
Content has a negligible chance of being unsafe.
Content has a low chance of being unsafe.
Content has a medium chance of being unsafe.
Content has a high chance of being unsafe.
Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.
Used in:
, , ,Required. The category for this setting.
Required. Controls the probability threshold at which harm is blocked.
Block at and beyond a specified harm probability.
Used in:
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 `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).
Used in:
,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
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. 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. 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. Properties of Type.OBJECT.
Optional. Required properties of Type.OBJECT.
Google search entry point.
Used in:
Optional. Web content snippet that can be embedded in a web page or an app webview.
Optional. Base64 encoded JSON representing array of <search term, search url> tuple.
Segment of the content.
Used in:
Output only. The index of a Part object within its parent Content object.
Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.
Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.
Output only. The text corresponding to the segment from the response.
Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.
Used in:
Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`.
Required. Query to use for matching `Chunk`s in the given resource by similarity.
Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.
Optional. Maximum number of relevant `Chunk`s to retrieve.
Optional. Minimum relevance score for retrieved relevant `Chunk`s.
The speech generation config.
Used in:
The configuration for the speaker to use.
User provided string values assigned to a single metadata key.
Used in:
The string values of the metadata to store.
Type of task for which the embedding will be used.
Used in:
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.
Output text returned from a model.
Used in:
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`.
Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.
Used in:
,Required. The prompt text.
Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
Used in:
, ,Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a [FunctionCall][google.ai.generativelanguage.v1alpha.Part.function_call] with arguments to the client side for execution. The model may decide to call a subset of these functions by populating [FunctionCall][google.ai.generativelanguage.v1alpha.Part.function_call] in the response. The next conversation turn may contain a [FunctionResponse][google.ai.generativelanguage.v1alpha.Part.function_response] with the [Content.role][google.ai.generativelanguage.v1alpha.Content.role] "function" generation context for the next model turn.
Optional. Retrieval tool that is powered by Google search.
Optional. Enables the model to execute code as part of generation.
Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
Used in:
(message has no fields)
The Tool configuration containing parameters for specifying `Tool` use in the request.
Used in:
,Optional. Function calling config.
A fine-tuned model created using ModelService.CreateTunedModel.
Used as response type in: ModelService.GetTunedModel, ModelService.UpdateTunedModel
Used as field type in:
, ,The model used as the starting point for tuning.
Optional. TunedModel to use as the starting point for training the new model.
Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`
Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`
Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces.
Optional. A short description of this model.
Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.
Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.
Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.
Output only. The state of the tuned model.
Output only. The timestamp when this model was created.
Output only. The timestamp when this model was updated.
Required. The tuning task that creates the tuned model.
Optional. List of project numbers that have read access to the tuned model.
The state of the tuned model.
Used in:
The default value. This value is unused.
The model is being created.
The model is ready to be used.
The model failed to be created.
Tuned model as a source for training a new model.
Used in:
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/gemini-1.5-flash-001`
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.
Used in:
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.
A single example for tuning.
Used in:
The input to the model for this example.
Optional. Text model input.
Required. The expected model output.
A set of tuning examples. Can be training or validation data.
Used in:
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 tuning example with multiturn input.
Used in:
Optional. Developer set system instructions. Currently, text only.
Each Content represents a turn in the conversation.
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`.
Used in:
Data for the part. Only text supported.
Inline text.
Record for a single tuning step.
Used in:
,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.
Tuning tasks that create tuned models.
Used in:
Output only. The timestamp when tuning this model started.
Output only. The timestamp when tuning this model completed.
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.
Type contains the list of OpenAPI data types as defined by https://spec.openapis.org/oas/v3.0.3#data-types
Used in:
Not specified, should not be used.
String type.
Number type.
Integer type.
Boolean type.
Array type.
Object type.
Request to update a `Chunk`.
Used as request type in: RetrieverService.UpdateChunk
Used as field type in:
Required. The `Chunk` to update.
Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.
Metadata for a video `File`.
Used in:
Duration of the video.
The configuration for the voice to use.
Used in:
The configuration for the speaker to use.
The configuration for the prebuilt voice to use.