Method: projects.locations.collections.engines.sessions.listSessionFileMetadata

列出目前工作階段中所有檔案的中繼資料。

HTTP 要求

GET https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}:listSessionFileMetadata

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
name

string

這是必要旗標,工作階段的資源名稱。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}

要求主體

要求主體必須為空白。

回應主體

AssistantService.ListSessionFileMetadata 方法的回應訊息。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "fileMetadata": [
    {
      object (FileMetadata)
    }
  ],
  "totalQuotaPercentage": number
}
欄位
fileMetadata[]

object (FileMetadata)

FileMetadata

totalQuotaPercentage
(deprecated)

number

已淘汰:這個欄位可能未設定,或值可能未將所有檔案類型納入考量。將移除。

所有檔案使用的總配額百分比。

授權範圍

需要下列其中一種 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 權限

需要 name 資源的下列 IAM 權限:

  • discoveryengine.sessions.listSessionFileMetadata

詳情請參閱 IAM 說明文件

FileMetadata

檔案的中繼資料。

JSON 表示法
{
  "fileId": string,
  "name": string,
  "mimeType": string,
  "byteSize": string,
  "tokenCount": string,
  "quotaPercentage": number,
  "selected": boolean,
  "usedInConversation": boolean,
  "originalUri": string,
  "originalSourceType": enum (FileSource),
  "uploadTime": string,
  "metadata": {
    string: string,
    ...
  },
  "session": string
}
欄位
fileId

string

檔案的 ID。

name

string

上傳檔案的名稱。

mimeType

string

檔案的內容類型,請參閱 https://www.iana.org/assignments/media-types/media-types.xhtml

byteSize

string (int64 format)

結構定義檔案的大小 (以位元組為單位)。

tokenCount
(deprecated)

string (int64 format)

已淘汰:這個欄位不會針對所有檔案類型設定,且最終會移除。

檔案長度 (以權杖為單位)。

quotaPercentage
(deprecated)

number

已淘汰:這個欄位不會針對所有檔案類型設定,且最終會移除。

檔案使用的配額百分比。

selected

boolean

如果選取要使用的檔案。

usedInConversation

boolean

檔案先前是否曾用於工作階段 (即用於查詢),且屬於對話記錄,或僅上傳但尚未用於工作階段。

originalUri

string

選用。檔案的原始位置。可以是本機檔案路徑,也可以是允許存取外部系統中檔案的任何其他 URI。網址可能會在兩種情況下為空白:1. 如果檔案是以內嵌資料的形式傳送 (例如從剪貼簿貼上),2. 如果原始位置不存在。

請注意,我們無法保證 URI 會指向有效或實際存在的檔案。舉例來說,檔案可能已上傳至工作階段,但隨後從原始來源刪除。

originalSourceType

enum (FileSource)

選用。檔案原始來源的類型。

uploadTime

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"

metadata

map (key: string, value: string)

選用。代表與檔案相關的中繼資料,可因應特定用途。前置字串「google.」已預留給 Google 使用,但您可以自由使用其他前置字串。

session

string

僅供輸出。工作階段的資源名稱。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}

FileSource

檔案的原始來源。

列舉
FILE_SOURCE_UNSPECIFIED 預設值。來源不明。
FILE_SOURCE_INLINE 檔案資料是內嵌提供 (例如從剪貼簿貼上)。
FILE_SOURCE_LOCAL 檔案是從本機檔案上傳。
FILE_SOURCE_CLOUD_STORAGE 檔案是從 Cloud Storage 上傳。
FILE_SOURCE_CLOUD_DRIVE 檔案是從雲端硬碟上傳。
FILE_SOURCE_URL 檔案是從網址 (例如公開網站) 擷取。