REST Resource: projects.locations.notebooks.sources

資源:來源

來源是指單一內容來源。

JSON 表示法
{
  "name": string,
  "title": string,
  "sourceId": {
    object (SourceId)
  },
  "metadata": {
    object (SourceMetadata)
  },
  "settings": {
    object (SourceSettings)
  }
}
欄位
name

string

ID。來源的完整資源名稱。格式:projects/{project}/locations/{location}/notebooks/{notebook}/sources/{sourceId}

這個欄位必須是 UTF-8 編碼的字串,長度上限為 1024 個字元。

title

string

(選用步驟) 來源的標題。

sourceId

object (SourceId)

(選用步驟) 僅供輸出。來源 ID,也就是來源資源名稱的最後一個區段。

metadata

object (SourceMetadata)

僅供輸出。來源的中繼資料。

settings

object (SourceSettings)

僅供輸出。來源的狀態和任何失敗原因。

SourceMetadata

代表來源的中繼資料和一些額外資訊。

JSON 表示法
{

  // Union field metadata can be only one of the following:
  "googleDocsMetadata": {
    object (GoogleDocsSourceMetadata)
  },
  "youtubeMetadata": {
    object (YoutubeMetadata)
  },
  "agentspaceMetadata": {
    object (AgentspaceMetadata)
  }
  // End of list of possible types for union field metadata.
  "wordCount": integer,
  "tokenCount": integer,
  "sourceAddedTimestamp": string
}
欄位
聯集欄位 metadata。來源的中繼資料。metadata 只能是下列其中一項:
googleDocsMetadata

object (GoogleDocsSourceMetadata)

Google 文件來源的中繼資料。

youtubeMetadata

object (YoutubeMetadata)

YouTube 影片來源的中繼資料。

agentspaceMetadata

object (AgentspaceMetadata)

Agentspace 來源的中繼資料。

wordCount

integer

來源的字數。

tokenCount

integer

來源中的權杖數量。

sourceAddedTimestamp

string (Timestamp format)

新增來源的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 標準化,並使用 0、3、6 或 9 個小數點後位數。系統也接受「Z」以外的偏移量。例如:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

GoogleDocsSourceMetadata

Google 文件來源的中繼資料。

JSON 表示法
{
  "documentId": string,
  "revisionId": string
}
欄位
documentId

string

僅供輸出。Google 文件的文件 ID。

revisionId

string

僅供輸出。文件的修訂版本 ID。

YoutubeMetadata

YouTube 影片來源的中繼資料。

JSON 表示法
{
  "videoId": string,
  "channelName": string
}
欄位
videoId

string

僅供輸出。YouTube 影片的 ID。

channelName

string

僅供輸出。YouTube 影片的頻道名稱。

AgentspaceMetadata

代理程式空間來源的中繼資料。

JSON 表示法
{
  "documentName": string,
  "documentTitle": string
}
欄位
documentName

string

僅供輸出。Agentspace 中的完整文件名稱。

documentTitle

string

僅供輸出。文件的標題。

SourceSettings

允許在 sources.batchCreate 中擴充來源設定 (先前為 AddSource 要求)。

JSON 表示法
{
  "status": enum (SourceStatus),
  "failureReason": {
    object (FailureReason)
  }
}
欄位
status

enum (SourceStatus)

來源狀態。

failureReason

object (FailureReason)

失敗原因,內含來源無法擷取的詳細原因。

SourceStatus

來源的可能狀態清單。

列舉
SOURCE_STATUS_UNSPECIFIED 未指定狀態。
SOURCE_STATUS_PENDING 來源待新增。
SOURCE_STATUS_COMPLETE 來源新增作業已完成,且一切順利。
SOURCE_STATUS_ERROR 來源新增作業永久失敗。
SOURCE_STATUS_PENDING_DELETION 來源待刪除。
SOURCE_STATUS_TENTATIVE 使用者嘗試新增來源,但我們尚未上傳來源或檢查使用者限制。不計入使用者的來源限制。

FailureReason

失敗原因,內含來源無法擷取的詳細原因。

JSON 表示法
{

  // Union field error can be only one of the following:
  "unknown": {
    object (Unknown)
  },
  "sourceTooLong": {
    object (SourceTooLong)
  },
  "ingestionError": {
    object (IngestionError)
  },
  "sourceEmpty": {
    object (SourceEmpty)
  },
  "uploadError": {
    object (UploadError)
  },
  "paywallError": {
    object (PaywallError)
  },
  "sourceUnreachable": {
    object (SourceUnreachable)
  },
  "googleDriveError": {
    object (GoogleDriveError)
  },
  "youtubeError": {
    object (YoutubeError)
  },
  "audioTranscriptionError": {
    object (AudioTranscriptionError)
  },
  "sourceLimitExceeded": {
    object (SourceLimitExceeded)
  },
  "domainBlocked": {
    object (DomainBlocked)
  }
  // End of list of possible types for union field error.
}
欄位
聯集欄位 error。具體錯誤。error 只能是下列其中一項:
unknown

object (Unknown)

表示發生不明錯誤。

sourceTooLong

object (SourceTooLong)

