AS AgentScopeAPI 手册 / API Reference

DmScope

public enum DmScope
源码Source io/agentscope/harness/agent/gateway/channel/DmScope.java:31–41

定义Dm 范围相关取值的枚举。位于 io.agentscope.harness.agent.gateway.channel 包。核心成员包括 defaultScope、MAIN、PER_PEER、PER_CHANNEL_PEER、PER_ACCOUNT_CHANNEL_PEER。

Controls how DM (PeerKind#DIRECT) session keys are scoped.

  • #MAIN — all DMs for a given agent share a single session. Suitable for single-user or shared assistant scenarios.

  • #PER_PEER — one session per peer id. Most common for multi-user deployments.

  • #PER_CHANNEL_PEER — like PER_PEER but the channel name is included in the key, disambiguating the same peer across channels.

  • #PER_ACCOUNT_CHANNEL_PEER — extends PER_CHANNEL_PEER with the account id, useful for multi-account (multi-bot) deployments on the same channel platform.

枚举常量摘要Enum Constant Summary

常量Constant说明Description
MAIN
执行主相关操作。
Performs the MAIN operation.
PER_PEER
执行每个对端相关操作。
Performs the PER PEER operation.
PER_CHANNEL_PEER
执行每个渠道对端相关操作。
Performs the PER CHANNEL PEER operation.
PER_ACCOUNT_CHANNEL_PEER
执行每个 ACCOUNT 渠道对端相关操作。
Performs the PER ACCOUNT CHANNEL PEER operation.

方法摘要Method Summary

方法Method说明Description
public static DmScope defaultScope()
static
返回默认范围。
Default scope used when none is configured.

枚举常量详情Enum Constant Detail

MAIN

MAIN
staticfinal

执行主相关操作。

Performs the MAIN operation.

源码Source io/agentscope/harness/agent/gateway/channel/DmScope.java:32

PER_PEER

PER_PEER
staticfinal

执行每个对端相关操作。

Performs the PER PEER operation.

源码Source io/agentscope/harness/agent/gateway/channel/DmScope.java:33

PER_CHANNEL_PEER

PER_CHANNEL_PEER
staticfinal

执行每个渠道对端相关操作。

Performs the PER CHANNEL PEER operation.

源码Source io/agentscope/harness/agent/gateway/channel/DmScope.java:34

PER_ACCOUNT_CHANNEL_PEER

PER_ACCOUNT_CHANNEL_PEER
staticfinal

执行每个 ACCOUNT 渠道对端相关操作。

Performs the PER ACCOUNT CHANNEL PEER operation.

源码Source io/agentscope/harness/agent/gateway/channel/DmScope.java:35

方法详情Method Detail

defaultScope

public static DmScope defaultScope()
static

返回默认范围。

Default scope used when none is configured.

返回Returns DmScope
返回DmScope。Returns dm scope.
源码Source io/agentscope/harness/agent/gateway/channel/DmScope.java:38–40
基于官方固定版本源码静态生成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.