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 表示法
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "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 mutually exclusive fields.
}
欄位
資料區塊。以下列出互斥欄位。回應中最多會設定一個欄位:
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,
  "altText": string
}
欄位
mimeType

string

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

data

string (bytes format)

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

Base64 編碼字串。

altText

string

選用。圖片的替代文字。

ToolCall

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

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

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "tool": string,
  "toolsetTool": {
    object (ToolsetTool)
  }
  // End of mutually exclusive fields.
}
欄位
id

string

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

displayName

string

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

args

object (Struct format)

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

parentToolCallId

string

僅供輸出。如果是由代表父項呼叫的子代理程式發出,則為導致此呼叫的工具呼叫 ID。如果是頂層呼叫,則為空白。讓用戶端將子代理程式的工作歸類在啟動工作的呼叫下,而非將每個步驟都視為同層級。

agentName

string

僅供輸出。發出這通電話的代理名稱 (人類可讀),例如「合約架構師」。如果是由根層級代理發出,則為空白。

要執行的工具 ID。可以是持續性工具,也可以是工具集中的工具。以下列出互斥欄位。回應中最多會設定一個欄位:
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
  },
  "parentToolCallId": string,
  "agentName": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "tool": string,
  "toolsetTool": {
    object (ToolsetTool)
  }
  // End of mutually exclusive fields.
}
欄位
id

string

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

displayName

string

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

response

object (Struct format)

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

parentToolCallId

string

僅供輸出。如果是由代表父項呼叫的子代理程式發出,則為導致此呼叫的工具呼叫 ID。如果是頂層呼叫,則為空白。讓用戶端將子代理程式的工作歸類在啟動工作的呼叫下,而非將每個步驟都視為同層級。

agentName

string

僅供輸出。發出這通電話的代理名稱 (人類可讀),例如「合約架構師」。如果是由根層級代理發出,則為空白。

已執行的工具 ID。可以是持續性工具,也可以是工具集中的工具。以下列出互斥欄位。回應中最多會設定一個欄位:
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

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