Message

對話中的訊息。

JSON 表示法
{
  "role": string,
  "chunks": [
    {
      object (Chunk)
    }
  ],
  "eventTime": string
}
欄位
role

string

選用。對話中的角色,例如使用者、代理程式。

chunks[]

object (Chunk)

選用。訊息內容,以一系列區塊的形式呈現。

eventTime

string (Timestamp format)

選用。傳送或接收郵件/訊息時的時間戳記。如果訊息屬於 example,則不應使用此屬性。

使用 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"

Chunk

訊息中的內容區塊。

JSON 表示法
{

  // Union field data can be only one of the following:
  "text": string,
  "transcript": string,
  "blob": {
    object (Blob)
  },
  "payload": {
    object
  },
  "image": {
    object (Image)
  },
  "toolCall": {
    object (ToolCall)
  },
  "toolResponse": {
    object (ToolResponse)
  },
  "agentTransfer": {
    object (AgentTransfer)
  },
  "updatedVariables": {
    object
  },
  "defaultVariables": {
    object
  }
  // End of list of possible types for union field data.
}
欄位
聯集欄位 data。將資料分塊。data 只能是下列其中一個設定:
text

string

選用。文字資料。

transcript

string

選用。與音訊相關的轉錄稿。

blob

object (Blob)

選用。Blob 資料。

payload

object (Struct format)

選用。自訂酬載資料。

image

object (Image)

選用。圖片資料。

toolCall

object (ToolCall)

選用。工具執行要求。

toolResponse

object (ToolResponse)

選用。工具執行回應。

agentTransfer

object (AgentTransfer)

選用。代理程式轉移事件。

updatedVariables

object (Struct format)

結構體代表對話中更新的變數,並以變數名稱做為鍵。

defaultVariables

object (Struct format)

結構體代表對話開始時的預設變數,並以變數名稱做為鍵。

Blob

代表對話中的 Blob 輸入或輸出內容。

JSON 表示法
{
  "mimeType": string,
  "data": string
}
欄位
mimeType

string

這是必要旗標,來源資料的 IANA 標準 MIME 類型。

data

string (bytes format)

這是必要旗標,Blob 的原始位元組。

Base64 編碼字串。

圖片

代表對話中的圖片輸入或輸出內容。

JSON 表示法
{
  "mimeType": string,
  "data": string
}
欄位
mimeType

string

這是必要旗標,來源資料的 IANA 標準 MIME 類型。支援的圖片類型包括: * image/png * image/jpeg * image/webp

data

string (bytes format)

這是必要旗標,圖片的原始位元組。

Base64 編碼字串。

ToolCall

要求用戶端或代理程式執行指定工具。

JSON 表示法
{
  "id": string,
  "displayName": string,
  "args": {
    object
  },

  // Union field tool_identifier can be only one of the following:
  "tool": string,
  "toolsetTool": {
    object (ToolsetTool)
  }
  // End of list of possible types for union field tool_identifier.
}
欄位
id

string

選用。工具呼叫的專屬 ID。如果已填入,用戶端應傳回執行結果,並在 ToolResponse 中提供相符的 ID。

displayName

string

僅供輸出。工具的顯示名稱。

args

object (Struct format)

選用。工具的輸入參數和值,採用 JSON 物件格式。

聯集欄位 tool_identifier。要執行的工具 ID。可以是持續性工具,也可以是工具集中的工具。tool_identifier 只能是下列其中一個設定:
tool

string

選用。要執行的工具名稱。格式:projects/{project}/locations/{location}/apps/{app}/tools/{tool}

toolsetTool

object (ToolsetTool)

選用。要執行的工具集工具。

ToolsetTool

從工具集建立的工具。

JSON 表示法
{
  "toolset": string,
  "toolId": string
}
欄位
toolset

string

這是必要旗標,衍生此工具的工具集資源名稱。格式:projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

toolId

string

選用。用於篩選工具的工具 ID,可擷取結構定義。

ToolResponse

用戶端或代理程式中特定工具的執行結果。

JSON 表示法
{
  "id": string,
  "displayName": string,
  "response": {
    object
  },

  // Union field tool_identifier can be only one of the following:
  "tool": string,
  "toolsetTool": {
    object (ToolsetTool)
  }
  // End of list of possible types for union field tool_identifier.
}
欄位
id

string

選用。tool call 回應的相符 ID。

displayName

string

僅供輸出。工具的顯示名稱。

response

object (Struct format)

這是必要旗標,JSON 物件格式的工具執行結果。使用「output」鍵指定工具回應,並使用「error」鍵指定錯誤詳細資料 (如有)。如果未指定「output」和「error」鍵,系統會將整個「response」視為工具執行結果。

聯集欄位 tool_identifier。已執行的工具 ID。可以是持續性工具,也可以是工具集中的工具。tool_identifier 只能是下列其中一個設定:
tool

string

選用。要執行的工具名稱。格式:projects/{project}/locations/{location}/apps/{app}/tools/{tool}

toolsetTool

object (ToolsetTool)

選用。執行的工具集工具。

AgentTransfer

代表將對話轉移給其他服務專員的事件。

JSON 表示法
{
  "targetAgent": string,
  "displayName": string
}
欄位
targetAgent

string

這是必要旗標,要將對話轉移給哪位服務專員。服務專員會接手後續對話。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

displayName

string

僅供輸出。代理程式的顯示名稱。