ToolResponse

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

JSON 表示法
{
  "id": string,
  "displayName": string,
  "response": {
    object
  },
  "parentToolCallId": string,
  "agentName": string,
  "targetApp": 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

僅供輸出。發出這項呼叫的代理人類可讀名稱,例如「Contract Architect」。如果是由根層級代理發出,則為空白。

targetApp

string

僅供輸出。執行工具指定的應用程式;與 ToolCall.target_app 相同。

已執行工具的 ID。可以是永久工具或工具集中的工具。以下是互斥欄位清單。回應中最多會設定下列其中一個欄位:
tool

string

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

toolsetTool

object (ToolsetTool)

選用。已執行的工具組工具。

互斥欄位結束。