{ "openapi": "3.0.0", "info": { "title": "Generative Language API", "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.", "contact": { "name": "Google", "url": "https://google.com" }, "version": "v1beta", "license": { "name": "Creative Commons Attribution 3.0", "url": "http://creativecommons.org/licenses/by/3.0/" }, "termsOfService": "https://developers.google.com/terms/" }, "servers": [ { "url": "https://generativelanguage.googleapis.com/" } ], "components": { "schemas": { "AttributionSourceId": { "description": "Identifier for the source contributing to this attribution.", "properties": { "groundingPassage": { "$ref": "#/components/schemas/GroundingPassageId", "description": "Identifier for an inline passage." }, "semanticRetrieverChunk": { "$ref": "#/components/schemas/SemanticRetrieverChunk", "description": "Identifier for a `Chunk` fetched via Semantic Retriever." } }, "type": "object" }, "BatchCreateChunksRequest": { "description": "Request to batch create `Chunk`s.", "properties": { "requests": { "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": "#/components/schemas/CreateChunkRequest" }, "type": "array" } }, "type": "object" }, "BatchCreateChunksResponse": { "description": "Response from `BatchCreateChunks` containing a list of created `Chunk`s.", "properties": { "chunks": { "description": "`Chunk`s created.", "items": { "$ref": "#/components/schemas/Chunk" }, "type": "array" } }, "type": "object" }, "BatchDeleteChunksRequest": { "description": "Request to batch delete `Chunk`s.", "properties": { "requests": { "description": "Required. The request messages specifying the `Chunk`s to delete.", "items": { "$ref": "#/components/schemas/DeleteChunkRequest" }, "type": "array" } }, "type": "object" }, "BatchEmbedContentsRequest": { "description": "Batch request to get embeddings from the model for a list of prompts.", "properties": { "requests": { "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.", "items": { "$ref": "#/components/schemas/EmbedContentRequest" }, "type": "array" } }, "type": "object" }, "BatchEmbedContentsResponse": { "description": "The response to a `BatchEmbedContentsRequest`.", "properties": { "embeddings": { "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.", "items": { "$ref": "#/components/schemas/ContentEmbedding" }, "readOnly": true, "type": "array" } }, "type": "object" }, "BatchEmbedTextRequest": { "description": "Batch request to get a text embedding from the model.", "properties": { "requests": { "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.", "items": { "$ref": "#/components/schemas/EmbedTextRequest" }, "type": "array" }, "texts": { "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.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "BatchEmbedTextResponse": { "description": "The response to a EmbedTextRequest.", "properties": { "embeddings": { "description": "Output only. The embeddings generated from the input text.", "items": { "$ref": "#/components/schemas/Embedding" }, "readOnly": true, "type": "array" } }, "type": "object" }, "BatchUpdateChunksRequest": { "description": "Request to batch update `Chunk`s.", "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.", "items": { "$ref": "#/components/schemas/UpdateChunkRequest" }, "type": "array" } }, "type": "object" }, "BatchUpdateChunksResponse": { "description": "Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.", "properties": { "chunks": { "description": "`Chunk`s updated.", "items": { "$ref": "#/components/schemas/Chunk" }, "type": "array" } }, "type": "object" }, "Blob": { "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.", "properties": { "data": { "description": "Raw bytes for media formats.", "format": "byte", "type": "string" }, "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" } }, "type": "object" }, "Blobstore2Info": { "description": "Information to read/write to blobstore2.", "properties": { "blobGeneration": { "description": "The blob generation id.", "format": "int64", "type": "string" }, "blobId": { "description": "The blob id, e.g., /blobstore/prod/playground/scotty", "type": "string" }, "downloadReadHandle": { "description": "Read handle passed from Bigstore -> Scotty for a GCS download. This is a signed, serialized blobstore2.ReadHandle proto which must never be set outside of Bigstore, and is not applicable to non-GCS media downloads.", "format": "byte", "type": "string" }, "readToken": { "description": "The blob read token. Needed to read blobs that have not been replicated. Might not be available until the final call.", "type": "string" }, "uploadMetadataContainer": { "description": "Metadata passed from Blobstore -> Scotty for a new GCS upload. This is a signed, serialized blobstore2.BlobMetadataContainer proto which must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", "format": "byte", "type": "string" } }, "type": "object" }, "CachedContent": { "description": "Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for.", "properties": { "contents": { "description": "Optional. Input only. Immutable. The content to cache.", "items": { "$ref": "#/components/schemas/Content" }, "type": "array" }, "createTime": { "description": "Output only. Creation time of the cache entry.", "format": "google-datetime", "readOnly": true, "type": "string" }, "displayName": { "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.", "type": "string" }, "expireTime": { "description": "Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.", "format": "google-datetime", "type": "string" }, "model": { "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`", "type": "string" }, "name": { "description": "Optional. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", "type": "string" }, "systemInstruction": { "$ref": "#/components/schemas/Content", "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only." }, "toolConfig": { "$ref": "#/components/schemas/ToolConfig", "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools." }, "tools": { "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response", "items": { "$ref": "#/components/schemas/Tool" }, "type": "array" }, "ttl": { "description": "Input only. New TTL for this resource, input only.", "format": "google-duration", "type": "string" }, "updateTime": { "description": "Output only. When the cache entry was last updated in UTC time.", "format": "google-datetime", "readOnly": true, "type": "string" }, "usageMetadata": { "$ref": "#/components/schemas/CachedContentUsageMetadata", "description": "Output only. Metadata on the usage of the cached content.", "readOnly": true } }, "type": "object" }, "CachedContentUsageMetadata": { "description": "Metadata on the usage of the cached content.", "properties": { "totalTokenCount": { "description": "Total number of tokens that the cached content consumes.", "format": "int32", "type": "integer" } }, "type": "object" }, "Candidate": { "description": "A response candidate generated from the model.", "properties": { "avgLogprobs": { "description": "Output only. ", "format": "double", "readOnly": true, "type": "number" }, "citationMetadata": { "$ref": "#/components/schemas/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 }, "content": { "$ref": "#/components/schemas/Content", "description": "Output only. Generated content returned from the model.", "readOnly": true }, "finishReason": { "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.", "enum": [ "FINISH_REASON_UNSPECIFIED", "STOP", "MAX_TOKENS", "SAFETY", "RECITATION", "LANGUAGE", "OTHER", "BLOCKLIST", "PROHIBITED_CONTENT", "SPII", "MALFORMED_FUNCTION_CALL" ], "readOnly": true, "type": "string" }, "groundingAttributions": { "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", "items": { "$ref": "#/components/schemas/GroundingAttribution" }, "readOnly": true, "type": "array" }, "groundingMetadata": { "$ref": "#/components/schemas/GroundingMetadata", "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.", "readOnly": true }, "index": { "description": "Output only. Index of the candidate in the list of response candidates.", "format": "int32", "readOnly": true, "type": "integer" }, "logprobsResult": { "$ref": "#/components/schemas/LogprobsResult", "description": "Output only. Log-likelihood scores for the response tokens and top tokens", "readOnly": true }, "safetyRatings": { "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", "items": { "$ref": "#/components/schemas/SafetyRating" }, "type": "array" }, "tokenCount": { "description": "Output only. Token count for this candidate.", "format": "int32", "readOnly": true, "type": "integer" } }, "type": "object" }, "Chunk": { "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.", "properties": { "createTime": { "description": "Output only. The Timestamp of when the `Chunk` was created.", "format": "google-datetime", "readOnly": true, "type": "string" }, "customMetadata": { "description": "Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20.", "items": { "$ref": "#/components/schemas/CustomMetadata" }, "type": "array" }, "data": { "$ref": "#/components/schemas/ChunkData", "description": "Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043." }, "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" }, "state": { "description": "Output only. Current state of the `Chunk`.", "enum": [ "STATE_UNSPECIFIED", "STATE_PENDING_PROCESSING", "STATE_ACTIVE", "STATE_FAILED" ], "readOnly": true, "type": "string" }, "updateTime": { "description": "Output only. The Timestamp of when the `Chunk` was last updated.", "format": "google-datetime", "readOnly": true, "type": "string" } }, "type": "object" }, "ChunkData": { "description": "Extracted data that represents the `Chunk` content.", "properties": { "stringValue": { "description": "The `Chunk` content as a string. The maximum number of tokens per chunk is 2043.", "type": "string" } }, "type": "object" }, "CitationMetadata": { "description": "A collection of source attributions for a piece of content.", "properties": { "citationSources": { "description": "Citations to sources for a specific response.", "items": { "$ref": "#/components/schemas/CitationSource" }, "type": "array" } }, "type": "object" }, "CitationSource": { "description": "A citation to a source for a portion of a specific response.", "properties": { "endIndex": { "description": "Optional. End of the attributed segment, exclusive.", "format": "int32", "type": "integer" }, "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" }, "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" }, "uri": { "description": "Optional. URI that is attributed as a source for a portion of the text.", "type": "string" } }, "type": "object" }, "CodeExecution": { "description": "Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.", "properties": {}, "type": "object" }, "CodeExecutionResult": { "description": "Result of executing the `ExecutableCode`. Only generated when using the `CodeExecution`, and always follows a `part` containing the `ExecutableCode`.", "properties": { "outcome": { "description": "Required. Outcome of the code execution.", "enum": [ "OUTCOME_UNSPECIFIED", "OUTCOME_OK", "OUTCOME_FAILED", "OUTCOME_DEADLINE_EXCEEDED" ], "type": "string" }, "output": { "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.", "type": "string" } }, "type": "object" }, "CompositeMedia": { "description": "A sequence of media data references representing composite data. Introduced to support Bigstore composite objects. For details, visit http://go/bigstore-composites.", "properties": { "blobRef": { "deprecated": true, "description": "Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.", "format": "byte", "type": "string" }, "blobstore2Info": { "$ref": "#/components/schemas/Blobstore2Info", "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob." }, "cosmoBinaryReference": { "description": "A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.", "format": "byte", "type": "string" }, "crc32cHash": { "description": "crc32.c hash for the payload.", "format": "uint32", "type": "integer" }, "inline": { "description": "Media data, set if reference_type is INLINE", "format": "byte", "type": "string" }, "length": { "description": "Size of the data, in bytes", "format": "int64", "type": "string" }, "md5Hash": { "description": "MD5 hash for the payload.", "format": "byte", "type": "string" }, "objectId": { "$ref": "#/components/schemas/ObjectId", "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF." }, "path": { "description": "Path to the data, set if reference_type is PATH", "type": "string" }, "referenceType": { "description": "Describes what the field reference contains.", "enum": [ "PATH", "BLOB_REF", "INLINE", "BIGSTORE_REF", "COSMO_BINARY_REFERENCE" ], "type": "string" }, "sha1Hash": { "description": "SHA-1 hash for the payload.", "format": "byte", "type": "string" } }, "type": "object" }, "Condition": { "description": "Filter condition applicable to a single key.", "properties": { "numericValue": { "description": "The numeric value to filter the metadata on.", "format": "float", "type": "number" }, "operation": { "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" ], "type": "string" }, "stringValue": { "description": "The string value to filter the metadata on.", "type": "string" } }, "type": "object" }, "Content": { "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.", "properties": { "parts": { "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.", "items": { "$ref": "#/components/schemas/Part" }, "type": "array" }, "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" } }, "type": "object" }, "ContentEmbedding": { "description": "A list of floats representing an embedding.", "properties": { "values": { "description": "The embedding values.", "items": { "format": "float", "type": "number" }, "type": "array" } }, "type": "object" }, "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.", "properties": { "message": { "description": "A string that describes the filtering behavior in more detail.", "type": "string" }, "reason": { "description": "The reason content was blocked during request processing.", "enum": [ "BLOCKED_REASON_UNSPECIFIED", "SAFETY", "OTHER" ], "type": "string" } }, "type": "object" }, "ContentTypeInfo": { "description": "Detailed Content-Type information from Scotty. The Content-Type of the media will typically be filled in by the header or Scotty's best_guess, but this extended information provides the backend with more information so that it can make a better decision if needed. This is only used on media upload requests from Scotty.", "properties": { "bestGuess": { "description": "Scotty's best guess of what the content type of the file is.", "type": "string" }, "fromBytes": { "description": "The content type of the file derived by looking at specific bytes (i.e. \"magic bytes\") of the actual file.", "type": "string" }, "fromFileName": { "description": "The content type of the file derived from the file extension of the original file name used by the client.", "type": "string" }, "fromHeader": { "description": "The content type of the file as specified in the request headers, multipart headers, or RUPIO start request.", "type": "string" }, "fromUrlPath": { "description": "The content type of the file derived from the file extension of the URL path. The URL path is assumed to represent a file name (which is typically only true for agents that are providing a REST API).", "type": "string" } }, "type": "object" }, "Corpus": { "description": "A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.", "properties": { "createTime": { "description": "Output only. The Timestamp of when the `Corpus` was created.", "format": "google-datetime", "readOnly": true, "type": "string" }, "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" }, "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" }, "updateTime": { "description": "Output only. The Timestamp of when the `Corpus` was last updated.", "format": "google-datetime", "readOnly": true, "type": "string" } }, "type": "object" }, "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`.", "properties": { "prompt": { "$ref": "#/components/schemas/MessagePrompt", "description": "Required. The prompt, whose token count is to be returned." } }, "type": "object" }, "CountMessageTokensResponse": { "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.", "properties": { "tokenCount": { "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", "format": "int32", "type": "integer" } }, "type": "object" }, "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`.", "properties": { "prompt": { "$ref": "#/components/schemas/TextPrompt", "description": "Required. The free-form input text given to the model as a prompt." } }, "type": "object" }, "CountTextTokensResponse": { "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.", "properties": { "tokenCount": { "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", "format": "int32", "type": "integer" } }, "type": "object" }, "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`.", "properties": { "contents": { "description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.", "items": { "$ref": "#/components/schemas/Content" }, "type": "array" }, "generateContentRequest": { "$ref": "#/components/schemas/GenerateContentRequest", "description": "Optional. The overall input given to the `Model`. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). `Model`s/`Content`s and `generate_content_request`s are mutually exclusive. You can either send `Model` + `Content`s or a `generate_content_request`, but never both." } }, "type": "object" }, "CountTokensResponse": { "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.", "properties": { "cachedContentTokenCount": { "description": "Number of tokens in the cached part of the prompt (the cached content).", "format": "int32", "type": "integer" }, "totalTokens": { "description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative.", "format": "int32", "type": "integer" } }, "type": "object" }, "CreateChunkRequest": { "description": "Request to create a `Chunk`.", "properties": { "chunk": { "$ref": "#/components/schemas/Chunk", "description": "Required. The `Chunk` to create." }, "parent": { "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`", "type": "string" } }, "type": "object" }, "CreateFileRequest": { "description": "Request for `CreateFile`.", "properties": { "file": { "$ref": "#/components/schemas/File", "description": "Optional. Metadata for the file to create." } }, "type": "object" }, "CreateFileResponse": { "description": "Response for `CreateFile`.", "properties": { "file": { "$ref": "#/components/schemas/File", "description": "Metadata for the created file." } }, "type": "object" }, "CustomMetadata": { "description": "User provided metadata stored as key-value pairs.", "properties": { "key": { "description": "Required. The key of the metadata to store.", "type": "string" }, "numericValue": { "description": "The numeric value of the metadata to store.", "format": "float", "type": "number" }, "stringListValue": { "$ref": "#/components/schemas/StringList", "description": "The StringList value of the metadata to store." }, "stringValue": { "description": "The string value of the metadata to store.", "type": "string" } }, "type": "object" }, "Dataset": { "description": "Dataset for training or validation.", "properties": { "examples": { "$ref": "#/components/schemas/TuningExamples", "description": "Optional. Inline examples with simple input/output text." } }, "type": "object" }, "DeleteChunkRequest": { "description": "Request to delete a `Chunk`.", "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" } }, "type": "object" }, "DiffChecksumsResponse": { "description": "Backend response for a Diff get checksums response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "properties": { "checksumsLocation": { "$ref": "#/components/schemas/CompositeMedia", "description": "Exactly one of these fields must be populated. If checksums_location is filled, the server will return the corresponding contents to the user. If object_location is filled, the server will calculate the checksums based on the content there and return that to the user. For details on the format of the checksums, see http://go/scotty-diff-protocol." }, "chunkSizeBytes": { "description": "The chunk size of checksums. Must be a multiple of 256KB.", "format": "int64", "type": "string" }, "objectLocation": { "$ref": "#/components/schemas/CompositeMedia", "description": "If set, calculate the checksums based on the contents and return them to the caller." }, "objectSizeBytes": { "description": "The total size of the server object.", "format": "int64", "type": "string" }, "objectVersion": { "description": "The object version of the object the checksums are being returned for.", "type": "string" } }, "type": "object" }, "DiffDownloadResponse": { "description": "Backend response for a Diff download response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "properties": { "objectLocation": { "$ref": "#/components/schemas/CompositeMedia", "description": "The original object location." } }, "type": "object" }, "DiffUploadRequest": { "description": "A Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "properties": { "checksumsInfo": { "$ref": "#/components/schemas/CompositeMedia", "description": "The location of the checksums for the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. For details on the format of the checksums, see http://go/scotty-diff-protocol." }, "objectInfo": { "$ref": "#/components/schemas/CompositeMedia", "description": "The location of the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received." }, "objectVersion": { "description": "The object version of the object that is the base version the incoming diff script will be applied to. This field will always be filled in.", "type": "string" } }, "type": "object" }, "DiffUploadResponse": { "description": "Backend response for a Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "properties": { "objectVersion": { "description": "The object version of the object at the server. Must be included in the end notification response. The version in the end notification response must correspond to the new version of the object that is now stored at the server, after the upload.", "type": "string" }, "originalObject": { "$ref": "#/components/schemas/CompositeMedia", "description": "The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification." } }, "type": "object" }, "DiffVersionResponse": { "description": "Backend response for a Diff get version response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "properties": { "objectSizeBytes": { "description": "The total size of the server object.", "format": "int64", "type": "string" }, "objectVersion": { "description": "The version of the object stored at the server.", "type": "string" } }, "type": "object" }, "Document": { "description": "A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.", "properties": { "createTime": { "description": "Output only. The Timestamp of when the `Document` was created.", "format": "google-datetime", "readOnly": true, "type": "string" }, "customMetadata": { "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": "#/components/schemas/CustomMetadata" }, "type": "array" }, "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" }, "name": { "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`", "type": "string" }, "updateTime": { "description": "Output only. The Timestamp of when the `Document` was last updated.", "format": "google-datetime", "readOnly": true, "type": "string" } }, "type": "object" }, "DownloadParameters": { "description": "Parameters specific to media downloads.", "properties": { "allowGzipCompression": { "description": "A boolean to be returned in the response to Scotty. Allows/disallows gzip encoding of the payload content when the server thinks it's advantageous (hence, does not guarantee compression) which allows Scotty to GZip the response to the client.", "type": "boolean" }, "ignoreRange": { "description": "Determining whether or not Apiary should skip the inclusion of any Content-Range header on its response to Scotty.", "type": "boolean" } }, "type": "object" }, "DynamicRetrievalConfig": { "description": "Describes the options to customize dynamic retrieval.", "properties": { "dynamicThreshold": { "description": "The threshold to be used in dynamic retrieval. If not set, a system default value is used.", "format": "float", "type": "number" }, "mode": { "description": "The mode of the predictor to be used in dynamic retrieval.", "enum": [ "MODE_UNSPECIFIED", "MODE_DYNAMIC" ], "type": "string" } }, "type": "object" }, "EmbedContentRequest": { "description": "Request containing the `Content` for the model to embed.", "properties": { "content": { "$ref": "#/components/schemas/Content", "description": "Required. The content to embed. Only the `parts.text` fields will be counted." }, "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 only. You cannot set this value if using the earlier model (`models/embedding-001`).", "format": "int32", "type": "integer" }, "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", "RETRIEVAL_DOCUMENT", "SEMANTIC_SIMILARITY", "CLASSIFICATION", "CLUSTERING", "QUESTION_ANSWERING", "FACT_VERIFICATION" ], "type": "string" }, "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" } }, "type": "object" }, "EmbedContentResponse": { "description": "The response to an `EmbedContentRequest`.", "properties": { "embedding": { "$ref": "#/components/schemas/ContentEmbedding", "description": "Output only. The embedding generated from the input content.", "readOnly": true } }, "type": "object" }, "Embedding": { "description": "A list of floats representing the embedding.", "properties": { "value": { "description": "The embedding values.", "items": { "format": "float", "type": "number" }, "type": "array" } }, "type": "object" }, "EmbedTextRequest": { "description": "Request to get a text embedding from the model.", "properties": { "model": { "description": "Required. The model name to use with the format model=models/{model}.", "type": "string" }, "text": { "description": "Optional. The free-form input text that the model will turn into an embedding.", "type": "string" } }, "type": "object" }, "EmbedTextResponse": { "description": "The response to a EmbedTextRequest.", "properties": { "embedding": { "$ref": "#/components/schemas/Embedding", "description": "Output only. The embedding generated from the input text.", "readOnly": true } }, "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" }, "Example": { "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.", "properties": { "input": { "$ref": "#/components/schemas/Message", "description": "Required. An example of an input `Message` from the user." }, "output": { "$ref": "#/components/schemas/Message", "description": "Required. An example of what the model should output given the input." } }, "type": "object" }, "ExecutableCode": { "description": "Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.", "properties": { "code": { "description": "Required. The code to be executed.", "type": "string" }, "language": { "description": "Required. Programming language of the `code`.", "enum": [ "LANGUAGE_UNSPECIFIED", "PYTHON" ], "type": "string" } }, "type": "object" }, "File": { "description": "A file uploaded to the API.", "properties": { "createTime": { "description": "Output only. The timestamp of when the `File` was created.", "format": "google-datetime", "readOnly": true, "type": "string" }, "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" }, "error": { "$ref": "#/components/schemas/Status", "description": "Output only. Error status if File processing failed.", "readOnly": true }, "expirationTime": { "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.", "format": "google-datetime", "readOnly": true, "type": "string" }, "mimeType": { "description": "Output only. MIME type of the file.", "readOnly": true, "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" }, "sha256Hash": { "description": "Output only. SHA-256 hash of the uploaded bytes.", "format": "byte", "readOnly": true, "type": "string" }, "sizeBytes": { "description": "Output only. Size of the file in bytes.", "format": "int64", "readOnly": true, "type": "string" }, "state": { "description": "Output only. Processing state of the File.", "enum": [ "STATE_UNSPECIFIED", "PROCESSING", "ACTIVE", "FAILED" ], "readOnly": true, "type": "string" }, "updateTime": { "description": "Output only. The timestamp of when the `File` was last updated.", "format": "google-datetime", "readOnly": true, "type": "string" }, "uri": { "description": "Output only. The uri of the `File`.", "readOnly": true, "type": "string" }, "videoMetadata": { "$ref": "#/components/schemas/VideoMetadata", "description": "Output only. Metadata for a video.", "readOnly": true } }, "type": "object" }, "FileData": { "description": "URI based data.", "properties": { "fileUri": { "description": "Required. URI.", "type": "string" }, "mimeType": { "description": "Optional. The IANA standard MIME type of the source data.", "type": "string" } }, "type": "object" }, "FunctionCall": { "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", "properties": { "args": { "additionalProperties": { "description": "Properties of the object." }, "description": "Optional. The function parameters and values in JSON object format.", "type": "object" }, "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" } }, "type": "object" }, "FunctionCallingConfig": { "description": "Configuration for specifying function calling behavior.", "properties": { "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.", "items": { "type": "string" }, "type": "array" }, "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" ], "type": "string" } }, "type": "object" }, "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.", "properties": { "description": { "description": "Required. A brief description of the function.", "type": "string" }, "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" }, "parameters": { "$ref": "#/components/schemas/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." } }, "type": "object" }, "FunctionResponse": { "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.", "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" }, "response": { "additionalProperties": { "description": "Properties of the object." }, "description": "Required. The function response in JSON object format.", "type": "object" } }, "type": "object" }, "GenerateAnswerRequest": { "description": "Request to generate a grounded answer from the `Model`.", "properties": { "answerStyle": { "description": "Required. Style in which answers should be returned.", "enum": [ "ANSWER_STYLE_UNSPECIFIED", "ABSTRACTIVE", "EXTRACTIVE", "VERBOSE" ], "type": "string" }, "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` only supports queries in English.", "items": { "$ref": "#/components/schemas/Content" }, "type": "array" }, "inlinePassages": { "$ref": "#/components/schemas/GroundingPassages", "description": "Passages provided inline with the request." }, "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. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", "items": { "$ref": "#/components/schemas/SafetySetting" }, "type": "array" }, "semanticRetriever": { "$ref": "#/components/schemas/SemanticRetrieverConfig", "description": "Content retrieved from resources created via the Semantic Retriever API." }, "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.", "format": "float", "type": "number" } }, "type": "object" }, "GenerateAnswerResponse": { "description": "Response from the model for a grounded answer.", "properties": { "answer": { "$ref": "#/components/schemas/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`." }, "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, you may want to: * Display a message to the effect of \"We couldn’t answer that question\" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. `0.5` is a good starting threshold.", "format": "float", "readOnly": true, "type": "number" }, "inputFeedback": { "$ref": "#/components/schemas/InputFeedback", "description": "Output only. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. The input data can be one or more of the following: - Question specified by the last entry in `GenerateAnswerRequest.content` - Conversation history specified by the other entries in `GenerateAnswerRequest.content` - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or `GenerateAnswerRequest.inline_passages`)", "readOnly": true } }, "type": "object" }, "GenerateContentRequest": { "description": "Request to generate a completion from the model.", "properties": { "cachedContent": { "description": "Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`", "type": "string" }, "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 like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.", "items": { "$ref": "#/components/schemas/Content" }, "type": "array" }, "generationConfig": { "$ref": "#/components/schemas/GenerationConfig", "description": "Optional. Configuration options for model generation and outputs." }, "model": { "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", "type": "string" }, "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. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", "items": { "$ref": "#/components/schemas/SafetySetting" }, "type": "array" }, "systemInstruction": { "$ref": "#/components/schemas/Content", "description": "Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only." }, "toolConfig": { "$ref": "#/components/schemas/ToolConfig", "description": "Optional. Tool configuration for any `Tool` specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example." }, "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`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.", "items": { "$ref": "#/components/schemas/Tool" }, "type": "array" } }, "type": "object" }, "GenerateContentResponse": { "description": "Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`.", "properties": { "candidates": { "description": "Candidate responses from the model.", "items": { "$ref": "#/components/schemas/Candidate" }, "type": "array" }, "modelVersion": { "description": "Output only. The model version used to generate the response.", "readOnly": true, "type": "string" }, "promptFeedback": { "$ref": "#/components/schemas/PromptFeedback", "description": "Returns the prompt's feedback related to the content filters." }, "usageMetadata": { "$ref": "#/components/schemas/UsageMetadata", "description": "Output only. Metadata on the generation requests' token usage.", "readOnly": true } }, "type": "object" }, "GeneratedFile": { "description": "A file generated on behalf of a user.", "properties": { "blob": { "$ref": "#/components/schemas/Media", "description": "The blob reference of the generated file to download. Only set when the GeneratedFiles.get request url has the \"?alt=media\" query param." }, "error": { "$ref": "#/components/schemas/Status", "description": "Error details if the GeneratedFile ends up in the STATE_FAILED state." }, "mimeType": { "description": "MIME type of the generatedFile.", "type": "string" }, "name": { "description": "Identifier. The name of the generated file. Example: `generatedFiles/abc-123`", "type": "string" }, "state": { "description": "Output only. The state of the GeneratedFile.", "enum": [ "STATE_UNSPECIFIED", "GENERATING", "GENERATED", "FAILED" ], "readOnly": true, "type": "string" } }, "type": "object" }, "GenerateMessageRequest": { "description": "Request to generate a message response from the model.", "properties": { "candidateCount": { "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", "type": "integer" }, "prompt": { "$ref": "#/components/schemas/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" }, "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.", "format": "int32", "type": "integer" }, "topP": { "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`.", "format": "float", "type": "number" } }, "type": "object" }, "GenerateMessageResponse": { "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.", "properties": { "candidates": { "description": "Candidate response messages from the model.", "items": { "$ref": "#/components/schemas/Message" }, "type": "array" }, "filters": { "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": "#/components/schemas/ContentFilter" }, "type": "array" }, "messages": { "description": "The conversation history used by the model.", "items": { "$ref": "#/components/schemas/Message" }, "type": "array" } }, "type": "object" }, "GenerateTextRequest": { "description": "Request to generate a text completion response from the model.", "properties": { "candidateCount": { "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.", "format": "int32", "type": "integer" }, "maxOutputTokens": { "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", "type": "integer" }, "prompt": { "$ref": "#/components/schemas/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." }, "safetySettings": { "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.", "items": { "$ref": "#/components/schemas/SafetySetting" }, "type": "array" }, "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" }, "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.", "format": "float", "type": "number" }, "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.", "format": "int32", "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 the `getModel` function.", "format": "float", "type": "number" } }, "type": "object" }, "GenerateTextResponse": { "description": "The response from the model, including candidate completions.", "properties": { "candidates": { "description": "Candidate responses from the model.", "items": { "$ref": "#/components/schemas/TextCompletion" }, "type": "array" }, "filters": { "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": "#/components/schemas/ContentFilter" }, "type": "array" }, "safetyFeedback": { "description": "Returns any safety feedback related to content filtering.", "items": { "$ref": "#/components/schemas/SafetyFeedback" }, "type": "array" } }, "type": "object" }, "GenerationConfig": { "description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.", "properties": { "candidateCount": { "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", "type": "integer" }, "frequencyPenalty": { "description": "Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more dificult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit: \"...the the the the the...\".", "format": "float", "type": "number" }, "logprobs": { "description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs to return at each decoding step in the Candidate.logprobs_result.", "format": "int32", "type": "integer" }, "maxOutputTokens": { "description": "Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.", "format": "int32", "type": "integer" }, "presencePenalty": { "description": "Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.", "format": "float", "type": "number" }, "responseLogprobs": { "description": "Optional. If true, export the logprobs results in response.", "type": "boolean" }, "responseMimeType": { "description": "Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types.", "type": "string" }, "responseSchema": { "$ref": "#/components/schemas/Schema", "description": "Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible `response_mime_type` must also be set. Compatible MIME types: `application/json`: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details." }, "stopSequences": { "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.", "items": { "type": "string" }, "type": "array" }, "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 from the `getModel` function. Values can range from [0.0, 2.0].", "format": "float", "type": "number" }, "topK": { "description": "Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", "format": "int32", "type": "integer" }, "topP": { "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", "format": "float", "type": "number" } }, "type": "object" }, "GoogleSearchRetrieval": { "description": "Tool to retrieve public web data for grounding, powered by Google.", "properties": { "dynamicRetrievalConfig": { "$ref": "#/components/schemas/DynamicRetrievalConfig", "description": "Specifies the dynamic retrieval configuration for the given source." } }, "type": "object" }, "GroundingAttribution": { "description": "Attribution for a source that contributed to an answer.", "properties": { "content": { "$ref": "#/components/schemas/Content", "description": "Grounding source content that makes up this attribution." }, "sourceId": { "$ref": "#/components/schemas/AttributionSourceId", "description": "Output only. Identifier for the source contributing to this attribution.", "readOnly": true } }, "type": "object" }, "GroundingChunk": { "description": "Grounding chunk.", "properties": { "web": { "$ref": "#/components/schemas/Web", "description": "Grounding chunk from the web." } }, "type": "object" }, "GroundingMetadata": { "description": "Metadata returned to client when grounding is enabled.", "properties": { "groundingChunks": { "description": "List of supporting references retrieved from specified grounding source.", "items": { "$ref": "#/components/schemas/GroundingChunk" }, "type": "array" }, "groundingSupports": { "description": "List of grounding support.", "items": { "$ref": "#/components/schemas/GroundingSupport" }, "type": "array" }, "retrievalMetadata": { "$ref": "#/components/schemas/RetrievalMetadata", "description": "Metadata related to retrieval in the grounding flow." }, "searchEntryPoint": { "$ref": "#/components/schemas/SearchEntryPoint", "description": "Optional. Google search entry for the following-up web searches." }, "webSearchQueries": { "description": "Web search queries for the following-up web search.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "GroundingPassage": { "description": "Passage included inline with a grounding configuration.", "properties": { "content": { "$ref": "#/components/schemas/Content", "description": "Content of the passage." }, "id": { "description": "Identifier for the passage for attributing this passage in grounded answers.", "type": "string" } }, "type": "object" }, "GroundingPassageId": { "description": "Identifier for a part within a `GroundingPassage`.", "properties": { "partIndex": { "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", "format": "int32", "readOnly": true, "type": "integer" }, "passageId": { "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.", "readOnly": true, "type": "string" } }, "type": "object" }, "GroundingPassages": { "description": "A repeated list of passages.", "properties": { "passages": { "description": "List of passages.", "items": { "$ref": "#/components/schemas/GroundingPassage" }, "type": "array" } }, "type": "object" }, "GroundingSupport": { "description": "Grounding support.", "properties": { "confidenceScores": { "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.", "items": { "format": "float", "type": "number" }, "type": "array" }, "groundingChunkIndices": { "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.", "items": { "format": "int32", "type": "integer" }, "type": "array" }, "segment": { "$ref": "#/components/schemas/Segment", "description": "Segment of the content this support belongs to." } }, "type": "object" }, "Hyperparameters": { "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", "properties": { "batchSize": { "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.", "format": "int32", "type": "integer" }, "epochCount": { "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.", "format": "int32", "type": "integer" }, "learningRate": { "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", "type": "number" }, "learningRateMultiplier": { "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.", "format": "float", "type": "number" } }, "type": "object" }, "InputFeedback": { "description": "Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question.", "properties": { "blockReason": { "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase the input.", "enum": [ "BLOCK_REASON_UNSPECIFIED", "SAFETY", "OTHER" ], "type": "string" }, "safetyRatings": { "description": "Ratings for safety of the input. There is at most one rating per category.", "items": { "$ref": "#/components/schemas/SafetyRating" }, "type": "array" } }, "type": "object" }, "ListCachedContentsResponse": { "description": "Response with CachedContents list.", "properties": { "cachedContents": { "description": "List of cached contents.", "items": { "$ref": "#/components/schemas/CachedContent" }, "type": "array" }, "nextPageToken": { "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" } }, "type": "object" }, "ListChunksResponse": { "description": "Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`.", "properties": { "chunks": { "description": "The returned `Chunk`s.", "items": { "$ref": "#/components/schemas/Chunk" }, "type": "array" }, "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.", "type": "string" } }, "type": "object" }, "ListCorporaResponse": { "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", "properties": { "corpora": { "description": "The returned corpora.", "items": { "$ref": "#/components/schemas/Corpus" }, "type": "array" }, "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.", "type": "string" } }, "type": "object" }, "ListDocumentsResponse": { "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", "properties": { "documents": { "description": "The returned `Document`s.", "items": { "$ref": "#/components/schemas/Document" }, "type": "array" }, "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.", "type": "string" } }, "type": "object" }, "ListFilesResponse": { "description": "Response for `ListFiles`.", "properties": { "files": { "description": "The list of `File`s.", "items": { "$ref": "#/components/schemas/File" }, "type": "array" }, "nextPageToken": { "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.", "type": "string" } }, "type": "object" }, "ListGeneratedFilesResponse": { "description": "Response for `ListGeneratedFiles`.", "properties": { "generatedFiles": { "description": "The list of `GeneratedFile`s.", "items": { "$ref": "#/components/schemas/GeneratedFile" }, "type": "array" }, "nextPageToken": { "description": "A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call.", "type": "string" } }, "type": "object" }, "ListModelsResponse": { "description": "Response from `ListModel` containing a paginated list of Models.", "properties": { "models": { "description": "The returned Models.", "items": { "$ref": "#/components/schemas/Model" }, "type": "array" }, "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.", "type": "string" } }, "type": "object" }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "properties": { "nextPageToken": { "description": "The standard List next-page token.", "type": "string" }, "operations": { "description": "A list of operations that matches the specified filter in the request.", "items": { "$ref": "#/components/schemas/Operation" }, "type": "array" } }, "type": "object" }, "ListPermissionsResponse": { "description": "Response from `ListPermissions` containing a paginated list of permissions.", "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.", "type": "string" }, "permissions": { "description": "Returned permissions.", "items": { "$ref": "#/components/schemas/Permission" }, "type": "array" } }, "type": "object" }, "ListTunedModelsResponse": { "description": "Response from `ListTunedModels` containing a paginated list of Models.", "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.", "type": "string" }, "tunedModels": { "description": "The returned Models.", "items": { "$ref": "#/components/schemas/TunedModel" }, "type": "array" } }, "type": "object" }, "LogprobsResult": { "description": "Logprobs Result", "properties": { "chosenCandidates": { "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.", "items": { "$ref": "#/components/schemas/LogprobsResultCandidate" }, "type": "array" }, "topCandidates": { "description": "Length = total number of decoding steps.", "items": { "$ref": "#/components/schemas/TopCandidates" }, "type": "array" } }, "type": "object" }, "LogprobsResultCandidate": { "description": "Candidate for the logprobs token and score.", "properties": { "logProbability": { "description": "The candidate's log probability.", "format": "float", "type": "number" }, "token": { "description": "The candidate’s token string value.", "type": "string" }, "tokenId": { "description": "The candidate’s token id value.", "format": "int32", "type": "integer" } }, "type": "object" }, "Media": { "description": "A reference to data stored on the filesystem, on GFS or in blobstore.", "properties": { "algorithm": { "deprecated": true, "description": "Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, \"MD5\" is the only possible value for this field. New values may be added at any time.", "type": "string" }, "bigstoreObjectRef": { "deprecated": true, "description": "Use object_id instead.", "format": "byte", "type": "string" }, "blobRef": { "deprecated": true, "description": "Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.", "format": "byte", "type": "string" }, "blobstore2Info": { "$ref": "#/components/schemas/Blobstore2Info", "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob." }, "compositeMedia": { "description": "A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified.", "items": { "$ref": "#/components/schemas/CompositeMedia" }, "type": "array" }, "contentType": { "description": "MIME type of the data", "type": "string" }, "contentTypeInfo": { "$ref": "#/components/schemas/ContentTypeInfo", "description": "Extended content type information provided for Scotty uploads." }, "cosmoBinaryReference": { "description": "A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.", "format": "byte", "type": "string" }, "crc32cHash": { "description": "For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported.", "format": "uint32", "type": "integer" }, "diffChecksumsResponse": { "$ref": "#/components/schemas/DiffChecksumsResponse", "description": "Set if reference_type is DIFF_CHECKSUMS_RESPONSE." }, "diffDownloadResponse": { "$ref": "#/components/schemas/DiffDownloadResponse", "description": "Set if reference_type is DIFF_DOWNLOAD_RESPONSE." }, "diffUploadRequest": { "$ref": "#/components/schemas/DiffUploadRequest", "description": "Set if reference_type is DIFF_UPLOAD_REQUEST." }, "diffUploadResponse": { "$ref": "#/components/schemas/DiffUploadResponse", "description": "Set if reference_type is DIFF_UPLOAD_RESPONSE." }, "diffVersionResponse": { "$ref": "#/components/schemas/DiffVersionResponse", "description": "Set if reference_type is DIFF_VERSION_RESPONSE." }, "downloadParameters": { "$ref": "#/components/schemas/DownloadParameters", "description": "Parameters for a media download." }, "filename": { "description": "Original file name", "type": "string" }, "hash": { "deprecated": true, "description": "Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: http://cs/#google3/blobstore2/api/scotty/service/proto/upload_listener.proto&q=class:Hash Hex encoded hash value of the uploaded media.", "type": "string" }, "hashVerified": { "description": "For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification.", "type": "boolean" }, "inline": { "description": "Media data, set if reference_type is INLINE", "format": "byte", "type": "string" }, "isPotentialRetry": { "description": "|is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence.", "type": "boolean" }, "length": { "description": "Size of the data, in bytes", "format": "int64", "type": "string" }, "md5Hash": { "description": "Scotty-provided MD5 hash for an upload.", "format": "byte", "type": "string" }, "mediaId": { "description": "Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA.", "format": "byte", "type": "string" }, "objectId": { "$ref": "#/components/schemas/ObjectId", "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF." }, "path": { "description": "Path to the data, set if reference_type is PATH", "type": "string" }, "referenceType": { "description": "Describes what the field reference contains.", "enum": [ "PATH", "BLOB_REF", "INLINE", "GET_MEDIA", "COMPOSITE_MEDIA", "BIGSTORE_REF", "DIFF_VERSION_RESPONSE", "DIFF_CHECKSUMS_RESPONSE", "DIFF_DOWNLOAD_RESPONSE", "DIFF_UPLOAD_REQUEST", "DIFF_UPLOAD_RESPONSE", "COSMO_BINARY_REFERENCE", "ARBITRARY_BYTES" ], "type": "string" }, "sha1Hash": { "description": "Scotty-provided SHA1 hash for an upload.", "format": "byte", "type": "string" }, "sha256Hash": { "description": "Scotty-provided SHA256 hash for an upload.", "format": "byte", "type": "string" }, "timestamp": { "description": "Time at which the media data was last updated, in milliseconds since UNIX epoch", "format": "uint64", "type": "string" }, "token": { "description": "A unique fingerprint/version id for the media data", "type": "string" } }, "type": "object" }, "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.", "properties": { "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" }, "citationMetadata": { "$ref": "#/components/schemas/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.", "readOnly": true }, "content": { "description": "Required. The text content of the structured `Message`.", "type": "string" } }, "type": "object" }, "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": { "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.", "type": "string" }, "examples": { "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`.", "items": { "$ref": "#/components/schemas/Example" }, "type": "array" }, "messages": { "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`.", "items": { "$ref": "#/components/schemas/Message" }, "type": "array" } }, "type": "object" }, "MetadataFilter": { "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}]", "properties": { "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": "#/components/schemas/Condition" }, "type": "array" }, "key": { "description": "Required. The key of the metadata to filter on.", "type": "string" } }, "type": "object" }, "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: * `gemini-1.5-flash`", "type": "string" }, "description": { "description": "A short description of the model.", "type": "string" }, "displayName": { "description": "The human-readable name of the model. E.g. \"Gemini 1.5 Flash\". The name can be up to 128 characters long and can consist of any UTF-8 characters.", "type": "string" }, "inputTokenLimit": { "description": "Maximum number of input tokens allowed for this model.", "format": "int32", "type": "integer" }, "maxTemperature": { "description": "The maximum temperature this model can use.", "format": "float", "type": "number" }, "name": { "description": "Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/gemini-1.5-flash-001`", "type": "string" }, "outputTokenLimit": { "description": "Maximum number of output tokens available for this model.", "format": "int32", "type": "integer" }, "supportedGenerationMethods": { "description": "The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.", "items": { "type": "string" }, "type": "array" }, "temperature": { "description": "Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.", "format": "float", "type": "number" }, "topK": { "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.", "format": "int32", "type": "integer" }, "topP": { "description": "For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.", "format": "float", "type": "number" }, "version": { "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)", "type": "string" } }, "type": "object" }, "ObjectId": { "description": "This is a copy of the tech.blob.ObjectId proto, which could not be used directly here due to transitive closure issues with JavaScript support; see http://b/8801763.", "properties": { "bucketName": { "description": "The name of the bucket to which this object belongs.", "type": "string" }, "generation": { "description": "Generation of the object. Generations are monotonically increasing across writes, allowing them to be be compared to determine which generation is newer. If this is omitted in a request, then you are requesting the live object. See http://go/bigstore-versions", "format": "int64", "type": "string" }, "objectName": { "description": "The name of the object.", "type": "string" } }, "type": "object" }, "Operation": { "description": "This resource represents a long-running operation that is the result of a network API call.", "properties": { "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" }, "error": { "$ref": "#/components/schemas/Status", "description": "The error result of the operation in case of failure or cancellation." }, "metadata": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL." }, "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.", "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" }, "response": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL." }, "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`.", "type": "object" } }, "type": "object" }, "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.", "properties": { "codeExecutionResult": { "$ref": "#/components/schemas/CodeExecutionResult", "description": "Result of executing the `ExecutableCode`." }, "executableCode": { "$ref": "#/components/schemas/ExecutableCode", "description": "Code generated by the model that is meant to be executed." }, "fileData": { "$ref": "#/components/schemas/FileData", "description": "URI based data." }, "functionCall": { "$ref": "#/components/schemas/FunctionCall", "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values." }, "functionResponse": { "$ref": "#/components/schemas/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." }, "inlineData": { "$ref": "#/components/schemas/Blob", "description": "Inline media bytes." }, "text": { "description": "Inline text.", "type": "string" } }, "type": "object" }, "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", "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": { "description": "Optional. Immutable. The type of the grantee.", "enum": [ "GRANTEE_TYPE_UNSPECIFIED", "USER", "GROUP", "EVERYONE" ], "type": "string" }, "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.", "enum": [ "ROLE_UNSPECIFIED", "OWNER", "WRITER", "READER" ], "type": "string" } }, "type": "object" }, "PredictLongRunningRequest": { "description": "Request message for [PredictionService.PredictLongRunning].", "properties": { "instances": { "description": "Required. The instances that are the input to the prediction call.", "items": {}, "type": "array" }, "parameters": { "description": "Optional. The parameters that govern the prediction call." } }, "type": "object" }, "PredictRequest": { "description": "Request message for PredictionService.Predict.", "properties": { "instances": { "description": "Required. The instances that are the input to the prediction call.", "items": {}, "type": "array" }, "parameters": { "description": "Optional. The parameters that govern the prediction call." } }, "type": "object" }, "PredictResponse": { "description": "Response message for [PredictionService.Predict].", "properties": { "predictions": { "description": "The outputs of the prediction call.", "items": {}, "type": "array" } }, "type": "object" }, "PromptFeedback": { "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", "properties": { "blockReason": { "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.", "enum": [ "BLOCK_REASON_UNSPECIFIED", "SAFETY", "OTHER", "BLOCKLIST", "PROHIBITED_CONTENT" ], "type": "string" }, "safetyRatings": { "description": "Ratings for safety of the prompt. There is at most one rating per category.", "items": { "$ref": "#/components/schemas/SafetyRating" }, "type": "array" } }, "type": "object" }, "QueryCorpusRequest": { "description": "Request for querying a `Corpus`.", "properties": { "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.", "items": { "$ref": "#/components/schemas/MetadataFilter" }, "type": "array" }, "query": { "description": "Required. Query string to perform semantic search.", "type": "string" }, "resultsCount": { "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", "type": "integer" } }, "type": "object" }, "QueryCorpusResponse": { "description": "Response from `QueryCorpus` containing a list of relevant chunks.", "properties": { "relevantChunks": { "description": "The relevant chunks.", "items": { "$ref": "#/components/schemas/RelevantChunk" }, "type": "array" } }, "type": "object" }, "QueryDocumentRequest": { "description": "Request for querying a `Document`.", "properties": { "metadataFilters": { "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": "#/components/schemas/MetadataFilter" }, "type": "array" }, "query": { "description": "Required. Query string to perform semantic search.", "type": "string" }, "resultsCount": { "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", "type": "integer" } }, "type": "object" }, "QueryDocumentResponse": { "description": "Response from `QueryDocument` containing a list of relevant chunks.", "properties": { "relevantChunks": { "description": "The returned relevant chunks.", "items": { "$ref": "#/components/schemas/RelevantChunk" }, "type": "array" } }, "type": "object" }, "RelevantChunk": { "description": "The information for a chunk relevant to a query.", "properties": { "chunk": { "$ref": "#/components/schemas/Chunk", "description": "`Chunk` associated with the query." }, "chunkRelevanceScore": { "description": "`Chunk` relevance to the query.", "format": "float", "type": "number" } }, "type": "object" }, "RetrievalMetadata": { "description": "Metadata related to retrieval in the grounding flow.", "properties": { "googleSearchDynamicRetrievalScore": { "description": "Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search.", "format": "float", "type": "number" } }, "type": "object" }, "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": { "rating": { "$ref": "#/components/schemas/SafetyRating", "description": "Safety rating evaluated from content." }, "setting": { "$ref": "#/components/schemas/SafetySetting", "description": "Safety settings applied to the request." } }, "type": "object" }, "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": { "description": "Was this content blocked because of this rating?", "type": "boolean" }, "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", "HARM_CATEGORY_CIVIC_INTEGRITY" ], "type": "string" }, "probability": { "description": "Required. The probability of harm for this content.", "enum": [ "HARM_PROBABILITY_UNSPECIFIED", "NEGLIGIBLE", "LOW", "MEDIUM", "HIGH" ], "type": "string" } }, "type": "object" }, "SafetySetting": { "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.", "properties": { "category": { "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", "HARM_CATEGORY_CIVIC_INTEGRITY" ], "type": "string" }, "threshold": { "description": "Required. Controls the probability threshold at which harm is blocked.", "enum": [ "HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF" ], "type": "string" } }, "type": "object" }, "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).", "properties": { "description": { "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.", "type": "string" }, "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\"]}", "items": { "type": "string" }, "type": "array" }, "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 for STRING type: enum", "type": "string" }, "items": { "$ref": "#/components/schemas/Schema", "description": "Optional. Schema of the elements of Type.ARRAY." }, "maxItems": { "description": "Optional. Maximum number of the elements for Type.ARRAY.", "format": "int64", "type": "string" }, "minItems": { "description": "Optional. Minimum number of the elements for Type.ARRAY.", "format": "int64", "type": "string" }, "nullable": { "description": "Optional. Indicates if the value may be null.", "type": "boolean" }, "properties": { "additionalProperties": { "$ref": "#/components/schemas/Schema" }, "description": "Optional. Properties of Type.OBJECT.", "type": "object" }, "required": { "description": "Optional. Required properties of Type.OBJECT.", "items": { "type": "string" }, "type": "array" }, "type": { "description": "Required. Data type.", "enum": [ "TYPE_UNSPECIFIED", "STRING", "NUMBER", "INTEGER", "BOOLEAN", "ARRAY", "OBJECT" ], "type": "string" } }, "type": "object" }, "SearchEntryPoint": { "description": "Google search entry point.", "properties": { "renderedContent": { "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.", "type": "string" }, "sdkBlob": { "description": "Optional. Base64 encoded JSON representing array of tuple.", "format": "byte", "type": "string" } }, "type": "object" }, "Segment": { "description": "Segment of the content.", "properties": { "endIndex": { "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.", "format": "int32", "readOnly": true, "type": "integer" }, "partIndex": { "description": "Output only. The index of a Part object within its parent Content object.", "format": "int32", "readOnly": true, "type": "integer" }, "startIndex": { "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.", "format": "int32", "readOnly": true, "type": "integer" }, "text": { "description": "Output only. The text corresponding to the segment from the response.", "readOnly": true, "type": "string" } }, "type": "object" }, "SemanticRetrieverChunk": { "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", "properties": { "chunk": { "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`", "readOnly": true, "type": "string" }, "source": { "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`", "readOnly": true, "type": "string" } }, "type": "object" }, "SemanticRetrieverConfig": { "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.", "properties": { "maxChunksCount": { "description": "Optional. Maximum number of relevant `Chunk`s to retrieve.", "format": "int32", "type": "integer" }, "metadataFilters": { "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.", "items": { "$ref": "#/components/schemas/MetadataFilter" }, "type": "array" }, "minimumRelevanceScore": { "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s.", "format": "float", "type": "number" }, "query": { "$ref": "#/components/schemas/Content", "description": "Required. Query to use for matching `Chunk`s in the given resource by similarity." }, "source": { "description": "Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`.", "type": "string" } }, "type": "object" }, "Status": { "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).", "properties": { "code": { "description": "The status code, which should be an enum value of google.rpc.Code.", "format": "int32", "type": "integer" }, "details": { "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", "items": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL." }, "type": "object" }, "type": "array" }, "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" } }, "type": "object" }, "StringList": { "description": "User provided string values assigned to a single metadata key.", "properties": { "values": { "description": "The string values of the metadata to store.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "TextCompletion": { "description": "Output text returned from a model.", "properties": { "citationMetadata": { "$ref": "#/components/schemas/CitationMetadata", "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`.", "readOnly": true }, "output": { "description": "Output only. The generated text returned from the model.", "readOnly": true, "type": "string" }, "safetyRatings": { "description": "Ratings for the safety of a response. There is at most one rating per category.", "items": { "$ref": "#/components/schemas/SafetyRating" }, "type": "array" } }, "type": "object" }, "TextPrompt": { "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.", "properties": { "text": { "description": "Required. The prompt text.", "type": "string" } }, "type": "object" }, "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": { "codeExecution": { "$ref": "#/components/schemas/CodeExecution", "description": "Optional. Enables the model to execute code as part of generation." }, "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": "#/components/schemas/FunctionDeclaration" }, "type": "array" }, "googleSearchRetrieval": { "$ref": "#/components/schemas/GoogleSearchRetrieval", "description": "Optional. Retrieval tool that is powered by Google search." } }, "type": "object" }, "ToolConfig": { "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", "properties": { "functionCallingConfig": { "$ref": "#/components/schemas/FunctionCallingConfig", "description": "Optional. Function calling config." } }, "type": "object" }, "TopCandidates": { "description": "Candidates with top log probabilities at each decoding step.", "properties": { "candidates": { "description": "Sorted by log probability in descending order.", "items": { "$ref": "#/components/schemas/LogprobsResultCandidate" }, "type": "array" } }, "type": "object" }, "TransferOwnershipRequest": { "description": "Request to transfer the ownership of the tuned model.", "properties": { "emailAddress": { "description": "Required. The email address of the user to whom the tuned model is being transferred to.", "type": "string" } }, "type": "object" }, "TransferOwnershipResponse": { "description": "Response from `TransferOwnership`.", "properties": {}, "type": "object" }, "TunedModel": { "description": "A fine-tuned model created using ModelService.CreateTunedModel.", "properties": { "baseModel": { "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`", "type": "string" }, "createTime": { "description": "Output only. The timestamp when this model was created.", "format": "google-datetime", "readOnly": true, "type": "string" }, "description": { "description": "Optional. A short description of this model.", "type": "string" }, "displayName": { "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces.", "type": "string" }, "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`", "readOnly": true, "type": "string" }, "readerProjectNumbers": { "description": "Optional. List of project numbers that have read access to the tuned model.", "items": { "format": "int64", "type": "string" }, "type": "array" }, "state": { "description": "Output only. The state of the tuned model.", "enum": [ "STATE_UNSPECIFIED", "CREATING", "ACTIVE", "FAILED" ], "readOnly": true, "type": "string" }, "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.", "format": "float", "type": "number" }, "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.", "format": "int32", "type": "integer" }, "topP": { "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", "type": "number" }, "tunedModelSource": { "$ref": "#/components/schemas/TunedModelSource", "description": "Optional. TunedModel to use as the starting point for training the new model." }, "tuningTask": { "$ref": "#/components/schemas/TuningTask", "description": "Required. The tuning task that creates the tuned model." }, "updateTime": { "description": "Output only. The timestamp when this model was updated.", "format": "google-datetime", "readOnly": true, "type": "string" } }, "type": "object" }, "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/gemini-1.5-flash-001`", "readOnly": true, "type": "string" }, "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" } }, "type": "object" }, "TuningExample": { "description": "A single example for tuning.", "properties": { "output": { "description": "Required. The expected model output.", "type": "string" }, "textInput": { "description": "Optional. Text model input.", "type": "string" } }, "type": "object" }, "TuningExamples": { "description": "A set of tuning examples. Can be training or validation data.", "properties": { "examples": { "description": "The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.", "items": { "$ref": "#/components/schemas/TuningExample" }, "type": "array" } }, "type": "object" }, "TuningSnapshot": { "description": "Record for a single tuning step.", "properties": { "computeTime": { "description": "Output only. The timestamp when this metric was computed.", "format": "google-datetime", "readOnly": true, "type": "string" }, "epoch": { "description": "Output only. The epoch this step was part of.", "format": "int32", "readOnly": true, "type": "integer" }, "meanLoss": { "description": "Output only. The mean loss of the training examples for this step.", "format": "float", "readOnly": true, "type": "number" }, "step": { "description": "Output only. The tuning step.", "format": "int32", "readOnly": true, "type": "integer" } }, "type": "object" }, "TuningTask": { "description": "Tuning tasks that create tuned models.", "properties": { "completeTime": { "description": "Output only. The timestamp when tuning this model completed.", "format": "google-datetime", "readOnly": true, "type": "string" }, "hyperparameters": { "$ref": "#/components/schemas/Hyperparameters", "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used." }, "snapshots": { "description": "Output only. Metrics collected during tuning.", "items": { "$ref": "#/components/schemas/TuningSnapshot" }, "readOnly": true, "type": "array" }, "startTime": { "description": "Output only. The timestamp when tuning this model started.", "format": "google-datetime", "readOnly": true, "type": "string" }, "trainingData": { "$ref": "#/components/schemas/Dataset", "description": "Required. Input only. Immutable. The model training data." } }, "type": "object" }, "UpdateChunkRequest": { "description": "Request to update a `Chunk`.", "properties": { "chunk": { "$ref": "#/components/schemas/Chunk", "description": "Required. The `Chunk` to update." }, "updateMask": { "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.", "format": "google-fieldmask", "type": "string" } }, "type": "object" }, "UsageMetadata": { "description": "Metadata on the generation request's token usage.", "properties": { "cachedContentTokenCount": { "description": "Number of tokens in the cached part of the prompt (the cached content)", "format": "int32", "type": "integer" }, "candidatesTokenCount": { "description": "Total number of tokens across all the generated response candidates.", "format": "int32", "type": "integer" }, "promptTokenCount": { "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.", "format": "int32", "type": "integer" }, "totalTokenCount": { "description": "Total token count for the generation request (prompt + response candidates).", "format": "int32", "type": "integer" } }, "type": "object" }, "VideoMetadata": { "description": "Metadata for a video `File`.", "properties": { "videoDuration": { "description": "Duration of the video.", "format": "google-duration", "type": "string" } }, "type": "object" }, "Web": { "description": "Chunk from the web.", "properties": { "title": { "description": "Title of the chunk.", "type": "string" }, "uri": { "description": "URI reference of the chunk.", "type": "string" } }, "type": "object" } }, "parameters": { "_.xgafv": { "name": "$.xgafv", "in": "query", "description": "V1 error format.", "schema": { "type": "string", "enum": [ "1", "2" ] } }, "access_token": { "name": "access_token", "in": "query", "description": "OAuth access token.", "schema": { "type": "string" } }, "alt": { "name": "alt", "in": "query", "description": "Data format for response.", "schema": { "type": "string", "enum": [ "json", "media", "proto" ] } }, "callback": { "name": "callback", "in": "query", "description": "JSONP", "schema": { "type": "string" } }, "fields": { "name": "fields", "in": "query", "description": "Selector specifying which fields to include in a partial response.", "schema": { "type": "string" } }, "key": { "name": "key", "in": "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.", "schema": { "type": "string" } }, "oauth_token": { "name": "oauth_token", "in": "query", "description": "OAuth 2.0 token for the current user.", "schema": { "type": "string" } }, "prettyPrint": { "name": "prettyPrint", "in": "query", "description": "Returns response with indentations and line breaks.", "schema": { "type": "boolean" } }, "quotaUser": { "name": "quotaUser", "in": "query", "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.", "schema": { "type": "string" } }, "upload_protocol": { "name": "upload_protocol", "in": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "schema": { "type": "string" } }, "uploadType": { "name": "uploadType", "in": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "schema": { "type": "string" } } } }, "paths": { "/v1beta/cachedContents": { "post": { "description": "Creates CachedContent resource.", "operationId": "generativelanguage.cachedContents.create", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CachedContent" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CachedContent" } } } }, "tags": [ "cachedContents" ] }, "get": { "description": "Lists CachedContents.", "operationId": "generativelanguage.cachedContents.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCachedContentsResponse" } } } } }, "parameters": [ { "name": "pageSize", "in": "query", "description": "Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "query", "description": "Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.", "schema": { "type": "string" } } ], "tags": [ "cachedContents" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora": { "post": { "description": "Creates an empty `Corpus`.", "operationId": "generativelanguage.corpora.create", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Corpus" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Corpus" } } } }, "tags": [ "corpora" ] }, "get": { "description": "Lists all `Corpora` owned by the user.", "operationId": "generativelanguage.corpora.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCorporaResponse" } } } } }, "parameters": [ { "name": "pageSize", "in": "query", "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.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "query", "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.", "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/files": { "get": { "description": "Lists the metadata for `File`s owned by the requesting project.", "operationId": "generativelanguage.files.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListFilesResponse" } } } } }, "parameters": [ { "name": "pageSize", "in": "query", "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "query", "description": "Optional. A page token from a previous `ListFiles` call.", "schema": { "type": "string" } } ], "tags": [ "files" ] }, "post": { "description": "Creates a `File`.", "operationId": "generativelanguage.media.upload", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFileResponse" } } } } }, "requestBody": { "content": { "application/octet-stream": { "schema": { "$ref": "#/components/schemas/CreateFileRequest" } } } }, "tags": [ "media" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/generatedFiles": { "get": { "description": "Lists the generated files owned by the requesting project.", "operationId": "generativelanguage.generatedFiles.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListGeneratedFilesResponse" } } } } }, "parameters": [ { "name": "pageSize", "in": "query", "description": "Optional. Maximum number of `GeneratedFile`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 50.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "query", "description": "Optional. A page token from a previous `ListGeneratedFiles` call.", "schema": { "type": "string" } } ], "tags": [ "generatedFiles" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models": { "get": { "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", "operationId": "generativelanguage.models.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListModelsResponse" } } } } }, "parameters": [ { "name": "pageSize", "in": "query", "description": "The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "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.", "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/tunedModels": { "post": { "description": "Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", "operationId": "generativelanguage.tunedModels.create", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TunedModel" } } } }, "parameters": [ { "name": "tunedModelId", "in": "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])?`.", "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "get": { "description": "Lists created tuned models.", "operationId": "generativelanguage.tunedModels.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListTunedModelsResponse" } } } } }, "parameters": [ { "name": "filter", "in": "query", "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", "schema": { "type": "string" } }, { "name": "pageSize", "in": "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.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "query", "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.", "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/cachedContents/{name}": { "delete": { "description": "Deletes CachedContent resource.", "operationId": "generativelanguage.cachedContents.delete", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Empty" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`", "required": true, "schema": { "type": "string" } } ], "tags": [ "cachedContents" ] }, "get": { "description": "Reads CachedContent resource.", "operationId": "generativelanguage.cachedContents.get", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CachedContent" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`", "required": true, "schema": { "type": "string" } } ], "tags": [ "cachedContents" ] }, "patch": { "description": "Updates CachedContent resource (only expiration is updatable).", "operationId": "generativelanguage.cachedContents.patch", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CachedContent" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CachedContent" } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Optional. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", "required": true, "schema": { "type": "string" } }, { "name": "updateMask", "in": "query", "description": "The list of fields to update.", "schema": { "type": "string" } } ], "tags": [ "cachedContents" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{name}": { "delete": { "description": "Deletes the permission.", "operationId": "generativelanguage.corpora.permissions.delete", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Empty" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "required": true, "schema": { "type": "string" } }, { "name": "force", "in": "query", "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.", "schema": { "type": "boolean" } } ], "tags": [ "corpora" ] }, "get": { "description": "Gets information about a specific Permission.", "operationId": "generativelanguage.corpora.permissions.get", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "required": true, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "patch": { "description": "Updates the permission.", "operationId": "generativelanguage.corpora.permissions.patch", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } }, "parameters": [ { "name": "name", "in": "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.", "required": true, "schema": { "type": "string" } }, { "name": "updateMask", "in": "query", "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{name}:query": { "post": { "description": "Performs semantic search over a `Document`.", "operationId": "generativelanguage.corpora.documents.query", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryDocumentResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryDocumentRequest" } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`", "required": true, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{parent}/documents": { "post": { "description": "Creates an empty `Document`.", "operationId": "generativelanguage.corpora.documents.create", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`", "required": true, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "get": { "description": "Lists all `Document`s in a `Corpus`.", "operationId": "generativelanguage.corpora.documents.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListDocumentsResponse" } } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`", "required": true, "schema": { "type": "string" } }, { "name": "pageSize", "in": "query", "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.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "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.", "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{parent}/chunks:batchCreate": { "post": { "description": "Batch create `Chunk`s.", "operationId": "generativelanguage.corpora.documents.chunks.batchCreate", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchCreateChunksResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchCreateChunksRequest" } } } }, "parameters": [ { "name": "parent", "in": "path", "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`", "required": true, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{parent}/chunks:batchDelete": { "post": { "description": "Batch delete `Chunk`s.", "operationId": "generativelanguage.corpora.documents.chunks.batchDelete", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Empty" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchDeleteChunksRequest" } } } }, "parameters": [ { "name": "parent", "in": "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`", "required": true, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{parent}/chunks:batchUpdate": { "post": { "description": "Batch update `Chunk`s.", "operationId": "generativelanguage.corpora.documents.chunks.batchUpdate", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchUpdateChunksResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchUpdateChunksRequest" } } } }, "parameters": [ { "name": "parent", "in": "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, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{parent}/chunks": { "post": { "description": "Creates a `Chunk`.", "operationId": "generativelanguage.corpora.documents.chunks.create", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chunk" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chunk" } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`", "required": true, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "get": { "description": "Lists all `Chunk`s in a `Document`.", "operationId": "generativelanguage.corpora.documents.chunks.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListChunksResponse" } } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`", "required": true, "schema": { "type": "string" } }, { "name": "pageSize", "in": "query", "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.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "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.", "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/corpora/{parent}/permissions": { "post": { "description": "Create a permission to a specific resource.", "operationId": "generativelanguage.corpora.permissions.create", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "required": true, "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "get": { "description": "Lists permissions for the specific resource.", "operationId": "generativelanguage.corpora.permissions.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPermissionsResponse" } } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "required": true, "schema": { "type": "string" } }, { "name": "pageSize", "in": "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.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "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.", "schema": { "type": "string" } } ], "tags": [ "corpora" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/files/{name}": { "delete": { "description": "Deletes the `File`.", "operationId": "generativelanguage.files.delete", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Empty" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", "required": true, "schema": { "type": "string" } } ], "tags": [ "files" ] }, "get": { "description": "Gets the metadata for the given `File`.", "operationId": "generativelanguage.files.get", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/File" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The name of the `File` to get. Example: `files/abc-123`", "required": true, "schema": { "type": "string" } } ], "tags": [ "files" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/generatedFiles/{name}": { "get": { "description": "Gets a generated file. When calling this method via REST, only the metadata of the generated file is returned. To retrieve the file content via REST, add alt=media as a query parameter.", "operationId": "generativelanguage.media.download", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneratedFile" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The name of the generated file to retrieve. Example: `generatedFiles/abc-123`", "required": true, "schema": { "type": "string" } } ], "tags": [ "media" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:batchEmbedContents": { "post": { "description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", "operationId": "generativelanguage.models.batchEmbedContents", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchEmbedContentsResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchEmbedContentsRequest" } } } }, "parameters": [ { "name": "model", "in": "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, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:batchEmbedText": { "post": { "description": "Generates multiple embeddings from the model given input text in a synchronous call.", "operationId": "generativelanguage.models.batchEmbedText", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchEmbedTextResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchEmbedTextRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:countMessageTokens": { "post": { "description": "Runs a model's tokenizer on a string and returns the token count.", "operationId": "generativelanguage.models.countMessageTokens", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountMessageTokensResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountMessageTokensRequest" } } } }, "parameters": [ { "name": "model", "in": "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, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:countTextTokens": { "post": { "description": "Runs a model's tokenizer on a text and returns the token count.", "operationId": "generativelanguage.models.countTextTokens", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTextTokensResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTextTokensRequest" } } } }, "parameters": [ { "name": "model", "in": "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, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:countTokens": { "post": { "description": "Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.", "operationId": "generativelanguage.models.countTokens", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensRequest" } } } }, "parameters": [ { "name": "model", "in": "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, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:embedContent": { "post": { "description": "Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).", "operationId": "generativelanguage.models.embedContent", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbedContentResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbedContentRequest" } } } }, "parameters": [ { "name": "model", "in": "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, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:embedText": { "post": { "description": "Generates an embedding from the model given an input message.", "operationId": "generativelanguage.models.embedText", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbedTextResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbedTextRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The model name to use with the format model=models/{model}.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:generateAnswer": { "post": { "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", "operationId": "generativelanguage.models.generateAnswer", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateAnswerResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateAnswerRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:generateContent": { "post": { "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", "operationId": "generativelanguage.models.generateContent", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateContentResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateContentRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:generateMessage": { "post": { "description": "Generates a response from the model given an input `MessagePrompt`.", "operationId": "generativelanguage.models.generateMessage", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateMessageResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateMessageRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the model to use. Format: `name=models/{model}`.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:generateText": { "post": { "description": "Generates a response from the model given an input message.", "operationId": "generativelanguage.models.generateText", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateTextResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateTextRequest" } } } }, "parameters": [ { "name": "model", "in": "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", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{name}": { "get": { "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", "operationId": "generativelanguage.models.operations.get", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "The name of the operation resource.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:predict": { "post": { "description": "Performs a prediction request.", "operationId": "generativelanguage.models.predict", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PredictResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PredictRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:predictLongRunning": { "post": { "description": "Same as Predict but returns an LRO.", "operationId": "generativelanguage.models.predictLongRunning", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PredictLongRunningRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{model}:streamGenerateContent": { "post": { "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", "operationId": "generativelanguage.models.streamGenerateContent", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateContentResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateContentRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", "required": true, "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/models/{name}/operations": { "get": { "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", "operationId": "generativelanguage.models.operations.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListOperationsResponse" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "The name of the operation's parent resource.", "required": true, "schema": { "type": "string" } }, { "name": "filter", "in": "query", "description": "The standard list filter.", "schema": { "type": "string" } }, { "name": "pageSize", "in": "query", "description": "The standard list page size.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "query", "description": "The standard list page token.", "schema": { "type": "string" } } ], "tags": [ "models" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/tunedModels/{name}": { "delete": { "description": "Deletes the permission.", "operationId": "generativelanguage.tunedModels.permissions.delete", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Empty" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "required": true, "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "get": { "description": "Gets information about a specific Permission.", "operationId": "generativelanguage.tunedModels.permissions.get", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "required": true, "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "patch": { "description": "Updates the permission.", "operationId": "generativelanguage.tunedModels.permissions.patch", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } }, "parameters": [ { "name": "name", "in": "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.", "required": true, "schema": { "type": "string" } }, { "name": "updateMask", "in": "query", "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/tunedModels/{model}:generateContent": { "post": { "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", "operationId": "generativelanguage.tunedModels.generateContent", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateContentResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateContentRequest" } } } }, "parameters": [ { "name": "model", "in": "path", "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.", "required": true, "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/tunedModels/{model}:generateText": { "post": { "description": "Generates a response from the model given an input message.", "operationId": "generativelanguage.tunedModels.generateText", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateTextResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateTextRequest" } } } }, "parameters": [ { "name": "model", "in": "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", "required": true, "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/tunedModels/{name}:transferOwnership": { "post": { "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.", "operationId": "generativelanguage.tunedModels.transferOwnership", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferOwnershipResponse" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferOwnershipRequest" } } } }, "parameters": [ { "name": "name", "in": "path", "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", "required": true, "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/tunedModels/{name}/operations": { "get": { "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", "operationId": "generativelanguage.tunedModels.operations.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListOperationsResponse" } } } } }, "parameters": [ { "name": "name", "in": "path", "description": "The name of the operation's parent resource.", "required": true, "schema": { "type": "string" } }, { "name": "filter", "in": "query", "description": "The standard list filter.", "schema": { "type": "string" } }, { "name": "pageSize", "in": "query", "description": "The standard list page size.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "query", "description": "The standard list page token.", "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] }, "/v1beta/tunedModels/{parent}/permissions": { "post": { "description": "Create a permission to a specific resource.", "operationId": "generativelanguage.tunedModels.permissions.create", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Permission" } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "required": true, "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "get": { "description": "Lists permissions for the specific resource.", "operationId": "generativelanguage.tunedModels.permissions.list", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPermissionsResponse" } } } } }, "parameters": [ { "name": "parent", "in": "path", "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "required": true, "schema": { "type": "string" } }, { "name": "pageSize", "in": "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.", "schema": { "type": "integer" } }, { "name": "pageToken", "in": "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.", "schema": { "type": "string" } } ], "tags": [ "tunedModels" ] }, "parameters": [ { "$ref": "#/components/parameters/_.xgafv" }, { "$ref": "#/components/parameters/access_token" }, { "$ref": "#/components/parameters/alt" }, { "$ref": "#/components/parameters/callback" }, { "$ref": "#/components/parameters/fields" }, { "$ref": "#/components/parameters/key" }, { "$ref": "#/components/parameters/oauth_token" }, { "$ref": "#/components/parameters/prettyPrint" }, { "$ref": "#/components/parameters/quotaUser" }, { "$ref": "#/components/parameters/upload_protocol" }, { "$ref": "#/components/parameters/uploadType" } ] } }, "tags": [ { "name": "cachedContents" }, { "name": "corpora" }, { "name": "files" }, { "name": "generatedFiles" }, { "name": "media" }, { "name": "models" }, { "name": "tunedModels" } ], "externalDocs": { "url": "https://developers.generativeai.google/api" } }