diff --git a/crates/generate-types/src/main.rs b/crates/generate-types/src/main.rs index cc28089d..1d096925 100644 --- a/crates/generate-types/src/main.rs +++ b/crates/generate-types/src/main.rs @@ -1385,6 +1385,7 @@ fn generate_google_types_with_quicktype(spec: &serde_json::Value) { let _ = std::fs::remove_file(&temp_schema_path); + let quicktype_output = strip_quicktype_preamble(&quicktype_output); let processed_output = post_process_quicktype_output_for_google(&quicktype_output); let dest_path = "crates/lingua/src/providers/google/generated.rs"; @@ -1647,6 +1648,27 @@ fn add_default_derive_to_structs(content: &str) -> String { result_lines.join("\n") } +/// Strip non-Rust preamble lines from quicktype stdout. +/// CI environments or quicktype itself may emit diagnostic text before the +/// actual generated Rust code. We skip forward to the first line that looks +/// like valid Rust source (comments, use/extern statements, attributes, etc.). +fn strip_quicktype_preamble(output: &str) -> String { + let lines: Vec<&str> = output.lines().collect(); + let start = lines + .iter() + .position(|line| { + let trimmed = line.trim(); + trimmed.is_empty() + || trimmed.starts_with("//") + || trimmed.starts_with("use ") + || trimmed.starts_with("extern ") + || trimmed.starts_with("#[") + || trimmed.starts_with("pub ") + }) + .unwrap_or(0); + lines[start..].join("\n") +} + fn post_process_quicktype_output_for_google(quicktype_output: &str) -> String { let mut processed = quicktype_output.to_string(); diff --git a/crates/lingua/src/providers/google/generated.rs b/crates/lingua/src/providers/google/generated.rs index 529d0102..35838707 100644 --- a/crates/lingua/src/providers/google/generated.rs +++ b/crates/lingua/src/providers/google/generated.rs @@ -1390,6 +1390,12 @@ pub struct Tool { #[serde(rename_all = "camelCase")] #[ts(export_to = "google/")] pub struct ComputerUse { + /// Optional. Disabled safety policies for computer use. + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled_safety_policies: Option>, + /// Optional. Whether enable the prompt injection detection check on computer-use request. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_prompt_injection_detection: Option, /// Required. The environment being operated. #[serde(skip_serializing_if = "Option::is_none")] pub environment: Option, @@ -1401,6 +1407,28 @@ pub struct ComputerUse { pub excluded_predefined_functions: Option>, } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[ts(export_to = "google/")] +pub enum DisabledSafetyPolicy { + #[serde(rename = "ACCOUNT_CREATION")] + AccountCreation, + #[serde(rename = "COMMUNICATION_TOOL")] + CommunicationTool, + #[serde(rename = "DATA_MODIFICATION")] + DataModification, + #[serde(rename = "FINANCIAL_TRANSACTIONS")] + FinancialTransactions, + #[serde(rename = "LEGAL_TERMS_AND_AGREEMENTS")] + LegalTermsAndAgreements, + #[serde(rename = "SAFETY_POLICY_UNSPECIFIED")] + SafetyPolicyUnspecified, + #[serde(rename = "SENSITIVE_DATA_MODIFICATION")] + SensitiveDataModification, + #[serde(rename = "USER_CONSENT_MANAGEMENT")] + UserConsentManagement, +} + /// Required. The environment being operated. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] @@ -1408,6 +1436,10 @@ pub struct ComputerUse { pub enum Environment { #[serde(rename = "ENVIRONMENT_BROWSER")] EnvironmentBrowser, + #[serde(rename = "ENVIRONMENT_DESKTOP")] + EnvironmentDesktop, + #[serde(rename = "ENVIRONMENT_MOBILE")] + EnvironmentMobile, #[serde(rename = "ENVIRONMENT_UNSPECIFIED")] EnvironmentUnspecified, } diff --git a/provider-type-update-notes.md b/provider-type-update-notes.md new file mode 100644 index 00000000..066ed499 --- /dev/null +++ b/provider-type-update-notes.md @@ -0,0 +1,29 @@ +# Google provider type update notes + +## Changes in this update + +### `ComputerUse` struct (additive, optional fields) + +Two new optional fields added: +- `disabled_safety_policies: Option>` -- safety policies to disable during computer use +- `enable_prompt_injection_detection: Option` -- flag for prompt injection detection + +### New `DisabledSafetyPolicy` enum + +Eight variants: `AccountCreation`, `CommunicationTool`, `DataModification`, `FinancialTransactions`, `LegalTermsAndAgreements`, `SafetyPolicyUnspecified`, `SensitiveDataModification`, `UserConsentManagement`. + +### `Environment` enum (additive variants) + +Two new variants: `EnvironmentDesktop`, `EnvironmentMobile` (joining existing `EnvironmentBrowser`, `EnvironmentUnspecified`). + +### Generator improvement + +New `strip_quicktype_preamble()` function strips non-Rust diagnostic lines that CI environments or quicktype may emit before generated code. + +## Adapter/converter impact + +No hand-written code changes required. All changes are within the `ComputerUse` type hierarchy, which is a field on the `Tool` struct. The tool converter already does not convert `computer_use` to/from `UniversalTool` (pre-existing gap -- it handles `function_declarations`, `google_search`, `code_execution`, `google_search_retrieval`, and `url_context` only). The new fields and variants are all optional/additive, so serialization and deserialization remain backward-compatible. + +## Items for human review + +**`computer_use` tool conversion**: If cross-provider computer-use support is planned, the `Tool.computer_use` field needs a `UniversalTool` representation (likely a new builtin tool type). The new `DisabledSafetyPolicy` and expanded `Environment` variants would need to be modeled as part of that builtin tool's config. This is a pre-existing gap, not caused by this update. diff --git a/specs/google/discovery.json b/specs/google/discovery.json index 8937f724..83c2d7cd 100644 --- a/specs/google/discovery.json +++ b/specs/google/discovery.json @@ -1,588 +1,468 @@ { - "kind": "discovery#restDescription", - "protocol": "rest", - "name": "generativelanguage", - "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" - }, - "canonicalName": "Generative Language", + "ownerName": "Google", "rootUrl": "https://generativelanguage.googleapis.com/", + "baseUrl": "https://generativelanguage.googleapis.com/", + "servicePath": "", + "batchPath": "batch", "documentationLink": "https://developers.generativeai.google/api", - "title": "Gemini API", - "fullyEncodeReservedExpansion": true, - "basePath": "", + "version": "v1beta", "schemas": { - "BatchStats": { + "SafetyRating": { + "id": "SafetyRating", "type": "object", - "id": "BatchStats", - "description": "Stats about the batch.", "properties": { - "requestCount": { - "readOnly": true, - "description": "Output only. The number of requests in the batch.", - "type": "string", - "format": "int64" - }, - "pendingRequestCount": { - "description": "Output only. The number of requests that are still pending processing.", - "readOnly": true, + "category": { "type": "string", - "format": "int64" + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true + ], + "description": "Required. The category for this rating.", + "enumDescriptions": [ + "Category is unspecified.", + "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", + "**PaLM** - Content that is rude, disrespectful, or profane.", + "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", + "**PaLM** - Contains references to sexual acts or other lewd content.", + "**PaLM** - Promotes unchecked medical advice.", + "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", + "**Gemini** - Harassment content.", + "**Gemini** - Hate speech and content.", + "**Gemini** - Sexually explicit content.", + "**Gemini** - Dangerous content.", + "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." + ], + "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" + ] }, - "successfulRequestCount": { - "description": "Output only. The number of requests that were successfully processed.", - "readOnly": true, + "probability": { "type": "string", - "format": "int64" + "description": "Required. The probability of harm for this content.", + "enumDescriptions": [ + "Probability is unspecified.", + "Content has a negligible chance of being unsafe.", + "Content has a low chance of being unsafe.", + "Content has a medium chance of being unsafe.", + "Content has a high chance of being unsafe." + ], + "enum": [ + "HARM_PROBABILITY_UNSPECIFIED", + "NEGLIGIBLE", + "LOW", + "MEDIUM", + "HIGH" + ] }, - "failedRequestCount": { - "description": "Output only. The number of requests that failed to be processed.", - "readOnly": true, - "type": "string", - "format": "int64" + "blocked": { + "description": "Was this content blocked because of this rating?", + "type": "boolean" } - } + }, + "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." }, - "TunedModelSource": { - "description": "Tuned model as a source for training a new model.", + "AuthToken": { + "description": "A request to create an ephemeral authentication token.", "properties": { - "baseModel": { - "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`", + "newSessionExpireTime": { + "format": "google-datetime", + "type": "string", + "description": "Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected. If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future." + }, + "bidiGenerateContentSetup": { + "description": "Optional. Input only. Immutable. Configuration specific to `BidiGenerateContent`.", + "$ref": "BidiGenerateContentSetup" + }, + "name": { "readOnly": true, - "type": "string" + "type": "string", + "description": "Output only. Identifier. The token itself." }, - "tunedModel": { + "expireTime": { + "format": "google-datetime", "type": "string", - "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`" + "description": "Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.) If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future." + }, + "uses": { + "description": "Optional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1.", + "format": "int32", + "type": "integer" + }, + "fieldMask": { + "description": "Optional. Input only. Immutable. If field_mask is empty, and `bidi_generate_content_setup` is not present, then the effective `BidiGenerateContentSetup` message is taken from the Live API connection. If field_mask is empty, and `bidi_generate_content_setup` _is_ present, then the effective `BidiGenerateContentSetup` message is taken entirely from `bidi_generate_content_setup` in this request. The setup message from the Live API connection is ignored. If field_mask is not empty, then the corresponding fields from `bidi_generate_content_setup` will overwrite the fields from the setup message in the Live API connection.", + "format": "google-fieldmask", + "type": "string" } }, - "id": "TunedModelSource", - "type": "object" - }, - "TuningTask": { - "id": "TuningTask", "type": "object", - "description": "Tuning tasks that create tuned models.", + "id": "AuthToken" + }, + "GenerateAnswerRequest": { + "description": "Request to generate a grounded answer from the `Model`.", "properties": { - "completeTime": { - "type": "string", - "format": "google-datetime", - "readOnly": true, - "description": "Output only. The timestamp when tuning this model completed." + "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" }, - "startTime": { - "description": "Output only. The timestamp when tuning this model started.", - "readOnly": true, - "type": "string", - "format": "google-datetime" + "semanticRetriever": { + "description": "Content retrieved from resources created via the Semantic Retriever API.", + "$ref": "SemanticRetrieverConfig" }, - "hyperparameters": { - "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.", - "$ref": "Hyperparameters" + "inlinePassages": { + "description": "Passages provided inline with the request.", + "$ref": "GroundingPassages" }, - "snapshots": { - "readOnly": true, - "description": "Output only. Metrics collected during tuning.", + "contents": { "items": { - "$ref": "TuningSnapshot" + "$ref": "Content" }, + "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.", "type": "array" }, - "trainingData": { - "description": "Required. Input only. Immutable. The model training data.", - "$ref": "Dataset" - } - } - }, - "UrlMetadata": { - "type": "object", - "id": "UrlMetadata", - "description": "Context of the a single url retrieval.", - "properties": { - "retrievedUrl": { - "description": "Retrieved url by the tool.", - "type": "string" - }, - "urlRetrievalStatus": { - "description": "Status of the url retrieval.", - "type": "string", + "answerStyle": { "enumDescriptions": [ - "Default value. This value is unused.", - "Url retrieval is successful.", - "Url retrieval is failed due to error.", - "Url retrieval is failed because the content is behind paywall.", - "Url retrieval is failed because the content is unsafe." + "Unspecified answer style.", + "Succinct but abstract style.", + "Very brief and extractive style.", + "Verbose style including extra details. The response may be formatted as a sentence, paragraph, multiple paragraphs, or bullet points, etc." ], "enum": [ - "URL_RETRIEVAL_STATUS_UNSPECIFIED", - "URL_RETRIEVAL_STATUS_SUCCESS", - "URL_RETRIEVAL_STATUS_ERROR", - "URL_RETRIEVAL_STATUS_PAYWALL", - "URL_RETRIEVAL_STATUS_UNSAFE" - ] - } - } - }, - "RegisterFilesResponse": { - "description": "Response for `RegisterFiles`.", - "properties": { - "files": { - "description": "The registered files to be used when calling GenerateContent.", + "ANSWER_STYLE_UNSPECIFIED", + "ABSTRACTIVE", + "EXTRACTIVE", + "VERBOSE" + ], + "description": "Required. Style in which answers should be returned.", + "type": "string" + }, + "safetySettings": { "items": { - "$ref": "File" + "$ref": "SafetySetting" }, + "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.", "type": "array" } }, "type": "object", - "id": "RegisterFilesResponse" + "id": "GenerateAnswerRequest" }, - "StreamableHttpTransport": { - "id": "StreamableHttpTransport", - "type": "object", - "description": "A transport that can stream HTTP requests and responses. Next ID: 6", + "GroundingAttribution": { + "description": "Attribution for a source that contributed to an answer.", "properties": { - "headers": { - "description": "Optional: Fields for authentication headers, timeouts, etc., if needed.", - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "timeout": { - "type": "string", - "format": "google-duration", - "description": "HTTP timeout for regular operations." - }, - "url": { - "description": "The full URL for the MCPServer endpoint. Example: \"https://api.example.com/mcp\"", - "type": "string" - }, - "terminateOnClose": { - "description": "Whether to close the client session when the transport closes.", - "type": "boolean" + "sourceId": { + "description": "Output only. Identifier for the source contributing to this attribution.", + "readOnly": true, + "$ref": "AttributionSourceId" }, - "sseReadTimeout": { - "description": "Timeout for SSE read operations.", - "type": "string", - "format": "google-duration" + "content": { + "description": "Grounding source content that makes up this attribution.", + "$ref": "Content" } - } + }, + "type": "object", + "id": "GroundingAttribution" }, - "SearchEntryPoint": { - "description": "Google search entry point.", + "TextCompletion": { "properties": { - "renderedContent": { - "type": "string", - "description": "Optional. Web content snippet that can be embedded in a web page or an app webview." + "citationMetadata": { + "readOnly": true, + "$ref": "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`." }, - "sdkBlob": { - "description": "Optional. Base64 encoded JSON representing array of tuple.", - "type": "string", - "format": "byte" - } - }, - "type": "object", - "id": "SearchEntryPoint" - }, - "MetadataFilter": { - "type": "object", - "id": "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": { - "key": { - "description": "Required. The key of the metadata to filter on.", + "output": { + "description": "Output only. The generated text returned from the model.", + "readOnly": true, "type": "string" }, - "conditions": { - "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.", + "safetyRatings": { + "description": "Ratings for the safety of a response. There is at most one rating per category.", "items": { - "$ref": "Condition" + "$ref": "SafetyRating" }, "type": "array" } - } - }, - "InlinedRequests": { - "id": "InlinedRequests", - "type": "object", - "description": "The requests to be processed in the batch if provided as part of the batch creation request.", - "properties": { - "requests": { - "type": "array", - "description": "Required. The requests to be processed in the batch.", - "items": { - "$ref": "InlinedRequest" - } - } - } - }, - "Embedding": { - "description": "A list of floats representing the embedding.", - "properties": { - "value": { - "type": "array", - "description": "The embedding values.", - "items": { - "type": "number", - "format": "float" - } - } }, - "type": "object", - "id": "Embedding" + "description": "Output text returned from a model.", + "id": "TextCompletion", + "type": "object" }, - "GoogleAiGenerativelanguageV1betaGroundingSupport": { + "Schema": { "type": "object", - "id": "GoogleAiGenerativelanguageV1betaGroundingSupport", - "description": "Grounding support.", + "id": "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": { - "renderedParts": { - "readOnly": true, - "description": "Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.", + "description": { + "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.", + "type": "string" + }, + "nullable": { + "description": "Optional. Indicates if the value may be null.", + "type": "boolean" + }, + "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": "integer", - "format": "int32" + "type": "string" }, "type": "array" }, - "segment": { - "description": "Segment of the content this support belongs to.", - "$ref": "GoogleAiGenerativelanguageV1betaSegment" + "properties": { + "description": "Optional. Properties of Type.OBJECT.", + "additionalProperties": { + "$ref": "Schema" + }, + "type": "object" }, - "groundingChunkIndices": { - "type": "array", - "description": "Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order).", - "items": { - "type": "integer", - "format": "int32" - } + "minLength": { + "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING", + "type": "string", + "format": "int64" }, - "confidenceScores": { - "description": "Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.", + "default": { + "description": "Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors.", + "type": "any" + }, + "format": { + "description": "Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality.", + "type": "string" + }, + "example": { + "description": "Optional. Example of the object. Will only populated when the object is the root.", + "type": "any" + }, + "required": { + "type": "array", "items": { - "type": "number", - "format": "float" + "type": "string" }, - "type": "array" - } - } - }, - "EmbedContentConfig": { - "id": "EmbedContentConfig", - "type": "object", - "description": "Configurations for the EmbedContent request.", - "properties": { - "taskType": { - "description": "Optional. The task type of the embedding.", + "description": "Optional. Required properties of Type.OBJECT." + }, + "maximum": { + "type": "number", + "format": "double", + "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER" + }, + "maxProperties": { + "type": "string", + "format": "int64", + "description": "Optional. Maximum number of the properties for Type.OBJECT." + }, + "items": { + "description": "Optional. Schema of the elements of Type.ARRAY.", + "$ref": "Schema" + }, + "type": { "type": "string", + "description": "Required. Data type.", "enumDescriptions": [ - "Unset value, which will default to one of the other enum values.", - "Specifies the given text is a query in a search/retrieval setting.", - "Specifies the given text is a document from the corpus being searched.", - "Specifies the given text will be used for STS.", - "Specifies that the given text will be classified.", - "Specifies that the embeddings will be used for clustering.", - "Specifies that the given text will be used for question answering.", - "Specifies that the given text will be used for fact verification.", - "Specifies that the given text will be used for code retrieval." + "Not specified, should not be used.", + "String type.", + "Number type.", + "Integer type.", + "Boolean type.", + "Array type.", + "Object type.", + "Null type." ], "enum": [ - "TASK_TYPE_UNSPECIFIED", - "RETRIEVAL_QUERY", - "RETRIEVAL_DOCUMENT", - "SEMANTIC_SIMILARITY", - "CLASSIFICATION", - "CLUSTERING", - "QUESTION_ANSWERING", - "FACT_VERIFICATION", - "CODE_RETRIEVAL_QUERY" + "TYPE_UNSPECIFIED", + "STRING", + "NUMBER", + "INTEGER", + "BOOLEAN", + "ARRAY", + "OBJECT", + "NULL" ] }, - "outputDimensionality": { - "type": "integer", - "format": "int32", - "description": "Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end." + "minProperties": { + "type": "string", + "format": "int64", + "description": "Optional. Minimum number of the properties for Type.OBJECT." }, - "documentOcr": { - "description": "Optional. Whether to enable OCR for document content.", - "type": "boolean" + "title": { + "description": "Optional. The title of the schema.", + "type": "string" }, - "audioTrackExtraction": { - "description": "Optional. Whether to extract audio from video content.", - "type": "boolean" + "maxLength": { + "type": "string", + "format": "int64", + "description": "Optional. Maximum length of the Type.STRING" }, - "title": { - "description": "Optional. The title for the text.", + "pattern": { + "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.", "type": "string" }, - "autoTruncate": { - "type": "boolean", - "description": "Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length." + "maxItems": { + "type": "string", + "format": "int64", + "description": "Optional. Maximum number of the elements for Type.ARRAY." + }, + "minimum": { + "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER", + "type": "number", + "format": "double" + }, + "anyOf": { + "items": { + "$ref": "Schema" + }, + "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.", + "type": "array" + }, + "propertyOrdering": { + "type": "array", + "description": "Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.", + "items": { + "type": "string" + } + }, + "minItems": { + "description": "Optional. Minimum number of the elements for Type.ARRAY.", + "format": "int64", + "type": "string" } } }, - "CitationMetadata": { - "description": "A collection of source attributions for a piece of content.", + "ResponseFormatConfig": { + "id": "ResponseFormatConfig", + "type": "object", "properties": { - "citationSources": { - "type": "array", - "description": "Citations to sources for a specific response.", - "items": { - "$ref": "CitationSource" - } + "image": { + "description": "Optional. Image output format configuration.", + "$ref": "ImageResponseFormat" + }, + "text": { + "description": "Optional. Text output format configuration.", + "$ref": "TextResponseFormat" + }, + "audio": { + "description": "Optional. Audio output format configuration.", + "$ref": "AudioResponseFormat" } }, - "id": "CitationMetadata", - "type": "object" + "description": "Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality." }, - "EmbedContentRequest": { - "id": "EmbedContentRequest", - "type": "object", - "description": "Request containing the `Content` for the model to embed.", + "InlinedResponse": { "properties": { - "taskType": { - "type": "string", - "enum": [ - "TASK_TYPE_UNSPECIFIED", - "RETRIEVAL_QUERY", - "RETRIEVAL_DOCUMENT", - "SEMANTIC_SIMILARITY", - "CLASSIFICATION", - "CLUSTERING", - "QUESTION_ANSWERING", - "FACT_VERIFICATION", - "CODE_RETRIEVAL_QUERY" - ], - "description": "Optional. Deprecated: Please use EmbedContentConfig.task_type instead. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`).", - "enumDescriptions": [ - "Unset value, which will default to one of the other enum values.", - "Specifies the given text is a query in a search/retrieval setting.", - "Specifies the given text is a document from the corpus being searched.", - "Specifies the given text will be used for STS.", - "Specifies that the given text will be classified.", - "Specifies that the embeddings will be used for clustering.", - "Specifies that the given text will be used for question answering.", - "Specifies that the given text will be used for fact verification.", - "Specifies that the given text will be used for code retrieval." - ], - "deprecated": true - }, - "embedContentConfig": { - "description": "Optional. Configuration for the EmbedContent request.", - "$ref": "EmbedContentConfig" - }, - "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" - }, - "content": { - "description": "Required. The content to embed. Only the `parts.text` fields will be counted.", - "$ref": "Content" + "metadata": { + "readOnly": true, + "type": "object", + "description": "Output only. The metadata associated with the request.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } }, - "outputDimensionality": { - "description": "Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. 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`).", - "deprecated": true, - "type": "integer", - "format": "int32" + "error": { + "readOnly": true, + "$ref": "Status", + "description": "Output only. The error encountered while processing the request." }, - "title": { - "description": "Optional. Deprecated: Please use EmbedContentConfig.title instead. 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.", - "deprecated": true, - "type": "string" + "response": { + "description": "Output only. The response to the request.", + "readOnly": true, + "$ref": "GenerateContentResponse" } - } + }, + "description": "The response to a single request in the batch.", + "id": "InlinedResponse", + "type": "object" }, - "CountMessageTokensResponse": { - "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.", + "TranslationConfig": { "properties": { - "tokenCount": { - "type": "integer", - "format": "int32", - "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative." + "echoTargetLanguage": { + "description": "Optional. If true, the model will generate audio when the target language is spoken, essentially it will parrot the input. If false, we will not produce audio for the target language.", + "type": "boolean" + }, + "targetLanguageCode": { + "description": "Required. The target language for translation. Supported values are BCP-47 language codes (e.g. \"en\", \"es\", \"fr\").", + "type": "string" } }, - "id": "CountMessageTokensResponse", + "description": "Config for translation features.", + "id": "TranslationConfig", "type": "object" }, - "CountTextTokensRequest": { - "id": "CountTextTokensRequest", + "FileSearchStore": { + "id": "FileSearchStore", "type": "object", - "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", - "properties": { - "prompt": { - "description": "Required. The free-form input text given to the model as a prompt.", - "$ref": "TextPrompt" - } - } - }, - "GenerateContentBatch": { - "description": "A resource representing a batch of `GenerateContent` requests.", "properties": { - "batchStats": { - "readOnly": true, - "description": "Output only. Stats about the batch.", - "$ref": "BatchStats" - }, "updateTime": { + "format": "google-datetime", "readOnly": true, - "description": "Output only. The time at which the batch was last updated.", - "type": "string", - "format": "google-datetime" - }, - "displayName": { "type": "string", - "description": "Required. The user-defined name of this batch." + "description": "Output only. The Timestamp of when the `FileSearchStore` was last updated." }, "name": { - "type": "string", + "description": "Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the \"fileSearchStores/\" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.", "readOnly": true, - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`." - }, - "output": { - "description": "Output only. The output of the batch request.", - "$ref": "GenerateContentBatchOutput", - "readOnly": true - }, - "state": { - "type": "string", - "enum": [ - "BATCH_STATE_UNSPECIFIED", - "BATCH_STATE_PENDING", - "BATCH_STATE_RUNNING", - "BATCH_STATE_SUCCEEDED", - "BATCH_STATE_FAILED", - "BATCH_STATE_CANCELLED", - "BATCH_STATE_EXPIRED" - ], - "description": "Output only. The state of the batch.", - "enumDescriptions": [ - "The batch state is unspecified.", - "The service is preparing to run the batch.", - "The batch is in progress.", - "The batch completed successfully.", - "The batch failed.", - "The batch has been cancelled.", - "The batch has expired." - ], - "readOnly": true - }, - "inputConfig": { - "description": "Required. Input configuration of the instances on which batch processing are performed.", - "$ref": "InputConfig" + "type": "string" }, - "createTime": { + "pendingDocumentsCount": { + "description": "Output only. The number of documents in the `FileSearchStore` that are being processed.", "readOnly": true, - "description": "Output only. The time at which the batch was created.", "type": "string", - "format": "google-datetime" + "format": "int64" }, - "endTime": { - "description": "Output only. The time at which the batch processing completed.", + "sizeBytes": { "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "priority": { "type": "string", "format": "int64", - "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0." + "description": "Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`." }, - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "embeddingModel": { + "description": "Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used.", "type": "string" - } - }, - "id": "GenerateContentBatch", - "type": "object" - }, - "InlinedEmbedContentRequest": { - "type": "object", - "id": "InlinedEmbedContentRequest", - "description": "The request to be processed in the batch.", - "properties": { - "metadata": { - "type": "object", - "description": "Optional. The metadata to be associated with the request.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } - }, - "request": { - "description": "Required. The request to be processed in the batch.", - "$ref": "EmbedContentRequest" - } - } - }, - "FunctionResponse": { - "id": "FunctionResponse", - "type": "object", - "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.", - "properties": { - "parts": { - "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.", - "items": { - "$ref": "FunctionResponsePart" - }, - "type": "array" - }, - "response": { - "type": "object", - "description": "Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. \"output\", \"result\", etc. In particular, if the function call failed to execute, the response can have an \"error\" key to return error details to the model. Multimedia can be included by using a subobject containing a single \"$ref\" key whose value is the `inline_data.display_name` of a `FunctionResponsePart` holding the multimedia. See https://ai.google.dev/gemini-api/docs/function-calling#multimodal.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } - }, - "willContinue": { - "description": "Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.", - "type": "boolean" }, - "id": { - "description": "Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.", + "displayName": { + "description": "Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", "type": "string" }, - "name": { + "createTime": { + "readOnly": true, "type": "string", - "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128." + "format": "google-datetime", + "description": "Output only. The Timestamp of when the `FileSearchStore` was created." }, - "scheduling": { - "description": "Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.", - "type": "string", - "enumDescriptions": [ - "This value is unused.", - "Only add the result to the conversation context, do not interrupt or trigger generation.", - "Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.", - "Add the result to the conversation context, interrupt ongoing generation and prompt to generate output." - ], - "enum": [ - "SCHEDULING_UNSPECIFIED", - "SILENT", - "WHEN_IDLE", - "INTERRUPT" - ] - } - } - }, - "InputConfig": { - "description": "Configures the input to the batch request.", - "properties": { - "fileName": { - "description": "The name of the `File` containing the input requests.", + "failedDocumentsCount": { + "description": "Output only. The number of documents in the `FileSearchStore` that have failed processing.", + "format": "int64", + "readOnly": true, "type": "string" }, - "requests": { - "description": "The requests to be processed in the batch.", - "$ref": "InlinedRequests" + "activeDocumentsCount": { + "readOnly": true, + "type": "string", + "format": "int64", + "description": "Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval." } }, - "id": "InputConfig", - "type": "object" + "description": "A `FileSearchStore` is a collection of `Document`s." }, "CountTextTokensResponse": { - "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.", "properties": { "tokenCount": { "type": "integer", @@ -590,1073 +470,656 @@ "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative." } }, + "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.", "id": "CountTextTokensResponse", "type": "object" }, - "CountTokensResponse": { - "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.", + "TextResponseFormat": { + "description": "Configuration for text output format.", "properties": { - "totalTokens": { - "type": "integer", - "format": "int32", - "description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative." - }, - "cacheTokensDetails": { - "readOnly": true, - "description": "Output only. List of modalities that were processed in the cached content.", - "items": { - "$ref": "ModalityTokenCount" - }, - "type": "array" - }, - "cachedContentTokenCount": { - "type": "integer", - "format": "int32", - "description": "Number of tokens in the cached part of the prompt (the cached content)." - }, - "promptTokensDetails": { - "type": "array", - "description": "Output only. List of modalities that were processed in the request input.", - "items": { - "$ref": "ModalityTokenCount" - }, - "readOnly": true - } - }, - "id": "CountTokensResponse", - "type": "object" - }, - "Web": { - "description": "Chunk from the web.", - "properties": { - "uri": { - "readOnly": true, - "description": "Output only. URI reference of the chunk.", + "mimeType": { + "description": "Optional. The MIME type of the text output.", + "enumDescriptions": [ + "Default value. This value is unused.", + "JSON output format.", + "Plain text output format." + ], + "enum": [ + "MIME_TYPE_UNSPECIFIED", + "APPLICATION_JSON", + "TEXT_PLAIN" + ], "type": "string" }, - "title": { - "description": "Output only. Title of the chunk.", - "readOnly": true, - "type": "string" + "schema": { + "description": "Optional. The JSON schema that the output should conform to. Only applicable when mime_type is APPLICATION_JSON.", + "type": "any" } }, "type": "object", - "id": "Web" - }, - "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", - "id": "CodeExecution" + "id": "TextResponseFormat" }, - "WhiteSpaceConfig": { - "description": "Configuration for a white space chunking algorithm [white space delimited].", + "SemanticRetrieverConfig": { + "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.", "properties": { - "maxOverlapTokens": { - "description": "Maximum number of overlapping tokens between two adjacent chunks.", - "type": "integer", - "format": "int32" + "query": { + "description": "Required. Query to use for matching `Chunk`s in the given resource by similarity.", + "$ref": "Content" }, - "maxTokensPerChunk": { - "description": "Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow.", + "minimumRelevanceScore": { + "format": "float", + "type": "number", + "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s." + }, + "metadataFilters": { + "type": "array", + "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.", + "items": { + "$ref": "MetadataFilter" + } + }, + "source": { + "description": "Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`.", + "type": "string" + }, + "maxChunksCount": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "Optional. Maximum number of relevant `Chunk`s to retrieve." } }, "type": "object", - "id": "WhiteSpaceConfig" + "id": "SemanticRetrieverConfig" }, - "TunedModel": { + "AudioResponseFormat": { "type": "object", - "id": "TunedModel", - "description": "A fine-tuned model created using ModelService.CreateTunedModel.", + "id": "AudioResponseFormat", + "description": "Configuration for audio output format.", "properties": { - "topP": { - "type": "number", - "format": "float", - "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model." - }, - "topK": { - "type": "integer", - "format": "int32", - "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." - }, - "temperature": { - "type": "number", - "format": "float", - "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." - }, - "updateTime": { - "type": "string", - "format": "google-datetime", - "readOnly": true, - "description": "Output only. The timestamp when this model was updated." - }, - "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" - }, - "state": { + "delivery": { "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "CREATING", - "ACTIVE", - "FAILED" - ], - "description": "Output only. The state of the tuned model.", "enumDescriptions": [ - "The default value. This value is unused.", - "The model is being created.", - "The model is ready to be used.", - "The model failed to be created." + "Default value. This value is unused.", + "Audio data is returned inline in the response.", + "Audio data is returned as a URI." ], - "readOnly": true - }, - "readerProjectNumbers": { - "description": "Optional. List of project numbers that have read access to the tuned model.", - "items": { - "type": "string", - "format": "int64" - }, - "type": "array" - }, - "createTime": { - "type": "string", - "format": "google-datetime", - "description": "Output only. The timestamp when this model was created.", - "readOnly": true + "enum": [ + "DELIVERY_UNSPECIFIED", + "INLINE", + "URI" + ], + "description": "Optional. The delivery mode for the audio output." }, - "tunedModelSource": { - "description": "Optional. TunedModel to use as the starting point for training the new model.", - "$ref": "TunedModelSource" + "sampleRate": { + "description": "Optional. Sample rate in Hz.", + "type": "integer", + "format": "int32" }, - "baseModel": { - "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`", + "mimeType": { + "description": "Optional. The MIME type of the audio output.", + "enumDescriptions": [ + "Default value. This value is unused.", + "MP3 audio format.", + "OGG Opus audio format.", + "Raw PCM (L16) audio format.", + "WAV audio format.", + "A-law audio format.", + "Mu-law audio format." + ], + "enum": [ + "MIME_TYPE_UNSPECIFIED", + "AUDIO_MP3", + "AUDIO_OGG_OPUS", + "AUDIO_L16", + "AUDIO_WAV", + "AUDIO_ALAW", + "AUDIO_MULAW" + ], "type": "string" }, - "tuningTask": { - "description": "Required. The tuning task that creates the tuned model.", - "$ref": "TuningTask" - }, - "name": { - "type": "string", - "readOnly": true, - "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`" - }, - "description": { - "type": "string", - "description": "Optional. A short description of this model." + "bitRate": { + "description": "Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).", + "format": "int32", + "type": "integer" } } }, - "SemanticRetrieverConfig": { - "id": "SemanticRetrieverConfig", - "type": "object", - "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.", + "Content": { "properties": { - "maxChunksCount": { - "type": "integer", - "format": "int32", - "description": "Optional. Maximum number of relevant `Chunk`s to retrieve." - }, - "minimumRelevanceScore": { - "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s.", - "type": "number", - "format": "float" - }, - "query": { - "description": "Required. Query to use for matching `Chunk`s in the given resource by similarity.", - "$ref": "Content" + "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" }, - "metadataFilters": { - "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.", + "parts": { + "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.", "items": { - "$ref": "MetadataFilter" + "$ref": "Part" }, "type": "array" - }, - "source": { - "description": "Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`.", - "type": "string" } - } + }, + "description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.", + "id": "Content", + "type": "object" }, - "TextCompletion": { - "type": "object", - "id": "TextCompletion", - "description": "Output text returned from a model.", + "RegisterFilesResponse": { + "description": "Response for `RegisterFiles`.", "properties": { - "safetyRatings": { - "description": "Ratings for the safety of a response. There is at most one rating per category.", + "files": { + "description": "The registered files to be used when calling GenerateContent.", "items": { - "$ref": "SafetyRating" + "$ref": "File" }, "type": "array" - }, - "output": { - "type": "string", - "description": "Output only. The generated text returned from the model.", - "readOnly": true - }, - "citationMetadata": { - "readOnly": true, - "description": "Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`.", - "$ref": "CitationMetadata" } - } - }, - "ListCachedContentsResponse": { + }, "type": "object", - "id": "ListCachedContentsResponse", - "description": "Response with CachedContents list.", - "properties": { - "cachedContents": { - "type": "array", - "description": "List of cached contents.", - "items": { - "$ref": "CachedContent" - } - }, - "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" - } - } + "id": "RegisterFilesResponse" }, - "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`.", + "AttributionSourceId": { "properties": { - "modelStatus": { - "readOnly": true, - "description": "Output only. The current model status of this model.", - "$ref": "ModelStatus" + "groundingPassage": { + "description": "Identifier for an inline passage.", + "$ref": "GroundingPassageId" }, - "candidates": { - "description": "Candidate responses from the model.", - "items": { - "$ref": "Candidate" - }, - "type": "array" - }, - "promptFeedback": { - "description": "Returns the prompt's feedback related to the content filters.", - "$ref": "PromptFeedback" - }, - "modelVersion": { - "readOnly": true, - "description": "Output only. The model version used to generate the response.", - "type": "string" - }, - "responseId": { - "readOnly": true, - "description": "Output only. response_id is used to identify each response.", - "type": "string" - }, - "usageMetadata": { - "readOnly": true, - "description": "Output only. Metadata on the generation requests' token usage.", - "$ref": "UsageMetadata" + "semanticRetrieverChunk": { + "description": "Identifier for a `Chunk` fetched via Semantic Retriever.", + "$ref": "SemanticRetrieverChunk" } }, - "id": "GenerateContentResponse", + "description": "Identifier for the source contributing to this attribution.", + "id": "AttributionSourceId", "type": "object" }, - "ModalityTokenCount": { - "description": "Represents token counting info for a single modality.", - "properties": { - "tokenCount": { - "type": "integer", - "format": "int32", - "description": "Number of tokens." - }, - "modality": { - "description": "The modality associated with this token count.", - "type": "string", - "enumDescriptions": [ - "Unspecified modality.", - "Plain text.", - "Image.", - "Video.", - "Audio.", - "Document, e.g. PDF." - ], - "enum": [ - "MODALITY_UNSPECIFIED", - "TEXT", - "IMAGE", - "VIDEO", - "AUDIO", - "DOCUMENT" - ] - } - }, + "FunctionResponsePart": { + "id": "FunctionResponsePart", "type": "object", - "id": "ModalityTokenCount" - }, - "EmbedTextResponse": { - "description": "The response to a EmbedTextRequest.", "properties": { - "embedding": { - "readOnly": true, - "description": "Output only. The embedding generated from the input text.", - "$ref": "Embedding" + "inlineData": { + "description": "Inline media bytes.", + "$ref": "FunctionResponseBlob" } }, - "id": "EmbedTextResponse", - "type": "object" + "description": "A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes." }, - "LatLng": { - "id": "LatLng", - "type": "object", - "description": "An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.", + "ListModelsResponse": { + "description": "Response from `ListModel` containing a paginated list of Models.", "properties": { - "latitude": { - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", - "type": "number", - "format": "double" + "models": { + "type": "array", + "description": "The returned Models.", + "items": { + "$ref": "Model" + } }, - "longitude": { - "type": "number", - "format": "double", - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]." - } - } - }, - "GoogleAiGenerativelanguageV1betaSegment": { - "type": "object", - "id": "GoogleAiGenerativelanguageV1betaSegment", - "description": "Segment of the content.", - "properties": { - "text": { - "description": "The text corresponding to the segment from the response.", + "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" - }, - "startIndex": { - "description": "Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.", - "type": "integer", - "format": "int32" - }, - "partIndex": { - "description": "The index of a Part object within its parent Content object.", - "type": "integer", - "format": "int32" - }, - "endIndex": { - "type": "integer", - "format": "int32", - "description": "End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero." - } - } - }, - "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": { - "description": "Required. The prompt, whose token count is to be returned.", - "$ref": "MessagePrompt" } }, - "id": "CountMessageTokensRequest", - "type": "object" + "type": "object", + "id": "ListModelsResponse" }, - "ListDocumentsResponse": { - "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", + "FileData": { "properties": { - "documents": { - "description": "The returned `Document`s.", - "items": { - "$ref": "Document" - }, - "type": "array" + "fileUri": { + "description": "Required. URI.", + "type": "string" }, - "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.", + "mimeType": { + "description": "Optional. The IANA standard MIME type of the source data.", "type": "string" } }, - "id": "ListDocumentsResponse", + "description": "URI based data.", + "id": "FileData", "type": "object" }, - "InlinedEmbedContentRequests": { - "description": "The requests to be processed in the batch if provided as part of the batch creation request.", + "CachedContent": { + "id": "CachedContent", + "type": "object", "properties": { - "requests": { - "description": "Required. The requests to be processed in the batch.", + "contents": { "items": { - "$ref": "InlinedEmbedContentRequest" + "$ref": "Content" }, + "description": "Optional. Input only. Immutable. The content to cache.", "type": "array" - } - }, - "type": "object", - "id": "InlinedEmbedContentRequests" - }, - "PredictResponse": { - "description": "Response message for [PredictionService.Predict].", - "properties": { - "predictions": { - "type": "array", - "description": "The outputs of the prediction call.", - "items": { - "type": "any" - } - } - }, - "id": "PredictResponse", - "type": "object" - }, - "EmbedContentBatch": { - "description": "A resource representing a batch of `EmbedContent` requests.", - "properties": { - "inputConfig": { - "description": "Required. Input configuration of the instances on which batch processing are performed.", - "$ref": "InputEmbedContentConfig" }, - "createTime": { - "type": "string", - "format": "google-datetime", - "description": "Output only. The time at which the batch was created.", - "readOnly": true + "toolConfig": { + "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools.", + "$ref": "ToolConfig" }, - "endTime": { - "description": "Output only. The time at which the batch processing completed.", - "readOnly": true, + "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.", "type": "string", "format": "google-datetime" }, + "displayName": { + "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.", + "type": "string" + }, + "createTime": { + "description": "Output only. Creation time of the cache entry.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`", "type": "string" }, - "priority": { - "type": "string", - "format": "int64", - "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0." + "usageMetadata": { + "description": "Output only. Metadata on the usage of the cached content.", + "readOnly": true, + "$ref": "CachedContentUsageMetadata" }, - "batchStats": { - "description": "Output only. Stats about the batch.", - "$ref": "EmbedContentBatchStats", - "readOnly": true + "ttl": { + "type": "string", + "format": "google-duration", + "description": "Input only. New TTL for this resource, input only." }, - "displayName": { - "description": "Required. The user-defined name of this batch.", - "type": "string" + "systemInstruction": { + "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only.", + "$ref": "Content" }, "updateTime": { + "readOnly": true, "type": "string", "format": "google-datetime", - "readOnly": true, - "description": "Output only. The time at which the batch was last updated." - }, - "output": { - "description": "Output only. The output of the batch request.", - "$ref": "EmbedContentBatchOutput", - "readOnly": true + "description": "Output only. When the cache entry was last updated in UTC time." }, "name": { - "type": "string", - "readOnly": true, - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`." - }, - "state": { "readOnly": true, - "enumDescriptions": [ - "The batch state is unspecified.", - "The service is preparing to run the batch.", - "The batch is in progress.", - "The batch completed successfully.", - "The batch failed.", - "The batch has been cancelled.", - "The batch has expired." - ], - "description": "Output only. The state of the batch.", "type": "string", - "enum": [ - "BATCH_STATE_UNSPECIFIED", - "BATCH_STATE_PENDING", - "BATCH_STATE_RUNNING", - "BATCH_STATE_SUCCEEDED", - "BATCH_STATE_FAILED", - "BATCH_STATE_CANCELLED", - "BATCH_STATE_EXPIRED" - ] + "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`" + }, + "tools": { + "type": "array", + "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response", + "items": { + "$ref": "Tool" + } } }, - "type": "object", - "id": "EmbedContentBatch" + "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." }, - "TextPrompt": { - "id": "TextPrompt", - "type": "object", - "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.", + "SpeakerVoiceConfig": { + "description": "The configuration for a single speaker in a multi speaker setup.", "properties": { - "text": { - "type": "string", - "description": "Required. The prompt text." + "voiceConfig": { + "description": "Required. The configuration for the voice to use.", + "$ref": "VoiceConfig" + }, + "speaker": { + "description": "Required. The name of the speaker to use. Should be the same as in the prompt.", + "type": "string" } - } - }, - "GroundingMetadata": { - "id": "GroundingMetadata", + }, "type": "object", - "description": "Metadata returned to client when grounding is enabled.", + "id": "SpeakerVoiceConfig" + }, + "InputFeedback": { + "description": "Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question.", "properties": { - "retrievalMetadata": { - "description": "Metadata related to retrieval in the grounding flow.", - "$ref": "RetrievalMetadata" - }, - "googleMapsWidgetContextToken": { + "blockReason": { "type": "string", - "description": "Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled." + "enumDescriptions": [ + "Default value. This value is unused.", + "Input was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", + "Input was blocked due to other reasons." + ], + "enum": [ + "BLOCK_REASON_UNSPECIFIED", + "SAFETY", + "OTHER" + ], + "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase the input." }, - "groundingChunks": { - "description": "List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses.", + "safetyRatings": { + "type": "array", "items": { - "$ref": "GroundingChunk" + "$ref": "SafetyRating" }, - "type": "array" + "description": "Ratings for safety of the input. There is at most one rating per category." + } + }, + "type": "object", + "id": "InputFeedback" + }, + "TunedModel": { + "properties": { + "tunedModelSource": { + "description": "Optional. TunedModel to use as the starting point for training the new model.", + "$ref": "TunedModelSource" }, - "searchEntryPoint": { - "description": "Optional. Google search entry for the following-up web searches.", - "$ref": "SearchEntryPoint" + "baseModel": { + "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`", + "type": "string" }, - "groundingSupports": { - "type": "array", - "description": "List of grounding support.", - "items": { - "$ref": "GoogleAiGenerativelanguageV1betaGroundingSupport" - } + "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" }, - "webSearchQueries": { - "type": "array", - "description": "Web search queries for the following-up web search.", - "items": { - "type": "string" - } + "topK": { + "type": "integer", + "format": "int32", + "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." }, - "imageSearchQueries": { - "description": "Image search queries used for grounding.", + "readerProjectNumbers": { + "description": "Optional. List of project numbers that have read access to the tuned model.", "items": { + "format": "int64", "type": "string" }, "type": "array" - } - } - }, - "GenerateContentRequest": { - "type": "object", - "id": "GenerateContentRequest", - "description": "Request to generate a completion from the model.", - "properties": { - "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": "Tool" - }, - "type": "array" - }, - "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.", - "$ref": "ToolConfig" - }, - "contents": { - "type": "array", - "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries 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": "Content" - } - }, - "generationConfig": { - "description": "Optional. Configuration options for model generation and outputs.", - "$ref": "GenerationConfig" }, - "store": { - "type": "boolean", - "description": "Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config." + "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" }, - "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}`", + "description": { + "description": "Optional. A short description of this model.", "type": "string" }, - "model": { + "createTime": { + "readOnly": true, "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." + "format": "google-datetime", + "description": "Output only. The timestamp when this model was created." }, - "serviceTier": { - "description": "Optional. The service tier of the request.", + "updateTime": { + "readOnly": true, "type": "string", - "enumDescriptions": [ - "Default service tier, which is standard.", - "Standard service tier.", - "Flex service tier.", - "Priority service tier." - ], - "enum": [ - "unspecified", - "standard", - "flex", - "priority" - ] + "format": "google-datetime", + "description": "Output only. The timestamp when this model was updated." }, - "systemInstruction": { - "description": "Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.", - "$ref": "Content" + "tuningTask": { + "description": "Required. The tuning task that creates the tuned model.", + "$ref": "TuningTask" }, - "safetySettings": { - "type": "array", - "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, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", - "items": { - "$ref": "SafetySetting" - } - } - } - }, - "ThinkingConfig": { - "id": "ThinkingConfig", - "type": "object", - "description": "Config for thinking features.", - "properties": { - "includeThoughts": { - "type": "boolean", - "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only when available." + "topP": { + "format": "float", + "type": "number", + "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model." }, - "thinkingBudget": { - "description": "The number of thoughts tokens that the model should generate.", - "type": "integer", - "format": "int32" + "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" }, - "thinkingLevel": { + "state": { "type": "string", + "readOnly": true, "enumDescriptions": [ - "Default value.", - "Little to no thinking.", - "Low thinking level.", - "Medium thinking level.", - "High thinking level." + "The default value. This value is unused.", + "The model is being created.", + "The model is ready to be used.", + "The model failed to be created." ], "enum": [ - "THINKING_LEVEL_UNSPECIFIED", - "MINIMAL", - "LOW", - "MEDIUM", - "HIGH" + "STATE_UNSPECIFIED", + "CREATING", + "ACTIVE", + "FAILED" ], - "description": "Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error." + "description": "Output only. The state of the tuned model." } - } + }, + "description": "A fine-tuned model created using ModelService.CreateTunedModel.", + "id": "TunedModel", + "type": "object" }, - "SpeechConfig": { - "id": "SpeechConfig", - "type": "object", - "description": "Config for speech generation and transcription.", + "FunctionResponseBlob": { "properties": { - "multiSpeakerVoiceConfig": { - "description": "Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.", - "$ref": "MultiSpeakerVoiceConfig" - }, - "languageCode": { - "description": "Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`.", + "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" }, - "voiceConfig": { - "description": "The configuration in case of single-voice output.", - "$ref": "VoiceConfig" + "data": { + "type": "string", + "format": "byte", + "description": "Raw bytes for media formats." } - } + }, + "description": "Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.", + "id": "FunctionResponseBlob", + "type": "object" }, - "WebSearch": { + "DownloadMediaResponse": { + "description": "Response for DownloadMedia.", + "properties": { + "blob": { + "description": "Output only. The blob data.", + "readOnly": true, + "$ref": "GdataMedia" + } + }, "type": "object", - "id": "WebSearch", - "description": "Standard web search for grounding and related configurations.", - "properties": {} + "id": "DownloadMediaResponse" }, - "UrlContext": { - "description": "Tool to support URL context retrieval.", - "properties": {}, - "id": "UrlContext", - "type": "object" + "ListCorporaResponse": { + "type": "object", + "id": "ListCorporaResponse", + "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", + "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" + }, + "corpora": { + "type": "array", + "items": { + "$ref": "Corpus" + }, + "description": "The returned corpora." + } + } }, "LogprobsResultCandidate": { - "description": "Candidate for the logprobs token and score.", "properties": { "token": { "description": "The candidate’s token string value.", "type": "string" }, "logProbability": { - "type": "number", + "description": "The candidate's log probability.", "format": "float", - "description": "The candidate's log probability." + "type": "number" }, "tokenId": { - "description": "The candidate’s token id value.", + "format": "int32", "type": "integer", - "format": "int32" + "description": "The candidate’s token id value." } }, + "description": "Candidate for the logprobs token and score.", "id": "LogprobsResultCandidate", "type": "object" }, - "File": { - "id": "File", + "CreateFileRequest": { "type": "object", - "description": "A file uploaded to the API. Next ID: 15", + "id": "CreateFileRequest", + "description": "Request for `CreateFile`.", "properties": { - "sizeBytes": { - "type": "string", + "file": { + "description": "Optional. Metadata for the file to create.", + "$ref": "File" + } + } + }, + "EmbedContentBatchStats": { + "description": "Stats about the batch.", + "properties": { + "requestCount": { + "description": "Output only. The number of requests in the batch.", "format": "int64", - "description": "Output only. Size of the file in bytes.", - "readOnly": true - }, - "downloadUri": { "readOnly": true, - "description": "Output only. The download uri of the `File`.", "type": "string" }, - "error": { - "readOnly": true, - "description": "Output only. Error status if File processing failed.", - "$ref": "Status" - }, - "mimeType": { - "description": "Output only. MIME type of the file.", + "failedRequestCount": { + "description": "Output only. The number of requests that failed to be processed.", + "format": "int64", "readOnly": true, "type": "string" }, - "videoMetadata": { - "description": "Output only. Metadata for a video.", - "$ref": "VideoFileMetadata", - "readOnly": true - }, - "state": { - "description": "Output only. Processing state of the File.", - "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "PROCESSING", - "ACTIVE", - "FAILED" - ], - "readOnly": true, - "enumDescriptions": [ - "The default value. This value is used if the state is omitted.", - "File is being processed and cannot be used for inference yet.", - "File is processed and available for inference.", - "File failed processing." - ] - }, - "displayName": { - "type": "string", - "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"" - }, - "updateTime": { - "type": "string", - "format": "google-datetime", - "description": "Output only. The timestamp of when the `File` was last updated.", - "readOnly": true - }, - "expirationTime": { - "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.", - "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "sha256Hash": { + "pendingRequestCount": { + "description": "Output only. The number of requests that are still pending processing.", "readOnly": true, - "description": "Output only. SHA-256 hash of the uploaded bytes.", - "type": "string", - "format": "byte" - }, - "source": { "type": "string", - "enumDescriptions": [ - "Used if source is not specified.", - "Indicates the file is uploaded by the user.", - "Indicates the file is generated by Google.", - "Indicates the file is a registered, i.e. a Google Cloud Storage file." - ], - "enum": [ - "SOURCE_UNSPECIFIED", - "UPLOADED", - "GENERATED", - "REGISTERED" - ], - "description": "Source of the File." + "format": "int64" }, - "createTime": { - "type": "string", - "format": "google-datetime", + "successfulRequestCount": { + "format": "int64", "readOnly": true, - "description": "Output only. The timestamp of when the `File` was created." - }, - "name": { "type": "string", - "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`" - }, - "uri": { - "description": "Output only. The uri of the `File`.", - "readOnly": true, - "type": "string" + "description": "Output only. The number of requests that were successfully processed." } - } - }, - "SpeakerVoiceConfig": { - "id": "SpeakerVoiceConfig", + }, "type": "object", - "description": "The configuration for a single speaker in a multi speaker setup.", - "properties": { - "speaker": { - "type": "string", - "description": "Required. The name of the speaker to use. Should be the same as in the prompt." - }, - "voiceConfig": { - "description": "Required. The configuration for the voice to use.", - "$ref": "VoiceConfig" - } - } + "id": "EmbedContentBatchStats" }, - "InlinedResponse": { + "WhiteSpaceConfig": { + "id": "WhiteSpaceConfig", "type": "object", - "id": "InlinedResponse", - "description": "The response to a single request in the batch.", "properties": { - "metadata": { - "readOnly": true, - "description": "Output only. The metadata associated with the request.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "type": "object" - }, - "response": { - "readOnly": true, - "description": "Output only. The response to the request.", - "$ref": "GenerateContentResponse" + "maxTokensPerChunk": { + "format": "int32", + "type": "integer", + "description": "Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow." }, - "error": { - "readOnly": true, - "description": "Output only. The error encountered while processing the request.", - "$ref": "Status" + "maxOverlapTokens": { + "type": "integer", + "format": "int32", + "description": "Maximum number of overlapping tokens between two adjacent chunks." } - } + }, + "description": "Configuration for a white space chunking algorithm [white space delimited]." }, - "GenerateAnswerRequest": { - "description": "Request to generate a grounded answer from the `Model`.", + "CitationMetadata": { "properties": { - "safetySettings": { - "type": "array", - "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": "SafetySetting" - } - }, - "inlinePassages": { - "description": "Passages provided inline with the request.", - "$ref": "GroundingPassages" - }, - "semanticRetriever": { - "description": "Content retrieved from resources created via the Semantic Retriever API.", - "$ref": "SemanticRetrieverConfig" - }, - "contents": { + "citationSources": { "type": "array", - "description": "Required. The content of the current conversation with the `Model`. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last `Content` in the list containing the question. Note: `GenerateAnswer` only supports queries in English.", + "description": "Citations to sources for a specific response.", "items": { - "$ref": "Content" + "$ref": "CitationSource" } - }, - "answerStyle": { - "type": "string", - "enumDescriptions": [ - "Unspecified answer style.", - "Succinct but abstract style.", - "Very brief and extractive style.", - "Verbose style including extra details. The response may be formatted as a sentence, paragraph, multiple paragraphs, or bullet points, etc." - ], - "enum": [ - "ANSWER_STYLE_UNSPECIFIED", - "ABSTRACTIVE", - "EXTRACTIVE", - "VERBOSE" - ], - "description": "Required. Style in which answers should be returned." - }, - "temperature": { - "description": "Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.", - "type": "number", - "format": "float" } }, - "id": "GenerateAnswerRequest", + "description": "A collection of source attributions for a piece of content.", + "id": "CitationMetadata", "type": "object" }, - "ImportFileRequest": { - "description": "Request for `ImportFile` to import a File API file with a `FileSearchStore`.", + "Hyperparameters": { + "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", "properties": { - "chunkingConfig": { - "description": "Optional. Config for telling the service how to chunk the file. If not provided, the service will use default parameters.", - "$ref": "ChunkingConfig" + "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" }, - "fileName": { - "description": "Required. The name of the `File` to import. Example: `files/abc-123`", - "type": "string" + "learningRateMultiplier": { + "format": "float", + "type": "number", + "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used." }, - "customMetadata": { - "description": "Custom metadata to be associated with the file.", - "items": { - "$ref": "CustomMetadata" - }, - "type": "array" - } - }, - "type": "object", - "id": "ImportFileRequest" - }, - "TranslationConfig": { - "description": "Config for translation features.", - "properties": { - "echoTargetLanguage": { - "description": "Optional. If true, the model will generate audio when the target language is spoken, essentially it will parrot the input. If false, we will not produce audio for the target language.", - "type": "boolean" + "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" }, - "targetLanguageCode": { - "description": "Required. The target language for translation. Supported values are BCP-47 language codes (e.g. \"en\", \"es\", \"fr\").", - "type": "string" + "epochCount": { + "format": "int32", + "type": "integer", + "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used." } }, "type": "object", - "id": "TranslationConfig" + "id": "Hyperparameters" }, - "EmbedTextRequest": { - "description": "Request to get a text embedding from the model.", + "GdataMedia": { + "id": "GdataMedia", + "type": "object", "properties": { - "model": { - "type": "string", - "description": "Required. The model name to use with the format model=models/{model}." + "diffDownloadResponse": { + "description": "Set if reference_type is DIFF_DOWNLOAD_RESPONSE.", + "$ref": "DiffDownloadResponse" }, - "text": { - "type": "string", - "description": "Optional. The free-form input text that the model will turn into an embedding." - } - }, - "id": "EmbedTextRequest", - "type": "object" - }, - "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "properties": { - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "items": { - "$ref": "Operation" - }, - "type": "array" + "diffVersionResponse": { + "description": "Set if reference_type is DIFF_VERSION_RESPONSE.", + "$ref": "DiffVersionResponse" }, - "unreachable": { - "type": "array", - "description": "Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.", - "items": { - "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" }, - "nextPageToken": { - "type": "string", - "description": "The standard List next-page token." - } - }, - "type": "object", - "id": "ListOperationsResponse" - }, - "Blob": { - "id": "Blob", - "type": "object", - "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.", - "properties": { - "mimeType": { - "type": "string", - "description": "The IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: text/plain, text/html, text/css, text/javascript, text/x-typescript, text/csv, text/markdown, text/x-python, text/xml, text/rtf, video/text/timestamp - Applications: application/x-javascript, application/x-typescript, application/x-python-code, application/json, application/x-ipynb+json, application/rtf, application/pdf For additional context, see [Supported file formats](https://ai.google.dev/gemini-api/docs/file-input-methods#supported-content-types). //" + "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" }, - "data": { + "blobstore2Info": { + "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.", + "$ref": "Blobstore2Info" + }, + "diffUploadRequest": { + "description": "Set if reference_type is DIFF_UPLOAD_REQUEST.", + "$ref": "DiffUploadRequest" + }, + "diffUploadResponse": { + "description": "Set if reference_type is DIFF_UPLOAD_RESPONSE.", + "$ref": "DiffUploadResponse" + }, + "timestamp": { "type": "string", - "format": "byte", - "description": "Raw bytes for media formats." - } - } - }, - "InputEmbedContentConfig": { - "description": "Configures the input to the batch request.", - "properties": { - "fileName": { - "description": "The name of the `File` containing the input requests.", + "format": "uint64", + "description": "Time at which the media data was last updated, in milliseconds since UNIX epoch" + }, + "filename": { + "description": "Original file name", "type": "string" }, - "requests": { - "description": "The requests to be processed in the batch.", - "$ref": "InlinedEmbedContentRequests" - } - }, - "type": "object", - "id": "InputEmbedContentConfig" - }, - "TopCandidates": { - "description": "Candidates with top log probabilities at each decoding step.", - "properties": { - "candidates": { + "downloadParameters": { + "description": "Parameters for a media download.", + "$ref": "DownloadParameters" + }, + "compositeMedia": { "type": "array", - "description": "Sorted by log probability in descending order.", "items": { - "$ref": "LogprobsResultCandidate" - } - } - }, - "type": "object", - "id": "TopCandidates" - }, - "CompositeMedia": { - "type": "object", - "id": "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": { - "crc32cHash": { - "type": "integer", - "format": "uint32", - "description": "crc32.c hash for the payload." + "$ref": "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." }, - "referenceType": { - "description": "Describes what the field reference contains.", + "sha256Hash": { + "description": "Scotty-provided SHA256 hash for an upload.", "type": "string", - "enumDescriptions": [ - "Reference contains a GFS path or a local path.", - "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", - "Data is included into this proto buffer", - "Reference points to a bigstore object", - "Indicates the data is stored in cosmo_binary_reference." - ], - "enum": [ - "PATH", - "BLOB_REF", - "INLINE", - "BIGSTORE_REF", - "COSMO_BINARY_REFERENCE" - ] + "format": "byte" }, - "blobstore2Info": { - "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.", - "$ref": "Blobstore2Info" + "contentType": { + "description": "MIME type of the data", + "type": "string" }, - "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.", - "type": "string", - "format": "byte" + "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" }, - "path": { + "bigstoreObjectRef": { "type": "string", - "description": "Path to the data, set if reference_type is PATH" + "format": "byte", + "description": "Use object_id instead.", + "deprecated": true }, - "sha1Hash": { - "description": "SHA-1 hash for the payload.", + "objectId": { + "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF.", + "$ref": "ObjectId" + }, + "diffChecksumsResponse": { + "description": "Set if reference_type is DIFF_CHECKSUMS_RESPONSE.", + "$ref": "DiffChecksumsResponse" + }, + "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.", "type": "string", "format": "byte" }, @@ -1667,2816 +1130,2700 @@ "format": "byte" }, "length": { + "description": "Size of the data, in bytes", "type": "string", - "format": "int64", - "description": "Size of the data, in bytes" + "format": "int64" }, - "md5Hash": { - "type": "string", + "mediaId": { + "description": "Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA.", "format": "byte", - "description": "MD5 hash for the payload." + "type": "string" + }, + "crc32cHash": { + "format": "uint32", + "type": "integer", + "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." + }, + "contentTypeInfo": { + "description": "Extended content type information provided for Scotty uploads.", + "$ref": "ContentTypeInfo" }, "inline": { + "description": "Media data, set if reference_type is INLINE", + "format": "byte", + "type": "string" + }, + "token": { + "description": "A unique fingerprint/version id for the media data", + "type": "string" + }, + "sha1Hash": { + "description": "Scotty-provided SHA1 hash for an upload.", + "format": "byte", + "type": "string" + }, + "sha512Hash": { "type": "string", "format": "byte", - "description": "Media data, set if reference_type is INLINE" + "description": "Scotty-provided SHA512 hash for an upload." }, - "objectId": { - "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF.", - "$ref": "ObjectId" - } - } - }, - "ResponseFormatConfig": { - "type": "object", - "id": "ResponseFormatConfig", - "description": "Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality.", - "properties": { - "audio": { - "description": "Optional. Audio output format configuration.", - "$ref": "AudioResponseFormat" + "algorithm": { + "type": "string", + "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." }, - "image": { - "description": "Optional. Image output format configuration.", - "$ref": "ImageResponseFormat" + "md5Hash": { + "description": "Scotty-provided MD5 hash for an upload.", + "format": "byte", + "type": "string" }, - "text": { - "description": "Optional. Text output format configuration.", - "$ref": "TextResponseFormat" - } - } - }, - "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": { - "description": "Safety rating evaluated from content.", - "$ref": "SafetyRating" + "path": { + "description": "Path to the data, set if reference_type is PATH", + "type": "string" }, - "setting": { - "description": "Safety settings applied to the request.", - "$ref": "SafetySetting" + "referenceType": { + "type": "string", + "enumDescriptions": [ + "Reference contains a GFS path or a local path.", + "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", + "Data is included into this proto buffer", + "Data should be accessed from the current service using the operation GetMedia.", + "The content for this media object is stored across multiple partial media objects under the composite_media field.", + "Reference points to a bigstore object", + "Indicates the data is stored in diff_version_response.", + "Indicates the data is stored in diff_checksums_response.", + "Indicates the data is stored in diff_download_response.", + "Indicates the data is stored in diff_upload_request.", + "Indicates the data is stored in diff_upload_response.", + "Indicates the data is stored in cosmo_binary_reference.", + "Informs Scotty to generate a response payload with the size specified in the length field. The contents of the payload are generated by Scotty and are undefined. This is useful for testing download speeds between the user and Scotty without involving a real payload source. Note: range is not supported when using arbitrary_bytes." + ], + "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" + ], + "description": "Describes what the field reference contains." } }, - "type": "object", - "id": "SafetyFeedback" + "description": "A reference to data stored on the filesystem, on GFS or in blobstore." }, - "Corpus": { - "type": "object", - "id": "Corpus", - "description": "A `Corpus` is a collection of `Document`s. A project can create up to 10 corpora.", + "ToolResponse": { "properties": { - "name": { - "description": "Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`", - "readOnly": true, + "response": { + "type": "object", + "description": "Optional. The tool response.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "id": { + "description": "Optional. The identifier of the tool call this response is for.", "type": "string" }, - "createTime": { - "type": "string", - "format": "google-datetime", - "description": "Output only. The Timestamp of when the `Corpus` was created.", - "readOnly": true - }, - "updateTime": { - "readOnly": true, - "description": "Output only. The Timestamp of when the `Corpus` was last updated.", - "type": "string", - "format": "google-datetime" - }, - "displayName": { - "type": "string", - "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\"" + "toolType": { + "enumDescriptions": [ + "Unspecified tool type.", + "Google search tool, maps to Tool.google_search.search_types.web_search.", + "Image search tool, maps to Tool.google_search.search_types.image_search.", + "URL context tool, maps to Tool.url_context.", + "Google maps tool, maps to Tool.google_maps.", + "File search tool, maps to Tool.file_search." + ], + "enum": [ + "TOOL_TYPE_UNSPECIFIED", + "GOOGLE_SEARCH_WEB", + "GOOGLE_SEARCH_IMAGE", + "URL_CONTEXT", + "GOOGLE_MAPS", + "FILE_SEARCH" + ], + "description": "Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.", + "type": "string" } - } + }, + "description": "The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.", + "id": "ToolResponse", + "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.", + "HistoryConfig": { + "id": "HistoryConfig", + "type": "object", "properties": { - "objectSizeBytes": { - "description": "The total size of the server object.", - "type": "string", - "format": "int64" - }, - "objectVersion": { - "type": "string", - "description": "The version of the object stored at the server." + "initialHistoryInClientContent": { + "description": "Optional. If true, after sending `setup_complete`, the server will wait and at first process `client_content` messages until `turn_complete` is `true`. This initial history will not trigger a model call and may end with role `MODEL`. After `turn_complete` is `true`, the client can start the realtime conversation via `realtime_input`.", + "type": "boolean" } }, - "type": "object", - "id": "DiffVersionResponse" + "description": "History configuration. This message is included in the session configuration as `BidiGenerateContentSetup.history_config`. Configures the exchange of history messages." }, - "TuningExample": { - "description": "A single example for tuning.", + "ContentEmbedding": { "properties": { - "textInput": { - "type": "string", - "description": "Optional. Text model input." + "values": { + "type": "array", + "description": "The embedding values. This is for 3P users only and will not be populated for 1P calls.", + "items": { + "format": "float", + "type": "number" + } }, - "output": { - "description": "Required. The expected model output.", - "type": "string" + "shape": { + "type": "array", + "items": { + "format": "int32", + "type": "integer" + }, + "description": "This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048])." + } + }, + "description": "A list of floats representing an embedding.", + "id": "ContentEmbedding", + "type": "object" + }, + "MultiSpeakerVoiceConfig": { + "description": "The configuration for the multi-speaker setup.", + "properties": { + "speakerVoiceConfigs": { + "description": "Required. All the enabled speaker voices.", + "items": { + "$ref": "SpeakerVoiceConfig" + }, + "type": "array" } }, "type": "object", - "id": "TuningExample" + "id": "MultiSpeakerVoiceConfig" }, - "GenerationConfig": { - "id": "GenerationConfig", + "GenerateTextRequest": { + "id": "GenerateTextRequest", "type": "object", - "description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.", "properties": { - "responseJsonSchema": { - "description": "Optional. An internal detail. Use `responseJsonSchema` rather than this field.", - "type": "any" - }, - "temperature": { - "type": "number", - "format": "float", - "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]." - }, - "responseModalities": { + "safetySettings": { "type": "array", - "description": "Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text.", "items": { - "type": "string", - "enumDescriptions": [ - "Default value.", - "Indicates the model should return text.", - "Indicates the model should return images.", - "Indicates the model should return audio." - ], - "enum": [ - "MODALITY_UNSPECIFIED", - "TEXT", - "IMAGE", - "AUDIO" - ] - } - }, - "thinkingConfig": { - "description": "Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.", - "$ref": "ThinkingConfig" - }, - "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.", - "type": "integer", - "format": "int32" + "$ref": "SafetySetting" + }, + "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service." }, "topP": { - "type": "number", "format": "float", - "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." + "type": "number", + "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function." }, "topK": { + "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function.", "type": "integer", - "format": "int32", - "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." - }, - "responseFormat": { - "description": "Optional. Configuration for the response output format. Allows specifying output configuration per modality (text, audio, image) in a flat structure.", - "$ref": "ResponseFormatConfig" + "format": "int32" }, - "responseSchema": { - "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.", - "$ref": "Schema" + "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.", + "type": "integer", + "format": "int32" }, "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.", + "type": "array", "items": { "type": "string" }, - "type": "array" + "description": "The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response." }, - "logprobs": { - "description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20].", - "type": "integer", - "format": "int32" + "temperature": { + "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned the `getModel` function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model.", + "type": "number", + "format": "float" }, - "imageConfig": { - "description": "Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.", - "$ref": "ImageConfig" + "prompt": { + "description": "Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text.", + "$ref": "TextPrompt" }, - "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.", + "candidateCount": { + "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.", + "type": "integer", + "format": "int32" + } + }, + "description": "Request to generate a text completion response from the model." + }, + "ToolCall": { + "description": "A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.", + "properties": { + "id": { + "description": "Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.", "type": "string" }, - "responseLogprobs": { - "type": "boolean", - "description": "Optional. If true, export the logprobs results in response." - }, - "mediaResolution": { - "description": "Optional. If specified, the media resolution specified will be used.", + "toolType": { "type": "string", + "description": "Required. The type of tool that was called.", "enumDescriptions": [ - "Media resolution has not been set.", - "Media resolution set to low (64 tokens).", - "Media resolution set to medium (256 tokens).", - "Media resolution set to high (zoomed reframing with 256 tokens)." + "Unspecified tool type.", + "Google search tool, maps to Tool.google_search.search_types.web_search.", + "Image search tool, maps to Tool.google_search.search_types.image_search.", + "URL context tool, maps to Tool.url_context.", + "Google maps tool, maps to Tool.google_maps.", + "File search tool, maps to Tool.file_search." ], "enum": [ - "MEDIA_RESOLUTION_UNSPECIFIED", - "MEDIA_RESOLUTION_LOW", - "MEDIA_RESOLUTION_MEDIUM", - "MEDIA_RESOLUTION_HIGH" + "TOOL_TYPE_UNSPECIFIED", + "GOOGLE_SEARCH_WEB", + "GOOGLE_SEARCH_IMAGE", + "URL_CONTEXT", + "GOOGLE_MAPS", + "FILE_SEARCH" ] }, - "enableEnhancedCivicAnswers": { - "type": "boolean", - "description": "Optional. Enables enhanced civic answers. It may not be available for all models." - }, - "speechConfig": { - "description": "Optional. The speech generation config.", - "$ref": "SpeechConfig" - }, - "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.", - "type": "number", - "format": "float" - }, - "seed": { - "description": "Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.", - "type": "integer", - "format": "int32" - }, - "candidateCount": { - "type": "integer", - "format": "int32", - "description": "Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)" - }, - "_responseJsonSchema": { - "type": "any", - "description": "Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set." - }, - "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 difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit.", - "type": "number", - "format": "float" - }, - "translationConfig": { - "description": "Optional. Config for translation.", - "$ref": "TranslationConfig" + "args": { + "description": "Optional. The tool call arguments. Example: {\"arg1\" : \"value1\", \"arg2\" : \"value2\" , ...}", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + }, + "type": "object" } - } + }, + "type": "object", + "id": "ToolCall" }, - "PredictLongRunningRequest": { - "id": "PredictLongRunningRequest", + "InlinedEmbedContentResponses": { "type": "object", - "description": "Request message for [PredictionService.PredictLongRunning].", + "id": "InlinedEmbedContentResponses", + "description": "The responses to the requests in the batch.", "properties": { - "instances": { - "type": "array", - "description": "Required. The instances that are the input to the prediction call.", + "inlinedResponses": { "items": { - "type": "any" - } - }, - "parameters": { - "description": "Optional. The parameters that govern the prediction call.", - "type": "any" + "$ref": "InlinedEmbedContentResponse" + }, + "description": "Output only. The responses to the requests in the batch.", + "readOnly": true, + "type": "array" } } }, - "CreateFileResponse": { + "SemanticRetrieverChunk": { + "id": "SemanticRetrieverChunk", "type": "object", - "id": "CreateFileResponse", - "description": "Response for `CreateFile`.", "properties": { - "file": { - "description": "Metadata for the created file.", - "$ref": "File" + "chunk": { + "readOnly": true, + "type": "string", + "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`" + }, + "source": { + "readOnly": true, + "type": "string", + "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`" } - } + }, + "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`." }, - "BatchEmbedTextRequest": { - "type": "object", - "id": "BatchEmbedTextRequest", - "description": "Batch request to get a text embedding from the model.", + "UrlContextMetadata": { "properties": { - "texts": { + "urlMetadata": { "type": "array", - "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.", + "description": "List of url context.", "items": { - "type": "string" + "$ref": "UrlMetadata" } - }, - "requests": { - "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.", - "items": { - "$ref": "EmbedTextRequest" - }, - "type": "array" - } - } - }, - "McpServer": { - "type": "object", - "id": "McpServer", - "description": "A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6", - "properties": { - "streamableHttpTransport": { - "description": "A transport that can stream HTTP requests and responses.", - "$ref": "StreamableHttpTransport" - }, - "name": { - "description": "The name of the MCPServer.", - "type": "string" } - } + }, + "description": "Metadata related to url context retrieval tool.", + "id": "UrlContextMetadata", + "type": "object" }, - "BatchEmbedTextResponse": { - "description": "The response to a EmbedTextRequest.", + "LanguageHints": { + "description": "Provides hints to the model about possible languages present in the audio.", "properties": { - "embeddings": { - "readOnly": true, - "description": "Output only. The embeddings generated from the input text.", + "languageCodes": { + "type": "array", + "description": "Required. BCP-47 language codes.", "items": { - "$ref": "Embedding" - }, - "type": "array" + "type": "string" + } } }, "type": "object", - "id": "BatchEmbedTextResponse" + "id": "LanguageHints" }, - "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.", + "LogprobsResult": { + "id": "LogprobsResult", + "type": "object", "properties": { - "parts": { - "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.", + "topCandidates": { + "description": "Length = total number of decoding steps.", "items": { - "$ref": "Part" + "$ref": "TopCandidates" }, "type": "array" }, - "role": { - "type": "string", - "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." - } - }, - "id": "Content", - "type": "object" - }, - "GenerateContentBatchOutput": { - "description": "The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.", - "properties": { - "responsesFile": { - "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", - "readOnly": true, - "type": "string" + "logProbabilitySum": { + "description": "Sum of log probabilities for all tokens.", + "type": "number", + "format": "float" }, - "inlinedResponses": { - "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", - "$ref": "InlinedResponses", - "readOnly": true + "chosenCandidates": { + "items": { + "$ref": "LogprobsResultCandidate" + }, + "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.", + "type": "array" } }, - "id": "GenerateContentBatchOutput", - "type": "object" + "description": "Logprobs Result" }, - "Hyperparameters": { - "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", + "Model": { + "description": "Information about a Generative Language Model.", "properties": { - "learningRateMultiplier": { - "type": "number", - "format": "float", - "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used." + "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" }, - "epochCount": { + "inputTokenLimit": { + "description": "Maximum number of input tokens allowed for this model.", "type": "integer", - "format": "int32", - "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used." + "format": "int32" }, - "batchSize": { - "type": "integer", - "format": "int32", - "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples." + "thinking": { + "description": "Whether the model supports thinking.", + "type": "boolean" }, - "learningRate": { - "type": "number", + "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", - "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." - } - }, - "type": "object", - "id": "Hyperparameters" - }, - "GenerateTextRequest": { - "description": "Request to generate a text completion response from the model.", - "properties": { - "safetySettings": { + "type": "number" + }, + "supportedGenerationMethods": { "type": "array", - "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service.", "items": { - "$ref": "SafetySetting" - } - }, - "candidateCount": { - "type": "integer", - "format": "int32", - "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1." + "type": "string" + }, + "description": "The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`." }, - "maxOutputTokens": { - "type": "integer", - "format": "int32", - "description": "Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the `Model` specification." + "description": { + "description": "A short description of the model.", + "type": "string" }, - "topP": { - "type": "number", + "temperature": { "format": "float", - "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." + "type": "number", + "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." + }, + "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" }, "topK": { "type": "integer", "format": "int32", - "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function." + "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." }, - "prompt": { - "description": "Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text.", - "$ref": "TextPrompt" + "baseModelId": { + "description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`", + "type": "string" }, - "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.", + "outputTokenLimit": { + "format": "int32", + "type": "integer", + "description": "Maximum number of output tokens available for this model." + }, + "version": { + "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)", + "type": "string" + }, + "maxTemperature": { + "description": "The maximum temperature this model can use.", "type": "number", "format": "float" - }, - "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" } }, "type": "object", - "id": "GenerateTextRequest" + "id": "Model" }, - "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.", + "ExecutableCode": { "properties": { - "response": { - "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.", - "$ref": "Schema" - }, - "parametersJsonSchema": { - "description": "Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" }, \"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\", \"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive with `parameters`.", - "type": "any" - }, - "responseJsonSchema": { - "type": "any", - "description": "Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`." - }, - "behavior": { + "language": { "type": "string", + "description": "Required. Programming language of the `code`.", "enumDescriptions": [ - "This value is unused.", - "If set, the system will wait to receive the function response before continuing the conversation.", - "If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model." + "Unspecified language. This value should not be used.", + "Python \u003e= 3.10, with numpy and simpy available. Python is the default language." ], "enum": [ - "UNSPECIFIED", - "BLOCKING", - "NON_BLOCKING" - ], - "description": "Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method." + "LANGUAGE_UNSPECIFIED", + "PYTHON" + ] }, - "name": { - "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128.", + "code": { + "description": "Required. The code to be executed.", "type": "string" }, - "description": { - "type": "string", - "description": "Required. A brief description of the function." - }, - "parameters": { - "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.", - "$ref": "Schema" + "id": { + "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.", + "type": "string" } }, - "id": "FunctionDeclaration", + "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.", + "id": "ExecutableCode", "type": "object" }, - "ImageConfig": { - "type": "object", - "id": "ImageConfig", - "description": "Config for image generation features.", - "properties": { - "aspectRatio": { - "description": "Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, or `21:9`. If not specified, the model will choose a default aspect ratio based on any reference images provided.", - "type": "string" - }, - "imageSize": { - "description": "Optional. Specifies the size of generated images. Supported values are `512`, `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`.", - "type": "string" - } - } - }, - "Message": { - "type": "object", - "id": "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.", + "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": { - "content": { - "description": "Required. The text content of the structured `Message`.", - "type": "string" - }, - "author": { - "type": "string", - "description": "Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string." - }, - "citationMetadata": { - "readOnly": true, - "description": "Output only. Citation information for model-generated `content` in this `Message`. If this `Message` was generated as output from the model, this field may be populated with attribution information for any text included in the `content`. This field is used only on output.", - "$ref": "CitationMetadata" - } - } - }, - "DownloadFileResponse": { - "type": "object", - "id": "DownloadFileResponse", - "description": "Response for `DownloadFile`.", - "properties": {} - }, - "GoogleSearchRetrieval": { - "description": "Tool to retrieve public web data for grounding, powered by Google.", - "properties": { - "dynamicRetrievalConfig": { - "description": "Specifies the dynamic retrieval configuration for the given source.", - "$ref": "DynamicRetrievalConfig" - } - }, - "type": "object", - "id": "GoogleSearchRetrieval" - }, - "Document": { - "description": "A `Document` is a collection of `Chunk`s.", - "properties": { - "createTime": { - "readOnly": true, - "description": "Output only. The Timestamp of when the `Document` was created.", - "type": "string", - "format": "google-datetime" - }, - "mimeType": { - "type": "string", - "readOnly": true, - "description": "Output only. The mime type of the Document." - }, - "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" - }, - "updateTime": { - "description": "Output only. The Timestamp of when the `Document` was last updated.", - "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "name": { - "type": "string", - "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"fileSearchStores/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`" - }, - "sizeBytes": { - "readOnly": true, - "description": "Output only. The size of raw bytes ingested into the Document.", + "category": { + "description": "Required. The category for this setting.", + "enumDescriptions": [ + "Category is unspecified.", + "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", + "**PaLM** - Content that is rude, disrespectful, or profane.", + "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", + "**PaLM** - Contains references to sexual acts or other lewd content.", + "**PaLM** - Promotes unchecked medical advice.", + "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", + "**Gemini** - Harassment content.", + "**Gemini** - Hate speech and content.", + "**Gemini** - Sexually explicit content.", + "**Gemini** - Dangerous content.", + "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." + ], + "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", - "format": "int64" - }, - "customMetadata": { - "type": "array", - "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.", - "items": { - "$ref": "CustomMetadata" - } + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true + ] }, - "state": { - "description": "Output only. Current state of the `Document`.", + "threshold": { "type": "string", + "enumDescriptions": [ + "Threshold is unspecified.", + "Content with NEGLIGIBLE will be allowed.", + "Content with NEGLIGIBLE and LOW will be allowed.", + "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.", + "All content will be allowed.", + "Turn off the safety filter." + ], "enum": [ - "STATE_UNSPECIFIED", - "STATE_PENDING", - "STATE_ACTIVE", - "STATE_FAILED" + "HARM_BLOCK_THRESHOLD_UNSPECIFIED", + "BLOCK_LOW_AND_ABOVE", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_ONLY_HIGH", + "BLOCK_NONE", + "OFF" ], - "readOnly": true, - "enumDescriptions": [ - "The default value. This value is used if the state is omitted.", - "Some `Chunks` of the `Document` are being processed (embedding and vector storage).", - "All `Chunks` of the `Document` is processed and available for querying.", - "Some `Chunks` of the `Document` failed processing." - ] + "description": "Required. Controls the probability threshold at which harm is blocked." } }, "type": "object", - "id": "Document" + "id": "SafetySetting" }, - "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.", + "SpeechConfig": { + "id": "SpeechConfig", + "type": "object", "properties": { - "fromFileName": { - "description": "The content type of the file derived from the file extension of the original file name used by the client.", - "type": "string" - }, - "bestGuess": { - "type": "string", - "description": "Scotty's best guess of what the content type of the file is." - }, - "fromHeader": { - "type": "string", - "description": "The content type of the file as specified in the request headers, multipart headers, or RUPIO start request." + "voiceConfig": { + "description": "The configuration in case of single-voice output.", + "$ref": "VoiceConfig" }, - "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" + "multiSpeakerVoiceConfig": { + "description": "Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.", + "$ref": "MultiSpeakerVoiceConfig" }, - "fromBytes": { - "description": "The content type of the file derived by looking at specific bytes (i.e. \"magic bytes\") of the actual file.", + "languageCode": { + "description": "Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`.", "type": "string" - }, - "fromFusionId": { - "description": "The content type of the file detected by Fusion ID. go/fusionid", + } + }, + "description": "Config for speech generation and transcription." + }, + "SessionResumptionConfig": { + "properties": { + "handle": { + "description": "The handle of a previous session. If not present then a new session is created. Session handles come from `SessionResumptionUpdate.token` values in previous connections.", "type": "string" - }, - "fusionIdDetectionMetadata": { - "type": "string", - "format": "byte", - "description": "Metadata information from Fusion ID detection. Serialized FusionIdDetectionMetadata proto. Only set if from_fusion_id is set." } }, - "id": "ContentTypeInfo", + "description": "Session resumption configuration. This message is included in the session configuration as `BidiGenerateContentSetup.session_resumption`. If configured, the server will send `SessionResumptionUpdate` messages.", + "id": "SessionResumptionConfig", "type": "object" }, - "PlaceAnswerSources": { - "id": "PlaceAnswerSources", + "InputConfig": { "type": "object", - "description": "Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: \"does Bar Foo have Wifi\" or \"is Foo Bar wheelchair accessible?\"). Currently we only support review snippets as sources.", + "id": "InputConfig", + "description": "Configures the input to the batch request.", "properties": { - "reviewSnippets": { - "description": "Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.", - "items": { - "$ref": "ReviewSnippet" - }, - "type": "array" + "fileName": { + "description": "The name of the `File` containing the input requests.", + "type": "string" + }, + "requests": { + "description": "The requests to be processed in the batch.", + "$ref": "InlinedRequests" } } }, - "Dataset": { - "description": "Dataset for training or validation.", + "UploadToFileSearchStoreRequest": { + "type": "object", + "id": "UploadToFileSearchStoreRequest", + "description": "Request for `UploadToFileSearchStore`.", "properties": { - "examples": { - "description": "Optional. Inline examples with simple input/output text.", - "$ref": "TuningExamples" + "mimeType": { + "description": "Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content.", + "type": "string" + }, + "displayName": { + "description": "Optional. Display name of the created document.", + "type": "string" + }, + "customMetadata": { + "items": { + "$ref": "CustomMetadata" + }, + "description": "Custom metadata to be associated with the data.", + "type": "array" + }, + "chunkingConfig": { + "description": "Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters.", + "$ref": "ChunkingConfig" } - }, - "id": "Dataset", - "type": "object" + } }, - "SemanticRetrieverChunk": { - "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", + "CountMessageTokensResponse": { + "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.", "properties": { - "source": { - "type": "string", - "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`", - "readOnly": true - }, - "chunk": { - "type": "string", - "readOnly": true, - "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`" + "tokenCount": { + "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", + "type": "integer", + "format": "int32" } }, "type": "object", - "id": "SemanticRetrieverChunk" + "id": "CountMessageTokensResponse" }, - "DownloadParameters": { - "description": "Parameters specific to media downloads.", + "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": { - "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" + "prompt": { + "description": "Required. The prompt, whose token count is to be returned.", + "$ref": "MessagePrompt" } }, "type": "object", - "id": "DownloadParameters" + "id": "CountMessageTokensRequest" }, - "ToolConfig": { - "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", + "BatchEmbedTextResponse": { "properties": { - "functionCallingConfig": { - "description": "Optional. Function calling config.", - "$ref": "FunctionCallingConfig" - }, - "retrievalConfig": { - "description": "Optional. Retrieval config.", - "$ref": "RetrievalConfig" - }, - "includeServerSideToolInvocations": { - "description": "Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions.", - "type": "boolean" + "embeddings": { + "items": { + "$ref": "Embedding" + }, + "description": "Output only. The embeddings generated from the input text.", + "readOnly": true, + "type": "array" } }, - "id": "ToolConfig", + "description": "The response to a EmbedTextRequest.", + "id": "BatchEmbedTextResponse", "type": "object" }, - "CitationSource": { - "description": "A citation to a source for a portion of a specific response.", + "GoogleAiGenerativelanguageV1betaSegment": { + "description": "Segment of the content.", "properties": { - "endIndex": { + "partIndex": { "type": "integer", "format": "int32", - "description": "Optional. End of the attributed segment, exclusive." + "description": "The index of a Part object within its parent Content object." }, - "license": { - "type": "string", - "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations." + "text": { + "description": "The text corresponding to the segment from the response.", + "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.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero." }, - "uri": { - "type": "string", - "description": "Optional. URI that is attributed as a source for a portion of the text." + "endIndex": { + "description": "End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.", + "format": "int32", + "type": "integer" } }, "type": "object", - "id": "CitationSource" + "id": "GoogleAiGenerativelanguageV1betaSegment" }, - "GroundingPassageId": { - "description": "Identifier for a part within a `GroundingPassage`.", + "File": { + "description": "A file uploaded to the API. Next ID: 15", "properties": { - "passageId": { - "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.", + "mimeType": { + "description": "Output only. MIME type of the file.", "readOnly": true, "type": "string" }, - "partIndex": { - "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", + "createTime": { "readOnly": true, - "type": "integer", - "format": "int32" + "type": "string", + "format": "google-datetime", + "description": "Output only. The timestamp of when the `File` was created." + }, + "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" + }, + "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" + }, + "error": { + "description": "Output only. Error status if File processing failed.", + "readOnly": true, + "$ref": "Status" + }, + "videoMetadata": { + "readOnly": true, + "$ref": "VideoFileMetadata", + "description": "Output only. Metadata for a video." + }, + "state": { + "type": "string", + "readOnly": true, + "enumDescriptions": [ + "The default value. This value is used if the state is omitted.", + "File is being processed and cannot be used for inference yet.", + "File is processed and available for inference.", + "File failed processing." + ], + "enum": [ + "STATE_UNSPECIFIED", + "PROCESSING", + "ACTIVE", + "FAILED" + ], + "description": "Output only. Processing state of the File." + }, + "uri": { + "readOnly": true, + "type": "string", + "description": "Output only. The uri of the `File`." + }, + "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" + }, + "expirationTime": { + "readOnly": true, + "type": "string", + "format": "google-datetime", + "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire." + }, + "updateTime": { + "readOnly": true, + "type": "string", + "format": "google-datetime", + "description": "Output only. The timestamp of when the `File` was last updated." + }, + "source": { + "type": "string", + "enumDescriptions": [ + "Used if source is not specified.", + "Indicates the file is uploaded by the user.", + "Indicates the file is generated by Google.", + "Indicates the file is a registered, i.e. a Google Cloud Storage file." + ], + "enum": [ + "SOURCE_UNSPECIFIED", + "UPLOADED", + "GENERATED", + "REGISTERED" + ], + "description": "Source of the File." + }, + "downloadUri": { + "description": "Output only. The download uri of the `File`.", + "readOnly": true, + "type": "string" } }, - "id": "GroundingPassageId", - "type": "object" + "type": "object", + "id": "File" }, - "ChunkingConfig": { - "id": "ChunkingConfig", + "ImageSearch": { + "description": "Image search for grounding and related configurations.", + "properties": {}, "type": "object", - "description": "Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto", - "properties": { - "whiteSpaceConfig": { - "description": "White space chunking configuration.", - "$ref": "WhiteSpaceConfig" - } - } + "id": "ImageSearch" }, - "RetrievalConfig": { - "description": "Retrieval config.", + "ListTunedModelsResponse": { + "id": "ListTunedModelsResponse", + "type": "object", "properties": { - "latLng": { - "description": "Optional. The location of the user.", - "$ref": "LatLng" + "tunedModels": { + "description": "The returned Models.", + "items": { + "$ref": "TunedModel" + }, + "type": "array" }, - "languageCode": { - "description": "Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).", + "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", - "id": "RetrievalConfig" + "description": "Response from `ListTunedModels` containing a paginated list of Models." }, - "Status": { + "WebSearch": { + "properties": {}, + "description": "Standard web search for grounding and related configurations.", + "id": "WebSearch", + "type": "object" + }, + "UsageMetadata": { "type": "object", - "id": "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).", + "id": "UsageMetadata", + "description": "Metadata on the generation request's token usage.", "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", + "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.", "type": "integer", "format": "int32" }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client." - }, - "details": { - "type": "array", - "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "toolUsePromptTokensDetails": { + "description": "Output only. List of modalities that were processed for tool-use request inputs.", "items": { - "type": "object", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - } - } - } - } - }, - "GroundingChunkCustomMetadata": { - "id": "GroundingChunkCustomMetadata", - "type": "object", - "description": "User provided metadata about the GroundingFact.", - "properties": { - "stringValue": { - "description": "Optional. The string value of the metadata.", - "type": "string" + "$ref": "ModalityTokenCount" + }, + "readOnly": true, + "type": "array" }, - "numericValue": { - "type": "number", - "format": "float", - "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used." + "toolUsePromptTokenCount": { + "readOnly": true, + "type": "integer", + "format": "int32", + "description": "Output only. Number of tokens present in tool-use prompt(s)." }, - "key": { + "totalTokenCount": { + "description": "Total token count for the generation request (prompt + thoughts + response candidates).", + "type": "integer", + "format": "int32" + }, + "serviceTier": { "type": "string", - "description": "The key of the metadata." + "readOnly": true, + "enumDescriptions": [ + "Default service tier, which is standard.", + "Standard service tier.", + "Flex service tier.", + "Priority service tier." + ], + "enum": [ + "unspecified", + "standard", + "flex", + "priority" + ], + "description": "Output only. Service tier of the request." }, - "stringListValue": { - "description": "Optional. A list of string values for the metadata.", - "$ref": "GroundingChunkStringList" - } - } - }, - "GdataMedia": { - "id": "GdataMedia", - "type": "object", - "description": "A reference to data stored on the filesystem, on GFS or in blobstore.", - "properties": { - "token": { - "description": "A unique fingerprint/version id for the media data", - "type": "string" + "candidatesTokenCount": { + "description": "Total number of tokens across all the generated response candidates.", + "type": "integer", + "format": "int32" }, - "diffUploadRequest": { - "description": "Set if reference_type is DIFF_UPLOAD_REQUEST.", - "$ref": "DiffUploadRequest" + "thoughtsTokenCount": { + "format": "int32", + "readOnly": true, + "type": "integer", + "description": "Output only. Number of tokens of thoughts for thinking models." }, - "diffVersionResponse": { - "description": "Set if reference_type is DIFF_VERSION_RESPONSE.", - "$ref": "DiffVersionResponse" + "cachedContentTokenCount": { + "description": "Number of tokens in the cached part of the prompt (the cached content)", + "format": "int32", + "type": "integer" }, - "diffUploadResponse": { - "description": "Set if reference_type is DIFF_UPLOAD_RESPONSE.", - "$ref": "DiffUploadResponse" + "promptTokensDetails": { + "description": "Output only. List of modalities that were processed in the request input.", + "items": { + "$ref": "ModalityTokenCount" + }, + "readOnly": true, + "type": "array" }, - "inline": { - "type": "string", - "format": "byte", - "description": "Media data, set if reference_type is INLINE" - }, - "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" - }, - "blobstore2Info": { - "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.", - "$ref": "Blobstore2Info" - }, - "contentType": { - "description": "MIME type of the data", - "type": "string" - }, - "sha256Hash": { - "type": "string", - "format": "byte", - "description": "Scotty-provided SHA256 hash for an upload." - }, - "hash": { - "type": "string", - "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.", - "deprecated": true - }, - "objectId": { - "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF.", - "$ref": "ObjectId" - }, - "contentTypeInfo": { - "description": "Extended content type information provided for Scotty uploads.", - "$ref": "ContentTypeInfo" - }, - "crc32cHash": { - "type": "integer", - "format": "uint32", - "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." - }, - "hashVerified": { - "type": "boolean", - "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." - }, - "algorithm": { - "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.", - "deprecated": true, - "type": "string" + "cacheTokensDetails": { + "description": "Output only. List of modalities of the cached content in the request input.", + "items": { + "$ref": "ModalityTokenCount" + }, + "readOnly": true, + "type": "array" }, - "sha512Hash": { - "type": "string", - "format": "byte", - "description": "Scotty-provided SHA512 hash for an upload." + "candidatesTokensDetails": { + "description": "Output only. List of modalities that were returned in the response.", + "items": { + "$ref": "ModalityTokenCount" + }, + "readOnly": true, + "type": "array" + } + } + }, + "SafetyFeedback": { + "id": "SafetyFeedback", + "type": "object", + "properties": { + "rating": { + "description": "Safety rating evaluated from content.", + "$ref": "SafetyRating" }, - "filename": { - "description": "Original file name", + "setting": { + "description": "Safety settings applied to the request.", + "$ref": "SafetySetting" + } + }, + "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." + }, + "BatchStats": { + "id": "BatchStats", + "type": "object", + "properties": { + "successfulRequestCount": { + "description": "Output only. The number of requests that were successfully processed.", + "format": "int64", + "readOnly": true, "type": "string" }, - "bigstoreObjectRef": { - "type": "string", - "format": "byte", - "description": "Use object_id instead.", - "deprecated": true - }, - "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.", - "type": "string", - "format": "byte" - }, - "mediaId": { - "type": "string", - "format": "byte", - "description": "Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA." - }, - "diffChecksumsResponse": { - "description": "Set if reference_type is DIFF_CHECKSUMS_RESPONSE.", - "$ref": "DiffChecksumsResponse" - }, - "path": { - "type": "string", - "description": "Path to the data, set if reference_type is PATH" - }, - "sha1Hash": { - "type": "string", - "format": "byte", - "description": "Scotty-provided SHA1 hash for an upload." - }, - "blobRef": { - "type": "string", - "format": "byte", - "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.", - "deprecated": true - }, - "compositeMedia": { - "type": "array", - "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": "CompositeMedia" - } - }, - "timestamp": { + "pendingRequestCount": { + "description": "Output only. The number of requests that are still pending processing.", + "readOnly": true, "type": "string", - "format": "uint64", - "description": "Time at which the media data was last updated, in milliseconds since UNIX epoch" - }, - "downloadParameters": { - "description": "Parameters for a media download.", - "$ref": "DownloadParameters" + "format": "int64" }, - "length": { + "requestCount": { + "readOnly": true, "type": "string", "format": "int64", - "description": "Size of the data, in bytes" + "description": "Output only. The number of requests in the batch." }, - "md5Hash": { - "description": "Scotty-provided MD5 hash for an upload.", + "failedRequestCount": { + "description": "Output only. The number of requests that failed to be processed.", + "readOnly": true, "type": "string", - "format": "byte" - }, - "diffDownloadResponse": { - "description": "Set if reference_type is DIFF_DOWNLOAD_RESPONSE.", - "$ref": "DiffDownloadResponse" + "format": "int64" + } + }, + "description": "Stats about the batch." + }, + "TopCandidates": { + "description": "Candidates with top log probabilities at each decoding step.", + "properties": { + "candidates": { + "items": { + "$ref": "LogprobsResultCandidate" + }, + "description": "Sorted by log probability in descending order.", + "type": "array" + } + }, + "type": "object", + "id": "TopCandidates" + }, + "ThinkingConfig": { + "type": "object", + "id": "ThinkingConfig", + "description": "Config for thinking features.", + "properties": { + "includeThoughts": { + "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.", + "type": "boolean" }, - "referenceType": { - "type": "string", + "thinkingLevel": { + "description": "Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error.", "enumDescriptions": [ - "Reference contains a GFS path or a local path.", - "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", - "Data is included into this proto buffer", - "Data should be accessed from the current service using the operation GetMedia.", - "The content for this media object is stored across multiple partial media objects under the composite_media field.", - "Reference points to a bigstore object", - "Indicates the data is stored in diff_version_response.", - "Indicates the data is stored in diff_checksums_response.", - "Indicates the data is stored in diff_download_response.", - "Indicates the data is stored in diff_upload_request.", - "Indicates the data is stored in diff_upload_response.", - "Indicates the data is stored in cosmo_binary_reference.", - "Informs Scotty to generate a response payload with the size specified in the length field. The contents of the payload are generated by Scotty and are undefined. This is useful for testing download speeds between the user and Scotty without involving a real payload source. Note: range is not supported when using arbitrary_bytes." + "Default value.", + "Little to no thinking.", + "Low thinking level.", + "Medium thinking level.", + "High thinking level." ], "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" + "THINKING_LEVEL_UNSPECIFIED", + "MINIMAL", + "LOW", + "MEDIUM", + "HIGH" ], - "description": "Describes what the field reference contains." - } - } - }, - "ListFilesResponse": { - "type": "object", - "id": "ListFilesResponse", - "description": "Response for `ListFiles`.", - "properties": { - "nextPageToken": { - "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.", "type": "string" }, - "files": { - "description": "The list of `File`s.", - "items": { - "$ref": "File" - }, - "type": "array" + "thinkingBudget": { + "type": "integer", + "format": "int32", + "description": "The number of thoughts tokens that the model should generate." } } }, - "DiffUploadRequest": { - "description": "A Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", + "BatchEmbedContentsResponse": { "properties": { - "objectInfo": { - "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.", - "$ref": "CompositeMedia" - }, - "checksumsInfo": { - "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.", - "$ref": "CompositeMedia" + "usageMetadata": { + "readOnly": true, + "$ref": "EmbeddingUsageMetadata", + "description": "Output only. The usage metadata for the request." }, - "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" + "embeddings": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "ContentEmbedding" + }, + "description": "Output only. The embeddings for each request, in the same order as provided in the batch request." } }, - "id": "DiffUploadRequest", + "description": "The response to a `BatchEmbedContentsRequest`.", + "id": "BatchEmbedContentsResponse", "type": "object" }, - "Interval": { - "type": "object", - "id": "Interval", - "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "Candidate": { + "description": "A response candidate generated from the model.", "properties": { - "startTime": { - "type": "string", - "format": "google-datetime", - "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start." + "content": { + "readOnly": true, + "$ref": "Content", + "description": "Output only. Generated content returned from the model." }, - "endTime": { + "groundingMetadata": { + "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.", + "readOnly": true, + "$ref": "GroundingMetadata" + }, + "groundingAttributions": { + "readOnly": true, + "type": "array", + "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", + "items": { + "$ref": "GroundingAttribution" + } + }, + "citationMetadata": { + "readOnly": true, + "$ref": "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." + }, + "safetyRatings": { + "items": { + "$ref": "SafetyRating" + }, + "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", + "type": "array" + }, + "avgLogprobs": { + "description": "Output only. Average log probability score of the candidate.", + "readOnly": true, + "type": "number", + "format": "double" + }, + "index": { + "description": "Output only. Index of the candidate in the list of response candidates.", + "readOnly": true, + "type": "integer", + "format": "int32" + }, + "finishReason": { "type": "string", - "format": "google-datetime", - "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end." + "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.", + "enumDescriptions": [ + "Default value. This value is unused.", + "Natural stop point of the model or provided stop sequence.", + "The maximum number of tokens as specified in the request was reached.", + "The response candidate content was flagged for safety reasons.", + "The response candidate content was flagged for recitation reasons.", + "The response candidate content was flagged for using an unsupported language.", + "Unknown reason.", + "Token generation stopped because the content contains forbidden terms.", + "Token generation stopped for potentially containing prohibited content.", + "Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).", + "The function call generated by the model is invalid.", + "Token generation stopped because generated images contain safety violations.", + "Image generation stopped because generated images has other prohibited content.", + "Image generation stopped because of other miscellaneous issue.", + "The model was expected to generate an image, but none was generated.", + "Image generation stopped due to recitation.", + "Model generated a tool call but no tools were enabled in the request.", + "Model called too many tools consecutively, thus the system exited execution.", + "Request has at least one thought signature missing.", + "Finished due to malformed response.", + "Request was filtered by an escalation rule." + ], + "enum": [ + "FINISH_REASON_UNSPECIFIED", + "STOP", + "MAX_TOKENS", + "SAFETY", + "RECITATION", + "LANGUAGE", + "OTHER", + "BLOCKLIST", + "PROHIBITED_CONTENT", + "SPII", + "MALFORMED_FUNCTION_CALL", + "IMAGE_SAFETY", + "IMAGE_PROHIBITED_CONTENT", + "IMAGE_OTHER", + "NO_IMAGE", + "IMAGE_RECITATION", + "UNEXPECTED_TOOL_CALL", + "TOO_MANY_TOOL_CALLS", + "MISSING_THOUGHT_SIGNATURE", + "MALFORMED_RESPONSE", + "ESCALATION" + ], + "readOnly": true + }, + "logprobsResult": { + "readOnly": true, + "$ref": "LogprobsResult", + "description": "Output only. Log-likelihood scores for the response tokens and top tokens" + }, + "urlContextMetadata": { + "description": "Output only. Metadata related to url context retrieval tool.", + "readOnly": true, + "$ref": "UrlContextMetadata" + }, + "finishMessage": { + "description": "Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.", + "readOnly": true, + "type": "string" + }, + "tokenCount": { + "description": "Output only. Token count for this candidate.", + "format": "int32", + "readOnly": true, + "type": "integer" } - } + }, + "type": "object", + "id": "Candidate" }, - "TextResponseFormat": { - "id": "TextResponseFormat", + "Permission": { "type": "object", - "description": "Configuration for text output format.", + "id": "Permission", + "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete", "properties": { - "mimeType": { + "role": { "type": "string", + "description": "Required. The role granted by this permission.", "enumDescriptions": [ - "Default value. This value is unused.", - "JSON output format.", - "Plain text output format." + "The default value. This value is unused.", + "Owner can use, update, share and delete the resource.", + "Writer can use, update and share the resource.", + "Reader can use the resource." ], "enum": [ - "MIME_TYPE_UNSPECIFIED", - "APPLICATION_JSON", - "TEXT_PLAIN" - ], - "description": "Optional. The MIME type of the text output." + "ROLE_UNSPECIFIED", + "OWNER", + "WRITER", + "READER" + ] }, - "schema": { - "type": "any", - "description": "Optional. The JSON schema that the output should conform to. Only applicable when mime_type is APPLICATION_JSON." + "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" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only." + }, + "granteeType": { + "type": "string", + "description": "Optional. Immutable. The type of the grantee.", + "enumDescriptions": [ + "The default value. This value is unused.", + "Represents a user. When set, you must provide email_address for the user.", + "Represents a group. When set, you must provide email_address for the group.", + "Represents access to everyone. No extra information is required." + ], + "enum": [ + "GRANTEE_TYPE_UNSPECIFIED", + "USER", + "GROUP", + "EVERYONE" + ] } } }, - "GroundingChunk": { - "id": "GroundingChunk", + "ContentTypeInfo": { "type": "object", - "description": "A `GroundingChunk` represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps.", + "id": "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": { - "web": { - "description": "Grounding chunk from the web.", - "$ref": "Web" + "fromBytes": { + "description": "The content type of the file derived by looking at specific bytes (i.e. \"magic bytes\") of the actual file.", + "type": "string" }, - "image": { - "description": "Optional. Grounding chunk from image search.", - "$ref": "Image" + "fromHeader": { + "description": "The content type of the file as specified in the request headers, multipart headers, or RUPIO start request.", + "type": "string" }, - "retrievedContext": { - "description": "Optional. Grounding chunk from context retrieved by the file search tool.", - "$ref": "RetrievedContext" + "fromFileName": { + "description": "The content type of the file derived from the file extension of the original file name used by the client.", + "type": "string" }, - "maps": { - "description": "Optional. Grounding chunk from Google Maps.", - "$ref": "Maps" + "fromFusionId": { + "description": "The content type of the file detected by Fusion ID. go/fusionid", + "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" + }, + "fusionIdDetectionMetadata": { + "format": "byte", + "type": "string", + "description": "Metadata information from Fusion ID detection. Serialized FusionIdDetectionMetadata proto. Only set if from_fusion_id is set." + }, + "bestGuess": { + "description": "Scotty's best guess of what the content type of the file is.", + "type": "string" } } }, - "TransferOwnershipRequest": { - "description": "Request to transfer the ownership of the tuned model.", + "RegisterFilesRequest": { "properties": { - "emailAddress": { - "type": "string", - "description": "Required. The email address of the user to whom the tuned model is being transferred to." + "uris": { + "type": "array", + "description": "Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.", + "items": { + "type": "string" + } } }, - "id": "TransferOwnershipRequest", + "description": "Request for `RegisterFiles`.", + "id": "RegisterFilesRequest", "type": "object" }, - "Schema": { + "ListOperationsResponse": { "type": "object", - "id": "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).", + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations.", "properties": { - "minItems": { - "type": "string", - "format": "int64", - "description": "Optional. Minimum number of the elements for Type.ARRAY." - }, - "minLength": { - "type": "string", - "format": "int64", - "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING" - }, - "pattern": { - "type": "string", - "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression." - }, - "propertyOrdering": { - "description": "Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.", - "items": { - "type": "string" - }, - "type": "array" - }, - "anyOf": { - "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.", + "operations": { + "type": "array", "items": { - "$ref": "Schema" + "$ref": "Operation" }, - "type": "array" + "description": "A list of operations that matches the specified filter in the request." }, - "nullable": { - "type": "boolean", - "description": "Optional. Indicates if the value may be null." - }, - "minimum": { - "type": "number", - "format": "double", - "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER" + "nextPageToken": { + "description": "The standard List next-page token.", + "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\"]}", + "unreachable": { + "type": "array", + "description": "Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.", "items": { "type": "string" - }, - "type": "array" - }, - "maxItems": { - "type": "string", - "format": "int64", - "description": "Optional. Maximum number of the elements for Type.ARRAY." + } + } + } + }, + "TuningSnapshot": { + "type": "object", + "id": "TuningSnapshot", + "description": "Record for a single tuning step.", + "properties": { + "epoch": { + "description": "Output only. The epoch this step was part of.", + "format": "int32", + "readOnly": true, + "type": "integer" }, - "maximum": { - "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER", + "meanLoss": { + "readOnly": true, "type": "number", - "format": "double" + "format": "float", + "description": "Output only. The mean loss of the training examples for this step." }, - "example": { - "description": "Optional. Example of the object. Will only populated when the object is the root.", - "type": "any" + "step": { + "readOnly": true, + "type": "integer", + "format": "int32", + "description": "Output only. The tuning step." }, - "description": { - "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.", + "computeTime": { + "description": "Output only. The timestamp when this metric was computed.", + "format": "google-datetime", + "readOnly": true, "type": "string" + } + } + }, + "Example": { + "type": "object", + "id": "Example", + "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.", + "properties": { + "input": { + "description": "Required. An example of an input `Message` from the user.", + "$ref": "Message" }, - "title": { - "type": "string", - "description": "Optional. The title of the schema." + "output": { + "description": "Required. An example of what the model should output given the input.", + "$ref": "Message" + } + } + }, + "TuningExample": { + "description": "A single example for tuning.", + "properties": { + "textInput": { + "description": "Optional. Text model input.", + "type": "string" }, - "minProperties": { - "type": "string", - "format": "int64", - "description": "Optional. Minimum number of the properties for Type.OBJECT." + "output": { + "description": "Required. The expected model output.", + "type": "string" + } + }, + "type": "object", + "id": "TuningExample" + }, + "UrlContext": { + "description": "Tool to support URL context retrieval.", + "properties": {}, + "type": "object", + "id": "UrlContext" + }, + "FunctionDeclaration": { + "properties": { + "responseJsonSchema": { + "description": "Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.", + "type": "any" }, - "default": { - "type": "any", - "description": "Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors." + "parameters": { + "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.", + "$ref": "Schema" }, - "required": { - "type": "array", - "description": "Optional. Required properties of Type.OBJECT.", - "items": { - "type": "string" - } + "response": { + "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.", + "$ref": "Schema" }, - "type": { - "type": "string", + "behavior": { + "description": "Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.", "enumDescriptions": [ - "Not specified, should not be used.", - "String type.", - "Number type.", - "Integer type.", - "Boolean type.", - "Array type.", - "Object type.", - "Null type." + "This value is unused.", + "If set, the system will wait to receive the function response before continuing the conversation.", + "If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model." ], "enum": [ - "TYPE_UNSPECIFIED", - "STRING", - "NUMBER", - "INTEGER", - "BOOLEAN", - "ARRAY", - "OBJECT", - "NULL" + "UNSPECIFIED", + "BLOCKING", + "NON_BLOCKING" ], - "description": "Required. Data type." - }, - "format": { - "description": "Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality.", "type": "string" }, - "maxProperties": { - "type": "string", - "format": "int64", - "description": "Optional. Maximum number of the properties for Type.OBJECT." - }, - "maxLength": { - "type": "string", - "format": "int64", - "description": "Optional. Maximum length of the Type.STRING" - }, - "properties": { - "description": "Optional. Properties of Type.OBJECT.", - "additionalProperties": { - "$ref": "Schema" - }, - "type": "object" - }, - "items": { - "description": "Optional. Schema of the elements of Type.ARRAY.", - "$ref": "Schema" - } - } - }, - "Maps": { - "type": "object", - "id": "Maps", - "description": "A grounding chunk from Google Maps. A Maps chunk corresponds to a single place.", - "properties": { - "uri": { - "type": "string", - "description": "URI reference of the place." - }, - "title": { - "type": "string", - "description": "Title of the place." - }, - "text": { - "description": "Text description of the place answer.", + "name": { + "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128.", "type": "string" }, - "placeId": { - "type": "string", - "description": "The ID of the place, in `places/{place_id}` format. A user can use this ID to look up that place." + "description": { + "description": "Required. A brief description of the function.", + "type": "string" }, - "placeAnswerSources": { - "description": "Sources that provide answers about the features of a given place in Google Maps.", - "$ref": "PlaceAnswerSources" - } - } - }, - "DiffDownloadResponse": { - "type": "object", - "id": "DiffDownloadResponse", - "description": "Backend response for a Diff download response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", - "properties": { - "objectLocation": { - "description": "The original object location.", - "$ref": "CompositeMedia" + "parametersJsonSchema": { + "description": "Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" }, \"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\", \"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive with `parameters`.", + "type": "any" } - } + }, + "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.", + "id": "FunctionDeclaration", + "type": "object" }, "GenerateAnswerResponse": { - "type": "object", - "id": "GenerateAnswerResponse", - "description": "Response from the model for a grounded answer.", "properties": { - "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`)", - "$ref": "InputFeedback", - "readOnly": true - }, "answer": { "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`.", "$ref": "Candidate" }, "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.", + "readOnly": true, "type": "number", - "format": "float", + "format": "float" + }, + "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, - "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." + "$ref": "InputFeedback" } - } + }, + "description": "Response from the model for a grounded answer.", + "id": "GenerateAnswerResponse", + "type": "object" }, - "SafetyRating": { - "type": "object", - "id": "SafetyRating", - "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.", + "GenerationConfig": { "properties": { - "probability": { - "description": "Required. The probability of harm for this content.", - "type": "string", - "enumDescriptions": [ - "Probability is unspecified.", - "Content has a negligible chance of being unsafe.", - "Content has a low chance of being unsafe.", - "Content has a medium chance of being unsafe.", - "Content has a high chance of being unsafe." - ], - "enum": [ - "HARM_PROBABILITY_UNSPECIFIED", - "NEGLIGIBLE", - "LOW", - "MEDIUM", - "HIGH" - ] + "seed": { + "type": "integer", + "format": "int32", + "description": "Optional. Seed used in decoding. If not set, the request uses a randomly generated seed." }, - "blocked": { - "description": "Was this content blocked because of this rating?", + "enableEnhancedCivicAnswers": { + "description": "Optional. Enables enhanced civic answers. It may not be available for all models.", "type": "boolean" }, - "category": { - "enumDescriptions": [ - "Category is unspecified.", - "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", - "**PaLM** - Content that is rude, disrespectful, or profane.", - "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", - "**PaLM** - Contains references to sexual acts or other lewd content.", - "**PaLM** - Promotes unchecked medical advice.", - "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", - "**Gemini** - Harassment content.", - "**Gemini** - Hate speech and content.", - "**Gemini** - Sexually explicit content.", - "**Gemini** - Dangerous content.", - "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true + "maxOutputTokens": { + "format": "int32", + "type": "integer", + "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." + }, + "frequencyPenalty": { + "format": "float", + "type": "number", + "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 difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit." + }, + "responseJsonSchema": { + "description": "Optional. An internal detail. Use `responseJsonSchema` rather than this field.", + "type": "any" + }, + "imageConfig": { + "description": "Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.", + "$ref": "ImageConfig" + }, + "candidateCount": { + "type": "integer", + "format": "int32", + "description": "Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)" + }, + "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" + }, + "mediaResolution": { + "description": "Optional. If specified, the media resolution specified will be used.", + "enumDescriptions": [ + "Media resolution has not been set.", + "Media resolution set to low (64 tokens).", + "Media resolution set to medium (256 tokens).", + "Media resolution set to high (zoomed reframing with 256 tokens)." ], - "type": "string", "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT", - "HARM_CATEGORY_CIVIC_INTEGRITY" + "MEDIA_RESOLUTION_UNSPECIFIED", + "MEDIA_RESOLUTION_LOW", + "MEDIA_RESOLUTION_MEDIUM", + "MEDIA_RESOLUTION_HIGH" ], - "description": "Required. The category for this rating." - } - } - }, - "EmbedContentBatchStats": { - "id": "EmbedContentBatchStats", - "type": "object", - "description": "Stats about the batch.", - "properties": { - "requestCount": { - "type": "string", - "format": "int64", - "readOnly": true, - "description": "Output only. The number of requests in the batch." + "type": "string" }, - "pendingRequestCount": { - "type": "string", - "format": "int64", - "description": "Output only. The number of requests that are still pending processing.", - "readOnly": true + "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" }, - "successfulRequestCount": { - "readOnly": true, - "description": "Output only. The number of requests that were successfully processed.", - "type": "string", - "format": "int64" + "responseFormat": { + "description": "Optional. Configuration for the response output format. Allows specifying output configuration per modality (text, audio, image) in a flat structure.", + "$ref": "ResponseFormatConfig" }, - "failedRequestCount": { - "description": "Output only. The number of requests that failed to be processed.", - "readOnly": true, - "type": "string", - "format": "int64" - } - } - }, - "VideoFileMetadata": { - "description": "Metadata for a video `File`.", - "properties": { - "videoDuration": { - "type": "string", - "format": "google-duration", - "description": "Duration of the video." + "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" + }, + "speechConfig": { + "description": "Optional. The speech generation config.", + "$ref": "SpeechConfig" + }, + "_responseJsonSchema": { + "description": "Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set.", + "type": "any" + }, + "responseLogprobs": { + "description": "Optional. If true, export the logprobs results in response.", + "type": "boolean" + }, + "responseModalities": { + "description": "Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text.", + "items": { + "type": "string", + "enumDescriptions": [ + "Default value.", + "Indicates the model should return text.", + "Indicates the model should return images.", + "Indicates the model should return audio." + ], + "enum": [ + "MODALITY_UNSPECIFIED", + "TEXT", + "IMAGE", + "AUDIO" + ] + }, + "type": "array" + }, + "temperature": { + "format": "float", + "type": "number", + "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]." + }, + "logprobs": { + "description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20].", + "format": "int32", + "type": "integer" + }, + "thinkingConfig": { + "description": "Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.", + "$ref": "ThinkingConfig" + }, + "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.", + "type": "integer", + "format": "int32" + }, + "responseSchema": { + "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.", + "$ref": "Schema" + }, + "translationConfig": { + "description": "Optional. Config for translation.", + "$ref": "TranslationConfig" + }, + "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" } }, - "type": "object", - "id": "VideoFileMetadata" + "description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.", + "id": "GenerationConfig", + "type": "object" }, - "Example": { - "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.", + "FunctionCallingConfig": { + "id": "FunctionCallingConfig", + "type": "object", "properties": { - "input": { - "description": "Required. An example of an input `Message` from the user.", - "$ref": "Message" + "mode": { + "type": "string", + "enumDescriptions": [ + "Unspecified function calling mode. This value should not be used.", + "Default model behavior, model decides to predict either a function call or a natural language response.", + "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".", + "Model will not predict any function call. Model behavior is same as when not passing any function declarations.", + "Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\"." + ], + "enum": [ + "MODE_UNSPECIFIED", + "AUTO", + "ANY", + "NONE", + "VALIDATED" + ], + "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO." }, - "output": { - "description": "Required. An example of what the model should output given the input.", - "$ref": "Message" + "allowedFunctionNames": { + "type": "array", + "items": { + "type": "string" + }, + "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 or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names." } }, - "id": "Example", - "type": "object" + "description": "Configuration for specifying function calling behavior." }, - "AttributionSourceId": { + "DiffVersionResponse": { + "id": "DiffVersionResponse", "type": "object", - "id": "AttributionSourceId", - "description": "Identifier for the source contributing to this attribution.", "properties": { - "groundingPassage": { - "description": "Identifier for an inline passage.", - "$ref": "GroundingPassageId" + "objectVersion": { + "description": "The version of the object stored at the server.", + "type": "string" }, - "semanticRetrieverChunk": { - "description": "Identifier for a `Chunk` fetched via Semantic Retriever.", - "$ref": "SemanticRetrieverChunk" + "objectSizeBytes": { + "description": "The total size of the server object.", + "type": "string", + "format": "int64" } - } + }, + "description": "Backend response for a Diff get version response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol." }, - "ContentEmbedding": { - "description": "A list of floats representing an embedding.", + "MessagePrompt": { "properties": { - "shape": { - "description": "This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048]).", + "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": { + "type": "array", + "description": "Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`.", "items": { - "type": "integer", - "format": "int32" - }, - "type": "array" + "$ref": "Example" + } }, - "values": { - "description": "The embedding values. This is for 3P users only and will not be populated for 1P calls.", + "messages": { "items": { - "type": "number", - "format": "float" + "$ref": "Message" }, + "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`.", "type": "array" } }, - "id": "ContentEmbedding", + "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.", + "id": "MessagePrompt", "type": "object" }, - "Operation": { - "description": "This resource represents a long-running operation that is the result of a network API call.", + "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": { - "metadata": { - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, - "type": "object" - }, - "response": { - "type": "object", - "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } + "sha1Hash": { + "description": "SHA-1 hash for the payload.", + "format": "byte", + "type": "string" }, - "done": { - "type": "boolean", - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available." + "crc32cHash": { + "description": "crc32.c hash for the payload.", + "type": "integer", + "format": "uint32" }, - "error": { - "description": "The error result of the operation in case of failure or cancellation.", - "$ref": "Status" + "inline": { + "type": "string", + "format": "byte", + "description": "Media data, set if reference_type is INLINE" }, - "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}`.", + "objectId": { + "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF.", + "$ref": "ObjectId" + }, + "path": { + "description": "Path to the data, set if reference_type is PATH", "type": "string" - } - }, - "id": "Operation", - "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": { - "language": { - "description": "Required. Programming language of the `code`.", + }, + "blobstore2Info": { + "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.", + "$ref": "Blobstore2Info" + }, + "length": { + "format": "int64", "type": "string", + "description": "Size of the data, in bytes" + }, + "referenceType": { "enumDescriptions": [ - "Unspecified language. This value should not be used.", - "Python \u003e= 3.10, with numpy and simpy available. Python is the default language." + "Reference contains a GFS path or a local path.", + "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", + "Data is included into this proto buffer", + "Reference points to a bigstore object", + "Indicates the data is stored in cosmo_binary_reference." ], "enum": [ - "LANGUAGE_UNSPECIFIED", - "PYTHON" - ] + "PATH", + "BLOB_REF", + "INLINE", + "BIGSTORE_REF", + "COSMO_BINARY_REFERENCE" + ], + "description": "Describes what the field reference contains.", + "type": "string" }, - "id": { + "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" + }, + "blobRef": { + "format": "byte", "type": "string", - "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`." + "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." }, - "code": { - "description": "Required. The code to be executed.", - "type": "string" + "md5Hash": { + "format": "byte", + "type": "string", + "description": "MD5 hash for the payload." } }, - "id": "ExecutableCode", - "type": "object" + "type": "object", + "id": "CompositeMedia" }, - "ToolCall": { - "id": "ToolCall", + "VideoFileMetadata": { + "id": "VideoFileMetadata", "type": "object", - "description": "A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.", "properties": { - "id": { + "videoDuration": { + "description": "Duration of the video.", "type": "string", - "description": "Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`." + "format": "google-duration" + } + }, + "description": "Metadata for a video `File`." + }, + "GroundingMetadata": { + "properties": { + "webSearchQueries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Web search queries for the following-up web search." }, - "toolType": { - "description": "Required. The type of tool that was called.", - "type": "string", - "enumDescriptions": [ - "Unspecified tool type.", - "Google search tool, maps to Tool.google_search.search_types.web_search.", - "Image search tool, maps to Tool.google_search.search_types.image_search.", - "URL context tool, maps to Tool.url_context.", - "Google maps tool, maps to Tool.google_maps.", - "File search tool, maps to Tool.file_search." - ], - "enum": [ - "TOOL_TYPE_UNSPECIFIED", - "GOOGLE_SEARCH_WEB", - "GOOGLE_SEARCH_IMAGE", - "URL_CONTEXT", - "GOOGLE_MAPS", - "FILE_SEARCH" - ] + "googleMapsWidgetContextToken": { + "description": "Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled.", + "type": "string" }, - "args": { - "description": "Optional. The tool call arguments. Example: {\"arg1\" : \"value1\", \"arg2\" : \"value2\" , ...}", - "additionalProperties": { - "type": "any", - "description": "Properties of the object." + "retrievalMetadata": { + "description": "Metadata related to retrieval in the grounding flow.", + "$ref": "RetrievalMetadata" + }, + "groundingChunks": { + "items": { + "$ref": "GroundingChunk" }, - "type": "object" + "description": "List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses.", + "type": "array" + }, + "imageSearchQueries": { + "description": "Image search queries used for grounding.", + "items": { + "type": "string" + }, + "type": "array" + }, + "searchEntryPoint": { + "description": "Optional. Google search entry for the following-up web searches.", + "$ref": "SearchEntryPoint" + }, + "groundingSupports": { + "type": "array", + "items": { + "$ref": "GoogleAiGenerativelanguageV1betaGroundingSupport" + }, + "description": "List of grounding support." + } + }, + "description": "Metadata returned to client when grounding is enabled.", + "id": "GroundingMetadata", + "type": "object" + }, + "ListFilesResponse": { + "type": "object", + "id": "ListFilesResponse", + "description": "Response for `ListFiles`.", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "File" + }, + "description": "The list of `File`s." + }, + "nextPageToken": { + "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.", + "type": "string" } } }, - "CustomMetadata": { - "description": "User provided metadata stored as key-value pairs.", + "GroundingChunkCustomMetadata": { + "type": "object", + "id": "GroundingChunkCustomMetadata", + "description": "User provided metadata about the GroundingFact.", "properties": { - "stringListValue": { - "description": "The StringList value of the metadata to store.", - "$ref": "StringList" + "stringValue": { + "description": "Optional. The string value of the metadata.", + "type": "string" }, "numericValue": { "type": "number", "format": "float", - "description": "The numeric value of the metadata to store." + "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used." }, "key": { - "description": "Required. The key of the metadata to store.", + "description": "The key of the metadata.", "type": "string" }, - "stringValue": { - "type": "string", - "description": "The string value of the metadata to store." + "stringListValue": { + "description": "Optional. A list of string values for the metadata.", + "$ref": "GroundingChunkStringList" } - }, - "type": "object", - "id": "CustomMetadata" + } }, - "SearchTypes": { - "id": "SearchTypes", + "GroundingChunk": { + "id": "GroundingChunk", "type": "object", - "description": "Different types of search that can be enabled on the GoogleSearch tool.", "properties": { - "webSearch": { - "description": "Optional. Enables web search. Only text results are returned.", - "$ref": "WebSearch" + "web": { + "description": "Grounding chunk from the web.", + "$ref": "Web" }, - "imageSearch": { - "description": "Optional. Enables image search. Image bytes are returned.", - "$ref": "ImageSearch" + "image": { + "description": "Optional. Grounding chunk from image search.", + "$ref": "Image" + }, + "retrievedContext": { + "description": "Optional. Grounding chunk from context retrieved by the file search tool.", + "$ref": "RetrievedContext" + }, + "maps": { + "description": "Optional. Grounding chunk from Google Maps.", + "$ref": "Maps" } - } + }, + "description": "A `GroundingChunk` represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps." }, - "CountTokensRequest": { - "id": "CountTokensRequest", + "EmbedTextRequest": { "type": "object", - "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", + "id": "EmbedTextRequest", + "description": "Request to get a text embedding from the model.", "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": "Content" - }, - "type": "array" + "model": { + "description": "Required. The model name to use with the format model=models/{model}.", + "type": "string" }, - "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.", - "$ref": "GenerateContentRequest" + "text": { + "description": "Optional. The free-form input text that the model will turn into an embedding.", + "type": "string" } } }, - "ListGeneratedFilesResponse": { - "id": "ListGeneratedFilesResponse", + "GenerateMessageResponse": { + "id": "GenerateMessageResponse", "type": "object", - "description": "Response for `ListGeneratedFiles`.", "properties": { - "generatedFiles": { - "type": "array", - "description": "The list of `GeneratedFile`s.", + "messages": { + "description": "The conversation history used by the model.", "items": { - "$ref": "GeneratedFile" - } + "$ref": "Message" + }, + "type": "array" }, - "nextPageToken": { - "type": "string", - "description": "A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call." - } - } - }, - "Condition": { - "description": "Filter condition applicable to a single key.", - "properties": { - "operation": { - "type": "string", - "enumDescriptions": [ - "The default value. This value is unused.", - "Supported by numeric.", - "Supported by numeric.", - "Supported by numeric & string.", - "Supported by numeric.", - "Supported by numeric.", - "Supported by numeric & string.", - "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.", - "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`." - ], - "enum": [ - "OPERATOR_UNSPECIFIED", - "LESS", - "LESS_EQUAL", - "EQUAL", - "GREATER_EQUAL", - "GREATER", - "NOT_EQUAL", - "INCLUDES", - "EXCLUDES" - ], - "description": "Required. Operator applied to the given key-value pair to trigger the condition." - }, - "stringValue": { - "type": "string", - "description": "The string value to filter the metadata on." + "filters": { + "items": { + "$ref": "ContentFilter" + }, + "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.", + "type": "array" }, - "numericValue": { - "type": "number", - "format": "float", - "description": "The numeric value to filter the metadata on." + "candidates": { + "type": "array", + "items": { + "$ref": "Message" + }, + "description": "Candidate response messages from the model." } }, - "id": "Condition", - "type": "object" + "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages." }, - "FunctionCallingConfig": { - "id": "FunctionCallingConfig", - "type": "object", - "description": "Configuration for specifying function calling behavior.", + "GoogleMaps": { + "description": "The GoogleMaps Tool that provides geospatial context for the user's query.", "properties": { - "mode": { - "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.", - "type": "string", - "enumDescriptions": [ - "Unspecified function calling mode. This value should not be used.", - "Default model behavior, model decides to predict either a function call or a natural language response.", - "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".", - "Model will not predict any function call. Model behavior is same as when not passing any function declarations.", - "Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\"." - ], - "enum": [ - "MODE_UNSPECIFIED", - "AUTO", - "ANY", - "NONE", - "VALIDATED" - ] - }, - "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 or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names.", - "items": { - "type": "string" - }, - "type": "array" + "enableWidget": { + "description": "Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.", + "type": "boolean" } - } + }, + "type": "object", + "id": "GoogleMaps" }, - "Candidate": { - "id": "Candidate", + "PromptFeedback": { "type": "object", - "description": "A response candidate generated from the model.", + "id": "PromptFeedback", + "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", "properties": { - "index": { - "description": "Output only. Index of the candidate in the list of response candidates.", - "readOnly": true, - "type": "integer", - "format": "int32" - }, - "finishReason": { - "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.", - "type": "string", + "blockReason": { + "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.", + "enumDescriptions": [ + "Default value. This value is unused.", + "Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", + "Prompt was blocked due to unknown reasons.", + "Prompt was blocked due to the terms which are included from the terminology blocklist.", + "Prompt was blocked due to prohibited content.", + "Candidates blocked due to unsafe image generation content." + ], "enum": [ - "FINISH_REASON_UNSPECIFIED", - "STOP", - "MAX_TOKENS", + "BLOCK_REASON_UNSPECIFIED", "SAFETY", - "RECITATION", - "LANGUAGE", "OTHER", "BLOCKLIST", "PROHIBITED_CONTENT", - "SPII", - "MALFORMED_FUNCTION_CALL", - "IMAGE_SAFETY", - "IMAGE_PROHIBITED_CONTENT", - "IMAGE_OTHER", - "NO_IMAGE", - "IMAGE_RECITATION", - "UNEXPECTED_TOOL_CALL", - "TOO_MANY_TOOL_CALLS", - "MISSING_THOUGHT_SIGNATURE", - "MALFORMED_RESPONSE", - "ESCALATION" + "IMAGE_SAFETY" ], - "readOnly": true, - "enumDescriptions": [ - "Default value. This value is unused.", - "Natural stop point of the model or provided stop sequence.", - "The maximum number of tokens as specified in the request was reached.", - "The response candidate content was flagged for safety reasons.", - "The response candidate content was flagged for recitation reasons.", - "The response candidate content was flagged for using an unsupported language.", - "Unknown reason.", - "Token generation stopped because the content contains forbidden terms.", - "Token generation stopped for potentially containing prohibited content.", - "Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).", - "The function call generated by the model is invalid.", - "Token generation stopped because generated images contain safety violations.", - "Image generation stopped because generated images has other prohibited content.", - "Image generation stopped because of other miscellaneous issue.", - "The model was expected to generate an image, but none was generated.", - "Image generation stopped due to recitation.", - "Model generated a tool call but no tools were enabled in the request.", - "Model called too many tools consecutively, thus the system exited execution.", - "Request has at least one thought signature missing.", - "Finished due to malformed response.", - "Request was filtered by an escalation rule." - ] - }, - "finishMessage": { - "type": "string", - "readOnly": true, - "description": "Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set." - }, - "logprobsResult": { - "description": "Output only. Log-likelihood scores for the response tokens and top tokens", - "$ref": "LogprobsResult", - "readOnly": true - }, - "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.", - "$ref": "CitationMetadata", - "readOnly": true - }, - "urlContextMetadata": { - "readOnly": true, - "description": "Output only. Metadata related to url context retrieval tool.", - "$ref": "UrlContextMetadata" - }, - "content": { - "readOnly": true, - "description": "Output only. Generated content returned from the model.", - "$ref": "Content" - }, - "tokenCount": { - "readOnly": true, - "description": "Output only. Token count for this candidate.", - "type": "integer", - "format": "int32" - }, - "groundingMetadata": { - "readOnly": true, - "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.", - "$ref": "GroundingMetadata" - }, - "avgLogprobs": { - "description": "Output only. Average log probability score of the candidate.", - "readOnly": true, - "type": "number", - "format": "double" + "type": "string" }, "safetyRatings": { - "type": "array", - "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", "items": { "$ref": "SafetyRating" - } - }, - "groundingAttributions": { - "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", - "items": { - "$ref": "GroundingAttribution" }, - "readOnly": true, + "description": "Ratings for safety of the prompt. There is at most one rating per category.", "type": "array" } } }, - "AsyncBatchEmbedContentRequest": { - "type": "object", - "id": "AsyncBatchEmbedContentRequest", - "description": "Request for an `AsyncBatchEmbedContent` operation.", - "properties": { - "batch": { - "description": "Required. The batch to create.", - "$ref": "EmbedContentBatch" - } - } - }, - "ListModelsResponse": { - "id": "ListModelsResponse", + "BidiGenerateContentSetup": { + "id": "BidiGenerateContentSetup", "type": "object", - "description": "Response from `ListModel` containing a paginated list of Models.", "properties": { - "models": { - "description": "The returned Models.", + "contextWindowCompression": { + "description": "Optional. Configures a context window compression mechanism. If included, the server will automatically reduce the size of the context when it exceeds the configured length.", + "$ref": "ContextWindowCompressionConfig" + }, + "realtimeInputConfig": { + "description": "Optional. Configures the handling of realtime input.", + "$ref": "RealtimeInputConfig" + }, + "generationConfig": { + "description": "Optional. Generation config. The following fields are not supported: - `response_logprobs` - `response_mime_type` - `logprobs` - `response_schema` - `response_json_schema` - `stop_sequence` - `skip_response_cache` - `routing_config` - `audio_timestamp`", + "$ref": "GenerationConfig" + }, + "sessionResumption": { + "description": "Optional. Configures session resumption mechanism. If included, the server will send `SessionResumptionUpdate` messages.", + "$ref": "SessionResumptionConfig" + }, + "inputAudioTranscription": { + "description": "Optional. If set, enables transcription of voice input. The transcription aligns with the input audio language, if configured.", + "$ref": "AudioTranscriptionConfig" + }, + "historyConfig": { + "description": "Optional. Configures the exchange of history between the client and the server.", + "$ref": "HistoryConfig" + }, + "outputAudioTranscription": { + "description": "Optional. If set, enables transcription of the model's audio output. The transcription aligns with the language code specified for the output audio, if configured.", + "$ref": "AudioTranscriptionConfig" + }, + "systemInstruction": { + "description": "Optional. The user provided system instructions for the model. Note: Only text should be used in parts and content in each part will be in a separate paragraph.", + "$ref": "Content" + }, + "tools": { "items": { - "$ref": "Model" + "$ref": "Tool" }, + "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.", "type": "array" }, - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." - } - } - }, - "PrebuiltVoiceConfig": { - "description": "The configuration for the prebuilt speaker to use.", - "properties": { - "voiceName": { - "type": "string", - "description": "The name of the preset voice to use." + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`", + "type": "string" } }, - "id": "PrebuiltVoiceConfig", - "type": "object" + "description": "Message to be sent in the first (and only in the first) `BidiGenerateContentClientMessage`. Contains configuration that will apply for the duration of the streaming RPC. Clients should wait for a `BidiGenerateContentSetupComplete` message before sending any additional messages." }, - "ListFileSearchStoresResponse": { - "description": "Response from `ListFileSearchStores` containing a paginated list of `FileSearchStores`. The results are sorted by ascending `file_search_store.create_time`.", + "BatchEmbedContentsRequest": { + "description": "Batch request to get embeddings from the model for a list of prompts.", "properties": { - "fileSearchStores": { - "type": "array", - "description": "The returned rag_stores.", + "requests": { + "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.", "items": { - "$ref": "FileSearchStore" - } - }, - "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" + "$ref": "EmbedContentRequest" + }, + "type": "array" } }, "type": "object", - "id": "ListFileSearchStoresResponse" + "id": "BatchEmbedContentsRequest" }, - "GroundingAttribution": { + "TransferOwnershipResponse": { + "id": "TransferOwnershipResponse", "type": "object", - "id": "GroundingAttribution", - "description": "Attribution for a source that contributed to an answer.", - "properties": { - "sourceId": { - "description": "Output only. Identifier for the source contributing to this attribution.", - "$ref": "AttributionSourceId", - "readOnly": true - }, - "content": { - "description": "Grounding source content that makes up this attribution.", - "$ref": "Content" - } - } + "properties": {}, + "description": "Response from `TransferOwnership`." }, - "CodeExecutionResult": { - "type": "object", - "id": "CodeExecutionResult", - "description": "Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.", + "FunctionResponse": { "properties": { + "response": { + "description": "Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. \"output\", \"result\", etc. In particular, if the function call failed to execute, the response can have an \"error\" key to return error details to the model. Multimedia can be included by using a subobject containing a single \"$ref\" key whose value is the `inline_data.display_name` of a `FunctionResponsePart` holding the multimedia. See https://ai.google.dev/gemini-api/docs/function-calling#multimodal.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + }, + "type": "object" + }, "id": { - "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.", + "description": "Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.", "type": "string" }, - "outcome": { - "description": "Required. Outcome of the code execution.", - "type": "string", + "scheduling": { "enumDescriptions": [ - "Unspecified status. This value should not be used.", - "Code execution completed successfully. `output` contains the stdout, if any.", - "Code execution failed. `output` contains the stderr and stdout, if any.", - "Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present." + "This value is unused.", + "Only add the result to the conversation context, do not interrupt or trigger generation.", + "Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.", + "Add the result to the conversation context, interrupt ongoing generation and prompt to generate output." ], "enum": [ - "OUTCOME_UNSPECIFIED", - "OUTCOME_OK", - "OUTCOME_FAILED", - "OUTCOME_DEADLINE_EXCEEDED" - ] + "SCHEDULING_UNSPECIFIED", + "SILENT", + "WHEN_IDLE", + "INTERRUPT" + ], + "description": "Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.", + "type": "string" }, - "output": { - "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.", + "willContinue": { + "description": "Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.", + "type": "boolean" + }, + "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 128.", "type": "string" + }, + "parts": { + "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.", + "items": { + "$ref": "FunctionResponsePart" + }, + "type": "array" } - } + }, + "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.", + "id": "FunctionResponse", + "type": "object" }, - "Permission": { - "id": "Permission", + "ListCachedContentsResponse": { "type": "object", - "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete", + "id": "ListCachedContentsResponse", + "description": "Response with CachedContents list.", "properties": { - "name": { - "type": "string", - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", - "readOnly": true - }, - "emailAddress": { - "type": "string", - "description": "Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE." - }, - "granteeType": { - "type": "string", - "enumDescriptions": [ - "The default value. This value is unused.", - "Represents a user. When set, you must provide email_address for the user.", - "Represents a group. When set, you must provide email_address for the group.", - "Represents access to everyone. No extra information is required." - ], - "enum": [ - "GRANTEE_TYPE_UNSPECIFIED", - "USER", - "GROUP", - "EVERYONE" - ], - "description": "Optional. Immutable. The type of the grantee." + "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" }, - "role": { - "description": "Required. The role granted by this permission.", - "type": "string", - "enumDescriptions": [ - "The default value. This value is unused.", - "Owner can use, update, share and delete the resource.", - "Writer can use, update and share the resource.", - "Reader can use the resource." - ], - "enum": [ - "ROLE_UNSPECIFIED", - "OWNER", - "WRITER", - "READER" - ] + "cachedContents": { + "type": "array", + "items": { + "$ref": "CachedContent" + }, + "description": "List of cached contents." } } }, - "GenerateMessageResponse": { - "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.", + "SlidingWindow": { + "id": "SlidingWindow", + "type": "object", "properties": { - "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": "ContentFilter" - }, - "type": "array" - }, - "messages": { - "description": "The conversation history used by the model.", + "targetTokens": { + "format": "int64", + "type": "string", + "description": "The target number of tokens to keep. The default value is trigger_tokens/2. Discarding parts of the context window causes a temporary latency increase so this value should be calibrated to avoid frequent compression operations." + } + }, + "description": "The SlidingWindow method operates by discarding content at the beginning of the context window. The resulting context will always begin at the start of a USER role turn. System instructions and any `BidiGenerateContentSetup.prefix_turns` will always remain at the beginning of the result." + }, + "BatchEmbedTextRequest": { + "properties": { + "requests": { + "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.", "items": { - "$ref": "Message" + "$ref": "EmbedTextRequest" }, "type": "array" }, - "candidates": { + "texts": { "type": "array", - "description": "Candidate response messages from the model.", + "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": { - "$ref": "Message" + "type": "string" } } }, - "id": "GenerateMessageResponse", + "description": "Batch request to get a text embedding from the model.", + "id": "BatchEmbedTextRequest", "type": "object" }, - "BatchEmbedContentsResponse": { - "description": "The response to a `BatchEmbedContentsRequest`.", + "Blob": { + "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.", "properties": { - "embeddings": { - "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.", - "items": { - "$ref": "ContentEmbedding" - }, - "readOnly": true, - "type": "array" + "mimeType": { + "description": "The IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: text/plain, text/html, text/css, text/javascript, text/x-typescript, text/csv, text/markdown, text/x-python, text/xml, text/rtf, video/text/timestamp - Applications: application/x-javascript, application/x-typescript, application/x-python-code, application/json, application/x-ipynb+json, application/rtf, application/pdf For additional context, see [Supported file formats](https://ai.google.dev/gemini-api/docs/file-input-methods#supported-content-types). //", + "type": "string" }, - "usageMetadata": { - "description": "Output only. The usage metadata for the request.", - "$ref": "EmbeddingUsageMetadata", - "readOnly": true + "data": { + "description": "Raw bytes for media formats.", + "format": "byte", + "type": "string" } }, "type": "object", - "id": "BatchEmbedContentsResponse" + "id": "Blob" }, - "TuningSnapshot": { - "description": "Record for a single tuning step.", + "TuningExamples": { + "type": "object", + "id": "TuningExamples", + "description": "A set of tuning examples. Can be training or validation data.", "properties": { - "epoch": { + "examples": { + "type": "array", + "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": "TuningExample" + } + } + } + }, + "Corpus": { + "properties": { + "name": { "readOnly": true, - "description": "Output only. The epoch this step was part of.", - "type": "integer", - "format": "int32" + "type": "string", + "description": "Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`" }, - "meanLoss": { - "description": "Output only. The mean loss of the training examples for this step.", - "readOnly": true, - "type": "number", - "format": "float" + "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" }, - "computeTime": { - "type": "string", + "createTime": { "format": "google-datetime", - "description": "Output only. The timestamp when this metric was computed.", - "readOnly": true + "readOnly": true, + "type": "string", + "description": "Output only. The Timestamp of when the `Corpus` was created." }, - "step": { - "type": "integer", - "format": "int32", + "updateTime": { + "description": "Output only. The Timestamp of when the `Corpus` was last updated.", "readOnly": true, - "description": "Output only. The tuning step." + "type": "string", + "format": "google-datetime" } }, - "type": "object", - "id": "TuningSnapshot" + "description": "A `Corpus` is a collection of `Document`s. A project can create up to 10 corpora.", + "id": "Corpus", + "type": "object" }, - "Part": { - "type": "object", - "id": "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.", + "InlinedEmbedContentRequests": { "properties": { - "functionResponse": { - "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.", - "$ref": "FunctionResponse" + "requests": { + "items": { + "$ref": "InlinedEmbedContentRequest" + }, + "description": "Required. The requests to be processed in the batch.", + "type": "array" + } + }, + "description": "The requests to be processed in the batch if provided as part of the batch creation request.", + "id": "InlinedEmbedContentRequests", + "type": "object" + }, + "CitationSource": { + "properties": { + "endIndex": { + "format": "int32", + "type": "integer", + "description": "Optional. End of the attributed segment, exclusive." }, - "executableCode": { - "description": "Code generated by the model that is meant to be executed.", - "$ref": "ExecutableCode" + "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" }, - "videoMetadata": { - "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.", - "$ref": "VideoMetadata" + "uri": { + "description": "Optional. URI that is attributed as a source for a portion of the text.", + "type": "string" }, - "toolCall": { - "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.", - "$ref": "ToolCall" - }, - "functionCall": { - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", - "$ref": "FunctionCall" - }, - "text": { - "type": "string", - "description": "Inline text." - }, - "fileData": { - "description": "URI based data.", - "$ref": "FileData" - }, - "partMetadata": { - "type": "object", - "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } - }, - "thought": { - "type": "boolean", - "description": "Optional. Indicates if the part is thought from the model." - }, - "mediaResolution": { - "description": "Optional. Media resolution for the input media.", - "$ref": "MediaResolution" - }, - "codeExecutionResult": { - "description": "Result of executing the `ExecutableCode`.", - "$ref": "CodeExecutionResult" - }, - "toolResponse": { - "description": "The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.", - "$ref": "ToolResponse" + "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.", + "type": "integer", + "format": "int32" + } + }, + "description": "A citation to a source for a portion of a specific response.", + "id": "CitationSource", + "type": "object" + }, + "ImportFileRequest": { + "properties": { + "customMetadata": { + "items": { + "$ref": "CustomMetadata" + }, + "description": "Custom metadata to be associated with the file.", + "type": "array" }, - "thoughtSignature": { - "type": "string", - "format": "byte", - "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests." + "chunkingConfig": { + "description": "Optional. Config for telling the service how to chunk the file. If not provided, the service will use default parameters.", + "$ref": "ChunkingConfig" }, - "inlineData": { - "description": "Inline media bytes.", - "$ref": "Blob" + "fileName": { + "description": "Required. The name of the `File` to import. Example: `files/abc-123`", + "type": "string" } - } + }, + "description": "Request for `ImportFile` to import a File API file with a `FileSearchStore`.", + "id": "ImportFileRequest", + "type": "object" }, - "ToolResponse": { - "id": "ToolResponse", + "GenerateContentRequest": { "type": "object", - "description": "The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.", + "id": "GenerateContentRequest", + "description": "Request to generate a completion from the model.", "properties": { - "id": { - "description": "Optional. The identifier of the tool call this response is for.", + "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" }, - "toolType": { - "description": "Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.", + "serviceTier": { "type": "string", "enumDescriptions": [ - "Unspecified tool type.", - "Google search tool, maps to Tool.google_search.search_types.web_search.", - "Image search tool, maps to Tool.google_search.search_types.image_search.", - "URL context tool, maps to Tool.url_context.", - "Google maps tool, maps to Tool.google_maps.", - "File search tool, maps to Tool.file_search." + "Default service tier, which is standard.", + "Standard service tier.", + "Flex service tier.", + "Priority service tier." ], "enum": [ - "TOOL_TYPE_UNSPECIFIED", - "GOOGLE_SEARCH_WEB", - "GOOGLE_SEARCH_IMAGE", - "URL_CONTEXT", - "GOOGLE_MAPS", - "FILE_SEARCH" - ] - }, - "response": { - "type": "object", - "description": "Optional. The tool response.", - "additionalProperties": { - "type": "any", - "description": "Properties of the object." - } - } - } - }, - "Empty": { - "id": "Empty", - "type": "object", - "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": {} - }, - "InlinedEmbedContentResponse": { - "description": "The response to a single request in the batch.", - "properties": { - "metadata": { - "type": "object", - "readOnly": true, - "description": "Output only. The metadata associated with the request.", - "additionalProperties": { - "type": "any", - "description": "Properties of the object." - } - }, - "response": { - "readOnly": true, - "description": "Output only. The response to the request.", - "$ref": "EmbedContentResponse" + "unspecified", + "standard", + "flex", + "priority" + ], + "description": "Optional. The service tier of the request." }, - "error": { - "readOnly": true, - "description": "Output only. The error encountered while processing the request.", - "$ref": "Status" - } - }, - "id": "InlinedEmbedContentResponse", - "type": "object" - }, - "VoiceConfig": { - "description": "The configuration for the voice to use.", - "properties": { - "prebuiltVoiceConfig": { - "description": "The configuration for the prebuilt voice to use.", - "$ref": "PrebuiltVoiceConfig" - } - }, - "type": "object", - "id": "VoiceConfig" - }, - "RetrievalMetadata": { - "type": "object", - "id": "RetrievalMetadata", - "description": "Metadata related to retrieval in the grounding flow.", - "properties": { - "googleSearchDynamicRetrievalScore": { - "type": "number", - "format": "float", - "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." - } - } - }, - "TuningExamples": { - "description": "A set of tuning examples. Can be training or validation data.", - "properties": { - "examples": { + "contents": { "type": "array", - "description": "The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.", + "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": "TuningExample" + "$ref": "Content" } - } - }, - "id": "TuningExamples", - "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. Next ID: 16", - "properties": { - "googleSearch": { - "description": "Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", - "$ref": "GoogleSearch" - }, - "codeExecution": { - "description": "Optional. Enables the model to execute code as part of generation.", - "$ref": "CodeExecution" }, - "googleMaps": { - "description": "Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.", - "$ref": "GoogleMaps" + "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.", + "$ref": "ToolConfig" }, - "googleSearchRetrieval": { - "description": "Optional. Retrieval tool that is powered by Google search.", - "$ref": "GoogleSearchRetrieval" + "safetySettings": { + "items": { + "$ref": "SafetySetting" + }, + "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, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", + "type": "array" }, - "computerUse": { - "description": "Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.", - "$ref": "ComputerUse" + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "type": "string" }, - "fileSearch": { - "description": "Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.", - "$ref": "FileSearch" + "store": { + "description": "Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.", + "type": "boolean" }, - "mcpServers": { - "type": "array", - "description": "Optional. MCP Servers to connect to.", - "items": { - "$ref": "McpServer" - } + "systemInstruction": { + "description": "Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.", + "$ref": "Content" }, - "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.", + "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": "FunctionDeclaration" + "$ref": "Tool" }, "type": "array" }, - "urlContext": { - "description": "Optional. Tool to support URL context retrieval.", - "$ref": "UrlContext" + "generationConfig": { + "description": "Optional. Configuration options for model generation and outputs.", + "$ref": "GenerationConfig" } - }, - "type": "object", - "id": "Tool" + } }, - "FileSearchStore": { - "id": "FileSearchStore", + "EmbedContentBatch": { "type": "object", - "description": "A `FileSearchStore` is a collection of `Document`s.", + "id": "EmbedContentBatch", + "description": "A resource representing a batch of `EmbedContent` requests.", "properties": { - "sizeBytes": { - "type": "string", - "format": "int64", - "readOnly": true, - "description": "Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`." - }, - "createTime": { - "type": "string", + "endTime": { + "description": "Output only. The time at which the batch processing completed.", "format": "google-datetime", "readOnly": true, - "description": "Output only. The Timestamp of when the `FileSearchStore` was created." + "type": "string" }, "name": { - "type": "string", + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", "readOnly": true, - "description": "Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the \"fileSearchStores/\" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated." + "type": "string" }, - "pendingDocumentsCount": { - "description": "Output only. The number of documents in the `FileSearchStore` that are being processed.", + "output": { + "description": "Output only. The output of the batch request.", "readOnly": true, - "type": "string", - "format": "int64" - }, - "failedDocumentsCount": { - "readOnly": true, - "description": "Output only. The number of documents in the `FileSearchStore` that have failed processing.", - "type": "string", - "format": "int64" + "$ref": "EmbedContentBatchOutput" }, "updateTime": { + "description": "Output only. The time at which the batch was last updated.", + "format": "google-datetime", "readOnly": true, - "description": "Output only. The Timestamp of when the `FileSearchStore` was last updated.", - "type": "string", - "format": "google-datetime" + "type": "string" }, - "displayName": { - "description": "Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "type": "string" }, - "activeDocumentsCount": { - "type": "string", - "format": "int64", - "readOnly": true, - "description": "Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval." + "inputConfig": { + "description": "Required. Input configuration of the instances on which batch processing are performed.", + "$ref": "InputEmbedContentConfig" }, - "embeddingModel": { - "type": "string", - "description": "Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used." - } - } - }, - "GeneratedFile": { - "type": "object", - "id": "GeneratedFile", - "description": "A file generated on behalf of a user.", - "properties": { "state": { "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "GENERATING", - "GENERATED", - "FAILED" - ], - "description": "Output only. The state of the GeneratedFile.", + "description": "Output only. The state of the batch.", "enumDescriptions": [ - "The default value. This value is used if the state is omitted.", - "Being generated.", - "Generated and is ready for download.", - "Failed to generate the GeneratedFile." + "The batch state is unspecified.", + "The service is preparing to run the batch.", + "The batch is in progress.", + "The batch completed successfully.", + "The batch failed.", + "The batch has been cancelled.", + "The batch has expired." + ], + "enum": [ + "BATCH_STATE_UNSPECIFIED", + "BATCH_STATE_PENDING", + "BATCH_STATE_RUNNING", + "BATCH_STATE_SUCCEEDED", + "BATCH_STATE_FAILED", + "BATCH_STATE_CANCELLED", + "BATCH_STATE_EXPIRED" ], "readOnly": true }, - "name": { - "description": "Identifier. The name of the generated file. Example: `generatedFiles/abc-123`", + "displayName": { + "description": "Required. The user-defined name of this batch.", "type": "string" }, - "mimeType": { - "type": "string", - "description": "MIME type of the generatedFile." - }, - "error": { - "description": "Error details if the GeneratedFile ends up in the STATE_FAILED state.", - "$ref": "Status" - } - } - }, - "ObjectId": { - "id": "ObjectId", - "type": "object", - "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": { - "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", - "type": "string", - "format": "int64" + "createTime": { + "description": "Output only. The time at which the batch was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" }, - "bucketName": { + "priority": { + "format": "int64", "type": "string", - "description": "The name of the bucket to which this object belongs." + "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0." }, - "objectName": { - "type": "string", - "description": "The name of the object." + "batchStats": { + "readOnly": true, + "$ref": "EmbedContentBatchStats", + "description": "Output only. Stats about the batch." } } }, - "FileData": { - "type": "object", - "id": "FileData", - "description": "URI based data.", + "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": { - "mimeType": { - "description": "Optional. The IANA standard MIME type of the source data.", - "type": "string" + "conditions": { + "type": "array", + "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.", + "items": { + "$ref": "Condition" + } }, - "fileUri": { - "type": "string", - "description": "Required. URI." + "key": { + "description": "Required. The key of the metadata to filter on.", + "type": "string" } - } + }, + "type": "object", + "id": "MetadataFilter" }, - "CachedContent": { - "id": "CachedContent", + "ListGeneratedFilesResponse": { + "id": "ListGeneratedFilesResponse", "type": "object", - "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": { + "generatedFiles": { "type": "array", - "description": "Optional. Input only. Immutable. The content to cache.", "items": { - "$ref": "Content" - } - }, - "ttl": { - "description": "Input only. New TTL for this resource, input only.", - "type": "string", - "format": "google-duration" - }, - "name": { - "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", - "readOnly": true, - "type": "string" - }, - "tools": { - "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response", - "items": { - "$ref": "Tool" + "$ref": "GeneratedFile" }, - "type": "array" - }, - "toolConfig": { - "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools.", - "$ref": "ToolConfig" + "description": "The list of `GeneratedFile`s." }, - "displayName": { - "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.", + "nextPageToken": { + "description": "A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call.", "type": "string" - }, - "usageMetadata": { + } + }, + "description": "Response for `ListGeneratedFiles`." + }, + "GenerateContentBatchOutput": { + "properties": { + "inlinedResponses": { + "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", "readOnly": true, - "description": "Output only. Metadata on the usage of the cached content.", - "$ref": "CachedContentUsageMetadata" + "$ref": "InlinedResponses" }, - "updateTime": { - "type": "string", - "format": "google-datetime", + "responsesFile": { "readOnly": true, - "description": "Output only. When the cache entry was last updated in UTC time." - }, - "model": { - "type": "string", - "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`" - }, - "expireTime": { - "type": "string", - "format": "google-datetime", - "description": "Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input." - }, - "systemInstruction": { - "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only.", - "$ref": "Content" - }, - "createTime": { "type": "string", - "format": "google-datetime", - "description": "Output only. Creation time of the cache entry.", - "readOnly": true + "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests." } - } + }, + "description": "The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.", + "id": "GenerateContentBatchOutput", + "type": "object" }, - "UploadToFileSearchStoreRequest": { - "description": "Request for `UploadToFileSearchStore`.", + "CodeExecutionResult": { + "id": "CodeExecutionResult", + "type": "object", "properties": { - "displayName": { - "type": "string", - "description": "Optional. Display name of the created document." - }, - "customMetadata": { - "description": "Custom metadata to be associated with the data.", - "items": { - "$ref": "CustomMetadata" - }, - "type": "array" + "id": { + "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.", + "type": "string" }, - "mimeType": { + "outcome": { "type": "string", - "description": "Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content." + "enumDescriptions": [ + "Unspecified status. This value should not be used.", + "Code execution completed successfully. `output` contains the stdout, if any.", + "Code execution failed. `output` contains the stderr and stdout, if any.", + "Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present." + ], + "enum": [ + "OUTCOME_UNSPECIFIED", + "OUTCOME_OK", + "OUTCOME_FAILED", + "OUTCOME_DEADLINE_EXCEEDED" + ], + "description": "Required. Outcome of the code execution." }, - "chunkingConfig": { - "description": "Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters.", - "$ref": "ChunkingConfig" + "output": { + "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.", + "type": "string" } }, + "description": "Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used." + }, + "GoogleSearchRetrieval": { "type": "object", - "id": "UploadToFileSearchStoreRequest" + "id": "GoogleSearchRetrieval", + "description": "Tool to retrieve public web data for grounding, powered by Google.", + "properties": { + "dynamicRetrievalConfig": { + "description": "Specifies the dynamic retrieval configuration for the given source.", + "$ref": "DynamicRetrievalConfig" + } + } }, - "GroundingChunkStringList": { - "description": "A list of string values.", + "InputEmbedContentConfig": { "properties": { - "values": { - "description": "The string values of the list.", - "items": { - "type": "string" - }, - "type": "array" + "fileName": { + "description": "The name of the `File` containing the input requests.", + "type": "string" + }, + "requests": { + "description": "The requests to be processed in the batch.", + "$ref": "InlinedEmbedContentRequests" } }, - "id": "GroundingChunkStringList", + "description": "Configures the input to the batch request.", + "id": "InputEmbedContentConfig", "type": "object" }, - "FileSearch": { - "description": "The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.", + "AsyncBatchEmbedContentRequest": { + "description": "Request for an `AsyncBatchEmbedContent` operation.", "properties": { - "fileSearchStoreNames": { - "type": "array", - "description": "Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`", - "items": { - "type": "string" - } - }, - "topK": { - "type": "integer", - "format": "int32", - "description": "Optional. The number of semantic retrieval chunks to retrieve." - }, - "metadataFilter": { - "type": "string", - "description": "Optional. Metadata filter to apply to the semantic retrieval documents and chunks." + "batch": { + "description": "Required. The batch to create.", + "$ref": "EmbedContentBatch" } }, "type": "object", - "id": "FileSearch" + "id": "AsyncBatchEmbedContentRequest" }, - "DownloadMediaResponse": { + "ObjectId": { "type": "object", - "id": "DownloadMediaResponse", - "description": "Response for DownloadMedia.", + "id": "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": { - "blob": { - "readOnly": true, - "description": "Output only. The blob data.", - "$ref": "GdataMedia" + "objectName": { + "description": "The name of the object.", + "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" + }, + "bucketName": { + "description": "The name of the bucket to which this object belongs.", + "type": "string" } } }, - "UrlContextMetadata": { - "description": "Metadata related to url context retrieval tool.", + "DynamicRetrievalConfig": { + "description": "Describes the options to customize dynamic retrieval.", "properties": { - "urlMetadata": { - "description": "List of url context.", - "items": { - "$ref": "UrlMetadata" - }, - "type": "array" + "mode": { + "description": "The mode of the predictor to be used in dynamic retrieval.", + "enumDescriptions": [ + "Always trigger retrieval.", + "Run retrieval only when system decides it is necessary." + ], + "enum": [ + "MODE_UNSPECIFIED", + "MODE_DYNAMIC" + ], + "type": "string" + }, + "dynamicThreshold": { + "description": "The threshold to be used in dynamic retrieval. If not set, a system default value is used.", + "type": "number", + "format": "float" } }, "type": "object", - "id": "UrlContextMetadata" + "id": "DynamicRetrievalConfig" }, - "InlinedRequest": { - "id": "InlinedRequest", + "FunctionCall": { "type": "object", - "description": "The request to be processed in the batch.", + "id": "FunctionCall", + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", "properties": { - "metadata": { - "description": "Optional. The metadata to be associated with the request.", + "id": { + "description": "Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.", + "type": "string" + }, + "args": { + "type": "object", + "description": "Optional. The function parameters and values in JSON object format.", "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "type": "object" + "type": "any", + "description": "Properties of the object." + } }, - "request": { - "description": "Required. The request to be processed in the batch.", - "$ref": "GenerateContentRequest" + "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 128.", + "type": "string" } } }, - "AudioResponseFormat": { - "id": "AudioResponseFormat", - "type": "object", - "description": "Configuration for audio output format.", + "InlinedEmbedContentRequest": { "properties": { - "mimeType": { - "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "MP3 audio format.", - "OGG Opus audio format.", - "Raw PCM (L16) audio format.", - "WAV audio format.", - "A-law audio format.", - "Mu-law audio format." - ], - "enum": [ - "MIME_TYPE_UNSPECIFIED", - "AUDIO_MP3", - "AUDIO_OGG_OPUS", - "AUDIO_L16", - "AUDIO_WAV", - "AUDIO_ALAW", - "AUDIO_MULAW" - ], - "description": "Optional. The MIME type of the audio output." + "request": { + "description": "Required. The request to be processed in the batch.", + "$ref": "EmbedContentRequest" }, - "bitRate": { - "description": "Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).", - "type": "integer", - "format": "int32" + "metadata": { + "type": "object", + "description": "Optional. The metadata to be associated with the request.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + } + }, + "description": "The request to be processed in the batch.", + "id": "InlinedEmbedContentRequest", + "type": "object" + }, + "AudioTranscriptionConfig": { + "properties": { + "languageAuto": { + "description": "Optional. The model will detect the language automatically.", + "$ref": "LanguageAuto" }, - "delivery": { - "description": "Optional. The delivery mode for the audio output.", - "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "Audio data is returned inline in the response.", - "Audio data is returned as a URI." - ], - "enum": [ - "DELIVERY_UNSPECIFIED", - "INLINE", - "URI" - ] + "adaptationPhrases": { + "description": "Optional. A list of phrases used for speech adaptation, which biases the ASR model to improve recognition of these specific terms.", + "items": { + "type": "string" + }, + "type": "array" }, - "sampleRate": { - "type": "integer", - "format": "int32", - "description": "Optional. Sample rate in Hz." + "languageHints": { + "description": "Optional. Specifies one or more languages in the audio.", + "$ref": "LanguageHints" } - } + }, + "description": "The audio transcription configuration.", + "id": "AudioTranscriptionConfig", + "type": "object" }, - "CreateFileRequest": { + "TextPrompt": { "type": "object", - "id": "CreateFileRequest", - "description": "Request for `CreateFile`.", + "id": "TextPrompt", + "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.", "properties": { - "file": { - "description": "Optional. Metadata for the file to create.", - "$ref": "File" + "text": { + "description": "Required. The prompt text.", + "type": "string" } } }, - "Model": { - "id": "Model", + "InlinedResponses": { + "description": "The responses to the requests in the batch.", + "properties": { + "inlinedResponses": { + "description": "Output only. The responses to the requests in the batch.", + "items": { + "$ref": "InlinedResponse" + }, + "readOnly": true, + "type": "array" + } + }, "type": "object", - "description": "Information about a Generative Language Model.", + "id": "InlinedResponses" + }, + "GenerateContentResponse": { + "type": "object", + "id": "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": { - "baseModelId": { - "type": "string", - "description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`" - }, - "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" - }, - "thinking": { - "description": "Whether the model supports thinking.", - "type": "boolean" - }, - "inputTokenLimit": { - "description": "Maximum number of input tokens allowed for this model.", - "type": "integer", - "format": "int32" - }, - "topP": { - "type": "number", - "format": "float", - "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." - }, - "topK": { - "type": "integer", - "format": "int32", - "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter." - }, - "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.", - "type": "number", - "format": "float" + "candidates": { + "items": { + "$ref": "Candidate" + }, + "description": "Candidate responses from the model.", + "type": "array" }, - "version": { - "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)", + "responseId": { + "description": "Output only. response_id is used to identify each response.", + "readOnly": true, "type": "string" }, - "maxTemperature": { - "type": "number", - "format": "float", - "description": "The maximum temperature this model can use." - }, - "outputTokenLimit": { - "description": "Maximum number of output tokens available for this model.", - "type": "integer", - "format": "int32" + "modelStatus": { + "readOnly": true, + "$ref": "ModelStatus", + "description": "Output only. The current model status of this model." }, - "name": { - "type": "string", - "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`" + "usageMetadata": { + "description": "Output only. Metadata on the generation requests' token usage.", + "readOnly": true, + "$ref": "UsageMetadata" }, - "description": { + "modelVersion": { + "readOnly": true, "type": "string", - "description": "A short description of the model." + "description": "Output only. The model version used to generate the response." }, - "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" + "promptFeedback": { + "description": "Returns the prompt's feedback related to the content filters.", + "$ref": "PromptFeedback" } } }, "GroundingPassage": { - "description": "Passage included inline with a grounding configuration.", + "id": "GroundingPassage", + "type": "object", "properties": { "id": { - "type": "string", - "description": "Identifier for the passage for attributing this passage in grounded answers." + "description": "Identifier for the passage for attributing this passage in grounded answers.", + "type": "string" }, "content": { "description": "Content of the passage.", "$ref": "Content" } }, - "type": "object", - "id": "GroundingPassage" + "description": "Passage included inline with a grounding configuration." }, - "DiffUploadResponse": { - "id": "DiffUploadResponse", - "type": "object", - "description": "Backend response for a Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", + "VoiceConfig": { "properties": { - "originalObject": { - "description": "The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification.", - "$ref": "CompositeMedia" + "prebuiltVoiceConfig": { + "description": "The configuration for the prebuilt voice to use.", + "$ref": "PrebuiltVoiceConfig" + } + }, + "description": "The configuration for the voice to use.", + "id": "VoiceConfig", + "type": "object" + }, + "Web": { + "description": "Chunk from the web.", + "properties": { + "uri": { + "description": "Output only. URI reference of the chunk.", + "readOnly": true, + "type": "string" }, - "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.", + "title": { + "readOnly": true, + "type": "string", + "description": "Output only. Title of the chunk." + } + }, + "type": "object", + "id": "Web" + }, + "PredictRequest": { + "description": "Request message for PredictionService.Predict.", + "properties": { + "instances": { + "description": "Required. The instances that are the input to the prediction call.", + "items": { + "type": "any" + }, + "type": "array" + }, + "parameters": { + "description": "Optional. The parameters that govern the prediction call.", + "type": "any" + } + }, + "type": "object", + "id": "PredictRequest" + }, + "CreateFileResponse": { + "id": "CreateFileResponse", + "type": "object", + "properties": { + "file": { + "description": "Metadata for the created file.", + "$ref": "File" + } + }, + "description": "Response for `CreateFile`." + }, + "PrebuiltVoiceConfig": { + "type": "object", + "id": "PrebuiltVoiceConfig", + "description": "The configuration for the prebuilt speaker to use.", + "properties": { + "voiceName": { + "description": "The name of the preset voice to use.", "type": "string" } } }, "CustomLongRunningOperation": { - "type": "object", - "id": "CustomLongRunningOperation", "properties": { + "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" + }, "metadata": { - "type": "object", "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "type": "object" }, "error": { "description": "The error result of the operation in case of failure or cancellation.", "$ref": "Status" }, - "done": { - "type": "boolean", - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available." - }, "response": { "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", "additionalProperties": { @@ -4485,1803 +3832,2263 @@ }, "type": "object" }, - "name": { - "type": "string", - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`." + "done": { + "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", + "type": "boolean" } - } + }, + "type": "object", + "id": "CustomLongRunningOperation" }, - "GoogleSearch": { - "description": "GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", + "GroundingPassageId": { + "description": "Identifier for a part within a `GroundingPassage`.", "properties": { - "searchTypes": { - "description": "Optional. The set of search types to enable. If not set, web search is enabled by default.", - "$ref": "SearchTypes" + "passageId": { + "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.", + "readOnly": true, + "type": "string" }, - "timeRangeFilter": { - "description": "Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).", - "$ref": "Interval" + "partIndex": { + "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", + "format": "int32", + "readOnly": true, + "type": "integer" } }, - "id": "GoogleSearch", + "type": "object", + "id": "GroundingPassageId" + }, + "ToolConfig": { + "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", + "properties": { + "retrievalConfig": { + "description": "Optional. Retrieval config.", + "$ref": "RetrievalConfig" + }, + "includeServerSideToolInvocations": { + "description": "Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions.", + "type": "boolean" + }, + "functionCallingConfig": { + "description": "Optional. Function calling config.", + "$ref": "FunctionCallingConfig" + } + }, + "type": "object", + "id": "ToolConfig" + }, + "Status": { + "properties": { + "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" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use." + }, + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code." + } + }, + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", + "id": "Status", "type": "object" }, - "InputFeedback": { + "EmbedContentBatchOutput": { + "id": "EmbedContentBatchOutput", "type": "object", - "id": "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.", - "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "Input was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", - "Input was blocked due to other reasons." - ], - "enum": [ - "BLOCK_REASON_UNSPECIFIED", - "SAFETY", - "OTHER" - ] + "responsesFile": { + "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", + "readOnly": true, + "type": "string" }, - "safetyRatings": { - "description": "Ratings for safety of the input. There is at most one rating per category.", + "inlinedResponses": { + "readOnly": true, + "$ref": "InlinedEmbedContentResponses", + "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests." + } + }, + "description": "The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field." + }, + "CountTokensRequest": { + "type": "object", + "id": "CountTokensRequest", + "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", + "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": "SafetyRating" + "$ref": "Content" }, "type": "array" + }, + "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.", + "$ref": "GenerateContentRequest" } } }, - "RegisterFilesRequest": { - "description": "Request for `RegisterFiles`.", + "FileSearch": { + "id": "FileSearch", + "type": "object", "properties": { - "uris": { + "topK": { + "description": "Optional. The number of semantic retrieval chunks to retrieve.", + "format": "int32", + "type": "integer" + }, + "metadataFilter": { + "description": "Optional. Metadata filter to apply to the semantic retrieval documents and chunks.", + "type": "string" + }, + "fileSearchStoreNames": { "type": "array", - "description": "Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.", "items": { "type": "string" - } + }, + "description": "Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`" } }, + "description": "The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API." + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "properties": {}, "type": "object", - "id": "RegisterFilesRequest" + "id": "Empty" }, - "StringList": { - "description": "User provided string values assigned to a single metadata key.", + "RetrievalConfig": { "properties": { - "values": { - "description": "The string values of the metadata to store.", - "items": { - "type": "string" - }, - "type": "array" + "languageCode": { + "description": "Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).", + "type": "string" + }, + "latLng": { + "description": "Optional. The location of the user.", + "$ref": "LatLng" } }, - "type": "object", - "id": "StringList" + "description": "Retrieval config.", + "id": "RetrievalConfig", + "type": "object" }, - "ImageResponseFormat": { - "description": "Configuration for image output format.", + "CachedContentUsageMetadata": { "properties": { - "imageSize": { - "description": "Optional. The size of the image output.", - "type": "string", + "totalTokenCount": { + "description": "Total number of tokens that the cached content consumes.", + "format": "int32", + "type": "integer" + } + }, + "description": "Metadata on the usage of the cached content.", + "id": "CachedContentUsageMetadata", + "type": "object" + }, + "GenerateContentBatch": { + "properties": { + "state": { "enumDescriptions": [ - "Default value. This value is unused.", - "512px image size.", - "1K image size.", - "2K image size.", - "4K image size." + "The batch state is unspecified.", + "The service is preparing to run the batch.", + "The batch is in progress.", + "The batch completed successfully.", + "The batch failed.", + "The batch has been cancelled.", + "The batch has expired." ], "enum": [ - "IMAGE_SIZE_UNSPECIFIED", - "IMAGE_SIZE_FIVE_TWELVE", - "IMAGE_SIZE_ONE_K", - "IMAGE_SIZE_TWO_K", - "IMAGE_SIZE_FOUR_K" - ] - }, - "delivery": { - "description": "Optional. The delivery mode for the image output.", - "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "Image data is returned inline in the response.", - "Image data is returned as a URI." - ], - "enum": [ - "DELIVERY_UNSPECIFIED", - "INLINE", - "URI" - ] - }, - "mimeType": { - "description": "Optional. The MIME type of the image output.", - "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "JPEG image format." - ], - "enum": [ - "MIME_TYPE_UNSPECIFIED", - "IMAGE_JPEG" - ] - }, - "aspectRatio": { - "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "1:1 aspect ratio.", - "2:3 aspect ratio.", - "3:2 aspect ratio.", - "3:4 aspect ratio.", - "4:3 aspect ratio.", - "4:5 aspect ratio.", - "5:4 aspect ratio.", - "9:16 aspect ratio.", - "16:9 aspect ratio.", - "21:9 aspect ratio.", - "1:8 aspect ratio.", - "8:1 aspect ratio.", - "1:4 aspect ratio.", - "4:1 aspect ratio." - ], - "enum": [ - "ASPECT_RATIO_UNSPECIFIED", - "ASPECT_RATIO_ONE_BY_ONE", - "ASPECT_RATIO_TWO_BY_THREE", - "ASPECT_RATIO_THREE_BY_TWO", - "ASPECT_RATIO_THREE_BY_FOUR", - "ASPECT_RATIO_FOUR_BY_THREE", - "ASPECT_RATIO_FOUR_BY_FIVE", - "ASPECT_RATIO_FIVE_BY_FOUR", - "ASPECT_RATIO_NINE_BY_SIXTEEN", - "ASPECT_RATIO_SIXTEEN_BY_NINE", - "ASPECT_RATIO_TWENTY_ONE_BY_NINE", - "ASPECT_RATIO_ONE_BY_EIGHT", - "ASPECT_RATIO_EIGHT_BY_ONE", - "ASPECT_RATIO_ONE_BY_FOUR", - "ASPECT_RATIO_FOUR_BY_ONE" + "BATCH_STATE_UNSPECIFIED", + "BATCH_STATE_PENDING", + "BATCH_STATE_RUNNING", + "BATCH_STATE_SUCCEEDED", + "BATCH_STATE_FAILED", + "BATCH_STATE_CANCELLED", + "BATCH_STATE_EXPIRED" ], - "description": "Optional. The aspect ratio for the image output." - } - }, - "id": "ImageResponseFormat", - "type": "object" - }, - "UsageMetadata": { - "description": "Metadata on the generation request's token usage.", - "properties": { - "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.", - "type": "integer", - "format": "int32" - }, - "cacheTokensDetails": { - "type": "array", + "description": "Output only. The state of the batch.", "readOnly": true, - "description": "Output only. List of modalities of the cached content in the request input.", - "items": { - "$ref": "ModalityTokenCount" - } + "type": "string" }, - "totalTokenCount": { - "description": "Total token count for the generation request (prompt + thoughts + response candidates).", - "type": "integer", - "format": "int32" + "inputConfig": { + "description": "Required. Input configuration of the instances on which batch processing are performed.", + "$ref": "InputConfig" }, - "toolUsePromptTokensDetails": { - "type": "array", - "description": "Output only. List of modalities that were processed for tool-use request inputs.", - "items": { - "$ref": "ModalityTokenCount" - }, - "readOnly": true + "displayName": { + "description": "Required. The user-defined name of this batch.", + "type": "string" }, - "candidatesTokensDetails": { - "type": "array", - "description": "Output only. List of modalities that were returned in the response.", - "items": { - "$ref": "ModalityTokenCount" - }, - "readOnly": true + "createTime": { + "readOnly": true, + "type": "string", + "format": "google-datetime", + "description": "Output only. The time at which the batch was created." }, - "candidatesTokenCount": { - "type": "integer", - "format": "int32", - "description": "Total number of tokens across all the generated response candidates." + "priority": { + "format": "int64", + "type": "string", + "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0." }, - "cachedContentTokenCount": { - "type": "integer", - "format": "int32", - "description": "Number of tokens in the cached part of the prompt (the cached content)" + "batchStats": { + "description": "Output only. Stats about the batch.", + "readOnly": true, + "$ref": "BatchStats" }, - "serviceTier": { - "description": "Output only. Service tier of the request.", + "endTime": { + "description": "Output only. The time at which the batch processing completed.", + "readOnly": true, "type": "string", - "enum": [ - "unspecified", - "standard", - "flex", - "priority" - ], + "format": "google-datetime" + }, + "output": { + "description": "Output only. The output of the batch request.", "readOnly": true, - "enumDescriptions": [ - "Default service tier, which is standard.", - "Standard service tier.", - "Flex service tier.", - "Priority service tier." - ] + "$ref": "GenerateContentBatchOutput" }, - "thoughtsTokenCount": { - "type": "integer", - "format": "int32", + "updateTime": { + "format": "google-datetime", "readOnly": true, - "description": "Output only. Number of tokens of thoughts for thinking models." + "type": "string", + "description": "Output only. The time at which the batch was last updated." }, - "toolUsePromptTokenCount": { + "name": { "readOnly": true, - "description": "Output only. Number of tokens present in tool-use prompt(s).", - "type": "integer", - "format": "int32" + "type": "string", + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`." }, - "promptTokensDetails": { - "type": "array", - "description": "Output only. List of modalities that were processed in the request input.", - "items": { - "$ref": "ModalityTokenCount" - }, - "readOnly": true + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "type": "string" } }, - "type": "object", - "id": "UsageMetadata" + "description": "A resource representing a batch of `GenerateContent` requests.", + "id": "GenerateContentBatch", + "type": "object" }, - "GroundingPassages": { - "description": "A repeated list of passages.", + "InlinedRequest": { "properties": { - "passages": { - "description": "List of passages.", - "items": { - "$ref": "GroundingPassage" + "request": { + "description": "Required. The request to be processed in the batch.", + "$ref": "GenerateContentRequest" + }, + "metadata": { + "description": "Optional. The metadata to be associated with the request.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." }, - "type": "array" + "type": "object" } }, - "type": "object", - "id": "GroundingPassages" + "description": "The request to be processed in the batch.", + "id": "InlinedRequest", + "type": "object" }, - "InlinedEmbedContentResponses": { - "id": "InlinedEmbedContentResponses", - "type": "object", - "description": "The responses to the requests in the batch.", + "ListDocumentsResponse": { "properties": { - "inlinedResponses": { + "documents": { "type": "array", - "description": "Output only. The responses to the requests in the batch.", "items": { - "$ref": "InlinedEmbedContentResponse" + "$ref": "Document" }, - "readOnly": true - } - } - }, - "GoogleMaps": { - "description": "The GoogleMaps Tool that provides geospatial context for the user's query.", - "properties": { - "enableWidget": { - "description": "Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.", - "type": "boolean" + "description": "The returned `Document`s." + }, + "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", - "id": "GoogleMaps" + "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", + "id": "ListDocumentsResponse", + "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.", + "McpServer": { + "description": "A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6", "properties": { - "reason": { - "description": "The reason content was blocked during request processing.", - "type": "string", - "enumDescriptions": [ - "A blocked reason was not specified.", - "Content was blocked by safety settings.", - "Content was blocked, but the reason is uncategorized." - ], - "enum": [ - "BLOCKED_REASON_UNSPECIFIED", - "SAFETY", - "OTHER" - ] + "streamableHttpTransport": { + "description": "A transport that can stream HTTP requests and responses.", + "$ref": "StreamableHttpTransport" }, - "message": { - "description": "A string that describes the filtering behavior in more detail.", + "name": { + "description": "The name of the MCPServer.", "type": "string" } }, "type": "object", - "id": "ContentFilter" + "id": "McpServer" }, - "Image": { - "type": "object", - "id": "Image", - "description": "Chunk from image search.", + "GenerateTextResponse": { + "description": "The response from the model, including candidate completions.", "properties": { - "title": { - "description": "The title of the web page that the image is from.", - "type": "string" - }, - "imageUri": { - "type": "string", - "description": "The image asset URL." + "candidates": { + "type": "array", + "items": { + "$ref": "TextCompletion" + }, + "description": "Candidate responses from the model." }, - "domain": { - "description": "The root domain of the web page that the image is from, e.g. \"example.com\".", - "type": "string" + "filters": { + "items": { + "$ref": "ContentFilter" + }, + "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).", + "type": "array" }, - "sourceUri": { - "type": "string", - "description": "The web page URI for attribution." + "safetyFeedback": { + "type": "array", + "items": { + "$ref": "SafetyFeedback" + }, + "description": "Returns any safety feedback related to content filtering." } - } + }, + "type": "object", + "id": "GenerateTextResponse" }, "EmbeddingUsageMetadata": { - "description": "Metadata on the usage of the embedding request.", "properties": { "promptTokenCount": { - "type": "integer", - "format": "int32", + "description": "Output only. Number of tokens in the prompt.", "readOnly": true, - "description": "Output only. Number of tokens in the prompt." + "type": "integer", + "format": "int32" }, "promptTokenDetails": { "readOnly": true, + "type": "array", "description": "Output only. List of modalities that were processed in the request input.", "items": { "$ref": "ModalityTokenCount" - }, - "type": "array" + } } }, - "type": "object", - "id": "EmbeddingUsageMetadata" + "description": "Metadata on the usage of the embedding request.", + "id": "EmbeddingUsageMetadata", + "type": "object" }, - "ListCorporaResponse": { - "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", + "StreamableHttpTransport": { "properties": { - "corpora": { - "type": "array", - "description": "The returned corpora.", - "items": { - "$ref": "Corpus" + "url": { + "description": "The full URL for the MCPServer endpoint. Example: \"https://api.example.com/mcp\"", + "type": "string" + }, + "headers": { + "type": "object", + "description": "Optional: Fields for authentication headers, timeouts, etc., if needed.", + "additionalProperties": { + "type": "string" } }, - "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" + "timeout": { + "type": "string", + "format": "google-duration", + "description": "HTTP timeout for regular operations." + }, + "sseReadTimeout": { + "type": "string", + "format": "google-duration", + "description": "Timeout for SSE read operations." + }, + "terminateOnClose": { + "description": "Whether to close the client session when the transport closes.", + "type": "boolean" } }, - "type": "object", - "id": "ListCorporaResponse" - }, - "TransferOwnershipResponse": { - "description": "Response from `TransferOwnership`.", - "properties": {}, - "id": "TransferOwnershipResponse", + "description": "A transport that can stream HTTP requests and responses. Next ID: 6", + "id": "StreamableHttpTransport", "type": "object" }, - "CachedContentUsageMetadata": { - "description": "Metadata on the usage of the cached content.", + "GroundingPassages": { + "description": "A repeated list of passages.", "properties": { - "totalTokenCount": { - "description": "Total number of tokens that the cached content consumes.", - "type": "integer", - "format": "int32" + "passages": { + "type": "array", + "items": { + "$ref": "GroundingPassage" + }, + "description": "List of passages." } }, "type": "object", - "id": "CachedContentUsageMetadata" + "id": "GroundingPassages" }, - "ImageSearch": { - "id": "ImageSearch", + "EmbedTextResponse": { + "id": "EmbedTextResponse", "type": "object", - "description": "Image search for grounding and related configurations.", - "properties": {} - }, - "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": "EmbedContentRequest" - }, - "type": "array" + "embedding": { + "readOnly": true, + "$ref": "Embedding", + "description": "Output only. The embedding generated from the input text." } }, - "id": "BatchEmbedContentsRequest", - "type": "object" + "description": "The response to a EmbedTextRequest." }, - "InlinedResponses": { + "Message": { "type": "object", - "id": "InlinedResponses", - "description": "The responses to the requests in the batch.", + "id": "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": { - "inlinedResponses": { - "type": "array", - "description": "Output only. The responses to the requests in the batch.", - "items": { - "$ref": "InlinedResponse" - }, - "readOnly": true + "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, + "$ref": "CitationMetadata" + }, + "content": { + "description": "Required. The text content of the structured `Message`.", + "type": "string" + }, + "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" } } }, - "VideoMetadata": { - "deprecated": true, - "id": "VideoMetadata", + "CustomMetadata": { "type": "object", - "description": "Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content.", + "id": "CustomMetadata", + "description": "User provided metadata stored as key-value pairs.", "properties": { - "endOffset": { - "description": "Optional. The end offset of the video.", - "type": "string", - "format": "google-duration" + "stringListValue": { + "description": "The StringList value of the metadata to store.", + "$ref": "StringList" }, - "startOffset": { - "description": "Optional. The start offset of the video.", - "type": "string", - "format": "google-duration" + "stringValue": { + "description": "The string value of the metadata to store.", + "type": "string" }, - "fps": { + "numericValue": { + "description": "The numeric value of the metadata to store.", "type": "number", - "format": "double", - "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0]." + "format": "float" + }, + "key": { + "description": "Required. The key of the metadata to store.", + "type": "string" } } }, - "MessagePrompt": { - "id": "MessagePrompt", + "CodeExecution": { + "properties": {}, + "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.", + "id": "CodeExecution", + "type": "object" + }, + "Document": { "type": "object", - "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.", + "id": "Document", + "description": "A `Document` is a collection of `Chunk`s.", "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.", + "name": { + "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"fileSearchStores/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`", "type": "string" }, - "messages": { + "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" + }, + "customMetadata": { "type": "array", - "description": "Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.", + "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.", "items": { - "$ref": "Message" + "$ref": "CustomMetadata" } }, - "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": "Example" - }, - "type": "array" - } - } - }, - "FunctionCall": { - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", - "properties": { - "name": { - "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.", + "createTime": { + "readOnly": true, + "type": "string", + "format": "google-datetime", + "description": "Output only. The Timestamp of when the `Document` was created." + }, + "updateTime": { + "description": "Output only. The Timestamp of when the `Document` was last updated.", + "format": "google-datetime", + "readOnly": true, "type": "string" }, - "args": { - "type": "object", - "description": "Optional. The function parameters and values in JSON object format.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } + "mimeType": { + "description": "Output only. The mime type of the Document.", + "readOnly": true, + "type": "string" }, - "id": { - "description": "Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.", + "state": { + "enumDescriptions": [ + "The default value. This value is used if the state is omitted.", + "Some `Chunks` of the `Document` are being processed (embedding and vector storage).", + "All `Chunks` of the `Document` is processed and available for querying.", + "Some `Chunks` of the `Document` failed processing." + ], + "enum": [ + "STATE_UNSPECIFIED", + "STATE_PENDING", + "STATE_ACTIVE", + "STATE_FAILED" + ], + "description": "Output only. Current state of the `Document`.", + "readOnly": true, "type": "string" + }, + "sizeBytes": { + "format": "int64", + "readOnly": true, + "type": "string", + "description": "Output only. The size of raw bytes ingested into the Document." } - }, - "id": "FunctionCall", - "type": "object" + } }, - "GenerateMessageRequest": { - "id": "GenerateMessageRequest", - "type": "object", - "description": "Request to generate a message response from the model.", + "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. Next ID: 16", "properties": { - "topP": { - "type": "number", - "format": "float", - "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`." + "urlContext": { + "description": "Optional. Tool to support URL context retrieval.", + "$ref": "UrlContext" }, - "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.", - "type": "integer", - "format": "int32" + "mcpServers": { + "type": "array", + "items": { + "$ref": "McpServer" + }, + "description": "Optional. MCP Servers to connect to." }, - "candidateCount": { - "type": "integer", - "format": "int32", - "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`." + "computerUse": { + "description": "Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.", + "$ref": "ComputerUse" }, - "temperature": { - "type": "number", - "format": "float", - "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." + "googleSearchRetrieval": { + "description": "Optional. Retrieval tool that is powered by Google search.", + "$ref": "GoogleSearchRetrieval" }, - "prompt": { - "description": "Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.", - "$ref": "MessagePrompt" + "fileSearch": { + "description": "Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.", + "$ref": "FileSearch" + }, + "functionDeclarations": { + "type": "array", + "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn.", + "items": { + "$ref": "FunctionDeclaration" + } + }, + "googleSearch": { + "description": "Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", + "$ref": "GoogleSearch" + }, + "codeExecution": { + "description": "Optional. Enables the model to execute code as part of generation.", + "$ref": "CodeExecution" + }, + "googleMaps": { + "description": "Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.", + "$ref": "GoogleMaps" } - } - }, - "FunctionResponsePart": { + }, "type": "object", - "id": "FunctionResponsePart", - "description": "A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", - "properties": { - "inlineData": { - "description": "Inline media bytes.", - "$ref": "FunctionResponseBlob" - } - } + "id": "Tool" }, - "DiffChecksumsResponse": { - "description": "Backend response for a Diff get checksums response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", + "ImageConfig": { "properties": { - "objectLocation": { - "description": "If set, calculate the checksums based on the contents and return them to the caller.", - "$ref": "CompositeMedia" - }, - "objectVersion": { - "description": "The object version of the object the checksums are being returned for.", + "imageSize": { + "description": "Optional. Specifies the size of generated images. Supported values are `512`, `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`.", "type": "string" }, - "chunkSizeBytes": { - "type": "string", - "format": "int64", - "description": "The chunk size of checksums. Must be a multiple of 256KB." - }, - "checksumsLocation": { - "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.", - "$ref": "CompositeMedia" - }, - "objectSizeBytes": { - "description": "The total size of the server object.", - "type": "string", - "format": "int64" + "aspectRatio": { + "description": "Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, or `21:9`. If not specified, the model will choose a default aspect ratio based on any reference images provided.", + "type": "string" } }, - "id": "DiffChecksumsResponse", + "description": "Config for image generation features.", + "id": "ImageConfig", "type": "object" }, - "ComputerUse": { - "description": "Computer Use tool type.", + "BatchGenerateContentRequest": { + "description": "Request for a `BatchGenerateContent` operation.", "properties": { - "environment": { - "type": "string", - "enumDescriptions": [ - "Defaults to browser.", - "Operates in a web browser." - ], - "enum": [ - "ENVIRONMENT_UNSPECIFIED", - "ENVIRONMENT_BROWSER" - ], - "description": "Required. The environment being operated." + "batch": { + "description": "Required. The batch to create.", + "$ref": "GenerateContentBatch" + } + }, + "type": "object", + "id": "BatchGenerateContentRequest" + }, + "TunedModelSource": { + "description": "Tuned model as a source for training a new model.", + "properties": { + "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" }, - "excludedPredefinedFunctions": { - "description": "Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.", - "items": { - "type": "string" - }, - "type": "array" + "baseModel": { + "readOnly": true, + "type": "string", + "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`" } }, - "id": "ComputerUse", - "type": "object" + "type": "object", + "id": "TunedModelSource" }, - "MultiSpeakerVoiceConfig": { + "StringList": { "type": "object", - "id": "MultiSpeakerVoiceConfig", - "description": "The configuration for the multi-speaker setup.", + "id": "StringList", + "description": "User provided string values assigned to a single metadata key.", "properties": { - "speakerVoiceConfigs": { + "values": { "type": "array", - "description": "Required. All the enabled speaker voices.", "items": { - "$ref": "SpeakerVoiceConfig" - } + "type": "string" + }, + "description": "The string values of the metadata to store." } } }, - "ListPermissionsResponse": { - "type": "object", - "id": "ListPermissionsResponse", - "description": "Response from `ListPermissions` containing a paginated list of permissions.", + "EmbedContentResponse": { + "description": "The response to an `EmbedContentRequest`.", "properties": { - "permissions": { - "description": "Returned permissions.", - "items": { - "$ref": "Permission" - }, - "type": "array" + "usageMetadata": { + "readOnly": true, + "$ref": "EmbeddingUsageMetadata", + "description": "Output only. The usage metadata for the request." }, - "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" + "embedding": { + "readOnly": true, + "$ref": "ContentEmbedding", + "description": "Output only. The embedding generated from the input content." } - } + }, + "type": "object", + "id": "EmbedContentResponse" }, - "ModelStatus": { - "description": "The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.", + "DownloadFileResponse": { + "type": "object", + "id": "DownloadFileResponse", + "description": "Response for `DownloadFile`.", + "properties": {} + }, + "Image": { + "type": "object", + "id": "Image", + "description": "Chunk from image search.", "properties": { - "modelStage": { - "enumDescriptions": [ - "Unspecified model stage.", - "The underlying model is subject to lots of tunings.", - "Models in this stage are for experimental purposes only.", - "Models in this stage are more mature than experimental models.", - "Models in this stage are considered stable and ready for production use.", - "If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.", - "Models in this stage are deprecated. These models cannot be used.", - "Models in this stage are retired. These models cannot be used." - ], - "enumDeprecated": [ - false, - true, - false, - false, - false, - false, - true, - false - ], - "description": "The stage of the underlying model.", - "type": "string", - "enum": [ - "MODEL_STAGE_UNSPECIFIED", - "UNSTABLE_EXPERIMENTAL", - "EXPERIMENTAL", - "PREVIEW", - "STABLE", - "LEGACY", - "DEPRECATED", - "RETIRED" - ] + "sourceUri": { + "description": "The web page URI for attribution.", + "type": "string" }, - "retirementTime": { - "description": "The time at which the model will be retired.", - "type": "string", - "format": "google-datetime" + "domain": { + "description": "The root domain of the web page that the image is from, e.g. \"example.com\".", + "type": "string" }, - "message": { - "description": "A message explaining the model status.", + "title": { + "description": "The title of the web page that the image is from.", + "type": "string" + }, + "imageUri": { + "description": "The image asset URL.", "type": "string" } - }, - "type": "object", - "id": "ModelStatus" + } }, - "LogprobsResult": { - "description": "Logprobs Result", + "PlaceAnswerSources": { "properties": { - "logProbabilitySum": { - "type": "number", - "format": "float", - "description": "Sum of log probabilities for all tokens." - }, - "topCandidates": { + "reviewSnippets": { "type": "array", - "description": "Length = total number of decoding steps.", + "description": "Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.", "items": { - "$ref": "TopCandidates" + "$ref": "ReviewSnippet" } - }, - "chosenCandidates": { - "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.", - "items": { - "$ref": "LogprobsResultCandidate" - }, - "type": "array" } }, - "id": "LogprobsResult", + "description": "Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: \"does Bar Foo have Wifi\" or \"is Foo Bar wheelchair accessible?\"). Currently we only support review snippets as sources.", + "id": "PlaceAnswerSources", "type": "object" }, - "FunctionResponseBlob": { - "description": "Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.", + "DiffDownloadResponse": { + "id": "DiffDownloadResponse", + "type": "object", "properties": { - "mimeType": { - "type": "string", - "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)." - }, - "data": { - "description": "Raw bytes for media formats.", - "type": "string", - "format": "byte" + "objectLocation": { + "description": "The original object location.", + "$ref": "CompositeMedia" } }, + "description": "Backend response for a Diff download response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol." + }, + "ChunkingConfig": { "type": "object", - "id": "FunctionResponseBlob" + "id": "ChunkingConfig", + "description": "Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto", + "properties": { + "whiteSpaceConfig": { + "description": "White space chunking configuration.", + "$ref": "WhiteSpaceConfig" + } + } }, - "Blobstore2Info": { - "description": "Information to read/write to blobstore2.", + "VideoMetadata": { + "type": "object", + "deprecated": true, + "id": "VideoMetadata", + "description": "Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content.", "properties": { - "blobId": { + "endOffset": { + "description": "Optional. The end offset of the video.", "type": "string", - "description": "The blob id, e.g., /blobstore/prod/playground/scotty" + "format": "google-duration" }, - "downloadExternalReadToken": { - "description": "A serialized External Read Token passed from Bigstore -\u003e Scotty for a GCS download. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", + "startOffset": { "type": "string", - "format": "byte" + "format": "google-duration", + "description": "Optional. The start offset of the video." }, - "downloadReadHandle": { - "type": "string", - "format": "byte", - "description": "Read handle passed from Bigstore -\u003e 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." + "fps": { + "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].", + "format": "double", + "type": "number" + } + } + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "properties": { + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, - "blobGeneration": { - "type": "string", - "format": "int64", - "description": "The blob generation id." + "response": { + "type": "object", + "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } }, - "uploadMetadataContainer": { - "description": "Metadata passed from Blobstore -\u003e 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.", - "type": "string", - "format": "byte" + "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" }, - "uploadFragmentListCreationInfo": { + "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" + }, + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "type": "object" + } + }, + "type": "object", + "id": "Operation" + }, + "EmbedContentRequest": { + "description": "Request containing the `Content` for the model to embed.", + "properties": { + "outputDimensionality": { + "type": "integer", + "format": "int32", + "description": "Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. 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`).", + "deprecated": true + }, + "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" + }, + "taskType": { + "enumDescriptions": [ + "Unset value, which will default to one of the other enum values.", + "Specifies the given text is a query in a search/retrieval setting.", + "Specifies the given text is a document from the corpus being searched.", + "Specifies the given text will be used for STS.", + "Specifies that the given text will be classified.", + "Specifies that the embeddings will be used for clustering.", + "Specifies that the given text will be used for question answering.", + "Specifies that the given text will be used for fact verification.", + "Specifies that the given text will be used for code retrieval." + ], + "enum": [ + "TASK_TYPE_UNSPECIFIED", + "RETRIEVAL_QUERY", + "RETRIEVAL_DOCUMENT", + "SEMANTIC_SIMILARITY", + "CLASSIFICATION", + "CLUSTERING", + "QUESTION_ANSWERING", + "FACT_VERIFICATION", + "CODE_RETRIEVAL_QUERY" + ], + "description": "Optional. Deprecated: Please use EmbedContentConfig.task_type instead. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`).", "type": "string", - "format": "byte", - "description": "A serialized Object Fragment List Creation Info passed from Bigstore -\u003e Scotty for a GCS upload. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads." + "deprecated": true }, - "readToken": { - "description": "The blob read token. Needed to read blobs that have not been replicated. Might not be available until the final call.", + "title": { + "deprecated": true, + "description": "Optional. Deprecated: Please use EmbedContentConfig.title instead. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval.", "type": "string" + }, + "content": { + "description": "Required. The content to embed. Only the `parts.text` fields will be counted.", + "$ref": "Content" + }, + "embedContentConfig": { + "description": "Optional. Configuration for the EmbedContent request.", + "$ref": "EmbedContentConfig" } }, - "id": "Blobstore2Info", - "type": "object" + "type": "object", + "id": "EmbedContentRequest" }, - "ListTunedModelsResponse": { - "id": "ListTunedModelsResponse", + "SearchTypes": { + "description": "Different types of search that can be enabled on the GoogleSearch tool.", + "properties": { + "webSearch": { + "description": "Optional. Enables web search. Only text results are returned.", + "$ref": "WebSearch" + }, + "imageSearch": { + "description": "Optional. Enables image search. Image bytes are returned.", + "$ref": "ImageSearch" + } + }, + "type": "object", + "id": "SearchTypes" + }, + "PredictResponse": { "type": "object", - "description": "Response from `ListTunedModels` containing a paginated list of Models.", + "id": "PredictResponse", + "description": "Response message for [PredictionService.Predict].", "properties": { - "tunedModels": { - "description": "The returned Models.", + "predictions": { + "type": "array", "items": { - "$ref": "TunedModel" + "type": "any" }, - "type": "array" + "description": "The outputs of the prediction call." + } + } + }, + "ListPermissionsResponse": { + "description": "Response from `ListPermissions` containing a paginated list of permissions.", + "properties": { + "permissions": { + "type": "array", + "items": { + "$ref": "Permission" + }, + "description": "Returned permissions." }, "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", + "id": "ListPermissionsResponse" }, - "PromptFeedback": { - "id": "PromptFeedback", + "RealtimeInputConfig": { "type": "object", - "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", + "id": "RealtimeInputConfig", + "description": "Configures the realtime input behavior in `BidiGenerateContent`.", "properties": { - "blockReason": { + "automaticActivityDetection": { + "description": "Optional. If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals.", + "$ref": "AutomaticActivityDetection" + }, + "activityHandling": { "type": "string", "enumDescriptions": [ - "Default value. This value is unused.", - "Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", - "Prompt was blocked due to unknown reasons.", - "Prompt was blocked due to the terms which are included from the terminology blocklist.", - "Prompt was blocked due to prohibited content.", - "Candidates blocked due to unsafe image generation content." + "If unspecified, the default behavior is `START_OF_ACTIVITY_INTERRUPTS`.", + "If true, start of activity will interrupt the model's response (also called \"barge in\"). The model's current response will be cut-off in the moment of the interruption. This is the default behavior.", + "The model's response will not be interrupted." ], "enum": [ - "BLOCK_REASON_UNSPECIFIED", - "SAFETY", - "OTHER", - "BLOCKLIST", - "PROHIBITED_CONTENT", - "IMAGE_SAFETY" + "ACTIVITY_HANDLING_UNSPECIFIED", + "START_OF_ACTIVITY_INTERRUPTS", + "NO_INTERRUPTION" ], - "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt." + "description": "Optional. Defines what effect activity has." }, - "safetyRatings": { - "type": "array", - "description": "Ratings for safety of the prompt. There is at most one rating per category.", - "items": { - "$ref": "SafetyRating" - } + "turnCoverage": { + "type": "string", + "enumDescriptions": [ + "If unspecified, a default behavior is selected based on the model. E.g., for Gemini 2.5, the default is `TURN_INCLUDES_ONLY_ACTIVITY`, while for Gemini 3.1 and onwards, it's `TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO`.", + "Includes activity since the last turn, excluding inactivity (e.g. silence on the audio stream).", + "Includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).", + "Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence." + ], + "enum": [ + "TURN_COVERAGE_UNSPECIFIED", + "TURN_INCLUDES_ONLY_ACTIVITY", + "TURN_INCLUDES_ALL_INPUT", + "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO" + ], + "description": "Optional. Defines which input is included in the user's turn." } } }, - "GenerateTextResponse": { - "id": "GenerateTextResponse", + "ListFileSearchStoresResponse": { + "id": "ListFileSearchStoresResponse", "type": "object", - "description": "The response from the model, including candidate completions.", "properties": { - "candidates": { - "description": "Candidate responses from the model.", - "items": { - "$ref": "TextCompletion" - }, - "type": "array" - }, - "safetyFeedback": { - "type": "array", - "description": "Returns any safety feedback related to content filtering.", - "items": { - "$ref": "SafetyFeedback" - } - }, - "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).", + "fileSearchStores": { "items": { - "$ref": "ContentFilter" + "$ref": "FileSearchStore" }, + "description": "The returned rag_stores.", "type": "array" - } - } - }, - "EmbedContentBatchOutput": { - "description": "The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.", - "properties": { - "inlinedResponses": { - "readOnly": true, - "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", - "$ref": "InlinedEmbedContentResponses" }, - "responsesFile": { - "readOnly": true, - "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", + "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" } }, - "id": "EmbedContentBatchOutput", - "type": "object" + "description": "Response from `ListFileSearchStores` containing a paginated list of `FileSearchStores`. The results are sorted by ascending `file_search_store.create_time`." }, - "ReviewSnippet": { - "description": "Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.", + "AutomaticActivityDetection": { + "id": "AutomaticActivityDetection", + "type": "object", "properties": { - "reviewId": { - "type": "string", - "description": "The ID of the review snippet." + "disabled": { + "description": "Optional. If enabled (the default), detected voice and text input count as activity. If disabled, the client must send activity signals.", + "type": "boolean" }, - "googleMapsUri": { - "description": "A link that corresponds to the user review on Google Maps.", + "prefixPaddingMs": { + "type": "integer", + "format": "int32", + "description": "Optional. The required duration of detected speech before start-of-speech is committed. The lower this value, the more sensitive the start-of-speech detection is and shorter speech can be recognized. However, this also increases the probability of false positives." + }, + "endOfSpeechSensitivity": { + "enumDescriptions": [ + "The default is END_SENSITIVITY_HIGH.", + "Automatic detection ends speech more often.", + "Automatic detection ends speech less often." + ], + "enum": [ + "END_SENSITIVITY_UNSPECIFIED", + "END_SENSITIVITY_HIGH", + "END_SENSITIVITY_LOW" + ], + "description": "Optional. Determines how likely detected speech is ended.", "type": "string" }, - "title": { - "type": "string", - "description": "Title of the review." - } - }, - "id": "ReviewSnippet", - "type": "object" - }, - "DynamicRetrievalConfig": { - "id": "DynamicRetrievalConfig", - "type": "object", - "description": "Describes the options to customize dynamic retrieval.", - "properties": { - "mode": { - "description": "The mode of the predictor to be used in dynamic retrieval.", + "startOfSpeechSensitivity": { "type": "string", "enumDescriptions": [ - "Always trigger retrieval.", - "Run retrieval only when system decides it is necessary." + "The default is START_SENSITIVITY_HIGH.", + "Automatic detection will detect the start of speech more often.", + "Automatic detection will detect the start of speech less often." ], "enum": [ - "MODE_UNSPECIFIED", - "MODE_DYNAMIC" - ] + "START_SENSITIVITY_UNSPECIFIED", + "START_SENSITIVITY_HIGH", + "START_SENSITIVITY_LOW" + ], + "description": "Optional. Determines how likely speech is to be detected." }, - "dynamicThreshold": { - "description": "The threshold to be used in dynamic retrieval. If not set, a system default value is used.", - "type": "number", - "format": "float" + "silenceDurationMs": { + "description": "Optional. The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.", + "type": "integer", + "format": "int32" } - } + }, + "description": "Configures automatic detection of activity." }, - "EmbedContentResponse": { - "description": "The response to an `EmbedContentRequest`.", + "PredictLongRunningRequest": { "properties": { - "embedding": { - "readOnly": true, - "description": "Output only. The embedding generated from the input content.", - "$ref": "ContentEmbedding" + "instances": { + "type": "array", + "description": "Required. The instances that are the input to the prediction call.", + "items": { + "type": "any" + } }, - "usageMetadata": { - "description": "Output only. The usage metadata for the request.", - "$ref": "EmbeddingUsageMetadata", - "readOnly": true + "parameters": { + "description": "Optional. The parameters that govern the prediction call.", + "type": "any" } }, + "description": "Request message for [PredictionService.PredictLongRunning].", + "id": "PredictLongRunningRequest", + "type": "object" + }, + "CountTokensResponse": { + "id": "CountTokensResponse", "type": "object", - "id": "EmbedContentResponse" + "properties": { + "cachedContentTokenCount": { + "description": "Number of tokens in the cached part of the prompt (the cached content).", + "type": "integer", + "format": "int32" + }, + "totalTokens": { + "type": "integer", + "format": "int32", + "description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative." + }, + "promptTokensDetails": { + "readOnly": true, + "type": "array", + "description": "Output only. List of modalities that were processed in the request input.", + "items": { + "$ref": "ModalityTokenCount" + } + }, + "cacheTokensDetails": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "ModalityTokenCount" + }, + "description": "Output only. List of modalities that were processed in the cached content." + } + }, + "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`." }, - "SafetySetting": { - "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.", + "Interval": { "properties": { - "category": { + "startTime": { + "format": "google-datetime", "type": "string", - "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT", - "HARM_CATEGORY_CIVIC_INTEGRITY" - ], - "description": "Required. The category for this setting.", - "enumDescriptions": [ - "Category is unspecified.", - "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", - "**PaLM** - Content that is rude, disrespectful, or profane.", - "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", - "**PaLM** - Contains references to sexual acts or other lewd content.", - "**PaLM** - Promotes unchecked medical advice.", - "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", - "**Gemini** - Harassment content.", - "**Gemini** - Hate speech and content.", - "**Gemini** - Sexually explicit content.", - "**Gemini** - Dangerous content.", - "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true - ] + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start." }, - "threshold": { - "description": "Required. Controls the probability threshold at which harm is blocked.", + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", "type": "string", - "enumDescriptions": [ - "Threshold is unspecified.", - "Content with NEGLIGIBLE will be allowed.", - "Content with NEGLIGIBLE and LOW will be allowed.", - "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.", - "All content will be allowed.", - "Turn off the safety filter." - ], - "enum": [ - "HARM_BLOCK_THRESHOLD_UNSPECIFIED", - "BLOCK_LOW_AND_ABOVE", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_ONLY_HIGH", - "BLOCK_NONE", - "OFF" - ] + "format": "google-datetime" } }, - "id": "SafetySetting", + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "id": "Interval", "type": "object" }, - "BatchGenerateContentRequest": { - "id": "BatchGenerateContentRequest", - "type": "object", - "description": "Request for a `BatchGenerateContent` operation.", + "SearchEntryPoint": { "properties": { - "batch": { - "description": "Required. The batch to create.", - "$ref": "GenerateContentBatch" + "sdkBlob": { + "description": "Optional. Base64 encoded JSON representing array of tuple.", + "type": "string", + "format": "byte" + }, + "renderedContent": { + "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.", + "type": "string" } - } + }, + "description": "Google search entry point.", + "id": "SearchEntryPoint", + "type": "object" }, - "RetrievedContext": { - "type": "object", - "id": "RetrievedContext", - "description": "Chunk from context retrieved by the file search tool.", + "TuningTask": { "properties": { - "uri": { - "type": "string", - "description": "Optional. URI reference of the semantic retrieval document." - }, - "customMetadata": { + "snapshots": { + "readOnly": true, "type": "array", - "description": "Optional. User-provided metadata about the retrieved context.", "items": { - "$ref": "GroundingChunkCustomMetadata" - } - }, - "pageNumber": { - "type": "integer", - "format": "int32", - "description": "Optional. Page number of the retrieved context, if applicable." + "$ref": "TuningSnapshot" + }, + "description": "Output only. Metrics collected during tuning." }, - "fileSearchStore": { + "completeTime": { + "format": "google-datetime", + "readOnly": true, "type": "string", - "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`" + "description": "Output only. The timestamp when tuning this model completed." }, - "title": { - "description": "Optional. Title of the document.", - "type": "string" + "hyperparameters": { + "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.", + "$ref": "Hyperparameters" }, - "text": { + "startTime": { + "description": "Output only. The timestamp when tuning this model started.", + "readOnly": true, "type": "string", - "description": "Optional. Text of the chunk." + "format": "google-datetime" }, - "mediaId": { - "description": "Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}", - "type": "string" + "trainingData": { + "description": "Required. Input only. Immutable. The model training data.", + "$ref": "Dataset" } - } + }, + "description": "Tuning tasks that create tuned models.", + "id": "TuningTask", + "type": "object" }, - "PredictRequest": { - "type": "object", - "id": "PredictRequest", - "description": "Request message for PredictionService.Predict.", + "InlinedRequests": { + "description": "The requests to be processed in the batch if provided as part of the batch creation request.", "properties": { - "instances": { - "type": "array", - "description": "Required. The instances that are the input to the prediction call.", + "requests": { + "description": "Required. The requests to be processed in the batch.", "items": { - "type": "any" - } - }, - "parameters": { - "type": "any", - "description": "Optional. The parameters that govern the prediction call." + "$ref": "InlinedRequest" + }, + "type": "array" } - } - } - }, - "version_module": true, - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/devstorage.read_only": { - "description": "View your data in Google Cloud Storage" + }, + "type": "object", + "id": "InlinedRequests" + }, + "ContextWindowCompressionConfig": { + "type": "object", + "id": "ContextWindowCompressionConfig", + "description": "Enables context window compression — a mechanism for managing the model's context window so that it does not exceed a given length.", + "properties": { + "slidingWindow": { + "description": "A sliding-window mechanism.", + "$ref": "SlidingWindow" + }, + "triggerTokens": { + "format": "int64", + "type": "string", + "description": "The number of tokens (before running a turn) required to trigger a context window compression. This can be used to balance quality against latency as shorter context windows may result in faster model responses. However, any compression operation will cause a temporary latency increase, so they should not be triggered frequently. If not set, the default is 80% of the model's context window limit. This leaves 20% for the next user request/model response." } } - } - }, - "revision": "20260611", - "resources": { - "cachedContents": { - "methods": { - "get": { - "path": "v1beta/{+name}", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`", - "pattern": "^cachedContents/[^/]+$" - } - }, - "description": "Reads CachedContent resource.", - "id": "generativelanguage.cachedContents.get", - "httpMethod": "GET", - "response": { - "$ref": "CachedContent" - }, - "parameterOrder": [ - "name" - ], - "flatPath": "v1beta/cachedContents/{cachedContentsId}", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ] + }, + "GenerateMessageRequest": { + "description": "Request to generate a message response from the model.", + "properties": { + "topP": { + "type": "number", + "format": "float", + "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`." }, - "delete": { - "path": "v1beta/{+name}", - "parameters": { - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`", - "pattern": "^cachedContents/[^/]+$" - } - }, - "description": "Deletes CachedContent resource.", - "id": "generativelanguage.cachedContents.delete", - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "flatPath": "v1beta/cachedContents/{cachedContentsId}", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ] + "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.", + "type": "integer", + "format": "int32" }, - "create": { - "parameters": {}, - "description": "Creates CachedContent resource.", - "id": "generativelanguage.cachedContents.create", - "request": { - "$ref": "CachedContent" - }, - "path": "v1beta/cachedContents", - "flatPath": "v1beta/cachedContents", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "response": { - "$ref": "CachedContent" - }, - "httpMethod": "POST", - "parameterOrder": [] + "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.", + "type": "number", + "format": "float" }, - "patch": { - "flatPath": "v1beta/cachedContents/{cachedContentsId}", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "httpMethod": "PATCH", - "response": { - "$ref": "CachedContent" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "updateMask": { - "location": "query", - "type": "string", - "format": "google-fieldmask", - "description": "The list of fields to update." - }, - "name": { - "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", - "pattern": "^cachedContents/[^/]+$", - "location": "path", - "required": true, - "type": "string" - } - }, - "description": "Updates CachedContent resource (only expiration is updatable).", - "request": { - "$ref": "CachedContent" + "prompt": { + "description": "Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.", + "$ref": "MessagePrompt" + }, + "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" + } + }, + "type": "object", + "id": "GenerateMessageRequest" + }, + "GroundingChunkStringList": { + "id": "GroundingChunkStringList", + "type": "object", + "properties": { + "values": { + "items": { + "type": "string" }, - "id": "generativelanguage.cachedContents.patch", - "path": "v1beta/{+name}" + "description": "The string values of the list.", + "type": "array" + } + }, + "description": "A list of string values." + }, + "CountTextTokensRequest": { + "id": "CountTextTokensRequest", + "type": "object", + "properties": { + "prompt": { + "description": "Required. The free-form input text given to the model as a prompt.", + "$ref": "TextPrompt" + } + }, + "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`." + }, + "LanguageAuto": { + "properties": {}, + "description": "Indicates the language of the audio should be automatically detected.", + "id": "LanguageAuto", + "type": "object" + }, + "Condition": { + "type": "object", + "id": "Condition", + "description": "Filter condition applicable to a single key.", + "properties": { + "stringValue": { + "description": "The string value to filter the metadata on.", + "type": "string" }, - "list": { - "flatPath": "v1beta/cachedContents", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" + "numericValue": { + "type": "number", + "format": "float", + "description": "The numeric value to filter the metadata on." + }, + "operation": { + "enumDescriptions": [ + "The default value. This value is unused.", + "Supported by numeric.", + "Supported by numeric.", + "Supported by numeric & string.", + "Supported by numeric.", + "Supported by numeric.", + "Supported by numeric & string.", + "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.", + "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`." ], - "httpMethod": "GET", - "response": { - "$ref": "ListCachedContentsResponse" - }, - "parameterOrder": [], - "parameters": { - "pageSize": { - "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.", - "type": "integer", - "format": "int32", - "location": "query" - }, - "pageToken": { - "location": "query", - "type": "string", - "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." - } - }, - "description": "Lists CachedContents.", - "id": "generativelanguage.cachedContents.list", - "path": "v1beta/cachedContents" + "enum": [ + "OPERATOR_UNSPECIFIED", + "LESS", + "LESS_EQUAL", + "EQUAL", + "GREATER_EQUAL", + "GREATER", + "NOT_EQUAL", + "INCLUDES", + "EXCLUDES" + ], + "description": "Required. Operator applied to the given key-value pair to trigger the condition.", + "type": "string" } } }, - "tunedModels": { - "methods": { - "delete": { - "parameters": { - "name": { - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "location": "path", - "required": true - } - }, - "description": "Deletes a tuned model.", - "id": "generativelanguage.tunedModels.delete", - "flatPath": "v1beta/tunedModels/{tunedModelsId}", - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ] + "DiffUploadResponse": { + "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" }, - "create": { - "flatPath": "v1beta/tunedModels", - "parameterOrder": [], - "response": { - "$ref": "Operation" - }, - "httpMethod": "POST", - "id": "generativelanguage.tunedModels.create", - "request": { - "$ref": "TunedModel" - }, - "parameters": { - "tunedModelId": { - "location": "query", - "type": "string", - "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])?`." - } - }, - "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", - "path": "v1beta/tunedModels" + "originalObject": { + "description": "The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification.", + "$ref": "CompositeMedia" + } + }, + "description": "Backend response for a Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", + "id": "DiffUploadResponse", + "type": "object" + }, + "ModelStatus": { + "description": "The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.", + "properties": { + "retirementTime": { + "format": "google-datetime", + "type": "string", + "description": "The time at which the model will be retired." }, - "transferOwnership": { - "parameters": { - "name": { - "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "location": "path", - "required": true - } - }, - "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.", - "request": { - "$ref": "TransferOwnershipRequest" - }, - "id": "generativelanguage.tunedModels.transferOwnership", - "path": "v1beta/{+name}:transferOwnership", - "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership", - "httpMethod": "POST", - "response": { - "$ref": "TransferOwnershipResponse" - }, - "parameterOrder": [ - "name" + "modelStage": { + "description": "The stage of the underlying model.", + "enumDescriptions": [ + "Unspecified model stage.", + "The underlying model is subject to lots of tunings.", + "Models in this stage are for experimental purposes only.", + "Models in this stage are more mature than experimental models.", + "Models in this stage are considered stable and ready for production use.", + "If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.", + "Models in this stage are deprecated. These models cannot be used.", + "Models in this stage are retired. These models cannot be used." + ], + "enum": [ + "MODEL_STAGE_UNSPECIFIED", + "UNSTABLE_EXPERIMENTAL", + "EXPERIMENTAL", + "PREVIEW", + "STABLE", + "LEGACY", + "DEPRECATED", + "RETIRED" + ], + "type": "string", + "enumDeprecated": [ + false, + true, + false, + false, + false, + false, + true, + false ] }, - "patch": { - "parameterOrder": [ - "name" - ], - "httpMethod": "PATCH", - "response": { - "$ref": "TunedModel" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}", - "path": "v1beta/{+name}", - "request": { - "$ref": "TunedModel" - }, - "id": "generativelanguage.tunedModels.patch", - "parameters": { - "updateMask": { - "description": "Optional. The list of fields to update.", - "location": "query", - "type": "string", - "format": "google-fieldmask" - }, - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", - "pattern": "^tunedModels/[^/]+$" - } + "message": { + "description": "A message explaining the model status.", + "type": "string" + } + }, + "type": "object", + "id": "ModelStatus" + }, + "Dataset": { + "properties": { + "examples": { + "description": "Optional. Inline examples with simple input/output text.", + "$ref": "TuningExamples" + } + }, + "description": "Dataset for training or validation.", + "id": "Dataset", + "type": "object" + }, + "Embedding": { + "properties": { + "value": { + "description": "The embedding values.", + "items": { + "type": "number", + "format": "float" }, - "description": "Updates a tuned model." + "type": "array" + } + }, + "description": "A list of floats representing the embedding.", + "id": "Embedding", + "type": "object" + }, + "EmbedContentConfig": { + "id": "EmbedContentConfig", + "type": "object", + "properties": { + "title": { + "description": "Optional. The title for the text.", + "type": "string" }, - "streamGenerateContent": { - "httpMethod": "POST", - "response": { - "$ref": "GenerateContentResponse" - }, - "parameterOrder": [ - "model" + "taskType": { + "enumDescriptions": [ + "Unset value, which will default to one of the other enum values.", + "Specifies the given text is a query in a search/retrieval setting.", + "Specifies the given text is a document from the corpus being searched.", + "Specifies the given text will be used for STS.", + "Specifies that the given text will be classified.", + "Specifies that the embeddings will be used for clustering.", + "Specifies that the given text will be used for question answering.", + "Specifies that the given text will be used for fact verification.", + "Specifies that the given text will be used for code retrieval." ], - "flatPath": "v1beta/tunedModels/{tunedModelsId}:streamGenerateContent", - "path": "v1beta/{+model}:streamGenerateContent", - "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "location": "path", - "required": true - } - }, - "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`.", - "request": { - "$ref": "GenerateContentRequest" - }, - "id": "generativelanguage.tunedModels.streamGenerateContent" - }, - "asyncBatchEmbedContent": { - "flatPath": "v1beta/tunedModels/{tunedModelsId}:asyncBatchEmbedContent", - "httpMethod": "POST", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "model" + "enum": [ + "TASK_TYPE_UNSPECIFIED", + "RETRIEVAL_QUERY", + "RETRIEVAL_DOCUMENT", + "SEMANTIC_SIMILARITY", + "CLASSIFICATION", + "CLUSTERING", + "QUESTION_ANSWERING", + "FACT_VERIFICATION", + "CODE_RETRIEVAL_QUERY" ], - "parameters": { - "model": { - "type": "string", - "location": "path", - "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^tunedModels/[^/]+$" - } - }, - "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", - "request": { - "$ref": "AsyncBatchEmbedContentRequest" - }, - "id": "generativelanguage.tunedModels.asyncBatchEmbedContent", - "path": "v1beta/{+model}:asyncBatchEmbedContent" + "description": "Optional. The task type of the embedding.", + "type": "string" }, - "get": { - "id": "generativelanguage.tunedModels.get", - "flatPath": "v1beta/tunedModels/{tunedModelsId}", - "parameters": { - "name": { - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "location": "path", - "required": true - } - }, - "description": "Gets information about a specific TunedModel.", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "TunedModel" - }, - "httpMethod": "GET" + "autoTruncate": { + "description": "Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length.", + "type": "boolean" }, - "generateContent": { - "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent", - "parameterOrder": [ - "model" - ], - "httpMethod": "POST", - "response": { - "$ref": "GenerateContentResponse" - }, - "request": { - "$ref": "GenerateContentRequest" - }, - "id": "generativelanguage.tunedModels.generateContent", - "parameters": { - "model": { - "type": "string", - "location": "path", - "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^tunedModels/[^/]+$" - } - }, - "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.", - "path": "v1beta/{+model}:generateContent" + "audioTrackExtraction": { + "description": "Optional. Whether to extract audio from video content.", + "type": "boolean" }, - "generateText": { - "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText", - "response": { - "$ref": "GenerateTextResponse" - }, - "httpMethod": "POST", - "parameterOrder": [ - "model" - ], - "parameters": { - "model": { - "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", - "pattern": "^tunedModels/[^/]+$", - "location": "path", - "required": true, - "type": "string" - } - }, - "description": "Generates a response from the model given an input message.", - "id": "generativelanguage.tunedModels.generateText", - "request": { - "$ref": "GenerateTextRequest" - }, - "path": "v1beta/{+model}:generateText" + "outputDimensionality": { + "type": "integer", + "format": "int32", + "description": "Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end." }, - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListTunedModelsResponse" - }, - "path": "v1beta/tunedModels", - "parameterOrder": [], - "parameters": { - "pageSize": { - "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.", - "type": "integer", - "format": "int32", - "location": "query" - }, - "pageToken": { - "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "filter": { - "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone", - "location": "query", - "type": "string" - } + "documentOcr": { + "description": "Optional. Whether to enable OCR for document content.", + "type": "boolean" + } + }, + "description": "Configurations for the EmbedContent request." + }, + "GoogleSearch": { + "type": "object", + "id": "GoogleSearch", + "description": "GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", + "properties": { + "timeRangeFilter": { + "description": "Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).", + "$ref": "Interval" + }, + "searchTypes": { + "description": "Optional. The set of search types to enable. If not set, web search is enabled by default.", + "$ref": "SearchTypes" + } + } + }, + "ModalityTokenCount": { + "properties": { + "tokenCount": { + "description": "Number of tokens.", + "format": "int32", + "type": "integer" + }, + "modality": { + "enumDescriptions": [ + "Unspecified modality.", + "Plain text.", + "Image.", + "Video.", + "Audio.", + "Document, e.g. PDF." + ], + "enum": [ + "MODALITY_UNSPECIFIED", + "TEXT", + "IMAGE", + "VIDEO", + "AUDIO", + "DOCUMENT" + ], + "description": "The modality associated with this token count.", + "type": "string" + } + }, + "description": "Represents token counting info for a single modality.", + "id": "ModalityTokenCount", + "type": "object" + }, + "DiffChecksumsResponse": { + "properties": { + "objectLocation": { + "description": "If set, calculate the checksums based on the contents and return them to the caller.", + "$ref": "CompositeMedia" + }, + "objectVersion": { + "description": "The object version of the object the checksums are being returned for.", + "type": "string" + }, + "objectSizeBytes": { + "format": "int64", + "type": "string", + "description": "The total size of the server object." + }, + "checksumsLocation": { + "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.", + "$ref": "CompositeMedia" + }, + "chunkSizeBytes": { + "type": "string", + "format": "int64", + "description": "The chunk size of checksums. Must be a multiple of 256KB." + } + }, + "description": "Backend response for a Diff get checksums response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", + "id": "DiffChecksumsResponse", + "type": "object" + }, + "ComputerUse": { + "type": "object", + "id": "ComputerUse", + "description": "Computer Use tool type.", + "properties": { + "excludedPredefinedFunctions": { + "description": "Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.", + "items": { + "type": "string" }, - "description": "Lists created tuned models.", - "id": "generativelanguage.tunedModels.list", - "flatPath": "v1beta/tunedModels" + "type": "array" }, - "batchGenerateContent": { - "flatPath": "v1beta/tunedModels/{tunedModelsId}:batchGenerateContent", - "parameterOrder": [ - "model" + "environment": { + "type": "string", + "enumDescriptions": [ + "Defaults to browser.", + "Operates in a web browser.", + "Operates in a mobile environment.", + "Operates in a desktop environment." ], - "httpMethod": "POST", - "response": { - "$ref": "Operation" + "enum": [ + "ENVIRONMENT_UNSPECIFIED", + "ENVIRONMENT_BROWSER", + "ENVIRONMENT_MOBILE", + "ENVIRONMENT_DESKTOP" + ], + "description": "Required. The environment being operated." + }, + "enablePromptInjectionDetection": { + "description": "Optional. Whether enable the prompt injection detection check on computer-use request.", + "type": "boolean" + }, + "disabledSafetyPolicies": { + "description": "Optional. Disabled safety policies for computer use.", + "items": { + "type": "string", + "enumDescriptions": [ + "Unspecified safety policy.", + "Safety policy for financial transactions.", + "Safety policy for sensitive data modification.", + "Safety policy for communication tools (e.g. Gmail, Chat, Meet).", + "Safety policy for account creation.", + "Safety policy for data modification.", + "Safety policy for user consent management.", + "Safety policy for legal terms and agreements." + ], + "enum": [ + "SAFETY_POLICY_UNSPECIFIED", + "FINANCIAL_TRANSACTIONS", + "SENSITIVE_DATA_MODIFICATION", + "COMMUNICATION_TOOL", + "ACCOUNT_CREATION", + "DATA_MODIFICATION", + "USER_CONSENT_MANAGEMENT", + "LEGAL_TERMS_AND_AGREEMENTS" + ] }, - "request": { - "$ref": "BatchGenerateContentRequest" + "type": "array" + } + } + }, + "GoogleAiGenerativelanguageV1betaGroundingSupport": { + "id": "GoogleAiGenerativelanguageV1betaGroundingSupport", + "type": "object", + "properties": { + "groundingChunkIndices": { + "type": "array", + "description": "Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order).", + "items": { + "type": "integer", + "format": "int32" + } + }, + "renderedParts": { + "items": { + "format": "int32", + "type": "integer" }, - "id": "generativelanguage.tunedModels.batchGenerateContent", - "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^tunedModels/[^/]+$", - "location": "path", - "required": true, - "type": "string" - } + "description": "Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.", + "readOnly": true, + "type": "array" + }, + "confidenceScores": { + "type": "array", + "items": { + "format": "float", + "type": "number" }, - "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", - "path": "v1beta/{+model}:batchGenerateContent" + "description": "Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices." + }, + "segment": { + "description": "Segment of the content this support belongs to.", + "$ref": "GoogleAiGenerativelanguageV1betaSegment" } }, - "resources": { - "operations": { - "methods": { - "list": { - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation's parent resource.", - "pattern": "^tunedModels/[^/]+$" - }, - "filter": { - "location": "query", - "type": "string", - "description": "The standard list filter." - }, - "pageSize": { - "location": "query", - "type": "integer", - "format": "int32", - "description": "The standard list page size." - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "returnPartialSuccess": { - "type": "boolean", - "location": "query", - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation." - } - }, - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "id": "generativelanguage.tunedModels.operations.list", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations", - "response": { - "$ref": "ListOperationsResponse" - }, - "httpMethod": "GET", - "path": "v1beta/{+name}/operations", - "parameterOrder": [ - "name" - ] - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Operation" - }, - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation resource.", - "pattern": "^tunedModels/[^/]+/operations/[^/]+$" - } - }, - "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.", - "id": "generativelanguage.tunedModels.operations.get", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations/{operationsId}" - } - } - }, - "permissions": { - "methods": { - "list": { - "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "format": "int32", - "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size." - }, - "pageToken": { - "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "pattern": "^tunedModels/[^/]+$", - "location": "path", - "required": true, - "type": "string" - } - }, - "description": "Lists permissions for the specific resource.", - "id": "generativelanguage.tunedModels.permissions.list", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", - "httpMethod": "GET", - "response": { - "$ref": "ListPermissionsResponse" - }, - "path": "v1beta/{+parent}/permissions", - "parameterOrder": [ - "parent" - ] - }, - "patch": { - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", - "parameterOrder": [ - "name" - ], - "httpMethod": "PATCH", - "response": { - "$ref": "Permission" - }, - "request": { - "$ref": "Permission" - }, - "id": "generativelanguage.tunedModels.permissions.patch", - "parameters": { - "updateMask": { - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", - "location": "query", - "type": "string", - "format": "google-fieldmask" - }, - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" - } - }, - "description": "Updates the permission.", - "path": "v1beta/{+name}" - }, - "create": { - "parameters": { - "parent": { - "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "location": "path", - "required": true - } - }, - "description": "Create a permission to a specific resource.", - "id": "generativelanguage.tunedModels.permissions.create", - "request": { - "$ref": "Permission" - }, - "path": "v1beta/{+parent}/permissions", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", - "response": { - "$ref": "Permission" - }, - "httpMethod": "POST", - "parameterOrder": [ - "parent" - ] - }, - "get": { - "id": "generativelanguage.tunedModels.permissions.get", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" - } - }, - "description": "Gets information about a specific Permission.", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "response": { - "$ref": "Permission" - } - }, - "delete": { - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "id": "generativelanguage.tunedModels.permissions.delete", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", - "parameters": { - "name": { - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", - "location": "path", - "required": true, - "type": "string" - } - }, - "description": "Deletes the permission." + "description": "Grounding support." + }, + "InlinedEmbedContentResponse": { + "id": "InlinedEmbedContentResponse", + "type": "object", + "properties": { + "error": { + "readOnly": true, + "$ref": "Status", + "description": "Output only. The error encountered while processing the request." + }, + "response": { + "readOnly": true, + "$ref": "EmbedContentResponse", + "description": "Output only. The response to the request." + }, + "metadata": { + "description": "Output only. The metadata associated with the request.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + }, + "readOnly": true, + "type": "object" + } + }, + "description": "The response to a single request in the batch." + }, + "Blobstore2Info": { + "properties": { + "uploadFragmentListCreationInfo": { + "type": "string", + "format": "byte", + "description": "A serialized Object Fragment List Creation Info passed from Bigstore -\u003e Scotty for a GCS upload. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads." + }, + "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": { + "type": "string", + "format": "byte", + "description": "Metadata passed from Blobstore -\u003e 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." + }, + "downloadReadHandle": { + "description": "Read handle passed from Bigstore -\u003e 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.", + "type": "string", + "format": "byte" + }, + "downloadExternalReadToken": { + "description": "A serialized External Read Token passed from Bigstore -\u003e Scotty for a GCS download. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", + "format": "byte", + "type": "string" + }, + "blobGeneration": { + "format": "int64", + "type": "string", + "description": "The blob generation id." + }, + "blobId": { + "description": "The blob id, e.g., /blobstore/prod/playground/scotty", + "type": "string" + } + }, + "description": "Information to read/write to blobstore2.", + "id": "Blobstore2Info", + "type": "object" + }, + "Maps": { + "id": "Maps", + "type": "object", + "properties": { + "placeAnswerSources": { + "description": "Sources that provide answers about the features of a given place in Google Maps.", + "$ref": "PlaceAnswerSources" + }, + "uri": { + "description": "URI reference of the place.", + "type": "string" + }, + "placeId": { + "description": "The ID of the place, in `places/{place_id}` format. A user can use this ID to look up that place.", + "type": "string" + }, + "title": { + "description": "Title of the place.", + "type": "string" + }, + "text": { + "description": "Text description of the place answer.", + "type": "string" + } + }, + "description": "A grounding chunk from Google Maps. A Maps chunk corresponds to a single place." + }, + "ReviewSnippet": { + "description": "Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.", + "properties": { + "googleMapsUri": { + "description": "A link that corresponds to the user review on Google Maps.", + "type": "string" + }, + "reviewId": { + "description": "The ID of the review snippet.", + "type": "string" + }, + "title": { + "description": "Title of the review.", + "type": "string" + } + }, + "type": "object", + "id": "ReviewSnippet" + }, + "LatLng": { + "id": "LatLng", + "type": "object", + "properties": { + "latitude": { + "format": "double", + "type": "number", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0]." + }, + "longitude": { + "type": "number", + "format": "double", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]." + } + }, + "description": "An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges." + }, + "GeneratedFile": { + "properties": { + "mimeType": { + "description": "MIME type of the generatedFile.", + "type": "string" + }, + "name": { + "description": "Identifier. The name of the generated file. Example: `generatedFiles/abc-123`", + "type": "string" + }, + "error": { + "description": "Error details if the GeneratedFile ends up in the STATE_FAILED state.", + "$ref": "Status" + }, + "state": { + "readOnly": true, + "enumDescriptions": [ + "The default value. This value is used if the state is omitted.", + "Being generated.", + "Generated and is ready for download.", + "Failed to generate the GeneratedFile." + ], + "enum": [ + "STATE_UNSPECIFIED", + "GENERATING", + "GENERATED", + "FAILED" + ], + "description": "Output only. The state of the GeneratedFile.", + "type": "string" + } + }, + "description": "A file generated on behalf of a user.", + "id": "GeneratedFile", + "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": { + "functionCall": { + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", + "$ref": "FunctionCall" + }, + "inlineData": { + "description": "Inline media bytes.", + "$ref": "Blob" + }, + "codeExecutionResult": { + "description": "Result of executing the `ExecutableCode`.", + "$ref": "CodeExecutionResult" + }, + "toolResponse": { + "description": "The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.", + "$ref": "ToolResponse" + }, + "text": { + "description": "Inline text.", + "type": "string" + }, + "toolCall": { + "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.", + "$ref": "ToolCall" + }, + "partMetadata": { + "type": "object", + "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "thoughtSignature": { + "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.", + "type": "string", + "format": "byte" + }, + "thought": { + "description": "Optional. Indicates if the part is thought from the model.", + "type": "boolean" + }, + "mediaResolution": { + "description": "Optional. Media resolution for the input media.", + "$ref": "MediaResolution" + }, + "functionResponse": { + "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.", + "$ref": "FunctionResponse" + }, + "fileData": { + "description": "URI based data.", + "$ref": "FileData" + }, + "videoMetadata": { + "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.", + "$ref": "VideoMetadata" + }, + "executableCode": { + "description": "Code generated by the model that is meant to be executed.", + "$ref": "ExecutableCode" + } + }, + "type": "object", + "id": "Part" + }, + "ImageResponseFormat": { + "id": "ImageResponseFormat", + "type": "object", + "properties": { + "delivery": { + "type": "string", + "enumDescriptions": [ + "Default value. This value is unused.", + "Image data is returned inline in the response.", + "Image data is returned as a URI." + ], + "enum": [ + "DELIVERY_UNSPECIFIED", + "INLINE", + "URI" + ], + "description": "Optional. The delivery mode for the image output." + }, + "mimeType": { + "description": "Optional. The MIME type of the image output.", + "enumDescriptions": [ + "Default value. This value is unused.", + "JPEG image format." + ], + "enum": [ + "MIME_TYPE_UNSPECIFIED", + "IMAGE_JPEG" + ], + "type": "string" + }, + "imageSize": { + "description": "Optional. The size of the image output.", + "enumDescriptions": [ + "Default value. This value is unused.", + "512px image size.", + "1K image size.", + "2K image size.", + "4K image size." + ], + "enum": [ + "IMAGE_SIZE_UNSPECIFIED", + "IMAGE_SIZE_FIVE_TWELVE", + "IMAGE_SIZE_ONE_K", + "IMAGE_SIZE_TWO_K", + "IMAGE_SIZE_FOUR_K" + ], + "type": "string" + }, + "aspectRatio": { + "type": "string", + "description": "Optional. The aspect ratio for the image output.", + "enumDescriptions": [ + "Default value. This value is unused.", + "1:1 aspect ratio.", + "2:3 aspect ratio.", + "3:2 aspect ratio.", + "3:4 aspect ratio.", + "4:3 aspect ratio.", + "4:5 aspect ratio.", + "5:4 aspect ratio.", + "9:16 aspect ratio.", + "16:9 aspect ratio.", + "21:9 aspect ratio.", + "1:8 aspect ratio.", + "8:1 aspect ratio.", + "1:4 aspect ratio.", + "4:1 aspect ratio." + ], + "enum": [ + "ASPECT_RATIO_UNSPECIFIED", + "ASPECT_RATIO_ONE_BY_ONE", + "ASPECT_RATIO_TWO_BY_THREE", + "ASPECT_RATIO_THREE_BY_TWO", + "ASPECT_RATIO_THREE_BY_FOUR", + "ASPECT_RATIO_FOUR_BY_THREE", + "ASPECT_RATIO_FOUR_BY_FIVE", + "ASPECT_RATIO_FIVE_BY_FOUR", + "ASPECT_RATIO_NINE_BY_SIXTEEN", + "ASPECT_RATIO_SIXTEEN_BY_NINE", + "ASPECT_RATIO_TWENTY_ONE_BY_NINE", + "ASPECT_RATIO_ONE_BY_EIGHT", + "ASPECT_RATIO_EIGHT_BY_ONE", + "ASPECT_RATIO_ONE_BY_FOUR", + "ASPECT_RATIO_FOUR_BY_ONE" + ] + } + }, + "description": "Configuration for image output format." + }, + "RetrievedContext": { + "id": "RetrievedContext", + "type": "object", + "properties": { + "title": { + "description": "Optional. Title of the document.", + "type": "string" + }, + "text": { + "description": "Optional. Text of the chunk.", + "type": "string" + }, + "mediaId": { + "description": "Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}", + "type": "string" + }, + "customMetadata": { + "description": "Optional. User-provided metadata about the retrieved context.", + "items": { + "$ref": "GroundingChunkCustomMetadata" + }, + "type": "array" + }, + "uri": { + "description": "Optional. URI reference of the semantic retrieval document.", + "type": "string" + }, + "fileSearchStore": { + "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`", + "type": "string" + }, + "pageNumber": { + "format": "int32", + "type": "integer", + "description": "Optional. Page number of the retrieved context, if applicable." + } + }, + "description": "Chunk from context retrieved by the file search tool." + }, + "ContentFilter": { + "properties": { + "reason": { + "type": "string", + "description": "The reason content was blocked during request processing.", + "enumDescriptions": [ + "A blocked reason was not specified.", + "Content was blocked by safety settings.", + "Content was blocked, but the reason is uncategorized." + ], + "enum": [ + "BLOCKED_REASON_UNSPECIFIED", + "SAFETY", + "OTHER" + ] + }, + "message": { + "description": "A string that describes the filtering behavior in more detail.", + "type": "string" + } + }, + "description": "Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.", + "id": "ContentFilter", + "type": "object" + }, + "DiffUploadRequest": { + "description": "A Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", + "properties": { + "checksumsInfo": { + "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.", + "$ref": "CompositeMedia" + }, + "objectInfo": { + "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.", + "$ref": "CompositeMedia" + }, + "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", + "id": "DiffUploadRequest" + }, + "UrlMetadata": { + "properties": { + "urlRetrievalStatus": { + "enumDescriptions": [ + "Default value. This value is unused.", + "Url retrieval is successful.", + "Url retrieval is failed due to error.", + "Url retrieval is failed because the content is behind paywall.", + "Url retrieval is failed because the content is unsafe." + ], + "enum": [ + "URL_RETRIEVAL_STATUS_UNSPECIFIED", + "URL_RETRIEVAL_STATUS_SUCCESS", + "URL_RETRIEVAL_STATUS_ERROR", + "URL_RETRIEVAL_STATUS_PAYWALL", + "URL_RETRIEVAL_STATUS_UNSAFE" + ], + "description": "Status of the url retrieval.", + "type": "string" + }, + "retrievedUrl": { + "description": "Retrieved url by the tool.", + "type": "string" + } + }, + "description": "Context of the a single url retrieval.", + "id": "UrlMetadata", + "type": "object" + }, + "TransferOwnershipRequest": { + "id": "TransferOwnershipRequest", + "type": "object", + "properties": { + "emailAddress": { + "description": "Required. The email address of the user to whom the tuned model is being transferred to.", + "type": "string" + } + }, + "description": "Request to transfer the ownership of the tuned model." + }, + "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", + "id": "RetrievalMetadata" + }, + "DownloadParameters": { + "id": "DownloadParameters", + "type": "object", + "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" + } + }, + "description": "Parameters specific to media downloads." + } + }, + "resources": { + "dynamic": { + "methods": { + "generateContent": { + "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.", + "id": "generativelanguage.dynamic.generateContent", + "parameterOrder": [ + "model" + ], + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^dynamic/[^/]+$", + "type": "string", + "required": true, + "location": "path" } - } + }, + "flatPath": "v1beta/dynamic/{dynamicId}:generateContent", + "path": "v1beta/{+model}:generateContent", + "response": { + "$ref": "GenerateContentResponse" + }, + "request": { + "$ref": "GenerateContentRequest" + }, + "httpMethod": "POST" + }, + "streamGenerateContent": { + "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`.", + "id": "generativelanguage.dynamic.streamGenerateContent", + "parameterOrder": [ + "model" + ], + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^dynamic/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta/dynamic/{dynamicId}:streamGenerateContent", + "path": "v1beta/{+model}:streamGenerateContent", + "response": { + "$ref": "GenerateContentResponse" + }, + "request": { + "$ref": "GenerateContentRequest" + }, + "httpMethod": "POST" } } }, - "models": { - "resources": { - "operations": { - "methods": { - "get": { - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "response": { - "$ref": "Operation" + "media": { + "methods": { + "upload": { + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "response": { + "$ref": "CreateFileResponse" + }, + "request": { + "$ref": "CreateFileRequest" + }, + "httpMethod": "POST", + "path": "v1beta/files", + "parameters": {}, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "2147483648", + "protocols": { + "resumable": { + "multipart": true, + "path": "/resumable/upload/v1beta/files" }, - "id": "generativelanguage.models.operations.get", - "flatPath": "v1beta/models/{modelsId}/operations/{operationsId}", - "parameters": { - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "The name of the operation resource.", - "pattern": "^models/[^/]+/operations/[^/]+$" - } + "simple": { + "multipart": true, + "path": "/upload/v1beta/files" + } + } + }, + "flatPath": "v1beta/files", + "supportsMediaUpload": true, + "description": "Creates a `File`.", + "id": "generativelanguage.media.upload", + "parameterOrder": [] + }, + "uploadToFileSearchStore": { + "id": "generativelanguage.media.uploadToFileSearchStore", + "parameterOrder": [ + "fileSearchStoreName" + ], + "description": "Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document.", + "mediaUpload": { + "protocols": { + "resumable": { + "multipart": true, + "path": "/resumable/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" }, - "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." + "simple": { + "multipart": true, + "path": "/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" + } }, - "list": { - "response": { - "$ref": "ListOperationsResponse" - }, - "httpMethod": "GET", - "path": "v1beta/{+name}/operations", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation's parent resource.", - "pattern": "^models/[^/]+$" - }, - "filter": { - "location": "query", - "type": "string", - "description": "The standard list filter." - }, - "pageSize": { - "type": "integer", - "format": "int32", - "location": "query", - "description": "The standard list page size." - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "The standard list page token." - }, - "returnPartialSuccess": { - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", - "type": "boolean", - "location": "query" - } - }, - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "id": "generativelanguage.models.operations.list", - "flatPath": "v1beta/models/{modelsId}/operations" + "accept": [ + "*/*" + ], + "maxSize": "104857600" + }, + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore", + "supportsMediaUpload": true, + "parameters": { + "fileSearchStoreName": { + "type": "string", + "required": true, + "location": "path", + "description": "Required. Immutable. The name of the `FileSearchStore` to upload the file into. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$" } + }, + "path": "v1beta/{+fileSearchStoreName}:uploadToFileSearchStore", + "request": { + "$ref": "UploadToFileSearchStoreRequest" + }, + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "response": { + "$ref": "CustomLongRunningOperation" } } - }, + } + }, + "models": { "methods": { - "countMessageTokens": { - "id": "generativelanguage.models.countMessageTokens", + "generateMessage": { + "parameters": { + "model": { + "type": "string", + "location": "path", + "required": true, + "description": "Required. The name of the model to use. Format: `name=models/{model}`.", + "pattern": "^models/[^/]+$" + } + }, + "flatPath": "v1beta/models/{modelsId}:generateMessage", + "description": "Generates a response from the model given an input `MessagePrompt`.", + "parameterOrder": [ + "model" + ], + "id": "generativelanguage.models.generateMessage", + "response": { + "$ref": "GenerateMessageResponse" + }, + "httpMethod": "POST", "request": { - "$ref": "CountMessageTokensRequest" + "$ref": "GenerateMessageRequest" }, + "path": "v1beta/{+model}:generateMessage" + }, + "streamGenerateContent": { + "id": "generativelanguage.models.streamGenerateContent", + "parameterOrder": [ + "model" + ], + "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`.", + "flatPath": "v1beta/models/{modelsId}:streamGenerateContent", "parameters": { "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}`", - "pattern": "^models/[^/]+$", "type": "string", "location": "path", - "required": true + "required": true, + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^models/[^/]+$" } }, - "description": "Runs a model's tokenizer on a string and returns the token count.", - "path": "v1beta/{+model}:countMessageTokens", - "flatPath": "v1beta/models/{modelsId}:countMessageTokens", + "path": "v1beta/{+model}:streamGenerateContent", + "request": { + "$ref": "GenerateContentRequest" + }, + "httpMethod": "POST", + "response": { + "$ref": "GenerateContentResponse" + } + }, + "list": { + "path": "v1beta/models", + "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", + "id": "generativelanguage.models.list", + "parameterOrder": [], + "parameters": { + "pageToken": { + "type": "string", + "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.", + "location": "query" + }, + "pageSize": { + "format": "int32", + "type": "integer", + "location": "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." + } + }, + "response": { + "$ref": "ListModelsResponse" + }, + "flatPath": "v1beta/models", + "httpMethod": "GET" + }, + "generateText": { + "description": "Generates a response from the model given an input message.", + "id": "generativelanguage.models.generateText", "parameterOrder": [ "model" ], + "parameters": { + "model": { + "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", + "pattern": "^models/[^/]+$", + "required": true, + "location": "path", + "type": "string" + } + }, + "flatPath": "v1beta/models/{modelsId}:generateText", + "path": "v1beta/{+model}:generateText", "response": { - "$ref": "CountMessageTokensResponse" + "$ref": "GenerateTextResponse" + }, + "request": { + "$ref": "GenerateTextRequest" }, "httpMethod": "POST" }, "predictLongRunning": { - "path": "v1beta/{+model}:predictLongRunning", + "flatPath": "v1beta/models/{modelsId}:predictLongRunning", "parameters": { "model": { "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", @@ -6291,695 +6098,900 @@ "type": "string" } }, - "description": "Same as Predict but returns an LRO.", "id": "generativelanguage.models.predictLongRunning", + "parameterOrder": [ + "model" + ], + "description": "Same as Predict but returns an LRO.", "request": { "$ref": "PredictLongRunningRequest" }, + "httpMethod": "POST", "response": { "$ref": "Operation" }, - "httpMethod": "POST", + "path": "v1beta/{+model}:predictLongRunning" + }, + "batchEmbedText": { "parameterOrder": [ "model" ], - "flatPath": "v1beta/models/{modelsId}:predictLongRunning" - }, - "get": { - "id": "generativelanguage.models.get", - "flatPath": "v1beta/models/{modelsId}", + "id": "generativelanguage.models.batchEmbedText", + "description": "Generates multiple embeddings from the model given input text in a synchronous call.", + "flatPath": "v1beta/models/{modelsId}:batchEmbedText", "parameters": { - "name": { + "model": { "type": "string", "location": "path", "required": true, - "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001", "pattern": "^models/[^/]+$" } }, - "description": "Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", + "path": "v1beta/{+model}:batchEmbedText", + "httpMethod": "POST", + "request": { + "$ref": "BatchEmbedTextRequest" + }, + "response": { + "$ref": "BatchEmbedTextResponse" + } + }, + "get": { "path": "v1beta/{+name}", + "description": "Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", + "id": "generativelanguage.models.get", "parameterOrder": [ "name" ], + "parameters": { + "name": { + "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "required": true, + "location": "path", + "type": "string" + } + }, "response": { "$ref": "Model" }, + "flatPath": "v1beta/models/{modelsId}", "httpMethod": "GET" }, "countTextTokens": { + "description": "Runs a model's tokenizer on a text and returns the token count.", + "id": "generativelanguage.models.countTextTokens", + "parameterOrder": [ + "model" + ], "parameters": { "model": { "type": "string", - "location": "path", "required": true, + "location": "path", "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", "pattern": "^models/[^/]+$" } }, - "description": "Runs a model's tokenizer on a text and returns the token count.", - "request": { - "$ref": "CountTextTokensRequest" - }, - "id": "generativelanguage.models.countTextTokens", - "path": "v1beta/{+model}:countTextTokens", "flatPath": "v1beta/models/{modelsId}:countTextTokens", - "httpMethod": "POST", + "path": "v1beta/{+model}:countTextTokens", "response": { "$ref": "CountTextTokensResponse" }, - "parameterOrder": [ - "model" - ] + "request": { + "$ref": "CountTextTokensRequest" + }, + "httpMethod": "POST" }, - "asyncBatchEmbedContent": { - "path": "v1beta/{+model}:asyncBatchEmbedContent", + "batchEmbedContents": { + "flatPath": "v1beta/models/{modelsId}:batchEmbedContents", "parameters": { "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}`", + "pattern": "^models/[^/]+$", "location": "path", "required": true, - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^models/[^/]+$" + "type": "string" } }, - "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", - "id": "generativelanguage.models.asyncBatchEmbedContent", + "id": "generativelanguage.models.batchEmbedContents", + "parameterOrder": [ + "model" + ], + "description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", "request": { - "$ref": "AsyncBatchEmbedContentRequest" + "$ref": "BatchEmbedContentsRequest" + }, + "httpMethod": "POST", + "response": { + "$ref": "BatchEmbedContentsResponse" }, + "path": "v1beta/{+model}:batchEmbedContents" + }, + "batchGenerateContent": { "response": { "$ref": "Operation" }, + "request": { + "$ref": "BatchGenerateContentRequest" + }, "httpMethod": "POST", + "path": "v1beta/{+model}:batchGenerateContent", + "parameters": { + "model": { + "required": true, + "location": "path", + "type": "string", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^models/[^/]+$" + } + }, + "flatPath": "v1beta/models/{modelsId}:batchGenerateContent", + "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", + "id": "generativelanguage.models.batchGenerateContent", "parameterOrder": [ "model" - ], - "flatPath": "v1beta/models/{modelsId}:asyncBatchEmbedContent" + ] }, - "generateMessage": { + "generateContent": { + "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.", + "parameterOrder": [ + "model" + ], + "id": "generativelanguage.models.generateContent", "parameters": { "model": { "type": "string", - "location": "path", "required": true, - "description": "Required. The name of the model to use. Format: `name=models/{model}`.", + "location": "path", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "pattern": "^models/[^/]+$" } }, - "description": "Generates a response from the model given an input `MessagePrompt`.", - "request": { - "$ref": "GenerateMessageRequest" - }, - "id": "generativelanguage.models.generateMessage", - "path": "v1beta/{+model}:generateMessage", - "flatPath": "v1beta/models/{modelsId}:generateMessage", - "httpMethod": "POST", + "flatPath": "v1beta/models/{modelsId}:generateContent", + "path": "v1beta/{+model}:generateContent", "response": { - "$ref": "GenerateMessageResponse" + "$ref": "GenerateContentResponse" }, - "parameterOrder": [ - "model" - ] + "httpMethod": "POST", + "request": { + "$ref": "GenerateContentRequest" + } }, - "batchEmbedContents": { - "id": "generativelanguage.models.batchEmbedContents", + "countMessageTokens": { + "httpMethod": "POST", "request": { - "$ref": "BatchEmbedContentsRequest" + "$ref": "CountMessageTokensRequest" + }, + "response": { + "$ref": "CountMessageTokensResponse" }, + "path": "v1beta/{+model}:countMessageTokens", + "flatPath": "v1beta/models/{modelsId}:countMessageTokens", "parameters": { "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}`", - "pattern": "^models/[^/]+$", + "type": "string", "location": "path", "required": true, - "type": "string" + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$" } }, - "description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", - "path": "v1beta/{+model}:batchEmbedContents", - "flatPath": "v1beta/models/{modelsId}:batchEmbedContents", "parameterOrder": [ "model" ], + "id": "generativelanguage.models.countMessageTokens", + "description": "Runs a model's tokenizer on a string and returns the token count." + }, + "generateAnswer": { + "path": "v1beta/{+model}:generateAnswer", "response": { - "$ref": "BatchEmbedContentsResponse" + "$ref": "GenerateAnswerResponse" }, - "httpMethod": "POST" - }, - "countTokens": { - "flatPath": "v1beta/models/{modelsId}:countTokens", "httpMethod": "POST", - "response": { - "$ref": "CountTokensResponse" + "request": { + "$ref": "GenerateAnswerRequest" }, + "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", "parameterOrder": [ "model" ], + "id": "generativelanguage.models.generateAnswer", "parameters": { "model": { "location": "path", "required": true, "type": "string", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.", "pattern": "^models/[^/]+$" } }, - "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.", + "flatPath": "v1beta/models/{modelsId}:generateAnswer" + }, + "countTokens": { "request": { "$ref": "CountTokensRequest" }, - "id": "generativelanguage.models.countTokens", - "path": "v1beta/{+model}:countTokens" - }, - "list": { - "id": "generativelanguage.models.list", - "flatPath": "v1beta/models", + "httpMethod": "POST", + "response": { + "$ref": "CountTokensResponse" + }, + "path": "v1beta/{+model}:countTokens", + "flatPath": "v1beta/models/{modelsId}:countTokens", "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "format": "int32", - "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." - }, - "pageToken": { + "model": { "type": "string", - "location": "query", - "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token." + "required": true, + "location": "path", + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$" } }, - "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", - "path": "v1beta/models", - "parameterOrder": [], - "httpMethod": "GET", - "response": { - "$ref": "ListModelsResponse" - } - }, - "generateContent": { - "httpMethod": "POST", - "response": { - "$ref": "GenerateContentResponse" - }, + "id": "generativelanguage.models.countTokens", "parameterOrder": [ "model" ], - "flatPath": "v1beta/models/{modelsId}:generateContent", - "path": "v1beta/{+model}:generateContent", + "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." + }, + "embedText": { + "flatPath": "v1beta/models/{modelsId}:embedText", "parameters": { "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "Required. The model name to use with the format model=models/{model}.", "pattern": "^models/[^/]+$", "type": "string", "location": "path", "required": true } }, - "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.", + "id": "generativelanguage.models.embedText", + "parameterOrder": [ + "model" + ], + "description": "Generates an embedding from the model given an input message.", "request": { - "$ref": "GenerateContentRequest" + "$ref": "EmbedTextRequest" + }, + "httpMethod": "POST", + "response": { + "$ref": "EmbedTextResponse" }, - "id": "generativelanguage.models.generateContent" + "path": "v1beta/{+model}:embedText" }, - "generateText": { + "embedContent": { + "flatPath": "v1beta/models/{modelsId}:embedContent", "parameters": { "model": { - "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", "pattern": "^models/[^/]+$", "type": "string", "location": "path", "required": true } }, - "description": "Generates a response from the model given an input message.", + "parameterOrder": [ + "model" + ], + "id": "generativelanguage.models.embedContent", + "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).", + "httpMethod": "POST", "request": { - "$ref": "GenerateTextRequest" + "$ref": "EmbedContentRequest" }, - "id": "generativelanguage.models.generateText", - "path": "v1beta/{+model}:generateText", - "flatPath": "v1beta/models/{modelsId}:generateText", - "httpMethod": "POST", "response": { - "$ref": "GenerateTextResponse" + "$ref": "EmbedContentResponse" }, - "parameterOrder": [ - "model" - ] + "path": "v1beta/{+model}:embedContent" }, - "generateAnswer": { + "predict": { + "response": { + "$ref": "PredictResponse" + }, + "httpMethod": "POST", "request": { - "$ref": "GenerateAnswerRequest" + "$ref": "PredictRequest" }, - "id": "generativelanguage.models.generateAnswer", + "path": "v1beta/{+model}:predict", "parameters": { "model": { - "type": "string", "location": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.", + "type": "string", + "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", "pattern": "^models/[^/]+$" } }, - "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", - "path": "v1beta/{+model}:generateAnswer", - "flatPath": "v1beta/models/{modelsId}:generateAnswer", + "flatPath": "v1beta/models/{modelsId}:predict", + "description": "Performs a prediction request.", "parameterOrder": [ "model" ], - "httpMethod": "POST", - "response": { - "$ref": "GenerateAnswerResponse" - } + "id": "generativelanguage.models.predict" }, - "batchGenerateContent": { - "flatPath": "v1beta/models/{modelsId}:batchGenerateContent", - "httpMethod": "POST", - "response": { - "$ref": "Operation" - }, + "asyncBatchEmbedContent": { "parameterOrder": [ "model" ], + "id": "generativelanguage.models.asyncBatchEmbedContent", + "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", + "flatPath": "v1beta/models/{modelsId}:asyncBatchEmbedContent", "parameters": { "model": { "type": "string", - "location": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^models/[^/]+$" - } - }, - "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", - "request": { - "$ref": "BatchGenerateContentRequest" - }, - "id": "generativelanguage.models.batchGenerateContent", - "path": "v1beta/{+model}:batchGenerateContent" - }, - "batchEmbedText": { - "path": "v1beta/{+model}:batchEmbedText", - "request": { - "$ref": "BatchEmbedTextRequest" - }, - "id": "generativelanguage.models.batchEmbedText", - "parameters": { - "model": { - "type": "string", "location": "path", - "required": true, - "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "pattern": "^models/[^/]+$" } }, - "description": "Generates multiple embeddings from the model given input text in a synchronous call.", - "parameterOrder": [ - "model" - ], + "path": "v1beta/{+model}:asyncBatchEmbedContent", "httpMethod": "POST", - "response": { - "$ref": "BatchEmbedTextResponse" + "request": { + "$ref": "AsyncBatchEmbedContentRequest" }, - "flatPath": "v1beta/models/{modelsId}:batchEmbedText" - }, - "streamGenerateContent": { - "httpMethod": "POST", "response": { - "$ref": "GenerateContentResponse" - }, - "parameterOrder": [ - "model" + "$ref": "Operation" + } + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "path": "v1beta/{+name}", + "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.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.models.operations.get", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^models/[^/]+/operations/[^/]+$", + "type": "string", + "required": true, + "location": "path" + } + }, + "response": { + "$ref": "Operation" + }, + "flatPath": "v1beta/models/{modelsId}/operations/{operationsId}", + "httpMethod": "GET" + }, + "list": { + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "pattern": "^models/[^/]+$", + "required": true, + "location": "path", + "type": "string" + }, + "filter": { + "type": "string", + "location": "query", + "description": "The standard list filter." + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "The standard list page token." + }, + "returnPartialSuccess": { + "location": "query", + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "type": "boolean" + }, + "pageSize": { + "format": "int32", + "type": "integer", + "location": "query", + "description": "The standard list page size." + } + }, + "response": { + "$ref": "ListOperationsResponse" + }, + "flatPath": "v1beta/models/{modelsId}/operations", + "httpMethod": "GET", + "path": "v1beta/{+name}/operations", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "id": "generativelanguage.models.operations.list", + "parameterOrder": [ + "name" + ] + } + } + } + } + }, + "files": { + "methods": { + "register": { + "description": "Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails.", + "id": "generativelanguage.files.register", + "parameterOrder": [], + "parameters": {}, + "flatPath": "v1beta/files:register", + "path": "v1beta/files:register", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" ], - "flatPath": "v1beta/models/{modelsId}:streamGenerateContent", - "path": "v1beta/{+model}:streamGenerateContent", - "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^models/[^/]+$", - "type": "string", - "location": "path", - "required": true - } + "response": { + "$ref": "RegisterFilesResponse" }, - "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`.", "request": { - "$ref": "GenerateContentRequest" + "$ref": "RegisterFilesRequest" }, - "id": "generativelanguage.models.streamGenerateContent" + "httpMethod": "POST" }, - "embedContent": { - "flatPath": "v1beta/models/{modelsId}:embedContent", + "get": { + "path": "v1beta/{+name}", "response": { - "$ref": "EmbedContentResponse" + "$ref": "File" }, - "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "httpMethod": "GET", + "description": "Gets the metadata for the given `File`.", "parameterOrder": [ - "model" + "name" ], + "id": "generativelanguage.files.get", "parameters": { - "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}`", - "pattern": "^models/[^/]+$", + "name": { "type": "string", + "required": true, "location": "path", - "required": true + "description": "Required. The name of the `File` to get. Example: `files/abc-123`", + "pattern": "^files/[^/]+$" } }, - "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).", - "id": "generativelanguage.models.embedContent", - "request": { - "$ref": "EmbedContentRequest" - }, - "path": "v1beta/{+model}:embedContent" + "flatPath": "v1beta/files/{filesId}" }, - "predict": { + "delete": { + "description": "Deletes the `File`.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.files.delete", "parameters": { - "model": { - "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", - "pattern": "^models/[^/]+$", - "location": "path", + "name": { + "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", + "pattern": "^files/[^/]+$", "required": true, + "location": "path", "type": "string" } }, - "description": "Performs a prediction request.", - "id": "generativelanguage.models.predict", - "request": { - "$ref": "PredictRequest" - }, - "path": "v1beta/{+model}:predict", - "flatPath": "v1beta/models/{modelsId}:predict", + "flatPath": "v1beta/files/{filesId}", + "path": "v1beta/{+name}", "response": { - "$ref": "PredictResponse" + "$ref": "Empty" }, - "httpMethod": "POST", - "parameterOrder": [ - "model" - ] + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "httpMethod": "DELETE" }, - "embedText": { + "list": { + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], "response": { - "$ref": "EmbedTextResponse" + "$ref": "ListFilesResponse" }, - "httpMethod": "POST", - "parameterOrder": [ - "model" - ], - "flatPath": "v1beta/models/{modelsId}:embedText", - "path": "v1beta/{+model}:embedText", + "httpMethod": "GET", + "path": "v1beta/files", "parameters": { - "model": { + "pageSize": { + "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { "type": "string", - "location": "path", - "required": true, - "description": "Required. The model name to use with the format model=models/{model}.", - "pattern": "^models/[^/]+$" + "location": "query", + "description": "Optional. A page token from a previous `ListFiles` call." } }, - "description": "Generates an embedding from the model given an input message.", - "id": "generativelanguage.models.embedText", - "request": { - "$ref": "EmbedTextRequest" + "flatPath": "v1beta/files", + "description": "Lists the metadata for `File`s owned by the requesting project.", + "id": "generativelanguage.files.list", + "parameterOrder": [] + } + } + }, + "generatedFiles": { + "methods": { + "list": { + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "response": { + "$ref": "ListGeneratedFilesResponse" + }, + "path": "v1beta/generatedFiles", + "flatPath": "v1beta/generatedFiles", + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of `GeneratedFile`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 50.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token from a previous `ListGeneratedFiles` call.", + "location": "query", + "type": "string" + } + }, + "id": "generativelanguage.generatedFiles.list", + "parameterOrder": [], + "description": "Lists the generated files owned by the requesting project." + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "path": "v1beta/{+name}", + "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.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.generatedFiles.operations.get", + "parameters": { + "name": { + "location": "path", + "required": true, + "type": "string", + "description": "The name of the operation resource.", + "pattern": "^generatedFiles/[^/]+/operations/[^/]+$" + } + }, + "response": { + "$ref": "Operation" + }, + "flatPath": "v1beta/generatedFiles/{generatedFilesId}/operations/{operationsId}", + "httpMethod": "GET" + } } } } }, - "media": { + "auth_tokens": { "methods": { - "upload": { - "path": "v1beta/files", + "create": { + "flatPath": "v1beta/auth_tokens", "parameters": {}, - "description": "Creates a `File`.", + "id": "generativelanguage.auth_tokens.create", + "parameterOrder": [], + "description": "Creates a token that can be used to constrain the behavior of a BidiGenerateContent session.", "request": { - "$ref": "CreateFileRequest" + "$ref": "AuthToken" }, - "id": "generativelanguage.media.upload", "httpMethod": "POST", "response": { - "$ref": "CreateFileResponse" + "$ref": "AuthToken" }, + "path": "v1beta/auth_tokens" + } + } + }, + "cachedContents": { + "methods": { + "list": { + "id": "generativelanguage.cachedContents.list", "parameterOrder": [], - "mediaUpload": { - "accept": [ - "*/*" - ], - "maxSize": "2147483648", - "protocols": { - "resumable": { - "multipart": true, - "path": "/resumable/upload/v1beta/files" - }, - "simple": { - "multipart": true, - "path": "/upload/v1beta/files" - } + "description": "Lists CachedContents.", + "flatPath": "v1beta/cachedContents", + "parameters": { + "pageSize": { + "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.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "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.", + "location": "query", + "type": "string" } }, - "supportsMediaUpload": true, - "flatPath": "v1beta/files", + "path": "v1beta/cachedContents", + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/devstorage.read_only" - ] + ], + "response": { + "$ref": "ListCachedContentsResponse" + } }, - "uploadToFileSearchStore": { - "mediaUpload": { - "accept": [ - "*/*" - ], - "maxSize": "104857600", - "protocols": { - "resumable": { - "multipart": true, - "path": "/resumable/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" - }, - "simple": { - "multipart": true, - "path": "/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" - } + "delete": { + "path": "v1beta/{+name}", + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "response": { + "$ref": "Empty" + }, + "id": "generativelanguage.cachedContents.delete", + "parameterOrder": [ + "name" + ], + "description": "Deletes CachedContent resource.", + "flatPath": "v1beta/cachedContents/{cachedContentsId}", + "parameters": { + "name": { + "type": "string", + "required": true, + "location": "path", + "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`", + "pattern": "^cachedContents/[^/]+$" } + } + }, + "create": { + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "response": { + "$ref": "CachedContent" + }, + "request": { + "$ref": "CachedContent" }, - "supportsMediaUpload": true, - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore", + "httpMethod": "POST", + "path": "v1beta/cachedContents", + "parameters": {}, + "flatPath": "v1beta/cachedContents", + "description": "Creates CachedContent resource.", + "id": "generativelanguage.cachedContents.create", + "parameterOrder": [] + }, + "get": { + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/devstorage.read_only" ], - "httpMethod": "POST", "response": { - "$ref": "CustomLongRunningOperation" + "$ref": "CachedContent" + }, + "path": "v1beta/{+name}", + "flatPath": "v1beta/cachedContents/{cachedContentsId}", + "parameters": { + "name": { + "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`", + "pattern": "^cachedContents/[^/]+$", + "required": true, + "location": "path", + "type": "string" + } }, + "id": "generativelanguage.cachedContents.get", "parameterOrder": [ - "fileSearchStoreName" + "name" + ], + "description": "Reads CachedContent resource." + }, + "patch": { + "id": "generativelanguage.cachedContents.patch", + "parameterOrder": [ + "name" ], + "description": "Updates CachedContent resource (only expiration is updatable).", + "flatPath": "v1beta/cachedContents/{cachedContentsId}", "parameters": { - "fileSearchStoreName": { - "type": "string", - "location": "path", + "name": { "required": true, - "description": "Required. Immutable. The name of the `FileSearchStore` to upload the file into. Example: `fileSearchStores/my-file-search-store-123`", - "pattern": "^fileSearchStores/[^/]+$" + "location": "path", + "type": "string", + "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", + "pattern": "^cachedContents/[^/]+$" + }, + "updateMask": { + "format": "google-fieldmask", + "type": "string", + "location": "query", + "description": "The list of fields to update." } }, - "description": "Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document.", + "path": "v1beta/{+name}", "request": { - "$ref": "UploadToFileSearchStoreRequest" + "$ref": "CachedContent" }, - "id": "generativelanguage.media.uploadToFileSearchStore", - "path": "v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "response": { + "$ref": "CachedContent" + } } } }, - "dynamic": { + "corpora": { "methods": { - "generateContent": { - "httpMethod": "POST", - "response": { - "$ref": "GenerateContentResponse" + "get": { + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.corpora.get", + "path": "v1beta/{+name}", + "description": "Gets information about a specific `Corpus`.", + "flatPath": "v1beta/corpora/{corporaId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`", + "pattern": "^corpora/[^/]+$", + "type": "string", + "required": true, + "location": "path" + } }, + "response": { + "$ref": "Corpus" + } + }, + "delete": { + "id": "generativelanguage.corpora.delete", "parameterOrder": [ - "model" + "name" ], - "flatPath": "v1beta/dynamic/{dynamicId}:generateContent", - "path": "v1beta/{+model}:generateContent", + "path": "v1beta/{+name}", + "description": "Deletes a `Corpus`.", + "flatPath": "v1beta/corpora/{corporaId}", + "httpMethod": "DELETE", "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^dynamic/[^/]+$", + "name": { "type": "string", + "required": true, "location": "path", - "required": true + "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", + "pattern": "^corpora/[^/]+$" + }, + "force": { + "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.", + "location": "query", + "type": "boolean" } }, - "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.", - "request": { - "$ref": "GenerateContentRequest" - }, - "id": "generativelanguage.dynamic.generateContent" + "response": { + "$ref": "Empty" + } }, - "streamGenerateContent": { - "path": "v1beta/{+model}:streamGenerateContent", - "id": "generativelanguage.dynamic.streamGenerateContent", + "create": { + "httpMethod": "POST", "request": { - "$ref": "GenerateContentRequest" + "$ref": "Corpus" + }, + "response": { + "$ref": "Corpus" }, + "path": "v1beta/corpora", + "flatPath": "v1beta/corpora", + "parameters": {}, + "parameterOrder": [], + "id": "generativelanguage.corpora.create", + "description": "Creates an empty `Corpus`." + }, + "list": { + "flatPath": "v1beta/corpora", + "httpMethod": "GET", "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^dynamic/[^/]+$", - "type": "string", - "location": "path", - "required": true + "pageToken": { + "location": "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.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "type": "integer", + "location": "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." } }, - "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`.", - "parameterOrder": [ - "model" - ], "response": { - "$ref": "GenerateContentResponse" + "$ref": "ListCorporaResponse" }, - "httpMethod": "POST", - "flatPath": "v1beta/dynamic/{dynamicId}:streamGenerateContent" + "id": "generativelanguage.corpora.list", + "parameterOrder": [], + "path": "v1beta/corpora", + "description": "Lists all `Corpora` owned by the user." } - } - }, - "corpora": { + }, "resources": { "operations": { "methods": { "get": { + "flatPath": "v1beta/corpora/{corporaId}/operations/{operationsId}", "httpMethod": "GET", - "response": { - "$ref": "Operation" - }, - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], "parameters": { "name": { "description": "The name of the operation resource.", "pattern": "^corpora/[^/]+/operations/[^/]+$", "type": "string", - "location": "path", - "required": true - } - }, - "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.", - "id": "generativelanguage.corpora.operations.get", - "flatPath": "v1beta/corpora/{corporaId}/operations/{operationsId}" - } - } - }, - "permissions": { - "methods": { - "list": { - "id": "generativelanguage.corpora.permissions.list", - "flatPath": "v1beta/corpora/{corporaId}/permissions", - "parameters": { - "parent": { - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "pattern": "^corpora/[^/]+$", - "location": "path", "required": true, - "type": "string" - }, - "pageSize": { - "type": "integer", - "format": "int32", - "location": "query", - "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size." - }, - "pageToken": { - "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", - "type": "string", - "location": "query" + "location": "path" } }, - "description": "Lists permissions for the specific resource.", - "path": "v1beta/{+parent}/permissions", - "parameterOrder": [ - "parent" - ], "response": { - "$ref": "ListPermissionsResponse" - }, - "httpMethod": "GET" - }, - "get": { - "id": "generativelanguage.corpora.permissions.get", - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", - "parameters": { - "name": { - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "pattern": "^corpora/[^/]+/permissions/[^/]+$", - "type": "string", - "location": "path", - "required": true - } + "$ref": "Operation" }, - "description": "Gets information about a specific Permission.", - "path": "v1beta/{+name}", + "id": "generativelanguage.corpora.operations.get", "parameterOrder": [ "name" ], - "response": { - "$ref": "Permission" - }, - "httpMethod": "GET" - }, - "delete": { "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "id": "generativelanguage.corpora.permissions.delete", - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", - "parameters": { - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "pattern": "^corpora/[^/]+/permissions/[^/]+$" - } - }, - "description": "Deletes the permission." - }, + "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." + } + } + }, + "permissions": { + "methods": { "create": { - "path": "v1beta/{+parent}/permissions", + "httpMethod": "POST", "request": { "$ref": "Permission" }, - "id": "generativelanguage.corpora.permissions.create", + "response": { + "$ref": "Permission" + }, + "path": "v1beta/{+parent}/permissions", + "flatPath": "v1beta/corpora/{corporaId}/permissions", "parameters": { "parent": { "type": "string", - "location": "path", "required": true, + "location": "path", "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "pattern": "^corpora/[^/]+$" } }, - "description": "Create a permission to a specific resource.", "parameterOrder": [ "parent" ], - "httpMethod": "POST", + "id": "generativelanguage.corpora.permissions.create", + "description": "Create a permission to a specific resource." + }, + "get": { + "path": "v1beta/{+name}", + "description": "Gets information about a specific Permission.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.corpora.permissions.get", + "parameters": { + "name": { + "type": "string", + "required": true, + "location": "path", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^corpora/[^/]+/permissions/[^/]+$" + } + }, "response": { "$ref": "Permission" }, - "flatPath": "v1beta/corpora/{corporaId}/permissions" + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "httpMethod": "GET" }, "patch": { + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", "parameters": { "updateMask": { - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", - "type": "string", "format": "google-fieldmask", - "location": "query" + "type": "string", + "location": "query", + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)" }, "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.", @@ -6989,716 +7001,1044 @@ "required": true } }, - "description": "Updates the permission.", + "parameterOrder": [ + "name" + ], "id": "generativelanguage.corpora.permissions.patch", + "description": "Updates the permission.", + "httpMethod": "PATCH", "request": { "$ref": "Permission" }, - "path": "v1beta/{+name}", - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", "response": { "$ref": "Permission" }, - "httpMethod": "PATCH", + "path": "v1beta/{+name}" + }, + "list": { + "parameters": { + "parent": { + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^corpora/[^/]+$", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token." + }, + "pageSize": { + "format": "int32", + "type": "integer", + "location": "query", + "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size." + } + }, + "response": { + "$ref": "ListPermissionsResponse" + }, + "flatPath": "v1beta/corpora/{corporaId}/permissions", + "httpMethod": "GET", + "path": "v1beta/{+parent}/permissions", + "description": "Lists permissions for the specific resource.", + "id": "generativelanguage.corpora.permissions.list", "parameterOrder": [ - "name" + "parent" ] + }, + "delete": { + "parameters": { + "name": { + "location": "path", + "required": true, + "type": "string", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^corpora/[^/]+/permissions/[^/]+$" + } + }, + "response": { + "$ref": "Empty" + }, + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "httpMethod": "DELETE", + "path": "v1beta/{+name}", + "description": "Deletes the permission.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.corpora.permissions.delete" } } } - }, + } + }, + "tunedModels": { "methods": { - "get": { + "delete": { + "id": "generativelanguage.tunedModels.delete", + "parameterOrder": [ + "name" + ], + "path": "v1beta/{+name}", + "description": "Deletes a tuned model.", + "flatPath": "v1beta/tunedModels/{tunedModelsId}", + "httpMethod": "DELETE", "parameters": { "name": { - "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`", - "pattern": "^corpora/[^/]+$", - "location": "path", + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", + "pattern": "^tunedModels/[^/]+$", + "type": "string", "required": true, - "type": "string" + "location": "path" } }, - "description": "Gets information about a specific `Corpus`.", - "id": "generativelanguage.corpora.get", - "flatPath": "v1beta/corpora/{corporaId}", "response": { - "$ref": "Corpus" - }, - "httpMethod": "GET", - "path": "v1beta/{+name}", + "$ref": "Empty" + } + }, + "asyncBatchEmbedContent": { + "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", + "id": "generativelanguage.tunedModels.asyncBatchEmbedContent", "parameterOrder": [ - "name" - ] + "model" + ], + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}:asyncBatchEmbedContent", + "path": "v1beta/{+model}:asyncBatchEmbedContent", + "response": { + "$ref": "Operation" + }, + "request": { + "$ref": "AsyncBatchEmbedContentRequest" + }, + "httpMethod": "POST" }, - "delete": { + "get": { "parameters": { - "force": { - "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.", - "type": "boolean", - "location": "query" - }, "name": { + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", + "pattern": "^tunedModels/[^/]+$", "type": "string", - "location": "path", "required": true, - "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", - "pattern": "^corpora/[^/]+$" + "location": "path" } }, - "description": "Deletes a `Corpus`.", - "id": "generativelanguage.corpora.delete", - "flatPath": "v1beta/corpora/{corporaId}", "response": { - "$ref": "Empty" + "$ref": "TunedModel" }, - "httpMethod": "DELETE", + "flatPath": "v1beta/tunedModels/{tunedModelsId}", + "httpMethod": "GET", "path": "v1beta/{+name}", + "description": "Gets information about a specific TunedModel.", + "id": "generativelanguage.tunedModels.get", "parameterOrder": [ "name" ] }, - "list": { - "id": "generativelanguage.corpora.list", - "flatPath": "v1beta/corpora", + "patch": { + "path": "v1beta/{+name}", + "response": { + "$ref": "TunedModel" + }, + "httpMethod": "PATCH", + "request": { + "$ref": "TunedModel" + }, + "description": "Updates a tuned model.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.tunedModels.patch", "parameters": { - "pageSize": { - "description": "Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.", - "type": "integer", - "format": "int32", - "location": "query" + "name": { + "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", + "pattern": "^tunedModels/[^/]+$", + "type": "string", + "required": true, + "location": "path" }, - "pageToken": { + "updateMask": { + "format": "google-fieldmask", "type": "string", "location": "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." + "description": "Optional. The list of fields to update." } }, - "description": "Lists all `Corpora` owned by the user.", - "path": "v1beta/corpora", - "parameterOrder": [], + "flatPath": "v1beta/tunedModels/{tunedModelsId}" + }, + "transferOwnership": { "response": { - "$ref": "ListCorporaResponse" + "$ref": "TransferOwnershipResponse" }, - "httpMethod": "GET" - }, - "create": { - "path": "v1beta/corpora", - "parameters": {}, - "description": "Creates an empty `Corpus`.", - "id": "generativelanguage.corpora.create", "request": { - "$ref": "Corpus" + "$ref": "TransferOwnershipRequest" + }, + "httpMethod": "POST", + "path": "v1beta/{+name}:transferOwnership", + "parameters": { + "name": { + "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", + "pattern": "^tunedModels/[^/]+$", + "type": "string", + "location": "path", + "required": true + } + }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership", + "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.", + "id": "generativelanguage.tunedModels.transferOwnership", + "parameterOrder": [ + "name" + ] + }, + "streamGenerateContent": { + "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`.", + "parameterOrder": [ + "model" + ], + "id": "generativelanguage.tunedModels.streamGenerateContent", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$", + "type": "string", + "location": "path", + "required": true + } }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}:streamGenerateContent", + "path": "v1beta/{+model}:streamGenerateContent", "response": { - "$ref": "Corpus" + "$ref": "GenerateContentResponse" }, "httpMethod": "POST", - "parameterOrder": [], - "flatPath": "v1beta/corpora" - } - } - }, - "batches": { - "methods": { + "request": { + "$ref": "GenerateContentRequest" + } + }, "list": { + "id": "generativelanguage.tunedModels.list", + "parameterOrder": [], + "path": "v1beta/tunedModels", + "description": "Lists created tuned models.", + "flatPath": "v1beta/tunedModels", + "httpMethod": "GET", "parameters": { - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "The name of the operation's parent resource.", - "pattern": "^batches$" - }, - "filter": { - "description": "The standard list filter.", + "pageToken": { "type": "string", + "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.", "location": "query" }, "pageSize": { - "location": "query", - "type": "integer", "format": "int32", - "description": "The standard list page size." - }, - "pageToken": { - "type": "string", + "type": "integer", "location": "query", - "description": "The standard list page token." + "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." }, - "returnPartialSuccess": { - "type": "boolean", + "filter": { "location": "query", - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation." + "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", + "type": "string" } }, - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "id": "generativelanguage.batches.list", - "flatPath": "v1beta/batches", "response": { - "$ref": "ListOperationsResponse" - }, - "httpMethod": "GET", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ] + "$ref": "ListTunedModelsResponse" + } }, - "cancel": { - "id": "generativelanguage.batches.cancel", - "flatPath": "v1beta/batches/{batchesId}:cancel", - "parameters": { - "name": { - "type": "string", - "location": "path", - "required": true, - "description": "The name of the operation resource to be cancelled.", - "pattern": "^batches/[^/]+$" - } - }, - "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.", - "path": "v1beta/{+name}:cancel", + "generateText": { + "description": "Generates a response from the model given an input message.", "parameterOrder": [ - "name" + "model" ], - "httpMethod": "POST", - "response": { - "$ref": "Empty" - } - }, - "get": { - "id": "generativelanguage.batches.get", - "flatPath": "v1beta/batches/{batchesId}", + "id": "generativelanguage.tunedModels.generateText", "parameters": { - "name": { + "model": { "location": "path", "required": true, "type": "string", - "description": "The name of the operation resource.", - "pattern": "^batches/[^/]+$" + "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", + "pattern": "^tunedModels/[^/]+$" } }, - "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.", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], + "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText", + "path": "v1beta/{+model}:generateText", "response": { - "$ref": "Operation" + "$ref": "GenerateTextResponse" }, - "httpMethod": "GET" + "httpMethod": "POST", + "request": { + "$ref": "GenerateTextRequest" + } }, - "delete": { + "generateContent": { "response": { - "$ref": "Empty" + "$ref": "GenerateContentResponse" }, - "httpMethod": "DELETE", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], + "httpMethod": "POST", + "request": { + "$ref": "GenerateContentRequest" + }, + "path": "v1beta/{+model}:generateContent", "parameters": { - "name": { - "description": "The name of the operation resource to be deleted.", - "pattern": "^batches/[^/]+$", - "location": "path", + "model": { + "type": "string", "required": true, - "type": "string" + "location": "path", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$" } }, - "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", - "id": "generativelanguage.batches.delete", - "flatPath": "v1beta/batches/{batchesId}" + "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent", + "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.", + "parameterOrder": [ + "model" + ], + "id": "generativelanguage.tunedModels.generateContent" }, - "updateEmbedContentBatch": { - "request": { - "$ref": "EmbedContentBatch" - }, - "id": "generativelanguage.batches.updateEmbedContentBatch", + "batchGenerateContent": { + "flatPath": "v1beta/tunedModels/{tunedModelsId}:batchGenerateContent", "parameters": { - "name": { - "location": "path", + "model": { "required": true, + "location": "path", "type": "string", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", - "pattern": "^batches/[^/]+$" - }, - "updateMask": { - "type": "string", - "format": "google-fieldmask", - "location": "query", - "description": "Optional. The list of fields to update." + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$" } }, - "description": "Updates a batch of EmbedContent requests for batch processing.", - "path": "v1beta/{+name}:updateEmbedContentBatch", - "flatPath": "v1beta/batches/{batchesId}:updateEmbedContentBatch", + "id": "generativelanguage.tunedModels.batchGenerateContent", "parameterOrder": [ - "name" + "model" ], - "httpMethod": "PATCH", - "response": { - "$ref": "EmbedContentBatch" - } - }, - "updateGenerateContentBatch": { - "httpMethod": "PATCH", + "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", + "request": { + "$ref": "BatchGenerateContentRequest" + }, + "httpMethod": "POST", "response": { - "$ref": "GenerateContentBatch" + "$ref": "Operation" }, - "parameterOrder": [ - "name" - ], - "flatPath": "v1beta/batches/{batchesId}:updateGenerateContentBatch", - "path": "v1beta/{+name}:updateGenerateContentBatch", + "path": "v1beta/{+model}:batchGenerateContent" + }, + "create": { "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", - "pattern": "^batches/[^/]+$" - }, - "updateMask": { - "description": "Optional. The list of fields to update.", + "tunedModelId": { + "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.", "location": "query", - "type": "string", - "format": "google-fieldmask" + "type": "string" } }, - "description": "Updates a batch of GenerateContent requests for batch processing.", - "request": { - "$ref": "GenerateContentBatch" - }, - "id": "generativelanguage.batches.updateGenerateContentBatch" - } - } - }, - "generatedFiles": { - "methods": { - "list": { - "flatPath": "v1beta/generatedFiles", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], + "flatPath": "v1beta/tunedModels", + "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", "parameterOrder": [], + "id": "generativelanguage.tunedModels.create", "response": { - "$ref": "ListGeneratedFilesResponse" + "$ref": "Operation" }, - "httpMethod": "GET", - "id": "generativelanguage.generatedFiles.list", - "parameters": { - "pageSize": { - "type": "integer", - "format": "int32", - "location": "query", - "description": "Optional. Maximum number of `GeneratedFile`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 50." + "httpMethod": "POST", + "request": { + "$ref": "TunedModel" + }, + "path": "v1beta/tunedModels" + } + }, + "resources": { + "operations": { + "methods": { + "list": { + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.tunedModels.operations.list", + "path": "v1beta/{+name}/operations", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "pattern": "^tunedModels/[^/]+$", + "required": true, + "location": "path", + "type": "string" + }, + "filter": { + "type": "string", + "location": "query", + "description": "The standard list filter." + }, + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + }, + "returnPartialSuccess": { + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "location": "query", + "type": "boolean" + } + }, + "response": { + "$ref": "ListOperationsResponse" + } }, - "pageToken": { - "location": "query", - "type": "string", - "description": "Optional. A page token from a previous `ListGeneratedFiles` call." + "get": { + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^tunedModels/[^/]+/operations/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "response": { + "$ref": "Operation" + }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations/{operationsId}", + "httpMethod": "GET", + "path": "v1beta/{+name}", + "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.", + "id": "generativelanguage.tunedModels.operations.get", + "parameterOrder": [ + "name" + ] } - }, - "description": "Lists the generated files owned by the requesting project.", - "path": "v1beta/generatedFiles" - } - }, - "resources": { - "operations": { + } + }, + "permissions": { "methods": { + "create": { + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", + "parameters": { + "parent": { + "type": "string", + "location": "path", + "required": true, + "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^tunedModels/[^/]+$" + } + }, + "parameterOrder": [ + "parent" + ], + "id": "generativelanguage.tunedModels.permissions.create", + "description": "Create a permission to a specific resource.", + "httpMethod": "POST", + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "path": "v1beta/{+parent}/permissions" + }, "get": { + "parameters": { + "name": { + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", + "type": "string", + "required": true, + "location": "path" + } + }, "response": { - "$ref": "Operation" + "$ref": "Permission" }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", "httpMethod": "GET", "path": "v1beta/{+name}", + "description": "Gets information about a specific Permission.", "parameterOrder": [ "name" ], + "id": "generativelanguage.tunedModels.permissions.get" + }, + "patch": { "parameters": { "name": { + "type": "string", + "required": true, + "location": "path", + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" + }, + "updateMask": { + "location": "query", + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", + "format": "google-fieldmask", + "type": "string" + } + }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "description": "Updates the permission.", + "id": "generativelanguage.tunedModels.permissions.patch", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Permission" + }, + "request": { + "$ref": "Permission" + }, + "httpMethod": "PATCH", + "path": "v1beta/{+name}" + }, + "list": { + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", + "httpMethod": "GET", + "parameters": { + "parent": { + "type": "string", "location": "path", "required": true, + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^tunedModels/[^/]+$" + }, + "pageSize": { + "format": "int32", + "type": "integer", + "location": "query", + "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size." + }, + "pageToken": { "type": "string", - "description": "The name of the operation resource.", - "pattern": "^generatedFiles/[^/]+/operations/[^/]+$" + "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", + "location": "query" } }, - "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.", - "id": "generativelanguage.generatedFiles.operations.get", - "flatPath": "v1beta/generatedFiles/{generatedFilesId}/operations/{operationsId}" + "response": { + "$ref": "ListPermissionsResponse" + }, + "parameterOrder": [ + "parent" + ], + "id": "generativelanguage.tunedModels.permissions.list", + "path": "v1beta/{+parent}/permissions", + "description": "Lists permissions for the specific resource." + }, + "delete": { + "path": "v1beta/{+name}", + "description": "Deletes the permission.", + "id": "generativelanguage.tunedModels.permissions.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "location": "path", + "required": true, + "type": "string", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" + } + }, + "response": { + "$ref": "Empty" + }, + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "httpMethod": "DELETE" } } } } }, - "files": { + "fileSearchStores": { "methods": { - "register": { - "request": { - "$ref": "RegisterFilesRequest" - }, - "id": "generativelanguage.files.register", + "create": { "parameters": {}, - "description": "Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails.", - "path": "v1beta/files:register", - "flatPath": "v1beta/files:register", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], + "flatPath": "v1beta/fileSearchStores", + "description": "Creates an empty `FileSearchStore`.", + "id": "generativelanguage.fileSearchStores.create", "parameterOrder": [], - "httpMethod": "POST", "response": { - "$ref": "RegisterFilesResponse" - } + "$ref": "FileSearchStore" + }, + "request": { + "$ref": "FileSearchStore" + }, + "httpMethod": "POST", + "path": "v1beta/fileSearchStores" }, "get": { - "response": { - "$ref": "File" - }, - "httpMethod": "GET", + "path": "v1beta/{+name}", + "description": "Gets information about a specific `FileSearchStore`.", "parameterOrder": [ "name" ], - "flatPath": "v1beta/files/{filesId}", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "path": "v1beta/{+name}", + "id": "generativelanguage.fileSearchStores.get", "parameters": { "name": { - "description": "Required. The name of the `File` to get. Example: `files/abc-123`", - "pattern": "^files/[^/]+$", - "location": "path", + "type": "string", "required": true, - "type": "string" + "location": "path", + "description": "Required. The name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$" } }, - "description": "Gets the metadata for the given `File`.", - "id": "generativelanguage.files.get" + "response": { + "$ref": "FileSearchStore" + }, + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", + "httpMethod": "GET" }, - "delete": { - "path": "v1beta/{+name}", + "importFile": { + "path": "v1beta/{+fileSearchStoreName}:importFile", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "httpMethod": "POST", + "request": { + "$ref": "ImportFileRequest" + }, + "description": "Imports a `File` from File Service to a `FileSearchStore`.", + "parameterOrder": [ + "fileSearchStoreName" + ], + "id": "generativelanguage.fileSearchStores.importFile", "parameters": { - "name": { - "location": "path", + "fileSearchStoreName": { "required": true, + "location": "path", "type": "string", - "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", - "pattern": "^files/[^/]+$" + "description": "Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$" + } + }, + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:importFile" + }, + "list": { + "path": "v1beta/fileSearchStores", + "description": "Lists all `FileSearchStores` owned by the user.", + "id": "generativelanguage.fileSearchStores.list", + "parameterOrder": [], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. A page token, received from a previous `ListFileSearchStores` 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 `ListFileSearchStores` must match the call that provided the page token.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "type": "integer", + "location": "query", + "description": "Optional. The maximum number of `FileSearchStores` to return (per page). The service may return fewer `FileSearchStores`. If unspecified, at most 10 `FileSearchStores` will be returned. The maximum size limit is 20 `FileSearchStores` per page." } }, - "description": "Deletes the `File`.", - "id": "generativelanguage.files.delete", - "httpMethod": "DELETE", "response": { - "$ref": "Empty" + "$ref": "ListFileSearchStoresResponse" }, + "flatPath": "v1beta/fileSearchStores", + "httpMethod": "GET" + }, + "delete": { "parameterOrder": [ "name" ], - "flatPath": "v1beta/files/{filesId}", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ] - }, - "list": { - "flatPath": "v1beta/files", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "parameterOrder": [], - "response": { - "$ref": "ListFilesResponse" - }, - "httpMethod": "GET", - "id": "generativelanguage.files.list", + "id": "generativelanguage.fileSearchStores.delete", + "path": "v1beta/{+name}", + "description": "Deletes a `FileSearchStore`.", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", + "httpMethod": "DELETE", "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "format": "int32", - "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100." + "name": { + "description": "Required. The resource name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$", + "required": true, + "location": "path", + "type": "string" }, - "pageToken": { - "description": "Optional. A page token from a previous `ListFiles` call.", + "force": { + "description": "Optional. If set to true, any `Document`s and objects related to this `FileSearchStore` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `FileSearchStore` contains any `Document`s.", "location": "query", - "type": "string" + "type": "boolean" } }, - "description": "Lists the metadata for `File`s owned by the requesting project.", - "path": "v1beta/files" + "response": { + "$ref": "Empty" + } } - } - }, - "fileSearchStores": { + }, "resources": { - "operations": { - "methods": { - "get": { - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Operation" - }, - "httpMethod": "GET", - "id": "generativelanguage.fileSearchStores.operations.get", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation resource.", - "pattern": "^fileSearchStores/[^/]+/operations/[^/]+$" + "upload": { + "resources": { + "operations": { + "methods": { + "get": { + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the operation resource.", + "pattern": "^fileSearchStores/[^/]+/upload/operations/[^/]+$" + } + }, + "response": { + "$ref": "Operation" + }, + "id": "generativelanguage.fileSearchStores.upload.operations.get", + "parameterOrder": [ + "name" + ], + "path": "v1beta/{+name}", + "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." } - }, - "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." + } } } }, "documents": { "methods": { "get": { - "id": "generativelanguage.fileSearchStores.documents.get", "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", + "httpMethod": "GET", "parameters": { "name": { + "type": "string", "location": "path", "required": true, - "type": "string", "description": "Required. The name of the `Document` to retrieve. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$" } }, - "description": "Gets information about a specific `Document`.", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", "response": { "$ref": "Document" - } - }, - "delete": { - "response": { - "$ref": "Empty" }, - "httpMethod": "DELETE", - "path": "v1beta/{+name}", "parameterOrder": [ "name" ], + "id": "generativelanguage.fileSearchStores.documents.get", + "path": "v1beta/{+name}", + "description": "Gets information about a specific `Document`." + }, + "delete": { "parameters": { - "force": { - "location": "query", - "type": "boolean", - "description": "Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s." - }, "name": { - "description": "Required. The resource name of the `Document` to delete. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", - "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$", "type": "string", + "required": true, "location": "path", - "required": true + "description": "Required. The resource name of the `Document` to delete. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", + "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$" + }, + "force": { + "location": "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.", + "type": "boolean" } }, + "response": { + "$ref": "Empty" + }, + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", + "httpMethod": "DELETE", + "path": "v1beta/{+name}", "description": "Deletes a `Document`.", "id": "generativelanguage.fileSearchStores.documents.delete", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}" + "parameterOrder": [ + "name" + ] }, "list": { - "path": "v1beta/{+parent}/documents", + "id": "generativelanguage.fileSearchStores.documents.list", "parameterOrder": [ "parent" ], - "httpMethod": "GET", - "response": { - "$ref": "ListDocumentsResponse" - }, - "id": "generativelanguage.fileSearchStores.documents.list", + "path": "v1beta/{+parent}/documents", + "description": "Lists all `Document`s in a `Corpus`.", "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents", + "httpMethod": "GET", "parameters": { - "pageSize": { - "type": "integer", - "format": "int32", - "location": "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." - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token." - }, "parent": { - "location": "path", "required": true, + "location": "path", "type": "string", "description": "Required. The name of the `FileSearchStore` containing `Document`s. Example: `fileSearchStores/my-file-search-store-123`", "pattern": "^fileSearchStores/[^/]+$" + }, + "pageSize": { + "description": "Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.", + "location": "query", + "type": "string" } }, - "description": "Lists all `Document`s in a `Corpus`." + "response": { + "$ref": "ListDocumentsResponse" + } } } }, - "upload": { - "resources": { - "operations": { - "methods": { - "get": { - "id": "generativelanguage.fileSearchStores.upload.operations.get", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}", - "parameters": { - "name": { - "description": "The name of the operation resource.", - "pattern": "^fileSearchStores/[^/]+/upload/operations/[^/]+$", - "type": "string", - "location": "path", - "required": true - } - }, - "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.", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "response": { - "$ref": "Operation" - } + "operations": { + "methods": { + "get": { + "path": "v1beta/{+name}", + "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.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.fileSearchStores.operations.get", + "parameters": { + "name": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the operation resource.", + "pattern": "^fileSearchStores/[^/]+/operations/[^/]+$" } - } + }, + "response": { + "$ref": "Operation" + }, + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}", + "httpMethod": "GET" } } } - }, + } + }, + "batches": { "methods": { - "create": { - "flatPath": "v1beta/fileSearchStores", - "response": { - "$ref": "FileSearchStore" + "delete": { + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "pattern": "^batches/[^/]+$", + "required": true, + "location": "path", + "type": "string" + } }, - "httpMethod": "POST", - "parameterOrder": [], - "parameters": {}, - "description": "Creates an empty `FileSearchStore`.", - "id": "generativelanguage.fileSearchStores.create", - "request": { - "$ref": "FileSearchStore" + "response": { + "$ref": "Empty" }, - "path": "v1beta/fileSearchStores" + "flatPath": "v1beta/batches/{batchesId}", + "httpMethod": "DELETE", + "path": "v1beta/{+name}", + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.batches.delete" }, - "get": { - "id": "generativelanguage.fileSearchStores.get", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", + "updateEmbedContentBatch": { + "description": "Updates a batch of EmbedContent requests for batch processing.", + "id": "generativelanguage.batches.updateEmbedContentBatch", + "parameterOrder": [ + "name" + ], "parameters": { "name": { - "location": "path", "required": true, + "location": "path", + "type": "string", + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", + "pattern": "^batches/[^/]+$" + }, + "updateMask": { + "format": "google-fieldmask", "type": "string", - "description": "Required. The name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", - "pattern": "^fileSearchStores/[^/]+$" + "location": "query", + "description": "Optional. The list of fields to update." } }, - "description": "Gets information about a specific `FileSearchStore`.", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", + "flatPath": "v1beta/batches/{batchesId}:updateEmbedContentBatch", + "path": "v1beta/{+name}:updateEmbedContentBatch", "response": { - "$ref": "FileSearchStore" - } + "$ref": "EmbedContentBatch" + }, + "request": { + "$ref": "EmbedContentBatch" + }, + "httpMethod": "PATCH" }, - "delete": { - "id": "generativelanguage.fileSearchStores.delete", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", + "list": { "parameters": { - "force": { - "location": "query", + "pageToken": { + "type": "string", + "description": "The standard list page token.", + "location": "query" + }, + "returnPartialSuccess": { "type": "boolean", - "description": "Optional. If set to true, any `Document`s and objects related to this `FileSearchStore` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `FileSearchStore` contains any `Document`s." + "location": "query", + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation." + }, + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "type": "integer" + }, + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" }, "name": { "type": "string", "location": "path", "required": true, - "description": "Required. The resource name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", - "pattern": "^fileSearchStores/[^/]+$" + "description": "The name of the operation's parent resource.", + "pattern": "^batches$" } }, - "description": "Deletes a `FileSearchStore`.", + "response": { + "$ref": "ListOperationsResponse" + }, + "flatPath": "v1beta/batches", + "httpMethod": "GET", "path": "v1beta/{+name}", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "id": "generativelanguage.batches.list", "parameterOrder": [ "name" - ], - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - } + ] }, - "list": { + "updateGenerateContentBatch": { + "id": "generativelanguage.batches.updateGenerateContentBatch", + "parameterOrder": [ + "name" + ], + "description": "Updates a batch of GenerateContent requests for batch processing.", + "flatPath": "v1beta/batches/{batchesId}:updateGenerateContentBatch", "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "format": "int32", - "description": "Optional. The maximum number of `FileSearchStores` to return (per page). The service may return fewer `FileSearchStores`. If unspecified, at most 10 `FileSearchStores` will be returned. The maximum size limit is 20 `FileSearchStores` per page." + "name": { + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", + "pattern": "^batches/[^/]+$", + "type": "string", + "required": true, + "location": "path" }, - "pageToken": { + "updateMask": { + "description": "Optional. The list of fields to update.", "location": "query", "type": "string", - "description": "Optional. A page token, received from a previous `ListFileSearchStores` 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 `ListFileSearchStores` must match the call that provided the page token." + "format": "google-fieldmask" } }, - "description": "Lists all `FileSearchStores` owned by the user.", - "id": "generativelanguage.fileSearchStores.list", - "flatPath": "v1beta/fileSearchStores", - "httpMethod": "GET", - "response": { - "$ref": "ListFileSearchStoresResponse" + "path": "v1beta/{+name}:updateGenerateContentBatch", + "request": { + "$ref": "GenerateContentBatch" }, - "path": "v1beta/fileSearchStores", - "parameterOrder": [] + "httpMethod": "PATCH", + "response": { + "$ref": "GenerateContentBatch" + } }, - "importFile": { + "get": { + "flatPath": "v1beta/batches/{batchesId}", + "httpMethod": "GET", "parameters": { - "fileSearchStoreName": { + "name": { + "type": "string", "location": "path", "required": true, - "type": "string", - "description": "Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123`", - "pattern": "^fileSearchStores/[^/]+$" + "description": "The name of the operation resource.", + "pattern": "^batches/[^/]+$" } }, - "description": "Imports a `File` from File Service to a `FileSearchStore`.", - "request": { - "$ref": "ImportFileRequest" - }, - "id": "generativelanguage.fileSearchStores.importFile", - "path": "v1beta/{+fileSearchStoreName}:importFile", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:importFile", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "httpMethod": "POST", "response": { "$ref": "Operation" }, + "id": "generativelanguage.batches.get", "parameterOrder": [ - "fileSearchStoreName" - ] + "name" + ], + "path": "v1beta/{+name}", + "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." + }, + "cancel": { + "path": "v1beta/{+name}:cancel", + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.", + "parameterOrder": [ + "name" + ], + "id": "generativelanguage.batches.cancel", + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "pattern": "^batches/[^/]+$", + "type": "string", + "required": true, + "location": "path" + } + }, + "response": { + "$ref": "Empty" + }, + "flatPath": "v1beta/batches/{batchesId}:cancel", + "httpMethod": "POST" } } } }, + "title": "Gemini API", + "discoveryVersion": "v1", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "fullyEncodeReservedExpansion": true, + "version_module": true, + "revision": "20260703", "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.", - "ownerDomain": "google.com", + "id": "generativelanguage:v1beta", + "name": "generativelanguage", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + } + } + } + }, + "protocol": "rest", "parameters": { + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", "default": "true", @@ -7706,81 +8046,63 @@ "type": "boolean" }, "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "description": "V1 error format.", "type": "string", + "location": "query", + "description": "V1 error format.", "enum": [ "1", "2" ], - "location": "query" - }, - "alt": { "enumDescriptions": [ - "Responses with Content-Type of application/json", - "Media download with context-dependent Content-Type", - "Responses with Content-Type of application/x-protobuf" - ], - "default": "json", - "type": "string", - "enum": [ - "json", - "media", - "proto" - ], - "location": "query", - "description": "Data format for response." - }, - "access_token": { - "location": "query", - "type": "string", - "description": "OAuth access token." - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" + "v1 error format", + "v2 error format" + ] }, - "key": { + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", "location": "query", - "type": "string", - "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." + "type": "string" }, "quotaUser": { "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", "location": "query", "type": "string" }, - "oauth_token": { + "upload_protocol": { "location": "query", - "type": "string", - "description": "OAuth 2.0 token for the current user." + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" }, - "callback": { + "access_token": { "type": "string", - "location": "query", - "description": "JSONP" + "description": "OAuth access token.", + "location": "query" }, - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", "location": "query", "type": "string" }, - "uploadType": { + "alt": { + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "description": "Data format for response.", "type": "string", - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + "location": "query" } }, - "id": "generativelanguage:v1beta", - "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/", - "batchPath": "batch", - "ownerName": "Google", - "version": "v1beta", - "baseUrl": "https://generativelanguage.googleapis.com/", - "discoveryVersion": "v1", - "servicePath": "" + "basePath": "", + "ownerDomain": "google.com", + "canonicalName": "Generative Language", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/" }