Part

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)