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}