- 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 | 
 (選用步驟) 構想工廠執行個體的資源名稱。格式: |