{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-gemini/json-schema/google-gemini-generate-content-response-schema.json",
  "title": "GenerateContentResponse",
  "description": "Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-gemini-dynamic-api-openapi.yml#/components/schemas/GenerateContentResponse",
  "type": "object",
  "properties": {
    "modelVersion": {
      "description": "Output only. The model version used to generate the response.",
      "readOnly": true,
      "type": "string"
    },
    "responseId": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. response_id is used to identify each response."
    },
    "candidates": {
      "description": "Candidate responses from the model.",
      "items": {
        "$ref": "#/$defs/Candidate"
      },
      "type": "array"
    },
    "usageMetadata": {
      "$ref": "#/$defs/UsageMetadata",
      "description": "Output only. Metadata on the generation requests' token usage."
    },
    "promptFeedback": {
      "$ref": "#/$defs/PromptFeedback",
      "description": "Returns the prompt's feedback related to the content filters."
    },
    "modelStatus": {
      "$ref": "#/$defs/ModelStatus",
      "description": "Output only. The current model status of this model."
    }
  },
  "$defs": {
    "AttributionSourceId": {
      "description": "Identifier for the source contributing to this attribution.",
      "type": "object",
      "properties": {
        "semanticRetrieverChunk": {
          "$ref": "#/$defs/SemanticRetrieverChunk",
          "description": "Identifier for a `Chunk` fetched via Semantic Retriever."
        },
        "groundingPassage": {
          "$ref": "#/$defs/GroundingPassageId",
          "description": "Identifier for an inline passage."
        }
      }
    },
    "AudioTranscription": {
      "type": "object",
      "description": "The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate Part with its own AudioTranscription carrying the speaker_label.",
      "properties": {
        "words": {
          "items": {
            "$ref": "#/$defs/WordInfo"
          },
          "description": "Optional. Detailed word-level transcriptions and timing details. Present when word_timestamp is set.",
          "type": "array"
        },
        "text": {
          "description": "Required. The transcription text of this audio segment.",
          "type": "string"
        },
        "speakerLabel": {
          "description": "Optional. A label identifying the speaker of this audio segment (e.g. \"spk_1\", \"spk_2\"). Present when diarization is set.",
          "type": "string"
        }
      }
    },
    "Blob": {
      "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.",
      "properties": {
        "mimeType": {
          "type": "string",
          "description": "The IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: text/plain, text/html, text/css, text/javascript, text/x-typescript, text/csv, text/markdown, text/x-python, text/xml, text/rtf, video/text/timestamp - Applications: application/x-javascript, application/x-typescript, application/x-python-code, application/json, application/x-ipynb+json, application/rtf, application/pdf For additional context, see [Supported file formats](https://aistudio.google.com/docs/file-input-methods#supported-content-types)."
        },
        "data": {
          "format": "byte",
          "description": "Raw bytes for media formats.",
          "type": "string"
        },
        "displayName": {
          "description": "Optional. Specifies the name used to refer to this blob to the model (e.g. \"my_blob.png\"). Used as the blob reference identifier when `verbalization_mode` is set to `REFERENCE_ONLY`.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Candidate": {
      "description": "A response candidate generated from the model.",
      "properties": {
        "citationMetadata": {
          "$ref": "#/$defs/CitationMetadata",
          "description": "Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are \"recited\" from copyrighted material in the foundational LLM's training data."
        },
        "safetyRatings": {
          "items": {
            "$ref": "#/$defs/SafetyRating"
          },
          "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.",
          "type": "array"
        },
        "tokenCount": {
          "type": "integer",
          "description": "Output only. Token count for this candidate.",
          "readOnly": true,
          "format": "int32"
        },
        "groundingMetadata": {
          "$ref": "#/$defs/GroundingMetadata",
          "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls."
        },
        "avgLogprobs": {
          "type": "number",
          "format": "double",
          "description": "Output only. Average log probability score of the candidate.",
          "readOnly": true
        },
        "continuationToken": {
          "type": "string",
          "format": "byte",
          "description": "An optional opaque continuation token returned when `finish_reason` is `CONTINUATION`. Clients can pass this token in a subsequent `GenerateContentRequest` to continue generation."
        },
        "urlContextMetadata": {
          "$ref": "#/$defs/UrlContextMetadata",
          "description": "Output only. Metadata related to url context retrieval tool."
        },
        "finishMessage": {
          "readOnly": true,
          "type": "string",
          "description": "Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set."
        },
        "logprobsResult": {
          "$ref": "#/$defs/LogprobsResult",
          "description": "Output only. Log-likelihood scores for the response tokens and top tokens"
        },
        "index": {
          "description": "Output only. Index of the candidate in the list of response candidates.",
          "format": "int32",
          "readOnly": true,
          "type": "integer"
        },
        "groundingAttributions": {
          "items": {
            "$ref": "#/$defs/GroundingAttribution"
          },
          "type": "array",
          "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.",
          "readOnly": true
        },
        "content": {
          "$ref": "#/$defs/Content",
          "description": "Output only. Generated content returned from the model."
        },
        "finishReason": {
          "readOnly": true,
          "type": "string",
          "enum": [
            "FINISH_REASON_UNSPECIFIED",
            "STOP",
            "MAX_TOKENS",
            "SAFETY",
            "RECITATION",
            "LANGUAGE",
            "OTHER",
            "BLOCKLIST",
            "PROHIBITED_CONTENT",
            "SPII",
            "MALFORMED_FUNCTION_CALL",
            "IMAGE_SAFETY",
            "IMAGE_PROHIBITED_CONTENT",
            "IMAGE_OTHER",
            "NO_IMAGE",
            "IMAGE_RECITATION",
            "UNEXPECTED_TOOL_CALL",
            "TOO_MANY_TOOL_CALLS",
            "MISSING_THOUGHT_SIGNATURE",
            "MALFORMED_RESPONSE",
            "ESCALATION",
            "PUP_LIMITED_DISABLED",
            "CONTINUATION"
          ],
          "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens."
        }
      },
      "type": "object"
    },
    "CitationMetadata": {
      "properties": {
        "citationSources": {
          "description": "Citations to sources for a specific response.",
          "items": {
            "$ref": "#/$defs/CitationSource"
          },
          "type": "array"
        }
      },
      "description": "A collection of source attributions for a piece of content.",
      "type": "object"
    },
    "CitationSource": {
      "type": "object",
      "description": "A citation to a source for a portion of a specific response.",
      "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."
        },
        "uri": {
          "type": "string",
          "description": "Optional. URI that is attributed as a source for a portion of the text."
        },
        "startIndex": {
          "type": "integer",
          "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"
        },
        "endIndex": {
          "format": "int32",
          "type": "integer",
          "description": "Optional. End of the attributed segment, exclusive."
        }
      }
    },
    "CodeExecutionResult": {
      "type": "object",
      "description": "Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.",
      "properties": {
        "id": {
          "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
          "type": "string"
        },
        "output": {
          "type": "string",
          "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise."
        },
        "outcome": {
          "type": "string",
          "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
          ],
          "description": "Required. Outcome of the code execution."
        }
      }
    },
    "Content": {
      "properties": {
        "parts": {
          "type": "array",
          "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.",
          "items": {
            "$ref": "#/$defs/Part"
          }
        },
        "role": {
          "description": "Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.",
          "type": "string"
        }
      },
      "type": "object",
      "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."
    },
    "ExecutableCode": {
      "description": "Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.",
      "properties": {
        "language": {
          "type": "string",
          "description": "Required. Programming language of the `code`.",
          "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
          ]
        },
        "id": {
          "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
          "type": "string"
        },
        "code": {
          "type": "string",
          "description": "Required. The code to be executed."
        }
      },
      "type": "object"
    },
    "FileData": {
      "properties": {
        "fileUri": {
          "description": "Required. URI.",
          "type": "string"
        },
        "displayName": {
          "description": "Optional. Specifies the name used to refer to this file to the model (e.g. \"my_file.pdf\"). Used as the file reference identifier when `verbalization_mode` is set to `REFERENCE_ONLY`.",
          "type": "string"
        },
        "mimeType": {
          "description": "Optional. The IANA standard MIME type of the source data.",
          "type": "string"
        }
      },
      "description": "URI based data.",
      "type": "object"
    },
    "FunctionCall": {
      "properties": {
        "name": {
          "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.",
          "type": "string"
        },
        "args": {
          "type": "object",
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "description": "Optional. The function parameters and values in JSON object format."
        },
        "id": {
          "description": "Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.",
          "type": "string"
        }
      },
      "type": "object",
      "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values."
    },
    "FunctionResponse": {
      "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`."
        },
        "scheduling": {
          "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
          ],
          "type": "string",
          "description": "Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
        },
        "response": {
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "type": "object",
          "description": "Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. \"output\", \"result\", etc. In particular, if the function call failed to execute, the response can have an \"error\" key to return error details to the model. Multimedia can be included by using a subobject containing a single \"$ref\" key whose value is the `inline_data.display_name` or `file_data.display_name` of a `FunctionResponsePart` holding the multimedia. See [Multimodal function responses](https://aistudio.google.com/docs/function-calling#multimodal)."
        },
        "name": {
          "type": "string",
          "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128."
        },
        "willContinue": {
          "description": "Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.",
          "type": "boolean"
        },
        "parts": {
          "type": "array",
          "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
          "items": {
            "$ref": "#/$defs/FunctionResponsePart"
          }
        }
      },
      "type": "object"
    },
    "FunctionResponseBlob": {
      "description": "Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.",
      "properties": {
        "displayName": {
          "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{\"$ref\": \"DISPLAY_NAME\"}`).",
          "type": "string"
        },
        "data": {
          "type": "string",
          "description": "Raw bytes for media formats.",
          "format": "byte"
        },
        "mimeType": {
          "type": "string",
          "description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://aistudio.google.com/docs/file-input-methods#supported-content-types)."
        }
      },
      "type": "object"
    },
    "FunctionResponseFileData": {
      "description": "URI based data for function response.",
      "properties": {
        "fileUri": {
          "description": "Required. URI.",
          "type": "string"
        },
        "mimeType": {
          "description": "The IANA standard MIME type of the source data. If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Multimodal function responses](https://aistudio.google.com/docs/function-calling#multimodal) and [Supported file formats](https://aistudio.google.com/docs/file-input-methods#supported-content-types).",
          "type": "string"
        },
        "displayName": {
          "type": "string",
          "description": "Optional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{\"$ref\": \"DISPLAY_NAME\"}`)."
        }
      },
      "type": "object"
    },
    "FunctionResponsePart": {
      "properties": {
        "inlineData": {
          "$ref": "#/$defs/FunctionResponseBlob",
          "description": "Inline media bytes."
        },
        "mediaProcessing": {
          "description": "Optional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.",
          "enum": [
            "MEDIA_PROCESSING_UNSPECIFIED",
            "STATIC",
            "AGENTIC"
          ],
          "type": "string"
        },
        "fileData": {
          "$ref": "#/$defs/FunctionResponseFileData",
          "description": "URI based data."
        }
      },
      "type": "object",
      "description": "A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. Media can be passed as raw bytes (`inline_data`) or by URI (`file_data`) with an IANA MIME type identifying the type and subtype of the media."
    },
    "GoogleAiGenerativelanguageV1betaGroundingSupport": {
      "type": "object",
      "description": "Grounding support.",
      "properties": {
        "renderedParts": {
          "items": {
            "type": "integer",
            "format": "int32"
          },
          "description": "Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.",
          "readOnly": true,
          "type": "array"
        },
        "segment": {
          "$ref": "#/$defs/GoogleAiGenerativelanguageV1betaSegment",
          "description": "Segment of the content this support belongs to."
        },
        "groundingChunkIndices": {
          "description": "Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order).",
          "items": {
            "type": "integer",
            "format": "int32"
          },
          "type": "array"
        },
        "confidenceScores": {
          "description": "Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
          "items": {
            "format": "float",
            "type": "number"
          },
          "type": "array"
        }
      }
    },
    "GoogleAiGenerativelanguageV1betaSegment": {
      "properties": {
        "startIndex": {
          "type": "integer",
          "format": "int32",
          "description": "Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero."
        },
        "partIndex": {
          "type": "integer",
          "format": "int32",
          "description": "The index of a Part object within its parent Content object."
        },
        "text": {
          "description": "The text corresponding to the segment from the response.",
          "type": "string"
        },
        "endIndex": {
          "description": "End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
          "type": "integer",
          "format": "int32"
        }
      },
      "type": "object",
      "description": "Segment of the content."
    },
    "GroundingAttribution": {
      "description": "Attribution for a source that contributed to an answer.",
      "properties": {
        "content": {
          "$ref": "#/$defs/Content",
          "description": "Grounding source content that makes up this attribution."
        },
        "sourceId": {
          "$ref": "#/$defs/AttributionSourceId",
          "description": "Output only. Identifier for the source contributing to this attribution."
        }
      },
      "type": "object"
    },
    "GroundingChunk": {
      "type": "object",
      "description": "A `GroundingChunk` represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps.",
      "properties": {
        "web": {
          "$ref": "#/$defs/Web",
          "description": "Grounding chunk from the web."
        },
        "maps": {
          "$ref": "#/$defs/Maps",
          "description": "Optional. Grounding chunk from Google Maps."
        },
        "retrievedContext": {
          "$ref": "#/$defs/RetrievedContext",
          "description": "Optional. Grounding chunk from context retrieved by the file search tool."
        },
        "image": {
          "$ref": "#/$defs/Image",
          "description": "Optional. Grounding chunk from image search."
        }
      }
    },
    "GroundingChunkCustomMetadata": {
      "type": "object",
      "properties": {
        "stringValue": {
          "type": "string",
          "description": "Optional. The string value of the metadata."
        },
        "stringListValue": {
          "$ref": "#/$defs/GroundingChunkStringList",
          "description": "Optional. A list of string values for the metadata."
        },
        "numericValue": {
          "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.",
          "format": "float",
          "type": "number"
        },
        "key": {
          "type": "string",
          "description": "The key of the metadata."
        }
      },
      "description": "User provided metadata about the GroundingFact."
    },
    "GroundingChunkStringList": {
      "description": "A list of string values.",
      "properties": {
        "values": {
          "type": "array",
          "description": "The string values of the list.",
          "items": {
            "type": "string"
          }
        }
      },
      "type": "object"
    },
    "GroundingMetadata": {
      "type": "object",
      "description": "Metadata returned to client when grounding is enabled.",
      "properties": {
        "googleMapsWidgetContextToken": {
          "description": "Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled.",
          "type": "string"
        },
        "groundingChunks": {
          "items": {
            "$ref": "#/$defs/GroundingChunk"
          },
          "type": "array",
          "description": "List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses."
        },
        "imageSearchQueries": {
          "description": "Image search queries used for grounding.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "retrievalMetadata": {
          "$ref": "#/$defs/RetrievalMetadata",
          "description": "Metadata related to retrieval in the grounding flow."
        },
        "searchEntryPoint": {
          "$ref": "#/$defs/SearchEntryPoint",
          "description": "Optional. Google search entry for the following-up web searches."
        },
        "groundingSupports": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GoogleAiGenerativelanguageV1betaGroundingSupport"
          },
          "description": "List of grounding support."
        },
        "webSearchQueries": {
          "items": {
            "type": "string"
          },
          "description": "Web search queries for the following-up web search.",
          "type": "array"
        }
      }
    },
    "GroundingPassageId": {
      "description": "Identifier for a part within a `GroundingPassage`.",
      "type": "object",
      "properties": {
        "passageId": {
          "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.",
          "readOnly": true,
          "type": "string"
        },
        "partIndex": {
          "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.",
          "format": "int32",
          "readOnly": true,
          "type": "integer"
        }
      }
    },
    "Image": {
      "description": "Chunk from image search.",
      "type": "object",
      "properties": {
        "title": {
          "description": "The title of the web page that the image is from.",
          "type": "string"
        },
        "domain": {
          "description": "The root domain of the web page that the image is from, e.g. \"example.com\".",
          "type": "string"
        },
        "imageUri": {
          "description": "The image asset URL.",
          "type": "string"
        },
        "sourceUri": {
          "type": "string",
          "description": "The web page URI for attribution."
        }
      }
    },
    "LogprobsResult": {
      "properties": {
        "chosenCandidates": {
          "items": {
            "$ref": "#/$defs/LogprobsResultCandidate"
          },
          "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.",
          "type": "array"
        },
        "topCandidates": {
          "description": "Length = total number of decoding steps.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TopCandidates"
          }
        },
        "logProbabilitySum": {
          "description": "Sum of log probabilities for all tokens.",
          "type": "number",
          "format": "float"
        }
      },
      "type": "object",
      "description": "Logprobs Result"
    },
    "LogprobsResultCandidate": {
      "type": "object",
      "description": "Candidate for the logprobs token and score.",
      "properties": {
        "logProbability": {
          "type": "number",
          "description": "The candidate's log probability.",
          "format": "float"
        },
        "token": {
          "type": "string",
          "description": "The candidate’s token string value."
        },
        "tokenId": {
          "format": "int32",
          "description": "The candidate’s token id value.",
          "type": "integer"
        }
      }
    },
    "Maps": {
      "properties": {
        "title": {
          "description": "Title of the place.",
          "type": "string"
        },
        "uri": {
          "description": "URI reference of the place.",
          "type": "string"
        },
        "placeId": {
          "description": "The ID of the place, in `places/{place_id}` format. A user can use this ID to look up that place.",
          "type": "string"
        },
        "text": {
          "type": "string",
          "description": "Text description of the place answer."
        },
        "placeAnswerSources": {
          "$ref": "#/$defs/PlaceAnswerSources",
          "description": "Sources that provide answers about the features of a given place in Google Maps."
        }
      },
      "description": "A grounding chunk from Google Maps. A Maps chunk corresponds to a single place.",
      "type": "object"
    },
    "ModalityTokenCount": {
      "type": "object",
      "properties": {
        "modality": {
          "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "VIDEO",
            "AUDIO",
            "DOCUMENT"
          ],
          "description": "The modality associated with this token count.",
          "type": "string"
        },
        "tokenCount": {
          "format": "int32",
          "type": "integer",
          "description": "Number of tokens."
        }
      },
      "description": "Represents token counting info for a single modality."
    },
    "ModelStatus": {
      "description": "The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.",
      "type": "object",
      "properties": {
        "modelStage": {
          "description": "The stage of the underlying model.",
          "type": "string",
          "enum": [
            "MODEL_STAGE_UNSPECIFIED",
            "UNSTABLE_EXPERIMENTAL",
            "EXPERIMENTAL",
            "PREVIEW",
            "STABLE",
            "LEGACY",
            "DEPRECATED",
            "RETIRED"
          ]
        },
        "retirementTime": {
          "format": "google-datetime",
          "description": "The time at which the model will be retired.",
          "type": "string"
        },
        "message": {
          "description": "A message explaining the model status.",
          "type": "string"
        }
      }
    },
    "Part": {
      "properties": {
        "executableCode": {
          "$ref": "#/$defs/ExecutableCode",
          "description": "Code generated by the model that is meant to be executed."
        },
        "codeExecutionResult": {
          "$ref": "#/$defs/CodeExecutionResult",
          "description": "Result of executing the `ExecutableCode`."
        },
        "functionResponse": {
          "$ref": "#/$defs/FunctionResponse",
          "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model."
        },
        "inlineData": {
          "$ref": "#/$defs/Blob",
          "description": "Inline media bytes."
        },
        "thought": {
          "description": "Optional. Indicates if the part is thought from the model.",
          "type": "boolean"
        },
        "toolResponse": {
          "$ref": "#/$defs/ToolResponse",
          "description": "The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`."
        },
        "toolCall": {
          "$ref": "#/$defs/ToolCall",
          "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
        },
        "videoMetadata": {
          "$ref": "#/$defs/VideoMetadata",
          "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
        },
        "mediaProcessing": {
          "description": "Optional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.",
          "type": "string",
          "enum": [
            "MEDIA_PROCESSING_UNSPECIFIED",
            "STATIC",
            "AGENTIC"
          ]
        },
        "functionCall": {
          "$ref": "#/$defs/FunctionCall",
          "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values."
        },
        "mediaResolution": {
          "$ref": "#/$defs/V1mainMediaResolution",
          "description": "Optional. Media resolution for the input media."
        },
        "partMetadata": {
          "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.",
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "type": "object"
        },
        "fileData": {
          "$ref": "#/$defs/FileData",
          "description": "URI based data."
        },
        "thoughtSignature": {
          "type": "string",
          "format": "byte",
          "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests."
        },
        "text": {
          "type": "string",
          "description": "Inline text."
        },
        "audioTranscription": {
          "$ref": "#/$defs/AudioTranscription",
          "description": "Optional. Audio (input or output) transcription. This is only set when this Part contains audio data."
        },
        "speechMetadata": {
          "$ref": "#/$defs/SpeechMetadata",
          "description": "Optional. Metadata applied to text parts to customize how they should be spoken or synthesized, such as specifying speaker identity or speaking style."
        }
      },
      "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.",
      "type": "object"
    },
    "PlaceAnswerSources": {
      "type": "object",
      "properties": {
        "reviewSnippets": {
          "description": "Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewSnippet"
          }
        }
      },
      "description": "Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: \"does Bar Foo have Wifi\" or \"is Foo Bar wheelchair accessible?\"). Currently we only support review snippets as sources."
    },
    "PromptFeedback": {
      "properties": {
        "blockReason": {
          "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.",
          "type": "string",
          "enum": [
            "BLOCK_REASON_UNSPECIFIED",
            "SAFETY",
            "OTHER",
            "BLOCKLIST",
            "PROHIBITED_CONTENT",
            "IMAGE_SAFETY"
          ]
        },
        "safetyRatings": {
          "items": {
            "$ref": "#/$defs/SafetyRating"
          },
          "type": "array",
          "description": "Ratings for safety of the prompt. There is at most one rating per category."
        }
      },
      "type": "object",
      "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`."
    },
    "RetrievalMetadata": {
      "type": "object",
      "description": "Metadata related to retrieval in the grounding flow.",
      "properties": {
        "googleSearchDynamicRetrievalScore": {
          "type": "number",
          "description": "Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search.",
          "format": "float"
        }
      }
    },
    "RetrievedContext": {
      "properties": {
        "mediaId": {
          "type": "string",
          "description": "Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}"
        },
        "text": {
          "description": "Optional. Text of the chunk.",
          "type": "string"
        },
        "fileSearchStore": {
          "type": "string",
          "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`"
        },
        "uri": {
          "description": "Optional. URI reference of the semantic retrieval document.",
          "type": "string"
        },
        "pageNumber": {
          "type": "integer",
          "format": "int32",
          "description": "Optional. Page number of the retrieved context, if applicable."
        },
        "title": {
          "description": "Optional. Title of the document.",
          "type": "string"
        },
        "customMetadata": {
          "type": "array",
          "description": "Optional. User-provided metadata about the retrieved context.",
          "items": {
            "$ref": "#/$defs/GroundingChunkCustomMetadata"
          }
        }
      },
      "type": "object",
      "description": "Chunk from context retrieved by the file search tool."
    },
    "ReviewSnippet": {
      "description": "Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.",
      "properties": {
        "reviewId": {
          "description": "The ID of the review snippet.",
          "type": "string"
        },
        "googleMapsUri": {
          "description": "A link that corresponds to the user review on Google Maps.",
          "type": "string"
        },
        "title": {
          "description": "Title of the review.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "SafetyRating": {
      "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.",
      "type": "object",
      "properties": {
        "blocked": {
          "type": "boolean",
          "description": "Was this content blocked because of this rating?"
        },
        "probability": {
          "enum": [
            "HARM_PROBABILITY_UNSPECIFIED",
            "NEGLIGIBLE",
            "LOW",
            "MEDIUM",
            "HIGH"
          ],
          "description": "Required. The probability of harm for this content.",
          "type": "string"
        },
        "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",
            "HARM_CATEGORY_JAILBREAK"
          ],
          "type": "string",
          "description": "Required. The category for this rating."
        }
      }
    },
    "SearchEntryPoint": {
      "type": "object",
      "properties": {
        "renderedContent": {
          "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
          "type": "string"
        },
        "sdkBlob": {
          "format": "byte",
          "description": "Optional. Base64 encoded JSON representing array of tuple.",
          "type": "string"
        }
      },
      "description": "Google search entry point."
    },
    "SemanticRetrieverChunk": {
      "type": "object",
      "properties": {
        "source": {
          "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`",
          "type": "string",
          "readOnly": true
        },
        "chunk": {
          "type": "string",
          "readOnly": true,
          "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`"
        }
      },
      "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`."
    },
    "SpeechMetadata": {
      "description": "Speech metadata for `text` parts.",
      "properties": {
        "speaker": {
          "description": "Optional. Optional speaker name for multi-speaker synthesis.",
          "type": "string"
        },
        "style": {
          "description": "Optional. Optional style instruction for the speech synthesis.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ToolCall": {
      "type": "object",
      "properties": {
        "id": {
          "description": "Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
          "type": "string"
        },
        "toolName": {
          "type": "string",
          "description": "Optional. The name of the tool that was called."
        },
        "args": {
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "type": "object",
          "description": "Optional. The tool call arguments. Example: {\"arg1\" : \"value1\", \"arg2\" : \"value2\" , ...}"
        },
        "toolType": {
          "type": "string",
          "enum": [
            "TOOL_TYPE_UNSPECIFIED",
            "GOOGLE_SEARCH_WEB",
            "GOOGLE_SEARCH_IMAGE",
            "URL_CONTEXT",
            "GOOGLE_MAPS",
            "FILE_SEARCH",
            "MEDIA_PROCESSING"
          ],
          "description": "Required. The type of tool that was called."
        }
      },
      "description": "A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`."
    },
    "ToolResponse": {
      "description": "The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.",
      "type": "object",
      "properties": {
        "id": {
          "description": "Optional. The identifier of the tool call this response is for.",
          "type": "string"
        },
        "toolType": {
          "description": "Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.",
          "enum": [
            "TOOL_TYPE_UNSPECIFIED",
            "GOOGLE_SEARCH_WEB",
            "GOOGLE_SEARCH_IMAGE",
            "URL_CONTEXT",
            "GOOGLE_MAPS",
            "FILE_SEARCH",
            "MEDIA_PROCESSING"
          ],
          "type": "string"
        },
        "response": {
          "type": "object",
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "description": "Optional. The tool response."
        }
      }
    },
    "TopCandidates": {
      "properties": {
        "candidates": {
          "items": {
            "$ref": "#/$defs/LogprobsResultCandidate"
          },
          "description": "Sorted by log probability in descending order.",
          "type": "array"
        }
      },
      "type": "object",
      "description": "Candidates with top log probabilities at each decoding step."
    },
    "UrlContextMetadata": {
      "properties": {
        "urlMetadata": {
          "items": {
            "$ref": "#/$defs/UrlMetadata"
          },
          "type": "array",
          "description": "List of url context."
        }
      },
      "description": "Metadata related to url context retrieval tool.",
      "type": "object"
    },
    "UrlMetadata": {
      "description": "Context of the a single url retrieval.",
      "type": "object",
      "properties": {
        "retrievedUrl": {
          "type": "string",
          "description": "Retrieved url by the tool."
        },
        "urlRetrievalStatus": {
          "type": "string",
          "enum": [
            "URL_RETRIEVAL_STATUS_UNSPECIFIED",
            "URL_RETRIEVAL_STATUS_SUCCESS",
            "URL_RETRIEVAL_STATUS_ERROR",
            "URL_RETRIEVAL_STATUS_PAYWALL",
            "URL_RETRIEVAL_STATUS_UNSAFE"
          ],
          "description": "Status of the url retrieval."
        }
      }
    },
    "UsageMetadata": {
      "type": "object",
      "properties": {
        "thoughtsTokenCount": {
          "description": "Output only. Number of tokens of thoughts for thinking models.",
          "readOnly": true,
          "type": "integer",
          "format": "int32"
        },
        "candidatesTokenCount": {
          "format": "int32",
          "type": "integer",
          "description": "Total number of tokens across all the generated response candidates."
        },
        "promptTokensDetails": {
          "description": "Output only. List of modalities that were processed in the request input.",
          "items": {
            "$ref": "#/$defs/ModalityTokenCount"
          },
          "type": "array",
          "readOnly": true
        },
        "toolUsePromptTokenCount": {
          "type": "integer",
          "format": "int32",
          "description": "Output only. Number of tokens present in tool-use prompt(s).",
          "readOnly": true
        },
        "promptTokenCount": {
          "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.",
          "type": "integer",
          "format": "int32"
        },
        "cacheTokensDetails": {
          "description": "Output only. List of modalities of the cached content in the request input.",
          "readOnly": true,
          "type": "array",
          "items": {
            "$ref": "#/$defs/ModalityTokenCount"
          }
        },
        "candidatesTokensDetails": {
          "description": "Output only. List of modalities that were returned in the response.",
          "items": {
            "$ref": "#/$defs/ModalityTokenCount"
          },
          "type": "array",
          "readOnly": true
        },
        "cachedContentTokenCount": {
          "description": "Number of tokens in the cached part of the prompt (the cached content)",
          "type": "integer",
          "format": "int32"
        },
        "totalTokenCount": {
          "description": "Total token count for the generation request (prompt + tool-use prompt + thoughts + response candidates).",
          "format": "int32",
          "type": "integer"
        },
        "serviceTier": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. Service tier of the request.",
          "enum": [
            "unspecified",
            "standard",
            "flex",
            "priority"
          ]
        },
        "toolUsePromptTokensDetails": {
          "items": {
            "$ref": "#/$defs/ModalityTokenCount"
          },
          "description": "Output only. List of modalities that were processed for tool-use request inputs.",
          "readOnly": true,
          "type": "array"
        }
      },
      "description": "Metadata on the generation request's token usage."
    },
    "V1mainMediaResolution": {
      "properties": {
        "level": {
          "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH",
            "MEDIA_RESOLUTION_ULTRA_HIGH"
          ],
          "description": "The tokenization quality used for given media. for Gemini API support .",
          "type": "string"
        }
      },
      "type": "object",
      "description": "Media resolution for tokenization."
    },
    "VideoMetadata": {
      "properties": {
        "endOffset": {
          "type": "string",
          "format": "google-duration",
          "description": "Optional. The end offset of the video."
        },
        "startOffset": {
          "type": "string",
          "description": "Optional. The start offset of the video.",
          "format": "google-duration"
        },
        "fps": {
          "format": "double",
          "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].",
          "type": "number"
        }
      },
      "description": "Metadata describes the input video content. Set this in `Part.video_metadata` or `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing (such as time clipping, frame rate, maximum frame count, or extracted content layers).",
      "type": "object"
    },
    "Web": {
      "description": "Chunk from the web.",
      "properties": {
        "title": {
          "description": "Output only. Title of the chunk.",
          "type": "string",
          "readOnly": true
        },
        "uri": {
          "type": "string",
          "readOnly": true,
          "description": "Output only. URI reference of the chunk."
        }
      },
      "type": "object"
    },
    "WordInfo": {
      "description": "Information about a single recognized word.",
      "properties": {
        "word": {
          "type": "string",
          "description": "Required. Transcript of the word."
        },
        "startOffset": {
          "format": "google-duration",
          "description": "Optional. Start offset in time of the word relative to the start of the audio.",
          "type": "string"
        },
        "endOffset": {
          "format": "google-duration",
          "description": "Optional. End offset in time of the word relative to the start of the audio.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}