> ## 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.

# 生成内容

> 根据输入的 `GenerateContentRequest` 生成模型响应。详细用法请参阅[文本生成指南](https://aistudio.google.com/docs/text-generation)。不同模型（包括调优模型）支持的输入能力有所不同，详见[模型指南](https://aistudio.google.com/docs/models)和[调优指南](https://aistudio.google.com/docs/model-tuning)。



## OpenAPI

````yaml /openapi/zh/gemini-generate-content.json post /v1beta/models/{model}:generateContent
openapi: 3.0.3
info:
  title: Gemini generateContent
  version: v1beta
  description: 用 Gemini generateContent 协议（v1beta）调用 Gemini 模型：多模态输入、思考、流式输出、函数调用和结构化输出。
servers:
  - url: https://api.dreamto.ai
security:
  - apiKeyAuth: []
  - bearerAuth: []
tags:
  - name: generateContent
paths:
  /v1beta/models/{model}:generateContent:
    post:
      tags:
        - generateContent
      summary: 生成内容
      description: >-
        根据输入的 `GenerateContentRequest`
        生成模型响应。详细用法请参阅[文本生成指南](https://aistudio.google.com/docs/text-generation)。不同模型（包括调优模型）支持的输入能力有所不同，详见[模型指南](https://aistudio.google.com/docs/models)和[调优指南](https://aistudio.google.com/docs/model-tuning)。
      operationId: generateContent
      parameters:
        - description: >-
            要使用的模型 ID，例如
            `gemini-4-hydrogen`。可用模型见[模型介绍](/llm/gemini-generate-content)。
          required: true
          schema:
            type: string
            default: gemini-4-hydrogen
          in: path
          name: model
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateContentRequest'
            examples:
              基础用法:
                summary: 基础用法
                description: 模型 ID 写在路径里，请求体只需要 `contents`。
                value:
                  contents:
                    - role: user
                      parts:
                        - text: 用三句话介绍一下量子计算。
              系统指令与多轮对话:
                summary: 系统指令与多轮对话
                description: '系统指令放在 `systemInstruction`；模型的历史回复用 `role: model`。'
                value:
                  systemInstruction:
                    parts:
                      - text: 你是一个简洁、专业的助手。
                  contents:
                    - role: user
                      parts:
                        - text: 帮我想一个咖啡店的名字。
                    - role: model
                      parts:
                        - text: 「晨光咖啡」怎么样？
                    - role: user
                      parts:
                        - text: 再给这个名字配一句标语。
              生成参数与思考:
                summary: 生成参数与思考
                description: >-
                  `generationConfig`
                  控制输出长度和思考深度（`thinkingConfig.thinkingLevel`）。
                value:
                  contents:
                    - role: user
                      parts:
                        - text: 证明：任意五个整数中，必有三个数之和能被 3 整除。
                  generationConfig:
                    maxOutputTokens: 8192
                    thinkingConfig:
                      thinkingLevel: HIGH
              图片理解:
                summary: 图片理解
                description: 用 `inlineData` 传入 Base64 编码的图片，并写明 `mimeType`。
                value:
                  contents:
                    - role: user
                      parts:
                        - inlineData:
                            mimeType: image/jpeg
                            data: <图片的 Base64 编码>
                        - text: 这张图片里有什么？
              函数调用:
                summary: 函数调用
                description: 模型需要外部数据时返回 `functionCall`；执行后用 `functionResponse` 把结果传回。
                value:
                  contents:
                    - role: user
                      parts:
                        - text: 杭州今天天气怎么样？
                  tools:
                    - functionDeclarations:
                        - name: get_weather
                          description: 查询指定城市的实时天气
                          parametersJsonSchema:
                            type: object
                            properties:
                              city:
                                type: string
                                description: 城市名，例如：杭州
                              unit:
                                type: string
                                enum:
                                  - celsius
                                  - fahrenheit
                            required:
                              - city
              结构化输出:
                summary: 结构化输出
                description: >-
                  `responseMimeType` 设为 `application/json`，并用
                  `responseJsonSchema` 给出结构。
                value:
                  contents:
                    - role: user
                      parts:
                        - text: 从这段话里提取联系人：我是星河科技的李雷，邮箱 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: 模型的回复，包含候选内容和用量。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateContentResponse'
        '400':
          description: 请求无效：JSON 格式错误、缺少必填字段，或参数不被所选模型支持。按 `message` 修改后重试。
          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: API Key 缺失或无效。
          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: 账户余额不足，充值后重试。
          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: 当前 API Key 无权使用该模型。
          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: 模型不存在或尚未开放。
          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: 请求频率超过限制，退避后重试。
          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: 服务内部错误，稍后重试。
          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: 服务暂时不可用或处理超时，稍后重试。
          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: 请求模型生成补全。
      properties:
        continuationToken:
          format: byte
          description: >-
            可选。不透明的续接 Token，用于从之前因 `finish_reason` 为 `CONTINUATION` 而停止的
            `GenerateContent` 或 `StreamGenerateContent` 响应处继续生成。注意，请求中提供续接 Token
            时，`contents` 为必填项，且必须与初始请求中的提示词和对话历史完全一致。
          type: string
        tools:
          items:
            $ref: '#/components/schemas/Tool'
          type: array
          description: >-
            可选。`Model` 可用于生成下一个响应的 `Tools` 列表。


            `Tool` 是一段代码，使系统能够与外部系统交互，以执行 `Model` 知识和能力范围之外的一个或一组操作。支持的 `Tool`
            包括 `Function` 和
            `code_execution`。详见[函数调用](https://aistudio.google.com/docs/function-calling)和[代码执行](https://aistudio.google.com/docs/code-execution)指南。
        serviceTier:
          description: 可选。请求的服务层级。
          allOf:
            - $ref: '#/components/schemas/ServiceTier'
        toolConfig:
          description: >-
            可选。请求中指定的任意 `Tool`
            的工具配置。用法示例请参阅[函数调用指南](https://aistudio.google.com/docs/function-calling#function_calling_modes)。
          allOf:
            - $ref: '#/components/schemas/ToolConfig'
        safetySettings:
          description: >-
            可选。用于拦截不安全内容的唯一 `SafetySetting` 实例列表。


            该设置会作用于 `GenerateContentRequest.contents` 和
            `GenerateContentResponse.candidates`。每种 `SafetyCategory`
            类型最多只能有一个设置。API 会拦截所有未达到这些设置所定阈值的内容和响应。此列表会覆盖 safety_settings
            中所指定的每个 `SafetyCategory` 的默认设置。如果列表中没有为某个 `SafetyCategory` 提供
            `SafetySetting`，API 将对该类别使用默认安全设置。支持的危害类别包括
            HARM_CATEGORY_HATE_SPEECH、HARM_CATEGORY_SEXUALLY_EXPLICIT、HARM_CATEGORY_DANGEROUS_CONTENT、HARM_CATEGORY_HARASSMENT、HARM_CATEGORY_CIVIC_INTEGRITY、HARM_CATEGORY_JAILBREAK。可用安全设置的详细信息请参阅[指南](https://aistudio.google.com/docs/safety-settings)。另请参阅[安全指南](https://aistudio.google.com/docs/safety-guidance)，了解如何在
            AI 应用中纳入安全考量。
          type: array
          items:
            $ref: '#/components/schemas/SafetySetting'
        labels:
          description: |-
            可选。请求的标签，包含用户自定义元数据。

            可选。标签必须遵循统一的 Cloud 标签标准要求：
            - 标签键必须以字母开头。
            - 标签键和值的长度不得超过 63 个字符（Unicode 码位），且只能包含小写字母、数字、下划线和短横线。
            - 允许使用国际字符。

            用法：
            -  来自聚合方的安全标识符：使用键 `safety_identifier`
               （例如 `{"safety_identifier": "user_session_123"}`）
          type: object
          additionalProperties:
            type: string
        cachedContent:
          description: >-
            可选。用作上下文来提供预测的[缓存](https://aistudio.google.com/docs/caching)内容名称。格式：`cachedContents/{cachedContent}`
          type: string
        generationConfig:
          description: 可选。模型生成和输出的配置选项。
          allOf:
            - $ref: '#/components/schemas/GenerationConfig'
        store:
          description: 可选。配置指定请求的日志记录行为。设置后将优先于项目级日志配置。
          type: boolean
        systemInstruction:
          allOf:
            - $ref: '#/components/schemas/Content'
          description: >-
            可选。开发者设置的[系统指令](https://aistudio.google.com/docs/text-generation#system-instructions)。目前仅支持文本。
        contents:
          description: >-
            必填。与模型当前对话的内容。


            对于单轮查询，这是单个实例。对于[聊天](https://aistudio.google.com/docs/text-generation#multi-turn-conversations)等多轮查询，这是一个重复字段，包含对话历史和最新请求。
          type: array
          items:
            $ref: '#/components/schemas/Content'
      type: object
      required:
        - contents
    GenerateContentResponse:
      description: >-
        支持多个候选响应的模型响应。


        安全评级和内容过滤的结果会针对提示词在 `GenerateContentResponse.prompt_feedback`
        中报告，并针对每个候选在 `finish_reason` 和 `safety_ratings` 中报告。API：
         - 要么返回所有请求的候选，要么一个也不返回
         - 仅当提示词有问题时才完全不返回候选（请检查 `prompt_feedback`）
         - 在 `finish_reason` 和 `safety_ratings` 中报告每个候选的反馈。
      type: object
      properties:
        modelVersion:
          description: 仅输出。用于生成响应的模型版本。
          readOnly: true
          type: string
        candidates:
          items:
            $ref: '#/components/schemas/Candidate'
          description: 模型的候选响应。
          type: array
        promptFeedback:
          allOf:
            - $ref: '#/components/schemas/PromptFeedback'
          description: 返回与内容过滤器相关的提示词反馈。
        responseId:
          type: string
          description: 仅输出。response_id 用于标识每个响应。
          readOnly: true
        usageMetadata:
          readOnly: true
          description: 仅输出。生成请求的 Token 用量元数据。
          allOf:
            - $ref: '#/components/schemas/UsageMetadata'
        modelStatus:
          readOnly: true
          description: 仅输出。该模型当前的模型状态。
          allOf:
            - $ref: '#/components/schemas/ModelStatus'
    GatewayError:
      type: object
      description: 错误响应。
      properties:
        error:
          type: object
          description: 错误信息。
          properties:
            code:
              type: string
              description: >-
                错误码，例如
                `invalid_request`、`unauthorized`、`insufficient_balance`、`rate_limit_exceeded`。个别由模型侧直接返回的参数错误里，这里是数字形式的状态码。
            http_status:
              type: integer
              description: 与响应的 HTTP 状态码相同；个别由模型侧直接返回的错误不带这个字段。
            message:
              type: string
              description: 错误描述（英文）。程序逻辑请依据状态码和 `code` 判断，不要依赖这段文字。
            request_id:
              type: string
              description: 本次请求的 ID，与响应头 `X-Request-Id` 相同，反馈问题时请提供；个别错误不带这个字段，请以响应头为准。
            type:
              type: string
              description: >-
                错误大类，例如
                `invalid_request_error`、`authentication_error`、`rate_limit_error`、`api_error`；个别错误不带这个字段。
          required:
            - code
            - message
      required:
        - error
    Tool:
      properties:
        fileSearch:
          description: 可选。FileSearch 工具类型。用于从 Semantic Retrieval 语料库检索知识的工具。
          allOf:
            - $ref: '#/components/schemas/FileSearch'
        googleSearchRetrieval:
          allOf:
            - $ref: '#/components/schemas/GoogleSearchRetrieval'
          description: 可选。由 Google 搜索提供支持的检索工具。
        googleSearch:
          description: 可选。GoogleSearch 工具类型。用于在模型中支持 Google 搜索的工具，由 Google 提供支持。
          allOf:
            - $ref: '#/components/schemas/GoogleSearch'
        codeExecution:
          description: 可选。使模型能够在生成过程中执行代码。
          allOf:
            - $ref: '#/components/schemas/CodeExecution'
        computerUse:
          description: 可选。支持模型直接与计算机交互的工具。启用后会自动填充计算机使用专用的函数声明。
          allOf:
            - $ref: '#/components/schemas/ComputerUse'
        googleMaps:
          allOf:
            - $ref: '#/components/schemas/GoogleMaps'
          description: 可选。允许使用与用户查询相关的地理空间上下文对模型响应进行接地的工具。
        functionDeclarations:
          description: >-
            可选。模型可用于函数调用的 `FunctionDeclarations` 列表。


            模型或系统不会执行函数。定义的函数可能以带参数的 FunctionCall 形式返回给客户端执行。模型可以通过在响应中填充
            FunctionCall 来决定调用其中部分函数。下一轮对话可能包含 FunctionResponse，以 Content.role
            "function" 作为模型下一轮的生成上下文。
          items:
            $ref: '#/components/schemas/FunctionDeclaration'
          type: array
        urlContext:
          description: 可选。支持 URL 上下文检索的工具。
          allOf:
            - $ref: '#/components/schemas/UrlContext'
        mcpServers:
          type: array
          description: 可选。要连接的 MCP 服务器。
          items:
            $ref: '#/components/schemas/McpServer'
      type: object
      description: |-
        模型可用于生成响应的工具详情。

        `Tool` 是一段代码，使系统能够与外部系统交互，以执行模型知识和能力范围之外的一个或一组操作。
    ServiceTier:
      enum:
        - unspecified
        - standard
        - flex
        - priority
      type: string
      description: |-
        **可选值：**
        - `unspecified`：默认服务层级，即标准层级。
        - `standard`：标准服务层级。
        - `flex`：Flex 服务层级。
        - `priority`：Priority 服务层级。
    ToolConfig:
      properties:
        functionCallingConfig:
          description: 可选。函数调用配置。
          allOf:
            - $ref: '#/components/schemas/FunctionCallingConfig'
        retrievalConfig:
          allOf:
            - $ref: '#/components/schemas/RetrievalConfig'
          description: 可选。检索配置。
        includeServerSideToolInvocations:
          type: boolean
          description: 可选。若为 true，API 响应会在 `Content` 消息中包含服务端工具调用及其响应，使客户端可以观察服务端的工具交互。
      description: 工具配置，包含用于指定请求中 `Tool` 使用方式的参数。
      type: object
    SafetySetting:
      properties:
        category:
          allOf:
            - $ref: '#/components/schemas/HarmCategory'
          description: 必填。此设置所属的类别。
        threshold:
          type: string
          description: |-
            必填。控制拦截有害内容的概率阈值。

            **可选值：**
            - `HARM_BLOCK_THRESHOLD_UNSPECIFIED`：未指定阈值。
            - `BLOCK_LOW_AND_ABOVE`：允许 NEGLIGIBLE 级别的内容。
            - `BLOCK_MEDIUM_AND_ABOVE`：允许 NEGLIGIBLE 和 LOW 级别的内容。
            - `BLOCK_ONLY_HIGH`：允许 NEGLIGIBLE、LOW 和 MEDIUM 级别的内容。
            - `BLOCK_NONE`：允许所有内容。
            - `OFF`：关闭安全过滤器。
          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: |-
        安全设置，影响安全拦截行为。

        为某个类别传入安全设置，会改变内容被拦截的允许概率。
    GenerationConfig:
      type: object
      description: 模型生成和输出的配置选项。并非所有参数都适用于每个模型。
      properties:
        _responseJsonSchema:
          description: >-
            可选。生成响应的输出 Schema。这是 `response_schema` 的替代方案，接受 [JSON
            Schema](https://json-schema.org/)。


            如果设置此项，必须省略 `response_schema`，但 `response_mime_type` 为必填。


            虽然可以发送完整的 JSON Schema，但并非所有特性都受支持。具体而言，仅支持以下属性：


            - `$id`

            - `$defs`

            - `$ref`

            - `$anchor`

            - `type`

            - `format`

            - `title`

            - `description`

            - `enum`（适用于字符串和数字）

            - `items`

            - `prefixItems`

            - `minItems`

            - `maxItems`

            - `minimum`

            - `maximum`

            - `anyOf`

            - `oneOf`（按与 `anyOf` 相同的方式解释）

            - `properties`

            - `additionalProperties`

            - `required`


            也可以设置非标准的 `propertyOrdering` 属性。


            循环引用会被有限展开，因此只能在非必需属性中使用。（仅设为可空属性是不够的。）如果在子 Schema 上设置了 `$ref`，则除以
            `$` 开头的属性外，不能设置其他任何属性。


            已弃用。请改用 `response_format`。
          deprecated: true
        translationConfig:
          description: 可选。翻译配置。
          allOf:
            - $ref: '#/components/schemas/TranslationConfig'
        thinkingConfig:
          allOf:
            - $ref: '#/components/schemas/ThinkingConfig'
          description: 可选。思考功能配置。如果为不支持思考的模型设置此字段，将返回错误。
        imageConfig:
          allOf:
            - $ref: '#/components/schemas/ImageConfig'
          description: 可选。图像生成配置。如果为不支持这些配置选项的模型设置此字段，将返回错误。
        candidateCount:
          description: 可选。要返回的生成响应数量。未设置时默认为 1。注意，此参数不适用于上一代模型（Gemini 1.0 系列）
          format: int32
          type: integer
        responseSchema:
          description: >-
            可选。生成的候选文本的输出 Schema。Schema 必须是 [OpenAPI
            schema](https://spec.openapis.org/oas/v3.0.3#schema)
            的子集，可以是对象、基本类型或数组。


            如果设置此项，还必须设置兼容的 `response_mime_type`。兼容的 MIME 类型：

            `application/json`：JSON 响应的 Schema。

            详见 [JSON
            文本生成指南](https://aistudio.google.com/docs/structured-output)。


            已弃用。请改用 `response_format`。
          allOf:
            - $ref: '#/components/schemas/Schema'
          deprecated: true
        enableEnhancedCivicAnswers:
          description: 可选。启用增强的公民事务回答。并非所有模型都支持。
          type: boolean
        maxOutputTokens:
          format: int32
          type: integer
          description: >-
            可选。响应候选中包含的最大 Token 数。


            注意：默认值因模型而异，参见 `getModel` 函数返回的 `Model` 的 `Model.output_token_limit`
            属性。
        speechConfig:
          description: 可选。语音生成配置。
          allOf:
            - $ref: '#/components/schemas/SpeechConfig'
        temperature:
          description: |-
            可选。控制输出的随机性。

            注意：默认值因模型而异，参见 `getModel` 函数返回的 `Model` 的 `Model.temperature` 属性。

            取值范围为 [0.0, 2.0]。

            Gemini 3.6 Flash 及更新的模型已不再支持此字段，并会静默忽略。
          type: number
          format: float
        seed:
          description: 可选。解码时使用的种子。未设置时，请求使用随机生成的种子。
          format: int32
          type: integer
        presencePenalty:
          description: >-
            可选。如果某个 Token 已在响应中出现过，则对下一个 Token 的对数概率施加存在惩罚。


            该惩罚只有开/关两种状态，与 Token 的使用次数（首次之后）无关。如需随每次使用而递增的惩罚，请使用
            frequency_penalty。


            正惩罚会抑制使用响应中已出现的 Token，从而增加词汇丰富度。


            负惩罚会鼓励使用响应中已出现的 Token，从而降低词汇丰富度。
          format: float
          type: number
        responseLogprobs:
          description: 可选。若为 true，在响应中导出对数概率结果。
          type: boolean
        topP:
          description: >-
            可选。采样时考虑的 Token 最大累积概率。


            模型结合使用 Top-k 和 Top-p（核）采样。


            Token 会按其分配的概率排序，只考虑可能性最高的 Token。Top-k 采样直接限制要考虑的最大 Token
            数量，而核采样则根据累积概率限制 Token 数量。


            注意：默认值因 `Model` 而异，由 `getModel` 函数返回的 `Model.top_p` 属性指定。`top_k`
            属性为空表示该模型不使用 top-k 采样，也不允许在请求中设置 `top_k`。


            Gemini 3.6 Flash 及更新的模型已不再支持此字段，并会静默忽略。
          format: float
          type: number
        logprobs:
          description: >-
            可选。仅在 response_logprobs=True 时有效。设置在 Candidate.logprobs_result
            中每个解码步骤返回的最高对数概率数量（包括被选中的候选）。取值范围必须在 [0, 20] 内。
          type: integer
          format: int32
        topK:
          format: int32
          description: >-
            可选。采样时考虑的最大 Token 数量。


            Gemini 模型使用 Top-p（核）采样，或结合使用 Top-k 与核采样。Top-k 采样会考虑概率最高的 `top_k` 个
            Token 组成的集合。使用核采样运行的模型不允许设置 top_k。


            注意：默认值因 `Model` 而异，由 `getModel` 函数返回的 `Model.top_p` 属性指定。`top_k`
            属性为空表示该模型不使用 top-k 采样，也不允许在请求中设置 `top_k`。


            Gemini 3.6 Flash 及更新的模型已不再支持此字段，并会静默忽略。
          type: integer
        responseFormat:
          description: 可选。响应输出格式的配置。允许以扁平结构按模态（文本、音频、图像）指定输出配置。
          allOf:
            - $ref: '#/components/schemas/ResponseFormatConfig'
        responseMimeType:
          type: string
          description: >-
            可选。生成的候选文本的 MIME 类型。支持的 MIME 类型：

            `text/plain`：（默认）文本输出。

            `application/json`：响应候选中为 JSON 响应。

            `text/x.enum`：响应候选中为字符串形式的 ENUM 响应。

            所有支持的文本 MIME
            类型列表请参阅[文档](https://aistudio.google.com/docs/file-input-methods#text-file-types)。
        enableAffectiveDialog:
          description: 可选。启用后，模型将检测情绪并相应调整其响应。
          type: boolean
        responseJsonSchema:
          description: 可选。内部细节。请使用 `responseJsonSchema` 而非此字段。
        stopSequences:
          items:
            type: string
          type: array
          description: >-
            可选。用于停止输出生成的字符序列集合（最多 5 个）。如果指定，API 会在首次出现 `stop_sequence`
            时停止。停止序列不会包含在响应中。
        responseModalities:
          description: |-
            可选。请求的响应模态。表示模型可以返回、且响应中应包含的模态集合，必须与响应的模态完全匹配。

            一个模型可能支持多种模态组合。如果请求的模态与所有支持的组合都不匹配，将返回错误。

            空列表等同于仅请求文本。

            **可选值：**
            - `MODALITY_UNSPECIFIED`：默认值。
            - `TEXT`：表示模型应返回文本。
            - `IMAGE`：表示模型应返回图像。
            - `AUDIO`：表示模型应返回音频。
          items:
            type: string
            enum:
              - MODALITY_UNSPECIFIED
              - TEXT
              - IMAGE
              - AUDIO
          type: array
        frequencyPenalty:
          type: number
          description: >-
            可选。应用于下一个 Token 对数概率的频率惩罚，乘以每个 Token 在当前响应中已出现的次数。


            正惩罚会抑制使用已用过的 Token，惩罚力度与该 Token 的使用次数成正比：Token
            使用得越多，模型就越难再次使用它，从而增加响应的词汇丰富度。


            注意：_负_ 惩罚会鼓励模型重复使用 Token，力度与该 Token
            的使用次数成正比。较小的负值会降低响应的词汇丰富度；较大的负值会导致模型不断重复某个常见 Token，直到达到
            max_output_tokens 上限。
          format: float
        mediaResolution:
          type: string
          description: |-
            可选。如果指定，将使用所指定的媒体分辨率。

            **可选值：**
            - `MEDIA_RESOLUTION_UNSPECIFIED`：未设置媒体分辨率。
            - `MEDIA_RESOLUTION_LOW`：媒体分辨率设为低（64 个 Token）。
            - `MEDIA_RESOLUTION_MEDIUM`：媒体分辨率设为中（256 个 Token）。
            - `MEDIA_RESOLUTION_HIGH`：媒体分辨率设为高（缩放重构图，256 个 Token）。
          enum:
            - MEDIA_RESOLUTION_UNSPECIFIED
            - MEDIA_RESOLUTION_LOW
            - MEDIA_RESOLUTION_MEDIUM
            - MEDIA_RESOLUTION_HIGH
        audioTranscriptionConfig:
          allOf:
            - $ref: '#/components/schemas/AudioTranscriptionConfig'
          description: 可选。音频转写（语音识别）配置。
    Content:
      properties:
        parts:
          items:
            $ref: '#/components/schemas/Part'
          description: 构成单条消息的有序 `Parts`。各部分可以具有不同的 MIME 类型。
          type: array
        role:
          description: |-
            可选。内容的生成方，必须为 'user' 或 'model'。

            在多轮对话中建议设置，否则可以留空或不设置。
          type: string
      description: >-
        包含消息多部分内容的基础结构化数据类型。


        `Content` 包含一个 `role` 字段，用于指定 `Content` 的生成方；以及一个 `parts`
        字段，包含构成该消息轮次内容的多部分数据。
      type: object
    Candidate:
      type: object
      description: 模型生成的响应候选。
      properties:
        safetyRatings:
          items:
            $ref: '#/components/schemas/SafetyRating'
          type: array
          description: |-
            响应候选的安全评级列表。

            每个类别最多只有一个评级。
        content:
          description: 仅输出。模型返回的生成内容。
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/Content'
        finishMessage:
          readOnly: true
          type: string
          description: 可选。仅输出。详细说明模型停止生成 Token 的原因。仅在设置了 `finish_reason` 时填充。
        avgLogprobs:
          type: number
          description: 仅输出。候选的平均对数概率分数。
          format: double
          readOnly: true
        groundingMetadata:
          readOnly: true
          description: |-
            仅输出。候选的接地元数据。

            此字段在 `GenerateContent` 调用中填充。
          allOf:
            - $ref: '#/components/schemas/GroundingMetadata'
        logprobsResult:
          readOnly: true
          description: 仅输出。响应 Token 及最高概率 Token 的对数似然分数
          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: >-
            可选。仅输出。模型停止生成 Token 的原因。


            如果为空，表示模型尚未停止生成 Token。


            **可选值：**

            - `FINISH_REASON_UNSPECIFIED`：默认值。此值未使用。

            - `STOP`：模型的自然停止点或提供的停止序列。

            - `MAX_TOKENS`：已达到请求中指定的最大 Token 数。

            - `SAFETY`：响应候选内容因安全原因被标记。

            - `RECITATION`：响应候选内容因复述原因被标记。

            - `LANGUAGE`：响应候选内容因使用了不支持的语言而被标记。

            - `OTHER`：未知原因。

            - `BLOCKLIST`：Token 生成已停止，因为内容包含禁用词语。

            - `PROHIBITED_CONTENT`：Token 生成已停止，因为内容可能包含违禁内容。

            - `SPII`：Token 生成已停止，因为内容可能包含敏感个人身份信息（SPII）。

            - `MALFORMED_FUNCTION_CALL`：模型生成的函数调用无效。

            - `IMAGE_SAFETY`：Token 生成已停止，因为生成的图像存在安全违规。

            - `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`：表示 Token
            生成已停止，因为用户账号因违反《禁止使用政策》（PUP）而被限制或停用。

            - `CONTINUATION`：Token 生成已停止，因为响应达到了单次请求的 Token 上限，但生成尚未完成。可以使用返回的
            `continuation_token` 发起后续请求以继续模型响应。注意，`max_output_tokens`
            在多次续接之间累计计算，必须单调递增或省略。
          readOnly: true
          type: string
        tokenCount:
          format: int32
          readOnly: true
          description: 仅输出。此候选的 Token 数。
          type: integer
        urlContextMetadata:
          description: 仅输出。URL 上下文检索工具相关的元数据。
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/UrlContextMetadata'
        groundingAttributions:
          description: |-
            仅输出。为接地答案提供内容的来源的归属信息。

            此字段在 `GenerateAnswer` 调用中填充。
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/GroundingAttribution'
        index:
          readOnly: true
          description: 仅输出。该候选在响应候选列表中的索引。
          format: int32
          type: integer
        continuationToken:
          description: >-
            可选的不透明续接 Token，在 `finish_reason` 为 `CONTINUATION` 时返回。客户端可以在后续的
            `GenerateContentRequest` 中传入此 Token 以继续生成。
          format: byte
          type: string
        citationMetadata:
          readOnly: true
          description: >-
            仅输出。模型生成候选的引用信息。


            对于 `content` 中包含的任意文本，此字段可能会填充复述信息。这些是从基础 LLM
            训练数据中受版权保护的材料“复述”而来的段落。
          allOf:
            - $ref: '#/components/schemas/CitationMetadata'
    PromptFeedback:
      properties:
        safetyRatings:
          type: array
          description: 提示词的安全评级。每个类别最多只有一个评级。
          items:
            $ref: '#/components/schemas/SafetyRating'
        blockReason:
          enum:
            - BLOCK_REASON_UNSPECIFIED
            - SAFETY
            - OTHER
            - BLOCKLIST
            - PROHIBITED_CONTENT
            - IMAGE_SAFETY
          description: |-
            可选。如果已设置，表示提示词已被拦截且不返回任何候选。请改写提示词。

            **可选值：**
            - `BLOCK_REASON_UNSPECIFIED`：默认值。此值未使用。
            - `SAFETY`：提示词因安全原因被拦截。查看 `safety_ratings` 以了解是哪个安全类别拦截了它。
            - `OTHER`：提示词因未知原因被拦截。
            - `BLOCKLIST`：提示词因包含术语屏蔽列表中的词语而被拦截。
            - `PROHIBITED_CONTENT`：提示词因包含违禁内容而被拦截。
            - `IMAGE_SAFETY`：候选因包含不安全的图像生成内容而被拦截。
          type: string
      description: 针对 `GenerateContentRequest.content` 中所指定提示词的一组反馈元数据。
      type: object
    UsageMetadata:
      properties:
        toolUsePromptTokenCount:
          format: int32
          readOnly: true
          description: 仅输出。工具使用提示词中的 Token 数量。
          type: integer
        candidatesTokensDetails:
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
          type: array
          readOnly: true
          description: 仅输出。响应中返回的模态列表。
        serviceTier:
          readOnly: true
          description: 仅输出。请求的服务层级。
          allOf:
            - $ref: '#/components/schemas/ServiceTier'
        cachedContentTokenCount:
          type: integer
          description: 提示词中缓存部分（即缓存内容）的 Token 数量
          format: int32
        promptTokenCount:
          format: int32
          type: integer
          description: >-
            提示词中的 Token 数量。设置了 `cached_content` 时，这仍是有效提示词的总大小，即包含缓存内容中的 Token
            数量。
        promptTokensDetails:
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
          readOnly: true
          description: 仅输出。请求输入中已处理的模态列表。
          type: array
        thoughtsTokenCount:
          readOnly: true
          format: int32
          type: integer
          description: 仅输出。思考模型的思考 Token 数量。
        totalTokenCount:
          type: integer
          description: 生成请求的 Token 总数（提示词 + 工具使用提示词 + 思考 + 响应候选）。
          format: int32
        toolUsePromptTokensDetails:
          type: array
          readOnly: true
          description: 仅输出。为工具使用请求输入处理的模态列表。
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
        candidatesTokenCount:
          format: int32
          description: 所有生成的响应候选的 Token 总数。
          type: integer
        cacheTokensDetails:
          type: array
          description: 仅输出。请求输入中缓存内容的模态列表。
          items:
            $ref: '#/components/schemas/ModalityTokenCount'
          readOnly: true
      type: object
      description: 生成请求的 Token 用量元数据。
    ModelStatus:
      description: 底层模型的状态，用于表示底层模型所处的阶段以及下线时间（如适用）。
      properties:
        message:
          type: string
          description: 说明模型状态的消息。
        modelStage:
          allOf:
            - $ref: '#/components/schemas/ModelStage'
          description: 底层模型所处的阶段。
        retirementTime:
          description: 模型的下线时间。
          type: string
          format: date-time
      type: object
    FileSearch:
      description: >-
        从 Semantic Retrieval 语料库检索知识的 FileSearch 工具。文件通过 ImportFile API 导入
        Semantic Retrieval 语料库。
      type: object
      properties:
        metadataFilter:
          description: 可选。应用于语义检索文档和片段的元数据过滤条件。
          type: string
        fileSearchStoreNames:
          type: array
          items:
            type: string
          description: >-
            必填。要从中检索的 file_search_stores
            名称。示例：`fileSearchStores/my-file-search-store-123`
        topK:
          description: 可选。要检索的语义检索片段数量。
          type: integer
          format: int32
      required:
        - fileSearchStoreNames
    GoogleSearchRetrieval:
      properties:
        dynamicRetrievalConfig:
          allOf:
            - $ref: '#/components/schemas/DynamicRetrievalConfig'
          description: 为给定来源指定动态检索配置。
      type: object
      description: 用于接地的公开网页数据检索工具，由 Google 提供支持。
    GoogleSearch:
      properties:
        searchTypes:
          description: 可选。要启用的搜索类型集合。未设置时默认启用网页搜索。
          allOf:
            - $ref: '#/components/schemas/SearchTypes'
        timeRangeFilter:
          allOf:
            - $ref: '#/components/schemas/Interval'
          description: 可选。将搜索结果过滤到特定时间范围。如果设置了开始时间，则必须同时设置结束时间（反之亦然）。
      type: object
      description: GoogleSearch 工具类型。用于在模型中支持 Google 搜索的工具，由 Google 提供支持。
    CodeExecution:
      description: |-
        执行模型生成的代码并自动将结果返回给模型的工具。

        另请参阅 `ExecutableCode` 和 `CodeExecutionResult`，它们仅在使用此工具时生成。
      type: object
    ComputerUse:
      properties:
        enablePromptInjectionDetection:
          type: boolean
          description: 可选。是否对计算机使用请求启用提示词注入检测。
        environment:
          type: string
          enum:
            - ENVIRONMENT_UNSPECIFIED
            - ENVIRONMENT_BROWSER
            - ENVIRONMENT_MOBILE
            - ENVIRONMENT_DESKTOP
          description: |-
            必填。所操作的环境。

            **可选值：**
            - `ENVIRONMENT_UNSPECIFIED`：默认为浏览器。
            - `ENVIRONMENT_BROWSER`：在网页浏览器中操作。
            - `ENVIRONMENT_MOBILE`：在移动环境中操作。
            - `ENVIRONMENT_DESKTOP`：在桌面环境中操作。
        disabledSafetyPolicies:
          description: |-
            可选。为计算机使用禁用的安全策略。

            **可选值：**
            - `SAFETY_POLICY_UNSPECIFIED`：未指定的安全策略。
            - `FINANCIAL_TRANSACTIONS`：金融交易安全策略。
            - `SENSITIVE_DATA_MODIFICATION`：敏感数据修改安全策略。
            - `COMMUNICATION_TOOL`：通信工具（例如 Gmail、Chat、Meet）安全策略。
            - `ACCOUNT_CREATION`：账号创建安全策略。
            - `DATA_MODIFICATION`：数据修改安全策略。
            - `USER_CONSENT_MANAGEMENT`：用户同意管理安全策略。
            - `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: |-
            可选。默认情况下，预定义函数会包含在最终的模型调用中。可以显式排除其中部分函数，使其不被自动包含。这有两个用途：
            1. 使用更受限或不同的操作空间。
            2. 改进预定义函数的定义或指令。
          items:
            type: string
      type: object
      required:
        - environment
      description: 计算机使用工具类型。
    GoogleMaps:
      properties:
        enableWidget:
          description: >-
            可选。是否在响应的 GroundingMetadata 中返回 widget 上下文 Token。开发者可以使用该 Token 渲染
            Google 地图 widget，展示与模型在响应中引用的地点相关的地理空间上下文。
          type: boolean
      type: object
      description: 为用户查询提供地理空间上下文的 GoogleMaps 工具。
    FunctionDeclaration:
      required:
        - name
        - description
      description: >-
        按照 [OpenAPI 3.03
        规范](https://spec.openapis.org/oas/v3.0.3)定义的函数声明的结构化表示，包含函数名称和参数。FunctionDeclaration
        表示一段代码，模型可将其作为 `Tool` 使用，并由客户端执行。
      properties:
        parametersJsonSchema:
          description: |-
            可选。以 JSON Schema 格式描述函数的参数。该 Schema 必须描述一个对象，其属性即为函数的参数。例如：

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

            此字段与 `parameters` 互斥。
        description:
          type: string
          description: 必填。函数的简要描述。
        responseJsonSchema:
          description: |-
            可选。以 JSON Schema 格式描述此函数的输出。该 Schema 指定的值即为函数的响应值。

            此字段与 `response` 互斥。
        behavior:
          description: |-
            可选。指定函数的 Behavior。目前仅 BidiGenerateContent 方法支持。

            **可选值：**
            - `UNSPECIFIED`：此值未使用。
            - `BLOCKING`：设置后，系统将等待收到函数响应后再继续对话。
            - `NON_BLOCKING`：设置后，系统不会等待函数响应，而是在保持用户与模型对话的同时，在函数响应可用时尝试处理它们。
          enum:
            - UNSPECIFIED
            - BLOCKING
            - NON_BLOCKING
          type: string
        name:
          description: 必填。函数名称。只能包含 a-z、A-Z、0-9，或下划线、冒号、点和短横线，最大长度为 128。
          type: string
        response:
          description: >-
            可选。以 JSON Schema 格式描述此函数的输出，对应 Open API 3.03 Response Object。该
            Schema 定义函数响应值所使用的类型。
          allOf:
            - $ref: '#/components/schemas/Schema'
        parameters:
          allOf:
            - $ref: '#/components/schemas/Schema'
          description: >-
            可选。描述此函数的参数，对应 Open API 3.03 Parameter Object。字符串
            Key：参数名称，区分大小写。Schema Value：定义该参数所用类型的 Schema。
      type: object
    UrlContext:
      type: object
      description: 支持 URL 上下文检索的工具。
    McpServer:
      properties:
        streamableHttpTransport:
          description: 可流式传输 HTTP 请求和响应的传输方式。
          allOf:
            - $ref: '#/components/schemas/StreamableHttpTransport'
        name:
          type: string
          description: MCPServer 的名称。
      description: MCPServer 是模型可以调用以执行操作的服务器，它实现了 MCP 协议。
      type: object
    FunctionCallingConfig:
      type: object
      properties:
        allowedFunctionNames:
          type: array
          items:
            type: string
          description: >-
            可选。函数名称集合，提供后会限制模型可调用的函数。


            仅应在 Mode 为 ANY 或 VALIDATED 时设置。函数名称应与 [FunctionDeclaration.name]
            匹配。设置后，模型只会从允许的函数名称中预测函数调用。
        mode:
          description: >-
            可选。指定函数调用的执行模式。未指定时默认为 AUTO。


            **可选值：**

            - `MODE_UNSPECIFIED`：未指定的函数调用模式。不应使用此值。

            - `AUTO`：默认模型行为，由模型决定预测函数调用还是自然语言响应。

            - `ANY`：模型被限制为始终只预测函数调用。如果设置了 "allowed_function_names"，预测的函数调用将限定为
            "allowed_function_names" 中的任意一个；否则将是所提供 "function_declarations"
            中的任意一个。

            - `NONE`：模型不会预测任何函数调用。模型行为与未传入任何函数声明时相同。

            - `VALIDATED`：由模型决定预测函数调用还是自然语言响应，但会通过约束解码校验函数调用。如果设置了
            "allowed_function_names"，预测的函数调用将限定为 "allowed_function_names"
            中的任意一个；否则将是所提供 "function_declarations" 中的任意一个。
          enum:
            - MODE_UNSPECIFIED
            - AUTO
            - ANY
            - NONE
            - VALIDATED
          type: string
      description: 用于指定函数调用行为的配置。
    RetrievalConfig:
      type: object
      properties:
        latLng:
          allOf:
            - $ref: '#/components/schemas/LatLng'
          description: 可选。用户的位置。
        languageCode:
          description: >-
            可选。用户的语言代码，即内容的语言代码。请使用
            [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) 定义的语言标签。
          type: string
      description: 检索配置。
    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: >-
        **可选值：**

        - `HARM_CATEGORY_UNSPECIFIED`：未指定类别。

        - `HARM_CATEGORY_DEROGATORY`：**PaLM** - 针对身份和/或受保护属性的负面或有害评论。已弃用：仅限 PaLM
        的类别，Gemini 模型不支持。

        - `HARM_CATEGORY_TOXICITY`：**PaLM** - 粗鲁、无礼或亵渎性的内容。已弃用：仅限 PaLM
        的类别，Gemini 模型不支持。

        - `HARM_CATEGORY_VIOLENCE`：**PaLM** - 描述针对个人或群体的暴力场景，或对血腥内容的一般性描述。已弃用：仅限
        PaLM 的类别，Gemini 模型不支持。

        - `HARM_CATEGORY_SEXUAL`：**PaLM** - 包含性行为相关内容或其他淫秽内容。已弃用：仅限 PaLM
        的类别，Gemini 模型不支持。

        - `HARM_CATEGORY_MEDICAL`：**PaLM** - 宣扬未经核实的医疗建议。已弃用：仅限 PaLM 的类别，Gemini
        模型不支持。

        - `HARM_CATEGORY_DANGEROUS`：**PaLM** - 宣扬、协助或鼓励有害行为的危险内容。已弃用：仅限 PaLM
        的类别，Gemini 模型不支持。

        - `HARM_CATEGORY_HARASSMENT`：**Gemini** - 骚扰内容。

        - `HARM_CATEGORY_HATE_SPEECH`：**Gemini** - 仇恨言论和内容。

        - `HARM_CATEGORY_SEXUALLY_EXPLICIT`：**Gemini** - 色情露骨内容。

        - `HARM_CATEGORY_DANGEROUS_CONTENT`：**Gemini** - 危险内容。

        - `HARM_CATEGORY_CIVIC_INTEGRITY`：**Gemini** - 可能被用于损害公民诚信的内容。已弃用：请改用
        enable_enhanced_civic_answers。

        - `HARM_CATEGORY_JAILBREAK`：**Gemini** - 试图绕过或破坏模型安全准则的提示词（越狱尝试）。
    TranslationConfig:
      type: object
      required:
        - targetLanguageCode
      description: 翻译功能的配置。
      properties:
        echoTargetLanguage:
          description: 可选。若为 true，当说出的是目标语言时模型也会生成音频，即复述输入内容；若为 false，则不会为目标语言生成音频。
          type: boolean
        targetLanguageCode:
          type: string
          description: 必填。翻译的目标语言。支持的值为 BCP-47 语言代码（例如 "en"、"es"、"fr"）。
    ThinkingConfig:
      properties:
        thinkingLevel:
          enum:
            - THINKING_LEVEL_UNSPECIFIED
            - MINIMAL
            - LOW
            - MEDIUM
            - HIGH
            - XHIGH
          type: string
          description: >-
            可选。控制模型在生成响应前内部推理过程的最大深度。默认值取决于模型。详见[思考等级指南](https://aistudio.google.com/docs/thinking#thinking-levels)。推荐用于
            Gemini 3 及更高版本的模型，用于更早的模型会导致错误。


            **可选值：**

            - `THINKING_LEVEL_UNSPECIFIED`：默认值。

            - `MINIMAL`：几乎不进行思考。

            - `LOW`：低思考等级。

            - `MEDIUM`：中思考等级。

            - `HIGH`：高思考等级。

            - `XHIGH`：超高思考等级。
        includeThoughts:
          type: boolean
          description: 是否在响应中包含思考内容。若为 true，仅在有可用思考内容时返回。
        thinkingBudget:
          type: integer
          description: 模型应生成的思考 Token 数量。
          format: int32
      type: object
      description: 思考功能的配置。
    ImageConfig:
      type: object
      description: 图像生成功能的配置。
      properties:
        imageSize:
          type: string
          description: 可选。指定生成图像的尺寸。支持的值为 `512`、`1K`、`2K`、`4K`。未指定时，模型将使用默认值 `1K`。
        aspectRatio:
          description: >-
            可选。要生成图像的宽高比。支持的宽高比：`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`
            或 `21:9`。


            未指定时，模型会根据提供的参考图像选择默认宽高比。
          type: string
    Schema:
      description: >-
        `Schema` 对象用于定义输入和输出数据类型。这些类型可以是对象，也可以是基本类型和数组。它表示 [OpenAPI 3.0 schema
        对象](https://spec.openapis.org/oas/v3.0.3#schema)的一个子集。
      required:
        - type
      properties:
        maxProperties:
          format: int64
          type: string
          description: 可选。Type.OBJECT 的最多属性数量。
        description:
          description: 可选。参数的简要描述，可以包含用法示例。参数描述可以使用 Markdown 格式。
          type: string
        propertyOrdering:
          items:
            type: string
          description: 可选。属性的顺序。并非 OpenAPI 规范中的标准字段，用于确定响应中属性的顺序。
          type: array
        default:
          description: >-
            可选。字段的默认值。按照 JSON Schema
            规范，此字段供文档生成工具使用，不影响校验。因此这里接受但会忽略该字段，以免开发者发送带 `default` 字段的 Schema
            时收到未知字段错误。
        maxLength:
          format: int64
          type: string
          description: 可选。Type.STRING 的最大长度
        minProperties:
          type: string
          format: int64
          description: 可选。Type.OBJECT 的最少属性数量。
        type:
          allOf:
            - $ref: '#/components/schemas/Type'
          description: 必填。数据类型。
        minimum:
          format: double
          type: number
          description: >-
            可选。适用于 INTEGER 和 NUMBER 类型的 Schema 字段。Type.INTEGER 和 Type.NUMBER
            的最小值
        enum:
          items:
            type: string
          type: array
          description: |-
            可选。enum 格式的 Type.STRING 元素的可能取值。例如可以这样定义枚举 Direction：
            {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
        example:
          description: 可选。对象的示例。仅当该对象为根对象时才会填充。
        minItems:
          type: string
          description: 可选。Type.ARRAY 的最少元素数量。
          format: int64
        maxItems:
          type: string
          description: 可选。Type.ARRAY 的最大元素数量。
          format: int64
        anyOf:
          items:
            $ref: '#/components/schemas/Schema'
          description: 可选。该值应通过列表中任一（一个或多个）子 Schema 的校验。
          type: array
        format:
          description: 可选。数据的格式。可以填写任意值，但大多数值不会触发任何特殊功能。
          type: string
        maximum:
          description: 可选。Type.INTEGER 和 Type.NUMBER 的最大值
          format: double
          type: number
        properties:
          additionalProperties:
            $ref: '#/components/schemas/Schema'
          type: object
          description: 可选。Type.OBJECT 的属性。
        title:
          type: string
          description: 可选。Schema 的标题。
        items:
          description: 可选。Type.ARRAY 元素的 Schema。
          allOf:
            - $ref: '#/components/schemas/Schema'
        required:
          items:
            type: string
          description: 可选。Type.OBJECT 的必需属性。
          type: array
        minLength:
          type: string
          format: int64
          description: 可选。适用于 STRING 类型的 Schema 字段。Type.STRING 的最小长度
        nullable:
          description: 可选。表示该值是否可以为 null。
          type: boolean
        pattern:
          description: 可选。Type.STRING 的模式，用于将字符串限制为符合某个正则表达式。
          type: string
      type: object
    SpeechConfig:
      type: object
      properties:
        languageCode:
          description: >-
            可选。用户为应用配置的 IETF
            [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
            语言代码，用于语音识别和语音合成。


            有效值为：`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`
            和 `th-TH`。
          type: string
        voiceConfig:
          allOf:
            - $ref: '#/components/schemas/VoiceConfig'
          description: 单一音色输出时的配置。
        multiSpeakerVoiceConfig:
          description: 可选。多说话人设置的配置。与 voice_config 字段互斥。
          allOf:
            - $ref: '#/components/schemas/MultiSpeakerVoiceConfig'
      description: 语音生成与转写的配置。
    ResponseFormatConfig:
      description: 响应输出格式的配置。这是一个扁平对象，每个可选子字段配置一种特定的输出模态。
      type: object
      properties:
        image:
          description: 可选。图像输出格式配置。
          allOf:
            - $ref: '#/components/schemas/ImageResponseFormat'
        audio:
          allOf:
            - $ref: '#/components/schemas/AudioResponseFormat'
          description: 可选。音频输出格式配置。
        text:
          description: 可选。文本输出格式配置。
          allOf:
            - $ref: '#/components/schemas/TextResponseFormat'
    AudioTranscriptionConfig:
      description: 音频转写配置。
      type: object
      properties:
        customVocabulary:
          type: array
          description: 可选。自定义词汇短语列表，使语音识别模型倾向于识别特定术语（产品名称、专有名词、行业术语）。
          items:
            type: string
        diarization:
          description: 可选。配置说话人分离。
          type: boolean
        languageHints:
          description: 可选。指定音频中的一种或多种语言。
          deprecated: true
          allOf:
            - $ref: '#/components/schemas/LanguageHints'
        languageAuto:
          allOf:
            - $ref: '#/components/schemas/LanguageAuto'
          deprecated: true
          description: 可选。模型将自动检测语言。
        sourceText:
          type: string
          description: >-
            可选。要通过语音指令编辑或改写的源文本。在 `SMART`
            模式下提供时，模型会结合此文本评估音频输入，并在候选响应中输出完整的替换文本，而不是在其后追加。
        wordTimestamp:
          description: 可选。配置词级时间戳生成。
          type: boolean
        languageCodes:
          items:
            type: string
          description: 可选。BCP-47 语言代码，提示音频中可能出现的语言。省略或为空时，默认自动检测语言。
          type: array
        adaptationPhrases:
          items:
            type: string
          type: array
          description: 可选。用于语音自适应的短语列表，使 ASR 模型倾向于更好地识别这些特定术语。
          deprecated: true
        mode:
          type: string
          description: >-
            可选。配置转写模式。支持的值：`VERBATIM`、`SMART`。未指定时默认为 `VERBATIM` 转写。在 `SMART`
            模式下，模型会去除不流畅内容（删除填充词、重复和错误开头），进行轻度语法清理和自动格式化（段落、项目符号、编号列表），并处理少量用户修改（行内自我更正）。时间戳和说话人分离与
            `SMART` 模式不兼容。


            **可选值：**

            - `MODE_UNSPECIFIED`：未指定的转写模式。

            - `VERBATIM`：逐字转写模式。

            - `SMART`：智能转写模式。
          enum:
            - MODE_UNSPECIFIED
            - VERBATIM
            - SMART
    Part:
      type: object
      properties:
        toolResponse:
          description: 服务端 `ToolCall` 执行的输出。此字段由客户端填充，内容为执行对应 `ToolCall` 的结果。
          allOf:
            - $ref: '#/components/schemas/ToolResponse'
        executableCode:
          description: 模型生成的、用于执行的代码。
          allOf:
            - $ref: '#/components/schemas/ExecutableCode'
        speechMetadata:
          description: 可选。应用于文本部分的元数据，用于自定义其朗读或合成方式，例如指定说话人身份或说话风格。
          allOf:
            - $ref: '#/components/schemas/SpeechMetadata'
        audioMetadata:
          description: 可选。音频元数据。仅当音频数据在 inline_data 或 file_data 中提供时才应指定此元数据。
          allOf:
            - $ref: '#/components/schemas/AudioMetadata'
        audioTranscription:
          description: 可选。音频（输入或输出）转写。仅当此 Part 包含音频数据时才会设置。
          allOf:
            - $ref: '#/components/schemas/AudioTranscription'
        inlineData:
          description: 内联媒体字节。
          allOf:
            - $ref: '#/components/schemas/Blob'
        spreadsheetMetadata:
          allOf:
            - $ref: '#/components/schemas/SpreadsheetMetadata'
          description: 可选。电子表格元数据。仅当电子表格数据在 inline_data 或 file_data 中提供时才应指定此元数据。
        partMetadata:
          type: object
          additionalProperties:
            description: 对象的属性。
          description: >-
            与 Part 关联的自定义元数据。使用 genai.Part 作为内容表示的智能体可能需要跟踪额外信息，例如 Part
            来源的文件名或来源名称，或用于复用多个 Part 流的方式。
        text:
          type: string
          description: 内联文本。
        thoughtSignature:
          format: byte
          description: 可选。思考内容的不透明签名，以便在后续请求中复用。
          type: string
        codeExecutionResult:
          description: 执行 `ExecutableCode` 的结果。
          allOf:
            - $ref: '#/components/schemas/CodeExecutionResult'
        thought:
          description: 可选。表示该部分是否为模型的思考内容。
          type: boolean
        functionCall:
          allOf:
            - $ref: '#/components/schemas/FunctionCall'
          description: 模型返回的预测 `FunctionCall`，包含表示 `FunctionDeclaration.name` 的字符串以及参数及其值。
        mediaProcessing:
          type: string
          description: >-
            可选。模型为理解该部分媒体而采用的处理方式。仅对视频部分（视频 MIME 类型的 `inline_data` 或
            `file_data`）有意义，非视频部分会忽略此字段。


            **可选值：**

            - `MEDIA_PROCESSING_UNSPECIFIED`：默认为模型特定的处理方式。

            - `STATIC`：固定帧率抽帧，所有帧都放入上下文。

            - `AGENTIC`：由模型驱动的动态浏览，推荐用于大多数场景。
          enum:
            - MEDIA_PROCESSING_UNSPECIFIED
            - STATIC
            - AGENTIC
        videoMetadata:
          allOf:
            - $ref: '#/components/schemas/VideoMetadata'
          description: 可选。视频元数据。仅当视频数据在 inline_data 或 file_data 中提供时才应指定此元数据。
        fileData:
          allOf:
            - $ref: '#/components/schemas/FileData'
          description: 基于 URI 的数据。
        mediaResolution:
          allOf:
            - $ref: '#/components/schemas/V1mainMediaResolution'
          description: 可选。输入媒体的媒体分辨率。
        documentMetadata:
          description: 可选。文档元数据。仅当文档数据在 inline_data 或 file_data 中提供时才应指定此元数据。
          allOf:
            - $ref: '#/components/schemas/DocumentMetadata'
        functionResponse:
          description: >-
            `FunctionCall` 的结果输出，包含表示 `FunctionDeclaration.name`
            的字符串，以及包含函数任意输出的结构化 JSON 对象，用作模型的上下文。
          allOf:
            - $ref: '#/components/schemas/FunctionResponse'
        toolCall:
          allOf:
            - $ref: '#/components/schemas/ToolCall'
          description: 服务端工具调用。当模型预测应在服务端执行的工具调用时填充此字段。客户端应将此消息原样回传给 API。
      description: |-
        一种包含媒体的数据类型，属于多部分 `Content` 消息的一部分。

        `Part` 由带有关联数据类型的数据组成。一个 `Part` 只能包含 `Part.data` 中接受的一种类型。

        如果 `inline_data` 字段填充的是原始字节，`Part` 必须具有固定的 IANA MIME 类型，用于标识媒体的类型和子类型。
    SafetyRating:
      required:
        - category
        - probability
      description: |-
        一段内容的安全评级。

        安全评级包含一段内容的危害类别以及该类别下的危害概率等级。内容会在多个危害类别上进行安全分类，此处包含危害分类的概率。
      type: object
      properties:
        category:
          allOf:
            - $ref: '#/components/schemas/HarmCategory'
          description: 必填。此评级的类别。
        probability:
          type: string
          description: |-
            必填。此内容的危害概率。

            **可选值：**
            - `HARM_PROBABILITY_UNSPECIFIED`：未指定概率。
            - `NEGLIGIBLE`：内容不安全的可能性可忽略不计。
            - `LOW`：内容不安全的可能性较低。
            - `MEDIUM`：内容不安全的可能性中等。
            - `HIGH`：内容不安全的可能性较高。
          enum:
            - HARM_PROBABILITY_UNSPECIFIED
            - NEGLIGIBLE
            - LOW
            - MEDIUM
            - HIGH
        blocked:
          type: boolean
          description: 此内容是否因该评级而被拦截？
    GroundingMetadata:
      description: 启用接地时返回给客户端的元数据。
      properties:
        googleMapsWidgetContextToken:
          description: >-
            可选。Google 地图 widget 上下文 Token 的资源名称，可与 PlacesContextElement widget
            配合使用以渲染上下文数据。仅在启用 Google 地图接地时填充。
          type: string
        searchEntryPoint:
          description: 可选。后续网页搜索的 Google 搜索入口。
          allOf:
            - $ref: '#/components/schemas/SearchEntryPoint'
        groundingChunks:
          items:
            $ref: '#/components/schemas/GroundingChunk'
          description: 从指定接地来源检索到的支撑引用列表。流式传输时，仅包含此前响应的接地元数据中尚未包含的接地片段。
          type: array
        webSearchQueries:
          description: 用于后续网页搜索的网页搜索查询。
          items:
            type: string
          type: array
        imageSearchQueries:
          type: array
          description: 用于接地的图片搜索查询。
          items:
            type: string
        groundingSupports:
          description: 接地支撑列表。
          items:
            $ref: >-
              #/components/schemas/GoogleAiGenerativelanguageV1betaGroundingSupport
          type: array
        retrievalMetadata:
          allOf:
            - $ref: '#/components/schemas/RetrievalMetadata'
          description: 接地流程中与检索相关的元数据。
      type: object
    LogprobsResult:
      type: object
      description: 对数概率结果
      properties:
        topCandidates:
          type: array
          description: 长度 = 解码步骤总数。
          items:
            $ref: '#/components/schemas/TopCandidates'
        chosenCandidates:
          type: array
          items:
            $ref: '#/components/schemas/LogprobsResultCandidate'
          description: 长度 = 解码步骤总数。被选中的候选不一定在 top_candidates 中。
        logProbabilitySum:
          description: 所有 Token 的对数概率之和。
          format: float
          type: number
    UrlContextMetadata:
      type: object
      properties:
        urlMetadata:
          type: array
          items:
            $ref: '#/components/schemas/UrlMetadata'
          description: URL 上下文列表。
      description: URL 上下文检索工具相关的元数据。
    GroundingAttribution:
      description: 为回答提供内容的来源归属。
      type: object
      properties:
        sourceId:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/AttributionSourceId'
          description: 仅输出。为此归属提供内容的来源标识符。
        content:
          description: 构成此归属的接地来源内容。
          allOf:
            - $ref: '#/components/schemas/Content'
    CitationMetadata:
      type: object
      properties:
        citationSources:
          items:
            $ref: '#/components/schemas/CitationSource'
          type: array
          description: 特定响应的来源引用。
      description: 一段内容的来源归属集合。
    ModalityTokenCount:
      type: object
      properties:
        modality:
          allOf:
            - $ref: '#/components/schemas/GenerativeLanguageModality'
          description: 与此 Token 计数关联的模态。
        tokenCount:
          description: Token 数量。
          format: int32
          type: integer
      description: 表示单一模态的 Token 计数信息。
    ModelStage:
      enum:
        - MODEL_STAGE_UNSPECIFIED
        - UNSTABLE_EXPERIMENTAL
        - EXPERIMENTAL
        - PREVIEW
        - STABLE
        - LEGACY
        - DEPRECATED
        - RETIRED
      type: string
      description: |-
        **可选值：**
        - `MODEL_STAGE_UNSPECIFIED`：未指定模型阶段。
        - `UNSTABLE_EXPERIMENTAL`：底层模型会经历大量调优。
        - `EXPERIMENTAL`：处于此阶段的模型仅供实验使用。
        - `PREVIEW`：处于此阶段的模型比实验模型更成熟。
        - `STABLE`：处于此阶段的模型被视为稳定，可用于生产环境。
        - `LEGACY`：处于此阶段的模型将在近期弃用，仅现有客户可以使用。
        - `DEPRECATED`：处于此阶段的模型已弃用，无法使用。
        - `RETIRED`：处于此阶段的模型已下线，无法使用。
    DynamicRetrievalConfig:
      description: 描述自定义动态检索的选项。
      properties:
        dynamicThreshold:
          description: 动态检索中使用的阈值。未设置时使用系统默认值。
          type: number
          format: float
        mode:
          description: |-
            动态检索中使用的预测器模式。

            **可选值：**
            - `MODE_UNSPECIFIED`：始终触发检索。
            - `MODE_DYNAMIC`：仅在系统判断有必要时执行检索。
          type: string
          enum:
            - MODE_UNSPECIFIED
            - MODE_DYNAMIC
      type: object
    SearchTypes:
      type: object
      description: GoogleSearch 工具上可启用的不同搜索类型。
      properties:
        imageSearch:
          allOf:
            - $ref: '#/components/schemas/ImageSearch'
          description: 可选。启用图片搜索，返回图片字节。
        webSearch:
          description: 可选。启用网页搜索，仅返回文本结果。
          allOf:
            - $ref: '#/components/schemas/WebSearch'
    Interval:
      description: |-
        表示一个时间区间，编码为 Timestamp 起点（包含）和 Timestamp 终点（不包含）。

        起点必须小于或等于终点。起点等于终点时，区间为空（不匹配任何时间）。起点和终点均未指定时，区间匹配任意时间。
      type: object
      properties:
        startTime:
          description: |-
            可选。区间的起点（包含）。

            如果指定，匹配此区间的 Timestamp 必须等于或晚于起点。
          type: string
          format: date-time
        endTime:
          description: |-
            可选。区间的终点（不包含）。

            如果指定，匹配此区间的 Timestamp 必须早于终点。
          format: date-time
          type: string
    StreamableHttpTransport:
      description: 可流式传输 HTTP 请求和响应的传输方式。
      type: object
      properties:
        terminateOnClose:
          description: 传输关闭时是否同时关闭客户端会话。
          type: boolean
        headers:
          additionalProperties:
            type: string
          type: object
          description: 可选：根据需要设置认证请求头、超时等字段。
        timeout:
          type: string
          format: google-duration
          description: 常规操作的 HTTP 超时时间。
        url:
          description: MCPServer 端点的完整 URL。示例："https://api.example.com/mcp"
          type: string
        sseReadTimeout:
          type: string
          description: SSE 读取操作的超时时间。
          format: google-duration
    LatLng:
      properties:
        latitude:
          description: 纬度（单位为度），必须在 [-90.0, +90.0] 范围内。
          type: number
          format: double
        longitude:
          format: double
          type: number
          description: 经度（单位为度），必须在 [-180.0, +180.0] 范围内。
      type: object
      description: >-
        表示一对纬度/经度的对象，以一对 double 值分别表示纬度和经度（单位为度）。除非另有说明，此对象必须符合 WGS84
        标准，且取值必须在规范化范围内。
    Type:
      enum:
        - TYPE_UNSPECIFIED
        - STRING
        - NUMBER
        - INTEGER
        - BOOLEAN
        - ARRAY
        - OBJECT
        - 'NULL'
      type: string
      description: |-
        **可选值：**
        - `TYPE_UNSPECIFIED`：未指定，不应使用。
        - `STRING`：字符串类型。
        - `NUMBER`：数字类型。
        - `INTEGER`：整数类型。
        - `BOOLEAN`：布尔类型。
        - `ARRAY`：数组类型。
        - `OBJECT`：对象类型。
        - `NULL`：空类型。
    VoiceConfig:
      properties:
        prebuiltVoiceConfig:
          description: 要使用的预置音色配置。
          allOf:
            - $ref: '#/components/schemas/PrebuiltVoiceConfig'
        voice:
          type: string
          description: |-
            可选。用于合成的说话人标识符。支持的格式：

            *   预置音色的说话人名称（例如 `Orus` 或 `Kore`）。
            *   已存储音色的音色 ID（例如 `voice_xxx`）。
            *   音色复刻密钥（例如 `voicekey_xxx`）。
      description: 要使用的音色配置。
      type: object
    MultiSpeakerVoiceConfig:
      properties:
        speakerVoiceConfigs:
          items:
            $ref: '#/components/schemas/SpeakerVoiceConfig'
          description: 必填。所有已启用的说话人音色。
          type: array
      type: object
      description: 多说话人设置的配置。
      required:
        - speakerVoiceConfigs
    ImageResponseFormat:
      description: 图像输出格式的配置。
      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: |-
            可选。图像输出的尺寸。

            **可选值：**
            - `IMAGE_SIZE_UNSPECIFIED`：默认值。此值未使用。
            - `IMAGE_SIZE_FIVE_TWELVE`：512px 图像尺寸。
            - `IMAGE_SIZE_ONE_K`：1K 图像尺寸。
            - `IMAGE_SIZE_TWO_K`：2K 图像尺寸。
            - `IMAGE_SIZE_FOUR_K`：4K 图像尺寸。
          type: string
        mimeType:
          enum:
            - MIME_TYPE_UNSPECIFIED
            - IMAGE_JPEG
          type: string
          description: |-
            可选。图像输出的 MIME 类型。

            **可选值：**
            - `MIME_TYPE_UNSPECIFIED`：默认值。此值未使用。
            - `IMAGE_JPEG`：JPEG 图像格式。
        aspectRatio:
          type: string
          description: |-
            可选。图像输出的宽高比。

            **可选值：**
            - `ASPECT_RATIO_UNSPECIFIED`：默认值。此值未使用。
            - `ASPECT_RATIO_ONE_BY_ONE`：1:1 宽高比。
            - `ASPECT_RATIO_TWO_BY_THREE`：2:3 宽高比。
            - `ASPECT_RATIO_THREE_BY_TWO`：3:2 宽高比。
            - `ASPECT_RATIO_THREE_BY_FOUR`：3:4 宽高比。
            - `ASPECT_RATIO_FOUR_BY_THREE`：4:3 宽高比。
            - `ASPECT_RATIO_FOUR_BY_FIVE`：4:5 宽高比。
            - `ASPECT_RATIO_FIVE_BY_FOUR`：5:4 宽高比。
            - `ASPECT_RATIO_NINE_BY_SIXTEEN`：9:16 宽高比。
            - `ASPECT_RATIO_SIXTEEN_BY_NINE`：16:9 宽高比。
            - `ASPECT_RATIO_TWENTY_ONE_BY_NINE`：21:9 宽高比。
            - `ASPECT_RATIO_ONE_BY_EIGHT`：1:8 宽高比。
            - `ASPECT_RATIO_EIGHT_BY_ONE`：8:1 宽高比。
            - `ASPECT_RATIO_ONE_BY_FOUR`：1:4 宽高比。
            - `ASPECT_RATIO_FOUR_BY_ONE`：4:1 宽高比。
          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: |-
            可选。图像输出的交付方式。

            **可选值：**
            - `DELIVERY_UNSPECIFIED`：默认值。此值未使用。
            - `INLINE`：图像数据以内联方式在响应中返回。
            - `URI`：图像数据以 URI 形式返回。
          enum:
            - DELIVERY_UNSPECIFIED
            - INLINE
            - URI
    AudioResponseFormat:
      properties:
        delivery:
          type: string
          description: |-
            可选。音频输出的交付方式。

            **可选值：**
            - `DELIVERY_UNSPECIFIED`：默认值。此值未使用。
            - `INLINE`：音频数据以内联方式在响应中返回。
            - `URI`：音频数据以 URI 形式返回。
          enum:
            - DELIVERY_UNSPECIFIED
            - INLINE
            - URI
        bitRate:
          type: integer
          description: 可选。比特率，单位为比特每秒（bps）。仅适用于压缩格式（MP3、Opus）。
          format: int32
        sampleRate:
          format: int32
          description: 可选。采样率（Hz）。
          type: integer
        mimeType:
          description: |-
            可选。音频输出的 MIME 类型。

            **可选值：**
            - `MIME_TYPE_UNSPECIFIED`：默认值。此值未使用。
            - `AUDIO_MP3`：MP3 音频格式。
            - `AUDIO_OGG_OPUS`：OGG Opus 音频格式。
            - `AUDIO_L16`：原始 PCM（L16）音频格式。
            - `AUDIO_WAV`：WAV 音频格式。
            - `AUDIO_ALAW`：A-law 音频格式。
            - `AUDIO_MULAW`：Mu-law 音频格式。
          type: string
          enum:
            - MIME_TYPE_UNSPECIFIED
            - AUDIO_MP3
            - AUDIO_OGG_OPUS
            - AUDIO_L16
            - AUDIO_WAV
            - AUDIO_ALAW
            - AUDIO_MULAW
      description: 音频输出格式的配置。
      type: object
    TextResponseFormat:
      properties:
        schema:
          description: 可选。输出应遵循的 JSON Schema。仅在 mime_type 为 APPLICATION_JSON 时适用。
        mimeType:
          type: string
          description: |-
            可选。文本输出的 MIME 类型。

            **可选值：**
            - `MIME_TYPE_UNSPECIFIED`：默认值。此值未使用。
            - `APPLICATION_JSON`：JSON 输出格式。
            - `TEXT_PLAIN`：纯文本输出格式。
          enum:
            - MIME_TYPE_UNSPECIFIED
            - APPLICATION_JSON
            - TEXT_PLAIN
      description: 文本输出格式的配置。
      type: object
    LanguageHints:
      description: 向模型提示音频中可能出现的语言。
      type: object
      deprecated: true
      required:
        - languageCodes
      properties:
        languageCodes:
          items:
            type: string
          type: array
          description: 必填。BCP-47 语言代码。
          deprecated: true
    LanguageAuto:
      description: 表示应自动检测音频的语言。
      deprecated: true
      type: object
    ToolResponse:
      required:
        - toolType
      description: >-
        服务端 `ToolCall` 执行的输出。此消息包含由模型发起的 `ToolCall` 所触发的工具调用结果。客户端应在后续轮次中将此
        `ToolResponse` 连同对应的 `ToolCall` 放在 `Content` 消息中回传给 API。
      properties:
        toolType:
          description: 必填。被调用工具的类型，与对应 `ToolCall` 中的 `tool_type` 一致。
          allOf:
            - $ref: '#/components/schemas/V1mainToolType'
        response:
          type: object
          description: 可选。工具响应。
          additionalProperties:
            description: 对象的属性。
        id:
          type: string
          description: 可选。此响应所对应的工具调用标识符。
      type: object
    ExecutableCode:
      description: |-
        模型生成的、用于执行的代码，执行结果会返回给模型。

        仅在使用 `CodeExecution` 工具时生成，此时代码会被自动执行，并同时生成对应的 `CodeExecutionResult`。
      type: object
      properties:
        language:
          type: string
          description: |-
            必填。`code` 的编程语言。

            **可选值：**
            - `LANGUAGE_UNSPECIFIED`：未指定语言。不应使用此值。
            - `PYTHON`：Python >= 3.10，可使用 numpy 和 simpy。Python 为默认语言。
          enum:
            - LANGUAGE_UNSPECIFIED
            - PYTHON
        id:
          type: string
          description: >-
            可选。`ExecutableCode` 部分的唯一标识符。服务器会返回带有相匹配 `id` 的
            `CodeExecutionResult`。
        code:
          description: 必填。要执行的代码。
          type: string
      required:
        - language
        - code
    SpeechMetadata:
      properties:
        style:
          type: string
          description: 可选。语音合成时可选的风格指令。
        speaker:
          type: string
          description: 可选。多说话人合成时可选的说话人名称。
      type: object
      description: '`text` 部分的语音元数据。'
    AudioMetadata:
      properties:
        endOffset:
          description: 可选。音频的结束偏移量，相对于音频流的开头。
          format: google-duration
          type: string
        startOffset:
          type: string
          description: 可选。音频的起始偏移量，相对于音频流的开头。
          format: google-duration
      type: object
      description: >-
        描述输入音频内容的元数据。当 `inline_data` 或 `file_data` 包含音频时，在 `Part.audio_metadata`
        或 `FunctionResponsePart.audio_metadata` 中设置此项，以配置静态音频预处理。
    AudioTranscription:
      type: object
      required:
        - text
      description: >-
        音频部分的转写。对于多说话人音频，每个说话人片段都是一个单独的 Part，各自带有包含 speaker_label 的
        AudioTranscription。
      properties:
        words:
          type: array
          items:
            $ref: '#/components/schemas/WordInfo'
          description: 可选。详细的词级转写及时间信息。设置了 word_timestamp 时才会出现。
        speakerLabel:
          type: string
          description: 可选。标识此音频片段说话人的标签（例如 "spk_1"、"spk_2"）。设置了说话人分离时才会出现。
        text:
          type: string
          description: 必填。此音频片段的转写文本。
    Blob:
      description: |-
        原始媒体字节。

        文本不应以原始字节发送，请使用 'text' 字段。
      properties:
        data:
          description: 媒体格式的原始字节。
          type: string
          format: byte
        mimeType:
          type: string
          description: >-
            源数据的 IANA 标准 MIME 类型。支持的类型示例：

            -
            图像：image/png、image/jpeg、image/jpg、image/webp、image/heic、image/heif、image/gif、image/avif

            - 音频：audio/*、video/audio/s16le、video/audio/wav

            - 视频：video/*

            -
            文本：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

            -
            应用：application/x-javascript、application/x-typescript、application/x-python-code、application/json、application/x-ipynb+json、application/rtf、application/pdf

            更多信息请参阅[支持的文件格式](https://aistudio.google.com/docs/file-input-methods#supported-content-types)。
        displayName:
          description: >-
            可选。指定向模型引用此 blob 时使用的名称（例如 "my_blob.png"）。当 `verbalization_mode` 设为
            `REFERENCE_ONLY` 时，用作 blob 引用标识符。
          type: string
      type: object
    SpreadsheetMetadata:
      properties:
        contentLayers:
          type: array
          items:
            type: string
            enum:
              - CONTENT_LAYER_UNSPECIFIED
              - DATA
              - FORMULAS
              - VISUAL
          description: |-
            可选。要返回的内容层。如果为空，在设置了 SpreadsheetMetadata 时默认为 [DATA, FORMULAS]。

            **可选值：**
            - `CONTENT_LAYER_UNSPECIFIED`：默认值。
            - `DATA`：单元格值、合并单元格和格式。
            - `FORMULAS`：公式表达式及其计算结果。
            - `VISUAL`：工作表的渲染图像。
        visibleCells:
          description: 可选。要提取的单元格范围，使用 A1 表示法（例如 "A1:D10"）。未设置时使用工作表的全部已占用区域。
          type: string
        sheetIndex:
          description: 可选。要提取的工作表索引（从 1 开始，按工作簿中的顺序）。未设置时提取所有工作表。
          format: int32
          type: integer
      type: object
      description: >-
        描述输入电子表格内容的元数据。当 `inline_data` 或 `file_data` 包含电子表格时，在
        `Part.spreadsheet_metadata` 或
        `FunctionResponsePart.spreadsheet_metadata` 中设置此项，以配置静态电子表格预处理。
    CodeExecutionResult:
      properties:
        outcome:
          description: |-
            必填。代码执行的结果。

            **可选值：**
            - `OUTCOME_UNSPECIFIED`：未指定状态。不应使用此值。
            - `OUTCOME_OK`：代码执行成功完成。`output` 包含标准输出（如有）。
            - `OUTCOME_FAILED`：代码执行失败。`output` 包含标准错误和标准输出（如有）。
            - `OUTCOME_DEADLINE_EXCEEDED`：代码执行时间过长，已被取消。可能存在部分 `output`，也可能没有。
          enum:
            - OUTCOME_UNSPECIFIED
            - OUTCOME_OK
            - OUTCOME_FAILED
            - OUTCOME_DEADLINE_EXCEEDED
          type: string
        id:
          description: >-
            可选。此结果所对应的 `ExecutableCode` 部分的标识符。仅当对应的 `ExecutableCode` 带有 ID
            时才会填充。
          type: string
        output:
          type: string
          description: 可选。代码执行成功时包含标准输出，否则包含标准错误或其他描述。
      type: object
      description: |-
        执行 `ExecutableCode` 的结果。

        仅在使用 `CodeExecution` 工具时生成。
      required:
        - outcome
    FunctionCall:
      required:
        - name
      properties:
        name:
          description: 必填。要调用的函数名称。只能包含 a-z、A-Z、0-9，或下划线和短横线，最大长度为 128。
          type: string
        args:
          type: object
          additionalProperties:
            description: 对象的属性。
          description: 可选。JSON 对象格式的函数参数及其值。
        id:
          description: 可选。函数调用的唯一标识符。如果已填充，客户端应执行 `function_call`，并返回带有相匹配 `id` 的响应。
          type: string
      type: object
      description: 模型返回的预测 `FunctionCall`，包含表示 `FunctionDeclaration.name` 的字符串以及参数及其值。
    VideoMetadata:
      type: object
      description: >-
        描述输入视频内容的元数据。当 `inline_data` 或 `file_data` 包含视频时，在 `Part.video_metadata`
        或 `FunctionResponsePart.video_metadata`
        中设置此项，以配置静态视频预处理（例如时间裁剪、帧率、最大帧数或提取的内容层）。
      properties:
        fps:
          description: 可选。发送给模型的视频帧率。未指定时默认为 1.0。fps 取值范围为 (0.0, 24.0]。
          format: double
          type: number
        startOffset:
          description: 可选。视频的起始偏移量。
          format: google-duration
          type: string
        contentLayers:
          items:
            enum:
              - CONTENT_LAYER_UNSPECIFIED
              - FRAMES
              - AUDIO
              - TRANSCRIPT
            type: string
          description: |-
            可选。要返回的内容层。如果为空，默认为 [FRAMES, AUDIO]。

            **可选值：**
            - `CONTENT_LAYER_UNSPECIFIED`：默认值。
            - `FRAMES`：提取视频帧。
            - `AUDIO`：提取音轨。
            - `TRANSCRIPT`：提取音频转写文本。
          type: array
        endOffset:
          type: string
          description: 可选。视频的结束偏移量。
          format: google-duration
    FileData:
      description: 基于 URI 的数据。
      required:
        - fileUri
      properties:
        displayName:
          description: >-
            可选。指定向模型引用此文件时使用的名称（例如 "my_file.pdf"）。当 `verbalization_mode` 设为
            `REFERENCE_ONLY` 时，用作文件引用标识符。
          type: string
        fileUri:
          description: 必填。URI。
          type: string
        mimeType:
          type: string
          description: 可选。源数据的 IANA 标准 MIME 类型。
      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: |-
            给定媒体所使用的 Token 化质量。适用于 Gemini API。

            **可选值：**
            - `MEDIA_RESOLUTION_UNSPECIFIED`：未设置媒体分辨率。
            - `MEDIA_RESOLUTION_LOW`：媒体分辨率设为低。
            - `MEDIA_RESOLUTION_MEDIUM`：媒体分辨率设为中。
            - `MEDIA_RESOLUTION_HIGH`：媒体分辨率设为高。
            - `MEDIA_RESOLUTION_ULTRA_HIGH`：媒体分辨率设为超高。
      description: Token 化所用的媒体分辨率。
    DocumentMetadata:
      properties:
        startPage:
          type: integer
          format: int32
          description: 可选。起始页码（从 1 开始计数，包含该页）。
        endPage:
          type: integer
          description: 可选。结束页码（从 1 开始计数，包含该页）。
          format: int32
        contentLayers:
          type: array
          description: >-
            可选。要返回的内容层。如果为空，在设置了 DocumentMetadata 时默认为 [PAGE_IMAGE]；未设置
            DocumentMetadata 时，使用默认文档处理方式（例如 PDF 返回页面图像）。


            **可选值：**

            - `CONTENT_LAYER_UNSPECIFIED`：默认值。

            - `PAGE_IMAGE`：渲染后的页面图像。

            - `PAGE_TEXT`：提取的页面文本。
          items:
            enum:
              - CONTENT_LAYER_UNSPECIFIED
              - PAGE_IMAGE
              - PAGE_TEXT
            type: string
      type: object
      description: >-
        描述输入文档内容的元数据。当 `inline_data` 或 `file_data` 包含文档时，在
        `Part.document_metadata` 或 `FunctionResponsePart.document_metadata`
        中设置此项，以配置静态文档预处理。
    FunctionResponse:
      description: >-
        `FunctionCall` 的结果输出，包含表示 `FunctionDeclaration.name` 的字符串，以及包含函数任意输出的结构化
        JSON 对象，用作模型的上下文。其中应包含根据模型预测发起的 `FunctionCall` 的结果。
      required:
        - name
        - response
      type: object
      properties:
        response:
          description: >-
            必填。JSON 对象格式的函数响应。调用方可以使用任意符合函数语法的键返回函数输出，例如 "output"、"result"
            等。特别地，如果函数调用执行失败，响应中可以包含 "error" 键，用于向模型返回错误详情。


            可以通过一个只含单个 "$ref" 键的子对象来包含多媒体，该键的值为承载该多媒体的 `FunctionResponsePart` 的
            `inline_data.display_name` 或
            `file_data.display_name`。参见[多模态函数响应](https://aistudio.google.com/docs/function-calling#multimodal)。
          type: object
          additionalProperties:
            description: 对象的属性。
        willContinue:
          description: >-
            可选。表示函数调用仍在继续，还会返回更多响应，从而将函数调用变为生成器。仅适用于 NON_BLOCKING
            函数调用，否则会被忽略。若设为 false，后续响应将不被考虑。允许返回空的 `response` 并设置
            `will_continue=False`，以表示函数调用已结束，这仍可能触发模型生成。若要避免触发生成并结束函数调用，还需将
            `scheduling` 设为 `SILENT`。
          type: boolean
        name:
          description: 必填。要调用的函数名称。只能包含 a-z、A-Z、0-9，或下划线和短横线，最大长度为 128。
          type: string
        parts:
          type: array
          items:
            $ref: '#/components/schemas/FunctionResponsePart'
          description: 可选。构成函数响应的有序 `Parts`。各部分可以具有不同的 IANA MIME 类型。
        id:
          type: string
          description: 可选。此响应所对应的函数调用标识符。由客户端填充，用于匹配对应函数调用的 `id`。
        scheduling:
          description: |-
            可选。指定响应在对话中的调度方式。仅适用于 NON_BLOCKING 函数调用，否则会被忽略。默认为 WHEN_IDLE。

            **可选值：**
            - `SCHEDULING_UNSPECIFIED`：此值未使用。
            - `SILENT`：仅将结果添加到对话上下文，不中断或触发生成。
            - `WHEN_IDLE`：将结果添加到对话上下文，并在不中断正在进行的生成的前提下提示生成输出。
            - `INTERRUPT`：将结果添加到对话上下文，中断正在进行的生成并提示生成输出。
          enum:
            - SCHEDULING_UNSPECIFIED
            - SILENT
            - WHEN_IDLE
            - INTERRUPT
          type: string
    ToolCall:
      type: object
      required:
        - toolType
      description: >-
        模型返回的预测服务端 `ToolCall`。此消息包含模型想要调用的工具的信息。客户端无需执行此 `ToolCall`，而应在后续轮次中将此
        `ToolCall` 连同对应的 `ToolResponse` 放在 `Content` 消息中回传给 API。
      properties:
        id:
          type: string
          description: 可选。工具调用的唯一标识符。服务器会返回带有相匹配 `id` 的工具响应。
        toolType:
          description: 必填。被调用工具的类型。
          allOf:
            - $ref: '#/components/schemas/V1mainToolType'
        args:
          additionalProperties:
            description: 对象的属性。
          description: '可选。工具调用参数。示例：{"arg1" : "value1", "arg2" : "value2" , ...}'
          type: object
        toolName:
          type: string
          description: 可选。被调用工具的名称。
    SearchEntryPoint:
      properties:
        sdkBlob:
          type: string
          format: byte
          description: 可选。Base64 编码的 JSON，表示元组数组。
        renderedContent:
          description: 可选。可嵌入网页或应用 WebView 的网页内容片段。
          type: string
      description: Google 搜索入口。
      type: object
    GroundingChunk:
      description: >-
        `GroundingChunk`
        表示为模型响应提供接地（Grounding）依据的一段支撑证据，可以是来自网页的片段、从文件中检索到的上下文，或来自 Google 地图的信息。
      type: object
      properties:
        image:
          allOf:
            - $ref: '#/components/schemas/Image'
          description: 可选。来自图片搜索的接地片段。
        maps:
          allOf:
            - $ref: '#/components/schemas/Maps'
          description: 可选。来自 Google 地图的接地片段。
        retrievedContext:
          allOf:
            - $ref: '#/components/schemas/RetrievedContext'
          description: 可选。来自文件搜索工具所检索上下文的接地片段。
        web:
          description: 来自网页的接地片段。
          allOf:
            - $ref: '#/components/schemas/Web'
    GoogleAiGenerativelanguageV1betaGroundingSupport:
      properties:
        confidenceScores:
          description: >-
            可选。支撑引用的置信度分数，取值范围 0 到 1，1 表示置信度最高。此列表的长度必须与 grounding_chunk_indices
            相同。
          type: array
          items:
            type: number
            format: float
        segment:
          description: 此支撑所属的内容片段。
          allOf:
            - $ref: '#/components/schemas/GoogleAiGenerativelanguageV1betaSegment'
        renderedParts:
          type: array
          items:
            type: integer
            format: int32
          description: 仅输出。指向候选内容 `parts` 字段的索引，用于指定哪些已渲染部分与此支撑来源关联。
          readOnly: true
        groundingChunkIndices:
          items:
            type: integer
            format: int32
          type: array
          description: >-
            可选。索引列表（指向 `response.candidate.grounding_metadata` 中的
            'grounding_chunk'），用于指定与该陈述关联的引用。例如 [1,3,4] 表示
            grounding_chunk[1]、grounding_chunk[3]、grounding_chunk[4]
            是该陈述所归属的检索内容。如果响应为流式，grounding_chunk_indices
            指的是所有响应中的索引。客户端需负责累积所有响应中的接地片段（并保持相同顺序）。
      type: object
      description: 接地支撑。
    RetrievalMetadata:
      description: 接地流程中与检索相关的元数据。
      properties:
        googleSearchDynamicRetrievalScore:
          type: number
          description: >-
            可选。表示 Google 搜索信息有助于回答提示词的可能性分数。取值范围为 [0, 1]，0 表示可能性最低，1
            表示可能性最高。仅在启用 Google 搜索接地和动态检索时填充此分数，并会与阈值比较以决定是否触发 Google 搜索。
          format: float
      type: object
    TopCandidates:
      type: object
      description: 每个解码步骤中对数概率最高的候选。
      properties:
        candidates:
          description: 按对数概率降序排列。
          type: array
          items:
            $ref: '#/components/schemas/LogprobsResultCandidate'
    LogprobsResultCandidate:
      properties:
        logProbability:
          type: number
          format: float
          description: 候选的对数概率。
        tokenId:
          format: int32
          description: 候选的 Token ID 值。
          type: integer
        token:
          description: 候选的 Token 字符串值。
          type: string
      description: 对数概率 Token 及其分数的候选。
      type: object
    UrlMetadata:
      properties:
        urlRetrievalStatus:
          description: |-
            URL 检索的状态。

            **可选值：**
            - `URL_RETRIEVAL_STATUS_UNSPECIFIED`：默认值。此值未使用。
            - `URL_RETRIEVAL_STATUS_SUCCESS`：URL 检索成功。
            - `URL_RETRIEVAL_STATUS_ERROR`：URL 检索因错误而失败。
            - `URL_RETRIEVAL_STATUS_PAYWALL`：URL 检索失败，因为内容位于付费墙之后。
            - `URL_RETRIEVAL_STATUS_UNSAFE`：URL 检索失败，因为内容不安全。
          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: 工具检索的 URL。
      description: 单次 URL 检索的上下文。
      type: object
    AttributionSourceId:
      description: 为此归属提供内容的来源标识符。
      properties:
        semanticRetrieverChunk:
          allOf:
            - $ref: '#/components/schemas/SemanticRetrieverChunk'
          description: 通过 Semantic Retriever 获取的 `Chunk` 的标识符。
        groundingPassage:
          allOf:
            - $ref: '#/components/schemas/GroundingPassageId'
          description: 内联段落的标识符。
      type: object
    CitationSource:
      properties:
        license:
          type: string
          description: |-
            可选。被归属为该片段来源的 GitHub 项目的许可证。

            代码引用必须提供许可证信息。
        uri:
          description: 可选。被归属为部分文本来源的 URI。
          type: string
        startIndex:
          type: integer
          format: int32
          description: |-
            可选。响应中归属于此来源的片段的起始位置。

            索引表示片段的起点，以字节为单位。
        endIndex:
          type: integer
          format: int32
          description: 可选。被归属片段的结束位置（不包含）。
      type: object
      description: 对特定响应中某一部分内容的来源引用。
    GenerativeLanguageModality:
      enum:
        - MODALITY_UNSPECIFIED
        - TEXT
        - IMAGE
        - VIDEO
        - AUDIO
        - DOCUMENT
      type: string
      description: |-
        **可选值：**
        - `MODALITY_UNSPECIFIED`：未指定模态。
        - `TEXT`：纯文本。
        - `IMAGE`：图像。
        - `VIDEO`：视频。
        - `AUDIO`：音频。
        - `DOCUMENT`：文档，例如 PDF。
    ImageSearch:
      type: object
      description: 用于接地的图片搜索及相关配置。
    WebSearch:
      type: object
      description: 用于接地的标准网页搜索及相关配置。
    PrebuiltVoiceConfig:
      description: 要使用的预置说话人配置。
      properties:
        voiceName:
          type: string
          description: 可选。要使用的预设音色名称。
      type: object
    SpeakerVoiceConfig:
      properties:
        voiceConfig:
          description: 必填。要使用的音色配置。
          allOf:
            - $ref: '#/components/schemas/VoiceConfig'
        speaker:
          type: string
          description: 必填。要使用的说话人名称，应与提示词中的名称一致。
      description: 多说话人设置中单个说话人的配置。
      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: >-
        **可选值：**

        - `TOOL_TYPE_UNSPECIFIED`：未指定的工具类型。

        - `GOOGLE_SEARCH_WEB`：Google 搜索工具，对应
        Tool.google_search.search_types.web_search。

        - `GOOGLE_SEARCH_IMAGE`：图片搜索工具，对应
        Tool.google_search.search_types.image_search。

        - `URL_CONTEXT`：URL 上下文工具，对应 Tool.url_context。

        - `GOOGLE_MAPS`：Google 地图工具，对应 Tool.google_maps。

        - `FILE_SEARCH`：文件搜索工具，对应 Tool.file_search。

        - `MEDIA_PROCESSING`：媒体处理工具类型（例如视频、音频等），对应用于多模态理解的不可见工具，例如
        GOOGLE_UNDERSTANDING_VIDEO。
    WordInfo:
      description: 单个识别词的信息。
      properties:
        word:
          description: 必填。该词的转写文本。
          type: string
        endOffset:
          type: string
          format: google-duration
          description: 可选。该词相对于音频开头的结束时间偏移量。
        startOffset:
          type: string
          description: 可选。该词相对于音频开头的起始时间偏移量。
          format: google-duration
      required:
        - word
      type: object
    FunctionResponsePart:
      type: object
      description: >-
        一种包含媒体的数据类型，属于 `FunctionResponse` 消息的一部分。


        `FunctionResponsePart` 由带有关联数据类型的数据组成。一个 `FunctionResponsePart` 只能包含
        `FunctionResponsePart.data` 中接受的一种类型。


        媒体可以以原始字节（`inline_data`）或 URI（`file_data`）的形式传入，并附带标识媒体类型和子类型的 IANA MIME
        类型。
      properties:
        documentMetadata:
          description: 可选。文档元数据。仅当文档数据在 inline_data 或 file_data 中提供时才应指定此元数据。
          allOf:
            - $ref: '#/components/schemas/DocumentMetadata'
        mediaProcessing:
          type: string
          description: >-
            可选。模型为理解该部分媒体而采用的处理方式。仅对视频部分（视频 MIME 类型的 `inline_data` 或
            `file_data`）有意义，非视频部分会忽略此字段。


            **可选值：**

            - `MEDIA_PROCESSING_UNSPECIFIED`：默认为模型特定的处理方式。

            - `STATIC`：固定帧率抽帧，所有帧都放入上下文。

            - `AGENTIC`：由模型驱动的动态浏览，推荐用于大多数场景。
          enum:
            - MEDIA_PROCESSING_UNSPECIFIED
            - STATIC
            - AGENTIC
        mediaResolution:
          allOf:
            - $ref: '#/components/schemas/V1mainMediaResolution'
          description: 可选。输入媒体的媒体分辨率。
        spreadsheetMetadata:
          allOf:
            - $ref: '#/components/schemas/SpreadsheetMetadata'
          description: 可选。电子表格元数据。仅当电子表格数据在 inline_data 或 file_data 中提供时才应指定此元数据。
        videoMetadata:
          allOf:
            - $ref: '#/components/schemas/VideoMetadata'
          description: 可选。视频元数据。仅当视频数据在 inline_data 或 file_data 中提供时才应指定此元数据。
        fileData:
          description: 基于 URI 的数据。
          allOf:
            - $ref: '#/components/schemas/FunctionResponseFileData'
        audioMetadata:
          description: 可选。音频元数据。仅当音频数据在 inline_data 或 file_data 中提供时才应指定此元数据。
          allOf:
            - $ref: '#/components/schemas/AudioMetadata'
        inlineData:
          allOf:
            - $ref: '#/components/schemas/FunctionResponseBlob'
          description: 内联媒体字节。
    Image:
      type: object
      properties:
        sourceUri:
          type: string
          description: 用于归属的网页 URI。
        imageUri:
          type: string
          description: 图片资源 URL。
        title:
          description: 图片所在网页的标题。
          type: string
        domain:
          description: 图片所在网页的根域名，例如 "example.com"。
          type: string
      description: 来自图片搜索的片段。
    Maps:
      type: object
      properties:
        placeAnswerSources:
          description: 提供 Google 地图中特定地点特征相关答案的来源。
          allOf:
            - $ref: '#/components/schemas/PlaceAnswerSources'
        placeId:
          type: string
          description: 地点 ID，格式为 `places/{place_id}`。用户可以使用此 ID 查找该地点。
        text:
          description: 地点答案的文本描述。
          type: string
        uri:
          type: string
          description: 地点的 URI 引用。
        title:
          type: string
          description: 地点名称。
      description: 来自 Google 地图的接地片段。一个地图片段对应一个地点。
    RetrievedContext:
      description: 来自文件搜索工具所检索上下文的片段。
      type: object
      properties:
        title:
          type: string
          description: 可选。文档标题。
        fileSearchStore:
          type: string
          description: 可选。包含该文档的 `FileSearchStore` 的名称。示例：`fileSearchStores/123`
        mediaId:
          description: >-
            可选。多模态文件搜索结果的媒体 blob
            资源名称。格式：fileSearchStores/{file_search_store_id}/media/{blob_id}
          type: string
        text:
          description: 可选。片段的文本。
          type: string
        pageNumber:
          format: int32
          type: integer
          description: 可选。所检索上下文的页码（如适用）。
        uri:
          type: string
          description: 可选。语义检索文档的 URI 引用。
        customMetadata:
          items:
            $ref: '#/components/schemas/GroundingChunkCustomMetadata'
          type: array
          description: 可选。用户提供的关于所检索上下文的元数据。
    Web:
      description: 来自网页的片段。
      type: object
      properties:
        uri:
          readOnly: true
          type: string
          description: 仅输出。片段的 URI 引用。
        title:
          readOnly: true
          description: 仅输出。片段的标题。
          type: string
    GoogleAiGenerativelanguageV1betaSegment:
      description: 内容片段。
      properties:
        endIndex:
          type: integer
          description: 在给定 Part 中的结束索引，以字节为单位。表示相对 Part 开头的偏移量（不包含），从 0 开始。
          format: int32
        partIndex:
          type: integer
          description: Part 对象在其父 Content 对象中的索引。
          format: int32
        startIndex:
          type: integer
          format: int32
          description: 在给定 Part 中的起始索引，以字节为单位。表示相对 Part 开头的偏移量（包含），从 0 开始。
        text:
          description: 响应中与该片段对应的文本。
          type: string
      type: object
    SemanticRetrieverChunk:
      type: object
      description: >-
        通过 Semantic Retriever 检索到的 `Chunk` 的标识符，该检索器在 `GenerateAnswerRequest`
        中使用 `SemanticRetrieverConfig` 指定。
      properties:
        source:
          description: >-
            仅输出。与请求的 `SemanticRetrieverConfig.source` 匹配的来源名称。示例：`corpora/123` 或
            `corpora/123/documents/abc`
          type: string
          readOnly: true
        chunk:
          readOnly: true
          type: string
          description: 仅输出。包含被归属文本的 `Chunk` 的名称。示例：`corpora/123/documents/abc/chunks/xyz`
    GroundingPassageId:
      type: object
      properties:
        passageId:
          description: 仅输出。与 `GenerateAnswerRequest` 的 `GroundingPassage.id` 匹配的段落 ID。
          type: string
          readOnly: true
        partIndex:
          type: integer
          readOnly: true
          description: 仅输出。该部分在 `GenerateAnswerRequest` 的 `GroundingPassage.content` 中的索引。
          format: int32
      description: '`GroundingPassage` 中某个部分的标识符。'
    FunctionResponseFileData:
      required:
        - fileUri
      type: object
      description: 函数响应中基于 URI 的数据。
      properties:
        displayName:
          description: >-
            可选。文件的显示名称。用于提供标签或文件名以区分文件数据，并可在 `FunctionResponse.response`
            中引用该文件（例如通过 `{"$ref": "DISPLAY_NAME"}`）。
          type: string
        fileUri:
          description: 必填。URI。
          type: string
        mimeType:
          description: >-
            源数据的 IANA 标准 MIME 类型。如果提供了不支持的 MIME
            类型，将返回错误。完整的支持类型列表请参阅[多模态函数响应](https://aistudio.google.com/docs/function-calling#multimodal)和[支持的文件格式](https://aistudio.google.com/docs/file-input-methods#supported-content-types)。
          type: string
    FunctionResponseBlob:
      properties:
        data:
          description: 媒体格式的原始字节。
          type: string
          format: byte
        displayName:
          description: >-
            可选。blob 的显示名称。用于提供标签或文件名以区分各个 blob，并可在 `FunctionResponse.response`
            中引用该 blob（例如通过 `{"$ref": "DISPLAY_NAME"}`）。
          type: string
        mimeType:
          type: string
          description: >-
            源数据的 IANA 标准 MIME 类型。示例：
              - image/png
              - image/jpeg
            如果提供了不支持的 MIME
            类型，将返回错误。完整的支持类型列表请参阅[支持的文件格式](https://aistudio.google.com/docs/file-input-methods#supported-content-types)。
      type: object
      description: |-
        函数响应的原始媒体字节。

        文本不应以原始字节发送，请使用 'FunctionResponse.response' 字段。
    PlaceAnswerSources:
      properties:
        reviewSnippets:
          items:
            $ref: '#/components/schemas/ReviewSnippet'
          description: 用于生成 Google 地图中特定地点特征相关答案的评价摘录。
          type: array
      description: >-
        提供 Google 地图中特定地点特征相关答案的来源集合。每条 PlaceAnswerSources 消息对应 Google
        地图中的一个特定地点。Google 地图工具使用这些来源回答有关地点特征的问题（例如：“Bar Foo 有 Wifi 吗”或“Foo Bar
        是否支持无障碍轮椅通行？”）。目前仅支持以评价摘录作为来源。
      type: object
    GroundingChunkCustomMetadata:
      type: object
      description: 用户提供的关于 GroundingFact 的元数据。
      properties:
        numericValue:
          format: float
          type: number
          description: 可选。元数据的数值。该值的预期范围取决于所使用的具体 `key`。
        key:
          type: string
          description: 元数据的键。
        stringListValue:
          allOf:
            - $ref: '#/components/schemas/GroundingChunkStringList'
          description: 可选。元数据的字符串值列表。
        stringValue:
          description: 可选。元数据的字符串值。
          type: string
    ReviewSnippet:
      properties:
        title:
          description: 评价标题。
          type: string
        googleMapsUri:
          description: 对应 Google 地图上该用户评价的链接。
          type: string
        reviewId:
          description: 评价摘录的 ID。
          type: string
      type: object
      description: 封装一段用户评价摘录，用于回答关于 Google 地图中特定地点特征的问题。
    GroundingChunkStringList:
      description: 字符串值列表。
      type: object
      properties:
        values:
          type: array
          items:
            type: string
          description: 列表中的字符串值。
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-goog-api-key
      description: >-
        在 `x-goog-api-key` 请求头中传入 DreamTo API Key，Google 官方 SDK
        默认使用这种方式；也可以用查询参数 `?key=<API Key>`。
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        在 `Authorization` 请求头中传入 DreamTo API Key：`Authorization: Bearer <API
        Key>`。

````

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