Record Class RouteResult
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.gateway.channel.RouteResult
- Record Components:
agentId- the resolved target agent idcontext- the routing context (channel, session scope keys, agentId extra) ready for gateway executionmatchedBy- human-readable label of the binding tier that matched (e.g."peer","guild+roles","default"); useful for debugging and loggingoutboundAddress- delivery target for proactive replies (e.g. subagent announces); derived from the inbound message's channel and peer metadata
public record RouteResult(String agentId, MsgContext context, String matchedBy, OutboundAddress outboundAddress)
extends Record
Output of
ChannelRouter.resolveRoute(io.agentscope.harness.agent.gateway.channel.ChannelConfig, io.agentscope.harness.agent.gateway.channel.InboundMessage): the resolved agent id, the MsgContext to
pass to Gateway.run(io.agentscope.harness.agent.gateway.MsgContext, java.util.List<io.agentscope.core.message.Msg>), a diagnostic matchedBy
label indicating which binding tier (or fallback) produced the result, and the OutboundAddress for delivering replies back to the originating channel/peer.-
Constructor Summary
ConstructorsConstructorDescriptionRouteResult(String agentId, MsgContext context, String matchedBy, OutboundAddress outboundAddress) Creates an instance of aRouteResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.context()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thematchedByrecord component.Returns the value of theoutboundAddressrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RouteResult
public RouteResult(String agentId, MsgContext context, String matchedBy, OutboundAddress outboundAddress) Creates an instance of aRouteResultrecord class.- Parameters:
agentId- the value for theagentIdrecord componentcontext- the value for thecontextrecord componentmatchedBy- the value for thematchedByrecord componentoutboundAddress- the value for theoutboundAddressrecord component
-
-
Method Details
-
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). -
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-
matchedBy
Returns the value of thematchedByrecord component.- Returns:
- the value of the
matchedByrecord component
-
outboundAddress
Returns the value of theoutboundAddressrecord component.- Returns:
- the value of the
outboundAddressrecord component
-