AS AgentScopeAPI 手册 / API Reference

ChannelConfig

public record ChannelConfig( String channelId, String defaultAgentId, DmScope dmScope, List<ChannelBinding> bindings)
源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:38–98

承载渠道配置数据的记录类型。位于 io.agentscope.harness.agent.gateway.channel 包。核心成员包括 channelId、defaultAgentId、dmScope、bindings、of、builder。

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.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
channelIdString
执行渠道标识相关操作。
the logical channel identifier this config applies to (must match `Channel#channelId()`)
defaultAgentIdString
执行默认智能体标识相关操作。
fallback agent id when no binding matches; if null the global default agent (registered via `io.agentscope.harness.agent.gateway.Gateway#bindMainAgent`) is used
dmScopeDmScope
执行dm 范围相关操作。
controls how DM (`PeerKind#DIRECT`) sessions are keyed; defaults to `DmScope#MAIN`
bindingsList<ChannelBinding>
执行 `bindings` 方法。
ordered list of binding rules; evaluated in list order within each priority tier

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.harness.agent.gateway.channel that deploys, schedules and serves agents.

构造器摘要Constructor Summary

构造器Constructor说明Description
public ChannelConfig(String channelId, String defaultAgentId, DmScope dmScope, List<ChannelBinding> bindings)
初始化 `ChannelConfig` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public static ChannelConfig of(String channelId)
static
创建并返回实例。
Minimal config: channel id only, using global agent default and `DmScope#MAIN`.
public static ChannelConfig of(String channelId, String defaultAgentId)
static
创建并返回实例。
Config with explicit default agent (no binding rules).
public static Builder builder(String channelId)
static
返回构建器实例。
Returns a builder for constructing channel configs fluently.

记录组件详情Record Component Detail

channelId

String channelId

执行渠道标识相关操作。

the logical channel identifier this config applies to (must match Channel#channelId())

源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:38–98

defaultAgentId

String defaultAgentId

执行默认智能体标识相关操作。

fallback agent id when no binding matches; if null the global default agent (registered via io.agentscope.harness.agent.gateway.Gateway#bindMainAgent) is used

源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:38–98

dmScope

DmScope dmScope

执行dm 范围相关操作。

controls how DM (PeerKind#DIRECT) sessions are keyed; defaults to DmScope#MAIN

源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:38–98

bindings

List<ChannelBinding> bindings

执行 bindings 方法。

ordered list of binding rules; evaluated in list order within each priority tier

源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:38–98

构造器详情Constructor Detail

ChannelConfig

public ChannelConfig(String channelId, String defaultAgentId, DmScope dmScope, List<ChannelBinding> bindings)

初始化 ChannelConfig 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
channelIdString渠道标识(类型 `String`)。The channel id.
defaultAgentIdString默认智能体标识(类型 `String`)。The default agent id.
dmScopeDmScopedm 范围(类型 `DmScope`)。The dm scope.
bindingsList<ChannelBinding>bindings(类型 `List`)。The bindings.
源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:41–45

方法详情Method Detail

of

public static ChannelConfig of(String channelId)
static

创建并返回实例。

Minimal config: channel id only, using global agent default and DmScope#MAIN.

参数Parameters
名称Name类型Type说明Description
channelIdString渠道标识(类型 `String`)。The channel id.
返回Returns ChannelConfig
返回ChannelConfig。Returns channel config.
源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:48–50

of

public static ChannelConfig of(String channelId, String defaultAgentId)
static

创建并返回实例。

Config with explicit default agent (no binding rules).

参数Parameters
名称Name类型Type说明Description
channelIdString渠道标识(类型 `String`)。The channel id.
defaultAgentIdString默认智能体标识(类型 `String`)。The default agent id.
返回Returns ChannelConfig
返回ChannelConfig。Returns channel config.
源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:53–55

builder

public static Builder builder(String channelId)
static

返回构建器实例。

Returns a builder for constructing channel configs fluently.

参数Parameters
名称Name类型Type说明Description
channelIdString渠道标识(类型 `String`)。The channel id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/gateway/channel/ChannelConfig.java:58–60

嵌套类详情Nested Class Detail

Builder

public static final class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.harness.agent.gateway.channel 包。核心成员包括 defaultAgentId、dmScope、binding、bindings、build。

A class in io.agentscope.harness.agent.gateway.channel that deploys, schedules and serves agents. Declared in io.agentscope.harness.agent.gateway.channel.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.