Method: projects.locations.collections.engines.assistants.generateContent

代表第一方 Gemini Enterprise 客户端,根据模型生成内容(一元)。

仅限于 Gemini Enterprise 客户端(ASSISTANT_USER 可见性);不属于常规 Discovery Engine API。

HTTP 请求

POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/assistants/*}:generateContent

网址采用 gRPC 转码语法。

路径参数

参数
name

string

必需。处理请求的 Assistant 的资源名称。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "model": string,
  "httpBody": {
    object (HttpBody)
  }
}
字段
model

string

必需。用于处理请求的模型。这是一个不透明的模型标识符,而不是 Discovery Engine 资源。

httpBody

object (HttpBody)

必需。不透明的请求正文。

响应正文

如果成功,则响应为通用 HTTP 响应,其格式由方法定义。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

如需了解详情,请参阅 Authentication Overview

IAM 权限

需要拥有 name 资源的以下 IAM 权限:

  • discoveryengine.assistants.assist

如需了解详情,请参阅 IAM 文档