ChatUiRequest
public record ChatUiRequest(String peerId, String agentId, String subagentId, List<Msg> messages)
io/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:42–91用于ChatUiChannel的请求对象。位于 io.agentscope.harness.agent.gateway.channel.chatui 包。核心成员包括 peerId、agentId、subagentId、messages、of、withPeer。
Request object for ChatUiChannel. Carries the peer identity (optional) and the messages
to send to the agent.
The peerId is used by the channel router to build a stable session key:
-
If
peerIdis null and the channel's DmScope is MAIN, all requests share one session — convenient for single-user or testing scenarios. -
If
peerIdis provided, each distinct peer gets its own session (when using PER_PEER or similar scopes).
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
peerId | String | 执行对端标识相关操作。 optional user / peer identifier; null means "no peer" (single-session mode) |
agentId | String | 执行智能体标识相关操作。 optional explicit agent override; null for normal binding-driven routing |
subagentId | String | 执行子智能体标识相关操作。 optional exposed subagent id for direct subagent routing; null for normal
routing |
messages | List<Msg> | 执行消息相关操作。 one or more messages to send |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ChatUiRequest(String peerId, String agentId, String subagentId, List<Msg> messages) | 初始化 `ChatUiRequest` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static ChatUiRequest of(String text)static | 创建并返回实例。 Single user-text message in single-session mode (no peer). |
public static ChatUiRequest withPeer(String peerId, String text)static | 执行使用对端相关操作。 Single user-text message associated with a specific peer id. |
public static ChatUiRequest forAgent(String peerId, String agentId, String text)static | 执行用于智能体相关操作。 Single user-text message targeted at a specific agent. |
public static ChatUiRequest toSubagent(String subagentId, String text)static | 执行到子智能体相关操作。 Single user-text message routed directly to an exposed subagent. |
public static ChatUiRequest of(List<Msg> messages)static | 创建并返回实例。 Multi-message request without a peer (single-session mode). |
public static ChatUiRequest withPeer(String peerId, List<Msg> messages)static | 执行使用对端相关操作。 Multi-message request for a specific peer. |
记录组件详情Record Component Detail
peerId
String peerId执行对端标识相关操作。
optional user / peer identifier; null means "no peer" (single-session mode)
io/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:42–91agentId
String agentId执行智能体标识相关操作。
optional explicit agent override; null for normal binding-driven routing
io/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:42–91subagentId
String subagentId执行子智能体标识相关操作。
optional exposed subagent id for direct subagent routing; null for normal routing
io/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:42–91messages
List<Msg> messages执行消息相关操作。
one or more messages to send
io/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:42–91构造器详情Constructor Detail
ChatUiRequest
public ChatUiRequest(String peerId, String agentId, String subagentId, List<Msg> messages)
初始化 ChatUiRequest 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
peerId | String | 对端标识(类型 `String`)。The peer id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
subagentId | String | 子智能体标识(类型 `String`)。The subagent id. |
messages | List<Msg> | 消息列表(类型 `List`)。The messages. |
io/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:44–49方法详情Method Detail
of
public static ChatUiRequest of(String text)
创建并返回实例。
Single user-text message in single-session mode (no peer).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
text | String | 文本(类型 `String`)。The text. |
ChatUiRequestio/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:52–55withPeer
public static ChatUiRequest withPeer(String peerId, String text)
执行使用对端相关操作。
Single user-text message associated with a specific peer id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
peerId | String | 对端标识(类型 `String`)。The peer id. |
text | String | 文本(类型 `String`)。The text. |
ChatUiRequestio/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:58–62forAgent
public static ChatUiRequest forAgent(String peerId, String agentId, String text)
执行用于智能体相关操作。
Single user-text message targeted at a specific agent.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
peerId | String | 对端标识(类型 `String`)。The peer id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
text | String | 文本(类型 `String`)。The text. |
ChatUiRequestio/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:65–69toSubagent
public static ChatUiRequest toSubagent(String subagentId, String text)
执行到子智能体相关操作。
Single user-text message routed directly to an exposed subagent.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
subagentId | String | 子智能体标识(类型 `String`)。The subagent id. |
text | String | 文本(类型 `String`)。The text. |
ChatUiRequestio/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:72–76of
public static ChatUiRequest of(List<Msg> messages)
创建并返回实例。
Multi-message request without a peer (single-session mode).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
messages | List<Msg> | 消息列表(类型 `List`)。The messages. |
ChatUiRequestio/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:79–81withPeer
public static ChatUiRequest withPeer(String peerId, List<Msg> messages)
执行使用对端相关操作。
Multi-message request for a specific peer.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
peerId | String | 对端标识(类型 `String`)。The peer id. |
messages | List<Msg> | 消息列表(类型 `List`)。The messages. |
ChatUiRequestio/agentscope/harness/agent/gateway/channel/chatui/ChatUiRequest.java:84–86