diff --git a/samples/REST.Playground/discovery.json b/samples/REST.Playground/discovery.json index 19c08e3..e7e7416 100644 --- a/samples/REST.Playground/discovery.json +++ b/samples/REST.Playground/discovery.json @@ -1,2108 +1,1292 @@ { - "title": "Generative Language API", - "fullyEncodeReservedExpansion": true, - "discoveryVersion": "v1", - "servicePath": "", - "canonicalName": "Generative Language", - "basePath": "", - "resources": { - "media": { - "methods": { - "upload": { - "parameterOrder": [], - "id": "generativelanguage.media.upload", - "httpMethod": "POST", - "request": { - "$ref": "CreateFileRequest" - }, - "flatPath": "v1beta/files", - "description": "Creates a `File`.", - "supportsMediaUpload": true, - "response": { - "$ref": "CreateFileResponse" - }, - "mediaUpload": { - "maxSize": "2147483648", - "accept": [ - "*/*" - ], - "protocols": { - "resumable": { - "path": "/resumable/upload/v1beta/files", - "multipart": true - }, - "simple": { - "multipart": true, - "path": "/upload/v1beta/files" - } - } + "version": "v1beta", + "baseUrl": "https://generativelanguage.googleapis.com/", + "documentationLink": "https://developers.generativeai.google/api", + "parameters": { + "alt": { + "description": "Data format for response.", + "default": "json", + "location": "query", + "type": "string", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ] + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", + "location": "query", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "type": "string", + "enum": [ + "1", + "2" + ] + }, + "callback": { + "location": "query", + "type": "string", + "description": "JSONP" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "key": { + "type": "string", + "location": "query", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token." + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "access_token": { + "location": "query", + "type": "string", + "description": "OAuth access token." + } + }, + "id": "generativelanguage:v1beta", + "schemas": { + "QueryCorpusResponse": { + "id": "QueryCorpusResponse", + "description": "Response from `QueryCorpus` containing a list of relevant chunks.", + "properties": { + "relevantChunks": { + "description": "The relevant chunks.", + "items": { + "$ref": "RelevantChunk" }, - "path": "v1beta/files", - "parameters": {} + "type": "array" } - } + }, + "type": "object" }, - "files": { - "methods": { - "delete": { - "response": { - "$ref": "Empty" - }, - "path": "v1beta/{+name}", - "httpMethod": "DELETE", - "parameters": { - "name": { - "required": true, - "pattern": "^files/[^/]+$", - "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", - "type": "string", - "location": "path" - } - }, - "description": "Deletes the `File`.", - "flatPath": "v1beta/files/{filesId}", - "parameterOrder": [ - "name" - ], - "id": "generativelanguage.files.delete" + "SafetyRating": { + "id": "SafetyRating", + "description": "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.", + "properties": { + "blocked": { + "type": "boolean", + "description": "Was this content blocked because of this rating?" }, - "list": { - "description": "Lists the metadata for `File`s owned by the requesting project.", - "flatPath": "v1beta/files", - "id": "generativelanguage.files.list", - "parameters": { - "pageSize": { - "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.", - "type": "integer", - "format": "int32", - "location": "query" - }, - "pageToken": { - "description": "Optional. A page token from a previous `ListFiles` call.", - "type": "string", - "location": "query" - } - }, - "path": "v1beta/files", - "parameterOrder": [], - "httpMethod": "GET", - "response": { - "$ref": "ListFilesResponse" - } + "category": { + "description": "Required. The category for this rating.", + "enum": [ + "HARM_CATEGORY_UNSPECIFIED", + "HARM_CATEGORY_DEROGATORY", + "HARM_CATEGORY_TOXICITY", + "HARM_CATEGORY_VIOLENCE", + "HARM_CATEGORY_SEXUAL", + "HARM_CATEGORY_MEDICAL", + "HARM_CATEGORY_DANGEROUS", + "HARM_CATEGORY_HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH", + "HARM_CATEGORY_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_DANGEROUS_CONTENT" + ], + "type": "string", + "enumDescriptions": [ + "Category is unspecified.", + "Negative or harmful comments targeting identity and/or protected attribute.", + "Content that is rude, disrespectful, or profane.", + "Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", + "Contains references to sexual acts or other lewd content.", + "Promotes unchecked medical advice.", + "Dangerous content that promotes, facilitates, or encourages harmful acts.", + "Harasment content.", + "Hate speech and content.", + "Sexually explicit content.", + "Dangerous content." + ] }, - "get": { - "flatPath": "v1beta/files/{filesId}", - "httpMethod": "GET", - "id": "generativelanguage.files.get", - "path": "v1beta/{+name}", - "response": { - "$ref": "File" - }, - "parameterOrder": [ - "name" + "probability": { + "enum": [ + "HARM_PROBABILITY_UNSPECIFIED", + "NEGLIGIBLE", + "LOW", + "MEDIUM", + "HIGH" ], - "parameters": { - "name": { - "pattern": "^files/[^/]+$", - "required": true, - "location": "path", - "type": "string", - "description": "Required. The name of the `File` to get. Example: `files/abc-123`" - } - }, - "description": "Gets the metadata for the given `File`." + "type": "string", + "enumDescriptions": [ + "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." + ], + "description": "Required. The probability of harm for this content." } - } + }, + "type": "object" }, - "tunedModels": { - "resources": { - "permissions": { - "methods": { - "list": { - "id": "generativelanguage.tunedModels.permissions.list", - "response": { - "$ref": "ListPermissionsResponse" - }, - "parameterOrder": [ - "parent" - ], - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", - "description": "Lists permissions for the specific resource.", - "parameters": { - "pageToken": { - "description": "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.", - "location": "query", - "type": "string" - }, - "parent": { - "type": "string", - "required": true, - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "location": "path", - "pattern": "^tunedModels/[^/]+$" - }, - "pageSize": { - "type": "integer", - "description": "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.", - "location": "query", - "format": "int32" - } - }, - "path": "v1beta/{+parent}/permissions", - "httpMethod": "GET" - }, - "patch": { - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "parameters": { - "updateMask": { - "type": "string", - "location": "query", - "format": "google-fieldmask", - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)" - }, - "name": { - "required": true, - "location": "path", - "type": "string", - "description": "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.", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" - } - }, - "response": { - "$ref": "Permission" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", - "description": "Updates the permission.", - "request": { - "$ref": "Permission" - }, - "id": "generativelanguage.tunedModels.permissions.patch", - "httpMethod": "PATCH" - }, - "get": { - "httpMethod": "GET", - "description": "Gets information about a specific Permission.", - "id": "generativelanguage.tunedModels.permissions.get", - "path": "v1beta/{+name}", - "response": { - "$ref": "Permission" - }, - "parameters": { - "name": { - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", - "required": true, - "location": "path", - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "type": "string" - } - }, - "parameterOrder": [ - "name" - ], - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}" - }, - "create": { - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "location": "path", - "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "required": true, - "pattern": "^tunedModels/[^/]+$", - "type": "string" - } - }, - "description": "Create a permission to a specific resource.", - "httpMethod": "POST", - "path": "v1beta/{+parent}/permissions", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", - "request": { - "$ref": "Permission" - }, - "id": "generativelanguage.tunedModels.permissions.create", - "response": { - "$ref": "Permission" - } - }, - "delete": { - "response": { - "$ref": "Empty" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", - "parameters": { - "name": { - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", - "location": "path", - "required": true, - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "type": "string" - } - }, - "httpMethod": "DELETE", - "description": "Deletes the permission.", - "id": "generativelanguage.tunedModels.permissions.delete", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ] - } - } - } - }, - "methods": { - "generateText": { - "request": { - "$ref": "GenerateTextRequest" - }, - "response": { - "$ref": "GenerateTextResponse" - }, - "parameters": { - "model": { - "pattern": "^tunedModels/[^/]+$", - "location": "path", - "required": true, - "type": "string", - "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m" - } - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText", - "description": "Generates a response from the model given an input message.", - "httpMethod": "POST", - "parameterOrder": [ - "model" + "Condition": { + "id": "Condition", + "properties": { + "operation": { + "enum": [ + "OPERATOR_UNSPECIFIED", + "LESS", + "LESS_EQUAL", + "EQUAL", + "GREATER_EQUAL", + "GREATER", + "NOT_EQUAL", + "INCLUDES", + "EXCLUDES" ], - "id": "generativelanguage.tunedModels.generateText", - "path": "v1beta/{+model}:generateText" + "description": "Required. Operator applied to the given key-value pair to trigger the condition.", + "type": "string", + "enumDescriptions": [ + "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`." + ] }, - "list": { - "response": { - "$ref": "ListTunedModelsResponse" + "stringValue": { + "type": "string", + "description": "The string value to filter the metadata on." + }, + "numericValue": { + "type": "number", + "description": "The numeric value to filter the metadata on.", + "format": "float" + } + }, + "type": "object", + "description": "Filter condition applicable to a single key." + }, + "BatchCreateChunksResponse": { + "description": "Response from `BatchCreateChunks` containing a list of created `Chunk`s.", + "id": "BatchCreateChunksResponse", + "properties": { + "chunks": { + "items": { + "$ref": "Chunk" }, - "parameterOrder": [], - "flatPath": "v1beta/tunedModels", - "httpMethod": "GET", - "path": "v1beta/tunedModels", - "description": "Lists tuned models owned by the user.", - "id": "generativelanguage.tunedModels.list", - "parameters": { - "pageSize": { - "type": "integer", - "format": "int32", - "location": "query", - "description": "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." - }, - "pageToken": { - "type": "string", - "description": "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.", - "location": "query" - }, - "filter": { - "type": "string", - "description": "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", - "location": "query" - } + "type": "array", + "description": "`Chunk`s created." + } + }, + "type": "object" + }, + "TransferOwnershipResponse": { + "description": "Response from `TransferOwnership`.", + "type": "object", + "properties": {}, + "id": "TransferOwnershipResponse" + }, + "TuningTask": { + "type": "object", + "description": "Tuning tasks that create tuned models.", + "properties": { + "snapshots": { + "description": "Output only. Metrics collected during tuning.", + "readOnly": true, + "type": "array", + "items": { + "$ref": "TuningSnapshot" } }, - "generateContent": { - "parameters": { - "model": { - "pattern": "^tunedModels/[^/]+$", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", - "type": "string", - "location": "path", - "required": true - } - }, - "request": { - "$ref": "GenerateContentRequest" - }, - "description": "Generates a response from the model given an input `GenerateContentRequest`.", - "parameterOrder": [ - "model" - ], - "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent", - "response": { - "$ref": "GenerateContentResponse" - }, - "path": "v1beta/{+model}:generateContent", - "id": "generativelanguage.tunedModels.generateContent", - "httpMethod": "POST" + "hyperparameters": { + "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.", + "$ref": "Hyperparameters" }, - "delete": { - "response": { - "$ref": "Empty" - }, - "description": "Deletes a tuned model.", - "parameters": { - "name": { - "location": "path", - "required": true, - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`" - } - }, - "httpMethod": "DELETE", - "id": "generativelanguage.tunedModels.delete", - "path": "v1beta/{+name}", - "flatPath": "v1beta/tunedModels/{tunedModelsId}", - "parameterOrder": [ - "name" - ] - }, - "transferOwnership": { - "parameters": { - "name": { - "type": "string", - "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", - "required": true, - "pattern": "^tunedModels/[^/]+$", - "location": "path" - } - }, - "path": "v1beta/{+name}:transferOwnership", - "parameterOrder": [ - "name" - ], - "request": { - "$ref": "TransferOwnershipRequest" - }, - "httpMethod": "POST", - "response": { - "$ref": "TransferOwnershipResponse" - }, - "description": "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.", - "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership", - "id": "generativelanguage.tunedModels.transferOwnership" + "trainingData": { + "description": "Required. Input only. Immutable. The model training data.", + "$ref": "Dataset" }, - "create": { - "httpMethod": "POST", - "description": "Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", - "path": "v1beta/tunedModels", - "parameters": { - "tunedModelId": { - "location": "query", - "description": "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])?.", - "type": "string" - } - }, - "parameterOrder": [], - "flatPath": "v1beta/tunedModels", - "request": { - "$ref": "TunedModel" - }, - "response": { - "$ref": "Operation" - }, - "id": "generativelanguage.tunedModels.create" + "completeTime": { + "type": "string", + "readOnly": true, + "format": "google-datetime", + "description": "Output only. The timestamp when tuning this model completed." }, - "patch": { - "response": { - "$ref": "TunedModel" - }, - "request": { - "$ref": "TunedModel" - }, - "path": "v1beta/{+name}", - "description": "Updates a tuned model.", - "id": "generativelanguage.tunedModels.patch", - "httpMethod": "PATCH", - "parameterOrder": [ - "name" - ], - "parameters": { - "updateMask": { - "format": "google-fieldmask", - "type": "string", - "description": "Required. The list of fields to update.", - "location": "query" - }, - "name": { - "description": "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\"", - "pattern": "^tunedModels/[^/]+$", - "required": true, - "location": "path", - "type": "string" - } + "startTime": { + "format": "google-datetime", + "readOnly": true, + "type": "string", + "description": "Output only. The timestamp when tuning this model started." + } + }, + "id": "TuningTask" + }, + "CountTokensResponse": { + "type": "object", + "id": "CountTokensResponse", + "properties": { + "totalTokens": { + "type": "integer", + "format": "int32", + "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative." + } + }, + "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`." + }, + "GenerateContentResponse": { + "properties": { + "candidates": { + "type": "array", + "items": { + "$ref": "Candidate" }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}" + "description": "Candidate responses from the model." }, - "get": { - "httpMethod": "GET", - "flatPath": "v1beta/tunedModels/{tunedModelsId}", - "description": "Gets information about a specific TunedModel.", - "id": "generativelanguage.tunedModels.get", - "parameters": { - "name": { - "type": "string", - "pattern": "^tunedModels/[^/]+$", - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "TunedModel" - }, - "path": "v1beta/{+name}" + "promptFeedback": { + "description": "Returns the prompt's feedback related to the content filters.", + "$ref": "PromptFeedback" } - } + }, + "type": "object", + "id": "GenerateContentResponse", + "description": "Response from the model supporting multiple candidates. Note on safety ratings and content filtering. They are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API contract is that: - either all requested candidates are returned or no candidates at all - no candidates are returned only if there was something wrong with the prompt (see `prompt_feedback`) - feedback on each candidate is reported on `finish_reason` and `safety_ratings`." }, - "models": { - "methods": { - "embedContent": { - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "required": true, - "description": "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}`", - "type": "string", - "location": "path" - } - }, - "httpMethod": "POST", - "flatPath": "v1beta/models/{modelsId}:embedContent", - "id": "generativelanguage.models.embedContent", - "request": { - "$ref": "EmbedContentRequest" - }, - "response": { - "$ref": "EmbedContentResponse" - }, - "path": "v1beta/{+model}:embedContent", - "parameterOrder": [ - "model" + "Chunk": { + "properties": { + "state": { + "description": "Output only. Current state of the `Chunk`.", + "type": "string", + "enumDescriptions": [ + "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." + ], + "enum": [ + "STATE_UNSPECIFIED", + "STATE_PENDING_PROCESSING", + "STATE_ACTIVE", + "STATE_FAILED" ], - "description": "Generates an embedding from the model given an input `Content`." + "readOnly": true }, - "generateAnswer": { - "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.", - "required": true, - "location": "path", - "pattern": "^models/[^/]+$", - "type": "string" - } - }, - "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", - "path": "v1beta/{+model}:generateAnswer", - "response": { - "$ref": "GenerateAnswerResponse" - }, - "httpMethod": "POST", - "request": { - "$ref": "GenerateAnswerRequest" - }, - "id": "generativelanguage.models.generateAnswer", - "flatPath": "v1beta/models/{modelsId}:generateAnswer", - "parameterOrder": [ - "model" - ] + "data": { + "description": "Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043.", + "$ref": "ChunkData" }, - "batchEmbedText": { - "parameterOrder": [ - "model" - ], - "flatPath": "v1beta/models/{modelsId}:batchEmbedText", - "description": "Generates multiple embeddings from the model given input text in a synchronous call.", - "path": "v1beta/{+model}:batchEmbedText", - "response": { - "$ref": "BatchEmbedTextResponse" - }, - "request": { - "$ref": "BatchEmbedTextRequest" - }, - "id": "generativelanguage.models.batchEmbedText", - "httpMethod": "POST", - "parameters": { - "model": { - "location": "path", - "pattern": "^models/[^/]+$", - "required": true, - "type": "string", - "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001" - } - } + "updateTime": { + "format": "google-datetime", + "description": "Output only. The Timestamp of when the `Chunk` was last updated.", + "type": "string", + "readOnly": true }, - "embedText": { - "httpMethod": "POST", - "path": "v1beta/{+model}:embedText", - "parameterOrder": [ - "model" - ], - "description": "Generates an embedding from the model given an input message.", - "request": { - "$ref": "EmbedTextRequest" + "customMetadata": { + "description": "Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20.", + "items": { + "$ref": "CustomMetadata" }, - "parameters": { - "model": { - "type": "string", - "description": "Required. The model name to use with the format model=models/{model}.", - "pattern": "^models/[^/]+$", - "required": true, - "location": "path" - } - }, - "id": "generativelanguage.models.embedText", - "flatPath": "v1beta/models/{modelsId}:embedText", - "response": { - "$ref": "EmbedTextResponse" - } + "type": "array" }, - "list": { - "parameters": { - "pageToken": { - "location": "query", - "type": "string", - "description": "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." - }, - "pageSize": { - "format": "int32", - "location": "query", - "description": "The maximum number of `Models` to return (per page). The service may return fewer models. If unspecified, at most 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.", - "type": "integer" - } - }, - "path": "v1beta/models", - "flatPath": "v1beta/models", - "description": "Lists models available through the API.", - "parameterOrder": [], - "response": { - "$ref": "ListModelsResponse" - }, - "httpMethod": "GET", - "id": "generativelanguage.models.list" + "createTime": { + "type": "string", + "format": "google-datetime", + "readOnly": true, + "description": "Output only. The Timestamp of when the `Chunk` was created." }, - "generateText": { - "flatPath": "v1beta/models/{modelsId}:generateText", - "path": "v1beta/{+model}:generateText", - "response": { - "$ref": "GenerateTextResponse" - }, - "id": "generativelanguage.models.generateText", - "httpMethod": "POST", - "request": { - "$ref": "GenerateTextRequest" - }, - "parameters": { - "model": { - "type": "string", - "pattern": "^models/[^/]+$", - "required": true, - "location": "path", - "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m" - } + "name": { + "description": "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`", + "type": "string" + } + }, + "type": "object", + "description": "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.", + "id": "Chunk" + }, + "Blob": { + "properties": { + "mimeType": { + "description": "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).", + "type": "string" + }, + "data": { + "description": "Raw bytes for media formats.", + "type": "string", + "format": "byte" + } + }, + "id": "Blob", + "type": "object", + "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field." + }, + "ListDocumentsResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + }, + "documents": { + "type": "array", + "items": { + "$ref": "Document" }, - "description": "Generates a response from the model given an input message.", - "parameterOrder": [ - "model" - ] + "description": "The returned `Document`s." + } + }, + "id": "ListDocumentsResponse", + "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`." + }, + "GenerateAnswerResponse": { + "type": "object", + "id": "GenerateAnswerResponse", + "properties": { + "answer": { + "$ref": "Candidate", + "description": "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`." }, - "generateMessage": { - "id": "generativelanguage.models.generateMessage", - "path": "v1beta/{+model}:generateMessage", - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "location": "path", - "description": "Required. The name of the model to use. Format: `name=models/{model}`.", - "type": "string", - "required": true - } + "answerableProbability": { + "description": "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, some clients may wish 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 clients’ use cases. 0.5 is a good starting threshold.", + "format": "float", + "type": "number", + "readOnly": true + }, + "inputFeedback": { + "description": "Output only. Feedback related to the input data used to answer the question, as opposed to model-generated response to the question. \"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`)", + "$ref": "InputFeedback", + "readOnly": true + } + }, + "description": "Response from the model for a grounded answer." + }, + "Example": { + "id": "Example", + "type": "object", + "properties": { + "output": { + "$ref": "Message", + "description": "Required. An example of what the model should output given the input." + }, + "input": { + "$ref": "Message", + "description": "Required. An example of an input `Message` from the user." + } + }, + "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response." + }, + "Embedding": { + "id": "Embedding", + "properties": { + "value": { + "items": { + "format": "float", + "type": "number" }, - "parameterOrder": [ - "model" - ], - "response": { - "$ref": "GenerateMessageResponse" + "type": "array", + "description": "The embedding values." + } + }, + "type": "object", + "description": "A list of floats representing the embedding." + }, + "GenerateAnswerRequest": { + "properties": { + "temperature": { + "description": "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.", + "type": "number", + "format": "float" + }, + "contents": { + "items": { + "$ref": "Content" }, - "httpMethod": "POST", - "flatPath": "v1beta/models/{modelsId}:generateMessage", - "description": "Generates a response from the model given an input `MessagePrompt`.", - "request": { - "$ref": "GenerateMessageRequest" + "type": "array", + "description": "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 currently only supports queries in English." + }, + "safetySettings": { + "description": "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.", + "type": "array", + "items": { + "$ref": "SafetySetting" } }, - "countMessageTokens": { - "parameterOrder": [ - "model" + "answerStyle": { + "description": "Required. Style in which answers should be returned.", + "enumDescriptions": [ + "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." ], - "id": "generativelanguage.models.countMessageTokens", - "path": "v1beta/{+model}:countMessageTokens", - "response": { - "$ref": "CountMessageTokensResponse" - }, - "request": { - "$ref": "CountMessageTokensRequest" - }, - "description": "Runs a model's tokenizer on a string and returns the token count.", - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "type": "string", - "location": "path", - "description": "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": true - } - }, - "flatPath": "v1beta/models/{modelsId}:countMessageTokens", - "httpMethod": "POST" - }, - "countTokens": { - "parameters": { - "model": { - "location": "path", - "description": "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": true, - "type": "string", - "pattern": "^models/[^/]+$" - } - }, - "parameterOrder": [ - "model" + "enum": [ + "ANSWER_STYLE_UNSPECIFIED", + "ABSTRACTIVE", + "EXTRACTIVE", + "VERBOSE" ], - "path": "v1beta/{+model}:countTokens", - "description": "Runs a model's tokenizer on input content and returns the token count.", - "request": { - "$ref": "CountTokensRequest" - }, - "response": { - "$ref": "CountTokensResponse" - }, - "httpMethod": "POST", - "id": "generativelanguage.models.countTokens", - "flatPath": "v1beta/models/{modelsId}:countTokens" + "type": "string" }, - "generateContent": { - "parameters": { - "model": { - "location": "path", - "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", - "type": "string", - "pattern": "^models/[^/]+$" - } - }, - "httpMethod": "POST", - "flatPath": "v1beta/models/{modelsId}:generateContent", - "request": { - "$ref": "GenerateContentRequest" - }, - "id": "generativelanguage.models.generateContent", - "parameterOrder": [ - "model" - ], - "description": "Generates a response from the model given an input `GenerateContentRequest`.", - "path": "v1beta/{+model}:generateContent", - "response": { - "$ref": "GenerateContentResponse" - } + "inlinePassages": { + "description": "Passages provided inline with the request.", + "$ref": "GroundingPassages" }, - "streamGenerateContent": { - "id": "generativelanguage.models.streamGenerateContent", - "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", - "type": "string", - "location": "path", - "pattern": "^models/[^/]+$", - "required": true - } - }, - "response": { - "$ref": "GenerateContentResponse" - }, - "httpMethod": "POST", - "description": "Generates a streamed response from the model given an input `GenerateContentRequest`.", - "path": "v1beta/{+model}:streamGenerateContent", - "flatPath": "v1beta/models/{modelsId}:streamGenerateContent", - "parameterOrder": [ - "model" - ], - "request": { - "$ref": "GenerateContentRequest" + "semanticRetriever": { + "$ref": "SemanticRetrieverConfig", + "description": "Content retrieved from resources created via the Semantic Retriever API." + } + }, + "id": "GenerateAnswerRequest", + "description": "Request to generate a grounded answer from the model.", + "type": "object" + }, + "GroundingPassage": { + "description": "Passage included inline with a grounding configuration.", + "properties": { + "id": { + "description": "Identifier for the passage for attributing this passage in grounded answers.", + "type": "string" + }, + "content": { + "$ref": "Content", + "description": "Content of the passage." + } + }, + "id": "GroundingPassage", + "type": "object" + }, + "EmbedTextResponse": { + "id": "EmbedTextResponse", + "type": "object", + "properties": { + "embedding": { + "description": "Output only. The embedding generated from the input text.", + "readOnly": true, + "$ref": "Embedding" + } + }, + "description": "The response to a EmbedTextRequest." + }, + "Model": { + "properties": { + "outputTokenLimit": { + "format": "int32", + "type": "integer", + "description": "Maximum number of output tokens available for this model." + }, + "topP": { + "description": "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 used by the backend while making the call to the model.", + "type": "number", + "format": "float" + }, + "supportedGenerationMethods": { + "type": "array", + "description": "The model's supported generation methods. The method names are defined as Pascal case strings, such as `generateMessage` which correspond to API methods.", + "items": { + "type": "string" } }, - "batchEmbedContents": { - "path": "v1beta/{+model}:batchEmbedContents", - "parameters": { - "model": { - "location": "path", - "description": "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}`", - "type": "string", - "pattern": "^models/[^/]+$", - "required": true - } - }, - "id": "generativelanguage.models.batchEmbedContents", - "httpMethod": "POST", - "parameterOrder": [ - "model" - ], - "response": { - "$ref": "BatchEmbedContentsResponse" - }, - "description": "Generates multiple embeddings from the model given input text in a synchronous call.", - "flatPath": "v1beta/models/{modelsId}:batchEmbedContents", - "request": { - "$ref": "BatchEmbedContentsRequest" + "name": { + "type": "string", + "description": "Required. The resource name of the `Model`. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/chat-bison-001`" + }, + "inputTokenLimit": { + "type": "integer", + "description": "Maximum number of input tokens allowed for this model.", + "format": "int32" + }, + "version": { + "description": "Required. The version number of the model. This represents the major version", + "type": "string" + }, + "baseModelId": { + "type": "string", + "description": "Required. The name of the base model, pass this to the generation request. Examples: * `chat-bison`" + }, + "displayName": { + "type": "string", + "description": "The human-readable name of the model. E.g. \"Chat Bison\". The name can be up to 128 characters long and can consist of any UTF-8 characters." + }, + "temperature": { + "description": "Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.", + "type": "number", + "format": "float" + }, + "topK": { + "format": "int32", + "description": "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.", + "type": "integer" + }, + "description": { + "description": "A short description of the model.", + "type": "string" + } + }, + "type": "object", + "description": "Information about a Generative Language Model.", + "id": "Model" + }, + "GenerateContentRequest": { + "type": "object", + "description": "Request to generate a completion from the model.", + "id": "GenerateContentRequest", + "properties": { + "contents": { + "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.", + "type": "array", + "items": { + "$ref": "Content" } }, - "get": { - "httpMethod": "GET", - "id": "generativelanguage.models.get", - "response": { - "$ref": "Model" - }, - "parameters": { - "name": { - "required": true, - "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "type": "string", - "location": "path", - "pattern": "^models/[^/]+$" - } - }, - "description": "Gets information about a specific Model.", - "flatPath": "v1beta/models/{modelsId}", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ] + "generationConfig": { + "description": "Optional. Configuration options for model generation and outputs.", + "$ref": "GenerationConfig" }, - "countTextTokens": { - "description": "Runs a model's tokenizer on a text and returns the token count.", - "flatPath": "v1beta/models/{modelsId}:countTextTokens", - "path": "v1beta/{+model}:countTextTokens", - "request": { - "$ref": "CountTextTokensRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "model" - ], - "id": "generativelanguage.models.countTextTokens", - "response": { - "$ref": "CountTextTokensResponse" + "safetySettings": { + "items": { + "$ref": "SafetySetting" }, - "parameters": { - "model": { - "required": true, - "pattern": "^models/[^/]+$", - "description": "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}`", - "location": "path", - "type": "string" - } + "description": "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 are supported.", + "type": "array" + }, + "toolConfig": { + "description": "Optional. Tool configuration for any `Tool` specified in the request.", + "$ref": "ToolConfig" + }, + "tools": { + "description": "Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. The only supported tool is currently `Function`.", + "type": "array", + "items": { + "$ref": "Tool" } + }, + "systemInstruction": { + "$ref": "Content", + "description": "Optional. Developer set system instruction. Currently, text only." } } }, - "corpora": { - "methods": { - "query": { - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], - "request": { - "$ref": "QueryCorpusRequest" - }, - "flatPath": "v1beta/corpora/{corporaId}:query", - "path": "v1beta/{+name}:query", - "response": { - "$ref": "QueryCorpusResponse" - }, - "description": "Performs semantic search over a `Corpus`.", - "parameters": { - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "Required. The name of the `Corpus` to query. Example: `corpora/my-corpus-123`", - "pattern": "^corpora/[^/]+$" - } - }, - "id": "generativelanguage.corpora.query" + "BatchUpdateChunksRequest": { + "properties": { + "requests": { + "type": "array", + "description": "Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch.", + "items": { + "$ref": "UpdateChunkRequest" + } + } + }, + "type": "object", + "description": "Request to batch update `Chunk`s.", + "id": "BatchUpdateChunksRequest" + }, + "FunctionDeclaration": { + "id": "FunctionDeclaration", + "type": "object", + "properties": { + "parameters": { + "$ref": "Schema", + "description": "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." }, - "patch": { - "flatPath": "v1beta/corpora/{corporaId}", - "httpMethod": "PATCH", - "path": "v1beta/{+name}", - "description": "Updates a `Corpus`.", - "parameterOrder": [ - "name" - ], - "id": "generativelanguage.corpora.patch", - "request": { - "$ref": "Corpus" - }, - "response": { - "$ref": "Corpus" - }, - "parameters": { - "name": { - "location": "path", - "type": "string", - "required": true, - "description": "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`", - "pattern": "^corpora/[^/]+$" - }, - "updateMask": { - "description": "Required. The list of fields to update. Currently, this only supports updating `display_name`.", - "type": "string", - "location": "query", - "format": "google-fieldmask" - } - } + "description": { + "type": "string", + "description": "Required. A brief description of the function." }, - "list": { - "httpMethod": "GET", - "parameters": { - "pageToken": { - "location": "query", - "type": "string", - "description": "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." - }, - "pageSize": { - "description": "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.", - "type": "integer", - "location": "query", - "format": "int32" - } - }, - "response": { - "$ref": "ListCorporaResponse" - }, - "description": "Lists all `Corpora` owned by the user.", - "path": "v1beta/corpora", - "parameterOrder": [], - "id": "generativelanguage.corpora.list", - "flatPath": "v1beta/corpora" + "name": { + "type": "string", + "description": "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." + } + }, + "description": "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." + }, + "GroundingAttribution": { + "id": "GroundingAttribution", + "properties": { + "sourceId": { + "readOnly": true, + "$ref": "AttributionSourceId", + "description": "Output only. Identifier for the source contributing to this attribution." }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" + "content": { + "description": "Grounding source content that makes up this attribution.", + "$ref": "Content" + } + }, + "description": "Attribution for a source that contributed to an answer.", + "type": "object" + }, + "ListChunksResponse": { + "type": "object", + "properties": { + "chunks": { + "items": { + "$ref": "Chunk" }, - "path": "v1beta/{+name}", - "id": "generativelanguage.corpora.delete", - "description": "Deletes a `Corpus`.", - "flatPath": "v1beta/corpora/{corporaId}", - "parameters": { - "force": { - "location": "query", - "description": "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.", - "type": "boolean" - }, - "name": { - "type": "string", - "pattern": "^corpora/[^/]+$", - "location": "path", - "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", - "required": true - } - } + "type": "array", + "description": "The returned `Chunk`s." }, - "get": { - "flatPath": "v1beta/corpora/{corporaId}", - "id": "generativelanguage.corpora.get", - "response": { - "$ref": "Corpus" - }, - "httpMethod": "GET", - "parameters": { - "name": { - "location": "path", - "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`", - "type": "string", - "required": true, - "pattern": "^corpora/[^/]+$" - } + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + } + }, + "id": "ListChunksResponse", + "description": "Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`." + }, + "EmbedContentResponse": { + "type": "object", + "properties": { + "embedding": { + "$ref": "ContentEmbedding", + "readOnly": true, + "description": "Output only. The embedding generated from the input content." + } + }, + "description": "The response to an `EmbedContentRequest`.", + "id": "EmbedContentResponse" + }, + "FunctionCall": { + "type": "object", + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", + "properties": { + "name": { + "description": "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.", + "type": "string" + }, + "args": { + "description": "Optional. The function parameters and values in JSON object format.", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" }, - "description": "Gets information about a specific `Corpus`.", - "parameterOrder": [ - "name" + "type": "object" + } + }, + "id": "FunctionCall" + }, + "Permission": { + "type": "object", + "properties": { + "emailAddress": { + "description": "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.", + "type": "string" + }, + "granteeType": { + "enumDescriptions": [ + "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." ], - "path": "v1beta/{+name}" + "type": "string", + "description": "Optional. Immutable. The type of the grantee.", + "enum": [ + "GRANTEE_TYPE_UNSPECIFIED", + "USER", + "GROUP", + "EVERYONE" + ] }, - "create": { - "path": "v1beta/corpora", - "parameterOrder": [], - "response": { - "$ref": "Corpus" - }, - "id": "generativelanguage.corpora.create", - "flatPath": "v1beta/corpora", - "httpMethod": "POST", - "parameters": {}, - "request": { - "$ref": "Corpus" + "name": { + "description": "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.", + "readOnly": true, + "type": "string" + }, + "role": { + "description": "Required. The role granted by this permission.", + "enumDescriptions": [ + "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." + ], + "type": "string", + "enum": [ + "ROLE_UNSPECIFIED", + "OWNER", + "WRITER", + "READER" + ] + } + }, + "id": "Permission", + "description": "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" + }, + "Empty": { + "type": "object", + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }" + }, + "SemanticRetrieverConfig": { + "id": "SemanticRetrieverConfig", + "type": "object", + "properties": { + "metadataFilters": { + "type": "array", + "items": { + "$ref": "MetadataFilter" }, - "description": "Creates an empty `Corpus`." + "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource." + }, + "query": { + "$ref": "Content", + "description": "Required. Query to use for similarity matching `Chunk`s in the given resource." + }, + "maxChunksCount": { + "format": "int32", + "type": "integer", + "description": "Optional. Maximum number of relevant `Chunk`s to retrieve." + }, + "source": { + "description": "Required. Name of the resource for retrieval, e.g. corpora/123 or corpora/123/documents/abc.", + "type": "string" + }, + "minimumRelevanceScore": { + "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s.", + "format": "float", + "type": "number" } }, - "resources": { - "permissions": { - "methods": { - "get": { - "parameterOrder": [ - "name" - ], - "id": "generativelanguage.corpora.permissions.get", - "description": "Gets information about a specific Permission.", - "response": { - "$ref": "Permission" - }, - "parameters": { - "name": { - "required": true, - "pattern": "^corpora/[^/]+/permissions/[^/]+$", - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "location": "path", - "type": "string" - } - }, - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", - "httpMethod": "GET", - "path": "v1beta/{+name}" - }, - "list": { - "httpMethod": "GET", - "flatPath": "v1beta/corpora/{corporaId}/permissions", - "description": "Lists permissions for the specific resource.", - "parameters": { - "pageSize": { - "location": "query", - "description": "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.", - "type": "integer", - "format": "int32" - }, - "pageToken": { - "location": "query", - "description": "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.", - "type": "string" - }, - "parent": { - "pattern": "^corpora/[^/]+$", - "type": "string", - "location": "path", - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "required": true - } - }, - "path": "v1beta/{+parent}/permissions", - "id": "generativelanguage.corpora.permissions.list", - "response": { - "$ref": "ListPermissionsResponse" - }, - "parameterOrder": [ - "parent" - ] - }, - "create": { - "flatPath": "v1beta/corpora/{corporaId}/permissions", - "path": "v1beta/{+parent}/permissions", - "httpMethod": "POST", - "request": { - "$ref": "Permission" - }, - "parameters": { - "parent": { - "type": "string", - "pattern": "^corpora/[^/]+$", - "required": true, - "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "location": "path" - } - }, - "description": "Create a permission to a specific resource.", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "Permission" - }, - "id": "generativelanguage.corpora.permissions.create" - }, - "delete": { - "path": "v1beta/{+name}", - "id": "generativelanguage.corpora.permissions.delete", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "description": "Deletes the permission.", - "parameters": { - "name": { - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "location": "path", - "type": "string", - "pattern": "^corpora/[^/]+/permissions/[^/]+$", - "required": true - } - }, - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}" - }, - "patch": { - "path": "v1beta/{+name}", - "id": "generativelanguage.corpora.permissions.patch", - "description": "Updates the permission.", - "response": { - "$ref": "Permission" - }, - "parameterOrder": [ - "name" - ], - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", - "request": { - "$ref": "Permission" - }, - "parameters": { - "name": { - "pattern": "^corpora/[^/]+/permissions/[^/]+$", - "type": "string", - "required": true, - "location": "path", - "description": "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." - }, - "updateMask": { - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", - "location": "query", - "format": "google-fieldmask", - "type": "string" - } - }, - "httpMethod": "PATCH" - } + "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API." + }, + "Schema": { + "description": "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).", + "type": "object", + "id": "Schema", + "properties": { + "enum": { + "description": "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\"]}", + "type": "array", + "items": { + "type": "string" } }, - "documents": { - "resources": { - "chunks": { - "methods": { - "delete": { - "parameters": { - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`", - "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$" - } - }, - "response": { - "$ref": "Empty" - }, - "description": "Deletes a `Chunk`.", - "httpMethod": "DELETE", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "id": "generativelanguage.corpora.documents.chunks.delete" - }, - "list": { - "httpMethod": "GET", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks", - "path": "v1beta/{+parent}/chunks", - "id": "generativelanguage.corpora.documents.chunks.list", - "response": { - "$ref": "ListChunksResponse" - }, - "parameters": { - "pageSize": { - "format": "int32", - "description": "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.", - "location": "query", - "type": "integer" - }, - "pageToken": { - "description": "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.", - "type": "string", - "location": "query" - }, - "parent": { - "required": true, - "type": "string", - "pattern": "^corpora/[^/]+/documents/[^/]+$", - "location": "path", - "description": "Required. The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`" - } - }, - "description": "Lists all `Chunk`s in a `Document`.", - "parameterOrder": [ - "parent" - ] - }, - "batchUpdate": { - "httpMethod": "POST", - "description": "Batch update `Chunk`s.", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchUpdate", - "parameterOrder": [ - "parent" - ], - "id": "generativelanguage.corpora.documents.chunks.batchUpdate", - "response": { - "$ref": "BatchUpdateChunksResponse" - }, - "path": "v1beta/{+parent}/chunks:batchUpdate", - "request": { - "$ref": "BatchUpdateChunksRequest" - }, - "parameters": { - "parent": { - "location": "path", - "description": "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": true, - "type": "string", - "pattern": "^corpora/[^/]+/documents/[^/]+$" - } - } - }, - "create": { - "request": { - "$ref": "Chunk" - }, - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks", - "response": { - "$ref": "Chunk" - }, - "path": "v1beta/{+parent}/chunks", - "httpMethod": "POST", - "parameters": { - "parent": { - "pattern": "^corpora/[^/]+/documents/[^/]+$", - "location": "path", - "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`", - "type": "string", - "required": true - } - }, - "parameterOrder": [ - "parent" - ], - "id": "generativelanguage.corpora.documents.chunks.create", - "description": "Creates a `Chunk`." - }, - "get": { - "id": "generativelanguage.corpora.documents.chunks.get", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}", - "path": "v1beta/{+name}", - "response": { - "$ref": "Chunk" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "parameters": { - "name": { - "description": "Required. The name of the `Chunk` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`", - "required": true, - "type": "string", - "location": "path", - "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$" - } - }, - "description": "Gets information about a specific `Chunk`." - }, - "batchCreate": { - "path": "v1beta/{+parent}/chunks:batchCreate", - "id": "generativelanguage.corpora.documents.chunks.batchCreate", - "response": { - "$ref": "BatchCreateChunksResponse" - }, - "request": { - "$ref": "BatchCreateChunksRequest" - }, - "description": "Batch create `Chunk`s.", - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchCreate", - "parameters": { - "parent": { - "description": "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`", - "location": "path", - "pattern": "^corpora/[^/]+/documents/[^/]+$", - "required": true, - "type": "string" - } - } - }, - "patch": { - "request": { - "$ref": "Chunk" - }, - "parameters": { - "name": { - "required": true, - "description": "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`", - "type": "string", - "location": "path", - "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$" - }, - "updateMask": { - "type": "string", - "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.", - "format": "google-fieldmask", - "location": "query" - } - }, - "httpMethod": "PATCH", - "id": "generativelanguage.corpora.documents.chunks.patch", - "response": { - "$ref": "Chunk" - }, - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "description": "Updates a `Chunk`." - }, - "batchDelete": { - "path": "v1beta/{+parent}/chunks:batchDelete", - "description": "Batch delete `Chunk`s.", - "id": "generativelanguage.corpora.documents.chunks.batchDelete", - "httpMethod": "POST", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchDelete", - "request": { - "$ref": "BatchDeleteChunksRequest" - }, - "parameters": { - "parent": { - "required": true, - "type": "string", - "location": "path", - "description": "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`", - "pattern": "^corpora/[^/]+/documents/[^/]+$" - } - }, - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "parent" - ] - } - } - } + "nullable": { + "type": "boolean", + "description": "Optional. Indicates if the value may be null." + }, + "type": { + "description": "Required. Data type.", + "type": "string", + "enum": [ + "TYPE_UNSPECIFIED", + "STRING", + "NUMBER", + "INTEGER", + "BOOLEAN", + "ARRAY", + "OBJECT" + ], + "enumDescriptions": [ + "Not specified, should not be used.", + "String type.", + "Number type.", + "Integer type.", + "Boolean type.", + "Array type.", + "Object type." + ] + }, + "items": { + "description": "Optional. Schema of the elements of Type.ARRAY.", + "$ref": "Schema" + }, + "description": { + "type": "string", + "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown." + }, + "required": { + "description": "Optional. Required properties of Type.OBJECT.", + "items": { + "type": "string" }, - "methods": { - "list": { - "response": { - "$ref": "ListDocumentsResponse" - }, - "parameters": { - "parent": { - "location": "path", - "required": true, - "description": "Required. The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`", - "pattern": "^corpora/[^/]+$", - "type": "string" - }, - "pageSize": { - "description": "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.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "pageToken": { - "location": "query", - "description": "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.", - "type": "string" - } - }, - "httpMethod": "GET", - "description": "Lists all `Document`s in a `Corpus`.", - "flatPath": "v1beta/corpora/{corporaId}/documents", - "path": "v1beta/{+parent}/documents", - "parameterOrder": [ - "parent" - ], - "id": "generativelanguage.corpora.documents.list" - }, - "get": { - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Document" - }, - "path": "v1beta/{+name}", - "httpMethod": "GET", - "id": "generativelanguage.corpora.documents.get", - "description": "Gets information about a specific `Document`.", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "Required. The name of the `Document` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc`", - "pattern": "^corpora/[^/]+/documents/[^/]+$" - } - } - }, - "query": { - "id": "generativelanguage.corpora.documents.query", - "path": "v1beta/{+name}:query", - "request": { - "$ref": "QueryDocumentRequest" - }, - "response": { - "$ref": "QueryDocumentResponse" - }, - "description": "Performs semantic search over a `Document`.", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`", - "required": true, - "location": "path", - "pattern": "^corpora/[^/]+/documents/[^/]+$", - "type": "string" - } - }, - "httpMethod": "POST", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}:query" - }, - "delete": { - "parameters": { - "name": { - "location": "path", - "required": true, - "description": "Required. The resource name of the `Document` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc`", - "pattern": "^corpora/[^/]+/documents/[^/]+$", - "type": "string" - }, - "force": { - "type": "boolean", - "description": "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.", - "location": "query" - } - }, - "description": "Deletes a `Document`.", - "id": "generativelanguage.corpora.documents.delete", - "httpMethod": "DELETE", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}", - "response": { - "$ref": "Empty" - } - }, - "patch": { - "request": { - "$ref": "Document" - }, - "parameters": { - "name": { - "type": "string", - "pattern": "^corpora/[^/]+/documents/[^/]+$", - "description": "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`", - "location": "path", - "required": true - }, - "updateMask": { - "type": "string", - "description": "Required. The list of fields to update. Currently, this only supports updating `display_name` and `custom_metadata`.", - "format": "google-fieldmask", - "location": "query" - } - }, - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "response": { - "$ref": "Document" - }, - "httpMethod": "PATCH", - "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}", - "description": "Updates a `Document`.", - "id": "generativelanguage.corpora.documents.patch" - }, - "create": { - "request": { - "$ref": "Document" - }, - "path": "v1beta/{+parent}/documents", - "id": "generativelanguage.corpora.documents.create", - "response": { - "$ref": "Document" - }, - "httpMethod": "POST", - "parameters": { - "parent": { - "required": true, - "description": "Required. The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`", - "type": "string", - "location": "path", - "pattern": "^corpora/[^/]+$" - } - }, - "description": "Creates an empty `Document`.", - "flatPath": "v1beta/corpora/{corporaId}/documents", - "parameterOrder": [ - "parent" - ] - } - } + "type": "array" + }, + "properties": { + "description": "Optional. Properties of Type.OBJECT.", + "additionalProperties": { + "$ref": "Schema" + }, + "type": "object" + }, + "format": { + "type": "string", + "description": "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" } } - } - }, - "baseUrl": "https://generativelanguage.googleapis.com/", - "batchPath": "batch", - "kind": "discovery#restDescription", - "parameters": { - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "upload_protocol": { - "location": "query", - "type": "string", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "type": "string", - "description": "V1 error format.", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "location": "query", - "type": "string" - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "description": "Data format for response.", - "default": "json", - "enumDescriptions": [ - "Responses with Content-Type of application/json", - "Media download with context-dependent Content-Type", - "Responses with Content-Type of application/x-protobuf" - ], - "location": "query" - }, - "prettyPrint": { - "default": "true", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "location": "query" - }, - "quotaUser": { - "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", - "location": "query", - "type": "string" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "key": { - "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", - "location": "query", - "type": "string" }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - } - }, - "revision": "20240411", - "documentationLink": "https://developers.generativeai.google/api", - "version": "v1beta", - "rootUrl": "https://generativelanguage.googleapis.com/", - "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/", - "protocol": "rest", - "ownerName": "Google", - "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" - }, - "name": "generativelanguage", - "id": "generativelanguage:v1beta", - "version_module": true, - "schemas": { - "Operation": { + "GenerateTextResponse": { + "id": "GenerateTextResponse", + "type": "object", + "description": "The response from the model, including candidate completions.", "properties": { - "metadata": { - "type": "object", - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - } - }, - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." + "safetyFeedback": { + "items": { + "$ref": "SafetyFeedback" + }, + "description": "Returns any safety feedback related to content filtering.", + "type": "array" }, - "name": { - "type": "string", - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`." + "candidates": { + "items": { + "$ref": "TextCompletion" + }, + "type": "array", + "description": "Candidate responses from the model." }, - "response": { - "type": "object", - "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" + "filters": { + "type": "array", + "description": "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).", + "items": { + "$ref": "ContentFilter" } - }, - "done": { - "type": "boolean", - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available." } - }, - "id": "Operation", - "description": "This resource represents a long-running operation that is the result of a network API call.", - "type": "object" + } }, - "ListFilesResponse": { + "ListModelsResponse": { + "description": "Response from `ListModel` containing a paginated list of Models.", "properties": { - "nextPageToken": { - "type": "string", - "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call." - }, - "files": { + "models": { + "description": "The returned Models.", "items": { - "$ref": "File" + "$ref": "Model" }, - "description": "The list of `File`s.", "type": "array" + }, + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." } }, - "type": "object", - "id": "ListFilesResponse", - "description": "Response for `ListFiles`." - }, - "ContentEmbedding": { - "properties": { - "values": { - "type": "array", - "description": "The embedding values.", - "items": { - "type": "number", - "format": "float" - } - } - }, - "description": "A list of floats representing an embedding.", - "id": "ContentEmbedding", + "id": "ListModelsResponse", "type": "object" }, - "Dataset": { - "properties": { - "examples": { - "$ref": "TuningExamples", - "description": "Optional. Inline examples." - } - }, - "type": "object", - "id": "Dataset", - "description": "Dataset for training or validation." - }, - "Message": { - "description": "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.", - "type": "object", - "id": "Message", + "TunedModel": { + "description": "A fine-tuned model created using ModelService.CreateTunedModel.", "properties": { - "citationMetadata": { + "tunedModelSource": { + "description": "Optional. TunedModel to use as the starting point for training the new model.", + "$ref": "TunedModelSource" + }, + "state": { + "description": "Output only. The state of the tuned model.", + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "ACTIVE", + "FAILED" + ], + "enumDescriptions": [ + "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." + ], + "type": "string", + "readOnly": true + }, + "createTime": { + "format": "google-datetime", + "description": "Output only. The timestamp when this model was created.", "readOnly": true, - "description": "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.", - "$ref": "CitationMetadata" + "type": "string" }, - "author": { + "topK": { + "format": "int32", + "type": "integer", + "description": "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." + }, + "displayName": { "type": "string", - "description": "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." + "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces." }, - "content": { + "temperature": { + "type": "number", + "description": "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.", + "format": "float" + }, + "tuningTask": { + "description": "Required. The tuning task that creates the tuned model.", + "$ref": "TuningTask" + }, + "description": { "type": "string", - "description": "Required. The text content of the structured `Message`." - } - } - }, - "TuningSnapshot": { - "description": "Record for a single tuning step.", - "type": "object", - "properties": { - "meanLoss": { - "description": "Output only. The mean loss of the training examples for this step.", - "readOnly": true, + "description": "Optional. A short description of this model." + }, + "topP": { "type": "number", + "description": "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.", "format": "float" }, - "epoch": { - "type": "integer", - "format": "int32", + "updateTime": { + "format": "google-datetime", + "description": "Output only. The timestamp when this model was updated.", "readOnly": true, - "description": "Output only. The epoch this step was part of." + "type": "string" }, - "computeTime": { - "readOnly": true, - "description": "Output only. The timestamp when this metric was computed.", + "baseModel": { "type": "string", - "format": "google-datetime" + "description": "Immutable. The name of the `Model` to tune. Example: `models/text-bison-001`" }, - "step": { - "format": "int32", + "name": { "readOnly": true, - "description": "Output only. The tuning step.", - "type": "integer" + "type": "string", + "description": "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\"" } }, - "id": "TuningSnapshot" + "type": "object", + "id": "TunedModel" }, - "QueryDocumentRequest": { - "id": "QueryDocumentRequest", - "description": "Request for querying a `Document`.", + "Corpus": { + "id": "Corpus", "type": "object", "properties": { - "resultsCount": { - "type": "integer", - "format": "int32", - "description": "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." + "name": { + "description": "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`", + "type": "string" }, - "metadataFilters": { - "type": "array", - "description": "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.", - "items": { - "$ref": "MetadataFilter" - } - }, - "query": { - "description": "Required. Query string to perform semantic search.", + "updateTime": { + "readOnly": true, + "format": "google-datetime", + "description": "Output only. The Timestamp of when the `Corpus` was last updated.", "type": "string" - } - } - }, - "InputFeedback": { - "id": "InputFeedback", - "properties": { - "safetyRatings": { - "description": "Ratings for safety of the input. There is at most one rating per category.", - "type": "array", - "items": { - "$ref": "SafetyRating" - } }, - "blockReason": { - "enum": [ - "BLOCK_REASON_UNSPECIFIED", - "SAFETY", - "OTHER" - ], - "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase your input.", + "createTime": { + "readOnly": true, + "format": "google-datetime", "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "Input was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.", - "Input was blocked due to other reasons." - ] - } - }, - "type": "object", - "description": "Feedback related to the input data used to answer the question, as opposed to model-generated response to the question." - }, - "BatchCreateChunksResponse": { - "properties": { - "chunks": { - "type": "array", - "description": "`Chunk`s created.", - "items": { - "$ref": "Chunk" - } + "description": "Output only. The Timestamp of when the `Corpus` was created." + }, + "displayName": { + "description": "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\"", + "type": "string" } }, - "type": "object", - "description": "Response from `BatchCreateChunks` containing a list of created `Chunk`s.", - "id": "BatchCreateChunksResponse" + "description": "A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora." }, - "Permission": { + "GroundingPassageId": { + "description": "Identifier for a part within a `GroundingPassage`.", "properties": { - "emailAddress": { - "type": "string", - "description": "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." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "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." - }, - "granteeType": { - "type": "string", - "enum": [ - "GRANTEE_TYPE_UNSPECIFIED", - "USER", - "GROUP", - "EVERYONE" - ], - "enumDescriptions": [ - "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." - ], - "description": "Optional. Immutable. The type of the grantee." + "partIndex": { + "format": "int32", + "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", + "type": "integer", + "readOnly": true }, - "role": { - "enumDescriptions": [ - "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." - ], + "passageId": { + "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.", "type": "string", - "enum": [ - "ROLE_UNSPECIFIED", - "OWNER", - "WRITER", - "READER" - ], - "description": "Required. The role granted by this permission." + "readOnly": true } }, - "type": "object", - "id": "Permission", - "description": "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" + "id": "GroundingPassageId", + "type": "object" }, - "Corpus": { - "id": "Corpus", + "SemanticRetrieverChunk": { "type": "object", - "description": "A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.", "properties": { - "name": { - "type": "string", - "description": "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`" - }, - "createTime": { + "chunk": { "readOnly": true, - "description": "Output only. The Timestamp of when the `Corpus` was created.", "type": "string", - "format": "google-datetime" + "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`" }, - "updateTime": { - "type": "string", + "source": { "readOnly": true, - "description": "Output only. The Timestamp of when the `Corpus` was last updated.", - "format": "google-datetime" - }, - "displayName": { - "description": "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\"", + "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`", "type": "string" } - } + }, + "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", + "id": "SemanticRetrieverChunk" }, - "ListModelsResponse": { - "id": "ListModelsResponse", + "EmbedTextRequest": { "type": "object", + "id": "EmbedTextRequest", "properties": { - "nextPageToken": { + "model": { "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + "description": "Required. The model name to use with the format model=models/{model}." }, - "models": { - "description": "The returned Models.", - "items": { - "$ref": "Model" - }, - "type": "array" + "text": { + "type": "string", + "description": "Optional. The free-form input text that the model will turn into an embedding." } }, - "description": "Response from `ListModel` containing a paginated list of Models." + "description": "Request to get a text embedding from the model." }, - "AttributionSourceId": { - "id": "AttributionSourceId", - "description": "Identifier for the source contributing to this attribution.", + "BatchEmbedContentsRequest": { + "id": "BatchEmbedContentsRequest", + "description": "Batch request to get embeddings from the model for a list of prompts.", "type": "object", "properties": { - "semanticRetrieverChunk": { - "$ref": "SemanticRetrieverChunk", - "description": "Identifier for a `Chunk` fetched via Semantic Retriever." - }, - "groundingPassage": { - "$ref": "GroundingPassageId", - "description": "Identifier for an inline passage." + "requests": { + "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.", + "type": "array", + "items": { + "$ref": "EmbedContentRequest" + } } } }, - "UpdateChunkRequest": { + "GenerateTextRequest": { "properties": { - "chunk": { - "description": "Required. The `Chunk` to update.", - "$ref": "Chunk" + "candidateCount": { + "type": "integer", + "format": "int32", + "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1." }, - "updateMask": { - "type": "string", - "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.", - "format": "google-fieldmask" - } - }, - "type": "object", - "description": "Request to update a `Chunk`.", - "id": "UpdateChunkRequest" - }, - "Model": { - "description": "Information about a Generative Language Model.", - "properties": { - "baseModelId": { - "description": "Required. The name of the base model, pass this to the generation request. Examples: * `chat-bison`", - "type": "string" + "topP": { + "description": "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.", + "format": "float", + "type": "number" }, "topK": { "format": "int32", - "description": "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.", - "type": "integer" - }, - "supportedGenerationMethods": { - "description": "The model's supported generation methods. The method names are defined as Pascal case strings, such as `generateMessage` which correspond to API methods.", - "items": { - "type": "string" - }, - "type": "array" - }, - "displayName": { - "type": "string", - "description": "The human-readable name of the model. E.g. \"Chat Bison\". The name can be up to 128 characters long and can consist of any UTF-8 characters." - }, - "description": { - "type": "string", - "description": "A short description of the model." - }, - "name": { - "description": "Required. The resource name of the `Model`. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/chat-bison-001`", - "type": "string" + "type": "integer", + "description": "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." }, - "outputTokenLimit": { + "maxOutputTokens": { "type": "integer", - "format": "int32", - "description": "Maximum number of output tokens available for this model." + "description": "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.", + "format": "int32" }, - "version": { - "type": "string", - "description": "Required. The version number of the model. This represents the major version" + "prompt": { + "$ref": "TextPrompt", + "description": "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." }, - "temperature": { - "type": "number", - "description": "Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.", - "format": "float" + "safetySettings": { + "items": { + "$ref": "SafetySetting" + }, + "type": "array", + "description": "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." }, - "topP": { - "type": "number", - "description": "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 used by the backend while making the call to the model.", - "format": "float" + "temperature": { + "format": "float", + "description": "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.", + "type": "number" }, - "inputTokenLimit": { - "type": "integer", - "description": "Maximum number of input tokens allowed for this model.", - "format": "int32" + "stopSequences": { + "description": "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.", + "items": { + "type": "string" + }, + "type": "array" } }, - "id": "Model", - "type": "object" + "id": "GenerateTextRequest", + "type": "object", + "description": "Request to generate a text completion response from the model." }, - "ListPermissionsResponse": { + "TuningExample": { "type": "object", + "description": "A single example for tuning.", "properties": { - "nextPageToken": { + "textInput": { "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + "description": "Optional. Text model input." }, - "permissions": { - "type": "array", - "description": "Returned permissions.", - "items": { - "$ref": "Permission" - } + "output": { + "description": "Required. The expected model output.", + "type": "string" } }, - "id": "ListPermissionsResponse", - "description": "Response from `ListPermissions` containing a paginated list of permissions." + "id": "TuningExample" }, - "Candidate": { - "id": "Candidate", + "TextCompletion": { "properties": { - "groundingAttributions": { - "type": "array", + "citationMetadata": { + "$ref": "CitationMetadata", "readOnly": true, - "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", - "items": { - "$ref": "GroundingAttribution" - } + "description": "Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`." + }, + "output": { + "type": "string", + "description": "Output only. The generated text returned from the model.", + "readOnly": true }, "safetyRatings": { "items": { "$ref": "SafetyRating" }, - "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", - "type": "array" - }, - "citationMetadata": { - "description": "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.", - "readOnly": true, - "$ref": "CitationMetadata" - }, - "index": { - "description": "Output only. Index of the candidate in the list of candidates.", - "type": "integer", - "format": "int32", - "readOnly": true - }, - "tokenCount": { - "format": "int32", - "readOnly": true, - "description": "Output only. Token count for this candidate.", - "type": "integer" - }, - "content": { - "$ref": "Content", - "readOnly": true, - "description": "Output only. Generated content returned from the model." - }, - "finishReason": { - "readOnly": true, - "enum": [ - "FINISH_REASON_UNSPECIFIED", - "STOP", - "MAX_TOKENS", - "SAFETY", - "RECITATION", - "OTHER" - ], - "type": "string", - "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.", - "enumDescriptions": [ - "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 candidate content was flagged for safety reasons.", - "The candidate content was flagged for recitation reasons.", - "Unknown reason." - ] + "type": "array", + "description": "Ratings for the safety of a response. There is at most one rating per category." } }, "type": "object", - "description": "A response candidate generated from the model." + "description": "Output text returned from a model.", + "id": "TextCompletion" }, - "TuningExample": { - "description": "A single example for tuning.", - "id": "TuningExample", + "Dataset": { + "id": "Dataset", "properties": { - "output": { - "type": "string", - "description": "Required. The expected model output." - }, - "textInput": { - "type": "string", - "description": "Optional. Text model input." + "examples": { + "description": "Optional. Inline examples.", + "$ref": "TuningExamples" + } + }, + "type": "object", + "description": "Dataset for training or validation." + }, + "BatchEmbedContentsResponse": { + "description": "The response to a `BatchEmbedContentsRequest`.", + "properties": { + "embeddings": { + "readOnly": true, + "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.", + "type": "array", + "items": { + "$ref": "ContentEmbedding" + } } }, + "id": "BatchEmbedContentsResponse", "type": "object" }, - "FunctionDeclaration": { + "CreateFileResponse": { + "id": "CreateFileResponse", + "properties": { + "file": { + "description": "Metadata for the created file.", + "$ref": "File" + } + }, + "type": "object", + "description": "Response for `CreateFile`." + }, + "CountTextTokensRequest": { "type": "object", + "description": "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`.", "properties": { - "description": { - "type": "string", - "description": "Required. A brief description of the function." + "prompt": { + "description": "Required. The free-form input text given to the model as a prompt.", + "$ref": "TextPrompt" + } + }, + "id": "CountTextTokensRequest" + }, + "QueryDocumentRequest": { + "id": "QueryDocumentRequest", + "properties": { + "metadataFilters": { + "items": { + "$ref": "MetadataFilter" + }, + "type": "array", + "description": "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." }, - "name": { - "description": "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.", - "type": "string" + "resultsCount": { + "type": "integer", + "description": "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.", + "format": "int32" }, - "parameters": { - "$ref": "Schema", - "description": "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." + "query": { + "description": "Required. Query string to perform semantic search.", + "type": "string" } }, - "id": "FunctionDeclaration", - "description": "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." + "description": "Request for querying a `Document`.", + "type": "object" }, - "SemanticRetrieverChunk": { + "ContentFilter": { + "description": "Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.", + "id": "ContentFilter", "properties": { - "chunk": { - "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`", - "readOnly": true, + "message": { + "description": "A string that describes the filtering behavior in more detail.", "type": "string" }, - "source": { + "reason": { "type": "string", - "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`", - "readOnly": true + "description": "The reason content was blocked during request processing.", + "enumDescriptions": [ + "A blocked reason was not specified.", + "Content was blocked by safety settings.", + "Content was blocked, but the reason is uncategorized." + ], + "enum": [ + "BLOCKED_REASON_UNSPECIFIED", + "SAFETY", + "OTHER" + ] } }, + "type": "object" + }, + "CreateFileRequest": { "type": "object", - "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", - "id": "SemanticRetrieverChunk" + "properties": { + "file": { + "$ref": "File", + "description": "Optional. Metadata for the file to create." + } + }, + "id": "CreateFileRequest", + "description": "Request for `CreateFile`." }, - "ListChunksResponse": { + "ContentEmbedding": { "type": "object", + "description": "A list of floats representing an embedding.", "properties": { - "chunks": { - "items": { - "$ref": "Chunk" - }, + "values": { "type": "array", - "description": "The returned `Chunk`s." + "description": "The embedding values.", + "items": { + "type": "number", + "format": "float" + } + } + }, + "id": "ContentEmbedding" + }, + "RelevantChunk": { + "description": "The information for a chunk relevant to a query.", + "properties": { + "chunk": { + "description": "`Chunk` associated with the query.", + "$ref": "Chunk" }, - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + "chunkRelevanceScore": { + "type": "number", + "format": "float", + "description": "`Chunk` relevance to the query." } }, - "id": "ListChunksResponse", - "description": "Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`." + "type": "object", + "id": "RelevantChunk" }, "QueryCorpusRequest": { "description": "Request for querying a `Corpus`.", + "type": "object", "properties": { "query": { "description": "Required. Query string to perform semantic search.", @@ -2110,290 +1294,425 @@ }, "resultsCount": { "format": "int32", - "description": "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.", - "type": "integer" + "type": "integer", + "description": "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." }, "metadataFilters": { + "description": "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.", "type": "array", "items": { "$ref": "MetadataFilter" - }, - "description": "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." + } } }, - "id": "QueryCorpusRequest", - "type": "object" + "id": "QueryCorpusRequest" }, - "BatchEmbedContentsRequest": { - "id": "BatchEmbedContentsRequest", + "Message": { "type": "object", + "description": "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.", "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "EmbedContentRequest" - }, - "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`." + "citationMetadata": { + "description": "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.", + "$ref": "CitationMetadata", + "readOnly": true + }, + "author": { + "description": "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.", + "type": "string" + }, + "content": { + "type": "string", + "description": "Required. The text content of the structured `Message`." } }, - "description": "Batch request to get embeddings from the model for a list of prompts." + "id": "Message" }, - "BatchDeleteChunksRequest": { - "id": "BatchDeleteChunksRequest", - "description": "Request to batch delete `Chunk`s.", + "ToolConfig": { + "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", + "id": "ToolConfig", "type": "object", "properties": { - "requests": { - "items": { - "$ref": "DeleteChunkRequest" - }, - "type": "array", - "description": "Required. The request messages specifying the `Chunk`s to delete." + "functionCallingConfig": { + "description": "Optional. Function calling config.", + "$ref": "FunctionCallingConfig" } } }, - "TransferOwnershipResponse": { - "id": "TransferOwnershipResponse", - "properties": {}, - "description": "Response from `TransferOwnership`.", - "type": "object" - }, - "File": { - "id": "File", - "description": "A file uploaded to the API.", + "CountTextTokensResponse": { + "properties": { + "tokenCount": { + "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", + "format": "int32", + "type": "integer" + } + }, + "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.", "type": "object", + "id": "CountTextTokensResponse" + }, + "FunctionCallingConfig": { "properties": { - "sizeBytes": { - "format": "int64", - "readOnly": true, - "description": "Output only. Size of the file in bytes.", - "type": "string" + "allowedFunctionNames": { + "description": "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.", + "type": "array", + "items": { + "type": "string" + } }, - "uri": { - "description": "Output only. The uri of the `File`.", - "type": "string", - "readOnly": true - }, - "mimeType": { - "readOnly": true, - "description": "Output only. MIME type of the file.", + "mode": { + "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.", + "enum": [ + "MODE_UNSPECIFIED", + "AUTO", + "ANY", + "NONE" + ], + "enumDescriptions": [ + "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 repspose.", + "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." + ], "type": "string" - }, + } + }, + "type": "object", + "id": "FunctionCallingConfig", + "description": "Configuration for specifying function calling behavior." + }, + "TextPrompt": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "Required. The prompt text." + } + }, + "id": "TextPrompt", + "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion." + }, + "File": { + "id": "File", + "properties": { "displayName": { - "description": "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\"", - "type": "string" - }, - "name": { - "description": "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`", - "type": "string" + "type": "string", + "description": "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\"" }, "updateTime": { "type": "string", - "description": "Output only. The timestamp of when the `File` was last updated.", + "readOnly": true, "format": "google-datetime", - "readOnly": true + "description": "Output only. The timestamp of when the `File` was last updated." + }, + "name": { + "type": "string", + "description": "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`" }, "createTime": { - "format": "google-datetime", "readOnly": true, + "format": "google-datetime", "description": "Output only. The timestamp of when the `File` was created.", "type": "string" }, - "sha256Hash": { - "format": "byte", + "uri": { + "readOnly": true, "type": "string", - "description": "Output only. SHA-256 hash of the uploaded bytes.", + "description": "Output only. The uri of the `File`." + }, + "sizeBytes": { + "type": "string", + "format": "int64", + "description": "Output only. Size of the file in bytes.", "readOnly": true }, "expirationTime": { + "readOnly": true, + "type": "string", "format": "google-datetime", + "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire." + }, + "mimeType": { "type": "string", - "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.", + "description": "Output only. MIME type of the file.", "readOnly": true + }, + "sha256Hash": { + "description": "Output only. SHA-256 hash of the uploaded bytes.", + "readOnly": true, + "format": "byte", + "type": "string" } - } - }, - "CreateChunkRequest": { - "id": "CreateChunkRequest", - "description": "Request to create a `Chunk`.", + }, "type": "object", + "description": "A file uploaded to the API." + }, + "Operation": { + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a network API call.", "properties": { - "chunk": { - "description": "Required. The `Chunk` to create.", - "$ref": "Chunk" + "response": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "type": "object", + "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`." }, - "parent": { - "type": "string", - "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`" + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.", + "type": "string" + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", + "type": "boolean" } - } + }, + "type": "object" }, - "ListDocumentsResponse": { - "type": "object", - "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", - "id": "ListDocumentsResponse", + "BatchUpdateChunksResponse": { + "id": "BatchUpdateChunksResponse", "properties": { - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." - }, - "documents": { - "description": "The returned `Document`s.", + "chunks": { + "description": "`Chunk`s updated.", "type": "array", "items": { - "$ref": "Document" + "$ref": "Chunk" } } - } - }, - "CountTextTokensResponse": { - "type": "object", - "id": "CountTextTokensResponse", - "properties": { - "tokenCount": { - "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", - "type": "integer", - "format": "int32" - } }, - "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`." + "type": "object", + "description": "Response from `BatchUpdateChunks` containing a list of updated `Chunk`s." }, - "ListCorporaResponse": { - "id": "ListCorporaResponse", + "TransferOwnershipRequest": { + "description": "Request to transfer the ownership of the tuned model.", + "id": "TransferOwnershipRequest", + "type": "object", "properties": { - "nextPageToken": { + "emailAddress": { "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." - }, - "corpora": { - "items": { - "$ref": "Corpus" - }, - "type": "array", - "description": "The returned corpora." + "description": "Required. The email address of the user to whom the tuned model is being transferred to." } - }, - "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", - "type": "object" + } }, - "CreateFileResponse": { - "description": "Response for `CreateFile`.", + "FunctionResponse": { + "id": "FunctionResponse", "properties": { - "file": { - "description": "Metadata for the created file.", - "$ref": "File" + "response": { + "description": "Required. The function response in JSON object format.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "name": { + "description": "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.", + "type": "string" } }, - "id": "CreateFileResponse", - "type": "object" - }, - "MetadataFilter": { "type": "object", - "id": "MetadataFilter", + "description": "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." + }, + "GroundingPassages": { "properties": { - "conditions": { - "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.", + "passages": { + "type": "array", "items": { - "$ref": "Condition" + "$ref": "GroundingPassage" }, - "type": "array" - }, - "key": { - "type": "string", - "description": "Required. The key of the metadata to filter on." + "description": "List of passages." } }, - "description": "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}]" + "id": "GroundingPassages", + "type": "object", + "description": "A repeated list of passages." }, - "BatchUpdateChunksRequest": { + "Hyperparameters": { "properties": { - "requests": { - "description": "Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch.", - "type": "array", - "items": { - "$ref": "UpdateChunkRequest" - } + "learningRateMultiplier": { + "format": "float", + "type": "number", + "description": "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." + }, + "epochCount": { + "format": "int32", + "description": "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.", + "type": "integer" + }, + "batchSize": { + "type": "integer", + "format": "int32", + "description": "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." + }, + "learningRate": { + "type": "number", + "format": "float", + "description": "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." } }, - "description": "Request to batch update `Chunk`s.", - "id": "BatchUpdateChunksRequest", - "type": "object" + "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", + "type": "object", + "id": "Hyperparameters" }, - "CountMessageTokensRequest": { - "id": "CountMessageTokensRequest", - "description": "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`.", + "ChunkData": { "type": "object", + "description": "Extracted data that represents the `Chunk` content.", + "id": "ChunkData", "properties": { - "prompt": { - "$ref": "MessagePrompt", - "description": "Required. The prompt, whose token count is to be returned." + "stringValue": { + "description": "The `Chunk` content as a string. The maximum number of tokens per chunk is 2043.", + "type": "string" } } }, - "Embedding": { - "id": "Embedding", + "MessagePrompt": { + "description": "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.", "properties": { - "value": { + "context": { + "type": "string", + "description": "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." + }, + "examples": { "type": "array", "items": { - "type": "number", - "format": "float" + "$ref": "Example" }, - "description": "The embedding values." + "description": "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`." + }, + "messages": { + "items": { + "$ref": "Message" + }, + "type": "array", + "description": "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`." } }, - "description": "A list of floats representing the embedding.", - "type": "object" + "type": "object", + "id": "MessagePrompt" }, - "EmbedTextResponse": { - "id": "EmbedTextResponse", - "description": "The response to a EmbedTextRequest.", + "AttributionSourceId": { "properties": { - "embedding": { - "$ref": "Embedding", - "description": "Output only. The embedding generated from the input text.", - "readOnly": true + "semanticRetrieverChunk": { + "description": "Identifier for a `Chunk` fetched via Semantic Retriever.", + "$ref": "SemanticRetrieverChunk" + }, + "groundingPassage": { + "$ref": "GroundingPassageId", + "description": "Identifier for an inline passage." } }, - "type": "object" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", - "properties": {}, "type": "object", - "id": "Empty" + "description": "Identifier for the source contributing to this attribution.", + "id": "AttributionSourceId" }, "TunedModelSource": { - "description": "Tuned model as a source for training a new model.", + "type": "object", "id": "TunedModelSource", + "description": "Tuned model as a source for training a new model.", "properties": { "baseModel": { - "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/text-bison-001`", "type": "string", - "readOnly": true + "readOnly": true, + "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/text-bison-001`" }, "tunedModel": { + "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`", + "type": "string" + } + } + }, + "CreateChunkRequest": { + "id": "CreateChunkRequest", + "type": "object", + "properties": { + "parent": { "type": "string", - "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`" + "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`" + }, + "chunk": { + "description": "Required. The `Chunk` to create.", + "$ref": "Chunk" } }, - "type": "object" + "description": "Request to create a `Chunk`." + }, + "CitationMetadata": { + "type": "object", + "description": "A collection of source attributions for a piece of content.", + "id": "CitationMetadata", + "properties": { + "citationSources": { + "type": "array", + "description": "Citations to sources for a specific response.", + "items": { + "$ref": "CitationSource" + } + } + } + }, + "StringList": { + "type": "object", + "properties": { + "values": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The string values of the metadata to store." + } + }, + "description": "User provided string values assigned to a single metadata key.", + "id": "StringList" + }, + "Tool": { + "type": "object", + "id": "Tool", + "description": "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.", + "properties": { + "functionDeclarations": { + "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the [content.role] \"function\" generation context for the next model turn.", + "items": { + "$ref": "FunctionDeclaration" + }, + "type": "array" + } + } }, "EmbedContentRequest": { + "description": "Request containing the `Content` for the model to embed.", "type": "object", "id": "EmbedContentRequest", - "description": "Request containing the `Content` for the model to embed.", "properties": { - "model": { - "description": "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}`", - "type": "string" + "outputDimensionality": { + "description": "Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024, and the earlier model (`models/embedding-001`) cannot specify this value.", + "format": "int32", + "type": "integer" }, "title": { "description": "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.", "type": "string" }, + "content": { + "$ref": "Content", + "description": "Required. The content to embed. Only the `parts.text` fields will be counted." + }, + "model": { + "type": "string", + "description": "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}`" + }, "taskType": { - "description": "Optional. Optional task type for which the embeddings will be used. Can only be set for `models/embedding-001`.", "enum": [ "TASK_TYPE_UNSPECIFIED", "RETRIEVAL_QUERY", @@ -2404,6 +1723,8 @@ "QUESTION_ANSWERING", "FACT_VERIFICATION" ], + "type": "string", + "description": "Optional. Optional task type for which the embeddings will be used. Can only be set for `models/embedding-001`.", "enumDescriptions": [ "Unset value, which will default to one of the other enum values.", "Specifies the given text is a query in a search/retrieval setting.", @@ -2413,534 +1734,540 @@ "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." - ], - "type": "string" + ] + } + } + }, + "Part": { + "description": "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.", + "type": "object", + "id": "Part", + "properties": { + "functionCall": { + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", + "$ref": "FunctionCall" }, - "content": { - "description": "Required. The content to embed. Only the `parts.text` fields will be counted.", - "$ref": "Content" + "functionResponse": { + "$ref": "FunctionResponse", + "description": "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." }, - "outputDimensionality": { - "description": "Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024, and the earlier model (`models/embedding-001`) cannot specify this value.", - "format": "int32", - "type": "integer" + "fileData": { + "description": "URI based data.", + "$ref": "FileData" + }, + "text": { + "type": "string", + "description": "Inline text." + }, + "inlineData": { + "$ref": "Blob", + "description": "Inline media bytes." } } }, - "GroundingPassage": { - "description": "Passage included inline with a grounding configuration.", - "id": "GroundingPassage", + "Status": { "properties": { - "content": { - "$ref": "Content", - "description": "Content of the passage." + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } }, - "id": { - "description": "Identifier for the passage for attributing this passage in grounded answers.", + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", "type": "string" + }, + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer", + "format": "int32" } }, - "type": "object" + "type": "object", + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", + "id": "Status" }, - "GenerateAnswerRequest": { - "id": "GenerateAnswerRequest", + "ListTunedModelsResponse": { + "id": "ListTunedModelsResponse", "type": "object", - "description": "Request to generate a grounded answer from the model.", + "description": "Response from `ListTunedModels` containing a paginated list of Models.", "properties": { - "inlinePassages": { - "$ref": "GroundingPassages", - "description": "Passages provided inline with the request." - }, - "semanticRetriever": { - "description": "Content retrieved from resources created via the Semantic Retriever API.", - "$ref": "SemanticRetrieverConfig" - }, - "temperature": { - "format": "float", - "type": "number", - "description": "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." + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." }, - "answerStyle": { - "description": "Required. Style in which answers should be returned.", + "tunedModels": { + "description": "The returned Models.", + "type": "array", + "items": { + "$ref": "TunedModel" + } + } + } + }, + "PromptFeedback": { + "id": "PromptFeedback", + "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", + "type": "object", + "properties": { + "blockReason": { "enum": [ - "ANSWER_STYLE_UNSPECIFIED", - "ABSTRACTIVE", - "EXTRACTIVE", - "VERBOSE" + "BLOCK_REASON_UNSPECIFIED", + "SAFETY", + "OTHER" ], + "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase your prompt.", "type": "string", "enumDescriptions": [ - "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." + "Default value. This value is unused.", + "Prompt was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.", + "Prompt was blocked due to unknown reaasons." ] }, - "safetySettings": { + "safetyRatings": { "items": { - "$ref": "SafetySetting" + "$ref": "SafetyRating" }, - "description": "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.", - "type": "array" - }, - "contents": { - "description": "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 currently only supports queries in English.", "type": "array", - "items": { - "$ref": "Content" - } + "description": "Ratings for safety of the prompt. There is at most one rating per category." } } }, - "Part": { + "TuningSnapshot": { + "id": "TuningSnapshot", "properties": { - "functionCall": { - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", - "$ref": "FunctionCall" - }, - "inlineData": { - "description": "Inline media bytes.", - "$ref": "Blob" + "computeTime": { + "readOnly": true, + "format": "google-datetime", + "type": "string", + "description": "Output only. The timestamp when this metric was computed." }, - "fileData": { - "description": "URI based data.", - "$ref": "FileData" + "step": { + "format": "int32", + "readOnly": true, + "description": "Output only. The tuning step.", + "type": "integer" }, - "functionResponse": { - "description": "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.", - "$ref": "FunctionResponse" + "epoch": { + "format": "int32", + "description": "Output only. The epoch this step was part of.", + "type": "integer", + "readOnly": true }, - "text": { - "description": "Inline text.", - "type": "string" + "meanLoss": { + "description": "Output only. The mean loss of the training examples for this step.", + "type": "number", + "format": "float", + "readOnly": true } }, "type": "object", - "description": "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.", - "id": "Part" + "description": "Record for a single tuning step." }, - "FunctionResponse": { - "type": "object", - "description": "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.", + "CountMessageTokensResponse": { "properties": { - "response": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "type": "object", - "description": "Required. The function response in JSON object format." - }, - "name": { - "description": "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.", - "type": "string" + "tokenCount": { + "type": "integer", + "format": "int32", + "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative." } }, - "id": "FunctionResponse" + "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.", + "id": "CountMessageTokensResponse", + "type": "object" }, - "GenerateTextResponse": { - "type": "object", - "description": "The response from the model, including candidate completions.", + "Document": { "properties": { - "safetyFeedback": { - "description": "Returns any safety feedback related to content filtering.", + "customMetadata": { "type": "array", + "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.", "items": { - "$ref": "SafetyFeedback" + "$ref": "CustomMetadata" } }, - "candidates": { - "items": { - "$ref": "TextCompletion" - }, - "description": "Candidate responses from the model.", - "type": "array" + "name": { + "type": "string", + "description": "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`" }, - "filters": { + "updateTime": { + "description": "Output only. The Timestamp of when the `Document` was last updated.", + "type": "string", + "format": "google-datetime", + "readOnly": true + }, + "displayName": { + "description": "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\"", + "type": "string" + }, + "createTime": { + "readOnly": true, + "format": "google-datetime", + "type": "string", + "description": "Output only. The Timestamp of when the `Document` was created." + } + }, + "id": "Document", + "type": "object", + "description": "A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s." + }, + "InputFeedback": { + "id": "InputFeedback", + "properties": { + "safetyRatings": { "items": { - "$ref": "ContentFilter" + "$ref": "SafetyRating" }, - "description": "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).", + "description": "Ratings for safety of the input. There is at most one rating per category.", "type": "array" + }, + "blockReason": { + "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase your input.", + "enum": [ + "BLOCK_REASON_UNSPECIFIED", + "SAFETY", + "OTHER" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Input was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.", + "Input was blocked due to other reasons." + ], + "type": "string" } }, - "id": "GenerateTextResponse" + "description": "Feedback related to the input data used to answer the question, as opposed to model-generated response to the question.", + "type": "object" }, - "CitationMetadata": { + "BatchEmbedTextResponse": { + "id": "BatchEmbedTextResponse", + "description": "The response to a EmbedTextRequest.", + "type": "object", "properties": { - "citationSources": { + "embeddings": { + "description": "Output only. The embeddings generated from the input text.", "items": { - "$ref": "CitationSource" + "$ref": "Embedding" }, - "description": "Citations to sources for a specific response.", + "readOnly": true, "type": "array" } + } + }, + "GenerateMessageRequest": { + "description": "Request to generate a message response from the model.", + "properties": { + "topP": { + "format": "float", + "type": "number", + "description": "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`." + }, + "topK": { + "format": "int32", + "type": "integer", + "description": "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." + }, + "candidateCount": { + "type": "integer", + "format": "int32", + "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`." + }, + "prompt": { + "$ref": "MessagePrompt", + "description": "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." + }, + "temperature": { + "description": "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.", + "format": "float", + "type": "number" + } }, "type": "object", - "id": "CitationMetadata", - "description": "A collection of source attributions for a piece of content." + "id": "GenerateMessageRequest" }, - "ToolConfig": { - "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", + "BatchCreateChunksRequest": { + "id": "BatchCreateChunksRequest", + "description": "Request to batch create `Chunk`s.", "type": "object", "properties": { - "functionCallingConfig": { - "description": "Optional. Function calling config.", - "$ref": "FunctionCallingConfig" + "requests": { + "type": "array", + "description": "Required. The request messages specifying the `Chunk`s to create. A maximum of 100 `Chunk`s can be created in a batch.", + "items": { + "$ref": "CreateChunkRequest" + } } - }, - "id": "ToolConfig" + } }, - "CreateFileRequest": { + "DeleteChunkRequest": { "type": "object", + "description": "Request to delete a `Chunk`.", + "id": "DeleteChunkRequest", "properties": { - "file": { - "$ref": "File", - "description": "Optional. Metadata for the file to create." + "name": { + "type": "string", + "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`" } - }, - "description": "Request for `CreateFile`.", - "id": "CreateFileRequest" + } }, - "EmbedTextRequest": { + "UpdateChunkRequest": { + "id": "UpdateChunkRequest", "type": "object", - "description": "Request to get a text embedding from the model.", - "id": "EmbedTextRequest", "properties": { - "model": { - "type": "string", - "description": "Required. The model name to use with the format model=models/{model}." + "chunk": { + "$ref": "Chunk", + "description": "Required. The `Chunk` to update." }, - "text": { + "updateMask": { "type": "string", - "description": "Optional. The free-form input text that the model will turn into an embedding." + "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.", + "format": "google-fieldmask" } - } + }, + "description": "Request to update a `Chunk`." }, - "GroundingPassageId": { + "CountMessageTokensRequest": { "properties": { - "passageId": { - "type": "string", - "readOnly": true, - "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`." - }, - "partIndex": { - "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", - "readOnly": true, - "format": "int32", - "type": "integer" + "prompt": { + "description": "Required. The prompt, whose token count is to be returned.", + "$ref": "MessagePrompt" } }, - "id": "GroundingPassageId", - "description": "Identifier for a part within a `GroundingPassage`.", - "type": "object" + "type": "object", + "id": "CountMessageTokensRequest", + "description": "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`." }, - "Schema": { + "Content": { + "id": "Content", + "type": "object", "properties": { - "items": { - "description": "Optional. Schema of the elements of Type.ARRAY.", - "$ref": "Schema" - }, - "required": { + "parts": { "type": "array", - "description": "Optional. Required properties of Type.OBJECT.", + "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.", "items": { - "type": "string" + "$ref": "Part" } }, - "properties": { - "description": "Optional. Properties of Type.OBJECT.", - "additionalProperties": { - "$ref": "Schema" - }, - "type": "object" - }, - "description": { - "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.", - "type": "string" - }, - "format": { - "description": "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", + "role": { + "description": "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.", "type": "string" - }, - "enum": { - "type": "array", - "description": "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\"]}", - "items": { - "type": "string" - } - }, - "nullable": { - "type": "boolean", - "description": "Optional. Indicates if the value may be null." - }, - "type": { - "type": "string", - "enumDescriptions": [ - "Not specified, should not be used.", - "String type.", - "Number type.", - "Integer type.", - "Boolean type.", - "Array type.", - "Object type." - ], - "enum": [ - "TYPE_UNSPECIFIED", - "STRING", - "NUMBER", - "INTEGER", - "BOOLEAN", - "ARRAY", - "OBJECT" - ], - "description": "Required. Data type." } }, - "type": "object", - "description": "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).", - "id": "Schema" + "description": "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." }, - "CountTextTokensRequest": { - "description": "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`.", + "BatchDeleteChunksRequest": { + "id": "BatchDeleteChunksRequest", + "description": "Request to batch delete `Chunk`s.", "properties": { - "prompt": { - "$ref": "TextPrompt", - "description": "Required. The free-form input text given to the model as a prompt." + "requests": { + "description": "Required. The request messages specifying the `Chunk`s to delete.", + "items": { + "$ref": "DeleteChunkRequest" + }, + "type": "array" } }, - "id": "CountTextTokensRequest", "type": "object" }, - "ListTunedModelsResponse": { - "description": "Response from `ListTunedModels` containing a paginated list of Models.", + "CitationSource": { + "id": "CitationSource", "type": "object", - "id": "ListTunedModelsResponse", + "description": "A citation to a source for a portion of a specific response.", "properties": { - "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "license": { + "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.", "type": "string" }, - "tunedModels": { - "type": "array", - "description": "The returned Models.", - "items": { - "$ref": "TunedModel" - } + "uri": { + "type": "string", + "description": "Optional. URI that is attributed as a source for a portion of the text." + }, + "startIndex": { + "type": "integer", + "format": "int32", + "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes." + }, + "endIndex": { + "type": "integer", + "description": "Optional. End of the attributed segment, exclusive.", + "format": "int32" } } }, - "MessagePrompt": { + "FileData": { + "description": "URI based data.", + "id": "FileData", "type": "object", - "id": "MessagePrompt", - "description": "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.", "properties": { - "context": { + "mimeType": { "type": "string", - "description": "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." - }, - "messages": { - "items": { - "$ref": "Message" - }, - "type": "array", - "description": "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`." + "description": "Optional. The IANA standard MIME type of the source data." }, - "examples": { - "items": { - "$ref": "Example" - }, - "type": "array", - "description": "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`." + "fileUri": { + "description": "Required. URI.", + "type": "string" } } }, "TuningExamples": { - "description": "A set of tuning examples. Can be training or validation data.", "id": "TuningExamples", - "type": "object", + "description": "A set of tuning examples. Can be training or validation data.", "properties": { "examples": { + "description": "Required. The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.", "items": { "$ref": "TuningExample" }, - "description": "Required. The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.", "type": "array" } - } + }, + "type": "object" }, - "QueryDocumentResponse": { + "BatchEmbedTextRequest": { "type": "object", - "description": "Response from `QueryDocument` containing a list of relevant chunks.", + "id": "BatchEmbedTextRequest", + "description": "Batch request to get a text embedding from the model.", "properties": { - "relevantChunks": { + "texts": { "items": { - "$ref": "RelevantChunk" + "type": "string" }, "type": "array", - "description": "The returned relevant chunks." - } - }, - "id": "QueryDocumentResponse" - }, - "GenerateContentRequest": { - "type": "object", - "id": "GenerateContentRequest", - "properties": { - "safetySettings": { - "description": "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 are supported.", + "description": "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." + }, + "requests": { + "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.", "type": "array", "items": { - "$ref": "SafetySetting" + "$ref": "EmbedTextRequest" } + } + } + }, + "MetadataFilter": { + "properties": { + "key": { + "description": "Required. The key of the metadata to filter on.", + "type": "string" }, - "generationConfig": { - "$ref": "GenerationConfig", - "description": "Optional. Configuration options for model generation and outputs." - }, - "toolConfig": { - "description": "Optional. Tool configuration for any `Tool` specified in the request.", - "$ref": "ToolConfig" - }, + "conditions": { + "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.", + "items": { + "$ref": "Condition" + }, + "type": "array" + } + }, + "description": "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}]", + "type": "object", + "id": "MetadataFilter" + }, + "CountTokensRequest": { + "id": "CountTokensRequest", + "properties": { "contents": { - "type": "array", - "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.", "items": { "$ref": "Content" - } - }, - "systemInstruction": { - "$ref": "Content", - "description": "Optional. Developer set system instruction. Currently, text only." - }, - "tools": { - "items": { - "$ref": "Tool" }, "type": "array", - "description": "Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. The only supported tool is currently `Function`." + "description": "Required. The input given to the model as a prompt." } }, - "description": "Request to generate a completion from the model." + "description": "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`.", + "type": "object" }, - "TunedModel": { - "description": "A fine-tuned model created using ModelService.CreateTunedModel.", + "Candidate": { + "description": "A response candidate generated from the model.", "type": "object", "properties": { - "tunedModelSource": { - "$ref": "TunedModelSource", - "description": "Optional. TunedModel to use as the starting point for training the new model." + "safetyRatings": { + "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", + "items": { + "$ref": "SafetyRating" + }, + "type": "array" }, - "topP": { - "type": "number", - "format": "float", - "description": "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." + "index": { + "type": "integer", + "readOnly": true, + "description": "Output only. Index of the candidate in the list of candidates.", + "format": "int32" }, - "tuningTask": { - "$ref": "TuningTask", - "description": "Required. The tuning task that creates the tuned model." + "tokenCount": { + "type": "integer", + "readOnly": true, + "format": "int32", + "description": "Output only. Token count for this candidate." }, - "state": { - "enumDescriptions": [ - "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." - ], - "description": "Output only. The state of the tuned model.", + "groundingAttributions": { + "items": { + "$ref": "GroundingAttribution" + }, + "type": "array", + "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", + "readOnly": true + }, + "finishReason": { "readOnly": true, "enum": [ - "STATE_UNSPECIFIED", - "CREATING", - "ACTIVE", - "FAILED" + "FINISH_REASON_UNSPECIFIED", + "STOP", + "MAX_TOKENS", + "SAFETY", + "RECITATION", + "OTHER" + ], + "enumDescriptions": [ + "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 candidate content was flagged for safety reasons.", + "The candidate content was flagged for recitation reasons.", + "Unknown reason." ], - "type": "string" - }, - "displayName": { "type": "string", - "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces." - }, - "name": { - "readOnly": true, - "description": "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\"", - "type": "string" + "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens." }, - "createTime": { + "content": { "readOnly": true, - "format": "google-datetime", - "type": "string", - "description": "Output only. The timestamp when this model was created." - }, - "topK": { - "description": "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.", - "type": "integer", - "format": "int32" - }, - "description": { - "description": "Optional. A short description of this model.", - "type": "string" + "$ref": "Content", + "description": "Output only. Generated content returned from the model." }, - "updateTime": { - "type": "string", - "format": "google-datetime", + "citationMetadata": { + "$ref": "CitationMetadata", "readOnly": true, - "description": "Output only. The timestamp when this model was updated." - }, - "temperature": { - "description": "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.", - "type": "number", - "format": "float" - }, - "baseModel": { - "type": "string", - "description": "Immutable. The name of the `Model` to tune. Example: `models/text-bison-001`" + "description": "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." } }, - "id": "TunedModel" + "id": "Candidate" }, - "SafetyRating": { - "description": "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.", + "SafetySetting": { "type": "object", - "id": "SafetyRating", + "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed proability that content is blocked.", "properties": { - "probability": { - "enumDescriptions": [ - "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." - ], - "description": "Required. The probability of harm for this content.", + "threshold": { + "type": "string", + "description": "Required. Controls the probability threshold at which harm is blocked.", "enum": [ - "HARM_PROBABILITY_UNSPECIFIED", - "NEGLIGIBLE", - "LOW", - "MEDIUM", - "HIGH" + "HARM_BLOCK_THRESHOLD_UNSPECIFIED", + "BLOCK_LOW_AND_ABOVE", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_ONLY_HIGH", + "BLOCK_NONE" ], - "type": "string" - }, - "blocked": { - "type": "boolean", - "description": "Was this content blocked because of this rating?" + "enumDescriptions": [ + "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." + ] }, "category": { - "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT" - ], - "description": "Required. The category for this rating.", "enumDescriptions": [ "Category is unspecified.", "Negative or harmful comments targeting identity and/or protected attribute.", @@ -2954,1021 +2281,1694 @@ "Sexually explicit content.", "Dangerous content." ], - "type": "string" + "description": "Required. The category for this setting.", + "type": "string", + "enum": [ + "HARM_CATEGORY_UNSPECIFIED", + "HARM_CATEGORY_DEROGATORY", + "HARM_CATEGORY_TOXICITY", + "HARM_CATEGORY_VIOLENCE", + "HARM_CATEGORY_SEXUAL", + "HARM_CATEGORY_MEDICAL", + "HARM_CATEGORY_DANGEROUS", + "HARM_CATEGORY_HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH", + "HARM_CATEGORY_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_DANGEROUS_CONTENT" + ] } - } + }, + "id": "SafetySetting" }, - "Chunk": { + "CustomMetadata": { + "id": "CustomMetadata", "type": "object", "properties": { - "data": { - "description": "Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043.", - "$ref": "ChunkData" + "stringListValue": { + "$ref": "StringList", + "description": "The StringList value of the metadata to store." }, - "state": { - "description": "Output only. Current state of the `Chunk`.", + "stringValue": { "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "STATE_PENDING_PROCESSING", - "STATE_ACTIVE", - "STATE_FAILED" - ], - "readOnly": true, - "enumDescriptions": [ - "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." - ] + "description": "The string value of the metadata to store." }, - "name": { - "description": "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`", - "type": "string" + "numericValue": { + "format": "float", + "type": "number", + "description": "The numeric value of the metadata to store." }, - "createTime": { - "readOnly": true, - "format": "google-datetime", - "type": "string", - "description": "Output only. The Timestamp of when the `Chunk` was created." + "key": { + "description": "Required. The key of the metadata to store.", + "type": "string" + } + }, + "description": "User provided metadata stored as key-value pairs." + }, + "GenerateMessageResponse": { + "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.", + "properties": { + "filters": { + "items": { + "$ref": "ContentFilter" + }, + "type": "array", + "description": "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." }, - "customMetadata": { + "candidates": { "type": "array", "items": { - "$ref": "CustomMetadata" + "$ref": "Message" }, - "description": "Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20." + "description": "Candidate response messages from the model." }, - "updateTime": { - "format": "google-datetime", - "description": "Output only. The Timestamp of when the `Chunk` was last updated.", - "readOnly": true, - "type": "string" + "messages": { + "type": "array", + "description": "The conversation history used by the model.", + "items": { + "$ref": "Message" + } } }, - "description": "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.", - "id": "Chunk" + "type": "object", + "id": "GenerateMessageResponse" }, - "StringList": { + "ListFilesResponse": { + "id": "ListFilesResponse", + "description": "Response for `ListFiles`.", "properties": { - "values": { + "nextPageToken": { + "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.", + "type": "string" + }, + "files": { + "type": "array", "items": { - "type": "string" + "$ref": "File" }, - "description": "The string values of the metadata to store.", - "type": "array" + "description": "The list of `File`s." } }, - "id": "StringList", - "description": "User provided string values assigned to a single metadata key.", "type": "object" }, - "BatchEmbedTextRequest": { - "description": "Batch request to get a text embedding from the model.", - "type": "object", - "id": "BatchEmbedTextRequest", + "GenerationConfig": { + "description": "Configuration options for model generation and outputs. Not all parameters may be configurable for every model.", + "id": "GenerationConfig", "properties": { - "texts": { + "stopSequences": { + "type": "array", "items": { "type": "string" }, - "description": "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.", - "type": "array" + "description": "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." }, - "requests": { - "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.", - "items": { - "$ref": "EmbedTextRequest" - }, - "type": "array" - } - } - }, - "ContentFilter": { - "type": "object", - "id": "ContentFilter", - "properties": { - "message": { - "description": "A string that describes the filtering behavior in more detail.", - "type": "string" + "topP": { + "format": "float", + "type": "number", + "description": "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 from the `getModel` function." }, - "reason": { - "enumDescriptions": [ - "A blocked reason was not specified.", - "Content was blocked by safety settings.", - "Content was blocked, but the reason is uncategorized." - ], - "type": "string", - "enum": [ - "BLOCKED_REASON_UNSPECIFIED", - "SAFETY", - "OTHER" - ], - "description": "The reason content was blocked during request processing." - } - }, - "description": "Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified." - }, - "Status": { - "type": "object", - "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", - "id": "Status", - "properties": { - "message": { + "temperature": { + "type": "number", + "format": "float", + "description": "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]." + }, + "maxOutputTokens": { + "description": "Optional. The maximum number of tokens to include in a candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.", + "format": "int32", + "type": "integer" + }, + "responseMimeType": { "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client." + "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: `text/plain`: (default) Text output. `application/json`: JSON response in the candidates." }, - "details": { - "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - } - } + "topK": { + "type": "integer", + "description": "Optional. The maximum number of tokens to consider when sampling. Models use nucleus sampling or combined 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, see the `Model.top_k` attribute of the `Model` returned from the `getModel` function. Empty `top_k` field in `Model` indicates the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", + "format": "int32" }, - "code": { + "candidateCount": { "format": "int32", - "description": "The status code, which should be an enum value of google.rpc.Code.", + "description": "Optional. Number of generated responses to return. Currently, this value can only be set to 1. If unset, this will default to 1.", "type": "integer" } - } + }, + "type": "object" }, - "GenerateContentResponse": { - "type": "object", - "description": "Response from the model supporting multiple candidates. Note on safety ratings and content filtering. They are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API contract is that: - either all requested candidates are returned or no candidates at all - no candidates are returned only if there was something wrong with the prompt (see `prompt_feedback`) - feedback on each candidate is reported on `finish_reason` and `safety_ratings`.", - "id": "GenerateContentResponse", + "ListCorporaResponse": { + "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", "properties": { - "candidates": { + "corpora": { + "type": "array", "items": { - "$ref": "Candidate" + "$ref": "Corpus" }, - "description": "Candidate responses from the model.", - "type": "array" + "description": "The returned corpora." }, - "promptFeedback": { - "description": "Returns the prompt's feedback related to the content filters.", - "$ref": "PromptFeedback" + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." } - } + }, + "type": "object", + "id": "ListCorporaResponse" }, - "BatchEmbedContentsResponse": { + "ListPermissionsResponse": { "properties": { - "embeddings": { - "readOnly": true, - "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.", + "permissions": { + "description": "Returned permissions.", "type": "array", "items": { - "$ref": "ContentEmbedding" + "$ref": "Permission" } + }, + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." } }, - "id": "BatchEmbedContentsResponse", - "description": "The response to a `BatchEmbedContentsRequest`.", - "type": "object" + "type": "object", + "id": "ListPermissionsResponse", + "description": "Response from `ListPermissions` containing a paginated list of permissions." }, - "TransferOwnershipRequest": { - "id": "TransferOwnershipRequest", + "QueryDocumentResponse": { + "type": "object", "properties": { - "emailAddress": { - "description": "Required. The email address of the user to whom the tuned model is being transferred to.", - "type": "string" + "relevantChunks": { + "type": "array", + "items": { + "$ref": "RelevantChunk" + }, + "description": "The returned relevant chunks." } }, - "description": "Request to transfer the ownership of the tuned model.", - "type": "object" + "id": "QueryDocumentResponse", + "description": "Response from `QueryDocument` containing a list of relevant chunks." }, - "GenerateAnswerResponse": { + "SafetyFeedback": { + "description": "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.", "properties": { - "inputFeedback": { - "readOnly": true, - "$ref": "InputFeedback", - "description": "Output only. Feedback related to the input data used to answer the question, as opposed to model-generated response to the question. \"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`)" - }, - "answerableProbability": { - "format": "float", - "type": "number", - "description": "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, some clients may wish 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 clients’ use cases. 0.5 is a good starting threshold.", - "readOnly": true + "setting": { + "description": "Safety settings applied to the request.", + "$ref": "SafetySetting" }, - "answer": { - "$ref": "Candidate", - "description": "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`." + "rating": { + "$ref": "SafetyRating", + "description": "Safety rating evaluated from content." } }, - "description": "Response from the model for a grounded answer.", "type": "object", - "id": "GenerateAnswerResponse" - }, - "SafetySetting": { - "properties": { - "category": { - "type": "string", - "enumDescriptions": [ - "Category is unspecified.", - "Negative or harmful comments targeting identity and/or protected attribute.", - "Content that is rude, disrespectful, or profane.", - "Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", - "Contains references to sexual acts or other lewd content.", - "Promotes unchecked medical advice.", - "Dangerous content that promotes, facilitates, or encourages harmful acts.", - "Harasment content.", - "Hate speech and content.", - "Sexually explicit content.", - "Dangerous content." + "id": "SafetyFeedback" + } + }, + "resources": { + "files": { + "methods": { + "get": { + "path": "v1beta/{+name}", + "parameterOrder": [ + "name" ], - "description": "Required. The category for this setting.", - "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT" - ] - }, - "threshold": { - "description": "Required. Controls the probability threshold at which harm is blocked.", - "type": "string", - "enum": [ - "HARM_BLOCK_THRESHOLD_UNSPECIFIED", - "BLOCK_LOW_AND_ABOVE", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_ONLY_HIGH", - "BLOCK_NONE" - ], - "enumDescriptions": [ - "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." - ] - } - }, - "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed proability that content is blocked.", - "type": "object", - "id": "SafetySetting" - }, - "SemanticRetrieverConfig": { - "properties": { - "metadataFilters": { - "type": "array", - "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.", - "items": { - "$ref": "MetadataFilter" - } - }, - "query": { - "$ref": "Content", - "description": "Required. Query to use for similarity matching `Chunk`s in the given resource." - }, - "source": { - "type": "string", - "description": "Required. Name of the resource for retrieval, e.g. corpora/123 or corpora/123/documents/abc." + "flatPath": "v1beta/files/{filesId}", + "response": { + "$ref": "File" + }, + "id": "generativelanguage.files.get", + "description": "Gets the metadata for the given `File`.", + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the `File` to get. Example: `files/abc-123`", + "type": "string", + "required": true, + "pattern": "^files/[^/]+$" + } + }, + "httpMethod": "GET" }, - "maxChunksCount": { - "type": "integer", - "format": "int32", - "description": "Optional. Maximum number of relevant `Chunk`s to retrieve." + "list": { + "path": "v1beta/files", + "response": { + "$ref": "ListFilesResponse" + }, + "parameters": { + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100." + }, + "pageToken": { + "location": "query", + "type": "string", + "description": "Optional. A page token from a previous `ListFiles` call." + } + }, + "parameterOrder": [], + "id": "generativelanguage.files.list", + "description": "Lists the metadata for `File`s owned by the requesting project.", + "httpMethod": "GET", + "flatPath": "v1beta/files" }, - "minimumRelevanceScore": { - "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s.", - "type": "number", - "format": "float" - } - }, - "type": "object", - "id": "SemanticRetrieverConfig", - "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API." - }, - "ChunkData": { - "type": "object", - "description": "Extracted data that represents the `Chunk` content.", - "id": "ChunkData", - "properties": { - "stringValue": { - "description": "The `Chunk` content as a string. The maximum number of tokens per chunk is 2043.", - "type": "string" + "delete": { + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.files.delete", + "parameters": { + "name": { + "pattern": "^files/[^/]+$", + "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", + "type": "string", + "required": true, + "location": "path" + } + }, + "path": "v1beta/{+name}", + "httpMethod": "DELETE", + "description": "Deletes the `File`.", + "response": { + "$ref": "Empty" + }, + "flatPath": "v1beta/files/{filesId}" } } }, - "BatchCreateChunksRequest": { - "type": "object", - "description": "Request to batch create `Chunk`s.", - "id": "BatchCreateChunksRequest", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "CreateChunkRequest" + "media": { + "methods": { + "upload": { + "request": { + "$ref": "CreateFileRequest" }, - "description": "Required. The request messages specifying the `Chunk`s to create. A maximum of 100 `Chunk`s can be created in a batch." + "parameterOrder": [], + "httpMethod": "POST", + "mediaUpload": { + "maxSize": "2147483648", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/v1beta/files" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/v1beta/files" + } + }, + "accept": [ + "*/*" + ] + }, + "flatPath": "v1beta/files", + "path": "v1beta/files", + "id": "generativelanguage.media.upload", + "supportsMediaUpload": true, + "parameters": {}, + "description": "Creates a `File`.", + "response": { + "$ref": "CreateFileResponse" + } } } }, - "CitationSource": { - "properties": { - "startIndex": { - "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.", - "format": "int32", - "type": "integer" - }, - "endIndex": { - "format": "int32", - "type": "integer", - "description": "Optional. End of the attributed segment, exclusive." - }, - "uri": { - "type": "string", - "description": "Optional. URI that is attributed as a source for a portion of the text." - }, - "license": { - "type": "string", - "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations." - } - }, - "id": "CitationSource", - "type": "object", - "description": "A citation to a source for a portion of a specific response." - }, - "GroundingAttribution": { - "id": "GroundingAttribution", - "type": "object", - "properties": { - "content": { - "$ref": "Content", - "description": "Grounding source content that makes up this attribution." - }, - "sourceId": { - "description": "Output only. Identifier for the source contributing to this attribution.", - "readOnly": true, - "$ref": "AttributionSourceId" - } - }, - "description": "Attribution for a source that contributed to an answer." - }, - "CountTokensRequest": { - "properties": { - "contents": { - "items": { - "$ref": "Content" + "models": { + "methods": { + "get": { + "id": "generativelanguage.models.get", + "parameters": { + "name": { + "required": true, + "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "type": "string", + "location": "path" + } }, - "description": "Required. The input given to the model as a prompt.", - "type": "array" - } - }, - "type": "object", - "id": "CountTokensRequest", - "description": "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`." - }, - "CustomMetadata": { - "type": "object", - "id": "CustomMetadata", - "description": "User provided metadata stored as key-value pairs.", - "properties": { - "numericValue": { - "format": "float", - "description": "The numeric value of the metadata to store.", - "type": "number" - }, - "stringValue": { - "description": "The string value of the metadata to store.", - "type": "string" + "parameterOrder": [ + "name" + ], + "flatPath": "v1beta/models/{modelsId}", + "httpMethod": "GET", + "response": { + "$ref": "Model" + }, + "description": "Gets information about a specific Model.", + "path": "v1beta/{+name}" }, - "key": { - "type": "string", - "description": "Required. The key of the metadata to store." + "batchEmbedContents": { + "parameters": { + "model": { + "required": true, + "type": "string", + "pattern": "^models/[^/]+$", + "location": "path", + "description": "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}`" + } + }, + "request": { + "$ref": "BatchEmbedContentsRequest" + }, + "response": { + "$ref": "BatchEmbedContentsResponse" + }, + "path": "v1beta/{+model}:batchEmbedContents", + "flatPath": "v1beta/models/{modelsId}:batchEmbedContents", + "id": "generativelanguage.models.batchEmbedContents", + "httpMethod": "POST", + "description": "Generates multiple embeddings from the model given input text in a synchronous call.", + "parameterOrder": [ + "model" + ] }, - "stringListValue": { - "$ref": "StringList", - "description": "The StringList value of the metadata to store." - } - } - }, - "RelevantChunk": { - "type": "object", - "properties": { - "chunk": { - "$ref": "Chunk", - "description": "`Chunk` associated with the query." + "countMessageTokens": { + "description": "Runs a model's tokenizer on a string and returns the token count.", + "response": { + "$ref": "CountMessageTokensResponse" + }, + "flatPath": "v1beta/models/{modelsId}:countMessageTokens", + "parameters": { + "model": { + "pattern": "^models/[^/]+$", + "required": true, + "description": "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}`", + "location": "path", + "type": "string" + } + }, + "httpMethod": "POST", + "id": "generativelanguage.models.countMessageTokens", + "request": { + "$ref": "CountMessageTokensRequest" + }, + "path": "v1beta/{+model}:countMessageTokens", + "parameterOrder": [ + "model" + ] }, - "chunkRelevanceScore": { - "description": "`Chunk` relevance to the query.", - "type": "number", - "format": "float" - } - }, - "id": "RelevantChunk", - "description": "The information for a chunk relevant to a query." - }, - "GroundingPassages": { - "id": "GroundingPassages", - "description": "A repeated list of passages.", - "properties": { - "passages": { - "description": "List of passages.", - "type": "array", - "items": { - "$ref": "GroundingPassage" + "embedContent": { + "httpMethod": "POST", + "path": "v1beta/{+model}:embedContent", + "response": { + "$ref": "EmbedContentResponse" + }, + "id": "generativelanguage.models.embedContent", + "flatPath": "v1beta/models/{modelsId}:embedContent", + "description": "Generates an embedding from the model given an input `Content`.", + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "EmbedContentRequest" + }, + "parameters": { + "model": { + "location": "path", + "description": "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}`", + "pattern": "^models/[^/]+$", + "required": true, + "type": "string" + } } - } - }, - "type": "object" - }, - "FunctionCall": { - "properties": { - "name": { - "type": "string", - "description": "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." }, - "args": { - "type": "object", - "description": "Optional. The function parameters and values in JSON object format.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" + "countTokens": { + "response": { + "$ref": "CountTokensResponse" + }, + "flatPath": "v1beta/models/{modelsId}:countTokens", + "parameterOrder": [ + "model" + ], + "httpMethod": "POST", + "path": "v1beta/{+model}:countTokens", + "id": "generativelanguage.models.countTokens", + "description": "Runs a model's tokenizer on input content and returns the token count.", + "request": { + "$ref": "CountTokensRequest" + }, + "parameters": { + "model": { + "pattern": "^models/[^/]+$", + "type": "string", + "required": true, + "location": "path", + "description": "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}`" + } } - } - }, - "id": "FunctionCall", - "type": "object", - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values." - }, - "FileData": { - "id": "FileData", - "type": "object", - "properties": { - "fileUri": { - "type": "string", - "description": "Required. URI." - }, - "mimeType": { - "description": "Optional. The IANA standard MIME type of the source data.", - "type": "string" - } - }, - "description": "URI based data." - }, - "GenerateMessageRequest": { - "type": "object", - "description": "Request to generate a message response from the model.", - "id": "GenerateMessageRequest", - "properties": { - "candidateCount": { - "type": "integer", - "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.", - "format": "int32" - }, - "prompt": { - "description": "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.", - "$ref": "MessagePrompt" - }, - "topK": { - "format": "int32", - "description": "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.", - "type": "integer" - }, - "temperature": { - "type": "number", - "description": "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.", - "format": "float" }, - "topP": { - "format": "float", - "description": "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`.", - "type": "number" - } - } - }, - "GenerateMessageResponse": { - "properties": { - "messages": { - "items": { - "$ref": "Message" + "list": { + "path": "v1beta/models", + "id": "generativelanguage.models.list", + "response": { + "$ref": "ListModelsResponse" }, - "type": "array", - "description": "The conversation history used by the model." + "flatPath": "v1beta/models", + "httpMethod": "GET", + "parameterOrder": [], + "parameters": { + "pageSize": { + "description": "The maximum number of `Models` to return (per page). The service may return fewer models. If unspecified, at most 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "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.", + "type": "string" + } + }, + "description": "Lists models available through the API." }, - "filters": { - "type": "array", - "description": "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.", - "items": { - "$ref": "ContentFilter" + "generateMessage": { + "parameters": { + "model": { + "description": "Required. The name of the model to use. Format: `name=models/{model}`.", + "type": "string", + "location": "path", + "pattern": "^models/[^/]+$", + "required": true + } + }, + "path": "v1beta/{+model}:generateMessage", + "httpMethod": "POST", + "flatPath": "v1beta/models/{modelsId}:generateMessage", + "description": "Generates a response from the model given an input `MessagePrompt`.", + "response": { + "$ref": "GenerateMessageResponse" + }, + "parameterOrder": [ + "model" + ], + "id": "generativelanguage.models.generateMessage", + "request": { + "$ref": "GenerateMessageRequest" } }, - "candidates": { - "description": "Candidate response messages from the model.", - "items": { - "$ref": "Message" + "embedText": { + "httpMethod": "POST", + "request": { + "$ref": "EmbedTextRequest" }, - "type": "array" - } - }, - "type": "object", - "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.", - "id": "GenerateMessageResponse" - }, - "Content": { - "type": "object", - "properties": { - "parts": { - "items": { - "$ref": "Part" + "path": "v1beta/{+model}:embedText", + "parameterOrder": [ + "model" + ], + "id": "generativelanguage.models.embedText", + "description": "Generates an embedding from the model given an input message.", + "response": { + "$ref": "EmbedTextResponse" }, - "type": "array", - "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types." + "parameters": { + "model": { + "location": "path", + "required": true, + "type": "string", + "description": "Required. The model name to use with the format model=models/{model}.", + "pattern": "^models/[^/]+$" + } + }, + "flatPath": "v1beta/models/{modelsId}:embedText" }, - "role": { - "description": "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.", - "type": "string" - } - }, - "description": "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.", - "id": "Content" - }, - "EmbedContentResponse": { - "id": "EmbedContentResponse", - "properties": { - "embedding": { - "description": "Output only. The embedding generated from the input content.", - "readOnly": true, - "$ref": "ContentEmbedding" - } - }, - "description": "The response to an `EmbedContentRequest`.", - "type": "object" - }, - "Blob": { - "id": "Blob", - "properties": { - "data": { - "type": "string", - "description": "Raw bytes for media formats.", - "format": "byte" - }, - "mimeType": { - "description": "The IANA standard MIME type of the source data. Accepted types include: \"image/png\", \"image/jpeg\", \"image/heic\", \"image/heif\", \"image/webp\".", - "type": "string" - } - }, - "type": "object", - "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field." - }, - "TuningTask": { - "description": "Tuning tasks that create tuned models.", - "properties": { - "snapshots": { - "items": { - "$ref": "TuningSnapshot" + "generateText": { + "id": "generativelanguage.models.generateText", + "path": "v1beta/{+model}:generateText", + "parameterOrder": [ + "model" + ], + "parameters": { + "model": { + "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", + "type": "string", + "location": "path", + "required": true, + "pattern": "^models/[^/]+$" + } }, - "type": "array", - "description": "Output only. Metrics collected during tuning.", - "readOnly": true - }, - "trainingData": { - "description": "Required. Input only. Immutable. The model training data.", - "$ref": "Dataset" - }, - "completeTime": { - "readOnly": true, - "format": "google-datetime", - "type": "string", - "description": "Output only. The timestamp when tuning this model completed." - }, - "hyperparameters": { - "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.", - "$ref": "Hyperparameters" - }, - "startTime": { - "type": "string", - "format": "google-datetime", - "description": "Output only. The timestamp when tuning this model started.", - "readOnly": true - } - }, - "type": "object", - "id": "TuningTask" - }, - "CountMessageTokensResponse": { - "id": "CountMessageTokensResponse", - "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.", - "properties": { - "tokenCount": { - "format": "int32", - "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", - "type": "integer" - } - }, - "type": "object" - }, - "GenerationConfig": { - "description": "Configuration options for model generation and outputs. Not all parameters may be configurable for every model.", - "properties": { - "maxOutputTokens": { - "format": "int32", - "description": "Optional. The maximum number of tokens to include in a candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.", - "type": "integer" - }, - "topP": { - "description": "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 from the `getModel` function.", - "type": "number", - "format": "float" + "description": "Generates a response from the model given an input message.", + "httpMethod": "POST", + "flatPath": "v1beta/models/{modelsId}:generateText", + "request": { + "$ref": "GenerateTextRequest" + }, + "response": { + "$ref": "GenerateTextResponse" + } }, - "temperature": { - "type": "number", - "description": "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].", - "format": "float" + "generateContent": { + "path": "v1beta/{+model}:generateContent", + "request": { + "$ref": "GenerateContentRequest" + }, + "parameterOrder": [ + "model" + ], + "httpMethod": "POST", + "response": { + "$ref": "GenerateContentResponse" + }, + "parameters": { + "model": { + "pattern": "^models/[^/]+$", + "required": true, + "type": "string", + "location": "path", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`." + } + }, + "id": "generativelanguage.models.generateContent", + "description": "Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.", + "flatPath": "v1beta/models/{modelsId}:generateContent" }, - "responseMimeType": { - "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: `text/plain`: (default) Text output. `application/json`: JSON response in the candidates.", - "type": "string" + "batchEmbedText": { + "httpMethod": "POST", + "flatPath": "v1beta/models/{modelsId}:batchEmbedText", + "parameterOrder": [ + "model" + ], + "description": "Generates multiple embeddings from the model given input text in a synchronous call.", + "request": { + "$ref": "BatchEmbedTextRequest" + }, + "response": { + "$ref": "BatchEmbedTextResponse" + }, + "id": "generativelanguage.models.batchEmbedText", + "parameters": { + "model": { + "pattern": "^models/[^/]+$", + "type": "string", + "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001", + "required": true, + "location": "path" + } + }, + "path": "v1beta/{+model}:batchEmbedText" }, - "topK": { - "description": "Optional. The maximum number of tokens to consider when sampling. Models use nucleus sampling or combined 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, see the `Model.top_k` attribute of the `Model` returned from the `getModel` function. Empty `top_k` field in `Model` indicates the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", - "type": "integer", - "format": "int32" + "generateAnswer": { + "path": "v1beta/{+model}:generateAnswer", + "parameterOrder": [ + "model" + ], + "parameters": { + "model": { + "location": "path", + "type": "string", + "required": true, + "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.", + "pattern": "^models/[^/]+$" + } + }, + "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", + "httpMethod": "POST", + "flatPath": "v1beta/models/{modelsId}:generateAnswer", + "id": "generativelanguage.models.generateAnswer", + "response": { + "$ref": "GenerateAnswerResponse" + }, + "request": { + "$ref": "GenerateAnswerRequest" + } }, - "stopSequences": { - "items": { - "type": "string" + "streamGenerateContent": { + "httpMethod": "POST", + "request": { + "$ref": "GenerateContentRequest" }, - "description": "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.", - "type": "array" + "response": { + "$ref": "GenerateContentResponse" + }, + "parameterOrder": [ + "model" + ], + "parameters": { + "model": { + "required": true, + "type": "string", + "pattern": "^models/[^/]+$", + "location": "path", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`." + } + }, + "id": "generativelanguage.models.streamGenerateContent", + "path": "v1beta/{+model}:streamGenerateContent", + "description": "Generates a streamed response from the model given an input `GenerateContentRequest`.", + "flatPath": "v1beta/models/{modelsId}:streamGenerateContent" }, - "candidateCount": { - "type": "integer", - "description": "Optional. Number of generated responses to return. Currently, this value can only be set to 1. If unset, this will default to 1.", - "format": "int32" - } - }, - "id": "GenerationConfig", - "type": "object" - }, - "DeleteChunkRequest": { - "description": "Request to delete a `Chunk`.", - "type": "object", - "properties": { - "name": { - "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`", - "type": "string" - } - }, - "id": "DeleteChunkRequest" - }, - "BatchUpdateChunksResponse": { - "properties": { - "chunks": { - "description": "`Chunk`s updated.", - "type": "array", - "items": { - "$ref": "Chunk" - } - } - }, - "description": "Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.", - "type": "object", - "id": "BatchUpdateChunksResponse" - }, - "Tool": { - "id": "Tool", - "type": "object", - "description": "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.", - "properties": { - "functionDeclarations": { - "items": { - "$ref": "FunctionDeclaration" + "countTextTokens": { + "response": { + "$ref": "CountTextTokensResponse" }, - "type": "array", - "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the [content.role] \"function\" generation context for the next model turn." + "path": "v1beta/{+model}:countTextTokens", + "httpMethod": "POST", + "parameters": { + "model": { + "pattern": "^models/[^/]+$", + "type": "string", + "required": true, + "description": "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}`", + "location": "path" + } + }, + "description": "Runs a model's tokenizer on a text and returns the token count.", + "flatPath": "v1beta/models/{modelsId}:countTextTokens", + "id": "generativelanguage.models.countTextTokens", + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "CountTextTokensRequest" + } } } }, - "Example": { - "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.", - "type": "object", - "id": "Example", - "properties": { - "output": { - "description": "Required. An example of what the model should output given the input.", - "$ref": "Message" - }, - "input": { - "$ref": "Message", - "description": "Required. An example of an input `Message` from the user." - } - } - }, - "FunctionCallingConfig": { - "description": "Configuration for specifying function calling behavior.", - "id": "FunctionCallingConfig", - "properties": { - "mode": { - "enum": [ - "MODE_UNSPECIFIED", - "AUTO", - "ANY", - "NONE" - ], - "enumDescriptions": [ - "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 repspose.", - "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." + "tunedModels": { + "methods": { + "transferOwnership": { + "description": "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.", + "parameterOrder": [ + "name" ], - "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.", - "type": "string" - }, - "allowedFunctionNames": { - "items": { - "type": "string" + "httpMethod": "POST", + "path": "v1beta/{+name}:transferOwnership", + "response": { + "$ref": "TransferOwnershipResponse" }, - "type": "array", - "description": "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." - } - }, - "type": "object" - }, - "GenerateTextRequest": { - "type": "object", - "properties": { - "topP": { - "description": "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.", - "format": "float", - "type": "number" - }, - "maxOutputTokens": { - "format": "int32", - "description": "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.", - "type": "integer" - }, - "safetySettings": { - "items": { - "$ref": "SafetySetting" + "id": "generativelanguage.tunedModels.transferOwnership", + "request": { + "$ref": "TransferOwnershipRequest" }, - "description": "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.", - "type": "array" - }, - "prompt": { - "description": "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.", - "$ref": "TextPrompt" - }, - "topK": { - "description": "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.", - "type": "integer", - "format": "int32" - }, - "candidateCount": { - "format": "int32", - "type": "integer", - "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1." + "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership", + "parameters": { + "name": { + "location": "path", + "pattern": "^tunedModels/[^/]+$", + "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", + "type": "string", + "required": true + } + } }, - "stopSequences": { - "items": { - "type": "string" + "patch": { + "response": { + "$ref": "TunedModel" }, - "type": "array", - "description": "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." - }, - "temperature": { - "description": "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.", - "type": "number", - "format": "float" - } - }, - "description": "Request to generate a text completion response from the model.", - "id": "GenerateTextRequest" - }, - "TextPrompt": { - "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.", - "id": "TextPrompt", - "type": "object", - "properties": { - "text": { - "description": "Required. The prompt text.", - "type": "string" - } - } - }, - "QueryCorpusResponse": { - "description": "Response from `QueryCorpus` containing a list of relevant chunks.", - "type": "object", - "id": "QueryCorpusResponse", - "properties": { - "relevantChunks": { - "items": { - "$ref": "RelevantChunk" + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "TunedModel" }, - "type": "array", - "description": "The relevant chunks." - } - } - }, - "Document": { - "properties": { - "createTime": { - "readOnly": true, - "type": "string", - "description": "Output only. The Timestamp of when the `Document` was created.", - "format": "google-datetime" - }, - "customMetadata": { - "items": { - "$ref": "CustomMetadata" + "parameters": { + "updateMask": { + "description": "Required. The list of fields to update.", + "location": "query", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "required": true, + "type": "string", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "description": "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\"" + } }, - "type": "array", - "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`." - }, - "updateTime": { - "type": "string", - "readOnly": true, - "format": "google-datetime", - "description": "Output only. The Timestamp of when the `Document` was last updated." + "httpMethod": "PATCH", + "description": "Updates a tuned model.", + "id": "generativelanguage.tunedModels.patch", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}" }, - "displayName": { - "type": "string", - "description": "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\"" + "list": { + "response": { + "$ref": "ListTunedModelsResponse" + }, + "parameters": { + "filter": { + "description": "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", + "location": "query", + "type": "string" + }, + "pageToken": { + "description": "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.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "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.", + "type": "integer" + } + }, + "path": "v1beta/tunedModels", + "flatPath": "v1beta/tunedModels", + "parameterOrder": [], + "httpMethod": "GET", + "description": "Lists tuned models owned by the user.", + "id": "generativelanguage.tunedModels.list" }, - "name": { - "type": "string", - "description": "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`" - } - }, - "id": "Document", - "description": "A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.", - "type": "object" - }, - "PromptFeedback": { - "properties": { - "blockReason": { - "enumDescriptions": [ - "Default value. This value is unused.", - "Prompt was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.", - "Prompt was blocked due to unknown reaasons." + "generateText": { + "request": { + "$ref": "GenerateTextRequest" + }, + "httpMethod": "POST", + "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText", + "description": "Generates a response from the model given an input message.", + "response": { + "$ref": "GenerateTextResponse" + }, + "path": "v1beta/{+model}:generateText", + "id": "generativelanguage.tunedModels.generateText", + "parameterOrder": [ + "model" ], - "type": "string", - "enum": [ - "BLOCK_REASON_UNSPECIFIED", - "SAFETY", - "OTHER" + "parameters": { + "model": { + "location": "path", + "type": "string", + "required": true, + "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", + "pattern": "^tunedModels/[^/]+$" + } + } + }, + "get": { + "parameterOrder": [ + "name" ], - "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase your prompt." + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}", + "id": "generativelanguage.tunedModels.get", + "parameters": { + "name": { + "required": true, + "location": "path", + "type": "string", + "pattern": "^tunedModels/[^/]+$", + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`" + } + }, + "response": { + "$ref": "TunedModel" + }, + "description": "Gets information about a specific TunedModel.", + "httpMethod": "GET" }, - "safetyRatings": { - "items": { - "$ref": "SafetyRating" + "create": { + "response": { + "$ref": "Operation" }, - "type": "array", - "description": "Ratings for safety of the prompt. There is at most one rating per category." - } - }, - "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", - "type": "object", - "id": "PromptFeedback" - }, - "Condition": { - "type": "object", - "id": "Condition", - "properties": { - "operation": { - "enumDescriptions": [ - "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`." - ], - "type": "string", - "description": "Required. Operator applied to the given key-value pair to trigger the condition.", - "enum": [ - "OPERATOR_UNSPECIFIED", - "LESS", - "LESS_EQUAL", - "EQUAL", - "GREATER_EQUAL", - "GREATER", - "NOT_EQUAL", - "INCLUDES", - "EXCLUDES" - ] + "parameters": { + "tunedModelId": { + "description": "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])?.", + "location": "query", + "type": "string" + } + }, + "request": { + "$ref": "TunedModel" + }, + "path": "v1beta/tunedModels", + "id": "generativelanguage.tunedModels.create", + "flatPath": "v1beta/tunedModels", + "httpMethod": "POST", + "parameterOrder": [], + "description": "Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222" }, - "numericValue": { - "description": "The numeric value to filter the metadata on.", - "type": "number", - "format": "float" + "delete": { + "description": "Deletes a tuned model.", + "flatPath": "v1beta/tunedModels/{tunedModelsId}", + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "required": true, + "location": "path", + "pattern": "^tunedModels/[^/]+$", + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", + "type": "string" + } + }, + "id": "generativelanguage.tunedModels.delete", + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "path": "v1beta/{+name}" }, - "stringValue": { - "description": "The string value to filter the metadata on.", - "type": "string" + "generateContent": { + "response": { + "$ref": "GenerateContentResponse" + }, + "id": "generativelanguage.tunedModels.generateContent", + "httpMethod": "POST", + "request": { + "$ref": "GenerateContentRequest" + }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", + "location": "path", + "pattern": "^tunedModels/[^/]+$", + "type": "string", + "required": true + } + }, + "path": "v1beta/{+model}:generateContent", + "description": "Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.", + "parameterOrder": [ + "model" + ] } }, - "description": "Filter condition applicable to a single key." + "resources": { + "permissions": { + "methods": { + "create": { + "request": { + "$ref": "Permission" + }, + "id": "generativelanguage.tunedModels.permissions.create", + "description": "Create a permission to a specific resource.", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Permission" + }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", + "parameters": { + "parent": { + "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "type": "string", + "pattern": "^tunedModels/[^/]+$", + "required": true, + "location": "path" + } + }, + "httpMethod": "POST", + "path": "v1beta/{+parent}/permissions" + }, + "delete": { + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "parameterOrder": [ + "name" + ], + "path": "v1beta/{+name}", + "id": "generativelanguage.tunedModels.permissions.delete", + "description": "Deletes the permission.", + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", + "required": true, + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "location": "path", + "type": "string" + } + } + }, + "patch": { + "request": { + "$ref": "Permission" + }, + "parameters": { + "name": { + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "required": true, + "type": "string", + "location": "path" + }, + "updateMask": { + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", + "type": "string", + "format": "google-fieldmask", + "location": "query" + } + }, + "description": "Updates the permission.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.tunedModels.permissions.patch", + "httpMethod": "PATCH", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "response": { + "$ref": "Permission" + }, + "path": "v1beta/{+name}" + }, + "get": { + "description": "Gets information about a specific Permission.", + "parameters": { + "name": { + "required": true, + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "type": "string", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", + "location": "path" + } + }, + "httpMethod": "GET", + "path": "v1beta/{+name}", + "id": "generativelanguage.tunedModels.permissions.get", + "parameterOrder": [ + "name" + ], + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "response": { + "$ref": "Permission" + } + }, + "list": { + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", + "parameterOrder": [ + "parent" + ], + "id": "generativelanguage.tunedModels.permissions.list", + "description": "Lists permissions for the specific resource.", + "parameters": { + "pageSize": { + "format": "int32", + "description": "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.", + "type": "integer", + "location": "query" + }, + "parent": { + "pattern": "^tunedModels/[^/]+$", + "required": true, + "location": "path", + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "type": "string" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "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." + } + }, + "path": "v1beta/{+parent}/permissions", + "response": { + "$ref": "ListPermissionsResponse" + }, + "httpMethod": "GET" + } + } + } + } }, - "BatchEmbedTextResponse": { - "description": "The response to a EmbedTextRequest.", - "id": "BatchEmbedTextResponse", - "properties": { - "embeddings": { - "description": "Output only. The embeddings generated from the input text.", - "readOnly": true, - "type": "array", - "items": { - "$ref": "Embedding" + "corpora": { + "resources": { + "permissions": { + "methods": { + "get": { + "parameters": { + "name": { + "required": true, + "pattern": "^corpora/[^/]+/permissions/[^/]+$", + "location": "path", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "type": "string" + } + }, + "id": "generativelanguage.corpora.permissions.get", + "path": "v1beta/{+name}", + "parameterOrder": [ + "name" + ], + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "httpMethod": "GET", + "description": "Gets information about a specific Permission.", + "response": { + "$ref": "Permission" + } + }, + "list": { + "path": "v1beta/{+parent}/permissions", + "id": "generativelanguage.corpora.permissions.list", + "description": "Lists permissions for the specific resource.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListPermissionsResponse" + }, + "flatPath": "v1beta/corpora/{corporaId}/permissions", + "parameters": { + "pageToken": { + "type": "string", + "location": "query", + "description": "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." + }, + "parent": { + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^corpora/[^/]+$", + "type": "string", + "location": "path", + "required": true + }, + "pageSize": { + "location": "query", + "type": "integer", + "description": "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.", + "format": "int32" + } + } + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "id": "generativelanguage.corpora.permissions.delete", + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "description": "Deletes the permission.", + "path": "v1beta/{+name}", + "parameters": { + "name": { + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "location": "path", + "pattern": "^corpora/[^/]+/permissions/[^/]+$", + "required": true, + "type": "string" + } + } + }, + "patch": { + "path": "v1beta/{+name}", + "description": "Updates the permission.", + "id": "generativelanguage.corpora.permissions.patch", + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "response": { + "$ref": "Permission" + }, + "request": { + "$ref": "Permission" + }, + "parameters": { + "name": { + "required": true, + "pattern": "^corpora/[^/]+/permissions/[^/]+$", + "location": "path", + "description": "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.", + "type": "string" + }, + "updateMask": { + "format": "google-fieldmask", + "type": "string", + "location": "query", + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)" + } + } + }, + "create": { + "parameters": { + "parent": { + "required": true, + "type": "string", + "location": "path", + "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^corpora/[^/]+$" + } + }, + "response": { + "$ref": "Permission" + }, + "path": "v1beta/{+parent}/permissions", + "request": { + "$ref": "Permission" + }, + "flatPath": "v1beta/corpora/{corporaId}/permissions", + "description": "Create a permission to a specific resource.", + "httpMethod": "POST", + "id": "generativelanguage.corpora.permissions.create", + "parameterOrder": [ + "parent" + ] + } + } + }, + "documents": { + "methods": { + "delete": { + "path": "v1beta/{+name}", + "httpMethod": "DELETE", + "parameters": { + "force": { + "description": "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.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Required. The resource name of the `Document` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc`", + "type": "string", + "pattern": "^corpora/[^/]+/documents/[^/]+$", + "location": "path", + "required": true + } + }, + "id": "generativelanguage.corpora.documents.delete", + "response": { + "$ref": "Empty" + }, + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}", + "parameterOrder": [ + "name" + ], + "description": "Deletes a `Document`." + }, + "create": { + "flatPath": "v1beta/corpora/{corporaId}/documents", + "httpMethod": "POST", + "request": { + "$ref": "Document" + }, + "id": "generativelanguage.corpora.documents.create", + "path": "v1beta/{+parent}/documents", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "required": true, + "pattern": "^corpora/[^/]+$", + "type": "string", + "location": "path", + "description": "Required. The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`" + } + }, + "response": { + "$ref": "Document" + }, + "description": "Creates an empty `Document`." + }, + "patch": { + "path": "v1beta/{+name}", + "response": { + "$ref": "Document" + }, + "httpMethod": "PATCH", + "id": "generativelanguage.corpora.documents.patch", + "description": "Updates a `Document`.", + "parameters": { + "name": { + "required": true, + "location": "path", + "description": "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`", + "pattern": "^corpora/[^/]+/documents/[^/]+$", + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to update. Currently, this only supports updating `display_name` and `custom_metadata`.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "request": { + "$ref": "Document" + }, + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}", + "parameterOrder": [ + "name" + ] + }, + "list": { + "response": { + "$ref": "ListDocumentsResponse" + }, + "parameters": { + "pageToken": { + "description": "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.", + "location": "query", + "type": "string" + }, + "parent": { + "required": true, + "pattern": "^corpora/[^/]+$", + "description": "Required. The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`", + "type": "string", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "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.", + "location": "query", + "format": "int32" + } + }, + "path": "v1beta/{+parent}/documents", + "id": "generativelanguage.corpora.documents.list", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "description": "Lists all `Document`s in a `Corpus`.", + "flatPath": "v1beta/corpora/{corporaId}/documents" + }, + "get": { + "parameters": { + "name": { + "description": "Required. The name of the `Document` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc`", + "location": "path", + "required": true, + "pattern": "^corpora/[^/]+/documents/[^/]+$", + "type": "string" + } + }, + "id": "generativelanguage.corpora.documents.get", + "description": "Gets information about a specific `Document`.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "path": "v1beta/{+name}", + "response": { + "$ref": "Document" + }, + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}" + }, + "query": { + "description": "Performs semantic search over a `Document`.", + "path": "v1beta/{+name}:query", + "response": { + "$ref": "QueryDocumentResponse" + }, + "request": { + "$ref": "QueryDocumentRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.corpora.documents.query", + "parameters": { + "name": { + "type": "string", + "required": true, + "description": "Required. The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`", + "location": "path", + "pattern": "^corpora/[^/]+/documents/[^/]+$" + } + }, + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}:query" + } + }, + "resources": { + "chunks": { + "methods": { + "batchCreate": { + "httpMethod": "POST", + "request": { + "$ref": "BatchCreateChunksRequest" + }, + "parameterOrder": [ + "parent" + ], + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchCreate", + "response": { + "$ref": "BatchCreateChunksResponse" + }, + "path": "v1beta/{+parent}/chunks:batchCreate", + "parameters": { + "parent": { + "pattern": "^corpora/[^/]+/documents/[^/]+$", + "location": "path", + "required": true, + "description": "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`", + "type": "string" + } + }, + "id": "generativelanguage.corpora.documents.chunks.batchCreate", + "description": "Batch create `Chunk`s." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Chunk" + }, + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks", + "parameters": { + "parent": { + "pattern": "^corpora/[^/]+/documents/[^/]+$", + "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`", + "type": "string", + "location": "path", + "required": true + } + }, + "id": "generativelanguage.corpora.documents.chunks.create", + "description": "Creates a `Chunk`.", + "path": "v1beta/{+parent}/chunks", + "response": { + "$ref": "Chunk" + } + }, + "patch": { + "description": "Updates a `Chunk`.", + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Chunk" + }, + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}", + "response": { + "$ref": "Chunk" + }, + "httpMethod": "PATCH", + "id": "generativelanguage.corpora.documents.chunks.patch", + "path": "v1beta/{+name}", + "parameters": { + "name": { + "location": "path", + "description": "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`", + "type": "string", + "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$", + "required": true + }, + "updateMask": { + "type": "string", + "location": "query", + "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.", + "format": "google-fieldmask" + } + } + }, + "list": { + "id": "generativelanguage.corpora.documents.chunks.list", + "response": { + "$ref": "ListChunksResponse" + }, + "httpMethod": "GET", + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks", + "description": "Lists all `Chunk`s in a `Document`.", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageToken": { + "type": "string", + "location": "query", + "description": "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." + }, + "parent": { + "description": "Required. The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`", + "type": "string", + "location": "path", + "required": true, + "pattern": "^corpora/[^/]+/documents/[^/]+$" + }, + "pageSize": { + "location": "query", + "format": "int32", + "type": "integer", + "description": "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." + } + }, + "path": "v1beta/{+parent}/chunks" + }, + "delete": { + "parameters": { + "name": { + "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`", + "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$", + "required": true, + "type": "string", + "location": "path" + } + }, + "description": "Deletes a `Chunk`.", + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}", + "response": { + "$ref": "Empty" + }, + "path": "v1beta/{+name}", + "id": "generativelanguage.corpora.documents.chunks.delete", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ] + }, + "batchUpdate": { + "parameters": { + "parent": { + "location": "path", + "type": "string", + "required": true, + "pattern": "^corpora/[^/]+/documents/[^/]+$", + "description": "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`" + } + }, + "response": { + "$ref": "BatchUpdateChunksResponse" + }, + "description": "Batch update `Chunk`s.", + "parameterOrder": [ + "parent" + ], + "id": "generativelanguage.corpora.documents.chunks.batchUpdate", + "httpMethod": "POST", + "request": { + "$ref": "BatchUpdateChunksRequest" + }, + "path": "v1beta/{+parent}/chunks:batchUpdate", + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchUpdate" + }, + "get": { + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.corpora.documents.chunks.get", + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}", + "httpMethod": "GET", + "response": { + "$ref": "Chunk" + }, + "description": "Gets information about a specific `Chunk`.", + "path": "v1beta/{+name}", + "parameters": { + "name": { + "description": "Required. The name of the `Chunk` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`", + "type": "string", + "location": "path", + "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$", + "required": true + } + } + }, + "batchDelete": { + "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchDelete", + "parameters": { + "parent": { + "required": true, + "pattern": "^corpora/[^/]+/documents/[^/]+$", + "type": "string", + "description": "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`", + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Empty" + }, + "id": "generativelanguage.corpora.documents.chunks.batchDelete", + "request": { + "$ref": "BatchDeleteChunksRequest" + }, + "path": "v1beta/{+parent}/chunks:batchDelete", + "httpMethod": "POST", + "description": "Batch delete `Chunk`s." + } + } + } } } }, - "type": "object" - }, - "TextCompletion": { - "properties": { - "safetyRatings": { - "description": "Ratings for the safety of a response. There is at most one rating per category.", - "type": "array", - "items": { - "$ref": "SafetyRating" + "methods": { + "patch": { + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Corpus" + }, + "flatPath": "v1beta/corpora/{corporaId}", + "httpMethod": "PATCH", + "id": "generativelanguage.corpora.patch", + "path": "v1beta/{+name}", + "description": "Updates a `Corpus`.", + "request": { + "$ref": "Corpus" + }, + "parameters": { + "name": { + "location": "path", + "required": true, + "pattern": "^corpora/[^/]+$", + "type": "string", + "description": "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`" + }, + "updateMask": { + "location": "query", + "type": "string", + "description": "Required. The list of fields to update. Currently, this only supports updating `display_name`.", + "format": "google-fieldmask" + } } }, - "output": { - "type": "string", - "description": "Output only. The generated text returned from the model.", - "readOnly": true - }, - "citationMetadata": { - "readOnly": true, - "description": "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`.", - "$ref": "CitationMetadata" - } - }, - "description": "Output text returned from a model.", - "type": "object", - "id": "TextCompletion" - }, - "SafetyFeedback": { - "properties": { - "rating": { - "$ref": "SafetyRating", - "description": "Safety rating evaluated from content." + "query": { + "parameters": { + "name": { + "description": "Required. The name of the `Corpus` to query. Example: `corpora/my-corpus-123`", + "pattern": "^corpora/[^/]+$", + "type": "string", + "location": "path", + "required": true + } + }, + "id": "generativelanguage.corpora.query", + "httpMethod": "POST", + "flatPath": "v1beta/corpora/{corporaId}:query", + "request": { + "$ref": "QueryCorpusRequest" + }, + "response": { + "$ref": "QueryCorpusResponse" + }, + "path": "v1beta/{+name}:query", + "description": "Performs semantic search over a `Corpus`.", + "parameterOrder": [ + "name" + ] }, - "setting": { - "$ref": "SafetySetting", - "description": "Safety settings applied to the request." - } - }, - "description": "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.", - "type": "object", - "id": "SafetyFeedback" - }, - "CountTokensResponse": { - "id": "CountTokensResponse", - "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.", - "properties": { - "totalTokens": { - "format": "int32", - "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", - "type": "integer" - } - }, - "type": "object" - }, - "Hyperparameters": { - "properties": { - "learningRateMultiplier": { - "format": "float", - "description": "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.", - "type": "number" + "list": { + "parameterOrder": [], + "path": "v1beta/corpora", + "id": "generativelanguage.corpora.list", + "flatPath": "v1beta/corpora", + "description": "Lists all `Corpora` owned by the user.", + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "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.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "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.", + "type": "integer" + } + }, + "response": { + "$ref": "ListCorporaResponse" + } }, - "epochCount": { - "type": "integer", - "format": "int32", - "description": "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." + "create": { + "flatPath": "v1beta/corpora", + "parameters": {}, + "request": { + "$ref": "Corpus" + }, + "httpMethod": "POST", + "description": "Creates an empty `Corpus`.", + "response": { + "$ref": "Corpus" + }, + "path": "v1beta/corpora", + "id": "generativelanguage.corpora.create", + "parameterOrder": [] }, - "learningRate": { - "type": "number", - "description": "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.", - "format": "float" + "get": { + "parameters": { + "name": { + "location": "path", + "required": true, + "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`", + "pattern": "^corpora/[^/]+$", + "type": "string" + } + }, + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "flatPath": "v1beta/corpora/{corporaId}", + "response": { + "$ref": "Corpus" + }, + "path": "v1beta/{+name}", + "description": "Gets information about a specific `Corpus`.", + "id": "generativelanguage.corpora.get" }, - "batchSize": { - "type": "integer", - "format": "int32", - "description": "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." + "delete": { + "flatPath": "v1beta/corpora/{corporaId}", + "response": { + "$ref": "Empty" + }, + "parameters": { + "force": { + "description": "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.", + "location": "query", + "type": "boolean" + }, + "name": { + "type": "string", + "location": "path", + "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", + "pattern": "^corpora/[^/]+$", + "required": true + } + }, + "httpMethod": "DELETE", + "id": "generativelanguage.corpora.delete", + "description": "Deletes a `Corpus`.", + "parameterOrder": [ + "name" + ], + "path": "v1beta/{+name}" } - }, - "type": "object", - "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", - "id": "Hyperparameters" + } } }, + "version_module": true, + "protocol": "rest", + "canonicalName": "Generative Language", + "name": "generativelanguage", "ownerDomain": "google.com", - "description": "The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information. including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more." + "basePath": "", + "rootUrl": "https://generativelanguage.googleapis.com/", + "ownerName": "Google", + "discoveryVersion": "v1", + "description": "The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "servicePath": "", + "title": "Generative Language API", + "revision": "20240418", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/", + "fullyEncodeReservedExpansion": true, + "batchPath": "batch" }