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.assist.readwrite
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

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

IAM 权限

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

  • discoveryengine.sources.create

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

UserContent

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

JSON 表示法
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "googleDriveContent": {
    object (GoogleDriveContent)
  },
  "textContent": {
    object (TextContent)
  },
  "webContent": {
    object (WebContent)
  },
  "videoContent": {
    object (VideoContent)
  },
  "agentspaceContent": {
    object (AgentspaceContent)
  }
  // End of mutually exclusive fields.
}
字段
用户内容。以下是互斥字段的列表。在响应中,最多只能设置以下字段之一:
googleDriveContent

object (GoogleDriveContent)

Google 云端硬盘中的内容。

textContent

object (TextContent)

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

webContent

object (WebContent)

作为来源上传的 Web 内容。

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

作为来源上传的 Web 内容。

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

string

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

sourceName

string

要为来源显示的名称。

VideoContent

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

JSON 表示法
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "youtubeUrl": string
  // End of mutually exclusive fields.
}
字段
指定视频内容的格式。以下是互斥字段的列表。在响应中,最多只能设置以下字段之一:
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

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