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。

已执行工具的标识符。它可以是持久化工具,也可以是工具集中的工具。以下是互斥字段的列表。在响应中,最多只能设置以下字段之一:
tool

string

可选。要执行的工具的名称。格式:projects/{project}/locations/{location}/apps/{app}/tools/{tool}

toolsetTool

object (ToolsetTool)

可选。已执行的工具集工具。

互斥字段结束。