Record Class ChannelConfig
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.gateway.channel.ChannelConfig
- Record Components:
channelId- the logical channel identifier this config applies to (must matchChannel.channelId())defaultAgentId- fallback agent id when no binding matches; if null the global default agent (registered viaGateway.bindMainAgent(io.agentscope.harness.agent.HarnessAgent)) is useddmScope- controls how DM (PeerKind.DIRECT) sessions are keyed; defaults toDmScope.MAINbindings- ordered list of binding rules; evaluated in list order within each priority tier
public record ChannelConfig(String channelId, String defaultAgentId, DmScope dmScope, List<ChannelBinding> bindings)
extends Record
Per-channel routing configuration: default agent fallback, DM session scope, and ordered binding
rules evaluated by
ChannelRouter.
Used by Channel implementations to parameterize routing without hard-coding agent ids
or session shapes in adapter code.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionChannelConfig(String channelId, String defaultAgentId, DmScope dmScope, List<ChannelBinding> bindings) Creates an instance of aChannelConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbindings()Returns the value of thebindingsrecord component.static ChannelConfig.BuilderReturns a builder for constructing channel configs fluently.Returns the value of thechannelIdrecord component.Returns the value of thedefaultAgentIdrecord component.dmScope()Returns the value of thedmScoperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ChannelConfigMinimal config: channel id only, using global agent default andDmScope.MAIN.static ChannelConfigConfig with explicit default agent (no binding rules).final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChannelConfig
public ChannelConfig(String channelId, String defaultAgentId, DmScope dmScope, List<ChannelBinding> bindings) Creates an instance of aChannelConfigrecord class.- Parameters:
channelId- the value for thechannelIdrecord componentdefaultAgentId- the value for thedefaultAgentIdrecord componentdmScope- the value for thedmScoperecord componentbindings- the value for thebindingsrecord component
-
-
Method Details
-
of
Minimal config: channel id only, using global agent default andDmScope.MAIN. -
of
Config with explicit default agent (no binding rules). -
builder
Returns a builder for constructing channel configs fluently. -
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). -
channelId
Returns the value of thechannelIdrecord component.- Returns:
- the value of the
channelIdrecord component
-
defaultAgentId
Returns the value of thedefaultAgentIdrecord component.- Returns:
- the value of the
defaultAgentIdrecord component
-
dmScope
Returns the value of thedmScoperecord component.- Returns:
- the value of the
dmScoperecord component
-
bindings
Returns the value of thebindingsrecord component.- Returns:
- the value of the
bindingsrecord component
-