Skip to content

Instantly share code, notes, and snippets.

@devoncarew
Created December 10, 2024 18:46
Show Gist options
  • Select an option

  • Save devoncarew/df1fd96a5941694fb3e9d5e91facfcb0 to your computer and use it in GitHub Desktop.

Select an option

Save devoncarew/df1fd96a5941694fb3e9d5e91facfcb0 to your computer and use it in GitHub Desktop.
{
"servicePath": "",
"version": "v1",
"canonicalName": "Generative Language",
"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.",
"mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/",
"kind": "discovery#restDescription",
"name": "generativelanguage",
"parameters": {
"alt": {
"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.",
"default": "json",
"type": "string",
"enum": [
"json",
"media",
"proto"
],
"location": "query"
},
"oauth_token": {
"description": "OAuth 2.0 token for the current user.",
"location": "query",
"type": "string"
},
"prettyPrint": {
"description": "Returns response with indentations and line breaks.",
"type": "boolean",
"location": "query",
"default": "true"
},
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"upload_protocol": {
"location": "query",
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\")."
},
"callback": {
"location": "query",
"type": "string",
"description": "JSONP"
},
"key": {
"type": "string",
"location": "query",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token."
},
"$.xgafv": {
"type": "string",
"location": "query",
"description": "V1 error format.",
"enum": [
"1",
"2"
],
"enumDescriptions": [
"v1 error format",
"v2 error format"
]
},
"fields": {
"location": "query",
"description": "Selector specifying which fields to include in a partial response.",
"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"
},
"uploadType": {
"location": "query",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"type": "string"
}
},
"batchPath": "batch",
"version_module": true,
"revision": "20241209",
"ownerDomain": "google.com",
"id": "generativelanguage:v1",
"documentationLink": "https://developers.generativeai.google/api",
"icons": {
"x32": "http://www.google.com/images/icons/product/search-32.gif",
"x16": "http://www.google.com/images/icons/product/search-16.gif"
},
"rootUrl": "https://generativelanguage.googleapis.com/",
"baseUrl": "https://generativelanguage.googleapis.com/",
"fullyEncodeReservedExpansion": true,
"protocol": "rest",
"schemas": {
"BatchEmbedContentsRequest": {
"id": "BatchEmbedContentsRequest",
"type": "object",
"description": "Batch request to get embeddings from the model for a list of prompts.",
"properties": {
"requests": {
"items": {
"$ref": "EmbedContentRequest"
},
"type": "array",
"description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`."
}
}
},
"GroundingChunk": {
"type": "object",
"description": "Grounding chunk.",
"properties": {
"web": {
"description": "Grounding chunk from the web.",
"$ref": "Web"
}
},
"id": "GroundingChunk"
},
"GenerateContentResponse": {
"id": "GenerateContentResponse",
"type": "object",
"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": {
"modelVersion": {
"description": "Output only. The model version used to generate the response.",
"readOnly": true,
"type": "string"
},
"promptFeedback": {
"$ref": "PromptFeedback",
"description": "Returns the prompt's feedback related to the content filters."
},
"usageMetadata": {
"$ref": "UsageMetadata",
"readOnly": true,
"description": "Output only. Metadata on the generation requests' token usage."
},
"candidates": {
"description": "Candidate responses from the model.",
"type": "array",
"items": {
"$ref": "Candidate"
}
}
}
},
"UsageMetadata": {
"description": "Metadata on the generation request's token usage.",
"id": "UsageMetadata",
"type": "object",
"properties": {
"promptTokenCount": {
"format": "int32",
"type": "integer",
"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."
},
"candidatesTokenCount": {
"type": "integer",
"format": "int32",
"description": "Total number of tokens across all the generated response candidates."
},
"totalTokenCount": {
"description": "Total token count for the generation request (prompt + response candidates).",
"format": "int32",
"type": "integer"
}
}
},
"TopCandidates": {
"description": "Candidates with top log probabilities at each decoding step.",
"type": "object",
"id": "TopCandidates",
"properties": {
"candidates": {
"items": {
"$ref": "LogprobsResultCandidate"
},
"description": "Sorted by log probability in descending order.",
"type": "array"
}
}
},
"LogprobsResult": {
"id": "LogprobsResult",
"properties": {
"topCandidates": {
"items": {
"$ref": "TopCandidates"
},
"description": "Length = total number of decoding steps.",
"type": "array"
},
"chosenCandidates": {
"type": "array",
"description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.",
"items": {
"$ref": "LogprobsResultCandidate"
}
}
},
"description": "Logprobs Result",
"type": "object"
},
"RetrievalMetadata": {
"type": "object",
"id": "RetrievalMetadata",
"description": "Metadata related to retrieval in the grounding flow.",
"properties": {
"googleSearchDynamicRetrievalScore": {
"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.",
"type": "number"
}
}
},
"CountTokensResponse": {
"id": "CountTokensResponse",
"properties": {
"totalTokens": {
"type": "integer",
"format": "int32",
"description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative."
}
},
"type": "object",
"description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`."
},
"CitationSource": {
"description": "A citation to a source for a portion of a specific response.",
"id": "CitationSource",
"type": "object",
"properties": {
"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."
},
"startIndex": {
"description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.",
"format": "int32",
"type": "integer"
},
"uri": {
"type": "string",
"description": "Optional. URI that is attributed as a source for a portion of the text."
},
"endIndex": {
"type": "integer",
"format": "int32",
"description": "Optional. End of the attributed segment, exclusive."
}
}
},
"SafetyRating": {
"id": "SafetyRating",
"description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.",
"properties": {
"blocked": {
"description": "Was this content blocked because of this rating?",
"type": "boolean"
},
"probability": {
"description": "Required. The probability of harm for this content.",
"enum": [
"HARM_PROBABILITY_UNSPECIFIED",
"NEGLIGIBLE",
"LOW",
"MEDIUM",
"HIGH"
],
"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."
]
},
"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."
],
"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",
"description": "Required. The category for this rating."
}
},
"type": "object"
},
"Model": {
"type": "object",
"description": "Information about a Generative Language Model.",
"properties": {
"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`"
},
"supportedGenerationMethods": {
"items": {
"type": "string"
},
"type": "array",
"description": "The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`."
},
"description": {
"type": "string",
"description": "A short description of the model."
},
"version": {
"description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)",
"type": "string"
},
"outputTokenLimit": {
"description": "Maximum number of output tokens available for this model.",
"type": "integer",
"format": "int32"
},
"temperature": {
"description": "Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.",
"format": "float",
"type": "number"
},
"maxTemperature": {
"format": "float",
"type": "number",
"description": "The maximum temperature this model can use."
},
"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."
},
"inputTokenLimit": {
"type": "integer",
"description": "Maximum number of input tokens allowed for this model.",
"format": "int32"
},
"baseModelId": {
"description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`",
"type": "string"
},
"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"
},
"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.",
"type": "number",
"format": "float"
}
},
"id": "Model"
},
"PromptFeedback": {
"id": "PromptFeedback",
"description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.",
"properties": {
"blockReason": {
"enum": [
"BLOCK_REASON_UNSPECIFIED",
"SAFETY",
"OTHER",
"BLOCKLIST",
"PROHIBITED_CONTENT"
],
"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."
],
"description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt."
},
"safetyRatings": {
"items": {
"$ref": "SafetyRating"
},
"description": "Ratings for safety of the prompt. There is at most one rating per category.",
"type": "array"
}
},
"type": "object"
},
"Candidate": {
"description": "A response candidate generated from the model.",
"properties": {
"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
},
"content": {
"$ref": "Content",
"readOnly": true,
"description": "Output only. Generated content returned from the model."
},
"finishReason": {
"type": "string",
"readOnly": true,
"description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.",
"enum": [
"FINISH_REASON_UNSPECIFIED",
"STOP",
"MAX_TOKENS",
"SAFETY",
"RECITATION",
"LANGUAGE",
"OTHER",
"BLOCKLIST",
"PROHIBITED_CONTENT",
"SPII",
"MALFORMED_FUNCTION_CALL"
],
"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."
]
},
"avgLogprobs": {
"readOnly": true,
"format": "double",
"description": "Output only. Average log probability score of the candidate.",
"type": "number"
},
"groundingMetadata": {
"description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.",
"readOnly": true,
"$ref": "GroundingMetadata"
},
"tokenCount": {
"description": "Output only. Token count for this candidate.",
"readOnly": true,
"type": "integer",
"format": "int32"
},
"logprobsResult": {
"readOnly": true,
"$ref": "LogprobsResult",
"description": "Output only. Log-likelihood scores for the response tokens and top tokens"
},
"index": {
"format": "int32",
"readOnly": true,
"type": "integer",
"description": "Output only. Index of the candidate in the list of response candidates."
},
"safetyRatings": {
"type": "array",
"items": {
"$ref": "SafetyRating"
},
"description": "List of ratings for the safety of a response candidate. There is at most one rating per category."
}
},
"type": "object",
"id": "Candidate"
},
"EmbedContentRequest": {
"type": "object",
"id": "EmbedContentRequest",
"description": "Request containing the `Content` for the model to embed.",
"properties": {
"title": {
"description": "Optional. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval.",
"type": "string"
},
"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": {
"enum": [
"TASK_TYPE_UNSPECIFIED",
"RETRIEVAL_QUERY",
"RETRIEVAL_DOCUMENT",
"SEMANTIC_SIMILARITY",
"CLASSIFICATION",
"CLUSTERING",
"QUESTION_ANSWERING",
"FACT_VERIFICATION"
],
"type": "string",
"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."
],
"description": "Optional. Optional task type for which the embeddings will be used. Can only be set for `models/embedding-001`."
},
"outputDimensionality": {
"format": "int32",
"description": "Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`).",
"type": "integer"
},
"content": {
"$ref": "Content",
"description": "Required. The content to embed. Only the `parts.text` fields will be counted."
}
}
},
"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); }",
"type": "object",
"id": "Empty"
},
"EmbedContentResponse": {
"description": "The response to an `EmbedContentRequest`.",
"type": "object",
"id": "EmbedContentResponse",
"properties": {
"embedding": {
"description": "Output only. The embedding generated from the input content.",
"$ref": "ContentEmbedding",
"readOnly": true
}
}
},
"GroundingSupport": {
"description": "Grounding support.",
"type": "object",
"id": "GroundingSupport",
"properties": {
"groundingChunkIndices": {
"type": "array",
"description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.",
"items": {
"type": "integer",
"format": "int32"
}
},
"confidenceScores": {
"type": "array",
"description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
"items": {
"format": "float",
"type": "number"
}
},
"segment": {
"$ref": "Segment",
"description": "Segment of the content this support belongs to."
}
}
},
"Web": {
"type": "object",
"properties": {
"uri": {
"description": "URI reference of the chunk.",
"type": "string"
},
"title": {
"description": "Title of the chunk.",
"type": "string"
}
},
"description": "Chunk from the web.",
"id": "Web"
},
"GenerateContentRequest": {
"description": "Request to generate a completion from the model.",
"id": "GenerateContentRequest",
"properties": {
"generationConfig": {
"$ref": "GenerationConfig",
"description": "Optional. Configuration options for model generation and outputs."
},
"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"
}
},
"safetySettings": {
"type": "array",
"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."
},
"model": {
"type": "string",
"description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`."
}
},
"type": "object"
},
"Blob": {
"description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.",
"type": "object",
"properties": {
"mimeType": {
"description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).",
"type": "string"
},
"data": {
"description": "Raw bytes for media formats.",
"type": "string",
"format": "byte"
}
},
"id": "Blob"
},
"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": "Status",
"type": "object",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"format": "int32",
"type": "integer"
},
"details": {
"type": "array",
"description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
"additionalProperties": {
"type": "any",
"description": "Properties of the object. Contains field @type with type URL."
},
"type": "object"
}
},
"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."
}
}
},
"ListOperationsResponse": {
"properties": {
"nextPageToken": {
"description": "The standard List next-page token.",
"type": "string"
},
"operations": {
"type": "array",
"description": "A list of operations that matches the specified filter in the request.",
"items": {
"$ref": "Operation"
}
}
},
"description": "The response message for Operations.ListOperations.",
"type": "object",
"id": "ListOperationsResponse"
},
"Segment": {
"id": "Segment",
"description": "Segment of the content.",
"type": "object",
"properties": {
"endIndex": {
"description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
"format": "int32",
"type": "integer",
"readOnly": true
},
"partIndex": {
"description": "Output only. The index of a Part object within its parent Content object.",
"format": "int32",
"readOnly": true,
"type": "integer"
},
"text": {
"type": "string",
"description": "Output only. The text corresponding to the segment from the response.",
"readOnly": true
},
"startIndex": {
"format": "int32",
"type": "integer",
"readOnly": true,
"description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero."
}
}
},
"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`.",
"id": "CountTokensRequest",
"type": "object",
"properties": {
"contents": {
"type": "array",
"description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.",
"items": {
"$ref": "Content"
}
},
"generateContentRequest": {
"$ref": "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."
}
}
},
"GroundingMetadata": {
"properties": {
"retrievalMetadata": {
"description": "Metadata related to retrieval in the grounding flow.",
"$ref": "RetrievalMetadata"
},
"webSearchQueries": {
"type": "array",
"items": {
"type": "string"
},
"description": "Web search queries for the following-up web search."
},
"searchEntryPoint": {
"$ref": "SearchEntryPoint",
"description": "Optional. Google search entry for the following-up web searches."
},
"groundingSupports": {
"description": "List of grounding support.",
"type": "array",
"items": {
"$ref": "GroundingSupport"
}
},
"groundingChunks": {
"type": "array",
"description": "List of supporting references retrieved from specified grounding source.",
"items": {
"$ref": "GroundingChunk"
}
}
},
"id": "GroundingMetadata",
"description": "Metadata returned to client when grounding is enabled.",
"type": "object"
},
"ListModelsResponse": {
"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."
},
"models": {
"type": "array",
"items": {
"$ref": "Model"
},
"description": "The returned Models."
}
},
"id": "ListModelsResponse",
"description": "Response from `ListModel` containing a paginated list of Models.",
"type": "object"
},
"CancelOperationRequest": {
"id": "CancelOperationRequest",
"description": "The request message for Operations.CancelOperation.",
"properties": {},
"type": "object"
},
"Operation": {
"properties": {
"metadata": {
"additionalProperties": {
"type": "any",
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
"type": "object"
},
"name": {
"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}`."
},
"error": {
"$ref": "Status",
"description": "The error result of the operation in case of failure or cancellation."
},
"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": {
"type": "object",
"additionalProperties": {
"type": "any",
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`."
}
},
"type": "object",
"description": "This resource represents a long-running operation that is the result of a network API call.",
"id": "Operation"
},
"SearchEntryPoint": {
"properties": {
"sdkBlob": {
"description": "Optional. Base64 encoded JSON representing array of tuple.",
"format": "byte",
"type": "string"
},
"renderedContent": {
"description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
"type": "string"
}
},
"id": "SearchEntryPoint",
"type": "object",
"description": "Google search entry point."
},
"Part": {
"type": "object",
"properties": {
"inlineData": {
"description": "Inline media bytes.",
"$ref": "Blob"
},
"text": {
"type": "string",
"description": "Inline text."
}
},
"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."
},
"GenerationConfig": {
"id": "GenerationConfig",
"properties": {
"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.",
"type": "number",
"format": "float"
},
"frequencyPenalty": {
"description": "Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more dificult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit.",
"format": "float",
"type": "number"
},
"responseLogprobs": {
"type": "boolean",
"description": "Optional. If true, export the logprobs results in response."
},
"presencePenalty": {
"format": "float",
"type": "number",
"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."
},
"topK": {
"format": "int32",
"type": "integer",
"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."
},
"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]."
},
"enableEnhancedCivicAnswers": {
"type": "boolean",
"description": "Optional. Enables enhanced civic answers. It may not be available for all models."
},
"logprobs": {
"format": "int32",
"description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs to return at each decoding step in the Candidate.logprobs_result.",
"type": "integer"
},
"maxOutputTokens": {
"format": "int32",
"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"
},
"candidateCount": {
"type": "integer",
"format": "int32",
"description": "Optional. Number of generated responses to return. Currently, this value can only be set to 1. If unset, this will default to 1."
},
"stopSequences": {
"items": {
"type": "string"
},
"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"
}
},
"description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.",
"type": "object"
},
"CreateTunedModelMetadata": {
"type": "object",
"id": "CreateTunedModelMetadata",
"properties": {
"totalSteps": {
"description": "The total number of tuning steps.",
"type": "integer",
"format": "int32"
},
"snapshots": {
"type": "array",
"items": {
"$ref": "TuningSnapshot"
},
"description": "Metrics collected during tuning."
},
"completedPercent": {
"type": "number",
"format": "float",
"description": "The completed percentage for the tuning operation."
},
"tunedModel": {
"type": "string",
"description": "Name of the tuned model associated with the tuning operation."
},
"completedSteps": {
"description": "The number of steps completed.",
"type": "integer",
"format": "int32"
}
},
"description": "Metadata about the state and progress of creating a tuned model returned from the long-running operation"
},
"ContentEmbedding": {
"type": "object",
"properties": {
"values": {
"type": "array",
"description": "The embedding values.",
"items": {
"type": "number",
"format": "float"
}
}
},
"description": "A list of floats representing an embedding.",
"id": "ContentEmbedding"
},
"Content": {
"type": "object",
"description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.",
"properties": {
"parts": {
"description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.",
"type": "array",
"items": {
"$ref": "Part"
}
},
"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"
},
"CitationMetadata": {
"properties": {
"citationSources": {
"items": {
"$ref": "CitationSource"
},
"type": "array",
"description": "Citations to sources for a specific response."
}
},
"description": "A collection of source attributions for a piece of content.",
"id": "CitationMetadata",
"type": "object"
},
"SafetySetting": {
"description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.",
"id": "SafetySetting",
"type": "object",
"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"
],
"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."
],
"description": "Required. The category for this setting.",
"type": "string"
},
"threshold": {
"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": "Required. Controls the probability threshold at which harm is blocked."
}
}
},
"BatchEmbedContentsResponse": {
"description": "The response to a `BatchEmbedContentsRequest`.",
"type": "object",
"id": "BatchEmbedContentsResponse",
"properties": {
"embeddings": {
"readOnly": true,
"description": "Output only. The embeddings for each request, in the same order as provided in the batch request.",
"type": "array",
"items": {
"$ref": "ContentEmbedding"
}
}
}
},
"TuningSnapshot": {
"type": "object",
"properties": {
"step": {
"type": "integer",
"readOnly": true,
"format": "int32",
"description": "Output only. The tuning step."
},
"meanLoss": {
"type": "number",
"format": "float",
"readOnly": true,
"description": "Output only. The mean loss of the training examples for this step."
},
"computeTime": {
"type": "string",
"description": "Output only. The timestamp when this metric was computed.",
"format": "google-datetime",
"readOnly": true
},
"epoch": {
"type": "integer",
"readOnly": true,
"format": "int32",
"description": "Output only. The epoch this step was part of."
}
},
"description": "Record for a single tuning step.",
"id": "TuningSnapshot"
},
"LogprobsResultCandidate": {
"id": "LogprobsResultCandidate",
"description": "Candidate for the logprobs token and score.",
"properties": {
"logProbability": {
"description": "The candidate's log probability.",
"format": "float",
"type": "number"
},
"token": {
"description": "The candidate’s token string value.",
"type": "string"
},
"tokenId": {
"format": "int32",
"description": "The candidate’s token id value.",
"type": "integer"
}
},
"type": "object"
}
},
"discoveryVersion": "v1",
"resources": {
"operations": {
"methods": {
"list": {
"parameterOrder": [
"name"
],
"httpMethod": "GET",
"description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.",
"id": "generativelanguage.operations.list",
"parameters": {
"name": {
"type": "string",
"location": "path",
"required": true,
"description": "The name of the operation's parent resource.",
"pattern": "^operations$"
},
"filter": {
"type": "string",
"location": "query",
"description": "The standard list filter."
},
"pageToken": {
"description": "The standard list page token.",
"type": "string",
"location": "query"
},
"pageSize": {
"format": "int32",
"description": "The standard list page size.",
"type": "integer",
"location": "query"
}
},
"flatPath": "v1/operations",
"path": "v1/{+name}",
"response": {
"$ref": "ListOperationsResponse"
}
},
"delete": {
"path": "v1/{+name}",
"flatPath": "v1/operations/{operationsId}",
"response": {
"$ref": "Empty"
},
"httpMethod": "DELETE",
"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.operations.delete",
"parameters": {
"name": {
"required": true,
"type": "string",
"pattern": "^operations/.*$",
"location": "path",
"description": "The name of the operation resource to be deleted."
}
}
}
}
},
"generatedFiles": {
"resources": {
"operations": {
"methods": {
"get": {
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "The name of the operation resource.",
"type": "string",
"location": "path",
"required": true,
"pattern": "^generatedFiles/[^/]+/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.",
"flatPath": "v1/generatedFiles/{generatedFilesId}/operations/{operationsId}",
"response": {
"$ref": "Operation"
},
"id": "generativelanguage.generatedFiles.operations.get",
"path": "v1/{+name}",
"httpMethod": "GET"
}
}
}
}
},
"models": {
"resources": {
"operations": {
"methods": {
"list": {
"path": "v1/{+name}/operations",
"id": "generativelanguage.models.operations.list",
"httpMethod": "GET",
"response": {
"$ref": "ListOperationsResponse"
},
"description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.",
"parameterOrder": [
"name"
],
"parameters": {
"filter": {
"type": "string",
"location": "query",
"description": "The standard list filter."
},
"pageToken": {
"description": "The standard list page token.",
"location": "query",
"type": "string"
},
"name": {
"required": true,
"pattern": "^models/[^/]+$",
"type": "string",
"description": "The name of the operation's parent resource.",
"location": "path"
},
"pageSize": {
"description": "The standard list page size.",
"location": "query",
"type": "integer",
"format": "int32"
}
},
"flatPath": "v1/models/{modelsId}/operations"
},
"get": {
"description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
"path": "v1/{+name}",
"parameterOrder": [
"name"
],
"httpMethod": "GET",
"parameters": {
"name": {
"type": "string",
"pattern": "^models/[^/]+/operations/[^/]+$",
"description": "The name of the operation resource.",
"required": true,
"location": "path"
}
},
"id": "generativelanguage.models.operations.get",
"flatPath": "v1/models/{modelsId}/operations/{operationsId}",
"response": {
"$ref": "Operation"
}
}
}
}
},
"methods": {
"list": {
"parameterOrder": [],
"path": "v1/models",
"flatPath": "v1/models",
"httpMethod": "GET",
"response": {
"$ref": "ListModelsResponse"
},
"id": "generativelanguage.models.list",
"description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.",
"parameters": {
"pageToken": {
"location": "query",
"description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.",
"type": "string"
},
"pageSize": {
"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.",
"location": "query",
"type": "integer",
"format": "int32"
}
}
},
"get": {
"response": {
"$ref": "Model"
},
"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"
}
},
"id": "generativelanguage.models.get",
"path": "v1/{+name}",
"httpMethod": "GET",
"flatPath": "v1/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."
},
"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.",
"flatPath": "v1/models/{modelsId}:generateContent",
"parameterOrder": [
"model"
],
"response": {
"$ref": "GenerateContentResponse"
},
"request": {
"$ref": "GenerateContentRequest"
},
"id": "generativelanguage.models.generateContent",
"httpMethod": "POST",
"parameters": {
"model": {
"description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.",
"location": "path",
"type": "string",
"pattern": "^models/[^/]+$",
"required": true
}
},
"path": "v1/{+model}:generateContent"
},
"batchEmbedContents": {
"description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.",
"httpMethod": "POST",
"request": {
"$ref": "BatchEmbedContentsRequest"
},
"id": "generativelanguage.models.batchEmbedContents",
"parameters": {
"model": {
"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/[^/]+$",
"location": "path"
}
},
"parameterOrder": [
"model"
],
"response": {
"$ref": "BatchEmbedContentsResponse"
},
"path": "v1/{+model}:batchEmbedContents",
"flatPath": "v1/models/{modelsId}:batchEmbedContents"
},
"countTokens": {
"parameters": {
"model": {
"type": "string",
"location": "path",
"description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
"pattern": "^models/[^/]+$",
"required": true
}
},
"response": {
"$ref": "CountTokensResponse"
},
"httpMethod": "POST",
"id": "generativelanguage.models.countTokens",
"request": {
"$ref": "CountTokensRequest"
},
"parameterOrder": [
"model"
],
"flatPath": "v1/models/{modelsId}:countTokens",
"path": "v1/{+model}:countTokens",
"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."
},
"embedContent": {
"request": {
"$ref": "EmbedContentRequest"
},
"response": {
"$ref": "EmbedContentResponse"
},
"flatPath": "v1/models/{modelsId}: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).",
"id": "generativelanguage.models.embedContent",
"path": "v1/{+model}:embedContent",
"httpMethod": "POST",
"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
}
},
"parameterOrder": [
"model"
]
},
"streamGenerateContent": {
"response": {
"$ref": "GenerateContentResponse"
},
"id": "generativelanguage.models.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`.",
"path": "v1/{+model}:streamGenerateContent",
"parameters": {
"model": {
"location": "path",
"pattern": "^models/[^/]+$",
"type": "string",
"description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.",
"required": true
}
},
"request": {
"$ref": "GenerateContentRequest"
},
"flatPath": "v1/models/{modelsId}:streamGenerateContent",
"httpMethod": "POST",
"parameterOrder": [
"model"
]
}
}
},
"tunedModels": {
"resources": {
"operations": {
"methods": {
"get": {
"id": "generativelanguage.tunedModels.operations.get",
"httpMethod": "GET",
"flatPath": "v1/tunedModels/{tunedModelsId}/operations/{operationsId}",
"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.",
"parameters": {
"name": {
"required": true,
"location": "path",
"type": "string",
"pattern": "^tunedModels/[^/]+/operations/[^/]+$",
"description": "The name of the operation resource."
}
},
"parameterOrder": [
"name"
],
"response": {
"$ref": "Operation"
},
"path": "v1/{+name}"
},
"cancel": {
"httpMethod": "POST",
"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`.",
"response": {
"$ref": "Empty"
},
"flatPath": "v1/tunedModels/{tunedModelsId}/operations/{operationsId}:cancel",
"path": "v1/{+name}:cancel",
"id": "generativelanguage.tunedModels.operations.cancel",
"parameters": {
"name": {
"location": "path",
"description": "The name of the operation resource to be cancelled.",
"required": true,
"pattern": "^tunedModels/[^/]+/operations/[^/]+$",
"type": "string"
}
},
"parameterOrder": [
"name"
],
"request": {
"$ref": "CancelOperationRequest"
}
},
"list": {
"path": "v1/{+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": "v1/tunedModels/{tunedModelsId}/operations",
"id": "generativelanguage.tunedModels.operations.list",
"httpMethod": "GET",
"parameters": {
"name": {
"location": "path",
"required": true,
"pattern": "^tunedModels/[^/]+$",
"description": "The name of the operation's parent resource.",
"type": "string"
},
"filter": {
"type": "string",
"location": "query",
"description": "The standard list filter."
},
"pageSize": {
"type": "integer",
"location": "query",
"format": "int32",
"description": "The standard list page size."
},
"pageToken": {
"description": "The standard list page token.",
"location": "query",
"type": "string"
}
},
"response": {
"$ref": "ListOperationsResponse"
},
"parameterOrder": [
"name"
]
}
}
}
},
"methods": {
"generateContent": {
"parameterOrder": [
"model"
],
"httpMethod": "POST",
"parameters": {
"model": {
"pattern": "^tunedModels/[^/]+$",
"required": true,
"type": "string",
"location": "path",
"description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`."
}
},
"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.tunedModels.generateContent",
"response": {
"$ref": "GenerateContentResponse"
},
"request": {
"$ref": "GenerateContentRequest"
},
"path": "v1/{+model}:generateContent",
"flatPath": "v1/tunedModels/{tunedModelsId}:generateContent"
},
"streamGenerateContent": {
"parameterOrder": [
"model"
],
"response": {
"$ref": "GenerateContentResponse"
},
"parameters": {
"model": {
"required": true,
"type": "string",
"description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.",
"location": "path",
"pattern": "^tunedModels/[^/]+$"
}
},
"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": "v1/tunedModels/{tunedModelsId}:streamGenerateContent",
"path": "v1/{+model}:streamGenerateContent",
"request": {
"$ref": "GenerateContentRequest"
},
"id": "generativelanguage.tunedModels.streamGenerateContent",
"httpMethod": "POST"
}
}
}
},
"basePath": "",
"title": "Generative Language API",
"ownerName": "Google"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment