Method: projects.locations.notebooks.sources.batchCreate

创建 Source 的列表。

HTTP 请求

POST https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/notebooks/*}/sources:batchCreate

网址采用 gRPC 转码语法。

路径参数

参数
parent

string

必需。将创建来源的父资源。格式:projects/{project}/locations/{location}/notebooks/{notebook}

请求正文

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

JSON 表示法
{
  "userContents": [
    {
      object (UserContent)
    }
  ]
}
字段
userContents[]

object (UserContent)

必需。要上传的 UserContent

响应正文

SourceService.BatchCreateSources 方法的响应。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "sources": [
    {
      object (Source)
    }
  ]
}
字段
sources[]

object (Source)

Source

授权范围

需要以下 OAuth 范围之一:

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

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

IAM 权限

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

  • discoveryengine.sources.create

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

UserContent

“内容”消息是指用户想要上传的数据。

JSON 表示法
{

  // Union field content can be only one of the following:
  "googleDriveContent": {
    object (GoogleDriveContent)
  },
  "textContent": {
    object (TextContent)
  },
  "webContent": {
    object (WebContent)
  },
  "videoContent": {
    object (VideoContent)
  },
  "agentspaceContent": {
    object (AgentspaceContent)
  }
  // End of list of possible types for union field content.
}
字段
联合字段 content。用户内容。content 只能是下列其中一项:
googleDriveContent

object (GoogleDriveContent)

Google 云端硬盘中的内容。

textContent

object (TextContent)

作为来源上传的文本内容。

webContent

object (WebContent)

上传为来源的网络内容。

videoContent

object (VideoContent)

上传的视频内容作为来源。

agentspaceContent

object (AgentspaceContent)

以来源形式上传的 Agentspace 内容。

GoogleDriveContent

Google 云端硬盘中的内容。

JSON 表示法
{
  "documentId": string,
  "mimeType": string,
  "sourceName": string
}
字段
documentId

string

所选文档的文档 ID。

mimeType

string

所选文档的 MIME 类型。

可用于区分在云端硬盘选择器中选择的内容类型。对于 Google 文档,请使用 application/vnd.google-apps.document;对于 Google 幻灯片,请使用 application/vnd.google-apps.presentation。

sourceName

string

要为来源显示的名称。

TextContent

作为来源上传的文本内容。

JSON 表示法
{
  "sourceName": string,
  "content": string
}
字段
sourceName

string

文本源的显示名称。

content

string

要为来源显示的名称。

WebContent

上传为来源的网络内容。

JSON 表示法
{
  "url": string,
  "sourceName": string
}
字段
url

string

如果提供了网址,则会在后端提取网页。

sourceName

string

要为来源显示的名称。

VideoContent

以源文件形式上传的视频内容。

JSON 表示法
{

  // Union field format can be only one of the following:
  "youtubeUrl": string
  // End of list of possible types for union field format.
}
字段
联合字段 format。指定视频内容的格式,format 只能是下列其中一项:
youtubeUrl

string

视频内容的 YouTube 网址。

AgentspaceContent

以来源形式上传的 Agentspace 内容。

JSON 表示法
{
  "documentName": string,
  "engineName": string,
  "ideaforgeIdeaName": string
}
字段
documentName

string

可选。Agentspace 文档的完整资源名称。格式:projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}/documents/{documentId}

engineName

string

可选。引擎来验证文档的权限。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

ideaforgeIdeaName

string

可选。创意工作坊实例的资源名称。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/ideaForgeInstances/{instance}