RunSessionResponse

SessionService.RunSession 的响应消息。

JSON 表示法
{
  "outputs": [
    {
      object (SessionOutput)
    }
  ]
}
字段
outputs[]

object (SessionOutput)

会话的输出。

SessionOutput

会话的输出。

JSON 表示法
{
  "turnIndex": integer,
  "turnCompleted": boolean,
  "diagnosticInfo": {
    object (SessionOutput.DiagnosticInfo)
  },
  "context": [
    {
      "@type": string,
      field1: ...,
      ...
    }
  ],

  // Union field output_type can be only one of the following:
  "text": string,
  "audio": string,
  "toolCalls": {
    object (ToolCalls)
  },
  "citations": {
    object (Citations)
  },
  "googleSearchSuggestions": {
    object (GoogleSearchSuggestions)
  },
  "endSession": {
    object (EndSession)
  },
  "payload": {
    object
  },
  "image": {
    object (Image)
  }
  // End of list of possible types for union field output_type.
}
字段
turnIndex

integer

表示此输出所属的对话轮次的顺序,从 1 开始。

turnCompleted

boolean

如果为 true,则表示 CES 智能体已检测到当前对话轮次的结束,并且不会为此轮次提供进一步的输出。

diagnosticInfo

object (SessionOutput.DiagnosticInfo)

可选。诊断信息包含输入处理期间的执行详情。仅在每个轮次的最后一个 SessionOutput(turnCompleted=true)中填充。

context[]

object

外部监督防护措施的上下文消息。

此对象可以包含任意类型的字段。附加字段 "@type" 包含用于标示相应类型的 URI。示例:{ "id": 1234, "@type": "types.example.com/standard/id" }

联合字段 output_type。输出的类型。output_type 只能是下列其中一项:
text

string

CES 智能体的输出文本。

audio

string (bytes format)

CES 智能体的输出音频。

使用 base64 编码的字符串。

toolCalls

object (ToolCalls)

请求客户端执行工具。

citations

object (Citations)

提供智能体生成的文本的来源信息的引用。

googleSearchSuggestions

object (GoogleSearchSuggestions)

调用 GoogleSearchTool 后从 Google 搜索返回的建议。

endSession

object (EndSession)

表示会话已结束。

payload

object (Struct format)

包含 CES 智能体提供的结构化输出的自定义载荷。

image

object (Image)

CES 智能体的输出图片。

ToolCalls

请求客户端执行工具并返回执行结果,然后再继续会话。

JSON 表示法
{
  "toolCalls": [
    {
      object (ToolCall)
    }
  ]
}
字段
toolCalls[]

object (ToolCall)

可选。要执行的工具调用的列表。

EndSession

表示会话已终止,原因可能是成功完成(例如,用户说“再见!”)或智能体升级。

会话终止后,智能体将不再处理任何进一步的输入,并且客户端应在收到智能体的所有剩余响应后半关闭并断开连接。

JSON 表示法
{
  "metadata": {
    object
  }
}
字段
metadata

object (Struct format)

可选。提供有关结束会话信号的其他信息,例如结束会话的原因。

SessionOutput.DiagnosticInfo

包含处理期间的执行详情。

JSON 表示法
{
  "messages": [
    {
      object (Message)
    }
  ],
  "rootSpan": {
    object (Span)
  }
}
字段
messages[]

object (Message)

处理期间发生的消息的列表。

rootSpan

object (Span)

整个请求处理的轨迹,表示为根 span。此 span 可以包含特定操作的嵌套子 span。