{
  "version_module": true,
  "protocol": "rest",
  "id": "generativelanguage:v1beta3",
  "canonicalName": "Generative Language",
  "ownerName": "Google",
  "batchPath": "batch",
  "title": "Generative Language API",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "kind": "discovery#restDescription",
  "fullyEncodeReservedExpansion": true,
  "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.",
  "name": "generativelanguage",
  "servicePath": "",
  "documentationLink": "https://developers.generativeai.google/api",
  "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/",
  "schemas": {
    "Model": {
      "type": "object",
      "description": "Information about a Generative Language Model.",
      "id": "Model",
      "properties": {
        "maxTemperature": {
          "description": "The maximum temperature this model can use.",
          "type": "number",
          "format": "float"
        },
        "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"
        },
        "description": {
          "type": "string",
          "description": "A short description of the model."
        },
        "supportedGenerationMethods": {
          "items": {
            "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`.",
          "type": "array"
        },
        "baseModelId": {
          "type": "string",
          "description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`"
        },
        "topK": {
          "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.",
          "type": "integer",
          "format": "int32"
        },
        "thinking": {
          "type": "boolean",
          "description": "Whether the model supports thinking."
        },
        "outputTokenLimit": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of output tokens available for this model."
        },
        "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"
        },
        "inputTokenLimit": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of input tokens allowed for this model."
        },
        "version": {
          "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)",
          "type": "string"
        },
        "displayName": {
          "type": "string",
          "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."
        },
        "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."
        }
      }
    },
    "BatchEmbedTextRequest": {
      "type": "object",
      "id": "BatchEmbedTextRequest",
      "properties": {
        "requests": {
          "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.",
          "items": {
            "$ref": "EmbedTextRequest"
          },
          "type": "array"
        },
        "texts": {
          "items": {
            "type": "string"
          },
          "description": "Optional. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown.",
          "type": "array"
        }
      },
      "description": "Batch request to get a text embedding from the model."
    },
    "ListModelsResponse": {
      "type": "object",
      "id": "ListModelsResponse",
      "properties": {
        "models": {
          "items": {
            "$ref": "Model"
          },
          "description": "The returned Models.",
          "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."
        }
      },
      "description": "Response from `ListModel` containing a paginated list of Models."
    },
    "TransferOwnershipResponse": {
      "type": "object",
      "description": "Response from `TransferOwnership`.",
      "id": "TransferOwnershipResponse",
      "properties": {}
    },
    "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.",
      "id": "SafetyFeedback",
      "properties": {
        "rating": {
          "$ref": "SafetyRating",
          "description": "Safety rating evaluated from content."
        },
        "setting": {
          "$ref": "SafetySetting",
          "description": "Safety settings applied to the request."
        }
      },
      "type": "object"
    },
    "CreateTunedModelMetadata": {
      "id": "CreateTunedModelMetadata",
      "properties": {
        "tunedModel": {
          "type": "string",
          "description": "Name of the tuned model associated with the tuning operation."
        },
        "snapshots": {
          "description": "Metrics collected during tuning.",
          "items": {
            "$ref": "TuningSnapshot"
          },
          "type": "array"
        },
        "completedSteps": {
          "description": "The number of steps completed.",
          "type": "integer",
          "format": "int32"
        },
        "completedPercent": {
          "description": "The completed percentage for the tuning operation.",
          "type": "number",
          "format": "float"
        },
        "totalSteps": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of tuning steps."
        }
      },
      "description": "Metadata about the state and progress of creating a tuned model returned from the long-running operation",
      "type": "object"
    },
    "BatchEmbedTextResponse": {
      "type": "object",
      "description": "The response to a EmbedTextRequest.",
      "id": "BatchEmbedTextResponse",
      "properties": {
        "embeddings": {
          "description": "Output only. The embeddings generated from the input text.",
          "items": {
            "$ref": "Embedding"
          },
          "readOnly": true,
          "type": "array"
        }
      }
    },
    "CountTextTokensRequest": {
      "type": "object",
      "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
      "id": "CountTextTokensRequest",
      "properties": {
        "prompt": {
          "description": "Required. The free-form input text given to the model as a prompt.",
          "$ref": "TextPrompt"
        }
      }
    },
    "CountMessageTokensRequest": {
      "id": "CountMessageTokensRequest",
      "properties": {
        "prompt": {
          "$ref": "MessagePrompt",
          "description": "Required. The prompt, whose token count is to be returned."
        }
      },
      "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
      "type": "object"
    },
    "TuningExamples": {
      "id": "TuningExamples",
      "properties": {
        "examples": {
          "items": {
            "$ref": "TuningExample"
          },
          "description": "The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.",
          "type": "array"
        }
      },
      "description": "A set of tuning examples. Can be training or validation data.",
      "type": "object"
    },
    "Status": {
      "type": "object",
      "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
      "id": "Status",
      "properties": {
        "message": {
          "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": {
          "description": "The status code, which should be an enum value of google.rpc.Code.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "Embedding": {
      "type": "object",
      "id": "Embedding",
      "properties": {
        "value": {
          "type": "array",
          "items": {
            "type": "number",
            "format": "float"
          },
          "description": "The embedding values."
        }
      },
      "description": "A list of floats representing the embedding."
    },
    "GenerateTextResponse": {
      "id": "GenerateTextResponse",
      "properties": {
        "candidates": {
          "type": "array",
          "description": "Candidate responses from the model.",
          "items": {
            "$ref": "TextCompletion"
          }
        },
        "filters": {
          "type": "array",
          "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API).",
          "items": {
            "$ref": "ContentFilter"
          }
        },
        "safetyFeedback": {
          "type": "array",
          "items": {
            "$ref": "SafetyFeedback"
          },
          "description": "Returns any safety feedback related to content filtering."
        }
      },
      "description": "The response from the model, including candidate completions.",
      "type": "object"
    },
    "GenerateMessageResponse": {
      "id": "GenerateMessageResponse",
      "properties": {
        "candidates": {
          "items": {
            "$ref": "Message"
          },
          "description": "Candidate response messages from the model.",
          "type": "array"
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "Message"
          },
          "description": "The conversation history used by the model."
        },
        "filters": {
          "type": "array",
          "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category.",
          "items": {
            "$ref": "ContentFilter"
          }
        }
      },
      "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.",
      "type": "object"
    },
    "ContentFilter": {
      "id": "ContentFilter",
      "properties": {
        "reason": {
          "description": "The reason content was blocked during request processing.",
          "enumDescriptions": [
            "A blocked reason was not specified.",
            "Content was blocked by safety settings.",
            "Content was blocked, but the reason is uncategorized."
          ],
          "enum": [
            "BLOCKED_REASON_UNSPECIFIED",
            "SAFETY",
            "OTHER"
          ],
          "type": "string"
        },
        "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.",
      "type": "object"
    },
    "EmbedTextRequest": {
      "type": "object",
      "description": "Request to get a text embedding from the model.",
      "id": "EmbedTextRequest",
      "properties": {
        "model": {
          "type": "string",
          "description": "Required. The model name to use with the format model=models/{model}."
        },
        "text": {
          "type": "string",
          "description": "Optional. The free-form input text that the model will turn into an embedding."
        }
      }
    },
    "SafetyRating": {
      "id": "SafetyRating",
      "properties": {
        "probability": {
          "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"
          ],
          "type": "string"
        },
        "category": {
          "type": "string",
          "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"
          ]
        },
        "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.",
      "type": "object"
    },
    "TunedModel": {
      "type": "object",
      "id": "TunedModel",
      "properties": {
        "tunedModelSource": {
          "description": "Optional. TunedModel to use as the starting point for training the new model.",
          "$ref": "TunedModelSource"
        },
        "state": {
          "enum": [
            "STATE_UNSPECIFIED",
            "CREATING",
            "ACTIVE",
            "FAILED"
          ],
          "readOnly": true,
          "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."
          ],
          "type": "string"
        },
        "baseModel": {
          "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`",
          "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."
        },
        "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."
        },
        "tuningTask": {
          "description": "Required. The tuning task that creates the tuned model.",
          "$ref": "TuningTask"
        },
        "readerProjectNumbers": {
          "items": {
            "type": "string",
            "format": "int64"
          },
          "description": "Optional. List of project numbers that have read access to the tuned model.",
          "type": "array"
        },
        "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."
        },
        "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"
        },
        "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."
        },
        "updateTime": {
          "description": "Output only. The timestamp when this model was updated.",
          "readOnly": true,
          "type": "string",
          "format": "google-datetime"
        },
        "createTime": {
          "description": "Output only. The timestamp when this model was created.",
          "type": "string",
          "format": "google-datetime",
          "readOnly": true
        }
      },
      "description": "A fine-tuned model created using ModelService.CreateTunedModel."
    },
    "Hyperparameters": {
      "type": "object",
      "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance",
      "id": "Hyperparameters",
      "properties": {
        "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.",
          "type": "number",
          "format": "float"
        },
        "learningRateMultiplier": {
          "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.",
          "type": "number",
          "format": "float"
        },
        "epochCount": {
          "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used.",
          "type": "integer",
          "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."
        }
      }
    },
    "MessagePrompt": {
      "type": "object",
      "id": "MessagePrompt",
      "properties": {
        "context": {
          "type": "string",
          "description": "Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: \"Translate the phrase from English to French.\" or \"Given a statement, classify the sentiment as happy, sad or neutral.\" Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated."
        },
        "examples": {
          "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"
        },
        "messages": {
          "type": "array",
          "items": {
            "$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`."
        }
      },
      "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."
    },
    "Example": {
      "id": "Example",
      "properties": {
        "input": {
          "$ref": "Message",
          "description": "Required. An example of an input `Message` from the user."
        },
        "output": {
          "description": "Required. An example of what the model should output given the input.",
          "$ref": "Message"
        }
      },
      "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.",
      "type": "object"
    },
    "Empty": {
      "type": "object",
      "id": "Empty",
      "properties": {},
      "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); }"
    },
    "EmbedTextResponse": {
      "description": "The response to a EmbedTextRequest.",
      "id": "EmbedTextResponse",
      "properties": {
        "embedding": {
          "$ref": "Embedding",
          "description": "Output only. The embedding generated from the input text.",
          "readOnly": true
        }
      },
      "type": "object"
    },
    "CountTextTokensResponse": {
      "type": "object",
      "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.",
      "id": "CountTextTokensResponse",
      "properties": {
        "tokenCount": {
          "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "CountMessageTokensResponse": {
      "type": "object",
      "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.",
      "id": "CountMessageTokensResponse",
      "properties": {
        "tokenCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative."
        }
      }
    },
    "TextCompletion": {
      "type": "object",
      "description": "Output text returned from a model.",
      "id": "TextCompletion",
      "properties": {
        "output": {
          "description": "Output only. The generated text returned from the model.",
          "readOnly": true,
          "type": "string"
        },
        "safetyRatings": {
          "type": "array",
          "description": "Ratings for the safety of a response. There is at most one rating per category.",
          "items": {
            "$ref": "SafetyRating"
          }
        },
        "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`.",
          "$ref": "CitationMetadata",
          "readOnly": true
        }
      }
    },
    "CitationMetadata": {
      "type": "object",
      "description": "A collection of source attributions for a piece of content.",
      "id": "CitationMetadata",
      "properties": {
        "citationSources": {
          "type": "array",
          "description": "Citations to sources for a specific response.",
          "items": {
            "$ref": "CitationSource"
          }
        }
      }
    },
    "TuningExample": {
      "type": "object",
      "id": "TuningExample",
      "properties": {
        "output": {
          "description": "Required. The expected model output.",
          "type": "string"
        },
        "textInput": {
          "type": "string",
          "description": "Optional. Text model input."
        }
      },
      "description": "A single example for tuning."
    },
    "ListTunedModelsResponse": {
      "type": "object",
      "description": "Response from `ListTunedModels` containing a paginated list of Models.",
      "id": "ListTunedModelsResponse",
      "properties": {
        "tunedModels": {
          "type": "array",
          "items": {
            "$ref": "TunedModel"
          },
          "description": "The returned Models."
        },
        "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."
        }
      }
    },
    "Permission": {
      "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete",
      "id": "Permission",
      "properties": {
        "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."
        },
        "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": {
          "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"
          ],
          "type": "string"
        },
        "role": {
          "description": "Required. The role granted by this permission.",
          "enumDescriptions": [
            "The default value. This value is unused.",
            "Owner can use, update, share and delete the resource.",
            "Writer can use, update and share the resource.",
            "Reader can use the resource."
          ],
          "enum": [
            "ROLE_UNSPECIFIED",
            "OWNER",
            "WRITER",
            "READER"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "GenerateTextRequest": {
      "type": "object",
      "description": "Request to generate a text completion response from the model.",
      "id": "GenerateTextRequest",
      "properties": {
        "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."
        },
        "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"
        },
        "safetySettings": {
          "items": {
            "$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.",
          "type": "array"
        },
        "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."
        },
        "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"
        },
        "topP": {
          "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function.",
          "type": "number",
          "format": "float"
        },
        "prompt": {
          "$ref": "TextPrompt",
          "description": "Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text."
        },
        "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"
        }
      }
    },
    "SafetySetting": {
      "id": "SafetySetting",
      "properties": {
        "category": {
          "enum": [
            "HARM_CATEGORY_UNSPECIFIED",
            "HARM_CATEGORY_DEROGATORY",
            "HARM_CATEGORY_TOXICITY",
            "HARM_CATEGORY_VIOLENCE",
            "HARM_CATEGORY_SEXUAL",
            "HARM_CATEGORY_MEDICAL",
            "HARM_CATEGORY_DANGEROUS",
            "HARM_CATEGORY_HARASSMENT",
            "HARM_CATEGORY_HATE_SPEECH",
            "HARM_CATEGORY_SEXUALLY_EXPLICIT",
            "HARM_CATEGORY_DANGEROUS_CONTENT",
            "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."
          ],
          "type": "string",
          "enumDeprecated": [
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            true
          ]
        },
        "threshold": {
          "description": "Required. Controls the probability threshold at which harm is blocked.",
          "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"
          ],
          "type": "string"
        }
      },
      "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.",
      "type": "object"
    },
    "GenerateMessageRequest": {
      "type": "object",
      "description": "Request to generate a message response from the model.",
      "id": "GenerateMessageRequest",
      "properties": {
        "candidateCount": {
          "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.",
          "type": "integer",
          "format": "int32"
        },
        "prompt": {
          "$ref": "MessagePrompt",
          "description": "Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion."
        },
        "topP": {
          "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`.",
          "type": "number",
          "format": "float"
        },
        "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."
        },
        "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."
        }
      }
    },
    "ListPermissionsResponse": {
      "description": "Response from `ListPermissions` containing a paginated list of permissions.",
      "id": "ListPermissionsResponse",
      "properties": {
        "nextPageToken": {
          "type": "string",
          "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."
        },
        "permissions": {
          "type": "array",
          "items": {
            "$ref": "Permission"
          },
          "description": "Returned permissions."
        }
      },
      "type": "object"
    },
    "TransferOwnershipRequest": {
      "type": "object",
      "description": "Request to transfer the ownership of the tuned model.",
      "id": "TransferOwnershipRequest",
      "properties": {
        "emailAddress": {
          "description": "Required. The email address of the user to whom the tuned model is being transferred to.",
          "type": "string"
        }
      }
    },
    "CitationSource": {
      "description": "A citation to a source for a portion of a specific response.",
      "id": "CitationSource",
      "properties": {
        "endIndex": {
          "type": "integer",
          "format": "int32",
          "description": "Optional. End of the attributed segment, exclusive."
        },
        "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"
        },
        "uri": {
          "type": "string",
          "description": "Optional. URI that is attributed as a source for a portion of the text."
        },
        "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"
        }
      },
      "type": "object"
    },
    "TuningTask": {
      "type": "object",
      "description": "Tuning tasks that create tuned models.",
      "id": "TuningTask",
      "properties": {
        "hyperparameters": {
          "$ref": "Hyperparameters",
          "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used."
        },
        "trainingData": {
          "$ref": "Dataset",
          "description": "Required. Input only. Immutable. The model training data."
        },
        "startTime": {
          "description": "Output only. The timestamp when tuning this model started.",
          "type": "string",
          "format": "google-datetime",
          "readOnly": true
        },
        "snapshots": {
          "readOnly": true,
          "type": "array",
          "description": "Output only. Metrics collected during tuning.",
          "items": {
            "$ref": "TuningSnapshot"
          }
        },
        "completeTime": {
          "type": "string",
          "format": "google-datetime",
          "readOnly": true,
          "description": "Output only. The timestamp when tuning this model completed."
        }
      }
    },
    "TunedModelSource": {
      "description": "Tuned model as a source for training a new model.",
      "id": "TunedModelSource",
      "properties": {
        "tunedModel": {
          "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`"
        },
        "baseModel": {
          "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`",
          "type": "string",
          "readOnly": true
        }
      },
      "type": "object"
    },
    "TextPrompt": {
      "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.",
      "id": "TextPrompt",
      "properties": {
        "text": {
          "description": "Required. The prompt text.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Operation": {
      "description": "This resource represents a long-running operation that is the result of a network API call.",
      "id": "Operation",
      "properties": {
        "error": {
          "description": "The error result of the operation in case of failure or cancellation.",
          "$ref": "Status"
        },
        "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"
          }
        },
        "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"
          }
        },
        "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."
        },
        "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}`."
        }
      },
      "type": "object"
    },
    "Message": {
      "type": "object",
      "description": "The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text.",
      "id": "Message",
      "properties": {
        "content": {
          "description": "Required. The text content of the structured `Message`.",
          "type": "string"
        },
        "citationMetadata": {
          "readOnly": true,
          "$ref": "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."
        },
        "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"
        }
      }
    },
    "TuningSnapshot": {
      "description": "Record for a single tuning step.",
      "id": "TuningSnapshot",
      "properties": {
        "step": {
          "type": "integer",
          "format": "int32",
          "readOnly": true,
          "description": "Output only. The tuning step."
        },
        "computeTime": {
          "type": "string",
          "format": "google-datetime",
          "readOnly": true,
          "description": "Output only. The timestamp when this metric was computed."
        },
        "epoch": {
          "description": "Output only. The epoch this step was part of.",
          "type": "integer",
          "format": "int32",
          "readOnly": true
        },
        "meanLoss": {
          "description": "Output only. The mean loss of the training examples for this step.",
          "type": "number",
          "format": "float",
          "readOnly": true
        }
      },
      "type": "object"
    },
    "Dataset": {
      "description": "Dataset for training or validation.",
      "id": "Dataset",
      "properties": {
        "examples": {
          "$ref": "TuningExamples",
          "description": "Optional. Inline examples with simple input/output text."
        }
      },
      "type": "object"
    }
  },
  "resources": {
    "tunedModels": {
      "methods": {
        "get": {
          "flatPath": "v1beta3/tunedModels/{tunedModelsId}",
          "description": "Gets information about a specific TunedModel.",
          "parameters": {
            "name": {
              "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`",
              "pattern": "^tunedModels/[^/]+$",
              "type": "string",
              "required": true,
              "location": "path"
            }
          },
          "id": "generativelanguage.tunedModels.get",
          "httpMethod": "GET",
          "parameterOrder": [
            "name"
          ],
          "response": {
            "$ref": "TunedModel"
          },
          "path": "v1beta3/{+name}"
        },
        "transferOwnership": {
          "httpMethod": "POST",
          "parameterOrder": [
            "name"
          ],
          "request": {
            "$ref": "TransferOwnershipRequest"
          },
          "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.",
          "flatPath": "v1beta3/tunedModels/{tunedModelsId}:transferOwnership",
          "path": "v1beta3/{+name}:transferOwnership",
          "id": "generativelanguage.tunedModels.transferOwnership",
          "response": {
            "$ref": "TransferOwnershipResponse"
          },
          "parameters": {
            "name": {
              "required": true,
              "location": "path",
              "type": "string",
              "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`",
              "pattern": "^tunedModels/[^/]+$"
            }
          }
        },
        "patch": {
          "description": "Updates a tuned model.",
          "flatPath": "v1beta3/tunedModels/{tunedModelsId}",
          "httpMethod": "PATCH",
          "parameterOrder": [
            "name"
          ],
          "request": {
            "$ref": "TunedModel"
          },
          "path": "v1beta3/{+name}",
          "id": "generativelanguage.tunedModels.patch",
          "response": {
            "$ref": "TunedModel"
          },
          "parameters": {
            "name": {
              "location": "path",
              "required": true,
              "type": "string",
              "pattern": "^tunedModels/[^/]+$",
              "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`"
            },
            "updateMask": {
              "description": "Optional. The list of fields to update.",
              "location": "query",
              "type": "string",
              "format": "google-fieldmask"
            }
          }
        },
        "delete": {
          "description": "Deletes a tuned model.",
          "flatPath": "v1beta3/tunedModels/{tunedModelsId}",
          "id": "generativelanguage.tunedModels.delete",
          "httpMethod": "DELETE",
          "parameterOrder": [
            "name"
          ],
          "response": {
            "$ref": "Empty"
          },
          "path": "v1beta3/{+name}",
          "parameters": {
            "name": {
              "type": "string",
              "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`",
              "pattern": "^tunedModels/[^/]+$",
              "required": true,
              "location": "path"
            }
          }
        },
        "generateText": {
          "httpMethod": "POST",
          "parameterOrder": [
            "model"
          ],
          "request": {
            "$ref": "GenerateTextRequest"
          },
          "description": "Generates a response from the model given an input message.",
          "flatPath": "v1beta3/tunedModels/{tunedModelsId}:generateText",
          "id": "generativelanguage.tunedModels.generateText",
          "response": {
            "$ref": "GenerateTextResponse"
          },
          "path": "v1beta3/{+model}:generateText",
          "parameters": {
            "model": {
              "type": "string",
              "pattern": "^tunedModels/[^/]+$",
              "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m",
              "location": "path",
              "required": true
            }
          }
        },
        "list": {
          "description": "Lists created tuned models.",
          "flatPath": "v1beta3/tunedModels",
          "id": "generativelanguage.tunedModels.list",
          "httpMethod": "GET",
          "parameterOrder": [],
          "response": {
            "$ref": "ListTunedModelsResponse"
          },
          "path": "v1beta3/tunedModels",
          "parameters": {
            "pageSize": {
              "location": "query",
              "type": "integer",
              "format": "int32",
              "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size."
            },
            "filter": {
              "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone",
              "location": "query",
              "type": "string"
            },
            "pageToken": {
              "location": "query",
              "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."
            }
          }
        },
        "create": {
          "httpMethod": "POST",
          "parameterOrder": [],
          "request": {
            "$ref": "TunedModel"
          },
          "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",
          "flatPath": "v1beta3/tunedModels",
          "id": "generativelanguage.tunedModels.create",
          "response": {
            "$ref": "Operation"
          },
          "path": "v1beta3/tunedModels",
          "parameters": {
            "tunedModelId": {
              "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.",
              "location": "query",
              "type": "string"
            }
          }
        }
      },
      "resources": {
        "permissions": {
          "methods": {
            "get": {
              "id": "generativelanguage.tunedModels.permissions.get",
              "httpMethod": "GET",
              "parameterOrder": [
                "name"
              ],
              "response": {
                "$ref": "Permission"
              },
              "path": "v1beta3/{+name}",
              "parameters": {
                "name": {
                  "location": "path",
                  "required": true,
                  "type": "string",
                  "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
                  "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`"
                }
              },
              "description": "Gets information about a specific Permission.",
              "flatPath": "v1beta3/tunedModels/{tunedModelsId}/permissions/{permissionsId}"
            },
            "patch": {
              "id": "generativelanguage.tunedModels.permissions.patch",
              "response": {
                "$ref": "Permission"
              },
              "path": "v1beta3/{+name}",
              "parameters": {
                "name": {
                  "location": "path",
                  "required": true,
                  "type": "string",
                  "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
                  "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only."
                },
                "updateMask": {
                  "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)",
                  "location": "query",
                  "type": "string",
                  "format": "google-fieldmask"
                }
              },
              "httpMethod": "PATCH",
              "parameterOrder": [
                "name"
              ],
              "request": {
                "$ref": "Permission"
              },
              "description": "Updates the permission.",
              "flatPath": "v1beta3/tunedModels/{tunedModelsId}/permissions/{permissionsId}"
            },
            "delete": {
              "flatPath": "v1beta3/tunedModels/{tunedModelsId}/permissions/{permissionsId}",
              "description": "Deletes the permission.",
              "parameters": {
                "name": {
                  "location": "path",
                  "required": true,
                  "type": "string",
                  "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
                  "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`"
                }
              },
              "id": "generativelanguage.tunedModels.permissions.delete",
              "httpMethod": "DELETE",
              "parameterOrder": [
                "name"
              ],
              "response": {
                "$ref": "Empty"
              },
              "path": "v1beta3/{+name}"
            },
            "list": {
              "id": "generativelanguage.tunedModels.permissions.list",
              "httpMethod": "GET",
              "parameterOrder": [
                "parent"
              ],
              "response": {
                "$ref": "ListPermissionsResponse"
              },
              "path": "v1beta3/{+parent}/permissions",
              "parameters": {
                "pageToken": {
                  "location": "query",
                  "type": "string",
                  "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": {
                  "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.",
                  "location": "query",
                  "type": "integer",
                  "format": "int32"
                },
                "parent": {
                  "required": true,
                  "location": "path",
                  "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
                  "pattern": "^tunedModels/[^/]+$",
                  "type": "string"
                }
              },
              "description": "Lists permissions for the specific resource.",
              "flatPath": "v1beta3/tunedModels/{tunedModelsId}/permissions"
            },
            "create": {
              "httpMethod": "POST",
              "parameterOrder": [
                "parent"
              ],
              "request": {
                "$ref": "Permission"
              },
              "flatPath": "v1beta3/tunedModels/{tunedModelsId}/permissions",
              "description": "Create a permission to a specific resource.",
              "parameters": {
                "parent": {
                  "type": "string",
                  "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
                  "pattern": "^tunedModels/[^/]+$",
                  "required": true,
                  "location": "path"
                }
              },
              "id": "generativelanguage.tunedModels.permissions.create",
              "response": {
                "$ref": "Permission"
              },
              "path": "v1beta3/{+parent}/permissions"
            }
          }
        }
      }
    },
    "corpora": {
      "resources": {
        "permissions": {
          "methods": {
            "patch": {
              "httpMethod": "PATCH",
              "parameterOrder": [
                "name"
              ],
              "request": {
                "$ref": "Permission"
              },
              "flatPath": "v1beta3/corpora/{corporaId}/permissions/{permissionsId}",
              "description": "Updates the permission.",
              "parameters": {
                "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.",
                  "pattern": "^corpora/[^/]+/permissions/[^/]+$",
                  "type": "string",
                  "required": true,
                  "location": "path"
                },
                "updateMask": {
                  "location": "query",
                  "type": "string",
                  "format": "google-fieldmask",
                  "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)"
                }
              },
              "path": "v1beta3/{+name}",
              "id": "generativelanguage.corpora.permissions.patch",
              "response": {
                "$ref": "Permission"
              }
            },
            "delete": {
              "description": "Deletes the permission.",
              "flatPath": "v1beta3/corpora/{corporaId}/permissions/{permissionsId}",
              "path": "v1beta3/{+name}",
              "id": "generativelanguage.corpora.permissions.delete",
              "httpMethod": "DELETE",
              "parameterOrder": [
                "name"
              ],
              "response": {
                "$ref": "Empty"
              },
              "parameters": {
                "name": {
                  "location": "path",
                  "required": true,
                  "type": "string",
                  "pattern": "^corpora/[^/]+/permissions/[^/]+$",
                  "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`"
                }
              }
            },
            "get": {
              "description": "Gets information about a specific Permission.",
              "flatPath": "v1beta3/corpora/{corporaId}/permissions/{permissionsId}",
              "id": "generativelanguage.corpora.permissions.get",
              "httpMethod": "GET",
              "parameterOrder": [
                "name"
              ],
              "response": {
                "$ref": "Permission"
              },
              "path": "v1beta3/{+name}",
              "parameters": {
                "name": {
                  "location": "path",
                  "required": true,
                  "pattern": "^corpora/[^/]+/permissions/[^/]+$",
                  "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
                  "type": "string"
                }
              }
            },
            "create": {
              "httpMethod": "POST",
              "parameterOrder": [
                "parent"
              ],
              "request": {
                "$ref": "Permission"
              },
              "flatPath": "v1beta3/corpora/{corporaId}/permissions",
              "description": "Create a permission to a specific resource.",
              "parameters": {
                "parent": {
                  "required": true,
                  "location": "path",
                  "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
                  "pattern": "^corpora/[^/]+$",
                  "type": "string"
                }
              },
              "path": "v1beta3/{+parent}/permissions",
              "id": "generativelanguage.corpora.permissions.create",
              "response": {
                "$ref": "Permission"
              }
            },
            "list": {
              "flatPath": "v1beta3/corpora/{corporaId}/permissions",
              "description": "Lists permissions for the specific resource.",
              "parameters": {
                "parent": {
                  "type": "string",
                  "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
                  "pattern": "^corpora/[^/]+$",
                  "required": true,
                  "location": "path"
                },
                "pageToken": {
                  "location": "query",
                  "type": "string",
                  "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": {
                  "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.",
                  "location": "query",
                  "type": "integer",
                  "format": "int32"
                }
              },
              "path": "v1beta3/{+parent}/permissions",
              "id": "generativelanguage.corpora.permissions.list",
              "httpMethod": "GET",
              "parameterOrder": [
                "parent"
              ],
              "response": {
                "$ref": "ListPermissionsResponse"
              }
            }
          }
        }
      }
    },
    "models": {
      "methods": {
        "generateMessage": {
          "parameters": {
            "model": {
              "type": "string",
              "pattern": "^models/[^/]+$",
              "description": "Required. The name of the model to use. Format: `name=models/{model}`.",
              "location": "path",
              "required": true
            }
          },
          "path": "v1beta3/{+model}:generateMessage",
          "id": "generativelanguage.models.generateMessage",
          "response": {
            "$ref": "GenerateMessageResponse"
          },
          "flatPath": "v1beta3/models/{modelsId}:generateMessage",
          "description": "Generates a response from the model given an input `MessagePrompt`.",
          "httpMethod": "POST",
          "parameterOrder": [
            "model"
          ],
          "request": {
            "$ref": "GenerateMessageRequest"
          }
        },
        "list": {
          "parameters": {
            "pageToken": {
              "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",
              "type": "string"
            },
            "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."
            }
          },
          "path": "v1beta3/models",
          "id": "generativelanguage.models.list",
          "httpMethod": "GET",
          "parameterOrder": [],
          "response": {
            "$ref": "ListModelsResponse"
          },
          "flatPath": "v1beta3/models",
          "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API."
        },
        "generateText": {
          "id": "generativelanguage.models.generateText",
          "response": {
            "$ref": "GenerateTextResponse"
          },
          "path": "v1beta3/{+model}:generateText",
          "parameters": {
            "model": {
              "required": true,
              "location": "path",
              "type": "string",
              "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m",
              "pattern": "^models/[^/]+$"
            }
          },
          "httpMethod": "POST",
          "parameterOrder": [
            "model"
          ],
          "request": {
            "$ref": "GenerateTextRequest"
          },
          "description": "Generates a response from the model given an input message.",
          "flatPath": "v1beta3/models/{modelsId}:generateText"
        },
        "batchEmbedText": {
          "httpMethod": "POST",
          "parameterOrder": [
            "model"
          ],
          "request": {
            "$ref": "BatchEmbedTextRequest"
          },
          "flatPath": "v1beta3/models/{modelsId}:batchEmbedText",
          "description": "Generates multiple embeddings from the model given input text in a synchronous call.",
          "parameters": {
            "model": {
              "location": "path",
              "required": true,
              "pattern": "^models/[^/]+$",
              "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001",
              "type": "string"
            }
          },
          "path": "v1beta3/{+model}:batchEmbedText",
          "id": "generativelanguage.models.batchEmbedText",
          "response": {
            "$ref": "BatchEmbedTextResponse"
          }
        },
        "get": {
          "parameters": {
            "name": {
              "pattern": "^models/[^/]+$",
              "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
              "type": "string",
              "location": "path",
              "required": true
            }
          },
          "id": "generativelanguage.models.get",
          "httpMethod": "GET",
          "parameterOrder": [
            "name"
          ],
          "response": {
            "$ref": "Model"
          },
          "path": "v1beta3/{+name}",
          "flatPath": "v1beta3/models/{modelsId}",
          "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."
        },
        "countMessageTokens": {
          "parameters": {
            "model": {
              "location": "path",
              "required": true,
              "pattern": "^models/[^/]+$",
              "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
              "type": "string"
            }
          },
          "path": "v1beta3/{+model}:countMessageTokens",
          "id": "generativelanguage.models.countMessageTokens",
          "response": {
            "$ref": "CountMessageTokensResponse"
          },
          "httpMethod": "POST",
          "parameterOrder": [
            "model"
          ],
          "request": {
            "$ref": "CountMessageTokensRequest"
          },
          "flatPath": "v1beta3/models/{modelsId}:countMessageTokens",
          "description": "Runs a model's tokenizer on a string and returns the token count."
        },
        "embedText": {
          "id": "generativelanguage.models.embedText",
          "response": {
            "$ref": "EmbedTextResponse"
          },
          "path": "v1beta3/{+model}:embedText",
          "parameters": {
            "model": {
              "required": true,
              "location": "path",
              "description": "Required. The model name to use with the format model=models/{model}.",
              "pattern": "^models/[^/]+$",
              "type": "string"
            }
          },
          "description": "Generates an embedding from the model given an input message.",
          "flatPath": "v1beta3/models/{modelsId}:embedText",
          "httpMethod": "POST",
          "parameterOrder": [
            "model"
          ],
          "request": {
            "$ref": "EmbedTextRequest"
          }
        },
        "countTextTokens": {
          "path": "v1beta3/{+model}:countTextTokens",
          "id": "generativelanguage.models.countTextTokens",
          "response": {
            "$ref": "CountTextTokensResponse"
          },
          "parameters": {
            "model": {
              "pattern": "^models/[^/]+$",
              "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
              "type": "string",
              "location": "path",
              "required": true
            }
          },
          "description": "Runs a model's tokenizer on a text and returns the token count.",
          "flatPath": "v1beta3/models/{modelsId}:countTextTokens",
          "httpMethod": "POST",
          "parameterOrder": [
            "model"
          ],
          "request": {
            "$ref": "CountTextTokensRequest"
          }
        }
      }
    }
  },
  "version": "v1beta3",
  "discoveryVersion": "v1",
  "revision": "20260407",
  "basePath": "",
  "parameters": {
    "alt": {
      "description": "Data format for response.",
      "default": "json",
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "type": "string",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "location": "query"
    },
    "prettyPrint": {
      "type": "boolean",
      "location": "query",
      "description": "Returns response with indentations and line breaks.",
      "default": "true"
    },
    "upload_protocol": {
      "type": "string",
      "location": "query",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")."
    },
    "$.xgafv": {
      "description": "V1 error format.",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "type": "string",
      "enum": [
        "1",
        "2"
      ],
      "location": "query"
    },
    "callback": {
      "description": "JSONP",
      "type": "string",
      "location": "query"
    },
    "oauth_token": {
      "type": "string",
      "location": "query",
      "description": "OAuth 2.0 token for the current user."
    },
    "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.",
      "type": "string",
      "location": "query"
    },
    "uploadType": {
      "type": "string",
      "location": "query",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
    },
    "access_token": {
      "description": "OAuth access token.",
      "type": "string",
      "location": "query"
    },
    "quotaUser": {
      "type": "string",
      "location": "query",
      "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters."
    },
    "fields": {
      "description": "Selector specifying which fields to include in a partial response.",
      "type": "string",
      "location": "query"
    }
  },
  "ownerDomain": "google.com",
  "baseUrl": "https://generativelanguage.googleapis.com/",
  "rootUrl": "https://generativelanguage.googleapis.com/"
}
