Record Class ChatUiRequest
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.gateway.channel.chatui.ChatUiRequest
- Record Components:
peerId- optional user / peer identifier; null means "no peer" (single-session mode)agentId- optional explicit agent override; null for normal binding-driven routingsubagentId- optional exposed subagent id for direct subagent routing; null for normal routingmessages- one or more messages to send
public record ChatUiRequest(String peerId, String agentId, String subagentId, List<io.agentscope.core.message.Msg> messages)
extends Record
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).
-
Constructor Summary
ConstructorsConstructorDescriptionChatUiRequest(String peerId, String agentId, String subagentId, List<io.agentscope.core.message.Msg> messages) Creates an instance of aChatUiRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.final booleanIndicates whether some other object is "equal to" this one.static ChatUiRequestSingle user-text message targeted at a specific agent.final inthashCode()Returns a hash code value for this object.List<io.agentscope.core.message.Msg>messages()Returns the value of themessagesrecord component.static ChatUiRequestSingle user-text message in single-session mode (no peer).static ChatUiRequestMulti-message request without a peer (single-session mode).peerId()Returns the value of thepeerIdrecord component.Returns the value of thesubagentIdrecord component.final StringtoString()Returns a string representation of this record class.static ChatUiRequesttoSubagent(String subagentId, String text) Single user-text message routed directly to an exposed subagent.static ChatUiRequestSingle user-text message associated with a specific peer id.static ChatUiRequestMulti-message request for a specific peer.
-
Constructor Details
-
ChatUiRequest
public ChatUiRequest(String peerId, String agentId, String subagentId, List<io.agentscope.core.message.Msg> messages) Creates an instance of aChatUiRequestrecord class.- Parameters:
peerId- the value for thepeerIdrecord componentagentId- the value for theagentIdrecord componentsubagentId- the value for thesubagentIdrecord componentmessages- the value for themessagesrecord component
-
-
Method Details
-
of
Single user-text message in single-session mode (no peer). -
withPeer
Single user-text message associated with a specific peer id. -
forAgent
Single user-text message targeted at a specific agent. -
toSubagent
Single user-text message routed directly to an exposed subagent. -
of
Multi-message request without a peer (single-session mode). -
withPeer
Multi-message request for a specific peer. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
peerId
Returns the value of thepeerIdrecord component.- Returns:
- the value of the
peerIdrecord component
-
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
subagentId
Returns the value of thesubagentIdrecord component.- Returns:
- the value of the
subagentIdrecord component
-
messages
Returns the value of themessagesrecord component.- Returns:
- the value of the
messagesrecord component
-