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)

上傳做為來源的網路內容。

videoContent

object (VideoContent)

上傳做為來源的影片內容。

agentspaceContent

object (AgentspaceContent)

已上傳 Agent Space 內容做為來源。

互斥欄位的結尾。

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 表示法
{

  // 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

已上傳 Agent Space 內容做為來源。

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}