表示來源字數超出使用者限制。

ingestionError

object (IngestionError)

表示擷取來源時發生錯誤。

sourceEmpty

object (SourceEmpty)

表示來源為空白。

uploadError

object (UploadError)

表示上傳來源時發生錯誤。

paywallError

object (PaywallError)

表示來源設有付費牆,無法擷取。

sourceUnreachable

object (SourceUnreachable)

表示無法連上來源。

googleDriveError

object (GoogleDriveError)

Google 雲端硬碟專屬錯誤。

youtubeError

object (YoutubeError)

YouTube 專屬錯誤。

audioTranscriptionError

object (AudioTranscriptionError)

音訊檔案轉錄專屬錯誤。

sourceLimitExceeded

object (SourceLimitExceeded)

如果使用者嘗試更新超過上限,就會發生錯誤。

domainBlocked

object (DomainBlocked)

如果使用者嘗試從遭封鎖的網域新增來源,就會發生錯誤。

不明

這個類型沒有任何欄位。

表示發生不明錯誤。

SourceTooLong

表示來源字數超出使用者限制。

JSON 表示法
{
  "wordCount": integer,
  "wordLimit": integer
}
欄位
wordCount

integer

來源中的字數。

wordLimit

integer

上傳時,目前使用者可用的字數上限。

IngestionError

這個類型沒有任何欄位。

表示擷取來源時發生錯誤。

SourceEmpty

這個類型沒有任何欄位。

表示來源為空白。

UploadError

這個類型沒有任何欄位。

表示上傳來源時發生錯誤。

PaywallError

這個類型沒有任何欄位。

表示來源設有付費牆,無法擷取。

SourceUnreachable

表示無法連上來源。這項功能主要用於透過網址新增的來源。

JSON 表示法
{
  "errorDetails": enum (SourceUnreachableErrorReason)
}
欄位
errorDetails

enum (SourceUnreachableErrorReason)

說明來源無法連線的原因。

SourceUnreachableErrorReason

說明來源無法連線的詳細原因。用於向使用者顯示適當的訊息。

列舉
ERROR_REASON_UNSPECIFIED 預設
ERROR_REASON_INVALID_URL 來源網址無效。
ERROR_REASON_NOT_ACCESSIBLE 無法存取來源網址。
ERROR_REASON_NOT_REACHABLE 無法連上來源網址。
ERROR_REASON_URL_NOT_FOUND 來源網址傳回 404 錯誤。
ERROR_REASON_TRANSIENT_ERROR 由於暫時性網路錯誤或主機逾時等問題,無法連線至來源網址。
ERROR_REASON_FETCH_FAILED 發生內部錯誤,因此無法擷取來源網址。
ERROR_REASON_NOT_SUPPORTED 目前不支援該網址。例如:擷取的內容超過擷取器擷取大小上限、擷取的內容類型目前不支援等。

GoogleDriveError

Google 雲端硬碟專屬錯誤。

JSON 表示法
{

  // Union field error can be only one of the following:
  "downloadPrevented": {
    object (DownloadPrevented)
  }
  // End of list of possible types for union field error.
}
欄位
聯集欄位 error。雲端硬碟專屬錯誤。error 只能是下列其中一項:
downloadPrevented

object (DownloadPrevented)

使用者無法下載檔案。

DownloadPrevented

這個類型沒有任何欄位。

使用者無法下載檔案。

YoutubeError

YouTube 專屬錯誤。

JSON 表示法
{

  // Union field error can be only one of the following:
  "videoDeleted": {
    object (VideoDeleted)
  }
  // End of list of possible types for union field error.
}
欄位
聯集欄位 error。YouTube 專屬錯誤。error 只能是下列其中一項:
videoDeleted

object (VideoDeleted)

錯誤,表示來源已移除,因為影片已刪除。

VideoDeleted

這個類型沒有任何欄位。

錯誤,表示來源已移除,因為影片已刪除。

AudioTranscriptionError

音訊檔案轉錄專屬錯誤。

JSON 表示法
{

  // Union field error can be only one of the following:
  "languageDetectionFailed": {
    object (LanguageDetectionFailed)
  },
  "noAudioDetected": {
    object (NoAudioDetected)
  }
  // End of list of possible types for union field error.
}
欄位
聯集欄位 error。音訊檔案轉錄的特定錯誤。error 只能是下列其中一項:
languageDetectionFailed

object (LanguageDetectionFailed)

無法偵測檔案語言 (檔案可能不是語音)。

noAudioDetected

object (NoAudioDetected)

系統在輸入檔案中偵測不到音訊 (可能是影片)。

LanguageDetectionFailed

這個類型沒有任何欄位。

無法偵測檔案語言 (檔案可能不是語音)。

NoAudioDetected

這個類型沒有任何欄位。

輸入檔案中未偵測到音訊。

SourceLimitExceeded

這個類型沒有任何欄位。

表示使用者沒有這個來源的空間。

DomainBlocked

這個類型沒有任何欄位。

錯誤,表示來源已遭移除,因為網域遭到封鎖。

方法

batchCreate

建立 Source 清單。

batchDelete

刪除多個來源

get

取得 Source