> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate content

> Generates a model response given an input `GenerateContentRequest`.
Refer to the [text generation
guide](https://aistudio.google.com/docs/text-generation) for detailed
usage information. Input capabilities differ between models, including
tuned models. Refer to the [model
guide](https://aistudio.google.com/docs/models) and [tuning
guide](https://aistudio.google.com/docs/model-tuning) for details.



## OpenAPI

````yaml /openapi/en/gemini-generate-content.json post /v1beta/models/{model}:generateContent
openapi: 3.0.3
info:
  title: Gemini generateContent
  version: v1beta
  description: >-
    Call Gemini models with the Gemini generateContent protocol (v1beta):
    multimodal input, thinking, streaming, function calling and structured
    output.
servers:
  - url: https://api.dreamto.ai
security:
  - apiKeyAuth: []
  - bearerAuth: []
tags:
  - name: generateContent
paths:
  /v1beta/models/{model}:generateContent:
    post:
      tags:
        - generateContent
      summary: Generate content
      description: |-
        Generates a model response given an input `GenerateContentRequest`.
        Refer to the [text generation
        guide](https://aistudio.google.com/docs/text-generation) for detailed
        usage information. Input capabilities differ between models, including
        tuned models. Refer to the [model
        guide](https://aistudio.google.com/docs/models) and [tuning
        guide](https://aistudio.google.com/docs/model-tuning) for details.
      operationId: generateContent
      parameters:
        - description: >-
            ID of the model to use, for example `gemini-4-hydrogen`. See
            [Models](/en/llm/gemini-generate-content) for the available models.
          required: true
          schema:
            type: string
            default: gemini-4-hydrogen
          in: path
          name: model
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateContentRequest'
            examples:
              Basic request:
                summary: Basic request
                description: The model ID is in the path; the body only needs `contents`.
                value:
                  contents:
                    - role: user
                      parts:
                        - text: Explain quantum computing in three sentences.
              System instruction and multi-turn conversation:
                summary: System instruction and multi-turn conversation
                description: >-
                  The system instruction goes in `systemInstruction`; earlier
                  model turns use `role: model`.
                value:
                  systemInstruction:
                    parts:
                      - text: You are a concise, professional assistant.
                  contents:
                    - role: user
                      parts:
                        - text: Suggest a name for a coffee shop.
                    - role: model
                      parts:
                        - text: How about "Morning Light Coffee"?
                    - role: user
                      parts:
                        - text: Now add a tagline for that name.
              Generation settings and thinking:
                summary: Generation settings and thinking
                description: >-
                  `generationConfig` controls the output length and the thinking
                  depth (`thinkingConfig.thinkingLevel`).
                value:
                  contents:
                    - role: user
                      parts:
                        - text: >-
                            Prove that among any five integers there are three
                            whose sum is divisible by 3.
                  generationConfig:
                    maxOutputTokens: 8192
                    thinkingConfig:
                      thinkingLevel: HIGH
              Image input:
                summary: Image input
                description: >-
                  Pass a Base64-encoded image in `inlineData` together with its
                  `mimeType`.
                value:
                  contents:
                    - role: user
                      parts:
                        - inlineData:
                            mimeType: image/jpeg
                            data: <Base64-encoded image>
                        - text: What is in this image?
              Function calling:
                summary: Function calling
                description: >-
                  The model returns a `functionCall` part when it needs outside
                  data; send the result back in a `functionResponse` part.
                value:
                  contents:
                    - role: user
                      parts:
                        - text: What's the weather like in Hangzhou today?
                  tools:
                    - functionDeclarations:
                        - name: get_weather
                          description: Get the current weather for a city
                          parametersJsonSchema:
                            type: object
                            properties:
                              city:
                                type: string
                                description: City name, e.g. Hangzhou
                              unit:
                                type: string
                                enum:
                                  - celsius
                                  - fahrenheit
                            required:
                              - city
              Structured output:
                summary: Structured output
                description: >-
                  Set `responseMimeType` to `application/json` and describe the
                  structure in `responseJsonSchema`.
                value:
                  contents:
                    - role: user
                      parts:
                        - text: >-
                            Extract the contact from this sentence: I'm Li Lei
                            from Galaxy Tech, lilei@example.com.
                  generationConfig:
                    responseMimeType: application/json
                    responseJsonSchema:
                      type: object
                      properties:
                        name:
                          type: string
                        company:
                          type: string
                        email:
                          type: string
                      required:
                        - name
                        - company
                        - email
        required: true
      responses:
        '200':
          description: The model's reply, with the candidates and usage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateContentResponse'
        '400':
          description: >-
            Invalid request: malformed JSON, a missing required field, or a
            parameter the chosen model does not support. Fix it as `message`
            says and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: invalid_request
                      http_status: 400
                      message: Invalid request.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: invalid_request_error
        '401':
          description: The API Key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: unauthorized
                      http_status: 401
                      message: Unauthorized.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: authentication_error
        '402':
          description: Insufficient balance; top up and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: insufficient_balance
                      http_status: 402
                      message: Insufficient balance.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: insufficient_balance_error
        '403':
          description: This API Key is not allowed to use the model.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: forbidden
                      http_status: 403
                      message: Access denied.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: permission_error
        '404':
          description: The model does not exist or is not available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: not_found
                      http_status: 404
                      message: The requested model was not found.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: invalid_request_error
        '429':
          description: Rate limit exceeded; back off and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: rate_limit_exceeded
                      http_status: 429
                      message: Rate limit exceeded. Please try again later.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: rate_limit_error
        '500':
          description: Internal error; retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: api_error
                      http_status: 500
                      message: Internal server error.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: api_error
        '503':
          description: Service temporarily unavailable or timed out; retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: service_unavailable
                      http_status: 503
                      message: Service temporarily unavailable. Please try again later.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: api_error
components:
  schemas:
    GenerateContentRequest:
      description: Request to generate a completion from the model.
      properties:
        continuationToken:
          format: byte
          description: >-
            Optional. An opaque continuation token used to resume generation
            from a

            previous `GenerateContent` or `StreamGenerateContent` response that
            stopped

            with `finish_reason` set to `CONTINUATION`. Note that `contents` is

            mandatory and must identically replicate the prompt and conversation

            history from the initial request when continuation token is provided
            in

            a request.
          type: string
        tools:
          items:
            $ref: '#/components/schemas/Tool'
          type: array
          description: >-
            Optional. A list of `Tools` the `Model` may use to generate the next
            response.


            A `Tool` is a piece of code that enables the system to interact with

            external systems to perform an action, or set of actions, outside of

            knowledge and scope of the `Model`. Supported `Tool`s are `Function`
            and

            `code_execution`. Refer to the [Function

            calling](https://aistudio.google.com/docs/function-calling) and the

            [Code execution](https://aistudio.google.com/docs/code-execution)

            guides to learn more.
        serviceTier:
          description: Optional. The service tier of the request.
          allOf:
            - $ref: '#/components/schemas/ServiceTier'
        toolConfig:
          description: >-
            Optional. Tool configuration for any `Tool` specified in the
            request. Refer to the

            [Function calling

            guide](https://aistudio.google.com/docs/function-calling#function_calling_modes)

            for a usage example.
          allOf:
            - $ref: '#/components/schemas/ToolConfig'
        safetySettings:
          description: >-
            Optional. A list of unique `SafetySetting` instances for blocking
            unsafe content.


            This will be enforced on the `GenerateContentRequest.contents` and

            `GenerateContentResponse.candidates`. There should not be more than
            one

            setting for each `SafetyCategory` type. The API will block any
            contents and

            responses that fail to meet the thresholds set by these settings.
            This list

            overrides the default settings for each `SafetyCategory` specified
            in the

            safety_settings. If there is no `SafetySetting` for a given

            `SafetyCategory` provided in the list, the API will use the default
            safety

            setting for that category. Harm categories
            HARM_CATEGORY_HATE_SPEECH,

            HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,

            HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY,

            HARM_CATEGORY_JAILBREAK are supported.

            Refer to the
            [guide](https://aistudio.google.com/docs/safety-settings)

            for detailed information on available safety settings. Also refer to
            the

            [Safety guidance](https://aistudio.google.com/docs/safety-guidance)
            to

            learn how to incorporate safety considerations in your AI
            applications.
          type: array
          items:
            $ref: '#/components/schemas/SafetySetting'
        labels:
          description: >-
            Optional. Labels with user-defined metadata for the request.


            Optional. Labels must follow standard unified Cloud label
            requirements:

            - Label keys must start with a letter.

            - Label keys and values can be no longer than 63 characters (Unicode
              codepoints) and can only contain lowercase letters, numeric characters,
              underscores, and dashes.
            - International characters are allowed.


            Usage:

            -  Safety identifiers from aggregators: Use the key
            `safety_identifier`
               (e.g. `{"safety_identifier": "user_session_123"}`)
          type: object
          additionalProperties:
            type: string
        cachedContent:
          description: |-
            Optional. The name of the content
            [cached](https://aistudio.google.com/docs/caching) to use as context
            to serve the prediction. Format: `cachedContents/{cachedContent}`
          type: string
        generationConfig:
          description: Optional. Configuration options for model generation and outputs.
          allOf:
            - $ref: '#/components/schemas/GenerationConfig'
        store:
          description: >-
            Optional. Configures the logging behavior for a given request. If
            set, it takes

            precedence over the project-level logging config.
          type: boolean
        systemInstruction:
          allOf:
            - $ref: '#/components/schemas/Content'
          description: >-
            Optional. Developer set [system

            instruction(s)](https://aistudio.google.com/docs/text-generation#system-instructions).

            Currently, text only.
        contents:
          description: >-
            Required. The content of the current conversation with the model.


            For single-turn queries, this is a single instance. For multi-turn
            queries

            like

            [chat](https://aistudio.google.com/docs/text-generation#multi-turn-conversations),

            this is a repeated field that contains the conversation history and
            the

            latest request.
          type: array
          items:
            $ref: '#/components/schemas/Content'
      type: object
      required:
        - contents
    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`.
      type: object
      properties:
        modelVersion:
          description: Output only. The model version used to generate the response.
          readOnly: true
          type: string
        candidates:
          items:
            $ref: '#/components/schemas/Candidate'
          description: Candidate responses from the model.
          type: array
        promptFeedback:
          allOf:
            - $ref: '#/components/schemas/PromptFeedback'
          description: Returns the prompt's feedback related to the content filters.
        responseId:
          type: string
          description: Output only. response_id is used to identify each response.
          readOnly: true
        usageMetadata:
          readOnly: true
          description: Output only. Metadata on the generation requests' token usage.
          allOf:
            - $ref: '#/components/schemas/UsageMetadata'
        modelStatus:
          readOnly: true
          description: Output only. The current model status of this model.
          allOf:
            - $ref: '#/components/schemas/ModelStatus'
    GatewayError:
      type: object
      description: Error response.
      properties:
        error:
          type: object
          description: Error details.
          properties:
            code:
              type: string
              description: >-
                Error code, for example `invalid_request`, `unauthorized`,
                `insufficient_balance` or `rate_limit_exceeded`. In a few
                parameter errors returned by the model side directly it is the
                numeric status code.
            http_status:
              type: integer
              description: >-
                Same as the HTTP status code of the response; a few errors
                returned by the model side directly omit it.
            message:
              type: string
              description: >-
                Error description. Branch on the status code and `code`, not on
                this text.
            request_id:
              type: string
              description: >-
                ID of this request, also returned in the `X-Request-Id` header;
                include it when reporting a problem. A few errors omit it, so
                prefer the header.
            type:
              type: string
              description: >-
                Error category, for example `invalid_request_error`,
                `authentication_error`, `rate_limit_error` or `api_error`; a few
                errors omit it.
          required:
            - code
            - message
      required:
        - error
    Tool:
      properties:
        fileSearch:
          description: |-
            Optional. FileSearch tool type.
            Tool to retrieve knowledge from Semantic Retrieval corpora.
          allOf:
            - $ref: '#/components/schemas/FileSearch'
        googleSearchRetrieval:
          allOf:
            - $ref: '#/components/schemas/GoogleSearchRetrieval'
          description: Optional. Retrieval tool that is powered by Google search.
        googleSearch:
          description: |-
            Optional. GoogleSearch tool type.
            Tool to support Google Search in Model. Powered by Google.
          allOf:
            - $ref: '#/components/schemas/GoogleSearch'
        codeExecution:
          description: Optional. Enables the model to execute code as part of generation.
          allOf:
            - $ref: '#/components/schemas/CodeExecution'
        computerUse:
          description: >-
            Optional. Tool to support the model interacting directly with the
            computer.

            If enabled, it automatically populates computer-use specific
            Function

            Declarations.
          allOf:
            - $ref: '#/components/schemas/ComputerUse'
        googleMaps:
          allOf:
            - $ref: '#/components/schemas/GoogleMaps'
          description: >-
            Optional. Tool that allows grounding the model's response with
            geospatial context

            related to the user's query.
        functionDeclarations:
          description: >-
            Optional. A list of `FunctionDeclarations` available to the model
            that can be used

            for function calling.


            The model or system does not execute the function. Instead the
            defined

            function may be returned as a FunctionCall

            with arguments to the client side for execution. The model may
            decide to

            call a subset of these functions by populating

            FunctionCall in the response. The next

            conversation turn may contain a

            FunctionResponse

            with the Content.role "function" generation context for the next
            model

            turn.
          items:
            $ref: '#/components/schemas/FunctionDeclaration'
          type: array
        urlContext:
          description: Optional. Tool to support URL context retrieval.
          allOf:
            - $ref: '#/components/schemas/UrlContext'
        mcpServers:
          type: array
          description: Optional. MCP Servers to connect to.
          items:
            $ref: '#/components/schemas/McpServer'
      type: object
      description: |-
        Tool details that the model may use to generate response.

        A `Tool` is a piece of code that enables the system to interact with
        external systems to perform an action, or set of actions, outside of
        knowledge and scope of the model.
    ServiceTier:
      enum:
        - unspecified
        - standard
        - flex
        - priority
      type: string
      description: |-
        **Allowed values:**
        - `unspecified`: Default service tier, which is standard.
        - `standard`: Standard service tier.
        - `flex`: Flex service tier.
        - `priority`: Priority service tier.
    ToolConfig:
      properties:
        functionCallingConfig:
          description: Optional. Function calling config.
          allOf:
            - $ref: '#/components/schemas/FunctionCallingConfig'
        retrievalConfig:
          allOf:
            - $ref: '#/components/schemas/RetrievalConfig'
          description: Optional. Retrieval config.
        includeServerSideToolInvocations:
          type: boolean
          description: >-
            Optional. If true, the API response will include the server-side
            tool calls and

            responses within the `Content` message. This allows clients to

            observe the server's tool interactions.
      description: |-
        The Tool configuration containing parameters for specifying `Tool` use
        in the request.
      type: object
    SafetySetting:
      properties:
        category:
          allOf:
            - $ref: '#/components/schemas/HarmCategory'
          description: Required. The category for this setting.
        threshold:
          type: string
          description: >-
            Required. Controls the probability threshold at which harm is
            blocked.


            **Allowed values:**

            - `HARM_BLOCK_THRESHOLD_UNSPECIFIED`: Threshold is unspecified.

            - `BLOCK_LOW_AND_ABOVE`: Content with NEGLIGIBLE will be allowed.

            - `BLOCK_MEDIUM_AND_ABOVE`: Content with NEGLIGIBLE and LOW will be
            allowed.

            - `BLOCK_ONLY_HIGH`: Content with NEGLIGIBLE, LOW, and MEDIUM will
            be allowed.

            - `BLOCK_NONE`: All content will be allowed.

            - `OFF`: 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: object
      required:
        - category
        - threshold
      description: >-
        Safety setting, affecting the safety-blocking behavior.


        Passing a safety setting for a category changes the allowed probability
        that

        content is blocked.
    GenerationConfig:
      type: object
      description: >-
        Configuration options for model generation and outputs. Not all
        parameters

        are configurable for every model.
      properties:
        _responseJsonSchema:
          description: >-
            Optional. Output schema of the generated response. This is an
            alternative to

            `response_schema` that accepts [JSON
            Schema](https://json-schema.org/).


            If set, `response_schema` must be omitted, but `response_mime_type`
            is

            required.


            While the full JSON Schema may be sent, not all features are
            supported.

            Specifically, only the following properties are supported:


            - `$id`

            - `$defs`

            - `$ref`

            - `$anchor`

            - `type`

            - `format`

            - `title`

            - `description`

            - `enum` (for strings and numbers)

            - `items`

            - `prefixItems`

            - `minItems`

            - `maxItems`

            - `minimum`

            - `maximum`

            - `anyOf`

            - `oneOf` (interpreted the same as `anyOf`)

            - `properties`

            - `additionalProperties`

            - `required`


            The non-standard `propertyOrdering` property may also be set.


            Cyclic references are unrolled to a limited degree and, as such, may
            only

            be used within non-required properties. (Nullable properties are not

            sufficient.) If `$ref` is set on a sub-schema, no other properties,
            except

            for than those starting as a `$`, may be set.


            Deprecated. Use `response_format` instead.
          deprecated: true
        translationConfig:
          description: Optional. Config for translation.
          allOf:
            - $ref: '#/components/schemas/TranslationConfig'
        thinkingConfig:
          allOf:
            - $ref: '#/components/schemas/ThinkingConfig'
          description: |-
            Optional. Config for thinking features.
            An error will be returned if this field is set for models that don't
            support thinking.
        imageConfig:
          allOf:
            - $ref: '#/components/schemas/ImageConfig'
          description: |-
            Optional. Config for image generation.
            An error will be returned if this field is set for models that don't
            support these config options.
        candidateCount:
          description: >-
            Optional. Number of generated responses to return. If unset, this
            will default

            to 1. Please note that this doesn't work for previous generation

            models (Gemini 1.0 family)
          format: int32
          type: integer
        responseSchema:
          description: >-
            Optional. Output schema of the generated candidate text. Schemas
            must be a

            subset of the [OpenAPI
            schema](https://spec.openapis.org/oas/v3.0.3#schema)

            and can be objects, primitives or arrays.


            If set, a compatible `response_mime_type` must also be set.

            Compatible MIME types:

            `application/json`: Schema for JSON response.

            Refer to the [JSON text generation

            guide](https://aistudio.google.com/docs/structured-output) for more

            details.


            Deprecated. Use `response_format` instead.
          allOf:
            - $ref: '#/components/schemas/Schema'
          deprecated: true
        enableEnhancedCivicAnswers:
          description: >-
            Optional. Enables enhanced civic answers. It may not be available
            for all models.
          type: boolean
        maxOutputTokens:
          format: int32
          type: integer
          description: >-
            Optional. The maximum number of tokens to include in a response
            candidate.


            Note: The default value varies by model, see the
            `Model.output_token_limit`

            attribute of the `Model` returned from the `getModel` function.
        speechConfig:
          description: Optional. The speech generation config.
          allOf:
            - $ref: '#/components/schemas/SpeechConfig'
        temperature:
          description: >-
            Optional. Controls the randomness of the output.


            Note: The default value varies by model, see the `Model.temperature`

            attribute of the `Model` returned from the `getModel` function.


            Values can range from [0.0, 2.0].


            This field is no longer supported and is silently ignored on Gemini
            3.6

            Flash and newer models.
          type: number
          format: float
        seed:
          description: >-
            Optional. Seed used in decoding. If not set, the request uses a
            randomly generated

            seed.
          format: int32
          type: integer
        presencePenalty:
          description: >-
            Optional. Presence penalty applied to the next token's logprobs if
            the token has

            already been seen in the response.


            This penalty is binary on/off and not dependant on the number of
            times the

            token is used (after the first). Use

            frequency_penalty

            for a penalty that increases with each use.


            A positive penalty will discourage the use of tokens that have
            already

            been used in the response, increasing the vocabulary.


            A negative penalty will encourage the use of tokens that have
            already been

            used in the response, decreasing the vocabulary.
          format: float
          type: number
        responseLogprobs:
          description: Optional. If true, export the logprobs results in response.
          type: boolean
        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.


            This field is no longer supported and is silently ignored on Gemini
            3.6

            Flash and newer models.
          format: float
          type: number
        logprobs:
          description: >-
            Optional. Only valid if response_logprobs=True.

            This sets the number of top logprobs, including the chosen
            candidate, to

            return at each decoding step in the Candidate.logprobs_result. The

            number must be in the range of [0, 20].
          type: integer
          format: int32
        topK:
          format: int32
          description: >-
            Optional. The maximum number of tokens to consider when sampling.


            Gemini models use Top-p (nucleus) sampling or a combination of Top-k
            and

            nucleus sampling. Top-k sampling considers the set of `top_k` most
            probable

            tokens. Models running with nucleus sampling don't allow top_k
            setting.


            Note: The default value varies by `Model` and is specified by

            the`Model.top_p` attribute returned from the `getModel` function. An
            empty

            `top_k` attribute indicates that the model doesn't apply top-k
            sampling

            and doesn't allow setting `top_k` on requests.


            This field is no longer supported and is silently ignored on Gemini
            3.6

            Flash and newer models.
          type: integer
        responseFormat:
          description: >-
            Optional. Configuration for the response output format. Allows
            specifying output

            configuration per modality (text, audio, image) in a flat structure.
          allOf:
            - $ref: '#/components/schemas/ResponseFormatConfig'
        responseMimeType:
          type: string
          description: >-
            Optional. MIME type of the generated candidate text.

            Supported MIME types are:

            `text/plain`: (default) Text output.

            `application/json`: JSON response in the response candidates.

            `text/x.enum`: ENUM as a string response in the response candidates.

            Refer to the

            [docs](https://aistudio.google.com/docs/file-input-methods#text-file-types)

            for a list of all supported text MIME types.
        enableAffectiveDialog:
          description: >-
            Optional. If enabled, the model will detect emotions and adapt its
            responses

            accordingly.
          type: boolean
        responseJsonSchema:
          description: >-
            Optional. An internal detail. Use `responseJsonSchema` rather than
            this field.
        stopSequences:
          items:
            type: string
          type: array
          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.
        responseModalities:
          description: >-
            Optional. The requested modalities of the response. Represents the
            set of modalities

            that the model can return, and should be expected in the response.
            This is

            an exact match to the modalities of the response.


            A model may have multiple combinations of supported modalities. If
            the

            requested modalities do not match any of the supported combinations,
            an

            error will be returned.


            An empty list is equivalent to requesting only text.


            **Allowed values:**

            - `MODALITY_UNSPECIFIED`: Default value.

            - `TEXT`: Indicates the model should return text.

            - `IMAGE`: Indicates the model should return images.

            - `AUDIO`: Indicates the model should return audio.
          items:
            type: string
            enum:
              - MODALITY_UNSPECIFIED
              - TEXT
              - IMAGE
              - AUDIO
          type: array
        frequencyPenalty:
          type: number
          description: >-
            Optional. Frequency penalty applied to the next token's logprobs,
            multiplied by the

            number of times each token has been seen in the respponse so far.


            A positive penalty will discourage the use of tokens that have
            already

            been used, proportional to the number of times the token has been
            used:

            The more a token is used, the more difficult it is for the model to
            use

            that token again increasing the vocabulary of responses.


            Caution: A _negative_ penalty will encourage the model to reuse
            tokens

            proportional to the number of times the token has been used. Small

            negative values will reduce the vocabulary of a response. Larger
            negative

            values will cause the model to start repeating a common token  until
            it

            hits the max_output_tokens

            limit.
          format: float
        mediaResolution:
          type: string
          description: >-
            Optional. If specified, the media resolution specified will be used.


            **Allowed values:**

            - `MEDIA_RESOLUTION_UNSPECIFIED`: Media resolution has not been set.

            - `MEDIA_RESOLUTION_LOW`: Media resolution set to low (64 tokens).

            - `MEDIA_RESOLUTION_MEDIUM`: Media resolution set to medium (256
            tokens).

            - `MEDIA_RESOLUTION_HIGH`: Media resolution set to high (zoomed
            reframing with 256 tokens).
          enum:
            - MEDIA_RESOLUTION_UNSPECIFIED
            - MEDIA_RESOLUTION_LOW
            - MEDIA_RESOLUTION_MEDIUM
            - MEDIA_RESOLUTION_HIGH
        audioTranscriptionConfig:
          allOf:
            - $ref: '#/components/schemas/AudioTranscriptionConfig'
          description: Optional. Config for audio transcription (speech recognition).
    Content:
      properties:
        parts:
          items:
            $ref: '#/components/schemas/Part'
          description: >-
            Ordered `Parts` that constitute a single message. Parts may have
            different

            MIME types.
          type: array
        role:
          description: >-
            Optional. The producer of the content. Must be either 'user' or
            'model'.


            Useful to set for multi-turn conversations, otherwise can be left
            blank

            or unset.
          type: string
      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.
      type: object
    Candidate:
      type: object
      description: A response candidate generated from the model.
      properties:
        safetyRatings:
          items:
            $ref: '#/components/schemas/SafetyRating'
          type: array
          description: |-
            List of ratings for the safety of a response candidate.

            There is at most one rating per category.
        content:
          description: Output only. Generated content returned from the model.
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/Content'
        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.
        avgLogprobs:
          type: number
          description: Output only. Average log probability score of the candidate.
          format: double
          readOnly: true
        groundingMetadata:
          readOnly: true
          description: |-
            Output only. Grounding metadata for the candidate.

            This field is populated for `GenerateContent` calls.
          allOf:
            - $ref: '#/components/schemas/GroundingMetadata'
        logprobsResult:
          readOnly: true
          description: >-
            Output only. Log-likelihood scores for the response tokens and top
            tokens
          allOf:
            - $ref: '#/components/schemas/LogprobsResult'
        finishReason:
          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.


            **Allowed values:**

            - `FINISH_REASON_UNSPECIFIED`: Default value. This value is unused.

            - `STOP`: Natural stop point of the model or provided stop sequence.

            - `MAX_TOKENS`: The maximum number of tokens as specified in the
            request was reached.

            - `SAFETY`: The response candidate content was flagged for safety
            reasons.

            - `RECITATION`: The response candidate content was flagged for
            recitation reasons.

            - `LANGUAGE`: The response candidate content was flagged for using
            an unsupported language.

            - `OTHER`: Unknown reason.

            - `BLOCKLIST`: Token generation stopped because the content contains
            forbidden terms.

            - `PROHIBITED_CONTENT`: Token generation stopped for potentially
            containing prohibited content.

            - `SPII`: Token generation stopped because the content potentially
            contains Sensitive Personally Identifiable Information (SPII).

            - `MALFORMED_FUNCTION_CALL`: The function call generated by the
            model is invalid.

            - `IMAGE_SAFETY`: Token generation stopped because generated images
            contain safety violations.

            - `IMAGE_PROHIBITED_CONTENT`: Image generation stopped because
            generated images has other prohibited content.

            - `IMAGE_OTHER`: Image generation stopped because of other
            miscellaneous issue.

            - `NO_IMAGE`: The model was expected to generate an image, but none
            was generated.

            - `IMAGE_RECITATION`: Image generation stopped due to recitation.

            - `UNEXPECTED_TOOL_CALL`: Model generated a tool call but no tools
            were enabled in the request.

            - `TOO_MANY_TOOL_CALLS`: Model called too many tools consecutively,
            thus the system exited execution.

            - `MISSING_THOUGHT_SIGNATURE`: Request has at least one thought
            signature missing.

            - `MALFORMED_RESPONSE`: Finished due to malformed response.

            - `ESCALATION`: Request was filtered by an escalation rule.

            - `PUP_LIMITED_DISABLED`: Indicates that token generation stopped
            because the user account is limited or disabled due to Prohibited
            Use Policy (PUP) violations.

            - `CONTINUATION`: Token generation was stopped because the response
            reached the per-request token limit, but generation is not yet
            complete. The model response can be continued via a subsequent
            request using the returned `continuation_token`. Note, the
            `max_output_tokens` is cumulative across continuation hops and must
            be monotonically increased or omitted.
          readOnly: true
          type: string
        tokenCount:
          format: int32
          readOnly: true
          description: Output only. Token count for this candidate.
          type: integer
        urlContextMetadata:
          description: Output only. Metadata related to url context retrieval tool.
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/UrlContextMetadata'
        groundingAttributions:
          description: >-
            Output only. Attribution information for sources that contributed to
            a grounded answer.


            This field is populated for `GenerateAnswer` calls.
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/GroundingAttribution'
        index:
          readOnly: true
          description: >-
            Output only. Index of the candidate in the list of response
            candidates.
          format: int32
          type: integer
        continuationToken:
          description: >-
            An optional opaque continuation token returned when `finish_reason`
            is

            `CONTINUATION`.

            Clients can pass this token in a subsequent `GenerateContentRequest`
            to

            continue generation.
          format: byte
          type: string
        citationMetadata:
          readOnly: true
          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.
          allOf:
            - $ref: '#/components/schemas/CitationMetadata'
    PromptFeedback:
      properties:
        safetyRatings:
          type: array
          description: |-
            Ratings for safety of the prompt.
            There is at most one rating per category.
          items:
            $ref: '#/components/schemas/SafetyRating'
        blockReason:
          enum:
            - BLOCK_REASON_UNSPECIFIED
            - SAFETY
            - OTHER
            - BLOCKLIST
            - PROHIBITED_CONTENT
            - IMAGE_SAFETY
          description: >-
            Optional. If set, the prompt was blocked and no candidates are
            returned.

            Rephrase the prompt.


            **Allowed values:**

            - `BLOCK_REASON_UNSPECIFIED`: Default value. This value is unused.

            - `SAFETY`: Prompt was blocked due to safety reasons. Inspect
            `safety_ratings` to understand which safety category blocked it.

            - `OTHER`: Prompt was blocked due to unknown reasons.

            - `BLOCKLIST`: Prompt was blocked due to the terms which are
            included from the terminology blocklist.

            - `PROHIBITED_CONTENT`: Prompt was blocked due to prohibited
            content.

            - `IMAGE_SAFETY`: Candidates blocked due to unsafe image generation
            content.
          type: string
      description: |-
        A set of the feedback metadata the prompt specified in
        `GenerateContentRequest.content`.
      type: object
    UsageMetadata:
      properties:
        toolUsePromptTokenCount:
          format: int32
          readOnly: true
          description: Output only. Number of tokens present in tool-use prompt(s).
          type: integer
        candidatesTokensDetails:
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
          type: array
          readOnly: true
          description: Output only. List of modalities that were returned in the response.
        serviceTier:
          readOnly: true
          description: Output only. Service tier of the request.
          allOf:
            - $ref: '#/components/schemas/ServiceTier'
        cachedContentTokenCount:
          type: integer
          description: >-
            Number of tokens in the cached part of the prompt (the cached
            content)
          format: int32
        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.
        promptTokensDetails:
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
          readOnly: true
          description: >-
            Output only. List of modalities that were processed in the request
            input.
          type: array
        thoughtsTokenCount:
          readOnly: true
          format: int32
          type: integer
          description: Output only. Number of tokens of thoughts for thinking models.
        totalTokenCount:
          type: integer
          description: >-
            Total token count for the generation request (prompt + tool-use
            prompt +

            thoughts + response candidates).
          format: int32
        toolUsePromptTokensDetails:
          type: array
          readOnly: true
          description: >-
            Output only. List of modalities that were processed for tool-use
            request inputs.
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
        candidatesTokenCount:
          format: int32
          description: Total number of tokens across all the generated response candidates.
          type: integer
        cacheTokensDetails:
          type: array
          description: >-
            Output only. List of modalities of the cached content in the request
            input.
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
          readOnly: true
      type: object
      description: Metadata on the generation request's token usage.
    ModelStatus:
      description: >-
        The status of the underlying model. This is used to indicate the stage
        of the

        underlying model and the retirement time if applicable.
      properties:
        message:
          type: string
          description: A message explaining the model status.
        modelStage:
          allOf:
            - $ref: '#/components/schemas/ModelStage'
          description: The stage of the underlying model.
        retirementTime:
          description: The time at which the model will be retired.
          type: string
          format: date-time
      type: object
    FileSearch:
      description: >-
        The FileSearch tool that retrieves knowledge from Semantic Retrieval
        corpora.

        Files are imported to Semantic Retrieval corpora using the ImportFile
        API.
      type: object
      properties:
        metadataFilter:
          description: >-
            Optional. Metadata filter to apply to the semantic retrieval
            documents and chunks.
          type: string
        fileSearchStoreNames:
          type: array
          items:
            type: string
          description: |-
            Required. The names of the file_search_stores to retrieve from.
            Example: `fileSearchStores/my-file-search-store-123`
        topK:
          description: Optional. The number of semantic retrieval chunks to retrieve.
          type: integer
          format: int32
      required:
        - fileSearchStoreNames
    GoogleSearchRetrieval:
      properties:
        dynamicRetrievalConfig:
          allOf:
            - $ref: '#/components/schemas/DynamicRetrievalConfig'
          description: Specifies the dynamic retrieval configuration for the given source.
      type: object
      description: Tool to retrieve public web data for grounding, powered by Google.
    GoogleSearch:
      properties:
        searchTypes:
          description: >-
            Optional. The set of search types to enable. If not set, web search
            is

            enabled by default.
          allOf:
            - $ref: '#/components/schemas/SearchTypes'
        timeRangeFilter:
          allOf:
            - $ref: '#/components/schemas/Interval'
          description: |-
            Optional. Filter search results to a specific time range.
            If customers set a start time, they must set an end time (and vice
            versa).
      type: object
      description: |-
        GoogleSearch tool type.
        Tool to support Google Search in Model. Powered by Google.
    CodeExecution:
      description: >-
        Tool that executes code generated by the model, and automatically
        returns

        the result to the model.


        See also `ExecutableCode` and `CodeExecutionResult` which are only
        generated

        when using this tool.
      type: object
    ComputerUse:
      properties:
        enablePromptInjectionDetection:
          type: boolean
          description: >-
            Optional. Whether enable the prompt injection detection check on
            computer-use

            request.
        environment:
          type: string
          enum:
            - ENVIRONMENT_UNSPECIFIED
            - ENVIRONMENT_BROWSER
            - ENVIRONMENT_MOBILE
            - ENVIRONMENT_DESKTOP
          description: |-
            Required. The environment being operated.

            **Allowed values:**
            - `ENVIRONMENT_UNSPECIFIED`: Defaults to browser.
            - `ENVIRONMENT_BROWSER`: Operates in a web browser.
            - `ENVIRONMENT_MOBILE`: Operates in a mobile environment.
            - `ENVIRONMENT_DESKTOP`: Operates in a desktop environment.
        disabledSafetyPolicies:
          description: >-
            Optional. Disabled safety policies for computer use.


            **Allowed values:**

            - `SAFETY_POLICY_UNSPECIFIED`: Unspecified safety policy.

            - `FINANCIAL_TRANSACTIONS`: Safety policy for financial
            transactions.

            - `SENSITIVE_DATA_MODIFICATION`: Safety policy for sensitive data
            modification.

            - `COMMUNICATION_TOOL`: Safety policy for communication tools (e.g.
            Gmail, Chat, Meet).

            - `ACCOUNT_CREATION`: Safety policy for account creation.

            - `DATA_MODIFICATION`: Safety policy for data modification.

            - `USER_CONSENT_MANAGEMENT`: Safety policy for user consent
            management.

            - `LEGAL_TERMS_AND_AGREEMENTS`: Safety policy for legal terms and
            agreements.
          type: array
          items:
            enum:
              - SAFETY_POLICY_UNSPECIFIED
              - FINANCIAL_TRANSACTIONS
              - SENSITIVE_DATA_MODIFICATION
              - COMMUNICATION_TOOL
              - ACCOUNT_CREATION
              - DATA_MODIFICATION
              - USER_CONSENT_MANAGEMENT
              - LEGAL_TERMS_AND_AGREEMENTS
            type: string
        excludedPredefinedFunctions:
          type: array
          description: >-
            Optional. By default, predefined functions are included in the final
            model

            call.

            Some of them can be explicitly excluded from being automatically

            included. This can serve two purposes:

            1. Using a more restricted / different action space.

            2. Improving the definitions / instructions of predefined functions.
          items:
            type: string
      type: object
      required:
        - environment
      description: Computer Use tool type.
    GoogleMaps:
      properties:
        enableWidget:
          description: >-
            Optional. Whether to return a widget context token in the
            GroundingMetadata of the

            response. Developers can use the widget context token to render a
            Google

            Maps widget with geospatial context related to the places that the
            model

            references in the response.
          type: boolean
      type: object
      description: >-
        The GoogleMaps Tool that provides geospatial context for the user's
        query.
    FunctionDeclaration:
      required:
        - name
        - description
      description: >-
        Structured representation of a function declaration as defined by the

        [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3).
        Included

        in this declaration are the function name and parameters. This

        FunctionDeclaration is a representation of a block of code that can be
        used

        as a `Tool` by the model and executed by the client.
      properties:
        parametersJsonSchema:
          description: >-
            Optional. Describes the parameters to the function in JSON Schema
            format. The schema

            must describe an object where the properties are the parameters to
            the

            function. For example:


            ```

            {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "age": { "type": "integer" }
              },
              "additionalProperties": false,
              "required": ["name", "age"],
              "propertyOrdering": ["name", "age"]
            }

            ```


            This field is mutually exclusive with `parameters`.
        description:
          type: string
          description: Required. A brief description of the function.
        responseJsonSchema:
          description: >-
            Optional. Describes the output from this function in JSON Schema
            format. The value

            specified by the schema is the response value of the function.


            This field is mutually exclusive with `response`.
        behavior:
          description: >-
            Optional. Specifies the function Behavior.

            Currently only supported by the BidiGenerateContent method.


            **Allowed values:**

            - `UNSPECIFIED`: This value is unused.

            - `BLOCKING`: If set, the system will wait to receive the function
            response before continuing the conversation.

            - `NON_BLOCKING`: If set, the system will not wait to receive the
            function response. Instead, it will attempt to handle function
            responses as they become available while maintaining the
            conversation between the user and the model.
          enum:
            - UNSPECIFIED
            - BLOCKING
            - NON_BLOCKING
          type: string
        name:
          description: >-
            Required. The name of the function.

            Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and
            dashes,

            with a maximum length of 128.
          type: string
        response:
          description: >-
            Optional. Describes the output from this function in JSON Schema
            format. Reflects the

            Open API 3.03 Response Object. The Schema defines the type used for
            the

            response value of the function.
          allOf:
            - $ref: '#/components/schemas/Schema'
        parameters:
          allOf:
            - $ref: '#/components/schemas/Schema'
          description: >-
            Optional. Describes the parameters to this function. Reflects the
            Open API 3.03

            Parameter Object string Key: the name of the parameter. Parameter
            names are

            case sensitive. Schema Value: the Schema defining the type used for
            the

            parameter.
      type: object
    UrlContext:
      type: object
      description: Tool to support URL context retrieval.
    McpServer:
      properties:
        streamableHttpTransport:
          description: A transport that can stream HTTP requests and responses.
          allOf:
            - $ref: '#/components/schemas/StreamableHttpTransport'
        name:
          type: string
          description: The name of the MCPServer.
      description: >-
        A MCPServer is a server that can be called by the model to perform
        actions.

        It is a server that implements the MCP protocol.
      type: object
    FunctionCallingConfig:
      type: object
      properties:
        allowedFunctionNames:
          type: array
          items:
            type: string
          description: >-
            Optional. A set of function names that, when provided, limits the
            functions the model

            will call.


            This should only be set when the Mode is ANY or VALIDATED. Function
            names

            should match [FunctionDeclaration.name]. When set, model will

            predict a function call from only allowed function names.
        mode:
          description: >-
            Optional. Specifies the mode in which function calling should
            execute. If

            unspecified, the default value will be set to AUTO.


            **Allowed values:**

            - `MODE_UNSPECIFIED`: Unspecified function calling mode. This value
            should not be used.

            - `AUTO`: Default model behavior, model decides to predict either a
            function call or a natural language response.

            - `ANY`: Model is constrained to always predicting a function call
            only. If "allowed_function_names" are set, the predicted function
            call will be limited to any one of "allowed_function_names", else
            the predicted function call will be any one of the provided
            "function_declarations".

            - `NONE`: Model will not predict any function call. Model behavior
            is same as when not passing any function declarations.

            - `VALIDATED`: Model decides to predict either a function call or a
            natural language response, but will validate function calls with
            constrained decoding. If "allowed_function_names" are set, the
            predicted function call will be limited to any one of
            "allowed_function_names", else the predicted function call will be
            any one of the provided "function_declarations".
          enum:
            - MODE_UNSPECIFIED
            - AUTO
            - ANY
            - NONE
            - VALIDATED
          type: string
      description: Configuration for specifying function calling behavior.
    RetrievalConfig:
      type: object
      properties:
        latLng:
          allOf:
            - $ref: '#/components/schemas/LatLng'
          description: Optional. The location of the user.
        languageCode:
          description: |-
            Optional. The language code of the user.
            Language code for content. Use language tags defined by
            [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
          type: string
      description: Retrieval config.
    HarmCategory:
      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: >-
        **Allowed values:**

        - `HARM_CATEGORY_UNSPECIFIED`: Category is unspecified.

        - `HARM_CATEGORY_DEROGATORY`: **PaLM** - Negative or harmful comments
        targeting identity and/or protected attribute. DEPRECATED: PaLM-only
        category, not supported by Gemini models.

        - `HARM_CATEGORY_TOXICITY`: **PaLM** - Content that is rude,
        disrespectful, or profane. DEPRECATED: PaLM-only category, not supported
        by Gemini models.

        - `HARM_CATEGORY_VIOLENCE`: **PaLM** - Describes scenarios depicting
        violence against an individual or group, or general descriptions of
        gore. DEPRECATED: PaLM-only category, not supported by Gemini models.

        - `HARM_CATEGORY_SEXUAL`: **PaLM** - Contains references to sexual acts
        or other lewd content. DEPRECATED: PaLM-only category, not supported by
        Gemini models.

        - `HARM_CATEGORY_MEDICAL`: **PaLM** - Promotes unchecked medical advice.
        DEPRECATED: PaLM-only category, not supported by Gemini models.

        - `HARM_CATEGORY_DANGEROUS`: **PaLM** - Dangerous content that promotes,
        facilitates, or encourages harmful acts. DEPRECATED: PaLM-only category,
        not supported by Gemini models.

        - `HARM_CATEGORY_HARASSMENT`: **Gemini** - Harassment content.

        - `HARM_CATEGORY_HATE_SPEECH`: **Gemini** - Hate speech and content.

        - `HARM_CATEGORY_SEXUALLY_EXPLICIT`: **Gemini** - Sexually explicit
        content.

        - `HARM_CATEGORY_DANGEROUS_CONTENT`: **Gemini** - Dangerous content.

        - `HARM_CATEGORY_CIVIC_INTEGRITY`: **Gemini** - Content that may be used
        to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers
        instead.

        - `HARM_CATEGORY_JAILBREAK`: **Gemini** - Prompts attempting to bypass
        or subvert the model's safety guidelines (jailbreak attempts).
    TranslationConfig:
      type: object
      required:
        - targetLanguageCode
      description: Config for translation features.
      properties:
        echoTargetLanguage:
          description: >-
            Optional. If true, the model will generate audio when the target
            language is spoken,

            essentially it will parrot the input. If false, we will not produce
            audio

            for the target language.
          type: boolean
        targetLanguageCode:
          type: string
          description: >-
            Required. The target language for translation. Supported values are
            BCP-47 language

            codes (e.g. "en", "es", "fr").
    ThinkingConfig:
      properties:
        thinkingLevel:
          enum:
            - THINKING_LEVEL_UNSPECIFIED
            - MINIMAL
            - LOW
            - MEDIUM
            - HIGH
            - XHIGH
          type: string
          description: >-
            Optional. Controls the maximum depth of the model's internal
            reasoning process before

            it produces a response. The default value is model-dependent. Refer
            to the

            [Thinking levels

            guide](https://aistudio.google.com/docs/thinking#thinking-levels)
            for

            more details. Recommended for Gemini 3 or later models. Use with
            earlier

            models results in an error.


            **Allowed values:**

            - `THINKING_LEVEL_UNSPECIFIED`: Default value.

            - `MINIMAL`: Little to no thinking.

            - `LOW`: Low thinking level.

            - `MEDIUM`: Medium thinking level.

            - `HIGH`: High thinking level.

            - `XHIGH`: XHigh thinking level.
        includeThoughts:
          type: boolean
          description: |-
            Indicates whether to include thoughts in the response.
            If true, thoughts are returned only when available.
        thinkingBudget:
          type: integer
          description: The number of thoughts tokens that the model should generate.
          format: int32
      type: object
      description: Config for thinking features.
    ImageConfig:
      type: object
      description: Config for image generation features.
      properties:
        imageSize:
          type: string
          description: >-
            Optional. Specifies the size of generated images. Supported values
            are `512`, `1K`,

            `2K`, `4K`. If not specified, the model will use default value `1K`.
        aspectRatio:
          description: >-
            Optional. The aspect ratio of the image to generate. Supported
            aspect ratios: `1:1`,

            `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`,
            `5:4`,

            `9:16`, `16:9`, or `21:9`.


            If not specified, the model will choose a default aspect ratio based
            on any

            reference images provided.
          type: string
    Schema:
      description: >-
        The `Schema` object allows the definition of input and output data
        types.

        These types can be objects, but also primitives and arrays.

        Represents a select subset of an [OpenAPI 3.0 schema

        object](https://spec.openapis.org/oas/v3.0.3#schema).
      required:
        - type
      properties:
        maxProperties:
          format: int64
          type: string
          description: Optional. Maximum number of the properties for Type.OBJECT.
        description:
          description: >-
            Optional. A brief description of the parameter. This could contain
            examples of use.

            Parameter description may be formatted as Markdown.
          type: string
        propertyOrdering:
          items:
            type: string
          description: >-
            Optional. The order of the properties.

            Not a standard field in open api spec. Used to determine the order
            of the

            properties in the response.
          type: array
        default:
          description: >-
            Optional. Default value of the field. Per JSON Schema, this field is
            intended for

            documentation generators and doesn't affect validation. Thus it's
            included

            here and ignored so that developers who send schemas with a
            `default` field

            don't get unknown-field errors.
        maxLength:
          format: int64
          type: string
          description: Optional. Maximum length of the Type.STRING
        minProperties:
          type: string
          format: int64
          description: Optional. Minimum number of the properties for Type.OBJECT.
        type:
          allOf:
            - $ref: '#/components/schemas/Type'
          description: Required. Data type.
        minimum:
          format: double
          type: number
          description: |-
            Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER
            Minimum value of the Type.INTEGER and Type.NUMBER
        enum:
          items:
            type: string
          type: array
          description: >-
            Optional. Possible values of the element of Type.STRING with enum
            format.

            For example we can define an Enum Direction as :

            {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
        example:
          description: >-
            Optional. Example of the object. Will only populated when the object
            is the root.
        minItems:
          type: string
          description: Optional. Minimum number of the elements for Type.ARRAY.
          format: int64
        maxItems:
          type: string
          description: Optional. Maximum number of the elements for Type.ARRAY.
          format: int64
        anyOf:
          items:
            $ref: '#/components/schemas/Schema'
          description: >-
            Optional. The value should be validated against any (one or more) of
            the subschemas

            in the list.
          type: array
        format:
          description: >-
            Optional. The format of the data. Any value is allowed, but most do
            not trigger any

            special functionality.
          type: string
        maximum:
          description: Optional. Maximum value of the Type.INTEGER and Type.NUMBER
          format: double
          type: number
        properties:
          additionalProperties:
            $ref: '#/components/schemas/Schema'
          type: object
          description: Optional. Properties of Type.OBJECT.
        title:
          type: string
          description: Optional. The title of the schema.
        items:
          description: Optional. Schema of the elements of Type.ARRAY.
          allOf:
            - $ref: '#/components/schemas/Schema'
        required:
          items:
            type: string
          description: Optional. Required properties of Type.OBJECT.
          type: array
        minLength:
          type: string
          format: int64
          description: |-
            Optional. SCHEMA FIELDS FOR TYPE STRING
            Minimum length of the Type.STRING
        nullable:
          description: Optional. Indicates if the value may be null.
          type: boolean
        pattern:
          description: >-
            Optional. Pattern of the Type.STRING to restrict a string to a
            regular expression.
          type: string
      type: object
    SpeechConfig:
      type: object
      properties:
        languageCode:
          description: >-
            Optional. The IETF
            [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language

            code that the user configured the app to use. Used for speech
            recognition

            and synthesis.


            Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`,
            `es-US`,

            `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`,
            `it-IT`,

            `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`,
            `mr-IN`,

            `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and

            `th-TH`.
          type: string
        voiceConfig:
          allOf:
            - $ref: '#/components/schemas/VoiceConfig'
          description: The configuration in case of single-voice output.
        multiSpeakerVoiceConfig:
          description: |-
            Optional. The configuration for the multi-speaker setup.
            It is mutually exclusive with the voice_config field.
          allOf:
            - $ref: '#/components/schemas/MultiSpeakerVoiceConfig'
      description: Config for speech generation and transcription.
    ResponseFormatConfig:
      description: |-
        Configuration for the response output format. This is a flat object
        where each optional sub-field configures a specific output modality.
      type: object
      properties:
        image:
          description: Optional. Image output format configuration.
          allOf:
            - $ref: '#/components/schemas/ImageResponseFormat'
        audio:
          allOf:
            - $ref: '#/components/schemas/AudioResponseFormat'
          description: Optional. Audio output format configuration.
        text:
          description: Optional. Text output format configuration.
          allOf:
            - $ref: '#/components/schemas/TextResponseFormat'
    AudioTranscriptionConfig:
      description: The audio transcription configuration.
      type: object
      properties:
        customVocabulary:
          type: array
          description: >-
            Optional. A list of custom vocabulary phrases to bias the speech
            recognition model

            toward recognizing specific terms (product names, proper nouns,
            jargon).
          items:
            type: string
        diarization:
          description: Optional. Configures speaker diarization.
          type: boolean
        languageHints:
          description: Optional. Specifies one or more languages in the audio.
          deprecated: true
          allOf:
            - $ref: '#/components/schemas/LanguageHints'
        languageAuto:
          allOf:
            - $ref: '#/components/schemas/LanguageAuto'
          deprecated: true
          description: Optional. The model will detect the language automatically.
        sourceText:
          type: string
          description: >-
            Optional. The source text to be edited or rewritten via voice
            instructions.

            When provided in `SMART` mode, the model evaluates the audio input
            against

            this text and emits the complete replacement text in the candidate
            response

            rather than appending to it.
        wordTimestamp:
          description: Optional. Configures word-level timestamp generation.
          type: boolean
        languageCodes:
          items:
            type: string
          description: >-
            Optional. BCP-47 language codes providing hints about the languages
            present in the

            audio. If omitted or empty, defaults to automatic language
            detection.
          type: array
        adaptationPhrases:
          items:
            type: string
          type: array
          description: >-
            Optional. A list of phrases used for speech adaptation, which biases
            the ASR model to

            improve recognition of these specific terms.
          deprecated: true
        mode:
          type: string
          description: >-
            Optional. Configures transcription mode. Supported values:
            `VERBATIM`,

            `SMART`. If unspecified, defaults to `VERBATIM` transcription.

            In `SMART` mode, the model performs disfluency removal (eliminating

            filler words, repetitions, and false starts), light grammatical
            cleanup,

            automatic formatting (paragraphs, bullet points, numbered lists),
            and

            minor user edits (inline self-corrections).

            Timestamps and diarization are incompatible with mode `SMART`.


            **Allowed values:**

            - `MODE_UNSPECIFIED`: Unspecified transcription mode.

            - `VERBATIM`: Verbatim transcription mode.

            - `SMART`: Smart transcription mode.
          enum:
            - MODE_UNSPECIFIED
            - VERBATIM
            - SMART
    Part:
      type: object
      properties:
        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`.
          allOf:
            - $ref: '#/components/schemas/ToolResponse'
        executableCode:
          description: Code generated by the model that is meant to be executed.
          allOf:
            - $ref: '#/components/schemas/ExecutableCode'
        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.
          allOf:
            - $ref: '#/components/schemas/SpeechMetadata'
        audioMetadata:
          description: >-
            Optional. Audio metadata. The metadata should only be specified
            while the audio

            data is presented in inline_data or file_data.
          allOf:
            - $ref: '#/components/schemas/AudioMetadata'
        audioTranscription:
          description: |-
            Optional. Audio (input or output) transcription.
            This is only set when this Part contains audio data.
          allOf:
            - $ref: '#/components/schemas/AudioTranscription'
        inlineData:
          description: Inline media bytes.
          allOf:
            - $ref: '#/components/schemas/Blob'
        spreadsheetMetadata:
          allOf:
            - $ref: '#/components/schemas/SpreadsheetMetadata'
          description: >-
            Optional. Spreadsheet metadata. The metadata should only be
            specified while the

            spreadsheet data is presented in inline_data or file_data.
        partMetadata:
          type: object
          additionalProperties:
            description: Properties of the object.
          description: >-
            Custom metadata associated with the Part.

            Agents using genai.Part as content representation may need to keep
            track

            of the additional information. For example it can be name of a
            file/source

            from which the Part originates or a way to multiplex multiple Part
            streams.
        text:
          type: string
          description: Inline text.
        thoughtSignature:
          format: byte
          description: >-
            Optional. An opaque signature for the thought so it can be reused in
            subsequent

            requests.
          type: string
        codeExecutionResult:
          description: Result of executing the `ExecutableCode`.
          allOf:
            - $ref: '#/components/schemas/CodeExecutionResult'
        thought:
          description: Optional. Indicates if the part is thought from the model.
          type: boolean
        functionCall:
          allOf:
            - $ref: '#/components/schemas/FunctionCall'
          description: |-
            A predicted `FunctionCall` returned from the model that contains
            a string representing the `FunctionDeclaration.name` with the
            arguments and their values.
        mediaProcessing:
          type: string
          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.


            **Allowed values:**

            - `MEDIA_PROCESSING_UNSPECIFIED`: Defaults to model-specific
            processing.

            - `STATIC`: Fixed-rate frame extraction. All frames placed in
            context.

            - `AGENTIC`: Model-driven dynamic navigation. Recommended for most
            use cases.
          enum:
            - MEDIA_PROCESSING_UNSPECIFIED
            - STATIC
            - AGENTIC
        videoMetadata:
          allOf:
            - $ref: '#/components/schemas/VideoMetadata'
          description: >-
            Optional. Video metadata. The metadata should only be specified
            while the video

            data is presented in inline_data or file_data.
        fileData:
          allOf:
            - $ref: '#/components/schemas/FileData'
          description: URI based data.
        mediaResolution:
          allOf:
            - $ref: '#/components/schemas/V1mainMediaResolution'
          description: Optional. Media resolution for the input media.
        documentMetadata:
          description: >-
            Optional. Document metadata. The metadata should only be specified
            while the

            document data is presented in inline_data or file_data.
          allOf:
            - $ref: '#/components/schemas/DocumentMetadata'
        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.
          allOf:
            - $ref: '#/components/schemas/FunctionResponse'
        toolCall:
          allOf:
            - $ref: '#/components/schemas/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.
      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.
    SafetyRating:
      required:
        - category
        - probability
      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:
        category:
          allOf:
            - $ref: '#/components/schemas/HarmCategory'
          description: Required. The category for this rating.
        probability:
          type: string
          description: |-
            Required. The probability of harm for this content.

            **Allowed values:**
            - `HARM_PROBABILITY_UNSPECIFIED`: Probability is unspecified.
            - `NEGLIGIBLE`: Content has a negligible chance of being unsafe.
            - `LOW`: Content has a low chance of being unsafe.
            - `MEDIUM`: Content has a medium chance of being unsafe.
            - `HIGH`: Content has a high chance of being unsafe.
          enum:
            - HARM_PROBABILITY_UNSPECIFIED
            - NEGLIGIBLE
            - LOW
            - MEDIUM
            - HIGH
        blocked:
          type: boolean
          description: Was this content blocked because of this rating?
    GroundingMetadata:
      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
        searchEntryPoint:
          description: Optional. Google search entry for the following-up web searches.
          allOf:
            - $ref: '#/components/schemas/SearchEntryPoint'
        groundingChunks:
          items:
            $ref: '#/components/schemas/GroundingChunk'
          description: >-
            List of supporting references retrieved from specified grounding
            source.

            When streaming, this only contains the grounding chunks that have
            not been

            included in the grounding metadata of previous responses.
          type: array
        webSearchQueries:
          description: Web search queries for the following-up web search.
          items:
            type: string
          type: array
        imageSearchQueries:
          type: array
          description: Image search queries used for grounding.
          items:
            type: string
        groundingSupports:
          description: List of grounding support.
          items:
            $ref: >-
              #/components/schemas/GoogleAiGenerativelanguageV1betaGroundingSupport
          type: array
        retrievalMetadata:
          allOf:
            - $ref: '#/components/schemas/RetrievalMetadata'
          description: Metadata related to retrieval in the grounding flow.
      type: object
    LogprobsResult:
      type: object
      description: Logprobs Result
      properties:
        topCandidates:
          type: array
          description: Length = total number of decoding steps.
          items:
            $ref: '#/components/schemas/TopCandidates'
        chosenCandidates:
          type: array
          items:
            $ref: '#/components/schemas/LogprobsResultCandidate'
          description: |-
            Length = total number of decoding steps.
            The chosen candidates may or may not be in top_candidates.
        logProbabilitySum:
          description: Sum of log probabilities for all tokens.
          format: float
          type: number
    UrlContextMetadata:
      type: object
      properties:
        urlMetadata:
          type: array
          items:
            $ref: '#/components/schemas/UrlMetadata'
          description: List of url context.
      description: Metadata related to url context retrieval tool.
    GroundingAttribution:
      description: Attribution for a source that contributed to an answer.
      type: object
      properties:
        sourceId:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/AttributionSourceId'
          description: >-
            Output only. Identifier for the source contributing to this
            attribution.
        content:
          description: Grounding source content that makes up this attribution.
          allOf:
            - $ref: '#/components/schemas/Content'
    CitationMetadata:
      type: object
      properties:
        citationSources:
          items:
            $ref: '#/components/schemas/CitationSource'
          type: array
          description: Citations to sources for a specific response.
      description: A collection of source attributions for a piece of content.
    ModalityTokenCount:
      type: object
      properties:
        modality:
          allOf:
            - $ref: '#/components/schemas/GenerativeLanguageModality'
          description: The modality associated with this token count.
        tokenCount:
          description: Number of tokens.
          format: int32
          type: integer
      description: Represents token counting info for a single modality.
    ModelStage:
      enum:
        - MODEL_STAGE_UNSPECIFIED
        - UNSTABLE_EXPERIMENTAL
        - EXPERIMENTAL
        - PREVIEW
        - STABLE
        - LEGACY
        - DEPRECATED
        - RETIRED
      type: string
      description: >-
        **Allowed values:**

        - `MODEL_STAGE_UNSPECIFIED`: Unspecified model stage.

        - `UNSTABLE_EXPERIMENTAL`: The underlying model is subject to lots of
        tunings.

        - `EXPERIMENTAL`: Models in this stage are for experimental purposes
        only.

        - `PREVIEW`: Models in this stage are more mature than experimental
        models.

        - `STABLE`: Models in this stage are considered stable and ready for
        production use.

        - `LEGACY`: If the model is on this stage, it means that this model is
        on the path to deprecation in near future. Only existing customers can
        use this model.

        - `DEPRECATED`: Models in this stage are deprecated. These models cannot
        be used.

        - `RETIRED`: Models in this stage are retired. These models cannot be
        used.
    DynamicRetrievalConfig:
      description: Describes the options to customize dynamic retrieval.
      properties:
        dynamicThreshold:
          description: |-
            The threshold to be used in dynamic retrieval.
            If not set, a system default value is used.
          type: number
          format: float
        mode:
          description: >-
            The mode of the predictor to be used in dynamic retrieval.


            **Allowed values:**

            - `MODE_UNSPECIFIED`: Always trigger retrieval.

            - `MODE_DYNAMIC`: Run retrieval only when system decides it is
            necessary.
          type: string
          enum:
            - MODE_UNSPECIFIED
            - MODE_DYNAMIC
      type: object
    SearchTypes:
      type: object
      description: Different types of search that can be enabled on the GoogleSearch tool.
      properties:
        imageSearch:
          allOf:
            - $ref: '#/components/schemas/ImageSearch'
          description: Optional. Enables image search. Image bytes are returned.
        webSearch:
          description: Optional. Enables web search. Only text results are returned.
          allOf:
            - $ref: '#/components/schemas/WebSearch'
    Interval:
      description: >-
        Represents a time interval, encoded as a Timestamp start (inclusive) and
        a

        Timestamp end (exclusive).


        The start must be less than or equal to the end.

        When the start equals the end, the interval is empty (matches no time).

        When both start and end are unspecified, the interval matches any time.
      type: object
      properties:
        startTime:
          description: >-
            Optional. Inclusive start of the interval.


            If specified, a Timestamp matching this interval will have to be the
            same

            or after the start.
          type: string
          format: date-time
        endTime:
          description: >-
            Optional. Exclusive end of the interval.


            If specified, a Timestamp matching this interval will have to be
            before the

            end.
          format: date-time
          type: string
    StreamableHttpTransport:
      description: A transport that can stream HTTP requests and responses.
      type: object
      properties:
        terminateOnClose:
          description: Whether to close the client session when the transport closes.
          type: boolean
        headers:
          additionalProperties:
            type: string
          type: object
          description: >-
            Optional: Fields for authentication headers, timeouts, etc., if
            needed.
        timeout:
          type: string
          format: google-duration
          description: HTTP timeout for regular operations.
        url:
          description: |-
            The full URL for the MCPServer endpoint.
            Example: "https://api.example.com/mcp"
          type: string
        sseReadTimeout:
          type: string
          description: Timeout for SSE read operations.
          format: google-duration
    LatLng:
      properties:
        latitude:
          description: The latitude in degrees. It must be in the range [-90.0, +90.0].
          type: number
          format: double
        longitude:
          format: double
          type: number
          description: The longitude in degrees. It must be in the range [-180.0, +180.0].
      type: object
      description: >-
        An object that represents a latitude/longitude pair. This is expressed
        as a

        pair of doubles to represent degrees latitude and degrees longitude.
        Unless

        specified otherwise, this object must conform to the

        WGS84 standard. Values must be within normalized ranges.
    Type:
      enum:
        - TYPE_UNSPECIFIED
        - STRING
        - NUMBER
        - INTEGER
        - BOOLEAN
        - ARRAY
        - OBJECT
        - 'NULL'
      type: string
      description: |-
        **Allowed values:**
        - `TYPE_UNSPECIFIED`: Not specified, should not be used.
        - `STRING`: String type.
        - `NUMBER`: Number type.
        - `INTEGER`: Integer type.
        - `BOOLEAN`: Boolean type.
        - `ARRAY`: Array type.
        - `OBJECT`: Object type.
        - `NULL`: Null type.
    VoiceConfig:
      properties:
        prebuiltVoiceConfig:
          description: The configuration for the prebuilt voice to use.
          allOf:
            - $ref: '#/components/schemas/PrebuiltVoiceConfig'
        voice:
          type: string
          description: >-
            Optional. The speaker identifier for synthesis.

            Supported formats:


            *   Speaker name for prebuilt voices (for example, `Orus` or
            `Kore`).

            *   Voice ID for stored voices (for example, `voice_xxx`).

            *   Voice replication key (for example, `voicekey_xxx`).
      description: The configuration for the voice to use.
      type: object
    MultiSpeakerVoiceConfig:
      properties:
        speakerVoiceConfigs:
          items:
            $ref: '#/components/schemas/SpeakerVoiceConfig'
          description: Required. All the enabled speaker voices.
          type: array
      type: object
      description: The configuration for the multi-speaker setup.
      required:
        - speakerVoiceConfigs
    ImageResponseFormat:
      description: Configuration for image output format.
      type: object
      properties:
        imageSize:
          enum:
            - IMAGE_SIZE_UNSPECIFIED
            - IMAGE_SIZE_FIVE_TWELVE
            - IMAGE_SIZE_ONE_K
            - IMAGE_SIZE_TWO_K
            - IMAGE_SIZE_FOUR_K
          description: |-
            Optional. The size of the image output.

            **Allowed values:**
            - `IMAGE_SIZE_UNSPECIFIED`: Default value. This value is unused.
            - `IMAGE_SIZE_FIVE_TWELVE`: 512px image size.
            - `IMAGE_SIZE_ONE_K`: 1K image size.
            - `IMAGE_SIZE_TWO_K`: 2K image size.
            - `IMAGE_SIZE_FOUR_K`: 4K image size.
          type: string
        mimeType:
          enum:
            - MIME_TYPE_UNSPECIFIED
            - IMAGE_JPEG
          type: string
          description: |-
            Optional. The MIME type of the image output.

            **Allowed values:**
            - `MIME_TYPE_UNSPECIFIED`: Default value. This value is unused.
            - `IMAGE_JPEG`: JPEG image format.
        aspectRatio:
          type: string
          description: |-
            Optional. The aspect ratio for the image output.

            **Allowed values:**
            - `ASPECT_RATIO_UNSPECIFIED`: Default value. This value is unused.
            - `ASPECT_RATIO_ONE_BY_ONE`: 1:1 aspect ratio.
            - `ASPECT_RATIO_TWO_BY_THREE`: 2:3 aspect ratio.
            - `ASPECT_RATIO_THREE_BY_TWO`: 3:2 aspect ratio.
            - `ASPECT_RATIO_THREE_BY_FOUR`: 3:4 aspect ratio.
            - `ASPECT_RATIO_FOUR_BY_THREE`: 4:3 aspect ratio.
            - `ASPECT_RATIO_FOUR_BY_FIVE`: 4:5 aspect ratio.
            - `ASPECT_RATIO_FIVE_BY_FOUR`: 5:4 aspect ratio.
            - `ASPECT_RATIO_NINE_BY_SIXTEEN`: 9:16 aspect ratio.
            - `ASPECT_RATIO_SIXTEEN_BY_NINE`: 16:9 aspect ratio.
            - `ASPECT_RATIO_TWENTY_ONE_BY_NINE`: 21:9 aspect ratio.
            - `ASPECT_RATIO_ONE_BY_EIGHT`: 1:8 aspect ratio.
            - `ASPECT_RATIO_EIGHT_BY_ONE`: 8:1 aspect ratio.
            - `ASPECT_RATIO_ONE_BY_FOUR`: 1:4 aspect ratio.
            - `ASPECT_RATIO_FOUR_BY_ONE`: 4:1 aspect ratio.
          enum:
            - ASPECT_RATIO_UNSPECIFIED
            - ASPECT_RATIO_ONE_BY_ONE
            - ASPECT_RATIO_TWO_BY_THREE
            - ASPECT_RATIO_THREE_BY_TWO
            - ASPECT_RATIO_THREE_BY_FOUR
            - ASPECT_RATIO_FOUR_BY_THREE
            - ASPECT_RATIO_FOUR_BY_FIVE
            - ASPECT_RATIO_FIVE_BY_FOUR
            - ASPECT_RATIO_NINE_BY_SIXTEEN
            - ASPECT_RATIO_SIXTEEN_BY_NINE
            - ASPECT_RATIO_TWENTY_ONE_BY_NINE
            - ASPECT_RATIO_ONE_BY_EIGHT
            - ASPECT_RATIO_EIGHT_BY_ONE
            - ASPECT_RATIO_ONE_BY_FOUR
            - ASPECT_RATIO_FOUR_BY_ONE
        delivery:
          type: string
          description: |-
            Optional. The delivery mode for the image output.

            **Allowed values:**
            - `DELIVERY_UNSPECIFIED`: Default value. This value is unused.
            - `INLINE`: Image data is returned inline in the response.
            - `URI`: Image data is returned as a URI.
          enum:
            - DELIVERY_UNSPECIFIED
            - INLINE
            - URI
    AudioResponseFormat:
      properties:
        delivery:
          type: string
          description: |-
            Optional. The delivery mode for the audio output.

            **Allowed values:**
            - `DELIVERY_UNSPECIFIED`: Default value. This value is unused.
            - `INLINE`: Audio data is returned inline in the response.
            - `URI`: Audio data is returned as a URI.
          enum:
            - DELIVERY_UNSPECIFIED
            - INLINE
            - URI
        bitRate:
          type: integer
          description: >-
            Optional. Bit rate in bits per second (bps). Only applicable for
            compressed formats

            (MP3, Opus).
          format: int32
        sampleRate:
          format: int32
          description: Optional. Sample rate in Hz.
          type: integer
        mimeType:
          description: |-
            Optional. The MIME type of the audio output.

            **Allowed values:**
            - `MIME_TYPE_UNSPECIFIED`: Default value. This value is unused.
            - `AUDIO_MP3`: MP3 audio format.
            - `AUDIO_OGG_OPUS`: OGG Opus audio format.
            - `AUDIO_L16`: Raw PCM (L16) audio format.
            - `AUDIO_WAV`: WAV audio format.
            - `AUDIO_ALAW`: A-law audio format.
            - `AUDIO_MULAW`: Mu-law audio format.
          type: string
          enum:
            - MIME_TYPE_UNSPECIFIED
            - AUDIO_MP3
            - AUDIO_OGG_OPUS
            - AUDIO_L16
            - AUDIO_WAV
            - AUDIO_ALAW
            - AUDIO_MULAW
      description: Configuration for audio output format.
      type: object
    TextResponseFormat:
      properties:
        schema:
          description: >-
            Optional. The JSON schema that the output should conform to. Only
            applicable when

            mime_type is APPLICATION_JSON.
        mimeType:
          type: string
          description: |-
            Optional. The MIME type of the text output.

            **Allowed values:**
            - `MIME_TYPE_UNSPECIFIED`: Default value. This value is unused.
            - `APPLICATION_JSON`: JSON output format.
            - `TEXT_PLAIN`: Plain text output format.
          enum:
            - MIME_TYPE_UNSPECIFIED
            - APPLICATION_JSON
            - TEXT_PLAIN
      description: Configuration for text output format.
      type: object
    LanguageHints:
      description: >-
        Provides hints to the model about possible languages present in the
        audio.
      type: object
      deprecated: true
      required:
        - languageCodes
      properties:
        languageCodes:
          items:
            type: string
          type: array
          description: Required. BCP-47 language codes.
          deprecated: true
    LanguageAuto:
      description: Indicates the language of the audio should be automatically detected.
      deprecated: true
      type: object
    ToolResponse:
      required:
        - toolType
      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`.
      properties:
        toolType:
          description: >-
            Required. The type of tool that was called, matching the `tool_type`
            in the

            corresponding `ToolCall`.
          allOf:
            - $ref: '#/components/schemas/V1mainToolType'
        response:
          type: object
          description: Optional. The tool response.
          additionalProperties:
            description: Properties of the object.
        id:
          type: string
          description: Optional. The identifier of the tool call this response is for.
      type: object
    ExecutableCode:
      description: >-
        Code generated by the model that is meant to be executed, and the result

        returned to the model.


        Only generated when using the `CodeExecution` tool, in which the code
        will

        be automatically executed, and a corresponding `CodeExecutionResult`
        will

        also be generated.
      type: object
      properties:
        language:
          type: string
          description: >-
            Required. Programming language of the `code`.


            **Allowed values:**

            - `LANGUAGE_UNSPECIFIED`: Unspecified language. This value should
            not be used.

            - `PYTHON`: Python >= 3.10, with numpy and simpy available. Python
            is the default language.
          enum:
            - LANGUAGE_UNSPECIFIED
            - PYTHON
        id:
          type: string
          description: |-
            Optional. Unique identifier of the `ExecutableCode` part.
            The server returns the `CodeExecutionResult` with the matching `id`.
        code:
          description: Required. The code to be executed.
          type: string
      required:
        - language
        - code
    SpeechMetadata:
      properties:
        style:
          type: string
          description: Optional. Optional style instruction for the speech synthesis.
        speaker:
          type: string
          description: Optional. Optional speaker name for multi-speaker synthesis.
      type: object
      description: Speech metadata for `text` parts.
    AudioMetadata:
      properties:
        endOffset:
          description: |-
            Optional. The end offset of the audio, relative to the start of the
            audio stream.
          format: google-duration
          type: string
        startOffset:
          type: string
          description: >-
            Optional. The start offset of the audio, relative to the start of
            the

            audio stream.
          format: google-duration
      type: object
      description: >-
        Metadata describes the input audio content.

        Set this in `Part.audio_metadata` or
        `FunctionResponsePart.audio_metadata`

        when `inline_data` or `file_data` contains audio to configure static
        audio

        preprocessing.
    AudioTranscription:
      type: object
      required:
        - text
      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:
          type: array
          items:
            $ref: '#/components/schemas/WordInfo'
          description: |-
            Optional. Detailed word-level transcriptions and timing details.
            Present when word_timestamp is set.
        speakerLabel:
          type: string
          description: >-
            Optional. A label identifying the speaker of this audio segment
            (e.g. "spk_1",

            "spk_2"). Present when diarization is set.
        text:
          type: string
          description: Required. The transcription text of this audio segment.
    Blob:
      description: |-
        Raw media bytes.

        Text should not be sent as raw bytes, use the 'text' field.
      properties:
        data:
          description: Raw bytes for media formats.
          type: string
          format: byte
        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).
        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
    SpreadsheetMetadata:
      properties:
        contentLayers:
          type: array
          items:
            type: string
            enum:
              - CONTENT_LAYER_UNSPECIFIED
              - DATA
              - FORMULAS
              - VISUAL
          description: >-
            Optional. Content layers to return.

            If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is
            set.


            **Allowed values:**

            - `CONTENT_LAYER_UNSPECIFIED`: Default value.

            - `DATA`: Cell values, merges, and formats.

            - `FORMULAS`: Formula expressions and their computed results.

            - `VISUAL`: A rendered image of the sheet.
        visibleCells:
          description: >-
            Optional. The range of cells to extract, in A1 notation (e.g.
            "A1:D10").

            If not set, the full occupied area of the sheet is used.
          type: string
        sheetIndex:
          description: >-
            Optional. The 1-indexed index of the sheet to extract, in workbook
            order.

            If not set, all sheets are extracted.
          format: int32
          type: integer
      type: object
      description: |-
        Metadata describes the input spreadsheet content.
        Set this in `Part.spreadsheet_metadata` or
        `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or
        `file_data` contains a spreadsheet to configure static spreadsheet
        preprocessing.
    CodeExecutionResult:
      properties:
        outcome:
          description: >-
            Required. Outcome of the code execution.


            **Allowed values:**

            - `OUTCOME_UNSPECIFIED`: Unspecified status. This value should not
            be used.

            - `OUTCOME_OK`: Code execution completed successfully. `output`
            contains the stdout, if any.

            - `OUTCOME_FAILED`: Code execution failed. `output` contains the
            stderr and stdout, if any.

            - `OUTCOME_DEADLINE_EXCEEDED`: Code execution ran for too long, and
            was cancelled. There may or may not be a partial `output` present.
          enum:
            - OUTCOME_UNSPECIFIED
            - OUTCOME_OK
            - OUTCOME_FAILED
            - OUTCOME_DEADLINE_EXCEEDED
          type: string
        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.
      type: object
      description: |-
        Result of executing the `ExecutableCode`.

        Generated only when the `CodeExecution` tool is used.
      required:
        - outcome
    FunctionCall:
      required:
        - name
      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.
    VideoMetadata:
      type: object
      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).
      properties:
        fps:
          description: >-
            Optional. The frame rate of the video sent to the model. If not
            specified, the

            default value will be 1.0.

            The fps range is (0.0, 24.0].
          format: double
          type: number
        startOffset:
          description: Optional. The start offset of the video.
          format: google-duration
          type: string
        contentLayers:
          items:
            enum:
              - CONTENT_LAYER_UNSPECIFIED
              - FRAMES
              - AUDIO
              - TRANSCRIPT
            type: string
          description: |-
            Optional. Content layers to return.
            If empty, defaults to [FRAMES, AUDIO].

            **Allowed values:**
            - `CONTENT_LAYER_UNSPECIFIED`: Default value.
            - `FRAMES`: Extract video frames.
            - `AUDIO`: Extract audio track.
            - `TRANSCRIPT`: Extract audio transcript.
          type: array
        endOffset:
          type: string
          description: Optional. The end offset of the video.
          format: google-duration
    FileData:
      description: URI based data.
      required:
        - fileUri
      properties:
        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
        fileUri:
          description: Required. URI.
          type: string
        mimeType:
          type: string
          description: Optional. The IANA standard MIME type of the source data.
      type: object
    V1mainMediaResolution:
      type: object
      properties:
        level:
          enum:
            - MEDIA_RESOLUTION_UNSPECIFIED
            - MEDIA_RESOLUTION_LOW
            - MEDIA_RESOLUTION_MEDIUM
            - MEDIA_RESOLUTION_HIGH
            - MEDIA_RESOLUTION_ULTRA_HIGH
          type: string
          description: |-
            The tokenization quality used for given media.
             for Gemini API support .

            **Allowed values:**
            - `MEDIA_RESOLUTION_UNSPECIFIED`: Media resolution has not been set.
            - `MEDIA_RESOLUTION_LOW`: Media resolution set to low.
            - `MEDIA_RESOLUTION_MEDIUM`: Media resolution set to medium.
            - `MEDIA_RESOLUTION_HIGH`: Media resolution set to high.
            - `MEDIA_RESOLUTION_ULTRA_HIGH`: Media resolution set to ultra high.
      description: Media resolution for tokenization.
    DocumentMetadata:
      properties:
        startPage:
          type: integer
          format: int32
          description: Optional. 1-indexed inclusive start page.
        endPage:
          type: integer
          description: Optional. 1-indexed inclusive end page.
          format: int32
        contentLayers:
          type: array
          description: >-
            Optional. Content layers to return.

            If empty, defaults to [PAGE_IMAGE] when DocumentMetadata is set.
            When

            DocumentMetadata is not set, default document processing is used
            (for

            example, page images for PDFs).


            **Allowed values:**

            - `CONTENT_LAYER_UNSPECIFIED`: Default value.

            - `PAGE_IMAGE`: Rendered page images.

            - `PAGE_TEXT`: Extracted page text.
          items:
            enum:
              - CONTENT_LAYER_UNSPECIFIED
              - PAGE_IMAGE
              - PAGE_TEXT
            type: string
      type: object
      description: >-
        Metadata describes the input document content.

        Set this in `Part.document_metadata` or

        `FunctionResponsePart.document_metadata` when `inline_data` or
        `file_data`

        contains a document to configure static document preprocessing.
    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.
      required:
        - name
        - response
      type: object
      properties:
        response:
          description: >-
            Required. The function response in JSON object format.

            Callers can use any keys of their choice that fit the function's
            syntax

            to return the function output, e.g. "output", "result", etc.

            In particular, if the function call failed to execute, the response
            can

            have an "error" key to return error details to the model.


            Multimedia can be included by using a subobject containing a single
            "$ref"

            key whose value is the `inline_data.display_name` or

            `file_data.display_name` of a `FunctionResponsePart` holding the

            multimedia. See [Multimodal function

            responses](https://aistudio.google.com/docs/function-calling#multimodal).
          type: object
          additionalProperties:
            description: Properties of the object.
        willContinue:
          description: >-
            Optional. Signals that function call continues, and more responses
            will be

            returned, turning the function call into a generator.

            Is only applicable to NON_BLOCKING function calls, is ignored
            otherwise.

            If set to false, future responses will not be considered.

            It is allowed to return empty `response` with `will_continue=False`
            to

            signal that the function call is finished. This may still trigger
            the model

            generation. To avoid triggering the generation and finish the
            function

            call, additionally set `scheduling` to `SILENT`.
          type: boolean
        name:
          description: >-
            Required. The name of the function to call.

            Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a
            maximum

            length of 128.
          type: string
        parts:
          type: array
          items:
            $ref: '#/components/schemas/FunctionResponsePart'
          description: >-
            Optional. Ordered `Parts` that constitute a function response. Parts
            may have

            different IANA MIME types.
        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:
          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.


            **Allowed values:**

            - `SCHEDULING_UNSPECIFIED`: This value is unused.

            - `SILENT`: Only add the result to the conversation context, do not
            interrupt or trigger generation.

            - `WHEN_IDLE`: Add the result to the conversation context, and
            prompt to generate output without interrupting ongoing generation.

            - `INTERRUPT`: Add the result to the conversation context, interrupt
            ongoing generation and prompt to generate output.
          enum:
            - SCHEDULING_UNSPECIFIED
            - SILENT
            - WHEN_IDLE
            - INTERRUPT
          type: string
    ToolCall:
      type: object
      required:
        - toolType
      description: |-
        A predicted server-side `ToolCall` returned from the model. This message
        contains information about a tool that the model wants to invoke.
        The client is NOT expected to execute this `ToolCall`. Instead, the
        client should pass this `ToolCall` back to the API in a subsequent turn
        within a `Content` message, along with the corresponding `ToolResponse`.
      properties:
        id:
          type: string
          description: |-
            Optional. Unique identifier of the tool call.
            The server returns the tool response with the matching `id`.
        toolType:
          description: Required. The type of tool that was called.
          allOf:
            - $ref: '#/components/schemas/V1mainToolType'
        args:
          additionalProperties:
            description: Properties of the object.
          description: |-
            Optional. The tool call arguments.
            Example: {"arg1" : "value1", "arg2" : "value2" , ...}
          type: object
        toolName:
          type: string
          description: Optional. The name of the tool that was called.
    SearchEntryPoint:
      properties:
        sdkBlob:
          type: string
          format: byte
          description: Optional. Base64 encoded JSON representing array of  tuple.
        renderedContent:
          description: >-
            Optional. Web content snippet that can be embedded in a web page or
            an app webview.
          type: string
      description: Google search entry point.
      type: object
    GroundingChunk:
      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.
      type: object
      properties:
        image:
          allOf:
            - $ref: '#/components/schemas/Image'
          description: Optional. Grounding chunk from image search.
        maps:
          allOf:
            - $ref: '#/components/schemas/Maps'
          description: Optional. Grounding chunk from Google Maps.
        retrievedContext:
          allOf:
            - $ref: '#/components/schemas/RetrievedContext'
          description: >-
            Optional. Grounding chunk from context retrieved by the file search
            tool.
        web:
          description: Grounding chunk from the web.
          allOf:
            - $ref: '#/components/schemas/Web'
    GoogleAiGenerativelanguageV1betaGroundingSupport:
      properties:
        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.
          type: array
          items:
            type: number
            format: float
        segment:
          description: Segment of the content this support belongs to.
          allOf:
            - $ref: '#/components/schemas/GoogleAiGenerativelanguageV1betaSegment'
        renderedParts:
          type: array
          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
        groundingChunkIndices:
          items:
            type: integer
            format: int32
          type: array
          description: >-
            Optional. A list of indices (into 'grounding_chunk' in

            `response.candidate.grounding_metadata`) specifying the citations

            associated with the claim. For instance [1,3,4] means that

            grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the

            retrieved content attributed to the claim. If the response is
            streaming,

            the grounding_chunk_indices refer to the indices across all
            responses.

            It is the client's responsibility to accumulate the grounding chunks
            from

            all responses (while maintaining the same order).
      type: object
      description: Grounding support.
    RetrievalMetadata:
      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
      type: object
    TopCandidates:
      type: object
      description: Candidates with top log probabilities at each decoding step.
      properties:
        candidates:
          description: Sorted by log probability in descending order.
          type: array
          items:
            $ref: '#/components/schemas/LogprobsResultCandidate'
    LogprobsResultCandidate:
      properties:
        logProbability:
          type: number
          format: float
          description: The candidate's log probability.
        tokenId:
          format: int32
          description: The candidate’s token id value.
          type: integer
        token:
          description: The candidate’s token string value.
          type: string
      description: Candidate for the logprobs token and score.
      type: object
    UrlMetadata:
      properties:
        urlRetrievalStatus:
          description: >-
            Status of the url retrieval.


            **Allowed values:**

            - `URL_RETRIEVAL_STATUS_UNSPECIFIED`: Default value. This value is
            unused.

            - `URL_RETRIEVAL_STATUS_SUCCESS`: Url retrieval is successful.

            - `URL_RETRIEVAL_STATUS_ERROR`: Url retrieval is failed due to
            error.

            - `URL_RETRIEVAL_STATUS_PAYWALL`: Url retrieval is failed because
            the content is behind paywall.

            - `URL_RETRIEVAL_STATUS_UNSAFE`: Url retrieval is failed because the
            content is unsafe.
          type: string
          enum:
            - URL_RETRIEVAL_STATUS_UNSPECIFIED
            - URL_RETRIEVAL_STATUS_SUCCESS
            - URL_RETRIEVAL_STATUS_ERROR
            - URL_RETRIEVAL_STATUS_PAYWALL
            - URL_RETRIEVAL_STATUS_UNSAFE
        retrievedUrl:
          type: string
          description: Retrieved url by the tool.
      description: Context of the a single url retrieval.
      type: object
    AttributionSourceId:
      description: Identifier for the source contributing to this attribution.
      properties:
        semanticRetrieverChunk:
          allOf:
            - $ref: '#/components/schemas/SemanticRetrieverChunk'
          description: Identifier for a `Chunk` fetched via Semantic Retriever.
        groundingPassage:
          allOf:
            - $ref: '#/components/schemas/GroundingPassageId'
          description: Identifier for an inline passage.
      type: object
    CitationSource:
      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:
          description: >-
            Optional. URI that is attributed as a source for a portion of the
            text.
          type: string
        startIndex:
          type: integer
          format: int32
          description: >-
            Optional. Start of segment of the response that is attributed to
            this source.


            Index indicates the start of the segment, measured in bytes.
        endIndex:
          type: integer
          format: int32
          description: Optional. End of the attributed segment, exclusive.
      type: object
      description: A citation to a source for a portion of a specific response.
    GenerativeLanguageModality:
      enum:
        - MODALITY_UNSPECIFIED
        - TEXT
        - IMAGE
        - VIDEO
        - AUDIO
        - DOCUMENT
      type: string
      description: |-
        **Allowed values:**
        - `MODALITY_UNSPECIFIED`: Unspecified modality.
        - `TEXT`: Plain text.
        - `IMAGE`: Image.
        - `VIDEO`: Video.
        - `AUDIO`: Audio.
        - `DOCUMENT`: Document, e.g. PDF.
    ImageSearch:
      type: object
      description: Image search for grounding and related configurations.
    WebSearch:
      type: object
      description: Standard web search for grounding and related configurations.
    PrebuiltVoiceConfig:
      description: The configuration for the prebuilt speaker to use.
      properties:
        voiceName:
          type: string
          description: Optional. The name of the preset voice to use.
      type: object
    SpeakerVoiceConfig:
      properties:
        voiceConfig:
          description: Required. The configuration for the voice to use.
          allOf:
            - $ref: '#/components/schemas/VoiceConfig'
        speaker:
          type: string
          description: >-
            Required. The name of the speaker to use. Should be the same as in
            the prompt.
      description: The configuration for a single speaker in a multi speaker setup.
      required:
        - speaker
        - voiceConfig
      type: object
    V1mainToolType:
      enum:
        - TOOL_TYPE_UNSPECIFIED
        - GOOGLE_SEARCH_WEB
        - GOOGLE_SEARCH_IMAGE
        - URL_CONTEXT
        - GOOGLE_MAPS
        - FILE_SEARCH
        - MEDIA_PROCESSING
      type: string
      description: >-
        **Allowed values:**

        - `TOOL_TYPE_UNSPECIFIED`: Unspecified tool type.

        - `GOOGLE_SEARCH_WEB`: Google search tool, maps to
        Tool.google_search.search_types.web_search.

        - `GOOGLE_SEARCH_IMAGE`: Image search tool, maps to
        Tool.google_search.search_types.image_search.

        - `URL_CONTEXT`: URL context tool, maps to Tool.url_context.

        - `GOOGLE_MAPS`: Google maps tool, maps to Tool.google_maps.

        - `FILE_SEARCH`: File search tool, maps to Tool.file_search.

        - `MEDIA_PROCESSING`: Media processing tool types (e.g. video, audio,
        etc.), maps to invisible tools used for multimodal understanding like
        GOOGLE_UNDERSTANDING_VIDEO.
    WordInfo:
      description: Information about a single recognized word.
      properties:
        word:
          description: Required. Transcript of the word.
          type: string
        endOffset:
          type: string
          format: google-duration
          description: >-
            Optional. End offset in time of the word relative to the start of
            the audio.
        startOffset:
          type: string
          description: >-
            Optional. Start offset in time of the word relative to the start of
            the audio.
          format: google-duration
      required:
        - word
      type: object
    FunctionResponsePart:
      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.
      properties:
        documentMetadata:
          description: >-
            Optional. Document metadata. The metadata should only be specified
            while the

            document data is presented in inline_data or file_data.
          allOf:
            - $ref: '#/components/schemas/DocumentMetadata'
        mediaProcessing:
          type: string
          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.


            **Allowed values:**

            - `MEDIA_PROCESSING_UNSPECIFIED`: Defaults to model-specific
            processing.

            - `STATIC`: Fixed-rate frame extraction. All frames placed in
            context.

            - `AGENTIC`: Model-driven dynamic navigation. Recommended for most
            use cases.
          enum:
            - MEDIA_PROCESSING_UNSPECIFIED
            - STATIC
            - AGENTIC
        mediaResolution:
          allOf:
            - $ref: '#/components/schemas/V1mainMediaResolution'
          description: Optional. Media resolution for the input media.
        spreadsheetMetadata:
          allOf:
            - $ref: '#/components/schemas/SpreadsheetMetadata'
          description: >-
            Optional. Spreadsheet metadata. The metadata should only be
            specified while the

            spreadsheet data is presented in inline_data or file_data.
        videoMetadata:
          allOf:
            - $ref: '#/components/schemas/VideoMetadata'
          description: >-
            Optional. Video metadata. The metadata should only be specified
            while the video

            data is presented in inline_data or file_data.
        fileData:
          description: URI based data.
          allOf:
            - $ref: '#/components/schemas/FunctionResponseFileData'
        audioMetadata:
          description: >-
            Optional. Audio metadata. The metadata should only be specified
            while the audio

            data is presented in inline_data or file_data.
          allOf:
            - $ref: '#/components/schemas/AudioMetadata'
        inlineData:
          allOf:
            - $ref: '#/components/schemas/FunctionResponseBlob'
          description: Inline media bytes.
    Image:
      type: object
      properties:
        sourceUri:
          type: string
          description: The web page URI for attribution.
        imageUri:
          type: string
          description: The image asset URL.
        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
      description: Chunk from image search.
    Maps:
      type: object
      properties:
        placeAnswerSources:
          description: |-
            Sources that provide answers about the features of a given place in
            Google Maps.
          allOf:
            - $ref: '#/components/schemas/PlaceAnswerSources'
        placeId:
          type: string
          description: >-
            The ID of the place, in `places/{place_id}` format. A user can use
            this

            ID to look up that place.
        text:
          description: Text description of the place answer.
          type: string
        uri:
          type: string
          description: URI reference of the place.
        title:
          type: string
          description: Title of the place.
      description: |-
        A grounding chunk from Google Maps. A Maps chunk corresponds to a single
        place.
    RetrievedContext:
      description: Chunk from context retrieved by the file search tool.
      type: object
      properties:
        title:
          type: string
          description: Optional. Title of the document.
        fileSearchStore:
          type: string
          description: |-
            Optional. Name of the `FileSearchStore` containing the document.
            Example: `fileSearchStores/123`
        mediaId:
          description: >-
            Optional. The media blob resource name for multimodal file search
            results.

            Format: fileSearchStores/{file_search_store_id}/media/{blob_id}
          type: string
        text:
          description: Optional. Text of the chunk.
          type: string
        pageNumber:
          format: int32
          type: integer
          description: Optional. Page number of the retrieved context, if applicable.
        uri:
          type: string
          description: Optional. URI reference of the semantic retrieval document.
        customMetadata:
          items:
            $ref: '#/components/schemas/GroundingChunkCustomMetadata'
          type: array
          description: Optional. User-provided metadata about the retrieved context.
    Web:
      description: Chunk from the web.
      type: object
      properties:
        uri:
          readOnly: true
          type: string
          description: Output only. URI reference of the chunk.
        title:
          readOnly: true
          description: Output only. Title of the chunk.
          type: string
    GoogleAiGenerativelanguageV1betaSegment:
      description: Segment of the content.
      properties:
        endIndex:
          type: integer
          description: >-
            End index in the given Part, measured in bytes. Offset from the
            start of

            the Part, exclusive, starting at zero.
          format: int32
        partIndex:
          type: integer
          description: The index of a Part object within its parent Content object.
          format: int32
        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.
        text:
          description: The text corresponding to the segment from the response.
          type: string
      type: object
    SemanticRetrieverChunk:
      type: object
      description: >-
        Identifier for a `Chunk` retrieved via Semantic Retriever specified in
        the

        `GenerateAnswerRequest` using `SemanticRetrieverConfig`.
      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:
          readOnly: true
          type: string
          description: |-
            Output only. Name of the `Chunk` containing the attributed text.
            Example: `corpora/123/documents/abc/chunks/xyz`
    GroundingPassageId:
      type: object
      properties:
        passageId:
          description: >-
            Output only. ID of the passage matching the
            `GenerateAnswerRequest`'s

            `GroundingPassage.id`.
          type: string
          readOnly: true
        partIndex:
          type: integer
          readOnly: true
          description: |-
            Output only. Index of the part within the `GenerateAnswerRequest`'s
            `GroundingPassage.content`.
          format: int32
      description: Identifier for a part within a `GroundingPassage`.
    FunctionResponseFileData:
      required:
        - fileUri
      type: object
      description: URI based data for function response.
      properties:
        displayName:
          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: string
        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
    FunctionResponseBlob:
      properties:
        data:
          description: Raw bytes for media formats.
          type: string
          format: byte
        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
        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
      description: >-
        Raw media bytes for function response.


        Text should not be sent as raw bytes, use the
        'FunctionResponse.response'

        field.
    PlaceAnswerSources:
      properties:
        reviewSnippets:
          items:
            $ref: '#/components/schemas/ReviewSnippet'
          description: |-
            Snippets of reviews that are used to generate answers about the
            features of a given place in Google Maps.
          type: array
      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.
      type: object
    GroundingChunkCustomMetadata:
      type: object
      description: User provided metadata about the GroundingFact.
      properties:
        numericValue:
          format: float
          type: number
          description: >-
            Optional. The numeric value of the metadata.

            The expected range for this value depends on the specific `key`
            used.
        key:
          type: string
          description: The key of the metadata.
        stringListValue:
          allOf:
            - $ref: '#/components/schemas/GroundingChunkStringList'
          description: Optional. A list of string values for the metadata.
        stringValue:
          description: Optional. The string value of the metadata.
          type: string
    ReviewSnippet:
      properties:
        title:
          description: Title of the review.
          type: string
        googleMapsUri:
          description: A link that corresponds to the user review on Google Maps.
          type: string
        reviewId:
          description: The ID of the review snippet.
          type: string
      type: object
      description: |-
        Encapsulates a snippet of a user review that answers a question about
        the features of a specific place in Google Maps.
    GroundingChunkStringList:
      description: A list of string values.
      type: object
      properties:
        values:
          type: array
          items:
            type: string
          description: The string values of the list.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-goog-api-key
      description: >-
        Send your DreamTo API Key in the `x-goog-api-key` header, the way the
        Google SDKs do by default; the `?key=<API Key>` query parameter works
        too.
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your DreamTo API Key in the `Authorization` header: `Authorization:
        Bearer <API Key>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.