Part

Part 代表通訊內容區段的容器。部分可以是純文字、某種檔案 (圖片、影片等),或結構化資料 Blob (即 JSON)。

JSON 表示法
{
  "metadata": {
    object
  },

  // Union field part can be only one of the following:
  "text": string,
  "file": {
    object (FilePart)
  },
  "data": {
    object (DataPart)
  }
  // End of list of possible types for union field part.
}
欄位
metadata

object (Struct format)

與這個部分相關聯的選填中繼資料。

聯集欄位 part

part 只能是下列其中一項:

text

string

file

object (FilePart)

data

object (DataPart)

FilePart

FilePart 代表檔案的各種提供方式。如果檔案很小,系統支援透過 fileWithBytes 直接提供位元組。如果檔案很大,代理程式應直接從 fileWithUri 來源適當讀取內容。

JSON 表示法
{
  "mimeType": string,
  "name": string,

  // Union field file can be only one of the following:
  "fileWithUri": string,
  "fileWithBytes": string
  // End of list of possible types for union field file.
}
欄位
mimeType

string

name

string

聯集欄位 file

file 只能是下列其中一項:

fileWithUri

string

fileWithBytes

string (bytes format)

Base64 編碼字串。

DataPart

DataPart 代表結構化 blob。最常見的是 JSON 酬載。

JSON 表示法
{
  "data": {
    object
  }
}
欄位
data

object (Struct format)