- HTTP 请求
- 路径参数
- 请求正文
- 响应正文
- 授权范围
- IAM 权限
- UserContent
- GoogleDriveContent
- TextContent
- WebContent
- VideoContent
- AgentspaceContent
创建 Source
的列表。
HTTP 请求
POST https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/notebooks/*}/sources:batchCreate
网址采用 gRPC 转码语法。
路径参数
参数 | |
---|---|
parent |
必需。将创建来源的父资源。格式:projects/{project}/locations/{location}/notebooks/{notebook} |
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
---|
{
"userContents": [
{
object ( |
字段 | |
---|---|
userContents[] |
必需。要上传的 |
响应正文
对 SourceService.BatchCreateSources
方法的响应。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
---|
{
"sources": [
{
object ( |
字段 | |
---|---|
sources[] |
|
授权范围
需要以下 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 。用户内容。content 只能是下列其中一项: |
|
googleDriveContent |
Google 云端硬盘中的内容。 |
textContent |
作为来源上传的文本内容。 |
webContent |
上传为来源的网络内容。 |
videoContent |
上传的视频内容作为来源。 |
agentspaceContent |
以来源形式上传的 Agentspace 内容。 |
GoogleDriveContent
Google 云端硬盘中的内容。
JSON 表示法 |
---|
{ "documentId": string, "mimeType": string, "sourceName": string } |
字段 | |
---|---|
documentId |
所选文档的文档 ID。 |
mimeType |
所选文档的 MIME 类型。 可用于区分在云端硬盘选择器中选择的内容类型。对于 Google 文档,请使用 application/vnd.google-apps.document;对于 Google 幻灯片,请使用 application/vnd.google-apps.presentation。 |
sourceName |
要为来源显示的名称。 |
TextContent
作为来源上传的文本内容。
JSON 表示法 |
---|
{ "sourceName": string, "content": string } |
字段 | |
---|---|
sourceName |
文本源的显示名称。 |
content |
要为来源显示的名称。 |
WebContent
上传为来源的网络内容。
JSON 表示法 |
---|
{ "url": string, "sourceName": string } |
字段 | |
---|---|
url |
如果提供了网址,则会在后端提取网页。 |
sourceName |
要为来源显示的名称。 |
VideoContent
以源文件形式上传的视频内容。
JSON 表示法 |
---|
{ // Union field |
字段 | |
---|---|
联合字段 format 。指定视频内容的格式,format 只能是下列其中一项: |
|
youtubeUrl |
视频内容的 YouTube 网址。 |
AgentspaceContent
以来源形式上传的 Agentspace 内容。
JSON 表示法 |
---|
{ "documentName": string, "engineName": string, "ideaforgeIdeaName": string } |
字段 | |
---|---|
documentName |
可选。Agentspace 文档的完整资源名称。格式: |
engineName |
可选。引擎来验证文档的权限。格式: |
ideaforgeIdeaName |
可选。创意工作坊实例的资源名称。格式: |